Fix(Scripts/Spells): Check range to fire totem when casting Fire Nova. (#1566)
* Fix(Scripts/Spells): Check range to fire totem when casting Fire Nova.
This commit is contained in:
parent
26ae2ce2d6
commit
2e65c0afb7
1 changed files with 8 additions and 3 deletions
|
|
@ -821,13 +821,18 @@ class spell_sha_fire_nova : public SpellScriptLoader
|
|||
SpellCastResult CheckFireTotem()
|
||||
{
|
||||
// fire totem
|
||||
if (!GetCaster()->m_SummonSlot[1])
|
||||
Unit* caster = GetCaster();
|
||||
if (Creature* totem = caster->GetMap()->GetCreature(caster->m_SummonSlot[1]))
|
||||
{
|
||||
if (!caster->IsWithinDistInMap(totem, caster->GetSpellMaxRangeForTarget(totem, GetSpellInfo())))
|
||||
return SPELL_FAILED_OUT_OF_RANGE;
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCustomCastResultMessage(SPELL_CUSTOM_ERROR_MUST_HAVE_FIRE_TOTEM);
|
||||
return SPELL_FAILED_CUSTOM_ERROR;
|
||||
}
|
||||
|
||||
return SPELL_CAST_OK;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue