Core/Script: Add spellscript for Earthbind totem spell (patch by Socolin)
--HG-- branch : trunk
This commit is contained in:
@@ -29,7 +29,11 @@ enum ShamanSpells
|
||||
SHAMAN_SPELL_GLYPH_OF_MANA_TIDE = 55441,
|
||||
SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609,
|
||||
SHAMAN_SPELL_FIRE_NOVA_R1 = 1535,
|
||||
SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349
|
||||
SHAMAN_SPELL_FIRE_NOVA_TRIGGERED_R1 = 8349,
|
||||
|
||||
//For Earthen Power
|
||||
SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM = 6474, //Spell casted by totem
|
||||
SHAMAN_TOTEM_SPELL_EARTHEN_POWER = 59566,//Spell witch remove snare effect
|
||||
};
|
||||
|
||||
// 1535 Fire Nova
|
||||
@@ -131,8 +135,48 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
// 6474 - Earthbind Totem - Fix Talent:Earthen Power
|
||||
class spell_sha_earthbind_totem : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_sha_earthbind_totem() : SpellScriptLoader("spell_sha_earthbind_totem") { }
|
||||
|
||||
class spell_sha_earthbind_totem_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_sha_earthbind_totem_AuraScript);
|
||||
|
||||
bool Validate(SpellEntry const * /*spellEntry*/)
|
||||
{
|
||||
if (!sSpellStore.LookupEntry(SHAMAN_TOTEM_SPELL_EARTHBIND_TOTEM))
|
||||
return false;
|
||||
if (!sSpellStore.LookupEntry(SHAMAN_TOTEM_SPELL_EARTHEN_POWER))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * aurEff, AuraApplication const * aurApp)
|
||||
{
|
||||
if (Unit* target = aurApp->GetTarget())
|
||||
if (Unit *caster = aurEff->GetBase()->GetCaster())
|
||||
if (AuraEffect* aur = caster->GetDummyAuraEffect(SPELLFAMILY_SHAMAN, 2289, 0))
|
||||
if (roll_chance_i(aur->GetBaseAmount()))
|
||||
target->CastSpell(target, SHAMAN_TOTEM_SPELL_EARTHEN_POWER, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_sha_earthbind_totem_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
{
|
||||
return new spell_sha_earthbind_totem_AuraScript();
|
||||
}
|
||||
};
|
||||
void AddSC_shaman_spell_scripts()
|
||||
{
|
||||
new spell_sha_fire_nova();
|
||||
new spell_sha_mana_tide_totem();
|
||||
new spell_sha_earthbind_totem();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user