Scripts/Spells: Fixed target of visual polymorph in Silvermoon city
This commit is contained in:
@@ -123,6 +123,12 @@ class spell_mage_cold_snap : public SpellScriptLoader
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum SilvermoonPolymorph
|
||||||
|
{
|
||||||
|
NPC_AUROSALIA = 18744,
|
||||||
|
};
|
||||||
|
|
||||||
|
// TODO: move out of here and rename - not a mage spell
|
||||||
class spell_mage_polymorph_cast_visual : public SpellScriptLoader
|
class spell_mage_polymorph_cast_visual : public SpellScriptLoader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -132,22 +138,22 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader
|
|||||||
{
|
{
|
||||||
PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript);
|
PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript);
|
||||||
|
|
||||||
static const uint32 spell_list[6];
|
static const uint32 PolymorhForms[6];
|
||||||
|
|
||||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||||
{
|
{
|
||||||
// check if spell ids exist in dbc
|
// check if spell ids exist in dbc
|
||||||
for (int i = 0; i < 6; i++)
|
for (uint32 i = 0; i < 6; i++)
|
||||||
if (!sSpellMgr->GetSpellInfo(spell_list[i]))
|
if (!sSpellMgr->GetSpellInfo(PolymorhForms[i]))
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||||
{
|
{
|
||||||
if (Unit* unitTarget = GetHitUnit())
|
if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f))
|
||||||
if (unitTarget->GetTypeId() == TYPEID_UNIT)
|
if (target->GetTypeId() == TYPEID_UNIT)
|
||||||
unitTarget->CastSpell(unitTarget, spell_list[urand(0, 5)], true);
|
target->CastSpell(target, PolymorhForms[urand(0, 5)], true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Register()
|
void Register()
|
||||||
@@ -163,7 +169,7 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::spell_list[6] =
|
const uint32 spell_mage_polymorph_cast_visual::spell_mage_polymorph_cast_visual_SpellScript::PolymorhForms[6] =
|
||||||
{
|
{
|
||||||
SPELL_MAGE_SQUIRREL_FORM,
|
SPELL_MAGE_SQUIRREL_FORM,
|
||||||
SPELL_MAGE_GIRAFFE_FORM,
|
SPELL_MAGE_GIRAFFE_FORM,
|
||||||
|
|||||||
Reference in New Issue
Block a user