feat(Core/Unit): Add KillSelf overload (#14785)

Co-authored-by: jackpoz <giacomopoz@gmail.com>
This commit is contained in:
Skjalf
2023-01-28 17:57:23 -03:00
committed by GitHub
parent 6ae8ffa8e6
commit b4e3f1310b
28 changed files with 31 additions and 30 deletions

View File

@@ -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 { }

View File

@@ -450,7 +450,7 @@ public:
}
}
me->setActive(false);
Unit::Kill(me, me);
me->KillSelf();
break;
}

View File

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

View File

@@ -3566,7 +3566,7 @@ public:
events.ScheduleEvent(EVENT_GAUNTLET_PHASE3, 0);
}
else
Unit::Kill(me, me);
me->KillSelf();
}
}

View File

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

View File

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

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -246,7 +246,7 @@ public:
if (s->IsAlive())
good = true;
if (!good)
Unit::Kill(me, me);
me->KillSelf();
}
else
checkTimer -= diff;

View File

@@ -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();
}

View File

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