From 9e2083b4c8c00b06d1c4cb26e4a0b5253f6ca0d5 Mon Sep 17 00:00:00 2001 From: Malcrom Date: Mon, 1 Jul 2013 19:43:35 -0230 Subject: [PATCH] Core/Scripting: Update spirit of Olum to use db gossip. --- .../world/2013_07_01_06_world_gossip.sql | 7 +++ .../Outland/BlackTemple/black_temple.cpp | 47 +++++++------------ 2 files changed, 24 insertions(+), 30 deletions(-) create mode 100644 sql/updates/world/2013_07_01_06_world_gossip.sql diff --git a/sql/updates/world/2013_07_01_06_world_gossip.sql b/sql/updates/world/2013_07_01_06_world_gossip.sql new file mode 100644 index 0000000000..88dcc711c2 --- /dev/null +++ b/sql/updates/world/2013_07_01_06_world_gossip.sql @@ -0,0 +1,7 @@ +-- I sense you've cleared the path to my brethren. My connection to them and to the temple is still strong. Do you wish to delve deeper inside? +UPDATE `creature_template` SET `gossip_menu_id`=8750 WHERE `entry`=23411; +DELETE FROM `gossip_menu` WHERE `entry`=8750 AND `text_id`=11081; +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES (8750, 11081); +DELETE FROM `gossip_menu_option` WHERE (`menu_id`=8750 AND `id`=1); +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `box_coded`, `box_money`, `box_text`) VALUES +(8750, 1, 0, 'Take me to the other Deathsworn, Olum.', 0, 0, ''); diff --git a/src/server/scripts/Outland/BlackTemple/black_temple.cpp b/src/server/scripts/Outland/BlackTemple/black_temple.cpp index f8467b297c..4f7a70a80a 100644 --- a/src/server/scripts/Outland/BlackTemple/black_temple.cpp +++ b/src/server/scripts/Outland/BlackTemple/black_temple.cpp @@ -1,6 +1,5 @@ /* * Copyright (C) 2008-2013 TrinityCore - * Copyright (C) 2006-2009 ScriptDev2 * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the @@ -16,16 +15,15 @@ * with this program. If not, see . */ -/* ScriptData -SDName: Black_Temple -SD%Complete: 95 -SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. @todo Find proper gossip. -SDCategory: Black Temple -EndScriptData */ +/* +Name: Black_Temple +Complete: 100% +Comment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. +*/ -/* ContentData +/* Content npc_spirit_of_olum -EndContentData */ +*/ #include "ScriptMgr.h" #include "ScriptedCreature.h" @@ -37,36 +35,25 @@ EndContentData */ # npc_spirit_of_olum ####*/ -#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's -#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn" +enum Spells +{ + SPELL_TELEPORT = 39833 +}; class npc_spirit_of_olum : public CreatureScript { public: npc_spirit_of_olum() : CreatureScript("npc_spirit_of_olum") { } - bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action) + void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action) { - player->PlayerTalkClass->ClearMenus(); - if (action == GOSSIP_ACTION_INFO_DEF + 1) + if (action == 1) + { player->CLOSE_GOSSIP_MENU(); - - player->InterruptNonMeleeSpells(false); - player->CastSpell(player, SPELL_TELEPORT, false); - return true; + player->InterruptNonMeleeSpells(false); + player->CastSpell(player, SPELL_TELEPORT, false); + } } - - bool OnGossipHello(Player* player, Creature* creature) - { - InstanceScript* instance = creature->GetInstanceScript(); - - if (instance && (instance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (instance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - }; void AddSC_black_temple()