convert Blood Furnace to new format

--HG--
branch : trunk
This commit is contained in:
Supabad
2010-08-07 23:17:11 +02:00
parent 79b0567a74
commit 7ce0a6cf69
4 changed files with 669 additions and 613 deletions
@@ -37,11 +37,20 @@ enum eEnums
SPELL_POISON = 30914
};
class boss_broggok : public CreatureScript
{
public:
boss_broggok()
: CreatureScript("boss_broggok")
{
}
struct boss_broggokAI : public ScriptedAI
{
boss_broggokAI(Creature *c) : ScriptedAI(c)
boss_broggokAI(Creature* pCreature) : ScriptedAI(pCreature)
{
pInstance = c->GetInstanceData();
pInstance = pCreature->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -89,19 +98,25 @@ struct boss_broggokAI : public ScriptedAI
{
DoCast(me->getVictim(), SPELL_SLIME_SPRAY);
AcidSpray_Timer = 4000+rand()%8000;
} else AcidSpray_Timer -=diff;
}
else
AcidSpray_Timer -=diff;
if (PoisonBolt_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_POISON_BOLT);
PoisonBolt_Timer = 4000+rand()%8000;
} else PoisonBolt_Timer -=diff;
}
else
PoisonBolt_Timer -=diff;
if (PoisonSpawn_Timer <= diff)
{
DoCast(me, SPELL_POISON_CLOUD);
PoisonSpawn_Timer = 20000;
} else PoisonSpawn_Timer -=diff;
}
else
PoisonSpawn_Timer -=diff;
DoMeleeAttackIfReady();
}
@@ -118,16 +133,13 @@ struct boss_broggokAI : public ScriptedAI
};
CreatureAI* GetAI_boss_broggok(Creature* pCreature)
CreatureAI* GetAI(Creature* Creature) const
{
return new boss_broggokAI (pCreature);
return new boss_broggokAI (Creature);
}
};
void AddSC_boss_broggok()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_broggok";
newscript->GetAI = &GetAI_boss_broggok;
newscript->RegisterSelf();
new boss_broggok();
}
@@ -67,11 +67,20 @@ const float ShadowmoonChannelers[5][4]=
{316,-109,-24.6,1.257}
};
class boss_kelidan_the_breaker : public CreatureScript
{
public:
boss_kelidan_the_breaker()
: CreatureScript("boss_kelidan_the_breaker")
{
}
struct boss_kelidan_the_breakerAI : public ScriptedAI
{
boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c)
boss_kelidan_the_breakerAI(Creature* pCreature) : ScriptedAI(pCreature)
{
pInstance = c->GetInstanceData();
pInstance = pCreature->GetInstanceData();
for (uint8 i=0; i<5; ++i)
Channelers[i] = 0;
}
@@ -195,7 +204,9 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
if (!me->IsNonMeleeSpellCasted(false))
DoCast(me, SPELL_EVOCATION);
check_Timer = 5000;
} else check_Timer -= diff;
}
else
check_Timer -= diff;
return;
}
@@ -206,7 +217,9 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
DoCast(me, SPELL_FIRE_NOVA, true);
Firenova = false;
ShadowVolley_Timer = 2000;
} else Firenova_Timer -=diff;
}
else
Firenova_Timer -=diff;
return;
}
@@ -215,13 +228,17 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
{
DoCast(me, SPELL_SHADOW_BOLT_VOLLEY);
ShadowVolley_Timer = 5000+rand()%8000;
} else ShadowVolley_Timer -=diff;
}
else
ShadowVolley_Timer -=diff;
if (Corruption_Timer <= diff)
{
DoCast(me, SPELL_CORRUPTION);
Corruption_Timer = 30000+rand()%20000;
} else Corruption_Timer -=diff;
}
else
Corruption_Timer -=diff;
if (BurningNova_Timer <= diff)
{
@@ -242,17 +259,20 @@ struct boss_kelidan_the_breakerAI : public ScriptedAI
BurningNova_Timer = 20000+rand()%8000;
Firenova_Timer= 5000;
Firenova = true;
} else BurningNova_Timer -=diff;
}
else
BurningNova_Timer -=diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_kelidan_the_breaker(Creature* pCreature)
CreatureAI* GetAI(Creature* Creature) const
{
return new boss_kelidan_the_breakerAI (pCreature);
return new boss_kelidan_the_breakerAI (Creature);
}
};
/*######
## mob_shadowmoon_channeler
@@ -267,9 +287,18 @@ enum eShadowmoon
SPELL_CHANNELING = 39123
};
class mob_shadowmoon_channeler : public CreatureScript
{
public:
mob_shadowmoon_channeler()
: CreatureScript("mob_shadowmoon_channeler")
{
}
struct mob_shadowmoon_channelerAI : public ScriptedAI
{
mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c)
mob_shadowmoon_channelerAI(Creature* pCreature) : ScriptedAI(pCreature)
{
}
@@ -289,7 +318,7 @@ struct mob_shadowmoon_channelerAI : public ScriptedAI
void EnterCombat(Unit* who)
{
if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100))
CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who);
CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who);
if (me->IsNonMeleeSpellCasted(false))
me->InterruptNonMeleeSpells(true);
DoStartMovement(who);
@@ -298,7 +327,7 @@ struct mob_shadowmoon_channelerAI : public ScriptedAI
void JustDied(Unit* Killer)
{
if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100))
CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer);
CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer);
}
void UpdateAI(const uint32 diff)
@@ -310,12 +339,14 @@ struct mob_shadowmoon_channelerAI : public ScriptedAI
if (!me->IsNonMeleeSpellCasted(false))
if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100))
{
uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(me);
uint64 channeler = CAST_AI(boss_kelidan_the_breaker::boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(me);
if (Unit *channeled = Unit::GetUnit(*me, channeler))
DoCast(channeled, SPELL_CHANNELING);
}
check_Timer = 5000;
} else check_Timer -= diff;
}
else
check_Timer -= diff;
return;
}
@@ -324,35 +355,31 @@ struct mob_shadowmoon_channelerAI : public ScriptedAI
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_MARK_OF_SHADOW);
MarkOfShadow_Timer = 15000+rand()%5000;
} else MarkOfShadow_Timer -=diff;
}
else
MarkOfShadow_Timer -=diff;
if (ShadowBolt_Timer <= diff)
{
DoCast(me->getVictim(), SPELL_SHADOW_BOLT);
ShadowBolt_Timer = 5000+rand()%1000;
} else ShadowBolt_Timer -=diff;
}
else
ShadowBolt_Timer -=diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_mob_shadowmoon_channeler(Creature* pCreature)
CreatureAI* GetAI(Creature* Creature) const
{
return new mob_shadowmoon_channelerAI (pCreature);
return new mob_shadowmoon_channelerAI (Creature);
}
};
void AddSC_boss_kelidan_the_breaker()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_kelidan_the_breaker";
newscript->GetAI = &GetAI_boss_kelidan_the_breaker;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_shadowmoon_channeler";
newscript->GetAI = &GetAI_mob_shadowmoon_channeler;
newscript->RegisterSelf();
new boss_kelidan_the_breaker();
new mob_shadowmoon_channeler();
}
@@ -41,11 +41,20 @@ enum eEnums
SPELL_DOMINATION = 25772 // ???
};
class boss_the_maker : public CreatureScript
{
public:
boss_the_maker()
: CreatureScript("boss_the_maker")
{
}
struct boss_the_makerAI : public ScriptedAI
{
boss_the_makerAI(Creature *c) : ScriptedAI(c)
boss_the_makerAI(Creature* pCreature) : ScriptedAI(pCreature)
{
pInstance = c->GetInstanceData();
pInstance = pCreature->GetInstanceData();
}
ScriptedInstance* pInstance;
@@ -107,14 +116,18 @@ struct boss_the_makerAI : public ScriptedAI
{
DoCast(me->getVictim(), SPELL_ACID_SPRAY);
AcidSpray_Timer = 15000+rand()%8000;
} else AcidSpray_Timer -=diff;
}
else
AcidSpray_Timer -=diff;
if (ExplodingBreaker_Timer <= diff)
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM,0))
DoCast(pTarget, SPELL_EXPLODING_BREAKER);
ExplodingBreaker_Timer = 4000+rand()%8000;
} else ExplodingBreaker_Timer -=diff;
}
else
ExplodingBreaker_Timer -=diff;
/* // Disabled until Core Support for mind control
if (domination_timer_timer <= diff)
@@ -132,23 +145,22 @@ struct boss_the_makerAI : public ScriptedAI
{
DoCast(me->getVictim(), SPELL_KNOCKDOWN);
Knockdown_Timer = 4000+rand()%8000;
} else Knockdown_Timer -=diff;
}
else
Knockdown_Timer -=diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_the_makerAI(Creature* pCreature)
CreatureAI* GetAI(Creature* Creature) const
{
return new boss_the_makerAI (pCreature);
return new boss_the_makerAI (Creature);
}
};
void AddSC_boss_the_maker()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_the_maker";
newscript->GetAI = &GetAI_boss_the_makerAI;
newscript->RegisterSelf();
new boss_the_maker();
}
@@ -30,9 +30,17 @@ EndScriptData */
#define ENTRY_SEWER2 181766
#define MAX_ENCOUNTER 3
struct instance_blood_furnace : public ScriptedInstance
class instance_blood_furnace : public InstanceMapScript
{
instance_blood_furnace(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
public:
instance_blood_furnace()
: InstanceMapScript("instance_blood_furnace")
{
}
struct instance_blood_furnace_InstanceMapScript : public ScriptedInstance
{
instance_blood_furnace_InstanceMapScript(Map* pMap) : ScriptedInstance(pMap) {Initialize();};
uint64 The_MakerGUID;
uint64 BroggokGUID;
@@ -218,17 +226,14 @@ struct instance_blood_furnace : public ScriptedInstance
}
};
InstanceData* GetInstanceData_instance_blood_furnace(Map* pMap)
InstanceData* GetInstanceData(Map* pMap) const
{
return new instance_blood_furnace(pMap);
return new instance_blood_furnace_InstanceMapScript(pMap);
}
};
void AddSC_instance_blood_furnace()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_blood_furnace";
newscript->GetInstanceData = &GetInstanceData_instance_blood_furnace;
newscript->RegisterSelf();
new instance_blood_furnace();
}