Scripts/Icecrown Citadel: Fixed possible crash with Bone Spike Graveyard

Closes #7171
This commit is contained in:
Shauren
2013-01-24 22:51:42 +01:00
parent 1c7ade5e54
commit 705d0c8865

View File

@@ -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)