Core/Scripts: move npc_mortog_steamhead to DB

Move core script npc_mortog_steamhead to database
- script contains gossip handling + 1 condition
- both actions can be handled in DB settings
This commit is contained in:
tkrokli
2016-08-14 09:50:28 +02:00
committed by Aokromes
parent 1fc6f18024
commit d847bcdac4
2 changed files with 12 additions and 29 deletions

View File

@@ -0,0 +1,12 @@
-- NPC ID/entry 23373 Mortog Steamhead
UPDATE `creature_template` SET `ScriptName`= '' WHERE `entry`= 23373;
SET @menu_id := 8692;
DELETE FROM `gossip_menu_option` WHERE `menu_id`= @menu_id;
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`OptionBroadcastTextID`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`,`BoxBroadcastTextID`,`VerifiedBuild`) VALUES
(@menu_id,0,1,"I'd like to browse your goods.",3370,3,128,0,0,0,0,'',0,0);
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup`= @menu_id AND `SourceEntry`= 0 AND `SourceId`= 0;
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorType`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,@menu_id,0,0,0,5,0,942,128,0,0,0,0,'', 'Show gossip menu_id 8692 option id 0 if player is Exalted with Cenarion Expedition.');

View File

@@ -27,7 +27,6 @@ EndScriptData */
npcs_ashyen_and_keleth
npc_cooshcoosh
npc_elder_kuruti
npc_mortog_steamhead
npc_kayra_longmane
npc_timothy_daniels
EndContentData */
@@ -294,33 +293,6 @@ public:
}
};
/*######
## npc_mortog_steamhead
######*/
class npc_mortog_steamhead : public CreatureScript
{
public:
npc_mortog_steamhead() : CreatureScript("npc_mortog_steamhead") { }
bool OnGossipHello(Player* player, Creature* creature) override
{
if (creature->IsVendor() && player->GetReputationRank(942) == REP_EXALTED)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_TRADE)
player->GetSession()->SendListInventory(creature->GetGUID());
return true;
}
};
/*######
## npc_kayra_longmane
######*/
@@ -455,7 +427,6 @@ void AddSC_zangarmarsh()
new npcs_ashyen_and_keleth();
new npc_cooshcoosh();
new npc_elder_kuruti();
new npc_mortog_steamhead();
new npc_kayra_longmane();
new npc_timothy_daniels();
}