fix(Scripts/ZulAman): Load hostage gossip from DB (#27845)

Co-authored-by: lee <[email protected]>
Co-authored-by: offl <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
This commit is contained in:
vpinti
2026-09-28 11:48:01 -03:00
committed by GitHub
co-authored by lee offl Claude Opus 5.5
parent eeaab3a34d
commit 056dee5d09
2 changed files with 13 additions and 2 deletions
@@ -0,0 +1,7 @@
-- Zul'Aman hostages: move the hardcoded gossip option to the DB (credit: TrinityCore)
DELETE FROM `gossip_menu_option` WHERE `MenuID` IN (8799, 8874, 8881, 8927) AND `OptionID` = 0;
INSERT INTO `gossip_menu_option` (`MenuID`, `OptionID`, `OptionIcon`, `OptionText`, `OptionBroadcastTextID`, `OptionType`, `OptionNpcFlag`, `ActionMenuID`, `ActionPoiID`, `BoxCoded`, `BoxMoney`, `BoxText`, `BoxBroadcastTextID`, `VerifiedBuild`) VALUES
(8799, 0, 0, 'Nalorakk is dead, you\'re free to go.', 23015, 1, 1, 0, 0, 0, 0, '', 0, 12340),
(8874, 0, 0, 'The coast is clear. You\'re free!', 22965, 1, 1, 0, 0, 0, 0, '', 0, 11723),
(8881, 0, 0, 'We\'ve killed your captors. You\'re free to go.\n', 23090, 1, 1, 0, 0, 0, 0, '', 0, 0),
(8927, 0, 0, 'It\'s safe, little gnome. You can come out now.', 23154, 1, 1, 0, 0, 0, 0, '', 0, 0);
@@ -240,7 +240,10 @@ struct npc_forest_frog : public ScriptedAI
## npc_zulaman_hostage ## npc_zulaman_hostage
######*/ ######*/
#define GOSSIP_HOSTAGE1 "I am glad to help you." enum ZulAmanHostage
{
GOSSIP_OPTION_HOSTAGE_FREE = 0
};
static uint32 HostageEntry[] = {23999, 23790, 24024, 24001}; static uint32 HostageEntry[] = {23999, 23790, 24024, 24001};
static uint32 ChestEntry[] = {187021, 186648, 186667, 186672}; static uint32 ChestEntry[] = {187021, 186648, 186667, 186672};
@@ -282,7 +285,8 @@ public:
bool OnGossipHello(Player* player, Creature* creature) override bool OnGossipHello(Player* player, Creature* creature) override
{ {
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_HOSTAGE1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); uint32 const menuId = creature->GetCreatureTemplate()->GossipMenuId;
AddGossipItemFor(player, menuId, GOSSIP_OPTION_HOSTAGE_FREE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID()); SendGossipMenuFor(player, player->GetGossipTextId(creature), creature->GetGUID());
return true; return true;
} }