diff options
author | joschiwald <joschiwald@online.de> | 2013-09-06 20:57:38 +0200 |
---|---|---|
committer | joschiwald <joschiwald@online.de> | 2013-09-06 20:57:38 +0200 |
commit | adef15cd0f0b80d618fd7c0d9094f95940ab1c52 (patch) | |
tree | f9407d905d20013cdcdf7e0692856136750c2640 /src/server/scripts | |
parent | 46ffea86e3f4d7ccf9c402d1b3253e6981fe3f9c (diff) |
Core/Spells: add an other condition to SpellInfo::NeedsToBeTriggeredByCaster to correct spells with are wrongly triggered by target instead of caster
- convert archavons rock shards to spellscript (now it works properly)
- add a spellscript for one spell that can't be corrected by this (and delete the sai hack, now i uses the correct spell)
Diffstat (limited to 'src/server/scripts')
-rw-r--r-- | src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp | 52 | ||||
-rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 57 |
2 files changed, 108 insertions, 1 deletions
diff --git a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp index e44e0ab0539..e57bc8659d9 100644 --- a/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp +++ b/src/server/scripts/Northrend/VaultOfArchavon/boss_archavon.cpp @@ -27,9 +27,12 @@ enum Emotes enum Spells { - // Spells Archavon SPELL_ROCK_SHARDS = 58678, + SPELL_ROCK_SHARDS_VISUAL_L = 58689, + SPELL_ROCK_SHARDS_VISUAL_R = 58692, + SPELL_ROCK_SHARDS_DAMAGE_L = 58695, + SPELL_ROCK_SHARDS_DAMAGE_R = 58696, SPELL_CRUSHING_LEAP = 58960, SPELL_STOMP = 58663, SPELL_IMPALE = 58666, @@ -205,8 +208,55 @@ class npc_archavon_warder : public CreatureScript } }; +// 58941 - Rock Shards +class spell_archavon_rock_shards : public SpellScriptLoader +{ + public: + spell_archavon_rock_shards() : SpellScriptLoader("spell_archavon_rock_shards") { } + + class spell_archavon_rock_shards_SpellScript : public SpellScript + { + PrepareSpellScript(spell_archavon_rock_shards_SpellScript); + + bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE + { + if (!sSpellMgr->GetSpellInfo(SPELL_ROCK_SHARDS_VISUAL_L) + || !sSpellMgr->GetSpellInfo(SPELL_ROCK_SHARDS_VISUAL_R) + || !sSpellMgr->GetSpellInfo(SPELL_ROCK_SHARDS_DAMAGE_L) + || !sSpellMgr->GetSpellInfo(SPELL_ROCK_SHARDS_DAMAGE_R)) + return false; + return true; + } + + void HandleScript(SpellEffIndex /*effIndex*/) + { + Unit* caster = GetCaster(); + + for (uint8 i = 0; i < 3; ++i) + { + caster->CastSpell((Unit*)NULL, SPELL_ROCK_SHARDS_VISUAL_L, true); + caster->CastSpell((Unit*)NULL, SPELL_ROCK_SHARDS_VISUAL_R, true); + } + + caster->CastSpell((Unit*)NULL, SPELL_ROCK_SHARDS_DAMAGE_L, true); + caster->CastSpell((Unit*)NULL, SPELL_ROCK_SHARDS_DAMAGE_R, true); + } + + void Register() OVERRIDE + { + OnEffectHit += SpellEffectFn(spell_archavon_rock_shards_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_archavon_rock_shards_SpellScript(); + } +}; + void AddSC_boss_archavon() { new boss_archavon(); new npc_archavon_warder(); + new spell_archavon_rock_shards(); } diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 919046d3c38..4c4fc366d64 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -2105,6 +2105,61 @@ class spell_q12641_death_comes_from_on_high : public SpellScriptLoader } }; +// 51769 - Emblazon Runeblade +class spell_q12619_emblazon_runeblade : public SpellScriptLoader +{ + public: + spell_q12619_emblazon_runeblade() : SpellScriptLoader("spell_q12619_emblazon_runeblade") { } + + class spell_q12619_emblazon_runeblade_AuraScript : public AuraScript + { + PrepareAuraScript(spell_q12619_emblazon_runeblade_AuraScript); + + void HandleEffectPeriodic(AuraEffect const* aurEff) + { + PreventDefaultAction(); + GetCaster()->CastSpell(GetCaster(), GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true); + } + + void Register() OVERRIDE + { + OnEffectPeriodic += AuraEffectPeriodicFn(spell_q12619_emblazon_runeblade_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_HEAL); + } + }; + + AuraScript* GetAuraScript() const OVERRIDE + { + return new spell_q12619_emblazon_runeblade_AuraScript(); + } +}; + +// 51770 - Emblazon Runeblade +class spell_q12619_emblazon_runeblade_effect : public SpellScriptLoader +{ + public: + spell_q12619_emblazon_runeblade_effect() : SpellScriptLoader("spell_q12619_emblazon_runeblade_effect") { } + + class spell_q12619_emblazon_runeblade_effect_SpellScript : public SpellScript + { + PrepareSpellScript(spell_q12619_emblazon_runeblade_effect_SpellScript); + + void HandleScript(SpellEffIndex /*effIndex*/) + { + GetCaster()->CastSpell(GetCaster(), uint32(GetEffectValue()), true); + } + + void Register() OVERRIDE + { + OnEffectHit += SpellEffectFn(spell_q12619_emblazon_runeblade_effect_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT); + } + }; + + SpellScript* GetSpellScript() const OVERRIDE + { + return new spell_q12619_emblazon_runeblade_effect_SpellScript(); + } +}; + void AddSC_quest_spell_scripts() { new spell_q55_sacred_cleansing(); @@ -2155,4 +2210,6 @@ void AddSC_quest_spell_scripts() new spell_q12308_escape_from_silverbrook_summon_worgen(); new spell_q12308_escape_from_silverbrook(); new spell_q12641_death_comes_from_on_high(); + new spell_q12619_emblazon_runeblade(); + new spell_q12619_emblazon_runeblade_effect(); } |