diff options
author | offl <offl@users.noreply.github.com> | 2020-07-06 23:34:41 +0200 |
---|---|---|
committer | Killyana <Killyana@users.noreply.github.com> | 2020-07-06 23:34:41 +0200 |
commit | c29e3b46af49e3baeb3da01f839aa9eb1a44bb7b (patch) | |
tree | 6f66c1b0f6618695dcae465da1121be8f782b58a | |
parent | 7b010ca65bd8d9e023a1402862327e4937491a1f (diff) |
DB/Quest: Convert & update support for 'Protect Kaya' to SAI
Closes #24923
-rw-r--r-- | sql/updates/world/3.3.5/2020_07_05_06_world.sql | 68 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/kalimdor_script_loader.cpp | 4 | ||||
-rw-r--r-- | src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp | 106 |
3 files changed, 70 insertions, 108 deletions
diff --git a/sql/updates/world/3.3.5/2020_07_05_06_world.sql b/sql/updates/world/3.3.5/2020_07_05_06_world.sql new file mode 100644 index 00000000000..dfbd82e8920 --- /dev/null +++ b/sql/updates/world/3.3.5/2020_07_05_06_world.sql @@ -0,0 +1,68 @@ +-- Kaya Flathoof SAI (https://www.youtube.com/watch?v=axY4vXGm7Q4) +SET @ID := 11856; +UPDATE `creature_template` SET `AIName` = "SmartAI", `ScriptName` = "" WHERE `entry` = @ID; +DELETE FROM `smart_scripts` WHERE `entryorguid` = @ID AND `source_type` = 0; +DELETE FROM `smart_scripts` WHERE `entryorguid` BETWEEN @ID*100+0 AND @ID*100+2 AND `source_type` = 9; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 11910 AND `source_type` = 0 AND `id` = 1; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 11912 AND `source_type` = 0 AND `id` = 2; +DELETE FROM `smart_scripts` WHERE `entryorguid` = 11913 AND `source_type` = 0 AND `id` = 3; +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`,`event_param5`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_param4`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES +(@ID,0,0,0,19,0,100,0,6523,0,0,0,0,80,@ID*100+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Quest 'Protect Kaya' Taken - Run Script"), +(@ID,0,1,0,40,0,100,0,17,0,0,0,0,80,@ID*100+1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Waypoint 17 Reached - Run Script"), +(@ID,0,2,0,40,0,100,0,19,0,0,0,0,80,@ID*100+2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Waypoint 19 Reached - Run Script"), +(@ID,0,3,0,6,0,100,0,0,0,0,0,0,6,6523,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Kaya Flathoof - On Death - Fail Quest 'Protect Kaya'"), + +(@ID*100+0,9,0,0,0,0,100,0,0,0,0,0,0,64,1,0,0,0,0,0,16,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Store Targetlist"), +(@ID*100+0,9,1,0,0,0,100,0,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Remove NPC Flag Questgiver"), +(@ID*100+0,9,2,0,0,0,100,0,0,0,0,0,0,1,0,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Say Line 0"), +(@ID*100+0,9,3,0,0,0,100,0,5000,5000,0,0,0,53,0,11856,0,0,0,2,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Start Waypoint"), +(@ID*100+0,9,4,0,0,0,100,0,0,0,0,0,0,19,512,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Remove Flag Immune To NPC's"), +(@ID*100+0,9,5,0,0,0,100,0,0,0,0,0,0,2,113,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Set Faction 113"), + +(@ID*100+1,9,0,0,0,0,100,0,0,0,0,0,0,54,7000,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Pause Waypoint"), +-- She should not be attacked instantly, probably it's done by another way +(@ID*100+1,9,1,0,0,0,100,0,0,0,0,0,0,18,512,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Add Flag Immune To NPC's"), +(@ID*100+1,9,2,0,0,0,100,0,2000,2000,0,0,0,107,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Summon Group 0"), +(@ID*100+1,9,3,0,0,0,100,0,2000,2000,0,0,0,1,1,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Say Line 1"), +(@ID*100+1,9,4,0,0,0,100,0,3000,3000,0,0,0,19,512,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Remove Flag Immune To NPC's"), + +(@ID*100+2,9,0,0,0,0,100,0,0,0,0,0,0,54,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Pause Waypoint"), +(@ID*100+2,9,1,0,0,0,100,0,1000,1000,0,0,0,66,0,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Set Orientation Stored Target 1"), +(@ID*100+2,9,2,0,0,0,100,0,0,0,0,0,0,1,2,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Say Line 2"), +(@ID*100+2,9,3,0,0,0,100,0,5000,5000,0,0,0,26,6523,0,0,0,0,0,12,1,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Quest Credit 'Protect Kaya'"), +(@ID*100+2,9,4,0,0,0,100,0,0,0,0,0,0,41,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,"Kaya Flathoof - On Script - Despawn (0)"), + +(11910,0,1,0,54,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,21,30,0,0,0,0,0,0,0,"Grimtotem Ruffian - On Just Summoned - Start Attacking Closest Player"), +(11912,0,2,0,54,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,21,30,0,0,0,0,0,0,0,"Grimtotem Brute - On Just Summoned - Start Attacking Closest Player"), +(11913,0,3,0,54,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,21,30,0,0,0,0,0,0,0,"Grimtotem Sorcerer - On Just Summoned - Start Attacking Closest Player"); + +UPDATE `creature_text` SET `comment` = "Kaya Flathoof" WHERE `CreatureID` = @ID; + +DELETE FROM `creature_summon_groups` WHERE `summonerId` = @ID; +INSERT INTO `creature_summon_groups` (`summonerId`,`summonerType`,`groupId`,`entry`,`position_x`,`position_y`,`position_z`,`orientation`,`summonType`,`summonTime`,`Comment`) VALUES +(@ID,0,0,11910,-50.75,-500.77,-46.13,0.4,4,60000,"Kaya Flathoof - Group 0 - Grimtotem Ruffian"), +(@ID,0,0,11912,-40.05,-510.89,-46.05,1.7,4,60000,"Kaya Flathoof - Group 0 - Grimtotem Brute"), +(@ID,0,0,11913,-32.21,-499.20,-45.35,2.8,4,60000,"Kaya Flathoof - Group 0 - Grimtotem Sorcerer"); + +DELETE FROM `script_waypoint` WHERE `entry` = 11856; +DELETE FROM `waypoints` WHERE `entry` = 11856; +INSERT INTO `waypoints` (`entry`,`pointid`,`position_x`,`position_y`,`position_z`,`point_comment`) VALUES +(11856,1,113.91,-350.13,4.55,"Kaya Flathoof"), +(11856,2,109.54,-350.08,3.74,"Kaya Flathoof"), +(11856,3,106.95,-353.4,3.6,"Kaya Flathoof"), +(11856,4,100.28,-338.89,2.97,"Kaya Flathoof"), +(11856,5,110.11,-320.26,3.47,"Kaya Flathoof"), +(11856,6,109.78,-287.8,5.3,"Kaya Flathoof"), +(11856,7,105.02,-269.71,4.71,"Kaya Flathoof"), +(11856,8,86.71,-251.81,5.34,"Kaya Flathoof"), +(11856,9,64.1,-246.38,5.91,"Kaya Flathoof"), +(11856,10,-2.55,-243.58,6.3,"Kaya Flathoof"), +(11856,11,-27.78,-267.53,-1.08,"Kaya Flathoof"), +(11856,12,-31.27,-283.54,-4.36,"Kaya Flathoof"), +(11856,13,-28.96,-322.44,-9.19,"Kaya Flathoof"), +(11856,14,-35.63,-360.03,-16.59,"Kaya Flathoof"), +(11856,15,-58.3,-412.26,-30.6,"Kaya Flathoof"), +(11856,16,-58.88,-474.17,-44.54,"Kaya Flathoof"), +(11856,17,-45.92,-496.57,-46.26,"Kaya Flathoof"), +(11856,18,-40.25,-510.07,-46.05,"Kaya Flathoof"), +(11856,19,-38.88,-520.72,-46.06,"Kaya Flathoof"); diff --git a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp index eeed526e084..897c46cc1d4 100644 --- a/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp +++ b/src/server/scripts/Kalimdor/kalimdor_script_loader.cpp @@ -117,7 +117,7 @@ void AddSC_feralas(); void AddSC_moonglade(); void AddSC_orgrimmar(); void AddSC_silithus(); -void AddSC_stonetalon_mountains(); +// void AddSC_stonetalon_mountains(); void AddSC_tanaris(); void AddSC_the_barrens(); void AddSC_thousand_needles(); @@ -230,7 +230,7 @@ void AddKalimdorScripts() AddSC_moonglade(); AddSC_orgrimmar(); AddSC_silithus(); - AddSC_stonetalon_mountains(); + // AddSC_stonetalon_mountains(); AddSC_tanaris(); AddSC_the_barrens(); AddSC_thousand_needles(); diff --git a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp b/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp deleted file mode 100644 index 7f6fbd978fd..00000000000 --- a/src/server/scripts/Kalimdor/zone_stonetalon_mountains.cpp +++ /dev/null @@ -1,106 +0,0 @@ -/* - * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information - * - * 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/>. - */ - -#include "ScriptMgr.h" -#include "ScriptedCreature.h" -#include "ScriptedGossip.h" -#include "ScriptedEscortAI.h" -#include "Player.h" - -/*###### -## npc_kaya_flathoof -######*/ - -enum Kaya -{ - NPC_GRIMTOTEM_RUFFIAN = 11910, - NPC_GRIMTOTEM_BRUTE = 11912, - NPC_GRIMTOTEM_SORCERER = 11913, - - SAY_START = 0, - SAY_AMBUSH = 1, - SAY_END = 2, - - QUEST_PROTECT_KAYA = 6523 -}; - -class npc_kaya_flathoof : public CreatureScript -{ -public: - npc_kaya_flathoof() : CreatureScript("npc_kaya_flathoof") { } - - struct npc_kaya_flathoofAI : public EscortAI - { - npc_kaya_flathoofAI(Creature* creature) : EscortAI(creature) { } - - void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override - { - Player* player = GetPlayerForEscort(); - if (!player) - return; - - switch (waypointId) - { - case 16: - Talk(SAY_AMBUSH); - me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - break; - case 18: - me->SetFacingToObject(player); - Talk(SAY_END); - player->GroupEventHappens(QUEST_PROTECT_KAYA, me); - break; - } - } - - void JustSummoned(Creature* summoned) override - { - summoned->AI()->AttackStart(me); - } - - void Reset() override { } - - void QuestAccept(Player* player, Quest const* quest) override - { - if (quest->GetQuestId() == QUEST_PROTECT_KAYA) - { - Start(true, false, player->GetGUID()); - - Talk(SAY_START); - me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE); - me->SetImmuneToPC(false); - } - } - }; - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_kaya_flathoofAI(creature); - } - -}; - -/*###### -## AddSC -######*/ - -void AddSC_stonetalon_mountains() -{ - new npc_kaya_flathoof(); -} |