Razorfen downs: Implemented event from boss Tuten'kash. For a full fix see TDB Forums.

--HG--
branch : trunk
This commit is contained in:
_manuel_
2010-02-19 15:12:46 -08:00
parent b19e793032
commit 1da4996189
7 changed files with 444 additions and 88 deletions

View File

@@ -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;

View File

@@ -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();

View File

@@ -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

View File

@@ -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();
}

View File

@@ -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();
}

View File

@@ -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

View File

@@ -103,6 +103,87 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
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;NDEBUG;_LIB;_SECURE_SCL=0"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="1"
RuntimeTypeInfo="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="pchdef.h"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
AssemblerListingLocation=".\game__$(PlatformName)_$(ConfigurationName)\"
ObjectFile=".\game__$(PlatformName)_$(ConfigurationName)\"
ProgramDataBaseFileName=".\game__$(PlatformName)_$(ConfigurationName)\"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
CallingConvention="0"
CompileAs="0"
ForcedIncludeFiles="pchdef.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_SECURE_SCL=0"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\game__$(PlatformName)_$(ConfigurationName)\game.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|x64"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
@@ -187,87 +268,6 @@
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
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;NDEBUG;_LIB;_SECURE_SCL=0"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="1"
RuntimeTypeInfo="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="pchdef.h"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
AssemblerListingLocation=".\game__$(PlatformName)_$(ConfigurationName)\"
ObjectFile=".\game__$(PlatformName)_$(ConfigurationName)\"
ProgramDataBaseFileName=".\game__$(PlatformName)_$(ConfigurationName)\"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
CallingConvention="0"
CompileAs="0"
ForcedIncludeFiles="pchdef.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_SECURE_SCL=0"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\game__$(PlatformName)_$(ConfigurationName)\game.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release|x64"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
@@ -2888,10 +2888,18 @@
RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\boss_amnennar_the_coldbringer.cpp"
>
</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"