fix(Scripts/UtgardePinnacle): Fix Skadi start and reset checks (#23034)

This commit is contained in:
Andrew
2025-09-28 07:02:35 -03:00
committed by GitHub
parent 5d443d3cda
commit 09c2b7e5fb
3 changed files with 42 additions and 34 deletions

View File

@@ -0,0 +1,9 @@
--
DELETE FROM `areatrigger_scripts` WHERE `entry` = 4991;
INSERT INTO `areatrigger_scripts` (`entry`, `ScriptName`) VALUES (4991, 'SmartTrigger');
DELETE FROM `smart_scripts` WHERE (`entryorguid` = 4991) AND (`source_type` = 2) AND (`id` IN (0));
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
(4991, 2, 0, 0, 46, 0, 100, 0, 4991, 0, 0, 0, 0, 0, 223, 1, 0, 0, 0, 0, 0, 205, 2, 1, 0, 0, 0, 0, 0, 0, 'Areatrigger - On Trigger - Do Action ID 1');
UPDATE `creature_template` SET `unit_flags` = `unit_flags`|64|256, `flags_extra` = `flags_extra`|2147483648 WHERE `entry` IN (26693, 30807);

View File

@@ -143,10 +143,7 @@ public:
SecondPhase = false; SecondPhase = false;
EventStarted = false; EventStarted = false;
me->RemoveAllAuras(); me->RemoveUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
me->SetControlled(false, UNIT_STATE_ROOT);
me->UpdatePosition(343.02f, -507.325f, 104.567f, M_PI, true);
me->StopMovingOnCurrentPos();
if (m_pInstance) if (m_pInstance)
{ {
@@ -160,7 +157,9 @@ public:
Creature* GetGrauf() { return ObjectAccessor::GetCreature(*me, GraufGUID); } Creature* GetGrauf() { return ObjectAccessor::GetCreature(*me, GraufGUID); }
void JustEngagedWith(Unit* /*pWho*/) override void DoAction(int32 param) override
{
if (param == ACTION_START_EVENT)
{ {
if (!EventStarted) if (!EventStarted)
{ {
@@ -175,14 +174,11 @@ public:
} }
me->SetControlled(true, UNIT_STATE_ROOT); me->SetControlled(true, UNIT_STATE_ROOT);
me->SetInCombatWithZone(); me->SetUnitFlag(UNIT_FLAG_NOT_SELECTABLE);
events.RescheduleEvent(EVENT_SKADI_START, 2s); events.RescheduleEvent(EVENT_SKADI_START, 2s);
} }
} }
else if (param == ACTION_PHASE2)
void DoAction(int32 param) override
{
if (param == ACTION_PHASE2)
{ {
SecondPhase = true; SecondPhase = true;
events.ScheduleEvent(EVENT_SKADI_CRUSH, 8s); events.ScheduleEvent(EVENT_SKADI_CRUSH, 8s);
@@ -190,7 +186,7 @@ public:
events.ScheduleEvent(EVENT_SKADI_WHIRLWIND, 15s); events.ScheduleEvent(EVENT_SKADI_WHIRLWIND, 15s);
if (me->GetVictim()) if (me->GetVictim())
me->GetMotionMaster()->MoveChase(me->GetVictim()); me->ResumeChasingVictim();
else else
me->SetInCombatWithZone(); me->SetInCombatWithZone();
} }
@@ -415,7 +411,7 @@ public:
Map::PlayerList const& pList = me->GetMap()->GetPlayers(); Map::PlayerList const& pList = me->GetMap()->GetPlayers();
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr) for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
{ {
if (itr->GetSource()->GetPositionX() < 320.0f || itr->GetSource()->IsGameMaster() || !itr->GetSource()->IsAlive()) if (itr->GetSource()->GetPositionY() > -490.0f || itr->GetSource()->IsGameMaster() || !itr->GetSource()->IsAlive())
continue; continue;
return; return;
@@ -456,7 +452,7 @@ public:
SpawnHelpers(0); SpawnHelpers(0);
SpawnHelpers(0); SpawnHelpers(0);
events.ScheduleEvent(EVENT_GRAUF_MOVE, 15s); events.ScheduleEvent(EVENT_GRAUF_MOVE, 5s);
events.ScheduleEvent(EVENT_GRAUF_SUMMON_HELPERS, 20s); events.ScheduleEvent(EVENT_GRAUF_SUMMON_HELPERS, 20s);
break; break;
} }

View File

@@ -20,6 +20,12 @@
#include "ScriptedCreature.h" #include "ScriptedCreature.h"
#include "utgarde_pinnacle.h" #include "utgarde_pinnacle.h"
ObjectData const creatureData[] =
{
{ NPC_SKADI_THE_RUTHLESS, DATA_SKADI_THE_RUTHLESS },
{ 0, 0 }
};
class instance_utgarde_pinnacle : public InstanceMapScript class instance_utgarde_pinnacle : public InstanceMapScript
{ {
public: public:
@@ -36,7 +42,6 @@ public:
ObjectGuid SvalaSorrowgrave; ObjectGuid SvalaSorrowgrave;
ObjectGuid GortokPalehoof; ObjectGuid GortokPalehoof;
ObjectGuid SkadiRuthless;
ObjectGuid KingYmiron; ObjectGuid KingYmiron;
ObjectGuid FrenziedWorgen; ObjectGuid FrenziedWorgen;
ObjectGuid RavenousFurbolg; ObjectGuid RavenousFurbolg;
@@ -59,6 +64,7 @@ public:
void Initialize() override void Initialize() override
{ {
SetHeaders(DataHeader); SetHeaders(DataHeader);
LoadObjectData(creatureData, nullptr);
SkadiHits = 0; SkadiHits = 0;
SkadiInRange = 0; SkadiInRange = 0;
@@ -88,9 +94,6 @@ public:
case NPC_GORTOK_PALEHOOF: case NPC_GORTOK_PALEHOOF:
GortokPalehoof = pCreature->GetGUID(); GortokPalehoof = pCreature->GetGUID();
break; break;
case NPC_SKADI_THE_RUTHLESS:
SkadiRuthless = pCreature->GetGUID();
break;
case NPC_KING_YMIRON: case NPC_KING_YMIRON:
KingYmiron = pCreature->GetGUID(); KingYmiron = pCreature->GetGUID();
break; break;
@@ -110,6 +113,8 @@ public:
Grauf = pCreature->GetGUID(); Grauf = pCreature->GetGUID();
break; break;
} }
InstanceScript::OnCreatureCreate(pCreature);
} }
void OnGameObjectCreate(GameObject* pGo) override void OnGameObjectCreate(GameObject* pGo) override
@@ -238,8 +243,6 @@ public:
return SvalaSorrowgrave; return SvalaSorrowgrave;
case DATA_GORTOK_PALEHOOF: case DATA_GORTOK_PALEHOOF:
return GortokPalehoof; return GortokPalehoof;
case DATA_SKADI_THE_RUTHLESS:
return SkadiRuthless;
case DATA_KING_YMIRON: case DATA_KING_YMIRON:
return KingYmiron; return KingYmiron;
case DATA_NPC_FRENZIED_WORGEN: case DATA_NPC_FRENZIED_WORGEN: