aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoschiwald <joschiwald.trinity@gmail.com>2017-10-03 13:40:03 +0200
committerjoschiwald <joschiwald.trinity@gmail.com>2017-10-03 13:40:03 +0200
commit3106b8b33390d1810c06169505f7d51561bbe0cc (patch)
treeb6324e12fc93d6a304fe19a2dda839d27ca66489
parent25111b09dfaa7270f7b34a0973d9b6375cbb8cd2 (diff)
Scripts/AQ20: Fixed crash in npc_buru_egg and removed hack in spell_egg_explosion
-rw-r--r--src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
index 88097b1ec30..e0567a68e6f 100644
--- a/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
+++ b/src/server/scripts/Kalimdor/RuinsOfAhnQiraj/boss_buru.cpp
@@ -37,8 +37,8 @@ enum Spells
SPELL_THORNS = 25640,
SPELL_BURU_TRANSFORM = 24721,
SPELL_SUMMON_HATCHLING = 1881,
- SPELL_EXPLODE = 19593,
- SPELL_EXPLODE_2 = 5255,
+ SPELL_EGG_EXPLOSION = 19593,
+ SPELL_EXPLOSION_DAMAGE = 5255,
SPELL_BURU_EGG_TRIGGER = 26646
};
@@ -225,9 +225,8 @@ class npc_buru_egg : public CreatureScript
void JustDied(Unit* /*killer*/) override
{
- DoCastAOE(SPELL_EXPLODE, true);
- DoCastAOE(SPELL_EXPLODE_2, true); // Unknown purpose
- DoCast(me, SPELL_SUMMON_HATCHLING, true);
+ DoCastAOE(SPELL_EGG_EXPLOSION, true);
+ DoCastAOE(SPELL_SUMMON_HATCHLING, true);
if (Creature* buru = ObjectAccessor::GetCreature(*me, _instance->GetGuidData(DATA_BURU)))
if (boss_buru::boss_buruAI* buruAI = dynamic_cast<boss_buru::boss_buruAI*>(buru->AI()))
@@ -243,6 +242,7 @@ class npc_buru_egg : public CreatureScript
}
};
+// 19593 - Egg Explosion
class spell_egg_explosion : public SpellScriptLoader
{
public:
@@ -261,7 +261,10 @@ class spell_egg_explosion : public SpellScriptLoader
void HandleDummyHitTarget(SpellEffIndex /*effIndex*/)
{
if (Unit* target = GetHitUnit())
- GetCaster()->DealDamage(target, -16 * GetCaster()->GetDistance(target) + 500);
+ {
+ int32 damage = std::max<int32>(0, -16 * GetCaster()->GetDistance(target) + 500);
+ GetCaster()->CastCustomSpell(SPELL_EXPLOSION_DAMAGE, SPELLVALUE_BASE_POINT0, damage, target, true);
+ }
}
void Register() override