diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 4ea11efb3..fd9cca92a 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1059,7 +1059,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u { if (me && !me->isDead()) { - Unit::Kill(me, me); + me->KillSelf(); LOG_DEBUG("sql.sql", "SmartScript::ProcessAction: SMART_ACTION_DIE: Creature {}", me->GetGUID().ToString()); } break; diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 8e67412fc..e0d02fd23 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1548,6 +1548,7 @@ public: static void DealDamageMods(Unit const* victim, uint32& damage, uint32* absorb); static uint32 DealDamage(Unit* attacker, Unit* victim, uint32 damage, CleanDamage const* cleanDamage = nullptr, DamageEffectType damagetype = DIRECT_DAMAGE, SpellSchoolMask damageSchoolMask = SPELL_SCHOOL_MASK_NORMAL, SpellInfo const* spellProto = nullptr, bool durabilityLoss = true, bool allowGM = false, Spell const* spell = nullptr); static void Kill(Unit* killer, Unit* victim, bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const* spellProto = nullptr, Spell const* spell = nullptr); + void KillSelf(bool durabilityLoss = true, WeaponAttackType attackType = BASE_ATTACK, SpellInfo const* spellProto = nullptr, Spell const* spell = nullptr) { Kill(this, this, durabilityLoss, attackType, spellProto, spell); }; static int32 DealHeal(Unit* healer, Unit* victim, uint32 addhealth); static void ProcDamageAndSpell(Unit* actor, Unit* victim, uint32 procAttacker, uint32 procVictim, uint32 procEx, uint32 amount, WeaponAttackType attType = BASE_ATTACK, SpellInfo const* procSpellInfo = nullptr, SpellInfo const* procAura = nullptr, int8 procAuraEffectIndex = -1, Spell const* procSpell = nullptr, DamageInfo* damageInfo = nullptr, HealInfo* healInfo = nullptr, uint32 procPhase = 2 /*PROC_SPELL_PHASE_HIT*/); diff --git a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp index 213e1e107..c081def1d 100644 --- a/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp +++ b/src/server/scripts/EasternKingdoms/BlackrockMountain/BlackwingLair/boss_nefarian.cpp @@ -306,7 +306,7 @@ public: { summons.DespawnEntry(_nefarianLeftTunnel); summons.DespawnEntry(_nefarianRightTunnel); - Unit::Kill(me, me); + me->KillSelf(); } } diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp index 48e330bd1..ca23e547b 100644 --- a/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp +++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_midnight.cpp @@ -134,7 +134,7 @@ public: if (summon->GetEntry() == NPC_ATTUMEN_THE_HUNTSMAN_MOUNTED) { summons.clear(); - Unit::Kill(me, me); + me->KillSelf(); } } diff --git a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp index 3434fc8e8..3ec4fcff9 100644 --- a/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp +++ b/src/server/scripts/EasternKingdoms/MagistersTerrace/boss_felblood_kaelthas.cpp @@ -206,7 +206,7 @@ public: AttackStart(target); return; case EVENT_FINISH_TALK: - Unit::Kill(me, me); + me->KillSelf(); return; } diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp index b7abee1df..6e49ba093 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kalecgos.cpp @@ -263,7 +263,7 @@ public: break; case EVENT_TALK_GOOD_5: me->SetVisible(false); - Unit::Kill(me, me); + me->KillSelf(); break; case EVENT_TALK_BAD_1: me->SetReactState(REACT_PASSIVE); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp index 418ca14fd..f86154f7b 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_kiljaeden.cpp @@ -398,7 +398,7 @@ public: switch (events2.ExecuteEvent()) { case EVENT_KILL_SELF: - Unit::Kill(me, me); + me->KillSelf(); break; case EVENT_REBIRTH: me->SetVisible(true); diff --git a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp index 53a64bee3..887a5de02 100644 --- a/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp +++ b/src/server/scripts/EasternKingdoms/SunwellPlateau/boss_muru.cpp @@ -299,7 +299,7 @@ public: switch (events.ExecuteEvent()) { case EVENT_SINGULARITY_DEATH: - Unit::Kill(me, me); + me->KillSelf(); break; case EVENT_START_BLACK_HOLE: me->RemoveAurasDueToSpell(SPELL_BLACK_HOLE_SUMMON_VISUAL2); diff --git a/src/server/scripts/Events/brewfest.cpp b/src/server/scripts/Events/brewfest.cpp index 97925f44e..1e199af4c 100644 --- a/src/server/scripts/Events/brewfest.cpp +++ b/src/server/scripts/Events/brewfest.cpp @@ -733,7 +733,7 @@ struct npc_dark_iron_guzzler : public ScriptedAI if (me->IsAlive() && spellInfo->Id == SPELL_PLAYER_MUG) { me->CastSpell(me, SPELL_MUG_BOUNCE_BACK, true); - Unit::Kill(me, me); + me->KillSelf(); me->CastSpell(me, SPELL_REPORT_DEATH, true); } } @@ -795,7 +795,7 @@ struct npc_brewfest_super_brew_trigger : public ScriptedAI { player->CastSpell(player, SPELL_DRUNKEN_MASTER, true); me->RemoveAllGameObjects(); - Unit::Kill(me, me); + me->KillSelf(); } } } diff --git a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp index 60f2c7571..c20966aff 100644 --- a/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp +++ b/src/server/scripts/Kalimdor/TempleOfAhnQiraj/boss_viscidus.cpp @@ -362,7 +362,7 @@ struct boss_glob_of_viscidus : public ScriptedAI if (id == ROOM_CENTER) { DoCastSelf(SPELL_REJOIN_VISCIDUS); - Unit::Kill(me, me); + me->KillSelf(); } } diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp index cff5d065f..38edfc409 100644 --- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp +++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheChampion/trial_of_the_champion.cpp @@ -128,7 +128,7 @@ public: if (pInstance->GetData(DATA_INSTANCE_PROGRESS) < INSTANCE_PROGRESS_ARGENT_CHALLENGE_DIED) return; - Unit::Kill(me, me); // for bk scene, die after knockback + me->KillSelf(); // for bk scene, die after knockback } void UpdateAI(uint32 /*diff*/) override { } diff --git a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp index 61ae383a9..6f620f27f 100644 --- a/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp +++ b/src/server/scripts/Northrend/FrozenHalls/PitOfSaron/boss_krickandick.cpp @@ -450,7 +450,7 @@ public: } } me->setActive(false); - Unit::Kill(me, me); + me->KillSelf(); break; } diff --git a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp index d4bf957bc..ddd9bc8d2 100644 --- a/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp +++ b/src/server/scripts/Northrend/Gundrak/boss_drakkari_colossus.cpp @@ -170,7 +170,7 @@ public: { summons.Despawn(summon); if (summon->GetEntry() == NPC_DRAKKARI_ELEMENTAL) - Unit::Kill(me, me); + me->KillSelf(); } void SummonedCreatureDespawn(Creature* summon) override diff --git a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp index 9f07f1b80..83d13a0b2 100644 --- a/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp +++ b/src/server/scripts/Northrend/IcecrownCitadel/icecrown_citadel.cpp @@ -3566,7 +3566,7 @@ public: events.ScheduleEvent(EVENT_GAUNTLET_PHASE3, 0); } else - Unit::Kill(me, me); + me->KillSelf(); } } diff --git a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp index 1fbb3a7de..c62a456dd 100644 --- a/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp +++ b/src/server/scripts/Northrend/Ulduar/HallsOfStone/boss_sjonnir.cpp @@ -502,7 +502,7 @@ public: if ((*itr)->GetGUID() != me->GetGUID() && (*itr)->IsAlive() && me->IsAlive()) if (Creature* is = me->SummonCreature(NPC_IRON_SLUDGE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000)) { - Unit::Kill(me, me); + me->KillSelf(); Unit::Kill(*itr, *itr); is->SetInCombatWithZone(); break; diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp index fae50e043..6dc81c834 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_xt002.cpp @@ -760,7 +760,7 @@ public: data << uint32(SPELL_BOOM); me->SendMessageToSet(&data, false); - Unit::Kill(me, me); + me->KillSelf(); // Visual only seems to work if the instant kill event is delayed or the spell itself is delayed // Casting done from player and caster source has the same targetinfo flags, diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp index 2ab279cdd..b249aabab 100644 --- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp +++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_yoggsaron.cpp @@ -666,7 +666,7 @@ public: summons.DespawnEntry(NPC_FREYA_KEEPER); summons.DespawnEntry(NPC_THORIM_KEEPER); summons.DespawnEntry(NPC_SANITY_WELL); - Unit::Kill(me, me); + me->KillSelf(); return; } diff --git a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp index aa21ce401..3222ac5f4 100644 --- a/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp +++ b/src/server/scripts/Northrend/UtgardeKeep/UtgardeKeep/boss_keleseth.cpp @@ -104,10 +104,10 @@ public: if (Unit* p = ObjectAccessor::GetUnit(*me, PrisonerGUID)) { if( !p->HasAura(SPELL_FROST_TOMB_AURA) ) - Unit::Kill(me, me); + me->KillSelf(); } else - Unit::Kill(me, me); + me->KillSelf(); } } }; @@ -294,7 +294,7 @@ public: if( pInstance && pInstance->GetData(DATA_KELESETH) != IN_PROGRESS ) { if( me->IsAlive() ) - Unit::Kill(me, me); + me->KillSelf(); return; } diff --git a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp index 87272feb6..96b5bda34 100644 --- a/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp +++ b/src/server/scripts/Northrend/VioletHold/boss_zuramat.cpp @@ -246,7 +246,7 @@ public: if (s->IsAlive()) good = true; if (!good) - Unit::Kill(me, me); + me->KillSelf(); } else checkTimer -= diff; diff --git a/src/server/scripts/Northrend/zone_dragonblight.cpp b/src/server/scripts/Northrend/zone_dragonblight.cpp index a8aff815f..ed2a5db65 100644 --- a/src/server/scripts/Northrend/zone_dragonblight.cpp +++ b/src/server/scripts/Northrend/zone_dragonblight.cpp @@ -1435,7 +1435,7 @@ public: else if (a == -2) { me->CastSpell(me, SPELL_SAC_GHOUL_EXPLODE, true); - Unit::Kill(me, me); + me->KillSelf(); me->m_Events.KillAllEvents(true); Deactivate(); } diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index 83bf55bf6..a443c0bc0 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -391,7 +391,7 @@ public: else if (type == ESCORT_MOTION_TYPE && me->movespline->Finalized()) startPath = true; else if (type == EFFECT_MOTION_TYPE && pointId == me->GetEntry()) - Unit::Kill(me, me); + me->KillSelf(); } void DamageTaken(Unit* who, uint32& damage, DamageEffectType, SpellSchoolMask) override diff --git a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp index a81c518b0..44bf8eb37 100644 --- a/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp +++ b/src/server/scripts/Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp @@ -253,7 +253,7 @@ public: me->AddAura(DUNGEON_MODE(SPELL_EMPOWERING_SHADOWS_N, SPELL_EMPOWERING_SHADOWS_H), Vorpil); Vorpil->ModifyHealth(int32(Vorpil->CountPctFromMaxHealth(4))); me->CastSpell(me, SPELL_SHADOW_NOVA, true); - Unit::Kill(me, me); + me->KillSelf(); return; } diff --git a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp index 0ebafc214..fddebcb5d 100644 --- a/src/server/scripts/Outland/BlackTemple/illidari_council.cpp +++ b/src/server/scripts/Outland/BlackTemple/illidari_council.cpp @@ -205,7 +205,7 @@ public: if ((member = ObjectAccessor::GetCreature(*me, councilGUIDs[i]))) if (member->IsAlive()) Unit::Kill(me, member); - Unit::Kill(me, me); + me->KillSelf(); } } diff --git a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp index f63bbc8c4..0ae0558ba 100644 --- a/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp +++ b/src/server/scripts/Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp @@ -172,7 +172,7 @@ public: { if (Creature* kali = me->FindNearestCreature(NPC_WARLORD_KALITHRESH, 100.0f)) kali->CastSpell(kali, SPELL_WARLORDS_RAGE_PROC, true); - Unit::Kill(me, me); + me->KillSelf(); } } } diff --git a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp index 6a8c48374..908789f23 100644 --- a/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp +++ b/src/server/scripts/Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp @@ -121,7 +121,7 @@ public: } else if (summons.size() == 0) { - Unit::Kill(me, me); + me->KillSelf(); } } diff --git a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp index e6331c8bf..04c9139fe 100644 --- a/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp +++ b/src/server/scripts/Outland/TempestKeep/arcatraz/arcatraz.cpp @@ -340,7 +340,7 @@ public: { if (summon->GetEntry() == NPC_HARBINGER_SKYRISS) { - Unit::Kill(me, me); + me->KillSelf(); me->setActive(false); instance->SetBossState(DATA_WARDEN_MELLICHAR, DONE); if (Creature* creature = summons.GetCreatureWithEntry(NPC_MILLHOUSE)) diff --git a/src/server/scripts/Pet/pet_generic.cpp b/src/server/scripts/Pet/pet_generic.cpp index 904774be6..123dc6b13 100644 --- a/src/server/scripts/Pet/pet_generic.cpp +++ b/src/server/scripts/Pet/pet_generic.cpp @@ -640,7 +640,7 @@ struct npc_pet_gen_plump_turkey : public PassiveAI { if (type == EFFECT_MOTION_TYPE && id == 1) { - Unit::Kill(me, me); + me->KillSelf(); me->AddAura(SPELL_TURKEY_STARTS_TO_BURN, me); } } diff --git a/src/server/scripts/World/npcs_special.cpp b/src/server/scripts/World/npcs_special.cpp index 13b704f65..cd88b1eb8 100644 --- a/src/server/scripts/World/npcs_special.cpp +++ b/src/server/scripts/World/npcs_special.cpp @@ -444,7 +444,7 @@ public: { me->SetLootRecipient(me->GetOwner()); me->LowerPlayerDamageReq(me->GetMaxHealth()); - Unit::Kill(me, me); + me->KillSelf(); deathTimer = 600000; } else