aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/updates/7390_world_scriptname.sql4
-rw-r--r--src/game/ScriptLoader.cpp2
-rw-r--r--src/scripts/CMakeLists.txt2
-rw-r--r--src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp215
-rw-r--r--src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp80
-rw-r--r--src/scripts/kalimdor/razorfen_downs/razorfen_downs.h45
-rw-r--r--win/VC90/game.vcproj60
7 files changed, 382 insertions, 26 deletions
diff --git a/sql/updates/7390_world_scriptname.sql b/sql/updates/7390_world_scriptname.sql
new file mode 100644
index 00000000000..0c82857311d
--- /dev/null
+++ b/sql/updates/7390_world_scriptname.sql
@@ -0,0 +1,4 @@
+UPDATE `gameobject_template` SET `ScriptName`='go_gong' WHERE `entry`=148917;
+UPDATE `creature_template` SET `ScriptName`='npc_tomb_creature' WHERE `entry` IN (7351,7349);
+UPDATE `instance_template` SET `script`='instance_razorfen_downs' WHERE `map`=129;
+
diff --git a/src/game/ScriptLoader.cpp b/src/game/ScriptLoader.cpp
index 60814ce6c83..df4c9a251fc 100644
--- a/src/game/ScriptLoader.cpp
+++ b/src/game/ScriptLoader.cpp
@@ -238,6 +238,7 @@ void AddSC_boss_ptheradras();
void AddSC_boss_onyxia(); //Onyxia's Lair
void AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs
void AddSC_razorfen_downs();
+void AddSC_instance_razorfen_downs();
void AddSC_razorfen_kraul(); //Razorfen Kraul
void AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj
void AddSC_boss_rajaxx();
@@ -702,6 +703,7 @@ void AddScripts()
AddSC_boss_onyxia(); //Onyxia's Lair
AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs
AddSC_razorfen_downs();
+ AddSC_instance_razorfen_downs();
AddSC_razorfen_kraul(); //Razorfen Kraul
AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj
AddSC_boss_rajaxx();
diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt
index 6fc29306a27..a94f6daafa2 100644
--- a/src/scripts/CMakeLists.txt
+++ b/src/scripts/CMakeLists.txt
@@ -253,6 +253,8 @@ SET(scripts_STAT_SRCS
kalimdor/onyxias_lair/boss_onyxia.cpp
kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp
kalimdor/razorfen_downs/razorfen_downs.cpp
+ kalimdor/razorfen_downs/instance_razorfen_downs.cpp
+ kalimdor/razorfen_downs/razorfen_downs.h
kalimdor/razorfen_kraul/razorfen_kraul.h
kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp
kalimdor/razorfen_kraul/razorfen_kraul.cpp
diff --git a/src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp b/src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp
new file mode 100644
index 00000000000..8ac8073e1f1
--- /dev/null
+++ b/src/scripts/kalimdor/razorfen_downs/instance_razorfen_downs.cpp
@@ -0,0 +1,215 @@
+/*
+ * Copyright (C) 2010 Trinity <http://www.trinitycore.org/>
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "ScriptedPch.h"
+#include "razorfen_downs.h"
+
+#define MAX_ENCOUNTER 1
+
+struct instance_razorfen_downs : public ScriptedInstance
+{
+ instance_razorfen_downs(Map* pMap) : ScriptedInstance(pMap)
+ {
+ Initialize();
+ };
+
+ uint64 uiGongGUID;
+
+ uint32 m_auiEncounter[MAX_ENCOUNTER];
+
+ uint8 uiGongWaves;
+
+ std::string str_data;
+
+ void Initialize()
+ {
+ uiGongGUID = 0;
+
+ uiGongWaves = 0;
+
+ memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
+ }
+
+ std::string GetSaveData()
+ {
+ OUT_SAVE_INST_DATA;
+
+ std::ostringstream saveStream;
+
+ saveStream << "T C " << m_auiEncounter[0]
+ << " " << uiGongWaves;
+
+ str_data = saveStream.str();
+
+ OUT_SAVE_INST_DATA_COMPLETE;
+ return str_data;
+ }
+
+ void Load(const char* in)
+ {
+ if (!in)
+ {
+ OUT_LOAD_INST_DATA_FAIL;
+ return;
+ }
+
+ OUT_LOAD_INST_DATA(in);
+
+ char dataHead1, dataHead2;
+ uint16 data0, data1;
+
+ std::istringstream loadStream(in);
+ loadStream >> dataHead1 >> dataHead2 >> data0 >> data1;
+
+ if (dataHead1 == 'T' && dataHead2 == 'C')
+ {
+ m_auiEncounter[0] = data0;
+
+ for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
+ if (m_auiEncounter[i] == IN_PROGRESS)
+ m_auiEncounter[i] = NOT_STARTED;
+
+ uiGongWaves = data1;
+ } else OUT_LOAD_INST_DATA_FAIL;
+
+ OUT_LOAD_INST_DATA_COMPLETE;
+ }
+
+ void OnGameObjectCreate(GameObject* pGo, bool bAdd)
+ {
+ switch(pGo->GetEntry())
+ {
+ case GO_GONG:
+ uiGongGUID = pGo->GetGUID();
+ if (m_auiEncounter[0] == DONE)
+ pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
+ break;
+ default:
+ break;
+ }
+ }
+
+ void SetData(uint32 uiType, uint32 uiData)
+ {
+ if (uiType == DATA_GONG_WAVES)
+ {
+ uiGongWaves = uiData;
+
+ switch(uiGongWaves)
+ {
+ case 9:
+ case 14:
+ if (GameObject* pGo = instance->GetGameObject(uiGongGUID))
+ pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
+ break;
+ case 1:
+ case 10:
+ case 16:
+ {
+ GameObject* pGo = instance->GetGameObject(uiGongGUID);
+
+ if (!pGo)
+ return;
+
+ pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
+
+ uint32 uiCreature = 0;
+ uint8 uiSummonTimes = 0;
+
+ switch(uiGongWaves)
+ {
+ case 1:
+ uiCreature = CREATURE_TOMB_FIEND;
+ uiSummonTimes = 7;
+ break;
+ case 10:
+ uiCreature = CREATURE_TOMB_REAVER;
+ uiSummonTimes = 3;
+ break;
+ case 16:
+ uiCreature = CREATURE_TUTEN_KASH;
+ break;
+ default:
+ break;
+ }
+
+
+ if (Creature* pCreature = pGo->SummonCreature(uiCreature,2502.635,844.140,46.896,0.633))
+ {
+ if (uiGongWaves == 10 || uiGongWaves == 1)
+ {
+ for (uint8 i = 0; i < uiSummonTimes; ++i)
+ {
+ if (Creature* pSummon = pGo->SummonCreature(uiCreature,2502.635 + float(irand(-5,5)),844.140 + float(irand(-5,5)),46.896,0.633))
+ pSummon->GetMotionMaster()->MovePoint(0,2533.479 + float(irand(-5,5)),870.020 + float(irand(-5,5)),47.678);
+ }
+ }
+ pCreature->GetMotionMaster()->MovePoint(0,2533.479 + float(irand(-5,5)),870.020 + float(irand(-5,5)),47.678);
+ }
+ break;
+ }
+ default:
+ break;
+ }
+ }
+
+ if (uiType == BOSS_TUTEN_KASH)
+ {
+ m_auiEncounter[0] = uiData;
+
+ if (uiData == DONE)
+ SaveToDB();
+ }
+ }
+
+ uint32 GetData(uint32 uiType)
+ {
+ switch(uiType)
+ {
+ case DATA_GONG_WAVES:
+ return uiGongWaves;
+ }
+
+ return 0;
+ }
+
+ uint64 GetData64(uint32 uiType)
+ {
+ switch(uiType)
+ {
+ case DATA_GONG: return uiGongGUID;
+ }
+
+ return 0;
+ }
+};
+
+InstanceData* GetInstanceData_instance_razorfen_downs(Map* pMap)
+{
+ return new instance_razorfen_downs(pMap);
+}
+
+void AddSC_instance_razorfen_downs()
+{
+ Script* newscript;
+
+ newscript = new Script;
+ newscript->Name = "instance_razorfen_downs";
+ newscript->GetInstanceData = &GetInstanceData_instance_razorfen_downs;
+ newscript->RegisterSelf();
+}
diff --git a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp
index 7160524ff65..d8ffb63a3a7 100644
--- a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp
+++ b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp
@@ -26,6 +26,7 @@ npc_henry_stern
EndContentData */
#include "ScriptedPch.h"
+#include "razorfen_downs.h"
/*###
# npc_henry_stern
@@ -73,6 +74,75 @@ bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32
return true;
}
+/*######
+## go_gong
+######*/
+
+bool GOHello_go_gong(Player* pPlayer, GameObject* pGO)
+{
+ //basic support, not blizzlike data is missing...
+ ScriptedInstance* pInstance = pGO->GetInstanceData();
+
+ if (pInstance)
+ {
+ pInstance->SetData(DATA_GONG_WAVES,pInstance->GetData(DATA_GONG_WAVES)+1);
+ return true;
+ }
+
+ return false;
+}
+
+enum eTombCreature
+{
+ SPELL_WEB = 745
+};
+
+struct npc_tomb_creatureAI : public ScriptedAI
+{
+ npc_tomb_creatureAI(Creature* pCreature) : ScriptedAI(pCreature)
+ {
+ pInstance = pCreature->GetInstanceData();
+ }
+
+ ScriptedInstance* pInstance;
+
+ uint32 uiWebTimer;
+
+ void Reset()
+ {
+ uiWebTimer = urand(5000,8000);
+ }
+
+ void UpdateAI(const uint32 uiDiff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ //from acid
+ if (m_creature->GetEntry() == CREATURE_TOMB_REAVER)
+ {
+ if (uiWebTimer <= uiDiff)
+ {
+ DoCast(m_creature->getVictim(), SPELL_WEB);
+ uiWebTimer = urand(7000,16000);
+ } else uiWebTimer -= uiDiff;
+ }
+
+ DoMeleeAttackIfReady();
+ }
+
+ void JustDied(Unit* pKiller)
+ {
+ if (pInstance)
+ pInstance->SetData(DATA_GONG_WAVES,pInstance->GetData(DATA_GONG_WAVES)+1);
+ }
+};
+
+CreatureAI* GetAI_npc_tomb_creature(Creature* pCreature)
+{
+ return new npc_tomb_creatureAI (pCreature);
+}
+
void AddSC_razorfen_downs()
{
Script* newscript;
@@ -82,4 +152,14 @@ void AddSC_razorfen_downs()
newscript->pGossipHello = &GossipHello_npc_henry_stern;
newscript->pGossipSelect = &GossipSelect_npc_henry_stern;
newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "go_gong";
+ newscript->pGOHello = &GOHello_go_gong;
+ newscript->RegisterSelf();
+
+ newscript = new Script;
+ newscript->Name = "npc_tomb_creature";
+ newscript->GetAI = &GetAI_npc_tomb_creature;
+ newscript->RegisterSelf();
}
diff --git a/src/scripts/kalimdor/razorfen_downs/razorfen_downs.h b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.h
new file mode 100644
index 00000000000..d1c95d3f305
--- /dev/null
+++ b/src/scripts/kalimdor/razorfen_downs/razorfen_downs.h
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2010 Trinity <http://www.trinitycore.org/>
+ *
+ * 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef DEF_RAZORFEN_DOWNS_H
+#define DEF_RAZORFEN_DOWNS_H
+
+enum eData
+{
+ BOSS_TUTEN_KASH,
+ DATA_GONG_WAVES
+};
+
+enum eData64
+{
+ DATA_GONG
+};
+
+enum eGameObject
+{
+ GO_GONG = 148917
+};
+
+enum eCreature
+{
+ CREATURE_TOMB_FIEND = 7349,
+ CREATURE_TOMB_REAVER = 7351,
+ CREATURE_TUTEN_KASH = 7355
+};
+
+#endif
diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj
index c54c46012a2..bddf1189edd 100644
--- a/win/VC90/game.vcproj
+++ b/win/VC90/game.vcproj
@@ -104,7 +104,7 @@
/>
</Configuration>
<Configuration
- Name="Debug|x64"
+ Name="Release|Win32"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
@@ -126,19 +126,17 @@
/>
<Tool
Name="VCMIDLTool"
- TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/MP /bigobj /Zm200"
- Optimization="0"
+ AdditionalOptions="/MP /Zm200"
+ InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\Database;..\..\src\shared\vmap;..\..\dep\ACE_wrappers;..\..\src\game\"
- PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_LIB"
- StringPooling="false"
- MinimalRebuild="false"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
+ PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0"
+ StringPooling="true"
+ RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
+ EnableEnhancedInstructionSet="1"
RuntimeTypeInfo="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="pchdef.h"
@@ -159,7 +157,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
- PreprocessorDefinitions="_DEBUG"
+ PreprocessorDefinitions="NDEBUG;_SECURE_SCL=0"
Culture="1033"
/>
<Tool
@@ -167,7 +165,6 @@
/>
<Tool
Name="VCLibrarianTool"
- AdditionalDependencies=".\shared__$(PlatformName)_$(ConfigurationName)\shared.lib"
OutputFile=".\game__$(PlatformName)_$(ConfigurationName)\game.lib"
SuppressStartupBanner="true"
/>
@@ -188,7 +185,7 @@
/>
</Configuration>
<Configuration
- Name="Release|Win32"
+ Name="Debug|x64"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
@@ -210,17 +207,19 @@
/>
<Tool
Name="VCMIDLTool"
+ TargetEnvironment="3"
/>
<Tool
Name="VCCLCompilerTool"
- AdditionalOptions="/MP /Zm200"
- InlineFunctionExpansion="1"
+ AdditionalOptions="/MP /bigobj /Zm200"
+ Optimization="0"
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\Database;..\..\src\shared\vmap;..\..\dep\ACE_wrappers;..\..\src\game\"
- PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0"
- StringPooling="true"
- RuntimeLibrary="2"
+ PreprocessorDefinitions="WIN32;_DEBUG;TRINITY_DEBUG;_LIB"
+ StringPooling="false"
+ MinimalRebuild="false"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
EnableFunctionLevelLinking="true"
- EnableEnhancedInstructionSet="1"
RuntimeTypeInfo="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="pchdef.h"
@@ -241,7 +240,7 @@
/>
<Tool
Name="VCResourceCompilerTool"
- PreprocessorDefinitions="NDEBUG;_SECURE_SCL=0"
+ PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
@@ -249,6 +248,7 @@
/>
<Tool
Name="VCLibrarianTool"
+ AdditionalDependencies=".\shared__$(PlatformName)_$(ConfigurationName)\shared.lib"
OutputFile=".\game__$(PlatformName)_$(ConfigurationName)\game.lib"
SuppressStartupBanner="true"
/>
@@ -2889,9 +2889,17 @@
>
</File>
<File
+ RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\instance_razorfen_downs.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\razorfen_downs.cpp"
>
</File>
+ <File
+ RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\razorfen_downs.h"
+ >
+ </File>
</Filter>
<Filter
Name="Razorfen Kraul"
@@ -3149,15 +3157,15 @@
>
</File>
</Filter>
- <Filter
+ <Filter
Name="Forge of Souls"
>
<File
- RelativePath="..\..\src\scripts\northrend\frozen_halls\forge_of_souls\forge_of_souls.h"
+ RelativePath="..\..\src\scripts\northrend\frozen_halls\forge_of_souls\boss_bronjahm.cpp"
>
</File>
<File
- RelativePath="..\..\src\scripts\northrend\frozen_halls\forge_of_souls\boss_bronjahm.cpp"
+ RelativePath="..\..\src\scripts\northrend\frozen_halls\forge_of_souls\forge_of_souls.h"
>
</File>
<File
@@ -3181,11 +3189,11 @@
Name="Pit of Saron"
>
<File
- RelativePath="..\..\src\scripts\northrend\frozen_halls\pit_of_saron\pit_of_saron.h"
+ RelativePath="..\..\src\scripts\northrend\frozen_halls\pit_of_saron\instance_pit_of_saron.cpp"
>
</File>
<File
- RelativePath="..\..\src\scripts\northrend\frozen_halls\pit_of_saron\instance_pit_of_saron.cpp"
+ RelativePath="..\..\src\scripts\northrend\frozen_halls\pit_of_saron\pit_of_saron.h"
>
</File>
</Filter>
@@ -4152,7 +4160,7 @@
/>
</FileConfiguration>
<FileConfiguration
- Name="Debug|x64"
+ Name="Release|Win32"
>
<Tool
Name="VCCLCompilerTool"
@@ -4161,7 +4169,7 @@
/>
</FileConfiguration>
<FileConfiguration
- Name="Release|Win32"
+ Name="Debug|x64"
>
<Tool
Name="VCCLCompilerTool"