mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-22 10:05:32 +01:00
Convert Alterac Valley to new format.
--HG-- branch : trunk
This commit is contained in:
@@ -41,164 +41,168 @@ enum WaterElementalSpells
|
||||
SPELL_WATERBOLT = 46983
|
||||
};
|
||||
|
||||
struct mob_water_elementalAI : public ScriptedAI
|
||||
class mob_water_elemental : public CreatureScript
|
||||
{
|
||||
mob_water_elementalAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
mob_water_elemental() : CreatureScript("mob_water_elemental") { }
|
||||
|
||||
uint32 uiWaterBoltTimer;
|
||||
uint64 uiBalindaGUID;
|
||||
uint32 uiResetTimer;
|
||||
|
||||
void Reset()
|
||||
struct mob_water_elementalAI : public ScriptedAI
|
||||
{
|
||||
uiWaterBoltTimer = 3*IN_MILLISECONDS;
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
}
|
||||
mob_water_elementalAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
uint32 uiWaterBoltTimer;
|
||||
uint64 uiBalindaGUID;
|
||||
uint32 uiResetTimer;
|
||||
|
||||
if (uiWaterBoltTimer < diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WATERBOLT);
|
||||
uiWaterBoltTimer = 5*IN_MILLISECONDS;
|
||||
} else uiWaterBoltTimer -= diff;
|
||||
uiWaterBoltTimer = 3*IN_MILLISECONDS;
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (uiResetTimer < diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (Creature *pBalinda = Unit::GetCreature(*me, uiBalindaGUID))
|
||||
if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
|
||||
EnterEvadeMode();
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
} else uiResetTimer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
struct boss_balindaAI : public ScriptedAI
|
||||
{
|
||||
boss_balindaAI(Creature *c) : ScriptedAI(c), Summons(me) {}
|
||||
|
||||
uint32 uiArcaneExplosionTimer;
|
||||
uint32 uiConeOfColdTimer;
|
||||
uint32 uiFireBoltTimer;
|
||||
uint32 uiFrostboltTimer;
|
||||
uint32 uiResetTimer;
|
||||
uint32 uiWaterElementalTimer;
|
||||
|
||||
SummonList Summons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiArcaneExplosionTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
uiConeOfColdTimer = 8*IN_MILLISECONDS;
|
||||
uiFireBoltTimer = 1*IN_MILLISECONDS;
|
||||
uiFrostboltTimer = 4*IN_MILLISECONDS;
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
uiWaterElementalTimer = 0;
|
||||
|
||||
Summons.DespawnAll();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(YELL_AGGRO, me);
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
CAST_AI(mob_water_elementalAI, summoned->AI())->uiBalindaGUID = me->GetGUID();
|
||||
summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true));
|
||||
summoned->setFaction(me->getFaction());
|
||||
Summons.Summon(summoned);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
Summons.DespawnAll();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiWaterElementalTimer < diff)
|
||||
{
|
||||
if (Summons.empty())
|
||||
me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILLISECONDS);
|
||||
uiWaterElementalTimer = 50*IN_MILLISECONDS;
|
||||
} else uiWaterElementalTimer -= diff;
|
||||
|
||||
if (uiArcaneExplosionTimer < diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
|
||||
uiArcaneExplosionTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiArcaneExplosionTimer -= diff;
|
||||
|
||||
if (uiConeOfColdTimer < diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CONE_OF_COLD);
|
||||
uiConeOfColdTimer = urand(10*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
} else uiConeOfColdTimer -= diff;
|
||||
|
||||
if (uiFireBoltTimer < diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIREBALL);
|
||||
uiFireBoltTimer = urand(5*IN_MILLISECONDS,9*IN_MILLISECONDS);
|
||||
} else uiFireBoltTimer -= diff;
|
||||
|
||||
if (uiFrostboltTimer < diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FROSTBOLT);
|
||||
uiFrostboltTimer = urand(4*IN_MILLISECONDS,12*IN_MILLISECONDS);
|
||||
} else uiFrostboltTimer -= diff;
|
||||
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (uiResetTimer < diff)
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
if (uiWaterBoltTimer < diff)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
DoScriptText(YELL_EVADE, me);
|
||||
}
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
} else uiResetTimer -= diff;
|
||||
DoCast(me->getVictim(), SPELL_WATERBOLT);
|
||||
uiWaterBoltTimer = 5*IN_MILLISECONDS;
|
||||
} else uiWaterBoltTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
// check if creature is not outside of building
|
||||
if (uiResetTimer < diff)
|
||||
{
|
||||
if (Creature *pBalinda = Unit::GetCreature(*me, uiBalindaGUID))
|
||||
if (me->GetDistance2d(pBalinda->GetHomePosition().GetPositionX(), pBalinda->GetHomePosition().GetPositionY()) > 50)
|
||||
EnterEvadeMode();
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
} else uiResetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *OnGetAI(Creature *creature) const
|
||||
{
|
||||
return new mob_water_elementalAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_balinda(Creature *_Creature)
|
||||
class boss_balinda : public CreatureScript
|
||||
{
|
||||
return new boss_balindaAI (_Creature);
|
||||
}
|
||||
public:
|
||||
boss_balinda() : CreatureScript("boss_balinda") { }
|
||||
|
||||
CreatureAI* GetAI_mob_water_elemental(Creature *_Creature)
|
||||
{
|
||||
return new mob_water_elementalAI (_Creature);
|
||||
}
|
||||
struct boss_balindaAI : public ScriptedAI
|
||||
{
|
||||
boss_balindaAI(Creature *c) : ScriptedAI(c), Summons(me) {}
|
||||
|
||||
uint32 uiArcaneExplosionTimer;
|
||||
uint32 uiConeOfColdTimer;
|
||||
uint32 uiFireBoltTimer;
|
||||
uint32 uiFrostboltTimer;
|
||||
uint32 uiResetTimer;
|
||||
uint32 uiWaterElementalTimer;
|
||||
|
||||
SummonList Summons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
uiArcaneExplosionTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
uiConeOfColdTimer = 8*IN_MILLISECONDS;
|
||||
uiFireBoltTimer = 1*IN_MILLISECONDS;
|
||||
uiFrostboltTimer = 4*IN_MILLISECONDS;
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
uiWaterElementalTimer = 0;
|
||||
|
||||
Summons.DespawnAll();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(YELL_AGGRO, me);
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
CAST_AI(mob_water_elementalAI, summoned->AI())->uiBalindaGUID = me->GetGUID();
|
||||
summoned->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM,0, 50, true));
|
||||
summoned->setFaction(me->getFaction());
|
||||
Summons.Summon(summoned);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*Killer*/)
|
||||
{
|
||||
Summons.DespawnAll();
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiWaterElementalTimer < diff)
|
||||
{
|
||||
if (Summons.empty())
|
||||
me->SummonCreature(NPC_WATER_ELEMENTAL, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45*IN_MILLISECONDS);
|
||||
uiWaterElementalTimer = 50*IN_MILLISECONDS;
|
||||
} else uiWaterElementalTimer -= diff;
|
||||
|
||||
if (uiArcaneExplosionTimer < diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_ARCANE_EXPLOSION);
|
||||
uiArcaneExplosionTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiArcaneExplosionTimer -= diff;
|
||||
|
||||
if (uiConeOfColdTimer < diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CONE_OF_COLD);
|
||||
uiConeOfColdTimer = urand(10*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
} else uiConeOfColdTimer -= diff;
|
||||
|
||||
if (uiFireBoltTimer < diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FIREBALL);
|
||||
uiFireBoltTimer = urand(5*IN_MILLISECONDS,9*IN_MILLISECONDS);
|
||||
} else uiFireBoltTimer -= diff;
|
||||
|
||||
if (uiFrostboltTimer < diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FROSTBOLT);
|
||||
uiFrostboltTimer = urand(4*IN_MILLISECONDS,12*IN_MILLISECONDS);
|
||||
} else uiFrostboltTimer -= diff;
|
||||
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (uiResetTimer < diff)
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
DoScriptText(YELL_EVADE, me);
|
||||
}
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
} else uiResetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *OnGetAI(Creature *creature) const
|
||||
{
|
||||
return new boss_balindaAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_balinda()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_balinda";
|
||||
newscript->GetAI = &GetAI_boss_balinda;
|
||||
newscript->RegisterSelf();
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_water_elemental";
|
||||
newscript->GetAI = &GetAI_mob_water_elemental;
|
||||
newscript->RegisterSelf();
|
||||
new boss_balinda;
|
||||
new mob_water_elemental;
|
||||
};
|
||||
@@ -41,99 +41,101 @@ enum Yells
|
||||
YELL_RANDOM5 = -1810007
|
||||
};
|
||||
|
||||
struct boss_drektharAI : public ScriptedAI
|
||||
class boss_drekthar : public CreatureScript
|
||||
{
|
||||
boss_drektharAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_drekthar() : CreatureScript("boss_drekthar") { }
|
||||
|
||||
uint32 uiWhirlwindTimer;
|
||||
uint32 uiWhirlwind2Timer;
|
||||
uint32 uiKnockdownTimer;
|
||||
uint32 uiFrenzyTimer;
|
||||
uint32 uiYellTimer;
|
||||
uint32 uiResetTimer;
|
||||
|
||||
void Reset()
|
||||
struct boss_drektharAI : public ScriptedAI
|
||||
{
|
||||
uiWhirlwindTimer = urand(1*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
uiWhirlwind2Timer = urand(1*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
uiKnockdownTimer = 12*IN_MILLISECONDS;
|
||||
uiFrenzyTimer = 6*IN_MILLISECONDS;
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); //20 to 30 seconds
|
||||
}
|
||||
boss_drektharAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(YELL_AGGRO, me);
|
||||
}
|
||||
uint32 uiWhirlwindTimer;
|
||||
uint32 uiWhirlwind2Timer;
|
||||
uint32 uiKnockdownTimer;
|
||||
uint32 uiFrenzyTimer;
|
||||
uint32 uiYellTimer;
|
||||
uint32 uiResetTimer;
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
Reset();
|
||||
DoScriptText(YELL_RESPAWN, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiWhirlwindTimer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WHIRLWIND);
|
||||
uiWhirlwindTimer = urand(8*IN_MILLISECONDS,18*IN_MILLISECONDS);
|
||||
} else uiWhirlwindTimer -= diff;
|
||||
|
||||
if (uiWhirlwind2Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WHIRLWIND2);
|
||||
uiWhirlwind2Timer = urand(7*IN_MILLISECONDS,25*IN_MILLISECONDS);
|
||||
} else uiWhirlwind2Timer -= diff;
|
||||
|
||||
if (uiKnockdownTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKDOWN);
|
||||
uiKnockdownTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiKnockdownTimer -= diff;
|
||||
|
||||
if (uiFrenzyTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FRENZY);
|
||||
uiFrenzyTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
|
||||
} else uiFrenzyTimer -= diff;
|
||||
|
||||
if (uiYellTimer <= diff)
|
||||
{
|
||||
DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5), me);
|
||||
uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); //20 to 30 seconds
|
||||
} else uiYellTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (uiResetTimer <= diff)
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
DoScriptText(YELL_EVADE, me);
|
||||
}
|
||||
uiWhirlwindTimer = urand(1*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
uiWhirlwind2Timer = urand(1*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
uiKnockdownTimer = 12*IN_MILLISECONDS;
|
||||
uiFrenzyTimer = 6*IN_MILLISECONDS;
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
} else uiResetTimer -= diff;
|
||||
uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); //20 to 30 seconds
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(YELL_AGGRO, me);
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
Reset();
|
||||
DoScriptText(YELL_RESPAWN, me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiWhirlwindTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WHIRLWIND);
|
||||
uiWhirlwindTimer = urand(8*IN_MILLISECONDS,18*IN_MILLISECONDS);
|
||||
} else uiWhirlwindTimer -= diff;
|
||||
|
||||
if (uiWhirlwind2Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WHIRLWIND2);
|
||||
uiWhirlwind2Timer = urand(7*IN_MILLISECONDS,25*IN_MILLISECONDS);
|
||||
} else uiWhirlwind2Timer -= diff;
|
||||
|
||||
if (uiKnockdownTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_KNOCKDOWN);
|
||||
uiKnockdownTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiKnockdownTimer -= diff;
|
||||
|
||||
if (uiFrenzyTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FRENZY);
|
||||
uiFrenzyTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
|
||||
} else uiFrenzyTimer -= diff;
|
||||
|
||||
if (uiYellTimer <= diff)
|
||||
{
|
||||
DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5), me);
|
||||
uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); //20 to 30 seconds
|
||||
} else uiYellTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (uiResetTimer <= diff)
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
DoScriptText(YELL_EVADE, me);
|
||||
}
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
} else uiResetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
CreatureAI *OnGetAI(Creature *creature) const
|
||||
{
|
||||
return new boss_drektharAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
CreatureAI* GetAI_boss_drekthar(Creature *_Creature)
|
||||
{
|
||||
return new boss_drektharAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_drekthar()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_drekthar";
|
||||
newscript->GetAI = &GetAI_boss_drekthar;
|
||||
newscript->RegisterSelf();
|
||||
new boss_drekthar;
|
||||
}
|
||||
@@ -32,99 +32,101 @@ enum Yells
|
||||
YELL_EVADE = -1810022
|
||||
};
|
||||
|
||||
struct boss_galvangarAI : public ScriptedAI
|
||||
class boss_galvangar : public CreatureScript
|
||||
{
|
||||
boss_galvangarAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_galvangar() : CreatureScript("boss_galvangar") { }
|
||||
|
||||
|
||||
uint32 uiCleaveTimer;
|
||||
uint32 uiFrighteningShoutTimer;
|
||||
uint32 uiWhirlwind1Timer;
|
||||
uint32 uiWhirlwind2Timer;
|
||||
uint32 uiMortalStrikeTimer;
|
||||
uint32 uiResetTimer;
|
||||
|
||||
|
||||
void Reset()
|
||||
struct boss_galvangarAI : public ScriptedAI
|
||||
{
|
||||
uiCleaveTimer = urand(1*IN_MILLISECONDS,9*IN_MILLISECONDS);
|
||||
uiFrighteningShoutTimer = urand(2*IN_MILLISECONDS,19*IN_MILLISECONDS);
|
||||
uiWhirlwind1Timer = urand(1*IN_MILLISECONDS,13*IN_MILLISECONDS);
|
||||
uiWhirlwind2Timer = urand(5*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
uiMortalStrikeTimer = urand(5*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
}
|
||||
boss_galvangarAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(YELL_AGGRO, me);
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
uint32 uiCleaveTimer;
|
||||
uint32 uiFrighteningShoutTimer;
|
||||
uint32 uiWhirlwind1Timer;
|
||||
uint32 uiWhirlwind2Timer;
|
||||
uint32 uiMortalStrikeTimer;
|
||||
uint32 uiResetTimer;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiCleaveTimer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
uiCleaveTimer = urand(10*IN_MILLISECONDS,16*IN_MILLISECONDS);
|
||||
} else uiCleaveTimer -= diff;
|
||||
uiCleaveTimer = urand(1*IN_MILLISECONDS,9*IN_MILLISECONDS);
|
||||
uiFrighteningShoutTimer = urand(2*IN_MILLISECONDS,19*IN_MILLISECONDS);
|
||||
uiWhirlwind1Timer = urand(1*IN_MILLISECONDS,13*IN_MILLISECONDS);
|
||||
uiWhirlwind2Timer = urand(5*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
uiMortalStrikeTimer = urand(5*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
if (uiFrighteningShoutTimer <= diff)
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT);
|
||||
uiFrighteningShoutTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiFrighteningShoutTimer -= diff;
|
||||
DoScriptText(YELL_AGGRO, me);
|
||||
}
|
||||
|
||||
if (uiWhirlwind1Timer <= diff)
|
||||
void JustRespawned()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WHIRLWIND1);
|
||||
uiWhirlwind1Timer = urand(6*IN_MILLISECONDS,10*IN_MILLISECONDS);
|
||||
} else uiWhirlwind1Timer -= diff;
|
||||
Reset();
|
||||
}
|
||||
|
||||
if (uiWhirlwind2Timer <= diff)
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WHIRLWIND2);
|
||||
uiWhirlwind2Timer = urand(10*IN_MILLISECONDS,25*IN_MILLISECONDS);
|
||||
} else uiWhirlwind2Timer -= diff;
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiMortalStrikeTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
|
||||
uiMortalStrikeTimer = urand(10*IN_MILLISECONDS,30*IN_MILLISECONDS);
|
||||
} else uiMortalStrikeTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (uiResetTimer <= diff)
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
if (uiCleaveTimer <= diff)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
DoScriptText(YELL_EVADE, me);
|
||||
}
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
} else uiResetTimer -= diff;
|
||||
DoCast(me->getVictim(), SPELL_CLEAVE);
|
||||
uiCleaveTimer = urand(10*IN_MILLISECONDS,16*IN_MILLISECONDS);
|
||||
} else uiCleaveTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
if (uiFrighteningShoutTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_FRIGHTENING_SHOUT);
|
||||
uiFrighteningShoutTimer = urand(10*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiFrighteningShoutTimer -= diff;
|
||||
|
||||
if (uiWhirlwind1Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WHIRLWIND1);
|
||||
uiWhirlwind1Timer = urand(6*IN_MILLISECONDS,10*IN_MILLISECONDS);
|
||||
} else uiWhirlwind1Timer -= diff;
|
||||
|
||||
if (uiWhirlwind2Timer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_WHIRLWIND2);
|
||||
uiWhirlwind2Timer = urand(10*IN_MILLISECONDS,25*IN_MILLISECONDS);
|
||||
} else uiWhirlwind2Timer -= diff;
|
||||
|
||||
if (uiMortalStrikeTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_MORTAL_STRIKE);
|
||||
uiMortalStrikeTimer = urand(10*IN_MILLISECONDS,30*IN_MILLISECONDS);
|
||||
} else uiMortalStrikeTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (uiResetTimer <= diff)
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
DoScriptText(YELL_EVADE, me);
|
||||
}
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
} else uiResetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *OnGetAI(Creature *creature) const
|
||||
{
|
||||
return new boss_galvangarAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_galvangar(Creature *_Creature)
|
||||
{
|
||||
return new boss_galvangarAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_galvangar()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_galvangar";
|
||||
newscript->GetAI = &GetAI_boss_galvangar;
|
||||
newscript->RegisterSelf();
|
||||
new boss_galvangar;
|
||||
}
|
||||
|
||||
@@ -39,92 +39,92 @@ enum Spells
|
||||
SPELL_STORMBOLT = 20685 // not sure
|
||||
};
|
||||
|
||||
struct boss_vanndarAI : public ScriptedAI
|
||||
class boss_vanndar : public CreatureScript
|
||||
{
|
||||
boss_vanndarAI(Creature *c) : ScriptedAI(c) {}
|
||||
public:
|
||||
boss_vanndar() : CreatureScript("boss_vanndar") { }
|
||||
|
||||
|
||||
uint32 uiAvatarTimer;
|
||||
uint32 uiThunderclapTimer;
|
||||
uint32 uiStormboltTimer;
|
||||
uint32 uiResetTimer;
|
||||
uint32 uiYellTimer;
|
||||
|
||||
|
||||
void Reset()
|
||||
struct boss_vanndarAI : public ScriptedAI
|
||||
{
|
||||
uiAvatarTimer = 3*IN_MILLISECONDS;
|
||||
uiThunderclapTimer = 4*IN_MILLISECONDS;
|
||||
uiStormboltTimer = 6*IN_MILLISECONDS;
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
|
||||
}
|
||||
boss_vanndarAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(YELL_AGGRO, me);
|
||||
}
|
||||
uint32 uiAvatarTimer;
|
||||
uint32 uiThunderclapTimer;
|
||||
uint32 uiStormboltTimer;
|
||||
uint32 uiResetTimer;
|
||||
uint32 uiYellTimer;
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
Reset();
|
||||
DoScriptText(RAND(YELL_RESPAWN1,YELL_RESPAWN2), me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiAvatarTimer <= diff)
|
||||
void Reset()
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_AVATAR);
|
||||
uiAvatarTimer = urand(15*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
} else uiAvatarTimer -= diff;
|
||||
|
||||
if (uiThunderclapTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
|
||||
uiThunderclapTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiThunderclapTimer -= diff;
|
||||
|
||||
if (uiStormboltTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_STORMBOLT);
|
||||
uiStormboltTimer = urand(10*IN_MILLISECONDS,25*IN_MILLISECONDS);
|
||||
} else uiStormboltTimer -= diff;
|
||||
|
||||
if (uiYellTimer <= diff)
|
||||
{
|
||||
DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5,YELL_RANDOM6,YELL_RANDOM7), me);
|
||||
uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); //20 to 30 seconds
|
||||
} else uiYellTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (uiResetTimer <= diff)
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
DoScriptText(YELL_EVADE, me);
|
||||
}
|
||||
uiAvatarTimer = 3*IN_MILLISECONDS;
|
||||
uiThunderclapTimer = 4*IN_MILLISECONDS;
|
||||
uiStormboltTimer = 6*IN_MILLISECONDS;
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
} else uiResetTimer -= diff;
|
||||
uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
void EnterCombat(Unit * /*who*/)
|
||||
{
|
||||
DoScriptText(YELL_AGGRO, me);
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
Reset();
|
||||
DoScriptText(RAND(YELL_RESPAWN1,YELL_RESPAWN2), me);
|
||||
}
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (uiAvatarTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_AVATAR);
|
||||
uiAvatarTimer = urand(15*IN_MILLISECONDS,20*IN_MILLISECONDS);
|
||||
} else uiAvatarTimer -= diff;
|
||||
|
||||
if (uiThunderclapTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_THUNDERCLAP);
|
||||
uiThunderclapTimer = urand(5*IN_MILLISECONDS,15*IN_MILLISECONDS);
|
||||
} else uiThunderclapTimer -= diff;
|
||||
|
||||
if (uiStormboltTimer <= diff)
|
||||
{
|
||||
DoCast(me->getVictim(), SPELL_STORMBOLT);
|
||||
uiStormboltTimer = urand(10*IN_MILLISECONDS,25*IN_MILLISECONDS);
|
||||
} else uiStormboltTimer -= diff;
|
||||
|
||||
if (uiYellTimer <= diff)
|
||||
{
|
||||
DoScriptText(RAND(YELL_RANDOM1,YELL_RANDOM2,YELL_RANDOM3,YELL_RANDOM4,YELL_RANDOM5,YELL_RANDOM6,YELL_RANDOM7), me);
|
||||
uiYellTimer = urand(20*IN_MILLISECONDS,30*IN_MILLISECONDS); //20 to 30 seconds
|
||||
} else uiYellTimer -= diff;
|
||||
|
||||
// check if creature is not outside of building
|
||||
if (uiResetTimer <= diff)
|
||||
{
|
||||
if (me->GetDistance2d(me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
DoScriptText(YELL_EVADE, me);
|
||||
}
|
||||
uiResetTimer = 5*IN_MILLISECONDS;
|
||||
} else uiResetTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI *OnGetAI(Creature *creature) const
|
||||
{
|
||||
return new boss_vanndarAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_boss_vanndar(Creature *_Creature)
|
||||
{
|
||||
return new boss_vanndarAI (_Creature);
|
||||
}
|
||||
|
||||
void AddSC_boss_vanndar()
|
||||
{
|
||||
Script *newscript;
|
||||
newscript = new Script;
|
||||
newscript->Name = "boss_vanndar";
|
||||
newscript->GetAI = &GetAI_boss_vanndar;
|
||||
newscript->RegisterSelf();
|
||||
new boss_vandar;
|
||||
}
|
||||
Reference in New Issue
Block a user