Scripts/Spells: use new hook in some spellscripts

This commit is contained in:
joschiwald committed 2014-01-23 20:55:47 +01:00
1 parent 30a7ea912d
commit d6c5307a81
12 files changed
+59 -93

No files matched your search

+20 -26
View File
@@ -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);
}
};