* 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:
@@ -38,90 +38,92 @@ enum Spells
|
||||
SPELL_SUMMONSWARMER = 25844, //might be 25708
|
||||
SPELL_PARALYZE = 23414 //doesnt work correct (core)
|
||||
};
|
||||
|
||||
struct boss_ayamissAI : public ScriptedAI
|
||||
␍class boss_ayamiss : public CreatureScript
|
||||
{
|
||||
boss_ayamissAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_ayamiss() : CreatureScript("boss_ayamiss") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
return new boss_ayamissAI (pCreature);
|
||||
}
|
||||
|
||||
uint32 STINGERSPRAY_Timer;
|
||||
uint32 POISONSTINGER_Timer;
|
||||
uint32 SUMMONSWARMER_Timer;
|
||||
uint32 phase;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
struct boss_ayamissAI : public ScriptedAI
|
||||
{
|
||||
STINGERSPRAY_Timer = 30000;
|
||||
POISONSTINGER_Timer = 30000;
|
||||
SUMMONSWARMER_Timer = 60000;
|
||||
phase=1;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_AYAMISS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_AYAMISS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_AYAMISS_EVENT, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//If he is 70% start phase 2
|
||||
if (phase == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 70 && !me->IsNonMeleeSpellCasted(false))
|
||||
boss_ayamissAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
phase=2;
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
//STINGERSPRAY_Timer (only in phase2)
|
||||
if (phase == 2 && STINGERSPRAY_Timer <= diff)
|
||||
uint32 STINGERSPRAY_Timer;
|
||||
uint32 POISONSTINGER_Timer;
|
||||
uint32 SUMMONSWARMER_Timer;
|
||||
uint32 phase;
|
||||
|
||||
InstanceScript *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_STINGERSPRAY);
|
||||
STINGERSPRAY_Timer = 30000;
|
||||
} else STINGERSPRAY_Timer -= diff;
|
||||
|
||||
//POISONSTINGER_Timer (only in phase1)
|
||||
if (phase == 1 && POISONSTINGER_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_POISONSTINGER);
|
||||
POISONSTINGER_Timer = 30000;
|
||||
} else POISONSTINGER_Timer -= diff;
|
||||
|
||||
//SUMMONSWARMER_Timer (only in phase1)
|
||||
if (SUMMONSWARMER_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUMMONSWARMER);
|
||||
SUMMONSWARMER_Timer = 60000;
|
||||
} else SUMMONSWARMER_Timer -= diff;
|
||||
phase=1;
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_AYAMISS_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_AYAMISS_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_AYAMISS_EVENT, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//If he is 70% start phase 2
|
||||
if (phase == 1 && me->GetHealth()*100 / me->GetMaxHealth() <= 70 && !me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
phase=2;
|
||||
}
|
||||
|
||||
//STINGERSPRAY_Timer (only in phase2)
|
||||
if (phase == 2 && STINGERSPRAY_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_STINGERSPRAY);
|
||||
STINGERSPRAY_Timer = 30000;
|
||||
} else STINGERSPRAY_Timer -= diff;
|
||||
|
||||
//POISONSTINGER_Timer (only in phase1)
|
||||
if (phase == 1 && POISONSTINGER_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_POISONSTINGER);
|
||||
POISONSTINGER_Timer = 30000;
|
||||
} else POISONSTINGER_Timer -= diff;
|
||||
|
||||
//SUMMONSWARMER_Timer (only in phase1)
|
||||
if (SUMMONSWARMER_Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_SUMMONSWARMER);
|
||||
SUMMONSWARMER_Timer = 60000;
|
||||
} else SUMMONSWARMER_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_ayamiss(Creature* pCreature)
|
||||
{
|
||||
return new boss_ayamissAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_ayamiss()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_ayamiss";
|
||||
newscript->GetAI = &GetAI_boss_ayamiss;
|
||||
newscript->RegisterSelf();
|
||||
new boss_ayamiss();
|
||||
}
|
||||
|
||||
|
||||
@@ -30,45 +30,47 @@ enum Yells
|
||||
{
|
||||
EMOTE_TARGET = -1509002
|
||||
};
|
||||
|
||||
struct boss_buruAI : public ScriptedAI
|
||||
␍class boss_buru : public CreatureScript
|
||||
{
|
||||
boss_buruAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_buru() : CreatureScript("boss_buru") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
return new boss_buruAI (pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
struct boss_buruAI : public ScriptedAI
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_BURU_EVENT, NOT_STARTED);
|
||||
}
|
||||
boss_buruAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_BURU_EVENT, IN_PROGRESS);
|
||||
}
|
||||
InstanceScript *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_BURU_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_BURU_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_BURU_EVENT, DONE);
|
||||
}
|
||||
};
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_BURU_EVENT, DONE);
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_buru(Creature* pCreature)
|
||||
{
|
||||
return new boss_buruAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_buru()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_buru";
|
||||
newscript->GetAI = &GetAI_boss_buru;
|
||||
newscript->RegisterSelf();
|
||||
new boss_buru();
|
||||
}
|
||||
|
||||
|
||||
@@ -35,111 +35,113 @@ enum Spells
|
||||
SPELL_TRASH = 3391,
|
||||
SPELL_WIDE_SLASH = 25814
|
||||
};
|
||||
|
||||
struct boss_kurinnaxxAI : public ScriptedAI
|
||||
␍class boss_kurinnaxx : public CreatureScript
|
||||
{
|
||||
boss_kurinnaxxAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_kurinnaxx() : CreatureScript("boss_kurinnaxx") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
return new boss_kurinnaxxAI (pCreature);
|
||||
}
|
||||
|
||||
uint32 uiMortalWoundTimer;
|
||||
uint32 uiSandtrapTimer;
|
||||
uint32 uiWideSlashTimer;
|
||||
uint32 uiSummonPlayerTimer;
|
||||
uint32 uiTrashTimer;
|
||||
bool bIsEnraged;
|
||||
|
||||
ScriptedInstance* pInstance;
|
||||
|
||||
void Reset()
|
||||
struct boss_kurinnaxxAI : public ScriptedAI
|
||||
{
|
||||
bIsEnraged = false;
|
||||
uiMortalWoundTimer = urand(2000,7000);
|
||||
uiSandtrapTimer = urand(20000,30000);
|
||||
uiWideSlashTimer = urand(10000,15000);
|
||||
uiTrashTimer = urand(20000,25000);
|
||||
uiSummonPlayerTimer = urand(30000,40000);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KURINNAXX_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KURINNAXX_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KURINNAXX_EVENT, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//If we are <30% cast enrage
|
||||
if (!bIsEnraged && me->GetHealth()*100 / me->GetMaxHealth() <= 30 && !me->IsNonMeleeSpellCasted(false))
|
||||
boss_kurinnaxxAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
bIsEnraged = true;
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
//Mortal Wound spell
|
||||
if (uiMortalWoundTimer <= diff)
|
||||
uint32 uiMortalWoundTimer;
|
||||
uint32 uiSandtrapTimer;
|
||||
uint32 uiWideSlashTimer;
|
||||
uint32 uiSummonPlayerTimer;
|
||||
uint32 uiTrashTimer;
|
||||
bool bIsEnraged;
|
||||
|
||||
InstanceScript* pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALWOUND);
|
||||
bIsEnraged = false;
|
||||
uiMortalWoundTimer = urand(2000,7000);
|
||||
} else uiMortalWoundTimer -= diff;
|
||||
|
||||
//Santrap spell
|
||||
if (uiSandtrapTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SANDTRAP);
|
||||
uiSandtrapTimer = 30000;
|
||||
} else uiSandtrapTimer -= diff;
|
||||
|
||||
//Wide Slash spell
|
||||
if (uiWideSlashTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WIDE_SLASH);
|
||||
uiSandtrapTimer = urand(20000,30000);
|
||||
uiWideSlashTimer = urand(10000,15000);
|
||||
} else uiWideSlashTimer -= diff;
|
||||
|
||||
//Trash spell
|
||||
if (uiTrashTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_TRASH);
|
||||
uiTrashTimer = urand(20000,25000);
|
||||
} else uiTrashTimer -= diff;
|
||||
|
||||
//Summon Player spell
|
||||
if (uiSummonPlayerTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SUMMON_PLAYER);
|
||||
uiSummonPlayerTimer = urand(30000,40000);
|
||||
} else uiSummonPlayerTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KURINNAXX_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KURINNAXX_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_KURINNAXX_EVENT, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//If we are <30% cast enrage
|
||||
if (!bIsEnraged && me->GetHealth()*100 / me->GetMaxHealth() <= 30 && !me->IsNonMeleeSpellCasted(false))
|
||||
{
|
||||
bIsEnraged = true;
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
}
|
||||
|
||||
//Mortal Wound spell
|
||||
if (uiMortalWoundTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTALWOUND);
|
||||
uiMortalWoundTimer = urand(2000,7000);
|
||||
} else uiMortalWoundTimer -= diff;
|
||||
|
||||
//Santrap spell
|
||||
if (uiSandtrapTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SANDTRAP);
|
||||
uiSandtrapTimer = 30000;
|
||||
} else uiSandtrapTimer -= diff;
|
||||
|
||||
//Wide Slash spell
|
||||
if (uiWideSlashTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WIDE_SLASH);
|
||||
uiWideSlashTimer = urand(10000,15000);
|
||||
} else uiWideSlashTimer -= diff;
|
||||
|
||||
//Trash spell
|
||||
if (uiTrashTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_TRASH);
|
||||
uiTrashTimer = urand(20000,25000);
|
||||
} else uiTrashTimer -= diff;
|
||||
|
||||
//Summon Player spell
|
||||
if (uiSummonPlayerTimer <= diff)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
DoCast(pTarget, SPELL_SUMMON_PLAYER);
|
||||
uiSummonPlayerTimer = urand(30000,40000);
|
||||
} else uiSummonPlayerTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
CreatureAI* GetAI_boss_kurinnaxx(Creature* pCreature)
|
||||
{
|
||||
return new boss_kurinnaxxAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_kurinnaxx()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_kurinnaxx";
|
||||
newscript->GetAI = &GetAI_boss_kurinnaxx;
|
||||
newscript->RegisterSelf();
|
||||
new boss_kurinnaxx();
|
||||
}
|
||||
|
||||
|
||||
@@ -51,114 +51,116 @@ enum CombatPhase
|
||||
NORMAL,
|
||||
STONE
|
||||
};
|
||||
|
||||
struct boss_moamAI : public ScriptedAI
|
||||
␍class boss_moam : public CreatureScript
|
||||
{
|
||||
boss_moamAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_moam() : CreatureScript("boss_moam") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
return new boss_moamAI (pCreature);
|
||||
}
|
||||
|
||||
uint32 uiTrampleTimer;
|
||||
uint32 uiDrainManaTimer;
|
||||
uint32 uiPhaseTimer;
|
||||
CombatPhase Phase;
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
struct boss_moamAI : public ScriptedAI
|
||||
{
|
||||
uiTrampleTimer = urand(3000,7000);
|
||||
uiDrainManaTimer = urand(3000,7000);
|
||||
uiPhaseTimer = 90000;
|
||||
Phase = NORMAL;
|
||||
me->SetPower(POWER_MANA,0);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOAM_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(EMOTE_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOAM_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOAM_EVENT, DONE);
|
||||
}
|
||||
|
||||
void DrainMana()
|
||||
{
|
||||
for (uint8 i=0;i<6;++i)
|
||||
boss_moamAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
uint32 uiTrampleTimer;
|
||||
uint32 uiDrainManaTimer;
|
||||
uint32 uiPhaseTimer;
|
||||
CombatPhase Phase;
|
||||
|
||||
InstanceScript *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiTrampleTimer = urand(3000,7000);
|
||||
uiDrainManaTimer = urand(3000,7000);
|
||||
uiPhaseTimer = 90000;
|
||||
Phase = NORMAL;
|
||||
me->SetPower(POWER_MANA,0);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOAM_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(EMOTE_AGGRO, me);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOAM_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_MOAM_EVENT, DONE);
|
||||
}
|
||||
|
||||
void DrainMana()
|
||||
{
|
||||
for (uint8 i=0;i<6;++i)
|
||||
{
|
||||
pTarget->ModifyPower(POWER_MANA, -500);
|
||||
me->ModifyPower(POWER_MANA, 1000);
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
pTarget->ModifyPower(POWER_MANA, -500);
|
||||
me->ModifyPower(POWER_MANA, 1000);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Phase == NORMAL)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//If we are 100%MANA cast Arcane Erruption
|
||||
if (me->GetPower(POWER_MANA) == me->GetMaxPower(POWER_MANA))
|
||||
if (Phase == NORMAL)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ARCANEERUPTION);
|
||||
DoScriptText(EMOTE_MANA_FULL, me);
|
||||
me->SetPower(POWER_MANA,0);
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
//If we are 100%MANA cast Arcane Erruption
|
||||
if (me->GetPower(POWER_MANA) == me->GetMaxPower(POWER_MANA))
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ARCANEERUPTION);
|
||||
DoScriptText(EMOTE_MANA_FULL, me);
|
||||
me->SetPower(POWER_MANA,0);
|
||||
}
|
||||
|
||||
//Trample Spell
|
||||
if (uiTrampleTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_TRAMPLE);
|
||||
uiTrampleTimer = urand(3000,7000);
|
||||
} else uiTrampleTimer -= diff;
|
||||
|
||||
//Drain Mana
|
||||
if (uiDrainManaTimer <= diff)
|
||||
{
|
||||
DrainMana();
|
||||
uiDrainManaTimer = urand(3000,7000);
|
||||
} else uiDrainManaTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
//After 90secs change phase
|
||||
if (uiPhaseTimer <= diff)
|
||||
{
|
||||
Phase = STONE;
|
||||
DoCast(me, SPELL_SUMMONMANA);
|
||||
DoCast(me, SPELL_SUMMONMANA);
|
||||
DoCast(me, SPELL_SUMMONMANA);
|
||||
DoCast(me, SPELL_GRDRSLEEP);
|
||||
} else uiPhaseTimer -= diff;
|
||||
}
|
||||
|
||||
//Trample Spell
|
||||
if (uiTrampleTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_TRAMPLE);
|
||||
uiTrampleTimer = urand(3000,7000);
|
||||
} else uiTrampleTimer -= diff;
|
||||
|
||||
//Drain Mana
|
||||
if (uiDrainManaTimer <= diff)
|
||||
{
|
||||
DrainMana();
|
||||
uiDrainManaTimer = urand(3000,7000);
|
||||
} else uiDrainManaTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
|
||||
//After 90secs change phase
|
||||
if (uiPhaseTimer <= diff)
|
||||
{
|
||||
Phase = STONE;
|
||||
DoCast(me, SPELL_SUMMONMANA);
|
||||
DoCast(me, SPELL_SUMMONMANA);
|
||||
DoCast(me, SPELL_SUMMONMANA);
|
||||
DoCast(me, SPELL_GRDRSLEEP);
|
||||
} else uiPhaseTimer -= diff;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_moam(Creature* pCreature)
|
||||
{
|
||||
return new boss_moamAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_moam()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_moam";
|
||||
newscript->GetAI = &GetAI_boss_moam;
|
||||
newscript->RegisterSelf();
|
||||
new boss_moam();
|
||||
}
|
||||
|
||||
|
||||
@@ -38,44 +38,47 @@ enum Yells
|
||||
SAY_SLAY = -1509026,
|
||||
SAY_DEATH = -1509027
|
||||
};
|
||||
|
||||
struct boss_ossirianAI : public ScriptedAI
|
||||
␍class boss_ossirian : public CreatureScript
|
||||
{
|
||||
boss_ossirianAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_ossirian() : CreatureScript("boss_ossirian") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
return new boss_ossirianAI (pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
struct boss_ossirianAI : public ScriptedAI
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_OSSIRIAN_EVENT, NOT_STARTED);
|
||||
}
|
||||
boss_ossirianAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_OSSIRIAN_EVENT, IN_PROGRESS);
|
||||
}
|
||||
InstanceScript *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_OSSIRIAN_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_OSSIRIAN_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_OSSIRIAN_EVENT, DONE);
|
||||
}
|
||||
};
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_OSSIRIAN_EVENT, DONE);
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_ossirian(Creature* pCreature)
|
||||
{
|
||||
return new boss_ossirianAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_ossirian()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_ossirian";
|
||||
newscript->GetAI = &GetAI_boss_ossirian;
|
||||
newscript->RegisterSelf();
|
||||
new boss_ossirian();
|
||||
}
|
||||
|
||||
@@ -44,44 +44,47 @@ enum Yells
|
||||
SAY_KILLS_ANDOROV = -1509016,
|
||||
SAY_COMPLETE_QUEST = -1509017 //Yell when realm complete quest 8743 for world event
|
||||
};
|
||||
|
||||
struct boss_rajaxxAI : public ScriptedAI
|
||||
␍class boss_rajaxx : public CreatureScript
|
||||
{
|
||||
boss_rajaxxAI(Creature *c) : ScriptedAI(c)
|
||||
public:
|
||||
boss_rajaxx() : CreatureScript("boss_rajaxx") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
return new boss_rajaxxAI (pCreature);
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
|
||||
void Reset()
|
||||
struct boss_rajaxxAI : public ScriptedAI
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_RAJAXX_EVENT, NOT_STARTED);
|
||||
}
|
||||
boss_rajaxxAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_RAJAXX_EVENT, IN_PROGRESS);
|
||||
}
|
||||
InstanceScript *pInstance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_RAJAXX_EVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_RAJAXX_EVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_RAJAXX_EVENT, DONE);
|
||||
}
|
||||
};
|
||||
|
||||
void JustDied(Unit * /*killer*/)
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(DATA_RAJAXX_EVENT, DONE);
|
||||
}
|
||||
};
|
||||
CreatureAI* GetAI_boss_rajaxx(Creature* pCreature)
|
||||
{
|
||||
return new boss_rajaxxAI (pCreature);
|
||||
}
|
||||
|
||||
void AddSC_boss_rajaxx()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_rajaxx";
|
||||
newscript->GetAI = &GetAI_boss_rajaxx;
|
||||
newscript->RegisterSelf();
|
||||
new boss_rajaxx();
|
||||
}
|
||||
|
||||
@@ -35,181 +35,184 @@ EndScriptData */
|
||||
3 - Buru the Gorger
|
||||
4 - Ayamiss the Hunter
|
||||
5 - Ossirian the Unscarred */
|
||||
|
||||
struct instance_ruins_of_ahn_qiraj : public ScriptedInstance
|
||||
␍class instance_ruins_of_ahnqiraj : public InstanceMapScript
|
||||
{
|
||||
instance_ruins_of_ahn_qiraj(Map* pMap) : ScriptedInstance(pMap) { Initialize(); }
|
||||
public:
|
||||
instance_ruins_of_ahnqiraj() : InstanceMapScript("instance_ruins_of_ahnqiraj") { }
|
||||
|
||||
uint64 uiKurinaxx;
|
||||
uint64 uiRajaxx;
|
||||
uint64 uiMoam;
|
||||
uint64 uiBuru;
|
||||
uint64 uiAyamiss;
|
||||
uint64 uiOssirian;
|
||||
|
||||
uint8 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
void Initialize()
|
||||
InstanceScript* GetInstanceData_instance_ruins_of_ahn_qiraj_InstanceMapScript(Map* pMap)
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
uiKurinaxx = 0;
|
||||
uiRajaxx = 0;
|
||||
uiMoam = 0;
|
||||
uiBuru = 0;
|
||||
uiAyamiss = 0;
|
||||
uiOssirian = 0;
|
||||
return new instance_ruins_of_ahn_qiraj_InstanceMapScript(pMap);
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
struct instance_ruins_of_ahn_qiraj_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) return true;
|
||||
instance_ruins_of_ahn_qiraj_InstanceMapScript(Map* pMap) : InstanceScript(pMap) { Initialize(); }
|
||||
|
||||
return false;
|
||||
}
|
||||
uint64 uiKurinaxx;
|
||||
uint64 uiRajaxx;
|
||||
uint64 uiMoam;
|
||||
uint64 uiBuru;
|
||||
uint64 uiAyamiss;
|
||||
uint64 uiOssirian;
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch (pCreature->GetEntry())
|
||||
uint8 m_auiEncounter[MAX_ENCOUNTER];
|
||||
std::string str_data;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
case CREATURE_KURINAXX:
|
||||
uiKurinaxx = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_RAJAXX:
|
||||
uiRajaxx = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_MOAM:
|
||||
uiMoam = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_BURU:
|
||||
uiBuru = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_AYAMISS:
|
||||
uiAyamiss = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_OSSIRIAN:
|
||||
uiOssirian = pCreature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
uint32 GetData(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_KURINNAXX_EVENT: return m_auiEncounter[0];
|
||||
case DATA_RAJAXX_EVENT: return m_auiEncounter[1];
|
||||
case DATA_MOAM_EVENT: return m_auiEncounter[2];
|
||||
case DATA_BURU_EVENT: return m_auiEncounter[3];
|
||||
case DATA_AYAMISS_EVENT: return m_auiEncounter[4];
|
||||
case DATA_OSSIRIAN_EVENT: return m_auiEncounter[5];
|
||||
uiKurinaxx = 0;
|
||||
uiRajaxx = 0;
|
||||
uiMoam = 0;
|
||||
uiBuru = 0;
|
||||
uiAyamiss = 0;
|
||||
uiOssirian = 0;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 identifier, uint32 data)
|
||||
{
|
||||
switch(identifier)
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
case DATA_KURINNAXX_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
case DATA_RAJAXX_EVENT:
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_MOAM_EVENT:
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case DATA_BURU_EVENT:
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
case DATA_AYAMISS_EVENT:
|
||||
m_auiEncounter[4] = data;
|
||||
break;
|
||||
case DATA_OSSIRIAN_EVENT:
|
||||
m_auiEncounter[5] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 uiIdentifier)
|
||||
{
|
||||
switch(uiIdentifier)
|
||||
{
|
||||
case DATA_KURINNAXX: return uiKurinaxx;
|
||||
case DATA_RAJAXX: return uiRajaxx;
|
||||
case DATA_MOAM: return uiMoam;
|
||||
case DATA_BURU: return uiBuru;
|
||||
case DATA_AYAMISS: return uiAyamiss;
|
||||
case DATA_OSSIRIAN: return uiOssirian;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "R A " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
|
||||
<< m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5];
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return str_data;
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
uint16 data0, data1, data2, data3, data4, data5;
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4 >> data5;
|
||||
|
||||
if (dataHead1 == 'R' && dataHead2 == 'A')
|
||||
{
|
||||
m_auiEncounter[0] = data0;
|
||||
m_auiEncounter[1] = data1;
|
||||
m_auiEncounter[2] = data2;
|
||||
m_auiEncounter[3] = data3;
|
||||
m_auiEncounter[4] = data4;
|
||||
m_auiEncounter[5] = data5;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
if (m_auiEncounter[i] == IN_PROGRESS) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* pCreature, bool /*add*/)
|
||||
{
|
||||
switch (pCreature->GetEntry())
|
||||
{
|
||||
case CREATURE_KURINAXX:
|
||||
uiKurinaxx = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_RAJAXX:
|
||||
uiRajaxx = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_MOAM:
|
||||
uiMoam = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_BURU:
|
||||
uiBuru = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_AYAMISS:
|
||||
uiAyamiss = pCreature->GetGUID();
|
||||
break;
|
||||
case CREATURE_OSSIRIAN:
|
||||
uiOssirian = pCreature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 identifier)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_KURINNAXX_EVENT: return m_auiEncounter[0];
|
||||
case DATA_RAJAXX_EVENT: return m_auiEncounter[1];
|
||||
case DATA_MOAM_EVENT: return m_auiEncounter[2];
|
||||
case DATA_BURU_EVENT: return m_auiEncounter[3];
|
||||
case DATA_AYAMISS_EVENT: return m_auiEncounter[4];
|
||||
case DATA_OSSIRIAN_EVENT: return m_auiEncounter[5];
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 identifier, uint32 data)
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_KURINNAXX_EVENT:
|
||||
m_auiEncounter[0] = data;
|
||||
break;
|
||||
case DATA_RAJAXX_EVENT:
|
||||
m_auiEncounter[1] = data;
|
||||
break;
|
||||
case DATA_MOAM_EVENT:
|
||||
m_auiEncounter[2] = data;
|
||||
break;
|
||||
case DATA_BURU_EVENT:
|
||||
m_auiEncounter[3] = data;
|
||||
break;
|
||||
case DATA_AYAMISS_EVENT:
|
||||
m_auiEncounter[4] = data;
|
||||
break;
|
||||
case DATA_OSSIRIAN_EVENT:
|
||||
m_auiEncounter[5] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 uiIdentifier)
|
||||
{
|
||||
switch(uiIdentifier)
|
||||
{
|
||||
case DATA_KURINNAXX: return uiKurinaxx;
|
||||
case DATA_RAJAXX: return uiRajaxx;
|
||||
case DATA_MOAM: return uiMoam;
|
||||
case DATA_BURU: return uiBuru;
|
||||
case DATA_AYAMISS: return uiAyamiss;
|
||||
case DATA_OSSIRIAN: return uiOssirian;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "R A " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " "
|
||||
<< m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5];
|
||||
|
||||
str_data = saveStream.str();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return str_data;
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
uint16 data0, data1, data2, data3, data4, data5;
|
||||
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4 >> data5;
|
||||
|
||||
if (dataHead1 == 'R' && dataHead2 == 'A')
|
||||
{
|
||||
m_auiEncounter[0] = data0;
|
||||
m_auiEncounter[1] = data1;
|
||||
m_auiEncounter[2] = data2;
|
||||
m_auiEncounter[3] = data3;
|
||||
m_auiEncounter[4] = data4;
|
||||
m_auiEncounter[5] = data5;
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
|
||||
} else OUT_LOAD_INST_DATA_FAIL;
|
||||
}
|
||||
};
|
||||
|
||||
} else OUT_LOAD_INST_DATA_FAIL;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceData* GetInstanceData_instance_ruins_of_ahn_qiraj(Map* pMap)
|
||||
{
|
||||
return new instance_ruins_of_ahn_qiraj(pMap);
|
||||
}
|
||||
|
||||
void AddSC_instance_ruins_of_ahnqiraj()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "instance_ruins_of_ahnqiraj";
|
||||
newscript->GetInstanceData = &GetInstanceData_instance_ruins_of_ahn_qiraj;
|
||||
newscript->RegisterSelf();
|
||||
new instance_ruins_of_ahnqiraj();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user