diff -r 9ad0aaf0b0bb src/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.cpp Fri Mar 12 18:55:00 2010 +0100
@@ -0,0 +1,81 @@
+#include "ScriptedPch.h"
+#include "instance_blackrock_spire.h"
+
+struct instance_blackrock_spire : public ScriptedInstance
+{
+ instance_blackrock_spire(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
+
+ uint32 leeroyTimer;
+ uint32 whelpCount;
+ uint32 leroyData;
+
+ bool leeeeeeeeroy;
+
+ void Initialize()
+ {
+ leeroyTimer = 15000;
+ whelpCount = 0;
+ leeeeeeeeroy = true;
+ leroyData = 0;
+ }
+
+ void SetData(uint32 type, uint32 data)
+ {
+ switch(type)
+ {
+ case EVENT_LEEEROY:
+ {
+ if(data == DONE)
+ DoCompleteAchievement(2188);
+ leroyData = data; break;
+ }
+ case WHELP_DEATH_COUNT:
+ {
+ if(data == 1){
+ SetData(EVENT_LEEEROY, IN_PROGRESS);
+ //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Started");
+ }
+ whelpCount = data; break;
+ }
+ }
+ }
+
+ uint32 GetData(uint32 type)
+ {
+ switch(type)
+ {
+ case EVENT_LEEEROY: return leroyData;
+ case WHELP_DEATH_COUNT: return whelpCount;
+ }
+ }
+
+ void Update(uint32 diff)
+ {
+
+ if(GetData(EVENT_LEEEROY) != FAIL && GetData(EVENT_LEEEROY) == IN_PROGRESS){
+ if(leeroyTimer <= diff){
+ SetData(EVENT_LEEEROY, FAIL);
+ leeeeeeeeroy = false;
+ //DoSendNotifyToInstance("Leeeeeeeeeeeeeroy! Failed");
+ }else leeroyTimer -= diff;
+ if(whelpCount >= 50 && leeeeeeeeroy){
+ 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 -r 9ad0aaf0b0bb src/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/instance_blackrock_spire.h Fri Mar 12 18:55:00 2010 +0100
@@ -0,0 +1,11 @@
+#ifndef DEF_BRS_H
+#define DEF_BRS_H
+
+enum iDefines
+{
+ EVENT_LEEEROY = 1,
+ WHELP_DEATH_COUNT = 2
+
+};
+
+#endif
diff -r 9ad0aaf0b0bb src/scripts/eastern_kingdoms/blackrock_spire/npc_whelp_plus_egg.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/scripts/eastern_kingdoms/blackrock_spire/npc_whelp_plus_egg.cpp Fri Mar 12 18:55:00 2010 +0100
@@ -0,0 +1,61 @@
+#include "ScriptedPch.h"
+#include "instance_blackrock_spire.h"
+
+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, ((uint32)pInstance->GetData(WHELP_DEATH_COUNT)+1));
+ sLog.outError("zapocitavam whelpa");
+ }
+ }
+
+ 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)
+{
+ float x,y,z,o;
+ x = pPlayer->GetPositionX();
+ y = pPlayer->GetPositionY();
+ z = pPlayer->GetPositionZ();
+ o = pPlayer->GetOrientation();
+ pPlayer->SummonCreature(10161, x, y, z, o, TEMPSUMMON_TIMED_DESPAWN, 15000);
+ //destroy gobject need to be implemented
+
+ return true;
+};
+
+void AddSC_npc_rookey_whelp()
+{
+ 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 -r 9ad0aaf0b0bb src/game/ScriptLoader.cpp
--- a/src/game/ScriptLoader.cpp Sun Feb 14 06:05:41 2010 -0700
+++ b/src/game/ScriptLoader.cpp Fri Mar 12 18:57:51 2010 +0100
@@ -45,6 +45,8 @@
void AddSC_boss_tomb_of_seven();
void AddSC_instance_blackrock_depths();
void AddSC_boss_drakkisath(); //Blackrock Spire
+void AddSC_npc_rookey_whelp();
+void AddSC_instance_blackrock_spire();
void AddSC_boss_halycon();
void AddSC_boss_highlordomokk();
void AddSC_boss_mothersmolderweb();
@@ -509,6 +518,8 @@
AddSC_boss_tomb_of_seven();
AddSC_instance_blackrock_depths();
AddSC_boss_drakkisath(); //Blackrock Spire
+ AddSC_npc_rookey_whelp();
+ AddSC_instance_blackrock_spire();
AddSC_boss_halycon();
AddSC_boss_highlordomokk();
AddSC_boss_mothersmolderweb();
diff -r 9ad0aaf0b0bb src/scripts/CMakeLists.txt
--- a/src/scripts/CMakeLists.txt Sun Feb 14 06:05:41 2010 -0700
+++ b/src/scripts/CMakeLists.txt Fri Mar 12 18:57:33 2010 +0100
@@ -42,6 +42,9 @@
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/instance_blackrock_spire.cpp
+ eastern_kingdoms/blackrock_spire/instance_blackrock_spire.h
+ eastern_kingdoms/blackrock_spire/npc_whelp_plus_egg.cpp
eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp
eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp
eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp
Share This Thread