fix(Core/Creature): Fire JustRespawned for non-compat spawns (#25482)
Co-authored-by: blinkysc <blinkysc@users.noreply.github.com> Co-authored-by: Treeston <treeston.mmoc@gmail.com>
This commit is contained in:
parent
589784baa0
commit
7cc967adc4
2 changed files with 9 additions and 4 deletions
|
|
@ -0,0 +1,5 @@
|
|||
-- Onslaught Knight (27206): Add On Evade -> Despawn
|
||||
-- Prevents ejected riders from piling up when warhorses respawn
|
||||
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 27206) AND (`source_type` = 0) AND (`id` IN (2));
|
||||
INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `event_param5`, `event_param6`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_param4`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES
|
||||
(27206, 0, 2, 0, 7, 0, 100, 512, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 'Onslaught Knight - On Evade - Despawn Instant');
|
||||
|
|
@ -284,7 +284,7 @@ Creature::Creature(): Unit(), MovableMapObject(), m_groupLootTimer(0), lootingGr
|
|||
m_CombatDistance = 0.0f;
|
||||
|
||||
ResetLootMode(); // restore default loot mode
|
||||
TriggerJustRespawned = false;
|
||||
TriggerJustRespawned = true;
|
||||
_focusSpell = nullptr;
|
||||
|
||||
m_respawnedTime = time_t(0);
|
||||
|
|
@ -705,12 +705,12 @@ bool Creature::UpdateEntry(uint32 Entry, const CreatureData* data, bool changele
|
|||
|
||||
void Creature::Update(uint32 diff)
|
||||
{
|
||||
if (IsAIEnabled && TriggerJustRespawned)
|
||||
if (IsAIEnabled && TriggerJustRespawned && getDeathState() != DeathState::Dead)
|
||||
{
|
||||
if (_respawnCompatibilityMode && m_vehicleKit)
|
||||
m_vehicleKit->Reset();
|
||||
TriggerJustRespawned = false;
|
||||
AI()->JustRespawned();
|
||||
if (m_vehicleKit)
|
||||
m_vehicleKit->Reset();
|
||||
}
|
||||
|
||||
switch (m_deathState)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue