Trinitycore: DB/Quest: Sunken Treasure

Created on 19 Aug 2018  路  1Comment  路  Source: TrinityCore/TrinityCore

Description:

  • Convert Professor Phizzlethorpe into SAI
  • Professor Phizzlethorpe should not despawn when the escort is finished
  • Set different spawn positions for Vengeful Surges (they shouldn't spawn on top of each other)

This will require the complete removal of: https://github.com/TrinityCore/TrinityCore/blob/3.3.5/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp

Branch(es):

3.3.5

TC rev. hash/commit:

TrinityCore rev. 1cc3d33 2018-02-19 20:21:57 +0100 (3.3.5 branch) (Win64, RelWithDebInfo, Static)

TDB version: 335.64

Operating system: Windows 7

Suggested Fix:
``sql -- Professor Phizzlethorpe UPDATEcreature_templateSETAIName="SmartAI",ScriptName="" WHEREentry=2768; DELETE FROMsmart_scriptsWHEREentryorguid=2768 ANDsource_type=0; DELETE FROMsmart_scriptsWHEREentryorguidIN (276800,276801,276802,276803) ANDsource_type=9; INSERT INTOsmart_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_x,target_y,target_z,target_o,comment`) VALUES
(2768,0,0,1,19,0,100,0,665,0,0,0,0,64,1,0,0,0,0,0,7,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Quest 'Sunken Treasure' Taken - Store Targetlist"),
(2768,0,1,2,61,0,100,0,0,0,0,0,0,83,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Quest 'Sunken Treasure' Taken - Remove Npc Flag Questgiver"),
(2768,0,2,3,61,0,100,0,0,0,0,0,0,80,276800,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Quest 'Sunken Treasure' Taken - Run Script"),
(2768,0,3,0,61,0,100,0,0,0,0,0,0,2,113,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Quest 'Sunken Treasure' Taken - Set Faction 113"),
(2768,0,4,0,6,0,100,0,0,0,0,0,0,6,665,0,0,0,0,0,12,1,0,0,0,0,0,0,"Professor Phizzlethorpe - On Just Died - Fail Quest 'Sunken Treasure'"),
(2768,0,5,0,4,0,100,0,0,0,0,0,0,1,4,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Aggro - Say Line 4"),
(2768,0,6,0,40,0,100,0,5,276800,0,0,0,80,276801,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Waypoint 5 Reached - Run Script"),
(2768,0,7,0,40,0,100,0,8,276800,0,0,0,80,276802,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Waypoint 8 Reached - Run Script"),
(2768,0,8,0,40,0,100,0,8,276801,0,0,0,80,276803,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Waypoint 8 Reached - Run Script"),
(276800,9,0,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,"Professor Phizzlethorpe - On Script - Say Line 0"),
(276800,9,1,0,0,0,100,0,4000,4000,0,0,0,53,0,276800,0,0,0,2,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Start Waypoint"),
(276801,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,"Professor Phizzlethorpe - On Script - Pause Waypoint"),
(276801,9,1,0,0,0,100,0,0,0,0,0,0,1,1,0,0,0,0,0,12,1,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Say Line 1"),
(276801,9,2,0,0,0,100,0,7000,7000,0,0,0,1,2,0,0,0,0,0,12,1,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Say Line 2"),
(276802,9,0,0,0,0,100,0,0,0,0,0,0,1,3,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Say Line 3"),
(276802,9,1,0,0,0,100,0,10000,10000,0,0,0,107,1,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Summon Group"),
(276802,9,2,0,0,0,100,0,15000,15000,0,0,0,1,5,0,0,0,0,0,12,1,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Say Line 5"),
(276802,9,3,0,0,0,100,0,10000,10000,0,0,0,1,6,0,0,0,0,0,12,1,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Say Line 6"),
(276802,9,4,0,0,0,100,0,3000,3000,0,0,0,53,0,276801,0,0,0,2,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Start Waypoint"),
(276803,9,0,0,0,0,100,0,0,0,0,0,0,1,7,0,0,0,0,0,12,1,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Say Line 7"),
(276803,9,1,0,0,0,100,0,5000,5000,0,0,0,1,8,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Say Line 8"),
(276803,9,2,0,0,0,100,0,0,0,0,0,0,1,9,0,0,0,0,0,12,1,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Say Line 9"),
(276803,9,3,0,0,0,100,0,0,0,0,0,0,15,665,0,0,0,0,0,12,1,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Complete Quest 'Sunken Treasure'"),
(276803,9,4,0,0,0,100,0,0,0,0,0,0,82,2,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Add Npc Flag Questgiver"),
(276803,9,5,0,0,0,100,0,0,0,0,0,0,2,35,0,0,0,0,0,1,0,0,0,0,0,0,0,"Professor Phizzlethorpe - On Script - Set Faction 35");

DELETE FROM creature_summon_groups WHERE summonerId=2768;
INSERT INTO creature_summon_groups (summonerId, summonerType, groupId, entry, position_x, position_y, position_z, orientation, summonType, summonTime) VALUES
(2768,0,1,2776,-2056.19,-2143.23,20.4528,5.61003,5,3000),
(2768,0,1,2776,-2052.2,-2139.68,19.6804,5.31158,5,3000);

DELETE FROM script_waypoint WHERE entry=2768;
DELETE FROM waypoints WHERE entry IN (276800, 276801);
INSERT INTO waypoints (entry,pointid,position_x,position_y,position_z,point_comment) VALUES
(276800,1,-2077.73,-2091.17,9.49,""),
(276800,2,-2077.99,-2105.33,13.24,""),
(276800,3,-2074.6,-2109.67,14.24,""),
(276800,4,-2076.6,-2117.46,16.67,""),
(276800,5,-2073.51,-2123.46,18.42,""),
(276800,6,-2066.6,-2131.85,21.56,""),
(276800,7,-2053.85,-2143.19,20.31,""),
(276800,8,-2043.49,-2153.73,20.2,""),
(276801,1,-2053.85,-2143.19,20.31,""),
(276801,2,-2063.52,-2131.57,21.22,""),
(276801,3,-2073.51,-2123.46,18.42,""),
(276801,4,-2076.6,-2117.46,16.67,""),
(276801,5,-2074.6,-2109.67,14.24,""),
(276801,6,-2077.99,-2105.33,13.24,""),
(276801,7,-2077.73,-2091.17,9.49,""),
(276801,8,-2066.41,-2086.21,8.97,"");

-- Vengeful Surge
DELETE FROM smart_scripts WHERE entryorguid=2776 AND source_type=0 AND id=1;
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_x,target_y,target_z,target_o,comment) VALUES
(2776,0,1,0,54,0,100,0,0,0,0,0,0,49,0,0,0,0,0,0,19,2768,0,0,0,0,0,0,"Vengeful Surge - Just Summoned - Start Attacking");

Branch-3.3.5a Comp-Database Feedback-PatchFix

Most helpful comment

Cool. I will provide the removal diff, just in case.


diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
index ed0e843709..cff2441f02 100644
--- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
+++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
@@ -172,11 +172,10 @@ void AddSC_boss_grilek();
 void AddSC_boss_hazzarah();
 void AddSC_boss_renataki();
 void AddSC_boss_wushoolay();
 void AddSC_instance_zulgurub();
 //void AddSC_alterac_mountains();
-void AddSC_arathi_highlands();
 void AddSC_blasted_lands();
 void AddSC_duskwood();
 //void AddSC_eastern_plaguelands();
 void AddSC_ghostlands();
 void AddSC_goldshire();
@@ -349,11 +348,10 @@ void AddEasternKingdomsScripts()
     AddSC_boss_hazzarah();
     AddSC_boss_renataki();
     AddSC_boss_wushoolay();
     AddSC_instance_zulgurub();
     //AddSC_alterac_mountains();
-    AddSC_arathi_highlands();
     AddSC_blasted_lands();
     AddSC_duskwood();
     //AddSC_eastern_plaguelands();
     AddSC_ghostlands();
     AddSC_goldshire();
diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
deleted file mode 100644
index fa032d8431..0000000000
--- a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (C) 2008-2018 TrinityCore <https://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: Arathi Highlands
-SD%Complete: 100
-SDComment: Quest support: 665
-SDCategory: Arathi Highlands
-EndScriptData */
-
-/* ContentData
-npc_professor_phizzlethorpe
-EndContentData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "ScriptedEscortAI.h"
-#include "Player.h"
-
-/*######
-## npc_professor_phizzlethorpe
-######*/
-
-enum ProfessorPhizzlethorpe
-{
-    // Yells
-    SAY_PROGRESS_1          = 0,
-    SAY_PROGRESS_2          = 1,
-    SAY_PROGRESS_3          = 2,
-    EMOTE_PROGRESS_4        = 3,
-    SAY_AGGRO               = 4,
-    SAY_PROGRESS_5          = 5,
-    SAY_PROGRESS_6          = 6,
-    SAY_PROGRESS_7          = 7,
-    EMOTE_PROGRESS_8        = 8,
-    SAY_PROGRESS_9          = 9,
-    // Quests
-    QUEST_SUNKEN_TREASURE   = 665,
-    // Creatures
-    NPC_VENGEFUL_SURGE      = 2776
-};
-
-class npc_professor_phizzlethorpe : public CreatureScript
-{
-    public:
-        npc_professor_phizzlethorpe() : CreatureScript("npc_professor_phizzlethorpe") { }
-
-        struct npc_professor_phizzlethorpeAI : public EscortAI
-        {
-            npc_professor_phizzlethorpeAI(Creature* creature) : EscortAI(creature) { }
-
-            void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
-            {
-                Player* player = GetPlayerForEscort();
-                if (!player)
-                    return;
-
-                switch (waypointId)
-                {
-                    case 4:
-                        Talk(SAY_PROGRESS_2, player);
-                        break;
-                    case 5:
-                        Talk(SAY_PROGRESS_3, player);
-                        break;
-                    case 8:
-                        Talk(EMOTE_PROGRESS_4);
-                        break;
-                    case 9:
-                        me->SummonCreature(NPC_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
-                        me->SummonCreature(NPC_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
-                        break;
-                    case 10:
-                        Talk(SAY_PROGRESS_5, player);
-                        break;
-                    case 11:
-                        Talk(SAY_PROGRESS_6, player);
-                        SetRun();
-                        break;
-                    case 19:
-                        Talk(SAY_PROGRESS_7, player);
-                        break;
-                    case 20:
-                        Talk(EMOTE_PROGRESS_8);
-                        Talk(SAY_PROGRESS_9, player);
-                        player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
-                        break;
-                }
-            }
-
-            void JustSummoned(Creature* summoned) override
-            {
-                summoned->AI()->AttackStart(me);
-            }
-
-            void JustEngagedWith(Unit* /*who*/) override
-            {
-                Talk(SAY_AGGRO);
-            }
-
-            void QuestAccept(Player* player, Quest const* quest) override
-            {
-                if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
-                {
-                    Talk(SAY_PROGRESS_1, player);
-                    EscortAI::Start(false, false, player->GetGUID(), quest);
-                    me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
-                }
-            }
-
-            void UpdateAI(uint32 diff) override
-            {
-                EscortAI::UpdateAI(diff);
-            }
-        };
-
-    CreatureAI* GetAI(Creature* creature) const override
-    {
-        return new npc_professor_phizzlethorpeAI(creature);
-    }
-};
-
-void AddSC_arathi_highlands()
-{
-    new npc_professor_phizzlethorpe();
-}


Based on commit 86bba6421baf4be501dd523890ce691de3914e2f

>All comments

Cool. I will provide the removal diff, just in case.


diff --git a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
index ed0e843709..cff2441f02 100644
--- a/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
+++ b/src/server/scripts/EasternKingdoms/eastern_kingdoms_script_loader.cpp
@@ -172,11 +172,10 @@ void AddSC_boss_grilek();
 void AddSC_boss_hazzarah();
 void AddSC_boss_renataki();
 void AddSC_boss_wushoolay();
 void AddSC_instance_zulgurub();
 //void AddSC_alterac_mountains();
-void AddSC_arathi_highlands();
 void AddSC_blasted_lands();
 void AddSC_duskwood();
 //void AddSC_eastern_plaguelands();
 void AddSC_ghostlands();
 void AddSC_goldshire();
@@ -349,11 +348,10 @@ void AddEasternKingdomsScripts()
     AddSC_boss_hazzarah();
     AddSC_boss_renataki();
     AddSC_boss_wushoolay();
     AddSC_instance_zulgurub();
     //AddSC_alterac_mountains();
-    AddSC_arathi_highlands();
     AddSC_blasted_lands();
     AddSC_duskwood();
     //AddSC_eastern_plaguelands();
     AddSC_ghostlands();
     AddSC_goldshire();
diff --git a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp b/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
deleted file mode 100644
index fa032d8431..0000000000
--- a/src/server/scripts/EasternKingdoms/zone_arathi_highlands.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/*
- * Copyright (C) 2008-2018 TrinityCore <https://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: Arathi Highlands
-SD%Complete: 100
-SDComment: Quest support: 665
-SDCategory: Arathi Highlands
-EndScriptData */
-
-/* ContentData
-npc_professor_phizzlethorpe
-EndContentData */
-
-#include "ScriptMgr.h"
-#include "ScriptedCreature.h"
-#include "ScriptedEscortAI.h"
-#include "Player.h"
-
-/*######
-## npc_professor_phizzlethorpe
-######*/
-
-enum ProfessorPhizzlethorpe
-{
-    // Yells
-    SAY_PROGRESS_1          = 0,
-    SAY_PROGRESS_2          = 1,
-    SAY_PROGRESS_3          = 2,
-    EMOTE_PROGRESS_4        = 3,
-    SAY_AGGRO               = 4,
-    SAY_PROGRESS_5          = 5,
-    SAY_PROGRESS_6          = 6,
-    SAY_PROGRESS_7          = 7,
-    EMOTE_PROGRESS_8        = 8,
-    SAY_PROGRESS_9          = 9,
-    // Quests
-    QUEST_SUNKEN_TREASURE   = 665,
-    // Creatures
-    NPC_VENGEFUL_SURGE      = 2776
-};
-
-class npc_professor_phizzlethorpe : public CreatureScript
-{
-    public:
-        npc_professor_phizzlethorpe() : CreatureScript("npc_professor_phizzlethorpe") { }
-
-        struct npc_professor_phizzlethorpeAI : public EscortAI
-        {
-            npc_professor_phizzlethorpeAI(Creature* creature) : EscortAI(creature) { }
-
-            void WaypointReached(uint32 waypointId, uint32 /*pathId*/) override
-            {
-                Player* player = GetPlayerForEscort();
-                if (!player)
-                    return;
-
-                switch (waypointId)
-                {
-                    case 4:
-                        Talk(SAY_PROGRESS_2, player);
-                        break;
-                    case 5:
-                        Talk(SAY_PROGRESS_3, player);
-                        break;
-                    case 8:
-                        Talk(EMOTE_PROGRESS_4);
-                        break;
-                    case 9:
-                        me->SummonCreature(NPC_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
-                        me->SummonCreature(NPC_VENGEFUL_SURGE, -2052.96f, -2142.49f, 20.15f, 1.0f, TEMPSUMMON_CORPSE_DESPAWN, 0);
-                        break;
-                    case 10:
-                        Talk(SAY_PROGRESS_5, player);
-                        break;
-                    case 11:
-                        Talk(SAY_PROGRESS_6, player);
-                        SetRun();
-                        break;
-                    case 19:
-                        Talk(SAY_PROGRESS_7, player);
-                        break;
-                    case 20:
-                        Talk(EMOTE_PROGRESS_8);
-                        Talk(SAY_PROGRESS_9, player);
-                        player->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
-                        break;
-                }
-            }
-
-            void JustSummoned(Creature* summoned) override
-            {
-                summoned->AI()->AttackStart(me);
-            }
-
-            void JustEngagedWith(Unit* /*who*/) override
-            {
-                Talk(SAY_AGGRO);
-            }
-
-            void QuestAccept(Player* player, Quest const* quest) override
-            {
-                if (quest->GetQuestId() == QUEST_SUNKEN_TREASURE)
-                {
-                    Talk(SAY_PROGRESS_1, player);
-                    EscortAI::Start(false, false, player->GetGUID(), quest);
-                    me->SetFaction(FACTION_ESCORTEE_N_NEUTRAL_PASSIVE);
-                }
-            }
-
-            void UpdateAI(uint32 diff) override
-            {
-                EscortAI::UpdateAI(diff);
-            }
-        };
-
-    CreatureAI* GetAI(Creature* creature) const override
-    {
-        return new npc_professor_phizzlethorpeAI(creature);
-    }
-};
-
-void AddSC_arathi_highlands()
-{
-    new npc_professor_phizzlethorpe();
-}


Based on commit 86bba6421baf4be501dd523890ce691de3914e2f

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Lopfest picture Lopfest  路  3Comments

Jildor picture Jildor  路  3Comments

jerbookins picture jerbookins  路  3Comments

funjoker picture funjoker  路  3Comments

Rushor picture Rushor  路  3Comments