mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 21:56:22 +00:00
fix(Scripts/BRD): Rework Shadowforge Braziers (#8233)
- Both gates should open when both braziers are lit, regardless of the order - Added missing flavor text from Magmus, spoken once the gates open
This commit is contained in:
@@ -23,7 +23,10 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
uint32 braziersUsed = 0;
|
||||
enum ShadowforgeBrazier
|
||||
{
|
||||
SAY_MAGMUS_BRAZIER_LIT = 0
|
||||
};
|
||||
|
||||
//go_shadowforge_brazier
|
||||
class go_shadowforge_brazier : public GameObjectScript
|
||||
@@ -35,36 +38,37 @@ public:
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
{
|
||||
if (instance->GetData(TYPE_LYCEUM) == IN_PROGRESS)
|
||||
instance->SetData(TYPE_LYCEUM, DONE);
|
||||
else
|
||||
instance->SetData(TYPE_LYCEUM, IN_PROGRESS);
|
||||
// If used brazier open linked doors (North or South)
|
||||
if (go->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_N))
|
||||
GameObject* northBrazier = ObjectAccessor::GetGameObject(*go, instance->GetGuidData(DATA_SF_BRAZIER_N));
|
||||
GameObject* southBrazier = ObjectAccessor::GetGameObject(*go, instance->GetGuidData(DATA_SF_BRAZIER_S));
|
||||
|
||||
if (!northBrazier || !southBrazier)
|
||||
{
|
||||
if (braziersUsed == 0)
|
||||
{
|
||||
braziersUsed = 1;
|
||||
}
|
||||
else if(braziersUsed == 2)
|
||||
{
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_N), true);
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_S), true);
|
||||
braziersUsed = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else if (go->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_S))
|
||||
|
||||
// Check if the opposite brazier is lit - if it is, open the gates.
|
||||
if ((go->GetGUID() == northBrazier->GetGUID() && southBrazier->GetGoState() == GO_STATE_ACTIVE)
|
||||
|| (go->GetGUID() == southBrazier->GetGUID() && northBrazier->GetGoState() == GO_STATE_ACTIVE))
|
||||
{
|
||||
if (braziersUsed == 0)
|
||||
if (instance->GetData(TYPE_LYCEUM) == IN_PROGRESS)
|
||||
{
|
||||
braziersUsed = 2;
|
||||
instance->SetData(TYPE_LYCEUM, DONE);
|
||||
}
|
||||
else if (braziersUsed == 1)
|
||||
else
|
||||
{
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_N), true);
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_S), true);
|
||||
braziersUsed = 0;
|
||||
instance->SetData(TYPE_LYCEUM, IN_PROGRESS);
|
||||
}
|
||||
|
||||
if (Creature* magmus = ObjectAccessor::GetCreature(*go, instance->GetGuidData(DATA_MAGMUS)))
|
||||
{
|
||||
if (magmus->IsAlive())
|
||||
{
|
||||
magmus->AI()->Talk(SAY_MAGMUS_BRAZIER_LIT);
|
||||
}
|
||||
}
|
||||
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_N), true);
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_S), true);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -70,7 +70,14 @@ enum DataTypes
|
||||
DATA_OPEN_COFFER_DOORS = 30,
|
||||
|
||||
DATA_GOLEM_LORD_ARGELMACH_INIT = 31,
|
||||
DATA_GOLEM_LORD_ARGELMACH_ADDS = 32
|
||||
DATA_GOLEM_LORD_ARGELMACH_ADDS = 32,
|
||||
|
||||
DATA_MAGMUS = 33
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_MAGMUS = 9938
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
|
||||
@@ -34,7 +34,6 @@ enum Creatures
|
||||
NPC_SEETHREL = 9038,
|
||||
NPC_GLOOMREL = 9037,
|
||||
NPC_DOOMREL = 9039,
|
||||
NPC_MAGMUS = 9938,
|
||||
NPC_MOIRA = 8929,
|
||||
|
||||
NPC_WATCHMAN_DOOMGRIP = 9476,
|
||||
@@ -516,6 +515,10 @@ public:
|
||||
return GoGolemSGUID;
|
||||
case DATA_GO_CHALICE:
|
||||
return GoSpectralChaliceGUID;
|
||||
case DATA_MAGMUS:
|
||||
{
|
||||
return MagmusGUID;
|
||||
}
|
||||
}
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
|
||||
Reference in New Issue
Block a user