* Rename InstanceData to InstanceScript

* Rename *mgr to their new names in scripts project
* Mass convert all the scripts (NEEDS THOROUGH TESTING, because it was done automatically) Please, report bugs on issue tracker.

--HG--
branch : trunk
rename : src/server/game/Instances/InstanceData.cpp => src/server/game/Instances/InstanceScript.cpp
rename : src/server/game/Instances/InstanceData.h => src/server/game/Instances/InstanceScript.h
This commit is contained in:
azazel
2010-08-08 22:54:58 +06:00
parent 8a69e50d6a
commit 590199d8e1
482 changed files with 84476 additions and 82697 deletions
@@ -52,166 +52,171 @@ UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`=
#define EVENT_ROCK_SHOWER 5 //set = 20s cd,unkown cd
#define EVENT_SHIELD_CRUSH 6 //set = 30s cd
#define EVENT_WHIRL 8 //set= 10s cd
struct boss_archavonAI : public ScriptedAI
␍class boss_archavon : public CreatureScript
{
boss_archavonAI(Creature *c) : ScriptedAI(c)
public:
boss_archavon() : CreatureScript("boss_archavon") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_archavonAI (pCreature);
}
ScriptedInstance* pInstance;
EventMap events;
void Reset()
struct boss_archavonAI : public ScriptedAI
{
events.Reset();
if (pInstance)
pInstance->SetData(DATA_ARCHAVON_EVENT, NOT_STARTED);
}
void KilledUnit(Unit* /*Victim*/) {}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_ARCHAVON_EVENT, DONE);
}
void EnterCombat(Unit * /*who*/)
{
DoZoneInCombat();
events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000);
events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000);
events.ScheduleEvent(EVENT_STOMP, 45000);
events.ScheduleEvent(EVENT_BERSERK, 300000);
if (pInstance)
pInstance->SetData(DATA_ARCHAVON_EVENT, IN_PROGRESS);
}
// Below UpdateAI may need review/debug.
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
boss_archavonAI(Creature *c) : ScriptedAI(c)
{
switch(eventId)
{
case EVENT_ROCK_SHARDS:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_ROCK_SHARDS);
events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000);
return;
case EVENT_CHOKING_CLOUD:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_CRUSHING_LEAP, true); //10y~80y, ignore range
events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000);
return;
case EVENT_STOMP:
DoCast(me->getVictim(), SPELL_STOMP);
events.ScheduleEvent(EVENT_IMPALE, 3000);
events.ScheduleEvent(EVENT_STOMP, 45000);
return;
case EVENT_IMPALE:
DoCast(me->getVictim(), SPELL_IMPALE);
return;
case EVENT_BERSERK:
DoCast(me, SPELL_BERSERK);
DoScriptText(EMOTE_BERSERK, me);
return;
}
pInstance = c->GetInstanceScript();
}
DoMeleeAttackIfReady();
}
InstanceScript* pInstance;
EventMap events;
void Reset()
{
events.Reset();
if (pInstance)
pInstance->SetData(DATA_ARCHAVON_EVENT, NOT_STARTED);
}
void KilledUnit(Unit* /*Victim*/) {}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_ARCHAVON_EVENT, DONE);
}
void EnterCombat(Unit * /*who*/)
{
DoZoneInCombat();
events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000);
events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000);
events.ScheduleEvent(EVENT_STOMP, 45000);
events.ScheduleEvent(EVENT_BERSERK, 300000);
if (pInstance)
pInstance->SetData(DATA_ARCHAVON_EVENT, IN_PROGRESS);
}
// Below UpdateAI may need review/debug.
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_ROCK_SHARDS:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_ROCK_SHARDS);
events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000);
return;
case EVENT_CHOKING_CLOUD:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_CRUSHING_LEAP, true); //10y~80y, ignore range
events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000);
return;
case EVENT_STOMP:
DoCast(me->getVictim(), SPELL_STOMP);
events.ScheduleEvent(EVENT_IMPALE, 3000);
events.ScheduleEvent(EVENT_STOMP, 45000);
return;
case EVENT_IMPALE:
DoCast(me->getVictim(), SPELL_IMPALE);
return;
case EVENT_BERSERK:
DoCast(me, SPELL_BERSERK);
DoScriptText(EMOTE_BERSERK, me);
return;
}
}
DoMeleeAttackIfReady();
}
};
};
/*######
## Mob Archavon Warder
######*/
struct mob_archavon_warderAI : public ScriptedAI //npc 32353
######*/␍class mob_archavon_warder : public CreatureScript
{
mob_archavon_warderAI(Creature *c) : ScriptedAI(c) {}
public:
mob_archavon_warder() : CreatureScript("mob_archavon_warder") { }
EventMap events;
void Reset()
CreatureAI* GetAI(Creature* pCreature) const
{
events.Reset();
return new mob_archavon_warderAI(pCreature);
}
void EnterCombat(Unit * /*who*/)
struct mob_archavon_warderAI : public ScriptedAI //npc 32353
{
DoZoneInCombat();
events.ScheduleEvent(EVENT_ROCK_SHOWER, 2000);
events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000);
events.ScheduleEvent(EVENT_WHIRL, 7500);
}
mob_archavon_warderAI(Creature *c) : ScriptedAI(c) {}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
EventMap events;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
void Reset()
{
switch(eventId)
{
case EVENT_ROCK_SHOWER:
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_ROCK_SHOWER);
events.ScheduleEvent(EVENT_ROCK_SHARDS, 6000);
return;
}
case EVENT_SHIELD_CRUSH:
DoCast(me->getVictim(), SPELL_SHIELD_CRUSH);
events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000);
return;
case EVENT_WHIRL:
DoCast(me->getVictim(), SPELL_WHIRL);
events.ScheduleEvent(EVENT_WHIRL, 8000);
return;
}
events.Reset();
}
DoMeleeAttackIfReady();
}
void EnterCombat(Unit * /*who*/)
{
DoZoneInCombat();
events.ScheduleEvent(EVENT_ROCK_SHOWER, 2000);
events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000);
events.ScheduleEvent(EVENT_WHIRL, 7500);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_ROCK_SHOWER:
{
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_ROCK_SHOWER);
events.ScheduleEvent(EVENT_ROCK_SHARDS, 6000);
return;
}
case EVENT_SHIELD_CRUSH:
DoCast(me->getVictim(), SPELL_SHIELD_CRUSH);
events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000);
return;
case EVENT_WHIRL:
DoCast(me->getVictim(), SPELL_WHIRL);
events.ScheduleEvent(EVENT_WHIRL, 8000);
return;
}
}
DoMeleeAttackIfReady();
}
};
};
CreatureAI* GetAI_mob_archavon_warder(Creature* pCreature)
{
return new mob_archavon_warderAI(pCreature);
}
CreatureAI* GetAI_boss_archavon(Creature* pCreature)
{
return new boss_archavonAI (pCreature);
}
void AddSC_boss_archavon()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_archavon";
newscript->GetAI = &GetAI_boss_archavon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_archavon_warder";
newscript->GetAI = &GetAI_mob_archavon_warder;
newscript->RegisterSelf();
new boss_archavon();
new mob_archavon_warder();
}
@@ -56,214 +56,219 @@ struct Position TempestMinions[MAX_TEMPEST_MINIONS] =
/*######
## Emalon the Storm Watcher
######*/
struct boss_emalonAI : public BossAI
######*/␍class boss_emalon : public CreatureScript
{
boss_emalonAI(Creature *c) : BossAI(c, DATA_EMALON_EVENT)
public:
boss_emalon() : CreatureScript("boss_emalon") { }
CreatureAI* GetAI(Creature *_Creature)
{
return new boss_emalonAI (_Creature);
}
void Reset()
struct boss_emalonAI : public BossAI
{
_Reset();
for (uint8 i = 0; i < MAX_TEMPEST_MINIONS; ++i)
me->SummonCreature(MOB_TEMPEST_MINION, TempestMinions[i], TEMPSUMMON_CORPSE_DESPAWN, 0);
}
void JustSummoned(Creature *summoned)
{
BossAI::JustSummoned(summoned);
if (me->getVictim() && summoned->AI())
summoned->AI()->AttackStart(me->getVictim());
}
void EnterCombat(Unit * who)
{
if (!summons.empty())
boss_emalonAI(Creature *c) : BossAI(c, DATA_EMALON_EVENT)
{
for (std::list<uint64>::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
{
Creature *minion = Unit::GetCreature(*me, *itr);
if (minion && minion->isAlive() && !minion->getVictim() && minion->AI())
minion->AI()->AttackStart(who);
}
}
events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 5000);
events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000);
events.ScheduleEvent(EVENT_BERSERK, 360000);
events.ScheduleEvent(EVENT_OVERCHARGE, 45000);
_EnterCombat();
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
void Reset()
{
switch(eventId)
_Reset();
for (uint8 i = 0; i < MAX_TEMPEST_MINIONS; ++i)
me->SummonCreature(MOB_TEMPEST_MINION, TempestMinions[i], TEMPSUMMON_CORPSE_DESPAWN, 0);
}
void JustSummoned(Creature *summoned)
{
BossAI::JustSummoned(summoned);
if (me->getVictim() && summoned->AI())
summoned->AI()->AttackStart(me->getVictim());
}
void EnterCombat(Unit * who)
{
if (!summons.empty())
{
case EVENT_CHAIN_LIGHTNING:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 25000);
break;
case EVENT_LIGHTNING_NOVA:
DoCastAOE(SPELL_LIGHTNING_NOVA, false);
events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000);
break;
case EVENT_OVERCHARGE:
if (!summons.empty())
for (std::list<uint64>::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
{
std::list<uint64>::const_iterator itr = summons.begin();
std::advance(itr, urand(0, summons.size()-1));
Creature *minion = Unit::GetCreature(*me, *itr);
if (minion && minion->isAlive())
{
minion->CastSpell(me, SPELL_OVERCHARGED, true);
minion->SetHealth(minion->GetMaxHealth());
DoScriptText(EMOTE_OVERCHARGE, me);
events.ScheduleEvent(EVENT_OVERCHARGE, 45000);
}
if (minion && minion->isAlive() && !minion->getVictim() && minion->AI())
minion->AI()->AttackStart(who);
}
break;
case EVENT_BERSERK:
DoCast(me, SPELL_BERSERK);
DoScriptText(EMOTE_BERSERK, me);
break;
}
events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 5000);
events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000);
events.ScheduleEvent(EVENT_BERSERK, 360000);
events.ScheduleEvent(EVENT_OVERCHARGE, 45000);
_EnterCombat();
}
DoMeleeAttackIfReady();
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_CHAIN_LIGHTNING:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_CHAIN_LIGHTNING);
events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 25000);
break;
case EVENT_LIGHTNING_NOVA:
DoCastAOE(SPELL_LIGHTNING_NOVA, false);
events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000);
break;
case EVENT_OVERCHARGE:
if (!summons.empty())
{
std::list<uint64>::const_iterator itr = summons.begin();
std::advance(itr, urand(0, summons.size()-1));
Creature *minion = Unit::GetCreature(*me, *itr);
if (minion && minion->isAlive())
{
minion->CastSpell(me, SPELL_OVERCHARGED, true);
minion->SetHealth(minion->GetMaxHealth());
DoScriptText(EMOTE_OVERCHARGE, me);
events.ScheduleEvent(EVENT_OVERCHARGE, 45000);
}
}
break;
case EVENT_BERSERK:
DoCast(me, SPELL_BERSERK);
DoScriptText(EMOTE_BERSERK, me);
break;
}
}
DoMeleeAttackIfReady();
}
};
};
/*######
## Tempest Minion
######*/
struct mob_tempest_minionAI : public ScriptedAI
######*/␍class mob_tempest_minion : public CreatureScript
{
mob_tempest_minionAI(Creature *c) : ScriptedAI(c)
public:
mob_tempest_minion() : CreatureScript("mob_tempest_minion") { }
CreatureAI* GetAI(Creature *_Creature)
{
pInstance = c->GetInstanceData();
return new mob_tempest_minionAI (_Creature);
}
ScriptedInstance* pInstance;
EventMap events;
uint32 uiOverchargedTimer;
void Reset()
struct mob_tempest_minionAI : public ScriptedAI
{
events.Reset();
uiOverchargedTimer = 0;
}
void JustDied(Unit* /*Killer*/)
{
if (Creature *pEmalon = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
mob_tempest_minionAI(Creature *c) : ScriptedAI(c)
{
if (pEmalon->isAlive())
{
pEmalon->SummonCreature(MOB_TEMPEST_MINION, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
DoScriptText(EMOTE_MINION_RESPAWN, me);
}
pInstance = c->GetInstanceScript();
}
}
void EnterCombat(Unit * who)
{
DoZoneInCombat();
events.ScheduleEvent(EVENT_SHOCK, 20000);
InstanceScript* pInstance;
if (Creature *pEmalon = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
EventMap events;
uint32 uiOverchargedTimer;
void Reset()
{
if (!pEmalon->getVictim() && pEmalon->AI())
pEmalon->AI()->AttackStart(who);
events.Reset();
uiOverchargedTimer = 0;
}
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
if (Aura *overchargedAura = me->GetAura(SPELL_OVERCHARGED))
void JustDied(Unit* /*Killer*/)
{
if (overchargedAura->GetStackAmount() < 10)
if (Creature *pEmalon = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
{
if (uiOverchargedTimer <= diff)
if (pEmalon->isAlive())
{
DoCast(me, SPELL_OVERCHARGED);
uiOverchargedTimer = 2000;
} else uiOverchargedTimer -=diff;
}
else
{
if (overchargedAura->GetStackAmount() == 10)
{
DoCast(me, SPELL_OVERCHARGED_BLAST);
me->ForcedDespawn();
pEmalon->SummonCreature(MOB_TEMPEST_MINION, 0, 0, 0, 0, TEMPSUMMON_CORPSE_DESPAWN, 0);
DoScriptText(EMOTE_MINION_RESPAWN, me);
}
}
}
while (uint32 eventId = events.ExecuteEvent())
void EnterCombat(Unit * who)
{
switch(eventId)
DoZoneInCombat();
events.ScheduleEvent(EVENT_SHOCK, 20000);
if (Creature *pEmalon = Unit::GetCreature(*me, pInstance ? pInstance->GetData64(DATA_EMALON) : 0))
{
case EVENT_SHOCK:
DoCast(me->getVictim(), SPELL_SHOCK);
events.ScheduleEvent(EVENT_SHOCK, 20000);
return;
if (!pEmalon->getVictim() && pEmalon->AI())
pEmalon->AI()->AttackStart(who);
}
}
DoMeleeAttackIfReady();
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
if (Aura *overchargedAura = me->GetAura(SPELL_OVERCHARGED))
{
if (overchargedAura->GetStackAmount() < 10)
{
if (uiOverchargedTimer <= diff)
{
DoCast(me, SPELL_OVERCHARGED);
uiOverchargedTimer = 2000;
} else uiOverchargedTimer -=diff;
}
else
{
if (overchargedAura->GetStackAmount() == 10)
{
DoCast(me, SPELL_OVERCHARGED_BLAST);
me->ForcedDespawn();
DoScriptText(EMOTE_MINION_RESPAWN, me);
}
}
}
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_SHOCK:
DoCast(me->getVictim(), SPELL_SHOCK);
events.ScheduleEvent(EVENT_SHOCK, 20000);
return;
}
}
DoMeleeAttackIfReady();
}
};
};
CreatureAI* GetAI_mob_tempest_minion(Creature *_Creature)
{
return new mob_tempest_minionAI (_Creature);
}
CreatureAI* GetAI_boss_emalon(Creature *_Creature)
{
return new boss_emalonAI (_Creature);
}
void AddSC_boss_emalon()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_emalon";
newscript->GetAI = &GetAI_boss_emalon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_tempest_minion";
newscript->GetAI = &GetAI_mob_tempest_minion;
newscript->RegisterSelf();
new boss_emalon();
new mob_tempest_minion();
}
@@ -62,160 +62,165 @@ enum Spells
SPELL_FW_METEOR_FISTS_B = 67331,
SPELL_FW_METEOR_FISTS_B_H = 68160,
};
struct boss_koralonAI : public ScriptedAI
␍class boss_koralon : public CreatureScript
{
boss_koralonAI(Creature *c) : ScriptedAI(c)
public:
boss_koralon() : CreatureScript("boss_koralon") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_koralonAI (pCreature);
}
ScriptedInstance *pInstance;
EventMap events;
void Reset()
struct boss_koralonAI : public ScriptedAI
{
events.Reset();
if (pInstance)
pInstance->SetData(DATA_KORALON_EVENT, NOT_STARTED);
}
void KilledUnit(Unit* /*Victim*/) {}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_KORALON_EVENT, DONE);
}
void EnterCombat(Unit * /*who*/)
{
DoZoneInCombat();
DoCast(me, SPELL_BURNING_FURY);
events.ScheduleEvent(EVENT_BURNING_FURY, 20000); // TODO check timer
events.ScheduleEvent(EVENT_BURNING_BREATH, 15000); // 1st after 15sec, then every 45sec
events.ScheduleEvent(EVENT_METEOR_FISTS_A, 75000); // 1st after 75sec, then every 45sec
events.ScheduleEvent(EVENT_FLAME_CINDER_A, 30000); // TODO check timer
if (pInstance)
pInstance->SetData(DATA_KORALON_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
boss_koralonAI(Creature *c) : ScriptedAI(c)
{
switch(eventId)
{
case EVENT_BURNING_FURY:
DoCast(me, SPELL_BURNING_FURY);
events.ScheduleEvent(EVENT_BURNING_FURY, 20000);
return;
case EVENT_BURNING_BREATH:
DoCast(me, RAID_MODE(SPELL_BURNING_BREATH,SPELL_BURNING_BREATH_H));
events.ScheduleEvent(EVENT_BURNING_BREATH, 45000);
return;
case EVENT_METEOR_FISTS_A:
DoCast(me, RAID_MODE(SPELL_METEOR_FISTS_A,SPELL_METEOR_FISTS_A_H));
events.ScheduleEvent(EVENT_METEOR_FISTS_B, 1500);
return;
case EVENT_METEOR_FISTS_B:
DoCast(me, RAID_MODE(SPELL_METEOR_FISTS_B,SPELL_METEOR_FISTS_B_H));
events.ScheduleEvent(EVENT_METEOR_FISTS_A, 45000);
return;
case EVENT_FLAME_CINDER_A:
DoCast(me, RAID_MODE(SPELL_FLAME_CINDER_A,SPELL_FLAME_CINDER_A_H));
events.ScheduleEvent(EVENT_FLAME_CINDER_A, 30000);
return;
}
pInstance = c->GetInstanceScript();
}
DoMeleeAttackIfReady();
}
InstanceScript *pInstance;
EventMap events;
void Reset()
{
events.Reset();
if (pInstance)
pInstance->SetData(DATA_KORALON_EVENT, NOT_STARTED);
}
void KilledUnit(Unit* /*Victim*/) {}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_KORALON_EVENT, DONE);
}
void EnterCombat(Unit * /*who*/)
{
DoZoneInCombat();
DoCast(me, SPELL_BURNING_FURY);
events.ScheduleEvent(EVENT_BURNING_FURY, 20000); // TODO check timer
events.ScheduleEvent(EVENT_BURNING_BREATH, 15000); // 1st after 15sec, then every 45sec
events.ScheduleEvent(EVENT_METEOR_FISTS_A, 75000); // 1st after 75sec, then every 45sec
events.ScheduleEvent(EVENT_FLAME_CINDER_A, 30000); // TODO check timer
if (pInstance)
pInstance->SetData(DATA_KORALON_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_BURNING_FURY:
DoCast(me, SPELL_BURNING_FURY);
events.ScheduleEvent(EVENT_BURNING_FURY, 20000);
return;
case EVENT_BURNING_BREATH:
DoCast(me, RAID_MODE(SPELL_BURNING_BREATH,SPELL_BURNING_BREATH_H));
events.ScheduleEvent(EVENT_BURNING_BREATH, 45000);
return;
case EVENT_METEOR_FISTS_A:
DoCast(me, RAID_MODE(SPELL_METEOR_FISTS_A,SPELL_METEOR_FISTS_A_H));
events.ScheduleEvent(EVENT_METEOR_FISTS_B, 1500);
return;
case EVENT_METEOR_FISTS_B:
DoCast(me, RAID_MODE(SPELL_METEOR_FISTS_B,SPELL_METEOR_FISTS_B_H));
events.ScheduleEvent(EVENT_METEOR_FISTS_A, 45000);
return;
case EVENT_FLAME_CINDER_A:
DoCast(me, RAID_MODE(SPELL_FLAME_CINDER_A,SPELL_FLAME_CINDER_A_H));
events.ScheduleEvent(EVENT_FLAME_CINDER_A, 30000);
return;
}
}
DoMeleeAttackIfReady();
}
};
};
/*######
## Mob Flame Warder
######*/
struct mob_flame_warderAI : public ScriptedAI
######*/␍class mob_flame_warder : public CreatureScript
{
mob_flame_warderAI(Creature *c) : ScriptedAI(c) {}
public:
mob_flame_warder() : CreatureScript("mob_flame_warder") { }
EventMap events;
void Reset()
CreatureAI* GetAI(Creature* pCreature) const
{
events.Reset();
return new mob_flame_warderAI (pCreature);
}
void EnterCombat(Unit * /*who*/)
struct mob_flame_warderAI : public ScriptedAI
{
DoZoneInCombat();
mob_flame_warderAI(Creature *c) : ScriptedAI(c) {}
events.ScheduleEvent(EVENT_FW_LAVA_BIRST, 5000);
events.ScheduleEvent(EVENT_FW_METEOR_FISTS_A, 10000);
}
EventMap events;
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
void Reset()
{
switch(eventId)
{
case EVENT_FW_LAVA_BIRST:
DoCast(me->getVictim(), RAID_MODE(SPELL_FW_LAVA_BIRST,SPELL_FW_LAVA_BIRST_H));
events.ScheduleEvent(EVENT_FW_LAVA_BIRST, 15000);
return;
case EVENT_FW_METEOR_FISTS_A:
DoCast(me, RAID_MODE(SPELL_FW_METEOR_FISTS_A,SPELL_FW_METEOR_FISTS_A_H));
events.ScheduleEvent(EVENT_FW_METEOR_FISTS_B, 1500);
return;
case EVENT_FW_METEOR_FISTS_B:
DoCast(me, RAID_MODE(SPELL_FW_METEOR_FISTS_B,SPELL_FW_METEOR_FISTS_B_H));
events.ScheduleEvent(EVENT_FW_METEOR_FISTS_A, 20000);
return;
}
events.Reset();
}
DoMeleeAttackIfReady();
}
void EnterCombat(Unit * /*who*/)
{
DoZoneInCombat();
events.ScheduleEvent(EVENT_FW_LAVA_BIRST, 5000);
events.ScheduleEvent(EVENT_FW_METEOR_FISTS_A, 10000);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_FW_LAVA_BIRST:
DoCast(me->getVictim(), RAID_MODE(SPELL_FW_LAVA_BIRST,SPELL_FW_LAVA_BIRST_H));
events.ScheduleEvent(EVENT_FW_LAVA_BIRST, 15000);
return;
case EVENT_FW_METEOR_FISTS_A:
DoCast(me, RAID_MODE(SPELL_FW_METEOR_FISTS_A,SPELL_FW_METEOR_FISTS_A_H));
events.ScheduleEvent(EVENT_FW_METEOR_FISTS_B, 1500);
return;
case EVENT_FW_METEOR_FISTS_B:
DoCast(me, RAID_MODE(SPELL_FW_METEOR_FISTS_B,SPELL_FW_METEOR_FISTS_B_H));
events.ScheduleEvent(EVENT_FW_METEOR_FISTS_A, 20000);
return;
}
}
DoMeleeAttackIfReady();
}
};
};
CreatureAI* GetAI_boss_koralon(Creature* pCreature)
{
return new boss_koralonAI (pCreature);
}
CreatureAI* GetAI_mob_flame_warder(Creature* pCreature)
{
return new mob_flame_warderAI (pCreature);
}
void AddSC_boss_koralon()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_koralon";
newscript->GetAI = &GetAI_boss_koralon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_flame_warder";
newscript->GetAI = &GetAI_mob_flame_warder;
newscript->RegisterSelf();
new boss_koralon();
new mob_flame_warder();
}
@@ -52,249 +52,260 @@ UPDATE `creature_template` SET `ScriptName`='mob_frozen_orb' WHERE `entry`='3845
// Mob Frozen Orb
#define MOB_FROZEN_ORB 38456 // 1 in 10 mode and 3 in 25 mode
struct boss_toravonAI : public ScriptedAI
␍class boss_toravon : public CreatureScript
{
boss_toravonAI(Creature *c) : ScriptedAI(c)
public:
boss_toravon() : CreatureScript("boss_toravon") { }
CreatureAI* GetAI(Creature* pCreature) const
{
pInstance = c->GetInstanceData();
return new boss_toravonAI (pCreature);
}
ScriptedInstance *pInstance;
EventMap events;
void Reset()
struct boss_toravonAI : public ScriptedAI
{
events.Reset();
if (pInstance)
pInstance->SetData(DATA_TORAVON_EVENT, NOT_STARTED);
}
void KilledUnit(Unit* /*Victim*/) {}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_TORAVON_EVENT, DONE);
}
void EnterCombat(Unit * /*who*/)
{
DoZoneInCombat();
DoCast(me, SPELL_FROZEN_MALLET);
events.ScheduleEvent(EVENT_FROZEN_ORB, 11000);
events.ScheduleEvent(EVENT_WHITEOUT, 13000);
events.ScheduleEvent(EVENT_FREEZING_GROUND, 15000);
if (pInstance)
pInstance->SetData(DATA_TORAVON_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
boss_toravonAI(Creature *c) : ScriptedAI(c)
{
switch(eventId)
{
case EVENT_FROZEN_ORB:
DoCast(me, SPELL_FROZEN_ORB);
events.ScheduleEvent(EVENT_FROZEN_ORB, 38000);
return;
case EVENT_WHITEOUT:
DoCast(me, SPELL_WHITEOUT);
events.ScheduleEvent(EVENT_WHITEOUT, 38000);
return;
case EVENT_FREEZING_GROUND:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_FREEZING_GROUND);
events.ScheduleEvent(EVENT_FREEZING_GROUND, 20000);
return;
}
pInstance = c->GetInstanceScript();
}
DoMeleeAttackIfReady();
}
InstanceScript *pInstance;
EventMap events;
void Reset()
{
events.Reset();
if (pInstance)
pInstance->SetData(DATA_TORAVON_EVENT, NOT_STARTED);
}
void KilledUnit(Unit* /*Victim*/) {}
void JustDied(Unit* /*Killer*/)
{
if (pInstance)
pInstance->SetData(DATA_TORAVON_EVENT, DONE);
}
void EnterCombat(Unit * /*who*/)
{
DoZoneInCombat();
DoCast(me, SPELL_FROZEN_MALLET);
events.ScheduleEvent(EVENT_FROZEN_ORB, 11000);
events.ScheduleEvent(EVENT_WHITEOUT, 13000);
events.ScheduleEvent(EVENT_FREEZING_GROUND, 15000);
if (pInstance)
pInstance->SetData(DATA_TORAVON_EVENT, IN_PROGRESS);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
if (me->hasUnitState(UNIT_STAT_CASTING))
return;
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_FROZEN_ORB:
DoCast(me, SPELL_FROZEN_ORB);
events.ScheduleEvent(EVENT_FROZEN_ORB, 38000);
return;
case EVENT_WHITEOUT:
DoCast(me, SPELL_WHITEOUT);
events.ScheduleEvent(EVENT_WHITEOUT, 38000);
return;
case EVENT_FREEZING_GROUND:
if (Unit *pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0))
DoCast(pTarget, SPELL_FREEZING_GROUND);
events.ScheduleEvent(EVENT_FREEZING_GROUND, 20000);
return;
}
}
DoMeleeAttackIfReady();
}
};
};
/*######
## Mob Frost Warder
######*/
struct mob_frost_warderAI : public ScriptedAI
######*/␍class mob_frost_warder : public CreatureScript
{
mob_frost_warderAI(Creature *c) : ScriptedAI(c) {}
public:
mob_frost_warder() : CreatureScript("mob_frost_warder") { }
EventMap events;
void Reset()
CreatureAI* GetAI(Creature* pCreature) const
{
events.Reset();
return new mob_frost_warderAI (pCreature);
}
void EnterCombat(Unit * /*who*/)
struct mob_frost_warderAI : public ScriptedAI
{
DoZoneInCombat();
mob_frost_warderAI(Creature *c) : ScriptedAI(c) {}
DoCast(me, SPELL_FROZEN_MALLET);
EventMap events;
events.ScheduleEvent(EVENT_FROST_BLAST, 5000);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
void Reset()
{
switch(eventId)
{
case EVENT_FROST_BLAST:
DoCast(me->getVictim(), SPELL_FROST_BLAST);
events.ScheduleEvent(EVENT_FROST_BLAST, 20000);
return;
}
events.Reset();
}
DoMeleeAttackIfReady();
}
void EnterCombat(Unit * /*who*/)
{
DoZoneInCombat();
DoCast(me, SPELL_FROZEN_MALLET);
events.ScheduleEvent(EVENT_FROST_BLAST, 5000);
}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
events.Update(diff);
while (uint32 eventId = events.ExecuteEvent())
{
switch(eventId)
{
case EVENT_FROST_BLAST:
DoCast(me->getVictim(), SPELL_FROST_BLAST);
events.ScheduleEvent(EVENT_FROST_BLAST, 20000);
return;
}
}
DoMeleeAttackIfReady();
}
};
};
/*######
## Mob Frozen Orb
######*/
struct mob_frozen_orbAI : public ScriptedAI
######*/␍class mob_frozen_orb : public CreatureScript
{
mob_frozen_orbAI(Creature *c) : ScriptedAI(c) {}
public:
mob_frozen_orb() : CreatureScript("mob_frozen_orb") { }
bool done;
uint32 killtimer;
void Reset()
CreatureAI* GetAI(Creature* pCreature) const
{
done = false;
killtimer = 60000; // if after this time there is no victim -> destroy!
return new mob_frozen_orbAI (pCreature);
}
void EnterCombat(Unit * /*who*/)
struct mob_frozen_orbAI : public ScriptedAI
{
DoZoneInCombat();
}
mob_frozen_orbAI(Creature *c) : ScriptedAI(c) {}
void UpdateAI(const uint32 diff)
{
if (!done)
bool done;
uint32 killtimer;
void Reset()
{
DoCast(me, SPELL_FROZEN_ORB_AURA, true);
DoCast(me, SPELL_FROZEN_ORB_DMG, true);
done = true;
done = false;
killtimer = 60000; // if after this time there is no victim -> destroy!
}
if (killtimer <= diff)
void EnterCombat(Unit * /*who*/)
{
if (!UpdateVictim())
me->ForcedDespawn();
killtimer = 10000;
DoZoneInCombat();
}
else
killtimer -= diff;
}
void UpdateAI(const uint32 diff)
{
if (!done)
{
DoCast(me, SPELL_FROZEN_ORB_AURA, true);
DoCast(me, SPELL_FROZEN_ORB_DMG, true);
done = true;
}
if (killtimer <= diff)
{
if (!UpdateVictim())
me->ForcedDespawn();
killtimer = 10000;
}
else
killtimer -= diff;
}
};
};
/*######
## Mob Frozen Orb Stalker
######*/
struct mob_frozen_orb_stalkerAI : public Scripted_NoMovementAI
######*/␍class mob_frozen_orb_stalker : public CreatureScript
{
mob_frozen_orb_stalkerAI(Creature* c) : Scripted_NoMovementAI(c)
{
c->SetVisibility(VISIBILITY_OFF);
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_DISABLE_MOVE);
c->SetReactState(REACT_PASSIVE);
public:
mob_frozen_orb_stalker() : CreatureScript("mob_frozen_orb_stalker") { }
pInstance = c->GetInstanceData();
spawned = false;
CreatureAI* GetAI(Creature* pCreature) const
{
return new mob_frozen_orb_stalkerAI (pCreature);
}
ScriptedInstance *pInstance;
bool spawned;
void UpdateAI(const uint32 /*diff*/)
struct mob_frozen_orb_stalkerAI : public Scripted_NoMovementAI
{
if (spawned)
return;
spawned = true;
if (!pInstance)
return;
Unit* pToravon = me->GetCreature(*me, pInstance->GetData64(DATA_TORAVON));
if (!pToravon)
return;
uint8 num_orbs = RAID_MODE(1, 3);
for (uint8 i=0; i<num_orbs; ++i)
mob_frozen_orb_stalkerAI(Creature* c) : Scripted_NoMovementAI(c)
{
Position pos;
me->GetNearPoint(pToravon, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 10.0f, 0.0f);
me->SetPosition(pos, true);
DoCast(me, SPELL_FROZEN_ORB_SUMMON);
c->SetVisibility(VISIBILITY_OFF);
c->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_DISABLE_MOVE);
c->SetReactState(REACT_PASSIVE);
pInstance = c->GetInstanceScript();
spawned = false;
}
}
InstanceScript *pInstance;
bool spawned;
void UpdateAI(const uint32 /*diff*/)
{
if (spawned)
return;
spawned = true;
if (!pInstance)
return;
Unit* pToravon = me->GetCreature(*me, pInstance->GetData64(DATA_TORAVON));
if (!pToravon)
return;
uint8 num_orbs = RAID_MODE(1, 3);
for (uint8 i=0; i<num_orbs; ++i)
{
Position pos;
me->GetNearPoint(pToravon, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 10.0f, 0.0f);
me->SetPosition(pos, true);
DoCast(me, SPELL_FROZEN_ORB_SUMMON);
}
}
};
};
CreatureAI* GetAI_boss_toravon(Creature* pCreature)
{
return new boss_toravonAI (pCreature);
}
CreatureAI* GetAI_mob_frost_warder(Creature* pCreature)
{
return new mob_frost_warderAI (pCreature);
}
CreatureAI* GetAI_mob_frozen_orb(Creature* pCreature)
{
return new mob_frozen_orbAI (pCreature);
}
CreatureAI* GetAI_mob_frozen_orb_stalker(Creature* pCreature)
{
return new mob_frozen_orb_stalkerAI (pCreature);
}
void AddSC_boss_toravon()
{
Script *newscript;
newscript = new Script;
newscript->Name = "boss_toravon";
newscript->GetAI = &GetAI_boss_toravon;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_frost_warder";
newscript->GetAI = &GetAI_mob_frost_warder;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_frozen_orb";
newscript->GetAI = &GetAI_mob_frozen_orb;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "mob_frozen_orb_stalker";
newscript->GetAI = &GetAI_mob_frozen_orb_stalker;
newscript->RegisterSelf();
new boss_toravon();
new mob_frost_warder();
new mob_frozen_orb();
new mob_frozen_orb_stalker();
}
@@ -26,135 +26,138 @@
3 - Koralon the Flame Watcher event
4 - Toravon the Ice Watcher event
*/
struct instance_archavon : public ScriptedInstance
␍class instance_archavon : public InstanceMapScript
{
instance_archavon(Map *Map) : ScriptedInstance(Map) {};
public:
instance_archavon() : InstanceMapScript("instance_archavon") { }
uint32 uiEncounters[ENCOUNTERS];
uint64 uiArchavon;
uint64 uiEmalon;
uint64 uiKoralon;
uint64 uiToravon;
void Initialize()
InstanceScript* GetInstanceData_InstanceMapScript(Map* map)
{
uiArchavon = 0;
uiEmalon = 0;
uiKoralon = 0;
uiToravon = 0;
for (uint8 i = 0; i < ENCOUNTERS; i++)
uiEncounters[i] = NOT_STARTED;
return new instance_archavon_InstanceMapScript(map);
}
bool IsEncounterInProgress() const
struct instance_archavon_InstanceMapScript : public InstanceScript
{
for (uint8 i = 0; i < ENCOUNTERS; i++)
if (uiEncounters[i] == IN_PROGRESS)
return true;
instance_archavon_InstanceMapScript(Map *Map) : InstanceScript(Map) {};
return false;
}
uint32 uiEncounters[ENCOUNTERS];
void OnCreatureCreate(Creature *creature, bool /*add*/)
{
switch(creature->GetEntry())
uint64 uiArchavon;
uint64 uiEmalon;
uint64 uiKoralon;
uint64 uiToravon;
void Initialize()
{
case CREATURE_ARCHAVON: uiArchavon = creature->GetGUID(); break;
case CREATURE_EMALON: uiEmalon = creature->GetGUID(); break;
case CREATURE_KORALON: uiKoralon = creature->GetGUID(); break;
case CREATURE_TORAVON: uiToravon = creature->GetGUID(); break;
}
}
uiArchavon = 0;
uiEmalon = 0;
uiKoralon = 0;
uiToravon = 0;
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_ARCHAVON_EVENT: return uiEncounters[0];
case DATA_EMALON_EVENT: return uiEncounters[1];
case DATA_KORALON_EVENT: return uiEncounters[2];
case DATA_TORAVON_EVENT: return uiEncounters[3];
}
return 0;
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_ARCHAVON: return uiArchavon;
case DATA_EMALON: return uiEmalon;
case DATA_KORALON: return uiKoralon;
case DATA_TORAVON: return uiToravon;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_ARCHAVON_EVENT: uiEncounters[0] = data; break;
case DATA_EMALON_EVENT: uiEncounters[1] = data; break;
case DATA_KORALON_EVENT: uiEncounters[2] = data; break;
case DATA_TORAVON_EVENT: uiEncounters[3] = data; break;
}
if (data == DONE)
SaveToDB();
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream stream;
stream << uiEncounters[0] << " " << uiEncounters[1] << " " << uiEncounters[2] << " " << uiEncounters[3];
char* out = new char[stream.str().length() + 1];
strcpy(out, stream.str().c_str());
if (out)
{
OUT_SAVE_INST_DATA_COMPLETE;
return out;
}
return NULL;
}
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
std::istringstream stream(in);
stream >> uiEncounters[0] >> uiEncounters[1] >> uiEncounters[2] >> uiEncounters[3];
for (uint8 i = 0; i < ENCOUNTERS; ++i)
if (uiEncounters[i] == IN_PROGRESS)
for (uint8 i = 0; i < ENCOUNTERS; i++)
uiEncounters[i] = NOT_STARTED;
}
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < ENCOUNTERS; i++)
if (uiEncounters[i] == IN_PROGRESS)
return true;
return false;
}
void OnCreatureCreate(Creature *creature, bool /*add*/)
{
switch(creature->GetEntry())
{
case CREATURE_ARCHAVON: uiArchavon = creature->GetGUID(); break;
case CREATURE_EMALON: uiEmalon = creature->GetGUID(); break;
case CREATURE_KORALON: uiKoralon = creature->GetGUID(); break;
case CREATURE_TORAVON: uiToravon = creature->GetGUID(); break;
}
}
uint32 GetData(uint32 type)
{
switch(type)
{
case DATA_ARCHAVON_EVENT: return uiEncounters[0];
case DATA_EMALON_EVENT: return uiEncounters[1];
case DATA_KORALON_EVENT: return uiEncounters[2];
case DATA_TORAVON_EVENT: return uiEncounters[3];
}
return 0;
}
uint64 GetData64(uint32 identifier)
{
switch(identifier)
{
case DATA_ARCHAVON: return uiArchavon;
case DATA_EMALON: return uiEmalon;
case DATA_KORALON: return uiKoralon;
case DATA_TORAVON: return uiToravon;
}
return 0;
}
void SetData(uint32 type, uint32 data)
{
switch(type)
{
case DATA_ARCHAVON_EVENT: uiEncounters[0] = data; break;
case DATA_EMALON_EVENT: uiEncounters[1] = data; break;
case DATA_KORALON_EVENT: uiEncounters[2] = data; break;
case DATA_TORAVON_EVENT: uiEncounters[3] = data; break;
}
if (data == DONE)
SaveToDB();
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream stream;
stream << uiEncounters[0] << " " << uiEncounters[1] << " " << uiEncounters[2] << " " << uiEncounters[3];
char* out = new char[stream.str().length() + 1];
strcpy(out, stream.str().c_str());
if (out)
{
OUT_SAVE_INST_DATA_COMPLETE;
return out;
}
return NULL;
}
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
std::istringstream stream(in);
stream >> uiEncounters[0] >> uiEncounters[1] >> uiEncounters[2] >> uiEncounters[3];
for (uint8 i = 0; i < ENCOUNTERS; ++i)
if (uiEncounters[i] == IN_PROGRESS)
uiEncounters[i] = NOT_STARTED;
OUT_LOAD_INST_DATA_COMPLETE;
}
};
OUT_LOAD_INST_DATA_COMPLETE;
}
};
InstanceData* GetInstanceData_instance_archavon(Map* map)
{
return new instance_archavon(map);
}
void AddSC_instance_archavon()
{
Script *newscript;
newscript = new Script;
newscript->Name = "instance_archavon";
newscript->GetInstanceData = &GetInstanceData_instance_archavon;
newscript->RegisterSelf();
new instance_archavon();
}