Scripts/Scholomance:

- Updated Ras Frostwhisper to EventMaps
- Updated Vectus to EventMaps
This commit is contained in:
Nyeriah
2014-09-06 15:37:46 -03:00
parent f6f2b511a9
commit 25f75501ef
2 changed files with 120 additions and 137 deletions

View File

@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -16,122 +15,108 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Ras_Frostwhisper
SD%Complete: 100
SDComment:
SDCategory: Scholomance
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
enum Spells
{
SPELL_FROSTBOLT = 21369,
SPELL_ICEARMOR = 18100, // This is actually a buff he gives himself
SPELL_ICE_ARMOR = 18100, // This is actually a buff he gives himself
SPELL_FREEZE = 18763,
SPELL_FEAR = 26070,
SPELL_CHILLNOVA = 18099,
SPELL_CHILL_NOVA = 18099,
SPELL_FROSTVOLLEY = 8398
};
enum Events
{
EVENT_FROSTBOLT = 1,
EVENT_ICE_ARMOR,
EVENT_FREEZE,
EVENT_FEAR,
EVENT_CHILL_NOVA,
EVENT_FROSTVOLLEY
};
class boss_boss_ras_frostwhisper : public CreatureScript
{
public:
boss_boss_ras_frostwhisper() : CreatureScript("boss_boss_ras_frostwhisper") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_rasfrostAI(creature);
}
struct boss_rasfrostAI : public ScriptedAI
{
boss_rasfrostAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
IceArmor_Timer = 2000;
Frostbolt_Timer = 8000;
ChillNova_Timer = 12000;
Freeze_Timer = 18000;
FrostVolley_Timer = 24000;
Fear_Timer = 45000;
}
uint32 IceArmor_Timer;
uint32 Frostbolt_Timer;
uint32 Freeze_Timer;
uint32 Fear_Timer;
uint32 ChillNova_Timer;
uint32 FrostVolley_Timer;
boss_rasfrostAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() override
{
Initialize();
DoCast(me, SPELL_ICEARMOR, true);
events.Reset();
DoCast(me, SPELL_ICE_ARMOR);
}
void EnterCombat(Unit* /*who*/) override { }
void EnterCombat(Unit* /*who*/) override
{
events.ScheduleEvent(EVENT_ICE_ARMOR, 2000);
events.ScheduleEvent(EVENT_FROSTBOLT, 8000);
events.ScheduleEvent(EVENT_CHILL_NOVA, 12000);
events.ScheduleEvent(EVENT_FREEZE, 18000);
events.ScheduleEvent(EVENT_FEAR, 45000);
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
//IceArmor_Timer
if (IceArmor_Timer <= diff)
{
DoCast(me, SPELL_ICEARMOR);
IceArmor_Timer = 180000;
} else IceArmor_Timer -= diff;
events.Update(diff);
//Frostbolt_Timer
if (Frostbolt_Timer <= diff)
{
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_FROSTBOLT);
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
Frostbolt_Timer = 8000;
} else Frostbolt_Timer -= diff;
//Freeze_Timer
if (Freeze_Timer <= diff)
while (uint32 eventId = events.ExecuteEvent())
{
DoCastVictim(SPELL_FREEZE);
Freeze_Timer = 24000;
} else Freeze_Timer -= diff;
//Fear_Timer
if (Fear_Timer <= diff)
{
DoCastVictim(SPELL_FEAR);
Fear_Timer = 30000;
} else Fear_Timer -= diff;
//ChillNova_Timer
if (ChillNova_Timer <= diff)
{
DoCastVictim(SPELL_CHILLNOVA);
ChillNova_Timer = 14000;
} else ChillNova_Timer -= diff;
//FrostVolley_Timer
if (FrostVolley_Timer <= diff)
{
DoCastVictim(SPELL_FROSTVOLLEY);
FrostVolley_Timer = 15000;
} else FrostVolley_Timer -= diff;
switch (eventId)
{
case EVENT_ICE_ARMOR:
DoCast(me, SPELL_ICE_ARMOR);
events.ScheduleEvent(EVENT_ICE_ARMOR, 180000);
break;
case EVENT_FROSTBOLT:
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
DoCast(target, SPELL_FROSTBOLT);
events.ScheduleEvent(EVENT_FROSTBOLT, 8000);
break;
case EVENT_FREEZE:
DoCastVictim(SPELL_FREEZE);
events.ScheduleEvent(EVENT_FREEZE, 24000);
break;
case EVENT_FEAR:
DoCastVictim(SPELL_FEAR);
events.ScheduleEvent(EVENT_FEAR, 30000);
break;
case EVENT_CHILL_NOVA:
DoCastVictim(SPELL_CHILL_NOVA);
events.ScheduleEvent(EVENT_CHILL_NOVA, 14000);
break;
case EVENT_FROSTVOLLEY:
DoCastVictim(SPELL_FROSTVOLLEY);
events.ScheduleEvent(EVENT_FROSTVOLLEY, 15000);
break;
default:
break;
}
}
DoMeleeAttackIfReady();
}
private:
EventMap events;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_rasfrostAI(creature);
}
};
void AddSC_boss_rasfrost()

View File

@@ -1,6 +1,5 @@
/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2006-2009 ScriptDev2 <https://scriptdev2.svn.sourceforge.net/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@@ -16,103 +15,102 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* ScriptData
SDName: Boss_Vectus
SD%Complete: 100
SDComment:
SDCategory: Scholomance
EndScriptData */
#include "ScriptMgr.h"
#include "ScriptedCreature.h"
enum Emotes
{
EMOTE_FRENZY_KILL = 0
EMOTE_FRENZY = 0
};
enum Spells
{
SPELL_FLAMESTRIKE = 18399,
SPELL_BLAST_WAVE = 16046,
SPELL_FIRESHIELD = 19626,
SPELL_FIRE_SHIELD = 19626,
SPELL_FRENZY = 8269 // 28371
};
enum Events
{
EVENT_FIRE_SHIELD = 1,
EVENT_BLAST_WAVE,
EVENT_FRENZY
};
class boss_vectus : public CreatureScript
{
public:
boss_vectus() : CreatureScript("boss_vectus") { }
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_vectusAI(creature);
}
struct boss_vectusAI : public ScriptedAI
{
boss_vectusAI(Creature* creature) : ScriptedAI(creature)
{
Initialize();
}
void Initialize()
{
m_uiFireShield_Timer = 2000;
m_uiBlastWave_Timer = 14000;
m_uiFrenzy_Timer = 0;
}
uint32 m_uiFireShield_Timer;
uint32 m_uiBlastWave_Timer;
uint32 m_uiFrenzy_Timer;
boss_vectusAI(Creature* creature) : ScriptedAI(creature) { }
void Reset() override
{
Initialize();
events.Reset();
}
void UpdateAI(uint32 uiDiff) override
void EnterCombat(Unit* /*who*/) override
{
events.ScheduleEvent(EVENT_FIRE_SHIELD, 2000);
events.ScheduleEvent(EVENT_BLAST_WAVE, 14000);
}
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
{
if (me->HealthBelowPctDamaged(25, damage))
{
DoCast(me, SPELL_FRENZY);
Talk(EMOTE_FRENZY);
events.ScheduleEvent(EVENT_FRENZY, 24000);
}
}
void UpdateAI(uint32 diff) override
{
if (!UpdateVictim())
return;
//FireShield_Timer
if (m_uiFireShield_Timer <= uiDiff)
{
DoCast(me, SPELL_FIRESHIELD);
m_uiFireShield_Timer = 90000;
}
else
m_uiFireShield_Timer -= uiDiff;
events.Update(diff);
//BlastWave_Timer
if (m_uiBlastWave_Timer <= uiDiff)
{
DoCastVictim(SPELL_BLAST_WAVE);
m_uiBlastWave_Timer = 12000;
}
else
m_uiBlastWave_Timer -= uiDiff;
if (me->HasUnitState(UNIT_STATE_CASTING))
return;
//Frenzy_Timer
if (HealthBelowPct(25))
while (uint32 eventId = events.ExecuteEvent())
{
if (m_uiFrenzy_Timer <= uiDiff)
switch (eventId)
{
DoCast(me, SPELL_FRENZY);
Talk(EMOTE_FRENZY_KILL);
m_uiFrenzy_Timer = 24000;
case EVENT_FIRE_SHIELD:
DoCast(me, SPELL_FIRE_SHIELD);
events.ScheduleEvent(EVENT_FIRE_SHIELD, 90000);
break;
case EVENT_BLAST_WAVE:
DoCast(me, SPELL_BLAST_WAVE);
events.ScheduleEvent(EVENT_BLAST_WAVE, 12000);
case EVENT_FRENZY:
DoCast(me, SPELL_FRENZY);
Talk(EMOTE_FRENZY);
events.ScheduleEvent(EVENT_FRENZY, 24000);
break;
default:
break;
}
else
m_uiFrenzy_Timer -= uiDiff;
}
DoMeleeAttackIfReady();
}
private:
EventMap events;
};
CreatureAI* GetAI(Creature* creature) const override
{
return new boss_vectusAI(creature);
}
};
void AddSC_boss_vectus()