Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions data/sql/updates/pending_db_world/rev_1793327916730492900.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
--
-- Black Temple: Akama's gossip reads the Illidan gate data instead of boss state 8 (now Illidan)
UPDATE `conditions` SET `ConditionValue1` = 18, `ConditionValue3` = 0, `Comment` = 'If Illidan gate data is DONE'
WHERE `SourceTypeOrReferenceId` IN (14, 15) AND `SourceGroup` = 8713 AND `ConditionTypeOrReference` = 13
AND `ConditionValue1` = 8 AND `ConditionValue3` = 2 AND `NegativeCondition` = 0;
UPDATE `conditions` SET `ConditionValue1` = 18, `ConditionValue3` = 0, `Comment` = 'If Illidan gate data is not DONE'
WHERE `SourceTypeOrReferenceId` IN (14, 15) AND `SourceGroup` = 8713 AND `ConditionTypeOrReference` = 13
AND `ConditionValue1` = 8 AND `ConditionValue3` = 2 AND `NegativeCondition` = 1;
15 changes: 11 additions & 4 deletions src/server/scripts/Outland/BlackTemple/black_temple.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,23 @@ enum DataTypes
DATA_RELIQUARY_OF_SOULS = 5,
DATA_MOTHER_SHAHRAZ = 6,
DATA_ILLIDARI_COUNCIL = 7,
DATA_AKAMA_ILLIDAN = 8,
DATA_ILLIDAN_STORMRAGE = 9,
MAX_ENCOUNTERS = 10,
DATA_ILLIDAN_STORMRAGE = 8,
MAX_ENCOUNTERS = 9,

DATA_AKAMA_SHADE = 11,
DATA_GATHIOS_THE_SHATTERER = 12,
DATA_HIGH_NETHERMANCER_ZEREVOR = 13,
DATA_LADY_MALANDE = 14,
DATA_VERAS_DARKSHADOW = 15,
DATA_BLACK_TEMPLE_TRIGGER = 16
DATA_BLACK_TEMPLE_TRIGGER = 16,
DATA_AKAMA_ILLIDAN = 17,
DATA_ILLIDAN_GATE = 18
};

enum BTPersistentData
{
PERSISTENT_DATA_ILLIDAN_GATE,
PERSISTENT_DATA_COUNT
};

enum CreatureIds
Expand Down
17 changes: 14 additions & 3 deletions src/server/scripts/Outland/BlackTemple/boss_illidan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -807,13 +807,24 @@ struct npc_akama_illidan : public ScriptedAI
me->SetControlled(false, UNIT_STATE_ROOT);
}

void JustRespawned() override
{
Reset();

// After a restart with the Council dead and the gate shut, return Akama to the Council
if (instance->GetBossState(DATA_ILLIDARI_COUNCIL) == DONE &&
instance->GetPersistentData(PERSISTENT_DATA_ILLIDAN_GATE) != DONE &&
instance->GetBossState(DATA_ILLIDAN_STORMRAGE) != DONE)
DoAction(ACTION_ILLIDARI_COUNCIL_DONE);
}

void sGossipSelect(Player* player, uint32 /*sender*/, uint32 /*action*/) override
{
CloseGossipMenuFor(player);
me->ReplaceAllNpcFlags(UNIT_NPC_FLAG_NONE);
me->setActive(true);

if (instance->GetBossState(DATA_AKAMA_ILLIDAN) != DONE)
if (instance->GetPersistentData(PERSISTENT_DATA_ILLIDAN_GATE) != DONE)
{
me->GetMotionMaster()->MoveWaypoint(PATH_AKAMA_ILLIDARI_COUNCIL_2, false);
}
Expand Down Expand Up @@ -988,8 +999,8 @@ struct npc_akama_illidan : public ScriptedAI
udalo->InterruptNonMeleeSpells(false);
if (Creature* olum = me->FindNearestCreature(NPC_SPIRIT_OF_OLUM, 15.0f))
olum->InterruptNonMeleeSpells(false);
instance->SetBossState(DATA_AKAMA_ILLIDAN, NOT_STARTED);
instance->SetBossState(DATA_AKAMA_ILLIDAN, DONE);
instance->StorePersistentData(PERSISTENT_DATA_ILLIDAN_GATE, DONE);
instance->HandleGameObject(DATA_ILLIDAN_GATE, true);
}, 50680ms); // 20ms
me->m_Events.AddEventAtOffset([&] {
Talk(SAY_AKAMA_SALUTE);
Expand Down
29 changes: 19 additions & 10 deletions src/server/scripts/Outland/BlackTemple/instance_black_temple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,17 @@ DoorData const doorData[] =
{ GO_MOTHER_SHAHRAZ_DOOR, DATA_MOTHER_SHAHRAZ, DOOR_TYPE_PASSAGE },
{ GO_COUNCIL_DOOR_1, DATA_ILLIDARI_COUNCIL, DOOR_TYPE_ROOM },
{ GO_COUNCIL_DOOR_2, DATA_ILLIDARI_COUNCIL, DOOR_TYPE_ROOM },
{ GO_ILLIDAN_GATE, DATA_AKAMA_ILLIDAN, DOOR_TYPE_PASSAGE },
{ GO_ILLIDAN_DOOR_L, DATA_ILLIDAN_STORMRAGE, DOOR_TYPE_ROOM },
{ GO_ILLIDAN_DOOR_R, DATA_ILLIDAN_STORMRAGE, DOOR_TYPE_ROOM },
{ 0, 0, DOOR_TYPE_ROOM }
};

ObjectData const gameObjectData[] =
{
{ GO_ILLIDAN_GATE, DATA_ILLIDAN_GATE },
{ 0, 0 }
};

ObjectData const creatureData[] =
{
{ NPC_HIGH_WARLORD_NAJENTUS, DATA_HIGH_WARLORD_NAJENTUS },
Expand Down Expand Up @@ -102,9 +107,10 @@ class instance_black_temple : public InstanceMapScript
{
SetHeaders(DataHeader);
SetBossNumber(MAX_ENCOUNTERS);
SetPersistentDataCount(PERSISTENT_DATA_COUNT);
LoadDoorData(doorData);
LoadBossBoundaries(boundaries);
LoadObjectData(creatureData, nullptr);
LoadObjectData(creatureData, gameObjectData);
LoadSummonData(summonData);

ashtongueGUIDs.clear();
Expand Down Expand Up @@ -140,19 +146,22 @@ class instance_black_temple : public InstanceMapScript

void OnGameObjectCreate(GameObject* go) override
{
// If created after Illidari Council is done, then skip Akama's event. Used for crashes/reset
// The gate spawns open in the DB; keep it shut until Akama's scene opens it (saved)
if (go->GetEntry() == GO_ILLIDAN_GATE)
{
if (GetBossState(DATA_ILLIDARI_COUNCIL) == DONE)
{
SetBossState(DATA_AKAMA_ILLIDAN, DONE);
HandleGameObject(ObjectGuid::Empty, true, go);
}
}
HandleGameObject(ObjectGuid::Empty, GetPersistentData(PERSISTENT_DATA_ILLIDAN_GATE) == DONE, go);

InstanceScript::OnGameObjectCreate(go);
}

uint32 GetData(uint32 type) const override
{
// Read by Akama's gossip conditions
if (type == DATA_ILLIDAN_GATE)
return GetPersistentData(PERSISTENT_DATA_ILLIDAN_GATE);

return 0;
}

bool SetBossState(uint32 type, EncounterState state) override
{
if (!InstanceScript::SetBossState(type, state))
Expand Down
Loading