diff options
author | Malcrom <malcromdev@gmail.com> | 2013-07-15 19:57:18 -0230 |
---|---|---|
committer | Malcrom <malcromdev@gmail.com> | 2013-07-15 19:57:18 -0230 |
commit | bd3fa71d32a43cb90faf8021df55b77bbc91ec38 (patch) | |
tree | 6e7405f5e25d10b8d7925b20da89077af3dd238d /src | |
parent | 53e50750055071f0fa5119392db2a9d1f4793cd5 (diff) |
DB/Gossip: Add and fix a few more gossip menus.
Diffstat (limited to 'src')
-rw-r--r-- | src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp | 70 |
1 files changed, 40 insertions, 30 deletions
diff --git a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp index 516cd6a41a2..320c9970077 100644 --- a/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp +++ b/src/server/scripts/Kalimdor/RazorfenDowns/razorfen_downs.cpp @@ -39,54 +39,64 @@ EndContentData */ enum Spells { - SPELL_GOLDTHORN_TEA = 13028, SPELL_TEACHING_GOLDTHORN_TEA = 13029, - SPELL_MIGHT_TROLLS_BLOOD_POTION = 3451, - SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030, + SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030 }; enum Gossips { - GOSSIP_TEXT_TEA_ANSWER = 2114, - GOSSIP_TEXT_POTION_ANSWER = 2115, + GOSSIP_COOKING_SKILL_HIGH = 1444, + GOSSIP_COOKING_SKILL_LOW = 1501, + GOSSIP_ALCHEMY_SKILL_HIGH = 1442, + GOSSIP_ALCHEMY_SKILL_LOW = 1502 }; -#define GOSSIP_ITEM_TEA "Teach me the cooking recipe" -#define GOSSIP_ITEM_POTION "Teach me the alchemy recipe" - class npc_henry_stern : public CreatureScript { public: npc_henry_stern() : CreatureScript("npc_henry_stern") { } - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) OVERRIDE + struct npc_henry_sternAI : public ScriptedAI { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1) - { - player->CastSpell(player, SPELL_TEACHING_GOLDTHORN_TEA, true); - player->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, creature->GetGUID()); - } + npc_henry_sternAI(Creature* creature) : ScriptedAI(creature) { } - if (action == GOSSIP_ACTION_INFO_DEF + 2) + void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action) OVERRIDE { - player->CastSpell(player, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true); - player->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, creature->GetGUID()); - } + if (action == 0) + { + if (player->GetBaseSkillValue(SKILL_COOKING) >= 175) + { + player->PrepareGossipMenu(me, GOSSIP_COOKING_SKILL_HIGH); + player->SendPreparedGossip(me); + DoCast(player, SPELL_TEACHING_GOLDTHORN_TEA); + } + else + { + player->PrepareGossipMenu(me, GOSSIP_COOKING_SKILL_LOW); + player->SendPreparedGossip(me); + } + } - return true; - } + if (action == 1) + { + if (player->GetBaseSkillValue(SKILL_ALCHEMY) >= 180) + { + player->PrepareGossipMenu(me, GOSSIP_ALCHEMY_SKILL_HIGH); + player->SendPreparedGossip(me); + DoCast(player, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION); + } + else + { + player->PrepareGossipMenu(me, GOSSIP_ALCHEMY_SKILL_LOW); + player->SendPreparedGossip(me); + } + } + } + }; - bool OnGossipHello(Player* player, Creature* creature) OVERRIDE + CreatureAI* GetAI(Creature* creature) const OVERRIDE { - if (player->GetBaseSkillValue(SKILL_COOKING) >= 175 && !player->HasSpell(SPELL_GOLDTHORN_TEA)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (player->GetBaseSkillValue(SKILL_ALCHEMY) >= 180 && !player->HasSpell(SPELL_MIGHT_TROLLS_BLOOD_POTION)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_POTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; + return new npc_henry_sternAI(creature); } }; |