mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
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
|
||||
{
|
||||
public:
|
||||
@@ -132,22 +138,22 @@ class spell_mage_polymorph_cast_visual : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_mage_polymorph_cast_visual_SpellScript);
|
||||
|
||||
static const uint32 spell_list[6];
|
||||
static const uint32 PolymorhForms[6];
|
||||
|
||||
bool Validate(SpellInfo const* /*spellEntry*/)
|
||||
{
|
||||
// check if spell ids exist in dbc
|
||||
for (int i = 0; i < 6; i++)
|
||||
if (!sSpellMgr->GetSpellInfo(spell_list[i]))
|
||||
for (uint32 i = 0; i < 6; i++)
|
||||
if (!sSpellMgr->GetSpellInfo(PolymorhForms[i]))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* unitTarget = GetHitUnit())
|
||||
if (unitTarget->GetTypeId() == TYPEID_UNIT)
|
||||
unitTarget->CastSpell(unitTarget, spell_list[urand(0, 5)], true);
|
||||
if (Unit* target = GetCaster()->FindNearestCreature(NPC_AUROSALIA, 30.0f))
|
||||
if (target->GetTypeId() == TYPEID_UNIT)
|
||||
target->CastSpell(target, PolymorhForms[urand(0, 5)], true);
|
||||
}
|
||||
|
||||
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_GIRAFFE_FORM,
|
||||
|
||||
Reference in New Issue
Block a user