aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBlaymoira <none@none>2009-01-21 19:22:32 +0100
committerBlaymoira <none@none>2009-01-21 19:22:32 +0100
commit8dc780bfda3878269e9f78fc8acfe1a6e98c541a (patch)
treec20c803c3c7b9d0f9709a5cd6972e2b74271c90e /src
parenta39d1daeb47ce21ca8069ff0e8abf181a0b6906f (diff)
*Replace pointers to Guids in Kelidan script - by Iskander
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp61
-rw-r--r--src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp24
2 files changed, 47 insertions, 38 deletions
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
index ec2fe76e96e..94a75db6149 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp
@@ -74,7 +74,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
{
pInstance = ((ScriptedInstance*)c->GetInstanceData());
HeroicMode = m_creature->GetMap()->IsHeroic();
- for(int i=0; i<5; i++) Channelers[i] = NULL;
+ for(int i=0; i<5; ++i) Channelers[i] = 0;
Reset();
}
@@ -88,7 +88,7 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
uint32 check_Timer;
bool Firenova;
bool addYell;
- Creature *Channelers[5];
+ uint64 Channelers[5];
void Reset()
{
@@ -133,44 +133,50 @@ struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI
default: DoScriptText(SAY_ADD_AGGRO_3, m_creature); break;
}
}
- for(int i=0; i<5; i++)
- if(who && Channelers[i] && !Channelers[i]->isInCombat())
- Channelers[i]->AI()->AttackStart(who);
+ for(int i=0; i<5; ++i)
+ {
+ Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]);
+ if(who && channeler && !channeler->isInCombat())
+ channeler->AI()->AttackStart(who);
+ }
}
void ChannelerDied(Unit* killer)
{
- for(int i=0; i<5; i++)
- if(Channelers[i] && Channelers[i]->isAlive())
- return;
+ for(int i=0; i<5; ++i)
+ {
+ Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]);
+ if(channeler && channeler->isAlive())
+ return;
+ }
+
if(killer)
m_creature->AI()->AttackStart(killer);
}
- Creature* GetChanneled(Creature *channeler)
+ uint64 GetChanneled(Creature *channeler1)
{
SummonChannelers();
- if(!channeler) return NULL;
+ if(!channeler1) return NULL;
int i;
- for(i=0; i<5; i++)
- if(Channelers[i] && Channelers[i]->GetGUID()==channeler->GetGUID())
- break;
+ for(i=0; i<5; ++i)
+ {
+ Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]);
+ if(channeler && channeler->GetGUID()==channeler1->GetGUID())
+ break;
+ }
return Channelers[(i+2)%5];
}
void SummonChannelers()
{
- for(int i=0; i<5; i++)
- if(!Channelers[i] || Channelers[i]->isDead())
- Channelers[i] = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000);
- }
-
- void JustSummoned(Creature *summon)
- {
- for(int i=0; i<5; i++)
- if(!Channelers[i] || Channelers[i]->isDead())
- return;
- DoCast(m_creature,SPELL_EVOCATION);
+ for(int i=0; i<5; ++i)
+ {
+ Creature *channeler = (Creature*)Unit::GetUnit(*m_creature, Channelers[i]);
+ if(!channeler || channeler->isDead())
+ channeler = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000);
+ Channelers[i] = channeler->GetGUID();
+ }
}
void JustDied(Unit* Killer)
@@ -309,8 +315,11 @@ struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI
{
if (!m_creature->IsNonMeleeSpellCasted(false))
if(Creature *Kelidan = (Creature *)FindCreature(ENTRY_KELIDAN, 100))
- if(Creature *channeled = ((boss_kelidan_the_breakerAI*)Kelidan->AI())->GetChanneled(m_creature))
- DoCast(channeled,SPELL_CHANNELING);
+ {
+ uint64 channeler = ((boss_kelidan_the_breakerAI*)Kelidan->AI())->GetChanneled(m_creature);
+ if(Unit *channeled = Unit::GetUnit(*m_creature, channeler))
+ DoCast(channeled,SPELL_CHANNELING);
+ }
check_Timer = 5000;
}else check_Timer -= diff;
return;
diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp
index f0a10f74129..3c803350bb6 100644
--- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp
+++ b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp
@@ -24,30 +24,30 @@ EndScriptData */
#include "precompiled.h"
#include "def_blood_furnace.h"
-#define ENTRY_DOOR1 181823
-#define ENTRY_DOOR2 181766
+#define ENTRY_SEWER1 181823
+#define ENTRY_SEWER2 181766
struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance
{
instance_blood_furnace(Map *map) : ScriptedInstance(map) {Initialize();};
- uint64 Door1GUID;
- uint64 Door2GUID;
+ uint64 Sewer1GUID;
+ uint64 Sewer2GUID;
void Initialize()
{
- Door1GUID = 0;
- Door2GUID = 0;
+ Sewer1GUID = 0;
+ Sewer2GUID = 0;
}
void OnObjectCreate(GameObject *go)
{
switch(go->GetEntry())
{
- case ENTRY_DOOR1: Door1GUID = go->GetGUID(); break;
- case ENTRY_DOOR2: Door2GUID = go->GetGUID(); break;
+ case ENTRY_SEWER1: Sewer1GUID = go->GetGUID(); break;
+ case ENTRY_SEWER2: Sewer2GUID = go->GetGUID(); break;
}
}
@@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance
}
}
- debug_log("SD2: Instance Blood Furnace: GetPlayerInMap, but PlayerList is empty!");
+ debug_log("TSCR: Instance Blood Furnace: GetPlayerInMap, but PlayerList is empty!");
return NULL;
}
@@ -74,7 +74,7 @@ struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance
if (!player || !guid)
{
- debug_log("SD2: Blood Furnace: HandleGameObject fail");
+ debug_log("TSCR: Blood Furnace: HandleGameObject fail");
return;
}
@@ -89,8 +89,8 @@ struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance
case DATA_KELIDANEVENT:
if( data == DONE )
{
- HandleGameObject(Door1GUID,0);
- HandleGameObject(Door2GUID,0);
+ HandleGameObject(Sewer1GUID,0);
+ HandleGameObject(Sewer2GUID,0);
}
break;
}