aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-01-24 22:51:42 +0100
committerShauren <shauren.trinity@gmail.com>2013-01-24 22:51:42 +0100
commit705d0c88657e04ee0b4610e2f40ba9378228d670 (patch)
tree7db73f83203c927d55eb1a72a768d916565f69b8
parent1c7ade5e54454d285c843e633f69b911a1d81fb9 (diff)
Scripts/Icecrown Citadel: Fixed possible crash with Bone Spike Graveyard
Closes #7171
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
index e751ec2bd7b..4763896cf72 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_lord_marrowgar.cpp
@@ -53,7 +53,7 @@ enum Spells
SPELL_COLDFLAME_SUMMON = 69147,
};
-uint32 const boneSpikeSummonId[3] = {69062, 72669, 72670};
+uint32 const BoneSpikeSummonId[3] = {69062, 72669, 72670};
enum Events
{
@@ -515,6 +515,20 @@ class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader
{
PrepareSpellScript(spell_marrowgar_bone_spike_graveyard_SpellScript);
+ bool Validate(SpellInfo const* /*spell*/)
+ {
+ for (uint32 i = 0; i < 3; ++i)
+ if (!sSpellMgr->GetSpellInfo(BoneSpikeSummonId[i]))
+ return false;
+
+ return true;
+ }
+
+ bool Load()
+ {
+ return GetCaster()->GetTypeId() == TYPEID_UNIT && GetCaster()->IsAIEnabled;
+ }
+
SpellCastResult CheckCast()
{
return GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_TOPAGGRO, 1, 0.0f, true, -SPELL_IMPALED) ? SPELL_CAST_OK : SPELL_FAILED_NO_VALID_TARGETS;
@@ -536,7 +550,7 @@ class spell_marrowgar_bone_spike_graveyard : public SpellScriptLoader
break;
didHit = true;
- target->CastCustomSpell(boneSpikeSummonId[i], SPELLVALUE_BASE_POINT0, 0, target, true);
+ target->CastCustomSpell(BoneSpikeSummonId[i], SPELLVALUE_BASE_POINT0, 0, target, true);
}
if (didHit)