diff options
author | treeston <treeston.mmoc@gmail.com> | 2016-01-12 18:32:51 +0100 |
---|---|---|
committer | treeston <treeston.mmoc@gmail.com> | 2016-01-12 18:32:51 +0100 |
commit | e203d78d2a6daa2dc28fc41769e416753a10c08c (patch) | |
tree | 1cd6bb828838b3350a1b801a7afc86759c315ed3 | |
parent | 8ef9ea9157ca6c04194888a2118be7daf303856f (diff) | |
parent | d87f504b538f226c9b95f2683d8c1750bc62009e (diff) |
Merge remote-tracking branch 'velinath/sai-migrations' into 3.3.5-base
-rw-r--r-- | sql/updates/world/2016_01_12_00_world.sql | 125 | ||||
-rw-r--r-- | src/server/game/Scripting/ScriptLoader.cpp | 2 | ||||
-rw-r--r-- | src/server/scripts/World/npc_taxi.cpp | 117 |
3 files changed, 125 insertions, 119 deletions
diff --git a/sql/updates/world/2016_01_12_00_world.sql b/sql/updates/world/2016_01_12_00_world.sql new file mode 100644 index 00000000000..8ed4099450b --- /dev/null +++ b/sql/updates/world/2016_01_12_00_world.sql @@ -0,0 +1,125 @@ +-- Susurrus +-- Add sniffed gossip text to menu +DELETE FROM `gossip_menu_option` WHERE `menu_id` = 7415; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(7415, 0, 0, 'I am ready to be flown down to the Exodar.',14010,1,1,0,0,0,0,'',0); + +DELETE FROM `npc_text` WHERE `ID` = 8955; +INSERT INTO `npc_text` (`ID`, `text0_0`, `text0_1`, `BroadcastTextID0`, `lang0`, `Probability0`, `em0_0`, `em0_1`, `em0_2`, `em0_3`, `em0_4`, `em0_5`) VALUES +(8955, 'Are you ready, $n?', '', 14012, 0, 1, 0, 0, 0, 0, 0, 0); + +-- Set second gossip in gossip menu +DELETE FROM `gossip_menu` WHERE `entry` = 7415; +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(7415, 8954), +(7415, 8955); + +-- Migrate NPC to use SmartAI +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 17435; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14, 15) AND `SourceGroup` = 7415; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,7415,8954,0,0,2,0,23843,1,0,1,0,'','Susurrus - Show gossip menu text if player does not have item 23843 in inventory'), +(14,7415,8955,0,0,2,0,23843,1,0,0,0,'','Susurrus - Show gossip menu text if player has item 23843 in inventory'), +(15,7415,0,0,0,2,0,23843,1,0,0,0,'','Susurrus - Show gossip option 0 if player has item 23843 in inventory'); + +-- Create SmartAI for Susurrus +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 17435); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(17435,0,0,1,62,0,100,0,7415,0,0,0,11,32474,0,0,0,0,0,7,0,0,0,0,0,0,0,'Susurrus - On Gossip Option 0 Selected - Cast Spell 32474'), +(17435,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Susurrus - On Linked Actions - Close Gossip'); + + +-- Protectorate Nether Drake +-- Add sniffed gossip text to menu +DELETE FROM `gossip_menu_option` WHERE `menu_id` = 8229; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(8229, 0, 0, 'I''m ready to fly! Take me up, dragon!',18637,1,1,0,0,0,0,'',0); + +-- Migrate NPC to use SmartAI +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 20903; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` = 15 AND `SourceGroup` = 8229; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,8229,0,0,0,2,0,29778,1,0,0,0,'','Protectorate Nether Drake - Show gossip option 0 if player has item 23843 in inventory'), +(15,8229,0,0,0,9,0,10438,0,0,0,0,'','Protectorate Nether Drake - Show gossip option 0 if player has quest 10438'); +-- Create SmartAI for Protectorate Nether Drake +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 20903); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(20903,0,0,1,62,0,100,0,8229,0,0,0,52,627,0,0,0,0,0,7,0,0,0,0,0,0,0,'Protectorate Nether Drake - On Gossip Option 0 Selected - Init Taxi Path 627'), +(20903,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Protectorate Nether Drake - On Linked Actions - Close Gossip'); + + +-- Veronia +-- Add sniffed gossip text to menu +DELETE FROM `gossip_menu_option` WHERE `menu_id` = 8082; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(8082, 0, 0, 'I''m as ready as I''ll ever be.',17761,1,1,0,0,0,0,'',0); + +DELETE FROM `gossip_menu` WHERE `entry` = 8082; +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(8082, 9989), +(8082, 9990); + +-- Migrate NPC to use SmartAI +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 20162; + +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (14,15) AND `SourceGroup` = 8082; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,8082,9989,0,0,28,0,10652,0,0,1,0,'','Veronia - Show gossip menu text if player does not have quest 10652'), +(14,8082,9990,0,0,28,0,10652,0,0,0,0,'','Veronia - Show gossip menu text if player has quest 10652'), +(15,8082,0,0,0,28,0,10652,0,0,0,0,'','Veronia - Show gossip option 0 if player has quest 10652'); +-- Create SmartAI for Veronia +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 20162); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(20162,0,0,1,62,0,100,0,8082,0,0,0,85,34905,0,0,0,0,0,7,0,0,0,0,0,0,0,'Veronia - On Gossip Option 0 Selected - Invoker Cast \'Stealth Flight\''), +(20162,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Veronia - On Linked Actions - Close Gossip'); + + +-- Cassa Crimsonwing +-- Add sniffed gossip text to menu +DELETE FROM `gossip_menu_option` WHERE `menu_id` = 8782; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(8782, 0, 0, 'Lady Jaina told me to speak to you about using a gryphon to survey Alcaz Island.',22176,1,1,0,0,0,0,'',0); + +-- Migrate NPC to use SmartAI +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 23704; + +-- Condition: Gossip menu ID 0 needs quest ID 11142 to be incomplete. +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`= 15 AND `SourceGroup` = 8782 AND `SourceEntry` = 0; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(15,8782,0,0,0,9,0,11142,0,0,0,0,'','Cassa Crimsonwing - Show gossip option 0 if player has taken quest ID 11142'); + +-- Create SmartAI for Cassa Crimsonwing +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 23704); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(23704,0,0,1,62,0,100,0,8782,0,0,0,11,42295,0,0,0,0,0,7,0,0,0,0,0,0,0,'Cassa Crimsonwing - On Gossip Option 0 Selected - Cast Spell 42295'), +(23704,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Cassa Crimsonwing - On Linked Actions - Close Gossip'); + + +-- Brazen +-- Add sniffed gossip text to menu +DELETE FROM `gossip_menu_option` WHERE `menu_id` = 7959; +INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `OptionBroadcastTextID`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`, `BoxBroadcastTextID`) VALUES +(7959, 0, 0, 'I''m ready to go to Durnholde Keep.',16461,1,1,0,0,0,0,'',0); + +DELETE FROM `gossip_menu` WHERE `entry` = 7959; +INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES +(7959, 9779), +(7959, 9780); + +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName` = '' WHERE `entry` = 18725; + +-- Condition: On gossip menu click, if item exists, perform linked action +-- Condition: On gossip menu click, if item exists, perform linked action +DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`IN (14, 15) AND `SourceGroup` = 7959; +INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`SourceId`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionTarget`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES +(14,7959,9779,0,0,2,0,25853,1,0,0,0,'','Brazen - Show gossip menu text if player has item 25853'), +(14,7959,9780,0,0,2,0,25853,1,0,1,0,'','Brazen - Show gossip menu text if player does not have item 25853'), +(15,7959,0,0,0,2,0,25853,1,0,0,0,'','Brazen - Show gossip option 0 if player has item 25853'); + +-- Create SmartAI for Brazen +DELETE FROM `smart_scripts` WHERE (source_type = 0 AND entryorguid = 18725); +INSERT INTO `smart_scripts` (`entryorguid`, `source_type`, `id`, `link`, `event_type`, `event_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action_type`, `action_param1`, `action_param2`, `action_param3`, `action_param4`, `action_param5`, `action_param6`, `target_type`, `target_param1`, `target_param2`, `target_param3`, `target_x`, `target_y`, `target_z`, `target_o`, `comment`) VALUES +(18725,0,0,1,62,0,100,0,7959,0,0,0,52,534,0,0,0,0,0,7,0,0,0,0,0,0,0,'Brazen - On Gossip Option 0 Selected - Activate Taxi Path 534'), +(18725,0,1,0,61,0,100,0,0,0,0,0,72,0,0,0,0,0,0,7,0,0,0,0,0,0,0,'Brazen - On Linked Actions - Close Gossip'); diff --git a/src/server/game/Scripting/ScriptLoader.cpp b/src/server/game/Scripting/ScriptLoader.cpp index 0b9a53649a9..2922e4ef58d 100644 --- a/src/server/game/Scripting/ScriptLoader.cpp +++ b/src/server/game/Scripting/ScriptLoader.cpp @@ -89,7 +89,6 @@ void AddSC_item_scripts(); void AddSC_npc_professions(); void AddSC_npc_innkeeper(); void AddSC_npcs_special(); -void AddSC_npc_taxi(); void AddSC_achievement_scripts(); void AddSC_action_ip_logger(); void AddSC_duel_reset(); @@ -781,7 +780,6 @@ void AddWorldScripts() AddSC_npc_professions(); AddSC_npc_innkeeper(); AddSC_npcs_special(); - AddSC_npc_taxi(); AddSC_achievement_scripts(); AddSC_chat_log(); // location: scripts\World\chat_log.cpp // To avoid duplicate code, we check once /*ONLY*/ if logging is permitted or not. diff --git a/src/server/scripts/World/npc_taxi.cpp b/src/server/scripts/World/npc_taxi.cpp deleted file mode 100644 index a200ba545d8..00000000000 --- a/src/server/scripts/World/npc_taxi.cpp +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/> - * Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> - * - * 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 - * Free Software Foundation; either version 2 of the License, or (at your - * option) any later version. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License along - * with this program. If not, see <http://www.gnu.org/licenses/>. - */ - -/* ScriptData -SDName: Npc_Taxi -SD%Complete: 0% -SDComment: To be used for taxi NPCs that are located globally. -SDCategory: NPCs -EndScriptData -*/ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "Player.h" -#include "WorldSession.h" - -#define GOSSIP_SUSURRUS "I am ready." -#define GOSSIP_NETHER_DRAKE "I'm ready to fly! Take me up, dragon!" -#define GOSSIP_BRAZEN "I am ready to go to Durnholde Keep." -#define GOSSIP_VERONIA "Fly me to Manaforge Coruu please" -#define GOSSIP_CRIMSONWING "<Ride the gryphons to Survey Alcaz Island>" - -class npc_taxi : public CreatureScript -{ -public: - npc_taxi() : CreatureScript("npc_taxi") { } - - bool OnGossipHello(Player* player, Creature* creature) override - { - if (creature->IsQuestGiver()) - player->PrepareQuestMenu(creature->GetGUID()); - - switch (creature->GetEntry()) - { - case 17435: // Azuremyst Isle - Susurrus - if (player->HasItemCount(23843, 1, true)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SUSURRUS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - break; - case 20903: // Netherstorm - Protectorate Nether Drake - if (player->GetQuestStatus(10438) == QUEST_STATUS_INCOMPLETE && player->HasItemCount(29778)) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_NETHER_DRAKE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - break; - case 18725: // Old Hillsbrad Foothills - Brazen - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BRAZEN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - break; - case 20162: // Netherstorm - Veronia - //Behind Enemy Lines - if (player->GetQuestStatus(10652) != QUEST_STATUS_REWARDED) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_VERONIA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15); - break; - case 23704: // Dustwallow Marsh - Cassa Crimsonwing - if (player->GetQuestStatus(11142) == QUEST_STATUS_INCOMPLETE) - player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_CRIMSONWING, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+25); - break; - } - - player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID()); - return true; - } - - bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override - { - player->PlayerTalkClass->ClearMenus(); - switch (action) - { - case GOSSIP_ACTION_INFO_DEF: - //spellId is correct, however it gives flight a somewhat funny effect //TaxiPath 506. - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, 32474, true); - break; - case GOSSIP_ACTION_INFO_DEF + 1: - player->CLOSE_GOSSIP_MENU(); - player->ActivateTaxiPathTo(627); //TaxiPath 627 (possibly 627+628(152->153->154->155)) - break; - case GOSSIP_ACTION_INFO_DEF + 2: - if (!player->HasItemCount(25853)) - player->SEND_GOSSIP_MENU(9780, creature->GetGUID()); - else - { - player->CLOSE_GOSSIP_MENU(); - player->ActivateTaxiPathTo(534); //TaxiPath 534 - } - break; - case GOSSIP_ACTION_INFO_DEF + 15: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, 34905, true); //TaxiPath 606 - break; - case GOSSIP_ACTION_INFO_DEF + 25: - player->CLOSE_GOSSIP_MENU(); - player->CastSpell(player, 42295, true); - break; - } - - return true; - } -}; - -void AddSC_npc_taxi() -{ - new npc_taxi; -} |