fix(Core/TemporarySummon): Implement TEMPSUMMON_TIMED_DESPAWN_OOC_ALIVE (#9915)

This commit is contained in:
Noxies
2021-12-30 12:05:46 +01:00
committed by GitHub
parent ea2e24f31b
commit bbf08c1aaa
3 changed files with 19 additions and 2 deletions

View File

@@ -104,7 +104,23 @@ void TempSummon::Update(uint32 diff)
break;
}
case TEMPSUMMON_TIMED_DESPAWN_OOC_ALIVE:
{
if (!IsInCombat() && m_deathState != CORPSE)
{
if (m_timer <= diff)
{
UnSummon();
return;
}
m_timer -= diff;
}
else if (m_timer != m_lifetime)
m_timer = m_lifetime;
break;
}
case TEMPSUMMON_CORPSE_TIMED_DESPAWN:
{
if (m_deathState == CORPSE)

View File

@@ -46,6 +46,7 @@ enum TempSummonType
TEMPSUMMON_DEAD_DESPAWN = 7, // despawns when the creature disappears
TEMPSUMMON_MANUAL_DESPAWN = 8, // despawns when UnSummon() is called
TEMPSUMMON_DESPAWNED = 9, // xinef: DONT USE, INTERNAL USE ONLY
TEMPSUMMON_TIMED_DESPAWN_OOC_ALIVE = 10, // despawns after a specified time after the creature is out of combat and alive
};
enum PhaseMasks