diff options
| author | vincent-michael <Vincent_Michael@gmx.de> | 2012-02-18 21:18:02 +0000 |
|---|---|---|
| committer | Nay <dnpd.dd@gmail.com> | 2012-02-18 21:18:02 +0000 |
| commit | 34a41d01521464a1734c576950af4ae96f9e887b (patch) | |
| tree | f62914113037a30bbe092a9aca86b9f858234809 /src/server/scripts | |
| parent | f87da6d6643c8e1eb63c572a4869933fb1db966c (diff) | |
Scripts/Spells: Use correct spell and fix crash in spell_item_impale_leviroth
Diffstat (limited to 'src/server/scripts')
| -rw-r--r-- | src/server/scripts/Spells/spell_item.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/server/scripts/Spells/spell_item.cpp b/src/server/scripts/Spells/spell_item.cpp index 4f0c389825e..5343bfbaf5e 100644 --- a/src/server/scripts/Spells/spell_item.cpp +++ b/src/server/scripts/Spells/spell_item.cpp @@ -1504,7 +1504,8 @@ class spell_item_complete_raptor_capture : public SpellScriptLoader enum ImpaleLeviroth { - NPC_LEVIROTH = 26452, + NPC_LEVIROTH = 26452, + SPELL_LEVIROTH_SELF_IMPALE = 49882 }; class spell_item_impale_leviroth : public SpellScriptLoader @@ -1516,11 +1517,6 @@ class spell_item_impale_leviroth : public SpellScriptLoader { PrepareSpellScript(spell_item_impale_leviroth_SpellScript); - bool Load() - { - return GetHitCreature()->GetEntry() == NPC_LEVIROTH; - } - bool Validate(SpellInfo const* /*spell*/) { if (!sObjectMgr->GetCreatureTemplate(NPC_LEVIROTH)) @@ -1530,10 +1526,11 @@ class spell_item_impale_leviroth : public SpellScriptLoader void HandleDummy(SpellEffIndex /* effIndex */) { - Unit* caster = GetCaster(); - if (Unit* target = GetHitCreature()) - if (target->HealthBelowPct(95)) - caster->DealDamage(target, target->CountPctFromMaxHealth(93)); + Unit* target = GetHitCreature(); + if (!target || target->GetEntry() != NPC_LEVIROTH || !target->HealthBelowPct(95)) + return; + + target->CastSpell(target, SPELL_LEVIROTH_SELF_IMPALE, true); } void Register() |
