Core/Script: Add spellscript for Earthbind totem spell (patch by Socolin)

--HG--
branch : trunk
This commit is contained in:
click
2010-11-17 00:05:20 +01:00
parent c1614bc0f3
commit 8806a3efdb
3 changed files with 47 additions and 1 deletions
+1
View File
@@ -26960,6 +26960,7 @@ INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES
-- shaman -- shaman
( 39610, 'spell_sha_mana_tide_totem'), ( 39610, 'spell_sha_mana_tide_totem'),
( -1535, 'spell_sha_fire_nova'), ( -1535, 'spell_sha_fire_nova'),
( 6474, 'spell_sha_earthbind_totem'),
-- mage -- mage
(-11113, 'spell_mage_blast_wave'), (-11113, 'spell_mage_blast_wave'),
( 11958, 'spell_mage_cold_snap'), ( 11958, 'spell_mage_cold_snap'),
@@ -0,0 +1 @@
INSERT INTO `spell_script_names` (`spell_id`,`ScriptName`) VALUES (6474, 'spell_sha_earthbind_totem');
+45 -1
View File
@@ -29,7 +29,11 @@ enum ShamanSpells
SHAMAN_SPELL_GLYPH_OF_MANA_TIDE = 55441, SHAMAN_SPELL_GLYPH_OF_MANA_TIDE = 55441,
SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609, SHAMAN_SPELL_MANA_TIDE_TOTEM = 39609,
SHAMAN_SPELL_FIRE_NOVA_R1 = 1535, 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 // 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() void AddSC_shaman_spell_scripts()
{ {
new spell_sha_fire_nova(); new spell_sha_fire_nova();
new spell_sha_mana_tide_totem(); new spell_sha_mana_tide_totem();
new spell_sha_earthbind_totem();
} }