feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)
This commit is contained in:
+11
-11
@@ -29,7 +29,7 @@ public:
|
||||
else
|
||||
instance->SetData(TYPE_LYCEUM, IN_PROGRESS);
|
||||
// If used brazier open linked doors (North or South)
|
||||
if (go->GetGUID() == instance->GetData64(DATA_SF_BRAZIER_N))
|
||||
if (go->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_N))
|
||||
{
|
||||
if (braziersUsed == 0)
|
||||
{
|
||||
@@ -37,12 +37,12 @@ public:
|
||||
}
|
||||
else if(braziersUsed == 2)
|
||||
{
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GOLEM_DOOR_N), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GOLEM_DOOR_S), true);
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_N), true);
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_S), true);
|
||||
braziersUsed = 0;
|
||||
}
|
||||
}
|
||||
else if (go->GetGUID() == instance->GetData64(DATA_SF_BRAZIER_S))
|
||||
else if (go->GetGUID() == instance->GetGuidData(DATA_SF_BRAZIER_S))
|
||||
{
|
||||
if (braziersUsed == 0)
|
||||
{
|
||||
@@ -50,8 +50,8 @@ public:
|
||||
}
|
||||
else if (braziersUsed == 1)
|
||||
{
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GOLEM_DOOR_N), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_GOLEM_DOOR_S), true);
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_N), true);
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_GOLEM_DOOR_S), true);
|
||||
braziersUsed = 0;
|
||||
}
|
||||
}
|
||||
@@ -214,7 +214,7 @@ public:
|
||||
|
||||
void HandleGameObject(uint32 id, bool open)
|
||||
{
|
||||
instance->HandleGameObject(instance->GetData64(id), open);
|
||||
instance->HandleGameObject(instance->GetGuidData(id), open);
|
||||
}
|
||||
|
||||
void SummonBoss()
|
||||
@@ -294,11 +294,11 @@ public:
|
||||
if (theldrenEvent)
|
||||
{
|
||||
if (GameObject* go = me->SummonGameObject(GO_ARENA_SPOILS, 596.48f, -187.91f, -54.14f, 4.9f, 0.0f, 0.0f, 0.0f, 0.0f, 300))
|
||||
go->SetOwnerGUID(0);
|
||||
go->SetOwnerGUID(ObjectGuid::Empty);
|
||||
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
itr->GetSource()->KilledMonsterCredit(16166, 0);
|
||||
itr->GetSource()->KilledMonsterCredit(16166);
|
||||
}
|
||||
|
||||
HandleGameObject(DATA_ARENA2, false);
|
||||
@@ -526,7 +526,7 @@ public:
|
||||
|
||||
void DoGo(uint32 id, uint32 state)
|
||||
{
|
||||
if (GameObject* go = instance->instance->GetGameObject(instance->GetData64(id)))
|
||||
if (GameObject* go = instance->instance->GetGameObject(instance->GetGuidData(id)))
|
||||
go->SetGoState((GOState)state);
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ public:
|
||||
DoGo(DATA_GO_BAR_KEG_TRAP, 0); //doesn't work very well, leaving code here for future
|
||||
//spell by trap has effect61, this indicate the bar go hostile
|
||||
|
||||
if (Unit* tmp = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_PHALANX)))
|
||||
if (Unit* tmp = ObjectAccessor::GetUnit(*me, instance->GetGuidData(DATA_PHALANX)))
|
||||
tmp->setFaction(14);
|
||||
|
||||
//for later, this event(s) has alot more to it.
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
if (Creature* Moira = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_MOIRA)))
|
||||
if (Creature* Moira = ObjectAccessor::GetCreature(*me, instance->GetGuidData(DATA_MOIRA)))
|
||||
{
|
||||
Moira->AI()->EnterEvadeMode();
|
||||
Moira->setFaction(35);
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ public:
|
||||
void JustDied(Unit* killer) override
|
||||
{
|
||||
if (InstanceScript* instance = killer->GetInstanceScript())
|
||||
instance->HandleGameObject(instance->GetData64(DATA_THRONE_DOOR), true);
|
||||
instance->HandleGameObject(instance->GetGuidData(DATA_THRONE_DOOR), true);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
+3
-3
@@ -53,7 +53,7 @@ public:
|
||||
if (InstanceScript* instance = creature->GetInstanceScript())
|
||||
{
|
||||
//are 5 minutes expected? go template may have data to despawn when used at quest
|
||||
instance->DoRespawnGameObject(instance->GetData64(DATA_GO_CHALICE), MINUTE * 5);
|
||||
instance->DoRespawnGameObject(instance->GetGuidData(DATA_GO_CHALICE), MINUTE * 5);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
// Start encounter
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (instance)
|
||||
instance->SetData64(DATA_EVENSTARTER, player->GetGUID());
|
||||
instance->SetGuidData(DATA_EVENSTARTER, player->GetGUID());
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
@@ -175,7 +175,7 @@ public:
|
||||
if (me->IsAlive())
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
me->SetLootRecipient(nullptr);
|
||||
instance->SetData64(DATA_EVENSTARTER, 0);
|
||||
instance->SetGuidData(DATA_EVENSTARTER, ObjectGuid::Empty);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
|
||||
+35
-70
@@ -71,37 +71,37 @@ public:
|
||||
uint32 encounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
uint64 EmperorGUID;
|
||||
uint64 PhalanxGUID;
|
||||
uint64 MagmusGUID;
|
||||
uint64 MoiraGUID;
|
||||
ObjectGuid EmperorGUID;
|
||||
ObjectGuid PhalanxGUID;
|
||||
ObjectGuid MagmusGUID;
|
||||
ObjectGuid MoiraGUID;
|
||||
|
||||
uint64 GoArena1GUID;
|
||||
uint64 GoArena2GUID;
|
||||
uint64 GoArena3GUID;
|
||||
uint64 GoArena4GUID;
|
||||
uint64 GoShadowLockGUID;
|
||||
uint64 GoShadowMechGUID;
|
||||
uint64 GoShadowGiantGUID;
|
||||
uint64 GoShadowDummyGUID;
|
||||
uint64 GoBarKegGUID;
|
||||
uint64 GoBarKegTrapGUID;
|
||||
uint64 GoBarDoorGUID;
|
||||
uint64 GoTombEnterGUID;
|
||||
uint64 GoTombExitGUID;
|
||||
uint64 GoLyceumGUID;
|
||||
uint64 GoSFSGUID;
|
||||
uint64 GoSFNGUID;
|
||||
uint64 GoGolemNGUID;
|
||||
uint64 GoGolemSGUID;
|
||||
uint64 GoThroneGUID;
|
||||
uint64 GoChestGUID;
|
||||
uint64 GoSpectralChaliceGUID;
|
||||
ObjectGuid GoArena1GUID;
|
||||
ObjectGuid GoArena2GUID;
|
||||
ObjectGuid GoArena3GUID;
|
||||
ObjectGuid GoArena4GUID;
|
||||
ObjectGuid GoShadowLockGUID;
|
||||
ObjectGuid GoShadowMechGUID;
|
||||
ObjectGuid GoShadowGiantGUID;
|
||||
ObjectGuid GoShadowDummyGUID;
|
||||
ObjectGuid GoBarKegGUID;
|
||||
ObjectGuid GoBarKegTrapGUID;
|
||||
ObjectGuid GoBarDoorGUID;
|
||||
ObjectGuid GoTombEnterGUID;
|
||||
ObjectGuid GoTombExitGUID;
|
||||
ObjectGuid GoLyceumGUID;
|
||||
ObjectGuid GoSFSGUID;
|
||||
ObjectGuid GoSFNGUID;
|
||||
ObjectGuid GoGolemNGUID;
|
||||
ObjectGuid GoGolemSGUID;
|
||||
ObjectGuid GoThroneGUID;
|
||||
ObjectGuid GoChestGUID;
|
||||
ObjectGuid GoSpectralChaliceGUID;
|
||||
|
||||
uint32 BarAleCount;
|
||||
uint32 GhostKillCount;
|
||||
uint64 TombBossGUIDs[7];
|
||||
uint64 TombEventStarterGUID;
|
||||
ObjectGuid TombBossGUIDs[7];
|
||||
ObjectGuid TombEventStarterGUID;
|
||||
uint32 TombTimer;
|
||||
uint32 TombEventCounter;
|
||||
uint32 OpenedCoofers;
|
||||
@@ -110,42 +110,11 @@ public:
|
||||
{
|
||||
memset(&encounter, 0, sizeof(encounter));
|
||||
|
||||
EmperorGUID = 0;
|
||||
PhalanxGUID = 0;
|
||||
MagmusGUID = 0;
|
||||
MoiraGUID = 0;
|
||||
|
||||
GoArena1GUID = 0;
|
||||
GoArena2GUID = 0;
|
||||
GoArena3GUID = 0;
|
||||
GoArena4GUID = 0;
|
||||
GoShadowLockGUID = 0;
|
||||
GoShadowMechGUID = 0;
|
||||
GoShadowGiantGUID = 0;
|
||||
GoShadowDummyGUID = 0;
|
||||
GoBarKegGUID = 0;
|
||||
GoBarKegTrapGUID = 0;
|
||||
GoBarDoorGUID = 0;
|
||||
GoTombEnterGUID = 0;
|
||||
GoTombExitGUID = 0;
|
||||
GoLyceumGUID = 0;
|
||||
GoSFSGUID = 0;
|
||||
GoSFNGUID = 0;
|
||||
GoGolemNGUID = 0;
|
||||
GoGolemSGUID = 0;
|
||||
GoThroneGUID = 0;
|
||||
GoChestGUID = 0;
|
||||
GoSpectralChaliceGUID = 0;
|
||||
|
||||
BarAleCount = 0;
|
||||
GhostKillCount = 0;
|
||||
TombEventStarterGUID = 0;
|
||||
TombTimer = TIMER_TOMBOFTHESEVEN;
|
||||
TombEventCounter = 0;
|
||||
OpenedCoofers = 0;
|
||||
|
||||
for (uint8 i = 0; i < 7; ++i)
|
||||
TombBossGUIDs[i] = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature) override
|
||||
@@ -185,7 +154,7 @@ public:
|
||||
case NPC_MAGMUS:
|
||||
MagmusGUID = creature->GetGUID();
|
||||
if (!creature->IsAlive())
|
||||
HandleGameObject(GetData64(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
|
||||
HandleGameObject(GetGuidData(DATA_THRONE_DOOR), true); // if Magmus is dead open door to last boss
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -233,9 +202,9 @@ public:
|
||||
case GO_TOMB_EXIT:
|
||||
GoTombExitGUID = go->GetGUID();
|
||||
if (GhostKillCount >= 7)
|
||||
HandleGameObject(0, true, go);
|
||||
HandleGameObject(ObjectGuid::Empty, true, go);
|
||||
else
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_LYCEUM:
|
||||
GoLyceumGUID = go->GetGUID();
|
||||
@@ -264,12 +233,8 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SetData64(uint32 type, uint64 data) override
|
||||
void SetGuidData(uint32 type, ObjectGuid data) override
|
||||
{
|
||||
#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
|
||||
LOG_DEBUG("scripts.ai", "TSCR: Instance Blackrock Depths: SetData64 update (Type: %u Data " UI64FMTD ")", type, data);
|
||||
#endif
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case DATA_EVENSTARTER:
|
||||
@@ -365,7 +330,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 data) const override
|
||||
ObjectGuid GetGuidData(uint32 data) const override
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
@@ -404,7 +369,8 @@ public:
|
||||
case DATA_GO_CHALICE:
|
||||
return GoSpectralChaliceGUID;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
std::string GetSaveData() override
|
||||
@@ -474,7 +440,6 @@ public:
|
||||
}
|
||||
}
|
||||
GhostKillCount = 0;
|
||||
TombEventStarterGUID = 0;
|
||||
TombEventCounter = 0;
|
||||
TombTimer = TIMER_TOMBOFTHESEVEN;
|
||||
SetData(TYPE_TOMB_OF_SEVEN, NOT_STARTED);
|
||||
@@ -492,7 +457,7 @@ public:
|
||||
DoRespawnGameObject(GoChestGUID, DAY);
|
||||
HandleGameObject(GoTombExitGUID, true);//event done, open exit door
|
||||
HandleGameObject(GoTombEnterGUID, true);//event done, open entrance door
|
||||
TombEventStarterGUID = 0;
|
||||
TombEventStarterGUID.Clear();
|
||||
SetData(TYPE_TOMB_OF_SEVEN, DONE);
|
||||
}
|
||||
void Update(uint32 diff) override
|
||||
|
||||
+3
-6
@@ -72,8 +72,7 @@ public:
|
||||
me->GetCreaturesWithEntryInRange(ChromaticEliteGuards, 15.0f, ChromaticEliteGuardEntry);
|
||||
for (std::list<Creature*>::const_iterator itr = ChromaticEliteGuards.begin(); itr != ChromaticEliteGuards.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->GetGUID())
|
||||
(*itr)->ToCreature()->AI()->AttackStart(me->GetVictim());
|
||||
(*itr)->ToCreature()->AI()->AttackStart(me->GetVictim());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,16 +144,14 @@ public:
|
||||
me->GetCreaturesWithEntryInRange(GeneralDrakkisath, 15.0f, GeneralDrakkisathEntry);
|
||||
for (std::list<Creature*>::const_iterator itr = GeneralDrakkisath.begin(); itr != GeneralDrakkisath.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->GetGUID())
|
||||
(*itr)->ToCreature()->AI()->AttackStart(who);
|
||||
(*itr)->ToCreature()->AI()->AttackStart(who);
|
||||
}
|
||||
|
||||
std::list<Creature*> ChromaticEliteGuards;
|
||||
me->GetCreaturesWithEntryInRange(ChromaticEliteGuards, 15.0f, ChromaticEliteGuardEntry);
|
||||
for (std::list<Creature*>::const_iterator itr = ChromaticEliteGuards.begin(); itr != ChromaticEliteGuards.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->GetGUID())
|
||||
(*itr)->ToCreature()->AI()->AttackStart(who);
|
||||
(*itr)->ToCreature()->AI()->AttackStart(who);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+12
-12
@@ -93,10 +93,10 @@ public:
|
||||
break;
|
||||
case 2:
|
||||
// Close these two doors on Blackhand Incarcerators aggro
|
||||
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_IN)))
|
||||
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_IN)))
|
||||
if (door1->GetGoState() == GO_STATE_ACTIVE)
|
||||
door1->SetGoState(GO_STATE_READY);
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetData64(GO_DOORS)))
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_DOORS)))
|
||||
if (door2->GetGoState() == GO_STATE_ACTIVE)
|
||||
door2->SetGoState(GO_STATE_READY);
|
||||
break;
|
||||
@@ -155,33 +155,33 @@ public:
|
||||
void OpenDoors(bool Boss_Killed)
|
||||
{
|
||||
// These two doors reopen on reset or boss kill
|
||||
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_IN)))
|
||||
if (GameObject* door1 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_IN)))
|
||||
door1->SetGoState(GO_STATE_ACTIVE);
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetData64(GO_DOORS)))
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_DOORS)))
|
||||
door2->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
// This door opens on boss kill
|
||||
if (Boss_Killed)
|
||||
if (GameObject* door3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_OUT)))
|
||||
if (GameObject* door3 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_OUT)))
|
||||
door3->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
void UpdateRunes(GOState state)
|
||||
{
|
||||
// update all runes
|
||||
if (GameObject* rune1 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_1)))
|
||||
if (GameObject* rune1 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_1)))
|
||||
rune1->SetGoState(state);
|
||||
if (GameObject* rune2 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_2)))
|
||||
if (GameObject* rune2 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_2)))
|
||||
rune2->SetGoState(state);
|
||||
if (GameObject* rune3 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_3)))
|
||||
if (GameObject* rune3 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_3)))
|
||||
rune3->SetGoState(state);
|
||||
if (GameObject* rune4 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_4)))
|
||||
if (GameObject* rune4 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_4)))
|
||||
rune4->SetGoState(state);
|
||||
if (GameObject* rune5 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_5)))
|
||||
if (GameObject* rune5 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_5)))
|
||||
rune5->SetGoState(state);
|
||||
if (GameObject* rune6 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_6)))
|
||||
if (GameObject* rune6 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_6)))
|
||||
rune6->SetGoState(state);
|
||||
if (GameObject* rune7 = me->GetMap()->GetGameObject(instance->GetData64(GO_EMBERSEER_RUNE_7)))
|
||||
if (GameObject* rune7 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_EMBERSEER_RUNE_7)))
|
||||
rune7->SetGoState(state);
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -171,15 +171,15 @@ public:
|
||||
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_PREPARATION);
|
||||
gythEvent = false;
|
||||
victorGUID = 0;
|
||||
waveDoorGUID = 0;
|
||||
victorGUID.Clear();
|
||||
waveDoorGUID.Clear();
|
||||
|
||||
summons.DespawnAll();
|
||||
|
||||
if (Creature* victor = me->FindNearestCreature(NPC_LORD_VICTOR_NEFARIUS, 5.0f, true))
|
||||
victor->Respawn(true);
|
||||
|
||||
if (GameObject* exitDoor = me->GetMap()->GetGameObject(instance->GetData64(GO_GYTH_ENTRY_DOOR)))
|
||||
if (GameObject* exitDoor = me->GetMap()->GetGameObject(instance->GetGuidData(GO_GYTH_ENTRY_DOOR)))
|
||||
exitDoor->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
instance->SetBossState(DATA_WARCHIEF_REND_BLACKHAND, NOT_STARTED);
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
if (Creature* victor = me->FindNearestCreature(NPC_LORD_VICTOR_NEFARIUS, 75.0f, true))
|
||||
victor->AI()->SetData(1, 2);
|
||||
|
||||
if (GameObject* exitDoor = me->GetMap()->GetGameObject(instance->GetData64(GO_GYTH_ENTRY_DOOR)))
|
||||
if (GameObject* exitDoor = me->GetMap()->GetGameObject(instance->GetGuidData(GO_GYTH_ENTRY_DOOR)))
|
||||
exitDoor->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
instance->SetBossState(DATA_WARCHIEF_REND_BLACKHAND, DONE);
|
||||
@@ -287,7 +287,7 @@ public:
|
||||
if (Creature* victor = ObjectAccessor::GetCreature(*me, victorGUID))
|
||||
victor->AI()->Talk(SAY_NEFARIUS_0);
|
||||
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetData64(GO_GYTH_ENTRY_DOOR)))
|
||||
if (GameObject* door2 = me->GetMap()->GetGameObject(instance->GetGuidData(GO_GYTH_ENTRY_DOOR)))
|
||||
door2->SetGoState(GO_STATE_READY);
|
||||
|
||||
events.ScheduleEvent(EVENT_START_2, 4000);
|
||||
@@ -465,8 +465,8 @@ public:
|
||||
|
||||
private:
|
||||
bool gythEvent;
|
||||
uint64 victorGUID;
|
||||
uint64 waveDoorGUID;
|
||||
ObjectGuid victorGUID;
|
||||
ObjectGuid waveDoorGUID;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
|
||||
+51
-74
@@ -41,30 +41,6 @@ public:
|
||||
instance_blackrock_spireMapScript(InstanceMap* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(EncounterCount);
|
||||
HighlordOmokk = 0;
|
||||
ShadowHunterVoshgajin = 0;
|
||||
WarMasterVoone = 0;
|
||||
MotherSmolderweb = 0;
|
||||
UrokDoomhowl = 0;
|
||||
QuartermasterZigris = 0;
|
||||
GizrultheSlavener = 0;
|
||||
Halycon = 0;
|
||||
OverlordWyrmthalak = 0;
|
||||
PyroguardEmberseer = 0;
|
||||
WarchiefRendBlackhand = 0;
|
||||
Gyth = 0;
|
||||
LordVictorNefarius = 0;
|
||||
TheBeast = 0;
|
||||
GeneralDrakkisath = 0;
|
||||
go_emberseerin = 0;
|
||||
go_doors = 0;
|
||||
go_emberseerout = 0;
|
||||
go_blackrockaltar = 0;
|
||||
go_portcullis_active = 0;
|
||||
go_portcullis_tobossrooms = 0;
|
||||
go_urok_pile = 0;
|
||||
memset(go_roomrunes, 0, sizeof(go_roomrunes));
|
||||
memset(go_emberseerrunes, 0, sizeof(go_emberseerrunes));
|
||||
}
|
||||
|
||||
void CreatureLooted(Creature* creature, LootType loot) override
|
||||
@@ -147,97 +123,97 @@ public:
|
||||
break;
|
||||
case GO_EMBERSEER_IN:
|
||||
go_emberseerin = go->GetGUID();
|
||||
HandleGameObject(0, GetBossState(DATA_DRAGONSPIRE_ROOM) == DONE, go);
|
||||
HandleGameObject(ObjectGuid::Empty, GetBossState(DATA_DRAGONSPIRE_ROOM) == DONE, go);
|
||||
break;
|
||||
case GO_DOORS:
|
||||
go_doors = go->GetGUID();
|
||||
if (GetBossState(DATA_DRAGONSPIRE_ROOM) == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
HandleGameObject(ObjectGuid::Empty, true, go);
|
||||
break;
|
||||
case GO_EMBERSEER_OUT:
|
||||
go_emberseerout = go->GetGUID();
|
||||
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
HandleGameObject(ObjectGuid::Empty, true, go);
|
||||
break;
|
||||
case GO_HALL_RUNE_1:
|
||||
go_roomrunes[0] = go->GetGUID();
|
||||
if (GetBossState(DATA_HALL_RUNE_1) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_HALL_RUNE_2:
|
||||
go_roomrunes[1] = go->GetGUID();
|
||||
if (GetBossState(DATA_HALL_RUNE_2) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_HALL_RUNE_3:
|
||||
go_roomrunes[2] = go->GetGUID();
|
||||
if (GetBossState(DATA_HALL_RUNE_3) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_HALL_RUNE_4:
|
||||
go_roomrunes[3] = go->GetGUID();
|
||||
if (GetBossState(DATA_HALL_RUNE_4) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_HALL_RUNE_5:
|
||||
go_roomrunes[4] = go->GetGUID();
|
||||
if (GetBossState(DATA_HALL_RUNE_5) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_HALL_RUNE_6:
|
||||
go_roomrunes[5] = go->GetGUID();
|
||||
if (GetBossState(DATA_HALL_RUNE_6) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_HALL_RUNE_7:
|
||||
go_roomrunes[6] = go->GetGUID();
|
||||
if (GetBossState(DATA_HALL_RUNE_7) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_EMBERSEER_RUNE_1:
|
||||
go_emberseerrunes[0] = go->GetGUID();
|
||||
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_EMBERSEER_RUNE_2:
|
||||
go_emberseerrunes[1] = go->GetGUID();
|
||||
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_EMBERSEER_RUNE_3:
|
||||
go_emberseerrunes[2] = go->GetGUID();
|
||||
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_EMBERSEER_RUNE_4:
|
||||
go_emberseerrunes[3] = go->GetGUID();
|
||||
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_EMBERSEER_RUNE_5:
|
||||
go_emberseerrunes[4] = go->GetGUID();
|
||||
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_EMBERSEER_RUNE_6:
|
||||
go_emberseerrunes[5] = go->GetGUID();
|
||||
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_EMBERSEER_RUNE_7:
|
||||
go_emberseerrunes[6] = go->GetGUID();
|
||||
if (GetBossState(DATA_PYROGAURD_EMBERSEER) == DONE)
|
||||
HandleGameObject(0, false, go);
|
||||
HandleGameObject(ObjectGuid::Empty, false, go);
|
||||
break;
|
||||
case GO_PORTCULLIS_ACTIVE:
|
||||
go_portcullis_active = go->GetGUID();
|
||||
if (GetBossState(DATA_GYTH) == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
HandleGameObject(ObjectGuid::Empty, true, go);
|
||||
break;
|
||||
case GO_PORTCULLIS_TOBOSSROOMS:
|
||||
go_portcullis_tobossrooms = go->GetGUID();
|
||||
if (GetBossState(DATA_GYTH) == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
HandleGameObject(ObjectGuid::Empty, true, go);
|
||||
break;
|
||||
case GO_UROK_PILE:
|
||||
go_urok_pile = go->GetGUID();
|
||||
@@ -315,7 +291,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const override
|
||||
ObjectGuid GetGuidData(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@@ -388,7 +364,8 @@ public:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
void Update(uint32 diff) override
|
||||
@@ -465,7 +442,7 @@ public:
|
||||
|
||||
if (!_mobAlive && rune->GetGoState() == GO_STATE_ACTIVE)
|
||||
{
|
||||
HandleGameObject(0, false, rune);
|
||||
HandleGameObject(ObjectGuid::Empty, false, rune);
|
||||
|
||||
switch (rune->GetEntry())
|
||||
{
|
||||
@@ -502,11 +479,11 @@ public:
|
||||
{
|
||||
SetBossState(DATA_DRAGONSPIRE_ROOM, DONE);
|
||||
if (GameObject* door1 = instance->GetGameObject(go_emberseerin))
|
||||
HandleGameObject(0, true, door1);
|
||||
HandleGameObject(ObjectGuid::Empty, true, door1);
|
||||
if (GameObject* door2 = instance->GetGameObject(go_doors))
|
||||
HandleGameObject(0, true, door2);
|
||||
HandleGameObject(ObjectGuid::Empty, true, door2);
|
||||
if (GameObject* door3 = instance->GetGameObject(go_emberseerin))
|
||||
HandleGameObject(0, true, door3);
|
||||
HandleGameObject(ObjectGuid::Empty, true, door3);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -556,31 +533,31 @@ public:
|
||||
|
||||
protected:
|
||||
EventMap Events;
|
||||
uint64 HighlordOmokk;
|
||||
uint64 ShadowHunterVoshgajin;
|
||||
uint64 WarMasterVoone;
|
||||
uint64 MotherSmolderweb;
|
||||
uint64 UrokDoomhowl;
|
||||
uint64 QuartermasterZigris;
|
||||
uint64 GizrultheSlavener;
|
||||
uint64 Halycon;
|
||||
uint64 OverlordWyrmthalak;
|
||||
uint64 PyroguardEmberseer;
|
||||
uint64 WarchiefRendBlackhand;
|
||||
uint64 Gyth;
|
||||
uint64 LordVictorNefarius;
|
||||
uint64 TheBeast;
|
||||
uint64 GeneralDrakkisath;
|
||||
uint64 go_emberseerin;
|
||||
uint64 go_doors;
|
||||
uint64 go_emberseerout;
|
||||
uint64 go_blackrockaltar;
|
||||
uint64 go_roomrunes[7];
|
||||
uint64 go_emberseerrunes[7];
|
||||
uint64 runecreaturelist[7][5];
|
||||
uint64 go_portcullis_active;
|
||||
uint64 go_portcullis_tobossrooms;
|
||||
uint64 go_urok_pile;
|
||||
ObjectGuid HighlordOmokk;
|
||||
ObjectGuid ShadowHunterVoshgajin;
|
||||
ObjectGuid WarMasterVoone;
|
||||
ObjectGuid MotherSmolderweb;
|
||||
ObjectGuid UrokDoomhowl;
|
||||
ObjectGuid QuartermasterZigris;
|
||||
ObjectGuid GizrultheSlavener;
|
||||
ObjectGuid Halycon;
|
||||
ObjectGuid OverlordWyrmthalak;
|
||||
ObjectGuid PyroguardEmberseer;
|
||||
ObjectGuid WarchiefRendBlackhand;
|
||||
ObjectGuid Gyth;
|
||||
ObjectGuid LordVictorNefarius;
|
||||
ObjectGuid TheBeast;
|
||||
ObjectGuid GeneralDrakkisath;
|
||||
ObjectGuid go_emberseerin;
|
||||
ObjectGuid go_doors;
|
||||
ObjectGuid go_emberseerout;
|
||||
ObjectGuid go_blackrockaltar;
|
||||
ObjectGuid go_roomrunes[7];
|
||||
ObjectGuid go_emberseerrunes[7];
|
||||
ObjectGuid runecreaturelist[7][5];
|
||||
ObjectGuid go_portcullis_active;
|
||||
ObjectGuid go_portcullis_tobossrooms;
|
||||
ObjectGuid go_urok_pile;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
+3
-3
@@ -300,11 +300,11 @@ class go_chromaggus_lever : public GameObjectScript
|
||||
{
|
||||
_instance->SetBossState(DATA_CHROMAGGUS, IN_PROGRESS);
|
||||
|
||||
if (Creature* creature = _instance->instance->GetCreature(DATA_CHROMAGGUS))
|
||||
if (Creature* creature = _instance->instance->GetCreature(_instance->GetGuidData(DATA_CHROMAGGUS)))
|
||||
creature->AI()->AttackStart(player);
|
||||
|
||||
if (GameObject* go = _instance->instance->GetGameObject(DATA_GO_CHROMAGGUS_DOOR))
|
||||
_instance->HandleGameObject(0, true, go);
|
||||
if (GameObject* go = _instance->instance->GetGameObject(_instance->GetGuidData(DATA_GO_CHROMAGGUS_DOOR)))
|
||||
_instance->HandleGameObject(ObjectGuid::Empty, true, go);
|
||||
}
|
||||
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE | GO_FLAG_IN_USE);
|
||||
|
||||
+1
-1
@@ -158,7 +158,7 @@ public:
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
if (instance->GetData(DATA_EGG_EVENT) != DONE)
|
||||
if (Creature* razor = ObjectAccessor::GetCreature(*go, instance->GetData64(DATA_RAZORGORE_THE_UNTAMED)))
|
||||
if (Creature* razor = ObjectAccessor::GetCreature(*go, instance->GetGuidData(DATA_RAZORGORE_THE_UNTAMED)))
|
||||
{
|
||||
razor->Attack(player, true);
|
||||
player->CastSpell(razor, SPELL_MINDCONTROL);
|
||||
|
||||
+3
-3
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
PlayerGUID = 0;
|
||||
PlayerGUID.Clear();
|
||||
HasYelled = false;
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
@@ -260,8 +260,8 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 PlayerGUID;
|
||||
uint64 m_nefariusGuid;
|
||||
ObjectGuid PlayerGUID;
|
||||
ObjectGuid m_nefariusGuid;
|
||||
bool HasYelled;
|
||||
};
|
||||
|
||||
|
||||
+8
-8
@@ -75,7 +75,7 @@ public:
|
||||
case NPC_BLACKWING_TASKMASTER:
|
||||
case NPC_BLACKWING_LEGIONAIRE:
|
||||
case NPC_BLACKWING_WARLOCK:
|
||||
if (Creature* razor = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
|
||||
if (Creature* razor = instance->GetCreature(GetGuidData(DATA_RAZORGORE_THE_UNTAMED)))
|
||||
if (CreatureAI* razorAI = razor->AI())
|
||||
razorAI->JustSummoned(creature);
|
||||
break;
|
||||
@@ -169,8 +169,8 @@ public:
|
||||
case DATA_RAZORGORE_THE_UNTAMED:
|
||||
if (state == DONE)
|
||||
{
|
||||
for (std::list<uint64>::const_iterator itr = EggList.begin(); itr != EggList.end(); ++itr)
|
||||
if (GameObject* egg = instance->GetGameObject((*itr)))
|
||||
for (ObjectGuid const guid : EggList)
|
||||
if (GameObject* egg = instance->GetGameObject(guid))
|
||||
egg->SetPhaseMask(2, true);
|
||||
}
|
||||
SetData(DATA_EGG_EVENT, NOT_STARTED);
|
||||
@@ -179,7 +179,7 @@ public:
|
||||
switch (state)
|
||||
{
|
||||
case NOT_STARTED:
|
||||
if (Creature* nefarian = instance->GetCreature(DATA_NEFARIAN))
|
||||
if (Creature* nefarian = instance->GetCreature(GetGuidData(DATA_NEFARIAN)))
|
||||
nefarian->DespawnOrUnsummon();
|
||||
break;
|
||||
case FAIL:
|
||||
@@ -213,7 +213,7 @@ public:
|
||||
case SPECIAL:
|
||||
if (++EggCount == 15)
|
||||
{
|
||||
if (Creature* razor = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
|
||||
if (Creature* razor = instance->GetCreature(GetGuidData(DATA_RAZORGORE_THE_UNTAMED)))
|
||||
{
|
||||
SetData(DATA_EGG_EVENT, DONE);
|
||||
razor->RemoveAurasDueToSpell(42013); // MindControl
|
||||
@@ -255,11 +255,11 @@ public:
|
||||
break;
|
||||
case EVENT_RAZOR_PHASE_TWO:
|
||||
_events.CancelEvent(EVENT_RAZOR_SPAWN);
|
||||
if (Creature* razor = instance->GetCreature(DATA_RAZORGORE_THE_UNTAMED))
|
||||
if (Creature* razor = instance->GetCreature(GetGuidData(DATA_RAZORGORE_THE_UNTAMED)))
|
||||
razor->AI()->DoAction(ACTION_PHASE_TWO);
|
||||
break;
|
||||
case EVENT_RESPAWN_NEFARIUS:
|
||||
if (Creature* nefarius = instance->GetCreature(DATA_LORD_VICTOR_NEFARIUS))
|
||||
if (Creature* nefarius = instance->GetCreature(GetGuidData(DATA_LORD_VICTOR_NEFARIUS)))
|
||||
{
|
||||
nefarius->SetPhaseMask(1, true);
|
||||
nefarius->setActive(true);
|
||||
@@ -278,7 +278,7 @@ public:
|
||||
// Razorgore
|
||||
uint8 EggCount;
|
||||
uint32 EggEvent;
|
||||
std::list<uint64> EggList;
|
||||
GuidList EggList;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
if (HealthAbovePct(50) || !instance)
|
||||
return;
|
||||
|
||||
if (Creature* pGolemagg = instance->instance->GetCreature(instance->GetData64(BOSS_GOLEMAGG_THE_INCINERATOR)))
|
||||
if (Creature* pGolemagg = instance->instance->GetCreature(instance->GetGuidData(BOSS_GOLEMAGG_THE_INCINERATOR)))
|
||||
{
|
||||
if (pGolemagg->IsAlive())
|
||||
{
|
||||
|
||||
@@ -147,7 +147,7 @@ public:
|
||||
break;
|
||||
case EVENT_INTRO_4:
|
||||
Talk(SAY_ARRIVAL5_RAG);
|
||||
if (Creature* executus = ObjectAccessor::GetCreature(*me, instance->GetData64(BOSS_MAJORDOMO_EXECUTUS)))
|
||||
if (Creature* executus = ObjectAccessor::GetCreature(*me, instance->GetGuidData(BOSS_MAJORDOMO_EXECUTUS)))
|
||||
Unit::Kill(me, executus);
|
||||
break;
|
||||
case EVENT_INTRO_5:
|
||||
|
||||
+6
-9
@@ -42,9 +42,6 @@ public:
|
||||
instance_molten_core_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
_golemaggTheIncineratorGUID = 0;
|
||||
_majordomoExecutusGUID = 0;
|
||||
_cacheOfTheFirelordGUID = 0;
|
||||
_deadBossCount = 0;
|
||||
_ragnarosAddDeaths = 0;
|
||||
}
|
||||
@@ -125,7 +122,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const override
|
||||
ObjectGuid GetGuidData(uint32 type) const override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@@ -135,7 +132,7 @@ public:
|
||||
return _majordomoExecutusGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 bossId, EncounterState state) override
|
||||
@@ -236,12 +233,12 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _golemaggTheIncineratorGUID;
|
||||
uint64 _majordomoExecutusGUID;
|
||||
uint64 _cacheOfTheFirelordGUID;
|
||||
ObjectGuid _golemaggTheIncineratorGUID;
|
||||
ObjectGuid _majordomoExecutusGUID;
|
||||
ObjectGuid _cacheOfTheFirelordGUID;
|
||||
uint8 _deadBossCount;
|
||||
uint8 _ragnarosAddDeaths;
|
||||
std::unordered_map<uint8, uint64> _circlesGUIDs;
|
||||
std::unordered_map<uint8, ObjectGuid> _circlesGUIDs;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const override
|
||||
|
||||
Reference in New Issue
Block a user