fix(DB/Gossip): convert npc_slim gossip to database conditions (#25191)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Andrew 2026-03-23 16:10:38 -03:00 committed by GitHub
parent 03ad0e2a93
commit c682c1d29a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 38 deletions

View file

@ -0,0 +1,22 @@
-- Convert npc_slim (entry 19679) from C++ script to database gossip + conditions
-- Remove ScriptName from creature_template
UPDATE `creature_template` SET `ScriptName` = '' WHERE `entry` = 19679;
-- Add gossip_menu entry for non-friendly text (9895)
DELETE FROM `gossip_menu` WHERE `MenuID` = 8021 AND `TextID` = 9895;
INSERT INTO `gossip_menu` (`MenuID`, `TextID`) VALUES (8021, 9895);
-- Add conditions for gossip_menu text display
-- Show text 9896 (vendor greeting) only if player is Friendly+ with Consortium (faction 933)
-- Friendly(16) + Honored(32) + Revered(64) + Exalted(128) = 240
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 14 AND `SourceGroup` = 8021 AND `SourceEntry` IN (9895, 9896);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(14, 8021, 9896, 0, 0, 5, 0, 933, 240, 0, 0, 0, 0, '', 'Gossip Menu 8021 - Show text 9896 if player is Friendly+ with Consortium'),
(14, 8021, 9895, 0, 0, 5, 0, 933, 240, 0, 1, 0, 0, '', 'Gossip Menu 8021 - Show text 9895 if player is not Friendly+ with Consortium');
-- Add condition for gossip_menu_option vendor option
-- Show vendor option only if player is Friendly+ with Consortium
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 8021 AND `SourceEntry` = 0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorType`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 8021, 0, 0, 0, 5, 0, 933, 240, 0, 0, 0, 0, '', 'Gossip Option 8021/0 - Show vendor option if player is Friendly+ with Consortium');

View file

@ -613,43 +613,6 @@ public:
}
};
/*######
## npc_slim
######*/
enum Slim
{
FACTION_CONSORTIUM = 933
};
class npc_slim : public CreatureScript
{
public:
npc_slim() : CreatureScript("npc_slim") { }
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
ClearGossipMenuFor(player);
if (action == GOSSIP_ACTION_TRADE)
player->GetSession()->SendListInventory(creature->GetGUID());
return true;
}
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsVendor() && player->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY)
{
AddGossipItemFor(player, GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
SendGossipMenuFor(player, 9896, creature->GetGUID());
}
else
SendGossipMenuFor(player, 9895, creature->GetGUID());
return true;
}
};
void AddSC_terokkar_forest()
{
RegisterSpellAndAuraScriptPair(spell_q10930_big_bone_worm, spell_q10930_big_bone_worm_aura);
@ -663,5 +626,4 @@ void AddSC_terokkar_forest()
new npc_isla_starmane();
new go_skull_pile();
new go_ancient_skull_pile();
new npc_slim();
}