From 076534852bbac37fce40e6e5cf46f021abbf034e Mon Sep 17 00:00:00 2001 From: v-mstrs <104088833+v-mstrs@users.noreply.github.com> Date: Sat, 22 Jul 2023 14:25:24 +0200 Subject: [PATCH] fix(DB/Quest): Port quests regarding Corki from Trinity (#16080) * fix Corki's issues, Trinity help * Remove * Update data/sql/updates/pending_db_world/rev_1682394052134857558.sql Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com> * Update data/sql/updates/pending_db_world/rev_1682394052134857558.sql Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com> * Update rev_1682394052134857558.sql * Update rev_1682394052134857558.sql * spelling mistakes * Update Co-authored-by: Killyana --------- Co-authored-by: v-mstrs Co-authored-by: Gultask <100873791+Gultask@users.noreply.github.com> Co-authored-by: Killyana --- .../rev_1682394052134857558.sql | 43 ++++++ src/server/scripts/Outland/zone_nagrand.cpp | 123 ------------------ 2 files changed, 43 insertions(+), 123 deletions(-) create mode 100644 data/sql/updates/pending_db_world/rev_1682394052134857558.sql diff --git a/data/sql/updates/pending_db_world/rev_1682394052134857558.sql b/data/sql/updates/pending_db_world/rev_1682394052134857558.sql new file mode 100644 index 000000000..7b1b524b1 --- /dev/null +++ b/data/sql/updates/pending_db_world/rev_1682394052134857558.sql @@ -0,0 +1,43 @@ +UPDATE `creature_template` SET `AIName` = 'SmartAI', `ScriptName`='' WHERE `entry` IN (18445,18369,20812); +UPDATE `gameobject_template` SET `Data2`=300000, `AIName`='SmartGameObjectAI', `ScriptName`='' WHERE `entry` IN (182521,182349,182350); +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (182521,182349,182350) AND `source_type`=1; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (18445,18369,20812) AND `source_type`=0; +DELETE FROM `smart_scripts` WHERE `entryorguid` IN (1844500,1836900,2081200) AND `source_type`=9; +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 +(182521, 1, 0 ,1,70, 0, 100, 0, 2, 0, 0,0,64,1,0,0,0,0,0,16,0,0,0,0, 0, 0, 0, 'Corkis Prison - On State Changed - Store Targetlist'), +(182521, 1, 1 ,2,61, 0, 100, 0, 0, 0, 0,0,100,1,0,0,0,0,0,19,18445,0,0,0, 0, 0, 0, 'Corkis Prison - Script - Send Targetlist'), +(182521, 1, 2 ,0,61, 0, 100, 0, 0, 0, 0,0,45,1,1,0,0,0,0,19,18445,0,0,0, 0, 0, 0, 'Corkis Prison - Script - Set Data'), +(18445, 0, 0 ,0,38, 0, 100, 0, 1, 1, 0,0,80,1844500,0,0,0,0,0,1,0,0,0,0, 0, 0, 0, 'Corki - On Data Set - Action list'), +(1844500, 9, 0 ,0,0, 0, 100, 0, 0, 0, 0,0,1,0,0,0,0,0,0,12,1,0,0,0, 0, 0, 0, 'Corki - Action list - Say'), +(1844500, 9, 1 ,0,0, 0, 100, 0, 0, 0, 0,0,33,18444,0,0,0,0,0,12,1,0,0,0, 0, 0, 0, 'Corki - Action list - Kill Credit'), +(1844500, 9, 2 ,0,0, 0, 100, 0, 4000, 4000, 0,0,69,0,0,0,0,0,0,8,0,0,0,-896.082, 8687.346, 170.455, 3.81311, 'Corki - Action listt - Move Forward'), +(1844500, 9, 3 ,0,0, 0, 100, 0, 4000, 4000, 0,0,41,0,0,0,0,0,0,1,0,0,0,0, 0, 0, 0, 'Corki - Action list - Despawn after 5 seconds'), +(182349, 1, 0 ,1,70, 0, 100, 0, 2, 0, 0,0,64,1,0,0,0,0,0,16,0,0,0,0, 0, 0, 0, 'Corkis Prison - On State Changed - Store Targetlist'), +(182349, 1, 1 ,2,61, 0, 100, 0, 0, 0, 0,0,100,1,0,0,0,0,0,19,18369,0,0,0, 0, 0, 0, 'Corkis Prison - Script - Send Targetlist'), +(182349, 1, 2 ,0,61, 0, 100, 0, 0, 0, 0,0,45,1,1,0,0,0,0,19,18369,0,0,0, 0, 0, 0, 'Corkis Prison - Script - Set Data'), +(18369, 0, 0 ,0,38, 0, 100, 0, 1, 1, 0,0,80,1836900,0,0,0,0,0,1,0,0,0,0, 0, 0, 0, 'Corki - On Data Set - Action list'), +(1836900, 9, 0 , 0, 0, 0, 100, 0, 0, 0, 0,0,1,0,0,0,0,0,0,12,1,0,0,0, 0, 0, 0, 'Corki - Action list - Say'), +(1836900, 9, 1 , 0, 0, 0, 100, 0, 0, 0, 0,0,33,18369,0,0,0,0,0,12,1,0,0,0, 0, 0, 0, 'Corki - Action list - Kill Credit'), +(1836900, 9, 2 ,0,0, 0, 100, 0, 4000, 4000, 0,0,69,0,0,0,0,0,0,8,0,0,0,-2547.684, 6271.637, 14.767, 5.349, 'Corki - Action list - Move Forward'), +(1836900, 9, 3 , 0, 0, 0, 100, 0, 4000, 4000, 0,0,41,0,0,0,0,0,0,1,0,0,0,0, 0, 0, 0, 'Corki - Action list - Despawn after 5 seconds'), +(182350, 1, 0 ,1,70, 0, 100, 0, 2, 0, 0,0,64,1,0,0,0,0,0,16,0,0,0,0, 0, 0, 0, 'Corkis Prison - On State Changed - Store Targetlist'), +(182350, 1, 1 ,2,61, 0, 100, 0, 0, 0, 0,0,100,1,0,0,0,0,0,19,20812,0,0,0, 0, 0, 0, 'Corkis Prison - Script - Send Targetlist'), +(182350, 1, 2 ,0,61, 0, 100, 0, 0, 0, 0,0,45,1,1,0,0,0,0,19,20812,0,0,0, 0, 0, 0, 'Corkis Prison - Script - Set Data'), +(20812, 0, 0 ,0,38, 0, 100, 0, 1, 1, 0,0,80,2081200,0,0,0,0,0,1,0,0,0,0, 0, 0, 0, 'Corki - On Data Set - Action list'), +(2081200, 9, 0 , 0, 0, 0, 100, 0, 0, 0, 0,0,1,0,0,0,0,0,0,12,1,0,0,0, 0, 0, 0, 'Corki - Action list - Say'), +(2081200, 9, 1 , 0, 0, 0, 100, 0, 0, 0, 0,0,33,20812,0,0,0,0,0,12,1,0,0,0, 0, 0, 0, 'Corki - Action list - Kill Credit'), +(2081200, 9, 2 , 0, 0, 0, 100, 0, 4000, 4000, 0,0,69,0,0,0,0,0,0,8,0,0,0,-1001.022, 8113.366, -95.849, 0.352908, 'Corki - Action list - Move Forward'), +(2081200, 9, 3 , 0, 0, 0, 100, 0, 4000, 4000, 0,0,41,0,0,0,0,0,0,1,0,0,0,0, 0, 0, 0, 'Corki - Action list - Despawn after 5 seconds'); + +UPDATE `creature` SET `position_x`=-2563.89,`position_y`=6288.29,`position_z`=15.295,`orientation`=5.23599 WHERE `guid`=65786 AND `id1`=18369; +UPDATE `creature` SET `position_x`=-918.143,`position_y`=8663.94,`position_z`=172.542,`orientation`=0.523599 WHERE `guid`=65849 AND `id1`=18445; + +DELETE FROM `creature_questender` WHERE `id` IN (18369,18445); +INSERT INTO `creature_questender` (`id`, `quest`) VALUES +(18445, 9954); + +DELETE FROM `creature_queststarter` WHERE `id` IN (18369,18445); +INSERT INTO `creature_queststarter` (`id`, `quest`) VALUES +(18369, 9923), +(18445, 9955); + diff --git a/src/server/scripts/Outland/zone_nagrand.cpp b/src/server/scripts/Outland/zone_nagrand.cpp index 39d7d95bd..5b8590169 100644 --- a/src/server/scripts/Outland/zone_nagrand.cpp +++ b/src/server/scripts/Outland/zone_nagrand.cpp @@ -259,127 +259,6 @@ public: }; }; -/*###### -## go_corkis_prison and npc_corki -######*/ - -enum CorkiData -{ - // first quest - QUEST_HELP = 9923, - NPC_CORKI = 18445, - NPC_CORKI_CREDIT_1 = 18369, - GO_CORKIS_PRISON = 182349, - CORKI_SAY_THANKS = 0, - // 2nd quest - QUEST_CORKIS_GONE_MISSING_AGAIN = 9924, - NPC_CORKI_2 = 20812, - GO_CORKIS_PRISON_2 = 182350, - CORKI_SAY_PROMISE = 0, - // 3rd quest - QUEST_CHOWAR_THE_PILLAGER = 9955, - NPC_CORKI_3 = 18369, - NPC_CORKI_CREDIT_3 = 18444, - GO_CORKIS_PRISON_3 = 182521, - CORKI_SAY_LAST = 0 -}; - -class go_corkis_prison : public GameObjectScript -{ -public: - go_corkis_prison() : GameObjectScript("go_corkis_prison") { } - - bool OnGossipHello(Player* player, GameObject* go) override - { - go->SetGoState(GO_STATE_READY); - if (go->GetEntry() == GO_CORKIS_PRISON) - { - if (Creature* corki = go->FindNearestCreature(NPC_CORKI, 25, true)) - { - corki->GetMotionMaster()->MovePoint(1, go->GetPositionX() + 5, go->GetPositionY(), go->GetPositionZ()); - if (player) - player->KilledMonsterCredit(NPC_CORKI_CREDIT_1); - } - } - - if (go->GetEntry() == GO_CORKIS_PRISON_2) - { - if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true)) - { - corki->GetMotionMaster()->MovePoint(1, go->GetPositionX() - 5, go->GetPositionY(), go->GetPositionZ()); - if (player) - player->KilledMonsterCredit(NPC_CORKI_2); - } - } - - if (go->GetEntry() == GO_CORKIS_PRISON_3) - { - if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true)) - { - corki->GetMotionMaster()->MovePoint(1, go->GetPositionX() + 4, go->GetPositionY(), go->GetPositionZ()); - if (player) - player->KilledMonsterCredit(NPC_CORKI_CREDIT_3); - } - } - - return true; - } -}; - -class npc_corki : public CreatureScript -{ -public: - npc_corki() : CreatureScript("npc_corki") { } - - CreatureAI* GetAI(Creature* creature) const override - { - return new npc_corkiAI(creature); - } - - struct npc_corkiAI : public ScriptedAI - { - npc_corkiAI(Creature* creature) : ScriptedAI(creature) { } - - uint32 Say_Timer; - bool ReleasedFromCage; - - void Reset() override - { - Say_Timer = 5000; - ReleasedFromCage = false; - } - - void UpdateAI(uint32 diff) override - { - if (ReleasedFromCage) - { - if (Say_Timer <= diff) - { - me->DespawnOrUnsummon(); - ReleasedFromCage = false; - } - else - Say_Timer -= diff; - } - } - - void MovementInform(uint32 type, uint32 id) override - { - if (type == POINT_MOTION_TYPE && id == 1) - { - Say_Timer = 5000; - ReleasedFromCage = true; - if (me->GetEntry() == NPC_CORKI) - Talk(CORKI_SAY_THANKS); - if (me->GetEntry() == NPC_CORKI_2) - Talk(CORKI_SAY_PROMISE); - if (me->GetEntry() == NPC_CORKI_3) - Talk(CORKI_SAY_LAST); - } - }; - }; -}; - /*##### ## npc_kurenai_captive #####*/ @@ -608,8 +487,6 @@ void AddSC_nagrand() { new npc_maghar_captive(); new npc_creditmarker_visit_with_ancestors(); - new npc_corki(); - new go_corkis_prison(); new npc_kurenai_captive(); new go_warmaul_prison(); }