fix(DB/Creature): Fix ZA bosses not despawning on evade (#20900)
This commit is contained in:
@@ -0,0 +1,2 @@
|
|||||||
|
--
|
||||||
|
UPDATE `creature_template` SET `flags_extra` = `flags_extra`|2147483648 WHERE `entry` IN (23574, 23578, 24239);
|
||||||
@@ -15,6 +15,7 @@
|
|||||||
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
* with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "CreatureGroups.h"
|
||||||
#include "CreatureScript.h"
|
#include "CreatureScript.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
#include "ScriptedCreature.h"
|
#include "ScriptedCreature.h"
|
||||||
@@ -144,6 +145,9 @@ struct boss_zuljin : public BossAI
|
|||||||
me->SetCombatMovement(true);
|
me->SetCombatMovement(true);
|
||||||
me->m_Events.KillAllEvents(false);
|
me->m_Events.KillAllEvents(false);
|
||||||
_nextPhase = 0;
|
_nextPhase = 0;
|
||||||
|
|
||||||
|
if (CreatureGroup* formation = me->GetFormation())
|
||||||
|
formation->RespawnFormation(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void JustEngagedWith(Unit* /*who*/) override
|
void JustEngagedWith(Unit* /*who*/) override
|
||||||
@@ -239,6 +243,21 @@ struct boss_zuljin : public BossAI
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||||
|
{
|
||||||
|
if (CreatureGroup* formation = me->GetFormation())
|
||||||
|
{
|
||||||
|
for (auto const& itr : formation->GetMembers())
|
||||||
|
{
|
||||||
|
if (itr.first && itr.first != me)
|
||||||
|
itr.first->DespawnOnEvade(2min);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
me->DespawnOnEvade(2min);
|
||||||
|
_EnterEvadeMode();
|
||||||
|
}
|
||||||
|
|
||||||
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
|
void SpellHitTarget(Unit* target, SpellInfo const* spellInfo) override
|
||||||
{
|
{
|
||||||
if (spellInfo->Id == SPELL_CLAW_RAGE_CHARGE && target != me)
|
if (spellInfo->Id == SPELL_CLAW_RAGE_CHARGE && target != me)
|
||||||
|
|||||||
Reference in New Issue
Block a user