Scripts/Dire Maul: Allow players to open The Prince's Chest if Prince Tortheldrin is killed (#30866)

(cherry picked from commit 4a6b73782beb6981a6ea48dd0da34303d5af3edb)
This commit is contained in:
CraftedRO
2026-06-22 18:11:59 +02:00
committed by Shauren
parent 58f0741807
commit d9ba59dbeb
2 changed files with 13 additions and 1 deletions
@@ -69,7 +69,8 @@ enum DMGameobjectIds
GO_CRYSTAL_02 = 177257,
GO_CRYSTAL_03 = 177258,
GO_CRYSTAL_04 = 179504,
GO_CRYSTAL_05 = 179505
GO_CRYSTAL_05 = 179505,
GO_PRINCE_CHEST = 179545
};
template <class AI, class T>
@@ -127,6 +127,11 @@ public:
if (Creature* tortheldrin = instance->GetCreature(_tortheldrinGUID))
tortheldrin->SetFaction(FACTION_ENEMY);
}
else if (unit->GetGUID() == _tortheldrinGUID)
{
if (GameObject* chest = instance->GetGameObject(_princechestGUID))
chest->RemoveFlag(GO_FLAG_NOT_SELECTABLE);
}
else if (unit->GetEntry() == NPC_CHO_RUSH)
SetBossState(DATA_CHO_RUSH_THE_OBSERVER, DONE);
}
@@ -157,6 +162,9 @@ public:
if (GetBossState(DATA_FORCEFIELD) != DONE)
_events.ScheduleEvent(EVENT_CRYSTAL_CREATURE_STORE, 1s);
break;
case GO_PRINCE_CHEST:
_princechestGUID = go->GetGUID();
break;
default:
break;
}
@@ -178,6 +186,8 @@ public:
return _crystalGUIDs[4];
case GO_FORCEFIELD:
return _forcefieldGUID;
case GO_PRINCE_CHEST:
return _princechestGUID;
case NPC_IMMOLTHAR:
return _immoGUID;
case NPC_TORTHELDRIN:
@@ -306,6 +316,7 @@ protected:
std::array<ObjectGuid, 5> _crystalGUIDs;
std::array<std::array<ObjectGuid, 4>, 5> _crystalCreatureGUIDs; // 5 different Crystals, maximum of 4 Creatures
ObjectGuid _forcefieldGUID;
ObjectGuid _princechestGUID;
ObjectGuid _immoGUID;
ObjectGuid _tortheldrinGUID;
};