mirror of
https://github.com/liyunfan1223/azerothcore-wotlk.git
synced 2026-08-04 13:57:52 +00:00
fix(Scripts/Ulduar): Auriaya spawn and Sanctum Sentry formation (#26631)
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
-- Auriaya and Sanctum Sentry: DB-based spawns and creature_formations
|
||||
SET @CGUID := 137532;
|
||||
SET @AURI := 137496;
|
||||
SET @X := 1938.7361;
|
||||
SET @Y := 42.06429;
|
||||
SET @Z := 411.5189;
|
||||
SET @O := 1.818165;
|
||||
|
||||
-- Update Auriaya's spawn to sniff position
|
||||
UPDATE `creature` SET `position_x` = @X, `position_y` = @Y, `position_z` = @Z, `orientation` = @O WHERE `id` = 33515 AND `guid` = @AURI;
|
||||
|
||||
-- Add Sanctum Sentry spawns (10-man: 2 sentries, 25-man: 4 sentries)
|
||||
DELETE FROM `creature` WHERE `id` = 34014 AND `map` = 603;
|
||||
INSERT INTO `creature` (`guid`, `id`, `map`, `zoneId`, `areaId`, `spawnMask`, `phaseMask`, `equipment_id`, `position_x`, `position_y`, `position_z`, `orientation`, `spawntimesecs`, `wander_distance`, `MovementType`, `ScriptName`, `Comment`, `VerifiedBuild`) VALUES
|
||||
-- 10-man sentries
|
||||
(@CGUID+0, 34014, 603, 0, 0, 1, 1, 0, @X, @Y, @Z, @O, 604800, 0, 0, '', 'Sanctum Sentry - follows Auriaya', 0),
|
||||
(@CGUID+1, 34014, 603, 0, 0, 1, 1, 0, @X, @Y, @Z, @O, 604800, 0, 0, '', 'Sanctum Sentry - follows Auriaya', 0),
|
||||
-- 25-man sentries
|
||||
(@CGUID+2, 34014, 603, 0, 0, 2, 1, 0, @X, @Y, @Z, @O, 604800, 0, 0, '', 'Sanctum Sentry - follows Auriaya', 0),
|
||||
(@CGUID+3, 34014, 603, 0, 0, 2, 1, 0, @X, @Y, @Z, @O, 604800, 0, 0, '', 'Sanctum Sentry - follows Auriaya', 0),
|
||||
(@CGUID+4, 34014, 603, 0, 0, 2, 1, 0, @X, @Y, @Z, @O, 604800, 0, 0, '', 'Sanctum Sentry - follows Auriaya', 0),
|
||||
(@CGUID+5, 34014, 603, 0, 0, 2, 1, 0, @X, @Y, @Z, @O, 604800, 0, 0, '', 'Sanctum Sentry - follows Auriaya', 0);
|
||||
|
||||
-- Set creature_formations: sentries follow Auriaya
|
||||
DELETE FROM `creature_formations` WHERE `leaderGUID` = 137496;
|
||||
INSERT INTO `creature_formations` (`leaderGUID`, `memberGUID`, `dist`, `angle`, `groupAI`, `point_1`, `point_2`) VALUES
|
||||
(@AURI, @AURI, 0, 0, 2, 0, 0),
|
||||
-- 10-man sentries
|
||||
(@AURI, @CGUID+0, 7.0, 166, 519, 0, 0),
|
||||
(@AURI, @CGUID+1, 7.0, 194, 519, 0, 0),
|
||||
-- 25-man sentries
|
||||
(@AURI, @CGUID+2, 7.0, 166, 519, 0, 0),
|
||||
(@AURI, @CGUID+3, 7.0, 194, 519, 0, 0),
|
||||
(@AURI, @CGUID+4, 12.0, 204, 519, 0, 0),
|
||||
(@AURI, @CGUID+5, 12.0, 152, 519, 0, 0);
|
||||
@@ -17,6 +17,7 @@
|
||||
|
||||
#include "AchievementCriteriaScript.h"
|
||||
#include "CreatureScript.h"
|
||||
#include "CreatureGroups.h"
|
||||
#include "Player.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
@@ -90,6 +91,7 @@ enum Misc
|
||||
ACTION_FERAL_DEATH = 2,
|
||||
ACTION_DESPAWN_ADDS = 3,
|
||||
ACTION_FERAL_DEATH_WITH_STACK = 4,
|
||||
ACTION_SENTRY_DEATH = 5,
|
||||
|
||||
DATA_CRAZY_CAT = 10,
|
||||
DATA_NINE_LIVES = 11,
|
||||
@@ -102,6 +104,19 @@ struct boss_auriaya : public BossAI
|
||||
bool _feralDied{false};
|
||||
bool _nineLives{false};
|
||||
|
||||
void DespawnFormationMembers(bool onEvade = false)
|
||||
{
|
||||
if (CreatureGroup* formation = me->GetFormation())
|
||||
for (auto const& [member, info] : formation->GetMembers())
|
||||
if (member && member != me)
|
||||
{
|
||||
if (onEvade)
|
||||
member->DespawnOnEvade();
|
||||
else
|
||||
member->DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_feralDied = false;
|
||||
@@ -110,10 +125,10 @@ struct boss_auriaya : public BossAI
|
||||
EntryCheckPredicate pred(NPC_FERAL_DEFENDER);
|
||||
summons.DoAction(ACTION_DESPAWN_ADDS, pred);
|
||||
|
||||
BossAI::Reset();
|
||||
if (me->IsInEvadeMode())
|
||||
DespawnFormationMembers(true);
|
||||
|
||||
for (uint8 i = 0; i < RAID_MODE(2, 4); ++i)
|
||||
me->SummonCreature(NPC_SANCTUM_SENTRY, me->GetPositionX() + urand(4, 12), me->GetPositionY() + urand(4, 12), me->GetPositionZ());
|
||||
BossAI::Reset();
|
||||
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
|
||||
}
|
||||
@@ -128,22 +143,6 @@ struct boss_auriaya : public BossAI
|
||||
return 0;
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* cr) override
|
||||
{
|
||||
if (cr->GetEntry() == NPC_SANCTUM_SENTRY)
|
||||
cr->GetMotionMaster()->MoveFollow(me, 6, rand_norm() * 2 * 3.14f);
|
||||
else
|
||||
cr->SetInCombatWithZone();
|
||||
|
||||
summons.Summon(cr);
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* cr, Unit*) override
|
||||
{
|
||||
if (cr->GetEntry() == NPC_SANCTUM_SENTRY)
|
||||
_feralDied = true;
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* who) override
|
||||
{
|
||||
BossAI::JustEngagedWith(who);
|
||||
@@ -171,6 +170,8 @@ struct boss_auriaya : public BossAI
|
||||
EntryCheckPredicate pred(NPC_FERAL_DEFENDER);
|
||||
summons.DoAction(ACTION_DESPAWN_ADDS, pred);
|
||||
|
||||
DespawnFormationMembers();
|
||||
|
||||
BossAI::JustDied(killer);
|
||||
Talk(EMOTE_DEATH);
|
||||
}
|
||||
@@ -181,6 +182,8 @@ struct boss_auriaya : public BossAI
|
||||
events.ScheduleEvent(EVENT_RESPAWN_FERAL_DEFENDER, 25s);
|
||||
else if (param == ACTION_FERAL_DEATH)
|
||||
_nineLives = true;
|
||||
else if (param == ACTION_SENTRY_DEATH)
|
||||
_feralDied = true;
|
||||
}
|
||||
|
||||
void ExecuteEvent(uint32 eventId) override
|
||||
@@ -228,6 +231,13 @@ struct npc_auriaya_sanctum_sentry : public ScriptedAI
|
||||
{
|
||||
npc_auriaya_sanctum_sentry(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void JustDied(Unit*) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (Creature* auriaya = instance->GetCreature(BOSS_AURIAYA))
|
||||
auriaya->AI()->DoAction(ACTION_SENTRY_DEATH);
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit*) override
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
|
||||
Reference in New Issue
Block a user