mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 08:28:32 +01:00
DB/Gossip: Add and fix a few more gossip menus.
This commit is contained in:
37
sql/updates/world/2013_07_15_03_world_gossip.sql
Normal file
37
sql/updates/world/2013_07_15_03_world_gossip.sql
Normal file
@@ -0,0 +1,37 @@
|
||||
-- Gossip fixup for Aleanna Edune
|
||||
UPDATE `creature_template` SET `gossip_menu_id`=361 WHERE `entry`=24734;
|
||||
DELETE FROM `gossip_menu` WHERE `entry` IN (361);
|
||||
INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (361,838);
|
||||
|
||||
-- Gossip fixup for Marli Wishrunner
|
||||
UPDATE `creature_template` SET `gossip_menu_id`=1421 WHERE `entry`=7773;
|
||||
DELETE FROM `gossip_menu` WHERE `entry` IN (1421);
|
||||
INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (1421,2053);
|
||||
|
||||
-- Gossip fixup for Kalin Windflight "This guy may be missing a script"
|
||||
UPDATE `creature_template` SET `gossip_menu_id`=1422 WHERE `entry`=7772;
|
||||
DELETE FROM `gossip_menu` WHERE `entry` IN (1422);
|
||||
INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (1422,2054);
|
||||
-- Gossip Options
|
||||
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1422);
|
||||
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES
|
||||
(1422,0,1, 'Can you help me get down?',3,128,0);
|
||||
|
||||
-- Gossip fixup for Henry Stern
|
||||
UPDATE `creature_template` SET `gossip_menu_id`=1443 WHERE `entry`=8696;
|
||||
DELETE FROM `gossip_menu` WHERE `entry` IN (1442,1443,1444,1501,1502);
|
||||
INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
|
||||
(1442,2115),(1443,2113),(1444,2114),(1501,2173),(1502,2174);
|
||||
-- Gossip Options
|
||||
DELETE FROM `gossip_menu_option` WHERE `menu_id` IN (1443);
|
||||
INSERT INTO `gossip_menu_option` (`menu_id`,`id`,`option_icon`,`option_text`,`option_id`,`npc_option_npcflag`,`action_menu_id`) VALUES
|
||||
(1443,0,0, 'You can cook? So can I! Is there a recipe you can teach me?',1,1,0),
|
||||
(1443,1,0, 'You''re an alchemist? So am I. Perhaps you can teach me what you know...',1,1,0);
|
||||
|
||||
-- Gossip Options Conditions
|
||||
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup`=1443;
|
||||
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
|
||||
(15,1443,0,0,0,7,0,185,0,0,0,0,'','Gossip Option requires cooking skill'),
|
||||
(15,1443,0,0,1,25,0,13028,0,0,1,0,'','Gossip Option requires player not learned spell'),
|
||||
(15,1443,1,0,0,7,0,171,0,0,0,0,'','Gossip Option requires alchemy skill'),
|
||||
(15,1443,1,0,1,25,0,3451,0,0,1,0,'','Gossip Option requires player not learned spell');
|
||||
@@ -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)
|
||||
npc_henry_sternAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action) OVERRIDE
|
||||
{
|
||||
player->CastSpell(player, SPELL_TEACHING_GOLDTHORN_TEA, true);
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_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);
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
if (action == GOSSIP_ACTION_INFO_DEF + 2)
|
||||
{
|
||||
player->CastSpell(player, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true);
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, creature->GetGUID());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user