diff options
-rw-r--r-- | sql/FULL/world_scripts_full.sql | 4 | ||||
-rw-r--r-- | sql/updates/7797_world_scriptname.sql | 3 | ||||
-rw-r--r-- | src/game/ScriptLoader.cpp | 26 | ||||
-rw-r--r-- | src/scripts/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.cpp | 79 | ||||
-rw-r--r-- | src/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.h | 26 | ||||
-rw-r--r-- | src/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp | 104 | ||||
-rw-r--r-- | win/VC90/game.vcproj | 12 |
8 files changed, 252 insertions, 5 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 844d783f8ba..42229efa178 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -336,6 +336,10 @@ UPDATE `gameobject_template` SET `ScriptName`='go_shadowforge_brazier' WHERE `en /* BLACKROCK SPIRE */ +UPDATE `instance_template` SET `script`='instance_blackrock_spire' WHERE `map`=229; +UPDATE `creature_template` SET `ScriptName`='npc_rookey_whelp' WHERE entry=10161; +UPDATE `gameobject_template` SET `ScriptName`='go_rookey_egg' WHERE entry=175124; + /* BLACKROCK SPIRE Lower bosses */ UPDATE `creature_template` SET `ScriptName`='boss_highlord_omokk' WHERE `entry`=9196; UPDATE `creature_template` SET `ScriptName`='boss_shadow_hunter_voshgajin' WHERE `entry`=9236; diff --git a/sql/updates/7797_world_scriptname.sql b/sql/updates/7797_world_scriptname.sql new file mode 100644 index 00000000000..314389eb3d0 --- /dev/null +++ b/sql/updates/7797_world_scriptname.sql @@ -0,0 +1,3 @@ +UPDATE `instance_template` SET `script`='instance_blackrock_spire' WHERE `map`=229;
+UPDATE `creature_template` SET `ScriptName`='npc_rookey_whelp' WHERE entry=10161;
+UPDATE `gameobject_template` SET `ScriptName`='go_rookey_egg' WHERE entry=175124;
diff --git a/src/game/ScriptLoader.cpp b/src/game/ScriptLoader.cpp index c964a42d7b0..5cf488fe156 100644 --- a/src/game/ScriptLoader.cpp +++ b/src/game/ScriptLoader.cpp @@ -1,6 +1,18 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/> -* This program is free software licensed under GPL version 2 -* Please see the included DOCS/LICENSE.TXT for more information */ +/* Copyright (C) 2008 - 2010 TrinityCore <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" @@ -49,7 +61,8 @@ void AddSC_boss_magmus(); void AddSC_boss_moira_bronzebeard(); void AddSC_boss_tomb_of_seven(); void AddSC_instance_blackrock_depths(); -void AddSC_boss_drakkisath(); //Blackrock Spire +void AddSC_blackrock_spire(); //Blackrock Spire +void AddSC_boss_drakkisath(); void AddSC_boss_halycon(); void AddSC_boss_highlordomokk(); void AddSC_boss_mothersmolderweb(); @@ -61,6 +74,7 @@ void AddSC_boss_quatermasterzigris(); void AddSC_boss_pyroguard_emberseer(); void AddSC_boss_gyth(); void AddSC_boss_rend_blackhand(); +void AddSC_instance_blackrock_spire(); void AddSC_boss_razorgore(); //Blackwing lair void AddSC_boss_vael(); void AddSC_boss_broodlord(); @@ -539,7 +553,8 @@ void AddScripts() AddSC_boss_moira_bronzebeard(); AddSC_boss_tomb_of_seven(); AddSC_instance_blackrock_depths(); - AddSC_boss_drakkisath(); //Blackrock Spire + AddSC_blackrock_spire(); //Blackrock Spire + AddSC_boss_drakkisath(); AddSC_boss_halycon(); AddSC_boss_highlordomokk(); AddSC_boss_mothersmolderweb(); @@ -551,6 +566,7 @@ void AddScripts() AddSC_boss_pyroguard_emberseer(); AddSC_boss_gyth(); AddSC_boss_rend_blackhand(); + AddSC_instance_blackrock_spire(); AddSC_boss_razorgore(); //Blackwing lair AddSC_boss_vael(); AddSC_boss_broodlord(); diff --git a/src/scripts/CMakeLists.txt b/src/scripts/CMakeLists.txt index dad046e241c..462c31266be 100644 --- a/src/scripts/CMakeLists.txt +++ b/src/scripts/CMakeLists.txt @@ -35,6 +35,7 @@ SET(scripts_STAT_SRCS eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp eastern_kingdoms/blackrock_depths/blackrock_depths.h eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp + eastern_kingdoms/blackrock_spire/blackrock_spire.cpp eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp eastern_kingdoms/blackrock_spire/boss_gyth.cpp eastern_kingdoms/blackrock_spire/boss_halycon.cpp @@ -47,6 +48,8 @@ SET(scripts_STAT_SRCS eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp eastern_kingdoms/blackrock_spire/boss_the_beast.cpp eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp + eastern_kingdoms/blackrock_spire/blackrock_spire.h + eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.cpp new file mode 100644 index 00000000000..8729962c406 --- /dev/null +++ b/src/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.cpp @@ -0,0 +1,79 @@ +/* Copyright (C) 2008 - 2010 TrinityCore <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 "blackrock_spire.h"
+
+enum Creatures
+{
+ NPC_ROOKERY_WHELP = 10161
+};
+
+struct npc_rookey_whelpAI : public ScriptedAI
+{
+ npc_rookey_whelpAI(Creature *c) : ScriptedAI(c)
+ {
+ pInstance = c->GetInstanceData();
+ }
+
+ ScriptedInstance* pInstance;
+
+ void JustDied(Unit *who)
+ {
+ if (pInstance)
+ {
+ pInstance->SetData(WHELP_DEATH_COUNT, pInstance->GetData(WHELP_DEATH_COUNT)+1);
+ }
+ }
+
+ void UpdateAI(const uint32 diff)
+ {
+ if (!UpdateVictim())
+ return;
+
+ DoMeleeAttackIfReady();
+ }
+};
+
+CreatureAI* GetAI_rookey_whelp(Creature* pCreature)
+{
+ return new npc_rookey_whelpAI(pCreature);
+}
+
+bool GOHello_rookey_egg(Player *pPlayer, GameObject *pGO)
+{
+ Position pos;
+ pPlayer->GetPosition(&pos);
+ pPlayer->SummonCreature(NPC_ROOKERY_WHELP, pos, TEMPSUMMON_TIMED_DESPAWN, 15*IN_MILISECONDS);
+ //destroy gobject need to be implemented
+
+ return true;
+};
+
+void AddSC_blackrock_spire()
+{
+ Script *newscript;
+
+ newscript = new Script;
+ newscript->Name = "npc_rookey_whelp";
+ newscript->GetAI = &GetAI_rookey_whelp;
+ newscript->RegisterSelf();
+ newscript = new Script;
+
+ newscript->Name = "go_rookey_egg";
+ newscript->pGOHello = &GOHello_rookey_egg;
+ newscript->RegisterSelf();
+}
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.h b/src/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.h new file mode 100644 index 00000000000..cc6a9694192 --- /dev/null +++ b/src/scripts/eastern_kingdoms/blackrock_spire/blackrock_spire.h @@ -0,0 +1,26 @@ +/* Copyright (C) 2008 - 2010 TrinityCore <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_BRS_H
+#define DEF_BRS_H
+
+enum Data
+{
+ EVENT_LEEEROY,
+ WHELP_DEATH_COUNT
+};
+
+#endif
diff --git a/src/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp b/src/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp new file mode 100644 index 00000000000..59f3a3dd081 --- /dev/null +++ b/src/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp @@ -0,0 +1,104 @@ +/* Copyright (C) 2008 - 2010 TrinityCore <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 "blackrock_spire.h"
+
+enum Achievements
+{
+ ACHIEV_LEROY_JENKINS = 2188
+};
+
+struct instance_blackrock_spire : public ScriptedInstance
+{
+ instance_blackrock_spire(Map* pMap) : ScriptedInstance(pMap) {}
+
+ uint32 uiLeeroyTimer;
+ uint32 uiWhelpCount;
+ uint32 uiLeroyData;
+
+ bool bLeeeeeeeeroy;
+
+ void Initialize()
+ {
+ uiLeeroyTimer = 15*IN_MILISECONDS;
+ uiWhelpCount = 0;
+ bLeeeeeeeeroy = true;
+ uiLeroyData = 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case EVENT_LEEEROY:
+ if (data == DONE)
+ DoCompleteAchievement(ACHIEV_LEROY_JENKINS);
+ uiLeroyData = data;
+ break;
+ case WHELP_DEATH_COUNT:
+ if (data == 1)
+ {
+ SetData(EVENT_LEEEROY, IN_PROGRESS);
+ //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Started");
+ }
+ uiWhelpCount = data;
+ break;
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case EVENT_LEEEROY: return uiLeroyData;
+ case WHELP_DEATH_COUNT: return uiWhelpCount;
+ }
+ return 0;
+ }
+
+ void Update(uint32 diff)
+ {
+ if (GetData(EVENT_LEEEROY) != FAIL && GetData(EVENT_LEEEROY) == IN_PROGRESS)
+ {
+ if (uiLeeroyTimer <= diff)
+ {
+ SetData(EVENT_LEEEROY, FAIL);
+ bLeeeeeeeeroy = false;
+ //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Failed");
+ } else uiLeeroyTimer -= diff;
+ if (uiWhelpCount >= 50 && bLeeeeeeeeroy)
+ {
+ SetData(EVENT_LEEEROY, DONE);
+ //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Success");
+ }
+ }
+ }
+};
+
+InstanceData* GetInstanceData_instance_blackrock_spire(Map* pMap)
+{
+ return new instance_blackrock_spire(pMap);
+}
+
+void AddSC_instance_blackrock_spire()
+{
+ Script *newscript;
+ newscript = new Script;
+ newscript->Name = "instance_blackrock_spire";
+ newscript->GetInstanceData = &GetInstanceData_instance_blackrock_spire;
+ newscript->RegisterSelf();
+}
diff --git a/win/VC90/game.vcproj b/win/VC90/game.vcproj index 42ef6393d5e..3146e166c48 100644 --- a/win/VC90/game.vcproj +++ b/win/VC90/game.vcproj @@ -1933,6 +1933,14 @@ Name="Blackrock Spire" > <File + RelativePath="..\..\src\scripts\eastern_kingdoms\blackrock_spire\blackrock_spire.cpp" + > + </File> + <File + RelativePath="..\..\src\scripts\eastern_kingdoms\blackrock_spire\blackrock_spire.h" + > + </File> + <File RelativePath="..\..\src\scripts\eastern_kingdoms\blackrock_spire\boss_drakkisath.cpp" > </File> @@ -1980,6 +1988,10 @@ RelativePath="..\..\src\scripts\eastern_kingdoms\blackrock_spire\boss_warmaster_voone.cpp" > </File> + <File + RelativePath="..\..\src\scripts\eastern_kingdoms\blackrock_spire\instance_blackrock_spire.cpp" + > + </File> </Filter> <Filter Name="Blackwing Lair" |