mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 23:56:25 +00:00
feat(Core/Unit): Add KillSelf overload (#14785)
Co-authored-by: jackpoz <giacomopoz@gmail.com>
This commit is contained in:
@@ -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 { }
|
||||
|
||||
@@ -450,7 +450,7 @@ public:
|
||||
}
|
||||
}
|
||||
me->setActive(false);
|
||||
Unit::Kill(me, me);
|
||||
me->KillSelf();
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3566,7 +3566,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_GAUNTLET_PHASE3, 0);
|
||||
}
|
||||
else
|
||||
Unit::Kill(me, me);
|
||||
me->KillSelf();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
if (s->IsAlive())
|
||||
good = true;
|
||||
if (!good)
|
||||
Unit::Kill(me, me);
|
||||
me->KillSelf();
|
||||
}
|
||||
else
|
||||
checkTimer -= diff;
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user