mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[7009] Fixed spell 6991 work.
Also fix max power limits in some miscvalue checks.
This commit is contained in:
parent
dc8649a86a
commit
c88dfbccb3
4 changed files with 18 additions and 13 deletions
|
|
@ -2688,6 +2688,8 @@ void Spell::EffectEnergize(uint32 i)
|
|||
if(m_spellInfo->EffectMiscValue[i] < 0 || m_spellInfo->EffectMiscValue[i] >= MAX_POWERS)
|
||||
return;
|
||||
|
||||
Powers power = Powers(m_spellInfo->EffectMiscValue[i]);
|
||||
|
||||
// Some level depends spells
|
||||
int multiplier = 0;
|
||||
int level_diff = 0;
|
||||
|
|
@ -2718,8 +2720,6 @@ void Spell::EffectEnergize(uint32 i)
|
|||
if(damage < 0)
|
||||
return;
|
||||
|
||||
Powers power = Powers(m_spellInfo->EffectMiscValue[i]);
|
||||
|
||||
if(unitTarget->GetMaxPower(power) == 0)
|
||||
return;
|
||||
|
||||
|
|
@ -5402,7 +5402,8 @@ void Spell::EffectFeedPet(uint32 i)
|
|||
|
||||
Player *_player = (Player*)m_caster;
|
||||
|
||||
if(!itemTarget)
|
||||
Item* foodItem = m_targets.getItemTarget();
|
||||
if(!foodItem)
|
||||
return;
|
||||
|
||||
Pet *pet = _player->GetPet();
|
||||
|
|
@ -5412,15 +5413,15 @@ void Spell::EffectFeedPet(uint32 i)
|
|||
if(!pet->isAlive())
|
||||
return;
|
||||
|
||||
int32 benefit = pet->GetCurrentFoodBenefitLevel(itemTarget->GetProto()->ItemLevel);
|
||||
int32 benefit = pet->GetCurrentFoodBenefitLevel(foodItem->GetProto()->ItemLevel);
|
||||
if(benefit <= 0)
|
||||
return;
|
||||
|
||||
uint32 count = 1;
|
||||
_player->DestroyItemCount(itemTarget,count,true);
|
||||
_player->DestroyItemCount(foodItem,count,true);
|
||||
// TODO: fix crash when a spell has two effects, both pointed at the same item target
|
||||
|
||||
m_caster->CastCustomSpell(m_caster,m_spellInfo->EffectTriggerSpell[i],&benefit,NULL,NULL,true);
|
||||
m_caster->CastCustomSpell(pet,m_spellInfo->EffectTriggerSpell[i],&benefit,NULL,NULL,true);
|
||||
}
|
||||
|
||||
void Spell::EffectDismissPet(uint32 /*i*/)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue