Scripts/Spells: use new hook in some spellscripts
This commit is contained in:
1 parent
30a7ea912d
commit
d6c5307a81
12 files changed
+59
-93
No files matched your search
@@ -233,10 +233,7 @@ public:
|
||||
|
||||
struct npc_lord_gregor_lescovarAI : public npc_escortAI
|
||||
{
|
||||
npc_lord_gregor_lescovarAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
creature->RestoreFaction();
|
||||
}
|
||||
npc_lord_gregor_lescovarAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
uint32 uiTimer;
|
||||
uint32 uiPhase;
|
||||
|
||||
@@ -61,13 +61,9 @@ enum GameObjectIds
|
||||
};
|
||||
|
||||
template<class AI>
|
||||
CreatureAI* GetRazorfenDownsAI(Creature* creature)
|
||||
AI* GetRazorfenDownsAI(Creature* creature)
|
||||
{
|
||||
if (InstanceMap* instance = creature->GetMap()->ToInstanceMap())
|
||||
if (instance->GetInstanceScript())
|
||||
if (instance->GetScriptId() == sObjectMgr->GetScriptId(RFDScriptName))
|
||||
return new AI(creature);
|
||||
return NULL;
|
||||
return GetInstanceAI<AI>(creature, RFDScriptName);
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -502,8 +502,6 @@ public:
|
||||
|
||||
//Added. Can be removed if its included in DB.
|
||||
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true);
|
||||
me->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0);
|
||||
me->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0);
|
||||
}
|
||||
|
||||
void CastSpellOnBug(Creature* target)
|
||||
|
||||
@@ -1697,6 +1697,7 @@ class spell_halion_twilight_phasing : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 74805 - Summon Exit Portals
|
||||
class spell_halion_summon_exit_portals : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -1706,23 +1707,22 @@ class spell_halion_summon_exit_portals : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_halion_summon_exit_portals_SpellScript);
|
||||
|
||||
void OnSummon(SpellEffIndex effIndex)
|
||||
void SetDest0(SpellDestination& dest)
|
||||
{
|
||||
WorldLocation summonPos = *GetExplTargetDest();
|
||||
Position offset = {0.0f, 20.0f, 0.0f, 0.0f};
|
||||
if (effIndex == EFFECT_1)
|
||||
offset.m_positionY = -20.0f;
|
||||
Position const offset = { 0.0f, 20.0f, 0.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
summonPos.RelocateOffset(offset);
|
||||
|
||||
SetExplTargetDest(summonPos);
|
||||
GetHitDest()->RelocateOffset(offset);
|
||||
void SetDest1(SpellDestination& dest)
|
||||
{
|
||||
Position const offset = { 0.0f, -20.0f, 0.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnEffectLaunch += SpellEffectFn(spell_halion_summon_exit_portals_SpellScript::OnSummon, EFFECT_0, SPELL_EFFECT_SUMMON_OBJECT_WILD);
|
||||
OnEffectLaunch += SpellEffectFn(spell_halion_summon_exit_portals_SpellScript::OnSummon, EFFECT_1, SPELL_EFFECT_SUMMON_OBJECT_WILD);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_halion_summon_exit_portals_SpellScript::SetDest0, EFFECT_0, TARGET_DEST_CASTER);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_halion_summon_exit_portals_SpellScript::SetDest1, EFFECT_1, TARGET_DEST_CASTER);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1492,6 +1492,7 @@ class spell_taldaram_ball_of_inferno_flame : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 72080 - Kinetic Bomb (Valanar)
|
||||
class spell_valanar_kinetic_bomb : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -1501,18 +1502,15 @@ class spell_valanar_kinetic_bomb : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_valanar_kinetic_bomb_SpellScript);
|
||||
|
||||
void ChangeSummonPos(SpellEffIndex /*effIndex*/)
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
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_valanar_kinetic_bomb_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_valanar_kinetic_bomb_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2034,6 +2034,7 @@ class spell_svalna_remove_spear : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 72585 - Soul Missile
|
||||
class spell_icc_soul_missile : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -2043,15 +2044,15 @@ class spell_icc_soul_missile : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_icc_soul_missile_SpellScript);
|
||||
|
||||
void RelocateDest()
|
||||
void RelocateDest(SpellDestination& dest)
|
||||
{
|
||||
static Position const offset = {0.0f, 0.0f, 200.0f, 0.0f};
|
||||
const_cast<WorldLocation*>(GetExplTargetDest())->RelocateOffset(offset);
|
||||
static Position const offset = { 0.0f, 0.0f, 200.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnCast += SpellCastFn(spell_icc_soul_missile_SpellScript::RelocateDest);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_icc_soul_missile_SpellScript::RelocateDest, EFFECT_0, TARGET_DEST_CASTER);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -2232,6 +2232,7 @@ class spell_alexstrasza_bunny_destroy_platform_event : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 56070 - Summon Red Dragon Buddy
|
||||
class spell_wyrmrest_skytalon_summon_red_dragon_buddy : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -2246,19 +2247,16 @@ class spell_wyrmrest_skytalon_summon_red_dragon_buddy : public SpellScriptLoader
|
||||
return GetCaster()->GetTypeId() == TYPEID_PLAYER;
|
||||
}
|
||||
|
||||
void ChangeSummonPos(SpellEffIndex /*effIndex*/)
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
// Adjust effect summon position to lower Z
|
||||
WorldLocation summonPos = *GetExplTargetDest();
|
||||
Position offset = { 0.0f, 0.0f, -80.0f, 0.0f };
|
||||
summonPos.RelocateOffset(offset);
|
||||
SetExplTargetDest(summonPos);
|
||||
GetHitDest()->RelocateOffset(offset);
|
||||
Position const offset = { 0.0f, 0.0f, -80.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_wyrmrest_skytalon_summon_red_dragon_buddy_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_wyrmrest_skytalon_summon_red_dragon_buddy_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_RADIUS);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -375,27 +375,16 @@ class spell_oculus_call_ruby_emerald_amber_drake : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_oculus_call_ruby_emerald_amber_drake_SpellScript);
|
||||
|
||||
void ChangeSummonPos(SpellEffIndex /*effIndex*/)
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
// Adjust effect summon position
|
||||
WorldLocation summonPos = *GetExplTargetDest();
|
||||
Position offset = { 0.0f, 0.0f, 12.0f, 0.0f };
|
||||
summonPos.RelocateOffset(offset);
|
||||
SetExplTargetDest(summonPos);
|
||||
GetHitDest()->RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void ModDestHeight(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
// Used to cast visual effect at proper position
|
||||
Position offset = { 0.0f, 0.0f, 12.0f, 0.0f };
|
||||
const_cast<WorldLocation*>(GetExplTargetDest())->RelocateOffset(offset);
|
||||
Position const offset = { 0.0f, 0.0f, 12.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnEffectHit += SpellEffectFn(spell_oculus_call_ruby_emerald_amber_drake_SpellScript::ChangeSummonPos, EFFECT_0, SPELL_EFFECT_SUMMON);
|
||||
OnEffectLaunch += SpellEffectFn(spell_oculus_call_ruby_emerald_amber_drake_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_oculus_call_ruby_emerald_amber_drake_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_FRONT);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1253,6 +1253,7 @@ class spell_algalon_remove_phase : public SpellScriptLoader
|
||||
}
|
||||
};
|
||||
|
||||
// 62295 - Cosmic Smash
|
||||
class spell_algalon_cosmic_smash : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
@@ -1262,16 +1263,15 @@ class spell_algalon_cosmic_smash : public SpellScriptLoader
|
||||
{
|
||||
PrepareSpellScript(spell_algalon_cosmic_smash_SpellScript);
|
||||
|
||||
void ModDestHeight(SpellEffIndex /*effIndex*/)
|
||||
void ModDestHeight(SpellDestination& dest)
|
||||
{
|
||||
Position offset = {0.0f, 0.0f, 65.0f, 0.0f};
|
||||
const_cast<WorldLocation*>(GetExplTargetDest())->RelocateOffset(offset);
|
||||
GetHitDest()->RelocateOffset(offset);
|
||||
Position const offset = { 0.0f, 0.0f, 65.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register() OVERRIDE
|
||||
{
|
||||
OnEffectLaunch += SpellEffectFn(spell_algalon_cosmic_smash_SpellScript::ModDestHeight, EFFECT_0, SPELL_EFFECT_SUMMON);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_algalon_cosmic_smash_SpellScript::ModDestHeight, EFFECT_0, TARGET_DEST_CASTER_SUMMON);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1359,10 +1359,7 @@ public:
|
||||
|
||||
struct npc_counselor_talbotAI : public ScriptedAI
|
||||
{
|
||||
npc_counselor_talbotAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
creature->RestoreFaction();
|
||||
}
|
||||
npc_counselor_talbotAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint64 leryssaGUID;
|
||||
uint64 arlosGUID;
|
||||
|
||||
@@ -20,8 +20,6 @@
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "Player.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellInfo.h"
|
||||
#include "SpellScript.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user