diff options
author | Trond B Krokli <tkrokli@gmail.com> | 2016-05-02 22:22:17 +0200 |
---|---|---|
committer | joschiwald <joschiwald.trinity@gmail.com> | 2016-05-02 22:22:17 +0200 |
commit | d82534a7bbd401f4b672786749f10f5a95f6e76c (patch) | |
tree | 6521f90f0608e00c181d4d23ad179570dbc28687 /src | |
parent | 9064968a4dee9413abe8a480cf1c6984b28721d2 (diff) |
Core/Scripts/DB: remove hardcoded text from npc_beaten_corpse (#16907)
- remove hardcoded text from script npc_beaten_corpse
- remove OnGossipHello() hook, gossip text moved to DB
- use sGossipSelect() hook instead of OnGossipSelect()
- add npc_text 3557 and 3558 as text_id to gossip_menu
- add gossip_menu_option 2871 to NPC 10668 Beaten Corpse
- add condition for gossip_menu_option 2871 in Quest ID 4921
Tested on 4 different characters/classes, male & female.
Thanks to joschiwald for the sGossipSelect() script change.
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Kalimdor/zone_the_barrens.cpp | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/src/server/scripts/Kalimdor/zone_the_barrens.cpp b/src/server/scripts/Kalimdor/zone_the_barrens.cpp index b113615ca50..7a963d066b6 100644 --- a/src/server/scripts/Kalimdor/zone_the_barrens.cpp +++ b/src/server/scripts/Kalimdor/zone_the_barrens.cpp @@ -43,38 +43,37 @@ EndContentData */ ## npc_beaten_corpse ######*/ -#define GOSSIP_CORPSE "Examine corpse in detail..." - enum BeatenCorpse { - QUEST_LOST_IN_BATTLE = 4921 + GOSSIP_OPTION_ID_BEATEN_CORPSE = 0, + GOSSIP_MENU_OPTION_INSPECT_BODY = 2871 }; class npc_beaten_corpse : public CreatureScript { -public: - npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { } + public: + npc_beaten_corpse() : CreatureScript("npc_beaten_corpse") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF +1) + struct npc_beaten_corpseAI : public ScriptedAI { - player->SEND_GOSSIP_MENU(3558, creature->GetGUID()); - player->TalkedToCreature(creature->GetEntry(), creature->GetGUID()); - } - return true; - } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_INCOMPLETE || player->GetQuestStatus(QUEST_LOST_IN_BATTLE) == QUEST_STATUS_COMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CORPSE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + npc_beaten_corpseAI(Creature* creature) : ScriptedAI(creature) + { + } - player->SEND_GOSSIP_MENU(3557, creature->GetGUID()); - return true; - } + void sGossipSelect(Player* player, uint32 menuId, uint32 gossipListId) override + { + if (menuId == GOSSIP_MENU_OPTION_INSPECT_BODY && gossipListId == GOSSIP_OPTION_ID_BEATEN_CORPSE) + { + player->CLOSE_GOSSIP_MENU(); + player->TalkedToCreature(me->GetEntry(), me->GetGUID()); + } + } + }; + CreatureAI* GetAI(Creature* creature) const override + { + return new npc_beaten_corpseAI(creature); + } }; /*###### |