diff options
| author | tkrokli <tkrokli@users.noreply.github.com> | 2016-08-14 09:50:28 +0200 | 
|---|---|---|
| committer | Aokromes <Aokromes@users.noreply.github.com> | 2016-08-14 09:50:28 +0200 | 
| commit | 0c6eeb3abc54dbc0f147e5098619e8e19e27accd (patch) | |
| tree | 58400236bf4ec07fece22fbd2da400fa489d2f09 | |
| parent | d08efca201888e988f95e5761f31e9a890948091 (diff) | |
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
| -rw-r--r-- | sql/updates/world/3.3.5/2016_08_14_00_world.sql | 12 | ||||
| -rw-r--r-- | src/server/scripts/Outland/zone_zangarmarsh.cpp | 29 | 
2 files changed, 12 insertions, 29 deletions
diff --git a/sql/updates/world/3.3.5/2016_08_14_00_world.sql b/sql/updates/world/3.3.5/2016_08_14_00_world.sql new file mode 100644 index 00000000000..046d50dddad --- /dev/null +++ b/sql/updates/world/3.3.5/2016_08_14_00_world.sql @@ -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.'); diff --git a/src/server/scripts/Outland/zone_zangarmarsh.cpp b/src/server/scripts/Outland/zone_zangarmarsh.cpp index 6f38cce0e5b..51dbe1687e8 100644 --- a/src/server/scripts/Outland/zone_zangarmarsh.cpp +++ b/src/server/scripts/Outland/zone_zangarmarsh.cpp @@ -27,7 +27,6 @@ EndScriptData */  npcs_ashyen_and_keleth  npc_cooshcoosh  npc_elder_kuruti -npc_mortog_steamhead  npc_kayra_longmane  npc_timothy_daniels  EndContentData */ @@ -295,33 +294,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();  }  | 
