Scripts/HoO: moved the Lift of the Maker's gossip menu handling to database

This commit is contained in:
Ovahlord committed 2022-12-19 18:56:59 +01:00
1 parent 56ba5175e1
commit 33272e3210
2 files changed
+13 -44

No files matched your search

@@ -0,0 +1,9 @@
UPDATE `gossip_menu_option` SET `OptionType`= 1 WHERE `MenuID`= 12646;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=12646 AND SourceId = 0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`ErrorTextId`, `NegativeCondition`, `ScriptName`,`Comment`) VALUES
(15, 12646, 1, 0, 0, 13, 0, 1, 3, 2, 0, 0, "", "Show gossip if Anraphet or Earthrager Ptah have been defeated"),
(15, 12646, 1, 0, 1, 13, 0, 2, 3, 2, 0, 0, "", "Show gossip if Anraphet or Earthrager Ptah have been defeated"),
(15, 12646, 2, 0, 0, 13, 0, 3, 3, 2, 0, 0, "", "Show gossip if the Constructs of the Four Seats have been defeated"),
(15, 12646, 2, 0, 0, 13, 0, 4, 3, 2, 0, 0, "", "Show gossip if the Constructs of the Four Seats have been defeated"),
(15, 12646, 2, 0, 0, 13, 0, 5, 3, 2, 0, 0, "", "Show gossip if the Constructs of the Four Seats have been defeated"),
(15, 12646, 2, 0, 0, 13, 0, 6, 3, 2, 0, 0, "", "Show gossip if the Constructs of the Four Seats have been defeated");
@@ -732,61 +732,21 @@ struct npc_hoo_aqua_bubble : public NullCreatureAI
}
};
// The Maker's Lift
enum ElevatorMisc
{
GOSSIP_MENU_HOO_LIFT = 12646,
GOSSIP_NPC_TEXT_CHOOSE_A_DESTINATION = 17791,
GOSSIP_OPTION_FIRST_FLOOR = 0,
GOSSIP_OPTION_HOO_LIFT_SECOND_FLOOR = 1,
GOSSIP_OPTION_HOO_LIFT_THIRD_FLOOR = 2
};
// 207669 - The Maker's Lift Controller
struct go_hoo_the_makers_lift_controller : public GameObjectAI
{
go_hoo_the_makers_lift_controller(GameObject* go) : GameObjectAI(go) { }
bool GossipHello(Player* player) override
{
InstanceScript* instance = player->GetInstanceScript();
if (!instance)
return false;
// Build menu.
// First floor: Option available from start.
AddGossipItemFor(player, GOSSIP_MENU_HOO_LIFT, GOSSIP_OPTION_FIRST_FLOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 0);
// Second floor: Anraphet must be defeated first.
if (instance->GetBossState(DATA_ANRAPHET) == DONE || instance->GetBossState(DATA_EARTHRAGER_PTAH) == DONE)
AddGossipItemFor(player, GOSSIP_MENU_HOO_LIFT, GOSSIP_OPTION_HOO_LIFT_SECOND_FLOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
// Third floor: Constructs of The Four Seats must be defeated first.
if (instance->GetBossState(DATA_ISISET) == DONE && instance->GetBossState(DATA_AMMUNAE) == DONE &&
instance->GetBossState(DATA_SETESH) == DONE && instance->GetBossState(DATA_RAJH) == DONE)
AddGossipItemFor(player, GOSSIP_MENU_HOO_LIFT, GOSSIP_OPTION_HOO_LIFT_THIRD_FLOOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
SendGossipMenuFor(player, GOSSIP_NPC_TEXT_CHOOSE_A_DESTINATION, me->GetGUID());
return true;
}
bool GossipSelect(Player* player, uint32 /*sender*/, uint32 action) override
{
ClearGossipMenuFor(player);
player->PlayerTalkClass->SendCloseGossip();
InstanceScript* instance = player->GetInstanceScript();
if (!instance)
return true;
if (InstanceScript* instance = player->GetInstanceScript())
if (GameObject* elevator = instance->GetGameObject(DATA_LIFT_OF_THE_MAKERS))
elevator->SetGoState(GOState(GO_STATE_TRANSPORT_ACTIVE + action));
// Handle elevator: gossip item index => stopFrame (floor index).
GameObject* elevator = instance->GetGameObject(DATA_LIFT_OF_THE_MAKERS);
if (!elevator)
return true;
elevator->SetGoState(GOState(GO_STATE_TRANSPORT_ACTIVE + action));
return true;
return false;
}
};