From 2b1132c32a3e9bbcb45c1420075e31d9a3387404 Mon Sep 17 00:00:00 2001 From: _manuel_ Date: Thu, 25 Feb 2010 17:24:43 -0300 Subject: [PATCH] Implemented support for npc 34885. Code from ScriptDev2. --HG-- branch : trunk --- sql/FULL/world_scripts_full.sql | 1 + sql/updates/7436_world_scriptname.sql | 1 + src/scripts/northrend/icecrown.cpp | 31 +++++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 sql/updates/7436_world_scriptname.sql diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index dd9ae863af..7f1df0508f 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -727,6 +727,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_apothecary_hanes' WHERE `entry` /* ICECROWN */ UPDATE `creature_template` SET `ScriptName`='npc_arete' WHERE `entry`=29344; UPDATE `creature_template` SET `ScriptName`='valiant_challenge' WHERE `entry`=33518; +UPDATE `creature_template` SET `ScriptName`='npc_dame_evniki_kapsalis' WHERE `entry`=34885; /* IRONFORGE */ UPDATE `creature_template` SET `ScriptName`='npc_royal_historian_archesonus' WHERE `entry`=8879; diff --git a/sql/updates/7436_world_scriptname.sql b/sql/updates/7436_world_scriptname.sql new file mode 100644 index 0000000000..673303c058 --- /dev/null +++ b/sql/updates/7436_world_scriptname.sql @@ -0,0 +1 @@ +UPDATE `creature_template` SET `ScriptName`='npc_dame_evniki_kapsalis' WHERE `entry`=34885; \ No newline at end of file diff --git a/src/scripts/northrend/icecrown.cpp b/src/scripts/northrend/icecrown.cpp index 0867e19042..4c77e2e8f8 100644 --- a/src/scripts/northrend/icecrown.cpp +++ b/src/scripts/northrend/icecrown.cpp @@ -118,6 +118,31 @@ bool GossipHello_valiant_challenge(Player* player, Creature* _Creature) return true; } +/*###### +## npc_dame_evniki_kapsalis +######*/ + +enum eDameEnvikiKapsalis +{ + TITLE_CRUSADER = 123 +}; + +bool GossipHello_npc_dame_evniki_kapsalis(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->HasTitle(TITLE_CRUSADER)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + pPlayer->SEND_GOSSIP_MENU(pPlayer->GetGossipTextId(pCreature), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_dame_evniki_kapsalis(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_TRADE) + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + return true; +} + void AddSC_icecrown() { Script *newscript; @@ -132,4 +157,10 @@ void AddSC_icecrown() newscript->Name = "valiant_challenge"; newscript->pGossipHello = &GossipHello_valiant_challenge; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_dame_evniki_kapsalis"; + newscript->pGossipHello = &GossipHello_npc_dame_evniki_kapsalis; + newscript->pGossipSelect = &GossipSelect_npc_dame_evniki_kapsalis; + newscript->RegisterSelf(); }