diff options
| author | joschiwald <joschiwald@online.de> | 2014-01-23 20:55:47 +0100 |
|---|---|---|
| committer | joschiwald <joschiwald@online.de> | 2014-01-23 20:55:47 +0100 |
| commit | d6c5307a819176dd1c8b2827b0a63c11bcb709c3 (patch) | |
| tree | 7f3ff9555ed36e2e24933407c61c44ca6c397dec /src/server/scripts/Spells | |
| parent | 30a7ea912d00d012bbca3230041fa806e2cab43e (diff) | |
Scripts/Spells: use new hook in some spellscripts
Diffstat (limited to 'src/server/scripts/Spells')
| -rw-r--r-- | src/server/scripts/Spells/spell_quest.cpp | 46 |
1 files changed, 20 insertions, 26 deletions
diff --git a/src/server/scripts/Spells/spell_quest.cpp b/src/server/scripts/Spells/spell_quest.cpp index 4dd06b762a1..cdf32bd94d5 100644 --- a/src/server/scripts/Spells/spell_quest.cpp +++ b/src/server/scripts/Spells/spell_quest.cpp @@ -1606,6 +1606,7 @@ class spell_q12527_zuldrak_rat : public SpellScriptLoader } }; +// 55368 - Summon Stefan class spell_q12661_q12669_q12676_q12677_q12713_summon_stefan : public SpellScriptLoader { public: @@ -1615,19 +1616,16 @@ class spell_q12661_q12669_q12676_q12677_q12713_summon_stefan : public SpellScrip { PrepareSpellScript(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan_SpellScript); - void ChangeSummonPos(SpellEffIndex /*effIndex*/) + void SetDest(SpellDestination& dest) { // Adjust effect summon position - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = { 0.0f, 0.0f, 20.0f, 0.0f }; - summonPos.RelocateOffset(offset); - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); + Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12661_q12669_q12676_q12677_q12713_summon_stefan_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK); } }; @@ -1723,6 +1721,7 @@ class spell_q13291_q13292_q13239_q13261_frostbrood_skytalon_grab_decoy : public } }; +// 59303 - Summon Frost Wyrm class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon : public SpellScriptLoader { public: @@ -1732,19 +1731,16 @@ class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon : public S { PrepareSpellScript(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript); - void ChangeSummonPos(SpellEffIndex /*effIndex*/) + void SetDest(SpellDestination& dest) { // Adjust effect summon position - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = { 0.0f, 0.0f, 20.0f, 0.0f }; - summonPos.RelocateOffset(offset); - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); + Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_BACK); } }; @@ -1754,6 +1750,7 @@ class spell_q13291_q13292_q13239_q13261_armored_decoy_summon_skytalon : public S } }; +// 12601 - Second Chances: Summon Landgren's Soul Moveto Target Bunny class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader { public: @@ -1763,19 +1760,16 @@ class spell_q12847_summon_soul_moveto_bunny : public SpellScriptLoader { PrepareSpellScript(spell_q12847_summon_soul_moveto_bunny_SpellScript); - void ChangeSummonPos(SpellEffIndex /*effIndex*/) + void SetDest(SpellDestination& dest) { // Adjust effect summon position - WorldLocation summonPos = *GetExplTargetDest(); - Position offset = { 0.0f, 0.0f, 2.5f, 0.0f }; - summonPos.RelocateOffset(offset); - SetExplTargetDest(summonPos); - GetHitDest()->RelocateOffset(offset); + Position const offset = { 0.0f, 0.0f, 2.5f, 0.0f }; + dest.RelocateOffset(offset); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_q12847_summon_soul_moveto_bunny_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12847_summon_soul_moveto_bunny_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER); } }; @@ -2012,19 +2006,19 @@ class spell_q12308_escape_from_silverbrook_summon_worgen : public SpellScriptLoa { PrepareSpellScript(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript); - void ModDest(SpellEffIndex effIndex) + void ModDest(SpellDestination& dest) { - float dist = GetSpellInfo()->Effects[effIndex].CalcRadius(GetCaster()); - float angle = (urand(0, 1) ? -1 : 1) * (frand(0.75f, 1.0f) * M_PI); + float dist = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster()); + float angle = frand(0.75f, 1.25f) * M_PI; Position pos; GetCaster()->GetNearPosition(pos, dist, angle); - GetHitDest()->Relocate(&pos); + dest.Relocate(pos); } void Register() OVERRIDE { - OnEffectHit += SpellEffectFn(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript::ModDest, EFFECT_0, SPELL_EFFECT_SUMMON); + OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q12308_escape_from_silverbrook_summon_worgen_SpellScript::ModDest, EFFECT_0, TARGET_DEST_CASTER_SUMMON); } }; |
