diff options
-rw-r--r-- | sql/updates/world/2013_06_26_02_world_gossip.sql | 9 | ||||
-rw-r--r-- | src/server/scripts/Northrend/zone_storm_peaks.cpp | 46 |
2 files changed, 23 insertions, 32 deletions
diff --git a/sql/updates/world/2013_06_26_02_world_gossip.sql b/sql/updates/world/2013_06_26_02_world_gossip.sql new file mode 100644 index 00000000000..56c41e18b38 --- /dev/null +++ b/sql/updates/world/2013_06_26_02_world_gossip.sql @@ -0,0 +1,9 @@ +-- Add Any Missing Gossip Option for Injured Goblin Miner +DELETE FROM `gossip_menu_option` WHERE menu_id IN (9859); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`,`action_poi_id`,`box_coded`,`box_money`,`box_text`)VALUES +(9859,0,0,"I am ready, lets get you out of here.",1,1,0,0,0,0,''); + +-- Add Gossip option condition +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (9859); +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,9859,0,0,28,12832,0,0,1,0,'','Injured Goblin Miner - Show gossip option only if quest "Bitter Departure" is not complete'); diff --git a/src/server/scripts/Northrend/zone_storm_peaks.cpp b/src/server/scripts/Northrend/zone_storm_peaks.cpp index c34fbce6a66..4b1fa3f4123 100644 --- a/src/server/scripts/Northrend/zone_storm_peaks.cpp +++ b/src/server/scripts/Northrend/zone_storm_peaks.cpp @@ -30,15 +30,15 @@ ///npc_injured_goblin ///////////////////// -enum eInjuredGoblin +enum InjuredGoblinMiner { QUEST_BITTER_DEPARTURE = 12832, SAY_QUEST_ACCEPT = 0, - SAY_END_WP_REACHED = 1 + SAY_END_WP_REACHED = 1, + GOSSIP_ID = 9859, + GOSSIP_OPTION_ID = 0 }; -#define GOSSIP_ITEM_1 "I am ready, lets get you out of here" - class npc_injured_goblin : public CreatureScript { public: @@ -83,6 +83,16 @@ public: return; DoMeleeAttackIfReady(); } + + void sGossipSelect(Player* player, uint32 sender, uint32 action) + { + if (sender == GOSSIP_ID && action == GOSSIP_OPTION_ID) + { + player->CLOSE_GOSSIP_MENU(); + me->setFaction(113); + npc_escortAI::Start(true, true, player->GetGUID()); + } + } }; CreatureAI* GetAI(Creature* creature) const @@ -90,21 +100,6 @@ public: return new npc_injured_goblinAI(creature); } - bool OnGossipHello(Player* player, Creature* creature) - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - if (player->GetQuestStatus(QUEST_BITTER_DEPARTURE) == QUEST_STATUS_INCOMPLETE) - { - player->ADD_GOSSIP_ITEM(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - player->PlayerTalkClass->SendGossipMenu(9999999, creature->GetGUID()); - } - else - player->SEND_GOSSIP_MENU(999999, creature->GetGUID()); - return true; - } - bool OnQuestAccept(Player* /*player*/, Creature* creature, Quest const* quest) { if (quest->GetQuestId() == QUEST_BITTER_DEPARTURE) @@ -112,19 +107,6 @@ public: return false; } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) - { - player->PlayerTalkClass->ClearMenus(); - npc_escortAI* pEscortAI = CAST_AI(npc_injured_goblin::npc_injured_goblinAI, creature->AI()); - - if (action == GOSSIP_ACTION_INFO_DEF+1) - { - pEscortAI->Start(true, true, player->GetGUID()); - creature->setFaction(113); - } - return true; - } }; /*###### |