mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Add script VoA/Koralon and Toravon. Thanks WarHead.
Fixes issue #1231. --HG-- branch : trunk
This commit is contained in:
@@ -1354,6 +1354,12 @@ UPDATE `creature_template` SET `ScriptName`='boss_archavon' WHERE `entry`=31125;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`=32353;
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_emalon' WHERE `entry`=33993;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_tempest_minion' WHERE `entry`=33998;
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_koralon' WHERE `entry`=35013;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_flame_warder' WHERE `entry`=35143;
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_toravon' WHERE `entry`=38433;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_frost_warder' WHERE `entry`=38482;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_frozen_orb_stalker' WHERE `entry`=38461;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_frozen_orb' WHERE `entry`=38456;
|
||||
UPDATE `instance_template` SET `script`='instance_archavon' WHERE `map`=624;
|
||||
|
||||
/* VIOLET HOLD */
|
||||
|
||||
6
sql/updates/7668_world_scriptname.sql
Normal file
6
sql/updates/7668_world_scriptname.sql
Normal file
@@ -0,0 +1,6 @@
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_koralon' WHERE `entry`=35013;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_flame_warder' WHERE `entry`=35143;
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_toravon' WHERE `entry`=38433;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_frost_warder' WHERE `entry`=38482;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_frozen_orb_stalker' WHERE `entry`=38461;
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_frozen_orb' WHERE `entry`=38456;
|
||||
@@ -364,6 +364,8 @@ void AddSC_instance_utgarde_pinnacle();
|
||||
void AddSC_utgarde_keep();
|
||||
void AddSC_boss_archavon(); //Vault of Archavon
|
||||
void AddSC_boss_emalon();
|
||||
void AddSC_boss_koralon();
|
||||
void AddSC_boss_toravon();
|
||||
void AddSC_instance_archavon();
|
||||
void AddSC_boss_trollgore(); //Drak'Tharon Keep
|
||||
void AddSC_boss_novos();
|
||||
@@ -835,6 +837,8 @@ void AddScripts()
|
||||
AddSC_utgarde_keep();
|
||||
AddSC_boss_archavon(); //Vault of Archavon
|
||||
AddSC_boss_emalon();
|
||||
AddSC_boss_koralon();
|
||||
AddSC_boss_toravon();
|
||||
AddSC_instance_archavon();
|
||||
AddSC_boss_trollgore(); //Drak'Tharon Keep
|
||||
AddSC_boss_novos();
|
||||
|
||||
@@ -426,6 +426,8 @@ SET(scripts_STAT_SRCS
|
||||
northrend/vault_of_archavon/instance_vault_of_archavon.cpp
|
||||
northrend/vault_of_archavon/boss_archavon.cpp
|
||||
northrend/vault_of_archavon/boss_emalon.cpp
|
||||
northrend/vault_of_archavon/boss_koralon.cpp
|
||||
northrend/vault_of_archavon/boss_toravon.cpp
|
||||
northrend/vault_of_archavon/vault_of_archavon.h
|
||||
northrend/violet_hold/instance_violet_hold.cpp
|
||||
northrend/violet_hold/boss_cyanigosa.cpp
|
||||
|
||||
@@ -1,7 +1,26 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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 Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*** SQL START ***
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_archavon' WHERE `entry`='31125';
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`='32353';
|
||||
*** SQL END ***/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "vault_of_archavon.h"
|
||||
|
||||
@@ -121,9 +140,9 @@ struct boss_archavonAI : public ScriptedAI
|
||||
/*######
|
||||
## Mob Archavon Warder
|
||||
######*/
|
||||
struct mob_warderAI : public ScriptedAI //npc 32353
|
||||
struct mob_archavon_warderAI : public ScriptedAI //npc 32353
|
||||
{
|
||||
mob_warderAI(Creature *c) : ScriptedAI(c) {}
|
||||
mob_archavon_warderAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
EventMap events;
|
||||
|
||||
@@ -160,22 +179,22 @@ struct mob_warderAI : public ScriptedAI //npc 32353
|
||||
return;
|
||||
}
|
||||
case EVENT_SHIELD_CRUSH:
|
||||
DoCast(m_creature->getVictim(), SPELL_SHIELD_CRUSH);
|
||||
events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000);
|
||||
return;
|
||||
DoCast(m_creature->getVictim(), SPELL_SHIELD_CRUSH);
|
||||
events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000);
|
||||
return;
|
||||
case EVENT_WHIRL:
|
||||
DoCast(m_creature->getVictim(), SPELL_WHIRL);
|
||||
events.ScheduleEvent(EVENT_WHIRL, 8000);
|
||||
return;
|
||||
DoCast(m_creature->getVictim(), SPELL_WHIRL);
|
||||
events.ScheduleEvent(EVENT_WHIRL, 8000);
|
||||
return;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI_mob_warder(Creature* pCreature)
|
||||
CreatureAI* GetAI_mob_archavon_warder(Creature* pCreature)
|
||||
{
|
||||
return new mob_warderAI (pCreature);
|
||||
return new mob_archavon_warderAI(pCreature);
|
||||
}
|
||||
|
||||
CreatureAI* GetAI_boss_archavon(Creature* pCreature)
|
||||
@@ -194,6 +213,6 @@ void AddSC_boss_archavon()
|
||||
|
||||
newscript = new Script;
|
||||
newscript->Name = "mob_archavon_warder";
|
||||
newscript->GetAI = &GetAI_mob_warder;
|
||||
newscript->GetAI = &GetAI_mob_archavon_warder;
|
||||
newscript->RegisterSelf();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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 Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "vault_of_archavon.h"
|
||||
|
||||
|
||||
222
src/scripts/northrend/vault_of_archavon/boss_koralon.cpp
Normal file
222
src/scripts/northrend/vault_of_archavon/boss_koralon.cpp
Normal file
@@ -0,0 +1,222 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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 Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*** SQL START ***
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_koralon' WHERE `entry`='35013';
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_flame_warder' WHERE `entry`='35143';
|
||||
*** SQL END ***/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "vault_of_archavon.h"
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_NONE,
|
||||
|
||||
// Koralon
|
||||
EVENT_BURNING_BREATH,
|
||||
EVENT_BURNING_FURY,
|
||||
EVENT_FLAME_CINDER_A,
|
||||
EVENT_METEOR_FISTS_A,
|
||||
EVENT_METEOR_FISTS_B,
|
||||
|
||||
// Flame Warder
|
||||
EVENT_FW_LAVA_BIRST,
|
||||
EVENT_FW_METEOR_FISTS_A,
|
||||
EVENT_FW_METEOR_FISTS_B,
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
// Spells Koralon
|
||||
SPELL_BURNING_BREATH = 66665,
|
||||
SPELL_BURNING_BREATH_H = 67328,
|
||||
SPELL_BURNING_FURY = 66721,
|
||||
SPELL_FLAME_CINDER_A = 66684,
|
||||
SPELL_FLAME_CINDER_A_H = 67332,
|
||||
SPELL_FLAME_CINDER_B = 66681, // don't know the real relation to SPELL_FLAME_CINDER_A atm.
|
||||
SPELL_METEOR_FISTS_A = 66725,
|
||||
SPELL_METEOR_FISTS_A_H = 66765,
|
||||
SPELL_METEOR_FISTS_B = 67333,
|
||||
SPELL_METEOR_FISTS_B_H = 68161,
|
||||
|
||||
// Spells Flame Warder
|
||||
SPELL_FW_LAVA_BIRST = 66813,
|
||||
SPELL_FW_LAVA_BIRST_H = 67330,
|
||||
SPELL_FW_METEOR_FISTS_A = 66808,
|
||||
SPELL_FW_METEOR_FISTS_A_H = 66809,
|
||||
SPELL_FW_METEOR_FISTS_B = 67331,
|
||||
SPELL_FW_METEOR_FISTS_B_H = 68160,
|
||||
};
|
||||
|
||||
struct boss_koralonAI : public ScriptedAI
|
||||
{
|
||||
boss_koralonAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance *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 (m_creature->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
|
||||
{
|
||||
mob_flame_warderAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
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(m_creature->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();
|
||||
}
|
||||
298
src/scripts/northrend/vault_of_archavon/boss_toravon.cpp
Normal file
298
src/scripts/northrend/vault_of_archavon/boss_toravon.cpp
Normal file
@@ -0,0 +1,298 @@
|
||||
/*
|
||||
* Copyright (C) 2009-2010 Trinity <http://www.trinitycore.org/>
|
||||
*
|
||||
* 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 Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
/*** SQL START ***
|
||||
UPDATE `creature_template` SET `ScriptName`='boss_toravon' WHERE `entry`='38433';
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_frost_warder' WHERE `entry`='38482';
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_frozen_orb_stalker' WHERE `entry`='38461';
|
||||
UPDATE `creature_template` SET `ScriptName`='mob_frozen_orb' WHERE `entry`='38456';
|
||||
*** SQL END ***/
|
||||
|
||||
#include "ScriptedPch.h"
|
||||
#include "vault_of_archavon.h"
|
||||
|
||||
// Spells Toravon
|
||||
#define SPELL_FREEZING_GROUND RAID_MODE(72090,72104) // don't know cd... using 20 secs.
|
||||
#define SPELL_FROZEN_ORB RAID_MODE(72091,72095)
|
||||
#define SPELL_WHITEOUT RAID_MODE(72034,72096) // Every 38 sec. cast. (after SPELL_FROZEN_ORB)
|
||||
#define SPELL_FROZEN_MALLET 71993
|
||||
|
||||
// Spells Frost Warder
|
||||
#define SPELL_FROST_BLAST RAID_MODE(72123,72124) // don't know cd... using 20 secs.
|
||||
#define SPELL_FROZEN_MALLET 72122
|
||||
|
||||
// Spell Frozen Orb
|
||||
#define SPELL_FROZEN_ORB_DMG 72081 // priodic dmg aura
|
||||
#define SPELL_FROZEN_ORB_AURA 72067 // make visible
|
||||
|
||||
// Spell Frozen Orb Stalker
|
||||
#define SPELL_FROZEN_ORB_SUMMON 72093 // summon orb
|
||||
|
||||
// Events boss
|
||||
#define EVENT_FREEZING_GROUND 1
|
||||
#define EVENT_FROZEN_ORB 2
|
||||
#define EVENT_WHITEOUT 3
|
||||
|
||||
// Events mob
|
||||
#define EVENT_FROST_BLAST 4
|
||||
|
||||
// Mob Frozen Orb
|
||||
#define MOB_FROZEN_ORB 38456 // 1 in 10 mode and 3 in 25 mode
|
||||
|
||||
struct boss_toravonAI : public ScriptedAI
|
||||
{
|
||||
boss_toravonAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceData();
|
||||
}
|
||||
|
||||
ScriptedInstance *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 (m_creature->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
|
||||
{
|
||||
mob_frost_warderAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
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(m_creature->getVictim(), SPELL_FROST_BLAST);
|
||||
events.ScheduleEvent(EVENT_FROST_BLAST, 20000);
|
||||
return;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*######
|
||||
## Mob Frozen Orb
|
||||
######*/
|
||||
struct mob_frozen_orbAI : public ScriptedAI
|
||||
{
|
||||
mob_frozen_orbAI(Creature *c) : ScriptedAI(c) {}
|
||||
|
||||
bool done;
|
||||
uint32 killtimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
done = false;
|
||||
killtimer = 60000; // if after this time there is no victim -> destroy!
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *who)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
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())
|
||||
m_creature->ForcedDespawn();
|
||||
killtimer = 10000;
|
||||
}
|
||||
else
|
||||
killtimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## Mob Frozen Orb Stalker
|
||||
######*/
|
||||
struct mob_frozen_orb_stalkerAI : public Scripted_NoMovementAI
|
||||
{
|
||||
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);
|
||||
|
||||
pInstance = c->GetInstanceData();
|
||||
spawned = false;
|
||||
}
|
||||
|
||||
ScriptedInstance *pInstance;
|
||||
bool spawned;
|
||||
|
||||
void UpdateAI(const uint32 diff)
|
||||
{
|
||||
if (!spawned)
|
||||
{
|
||||
Unit* pToravon;
|
||||
if (pInstance && (pToravon = m_creature->GetCreature(*m_creature, pInstance->GetData64(DATA_TORAVON))))
|
||||
{
|
||||
uint8 num_orbs = RAID_MODE(1, 3);
|
||||
for (uint8 i=0; i<num_orbs; ++i)
|
||||
{
|
||||
Position pos;
|
||||
m_creature->GetNearPoint(pToravon, pos.m_positionX, pos.m_positionY, pos.m_positionZ, 0.0f, 10.0f, 0.0f);
|
||||
m_creature->SetPosition(pos, true);
|
||||
DoCast(me, SPELL_FROZEN_ORB_SUMMON);
|
||||
}
|
||||
}
|
||||
spawned = true;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
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();
|
||||
}
|
||||
@@ -1,35 +1,42 @@
|
||||
#include "ScriptedPch.h"
|
||||
#include "vault_of_archavon.h"
|
||||
|
||||
#define ENCOUNTERS 2
|
||||
#define ENCOUNTERS 4
|
||||
|
||||
/* Vault of Archavon encounters:
|
||||
1 - Archavon the Stone Watcher event
|
||||
2 - Emalon the Storm Watcher event
|
||||
3 - Koralon the Flame Watcher event
|
||||
4 - Toravon the Ice Watcher event
|
||||
*/
|
||||
|
||||
struct instance_archavon : public ScriptedInstance
|
||||
{
|
||||
instance_archavon(Map *Map) : ScriptedInstance(Map) {Initialize();};
|
||||
instance_archavon(Map *Map) : ScriptedInstance(Map) {};
|
||||
|
||||
uint32 Encounters[ENCOUNTERS];
|
||||
uint32 uiEncounters[ENCOUNTERS];
|
||||
|
||||
uint64 Archavon;
|
||||
uint64 Emalon;
|
||||
uint64 uiArchavon;
|
||||
uint64 uiEmalon;
|
||||
uint64 uiKoralon;
|
||||
uint64 uiToravon;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
Archavon = 0;
|
||||
Emalon = 0;
|
||||
uiArchavon = 0;
|
||||
uiEmalon = 0;
|
||||
uiKoralon = 0;
|
||||
uiToravon = 0;
|
||||
|
||||
for (uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
Encounters[i] = NOT_STARTED;
|
||||
uiEncounters[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < ENCOUNTERS; i++)
|
||||
if(Encounters[i] == IN_PROGRESS) return true;
|
||||
if (uiEncounters[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
@@ -38,8 +45,10 @@ struct instance_archavon : public ScriptedInstance
|
||||
{
|
||||
switch(creature->GetEntry())
|
||||
{
|
||||
case 31125: Archavon = creature->GetGUID(); break;
|
||||
case 33993: Emalon = creature->GetGUID(); break;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,8 +56,10 @@ struct instance_archavon : public ScriptedInstance
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_ARCHAVON_EVENT: return Encounters[0];
|
||||
case DATA_EMALON_EVENT: return Encounters[1];
|
||||
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;
|
||||
}
|
||||
@@ -57,8 +68,10 @@ struct instance_archavon : public ScriptedInstance
|
||||
{
|
||||
switch(identifier)
|
||||
{
|
||||
case DATA_ARCHAVON: return Archavon;
|
||||
case DATA_EMALON: return Emalon;
|
||||
case DATA_ARCHAVON: return uiArchavon;
|
||||
case DATA_EMALON: return uiEmalon;
|
||||
case DATA_KORALON: return uiKoralon;
|
||||
case DATA_TORAVON: return uiToravon;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -67,11 +80,13 @@ struct instance_archavon : public ScriptedInstance
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case DATA_ARCHAVON_EVENT: Encounters[0] = data; break;
|
||||
case DATA_EMALON_EVENT: Encounters[1] = data; break;
|
||||
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)
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
@@ -79,10 +94,11 @@ struct instance_archavon : public ScriptedInstance
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
std::ostringstream stream;
|
||||
stream << Encounters[0] << " " << Encounters[1];
|
||||
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)
|
||||
if (out)
|
||||
{
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return out;
|
||||
@@ -93,18 +109,21 @@ struct instance_archavon : public ScriptedInstance
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if(!in)
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
std::istringstream stream(in);
|
||||
stream >> Encounters[0] >> Encounters[1];
|
||||
stream >> uiEncounters[0] >> uiEncounters[1] >> uiEncounters[2] >> uiEncounters[3];
|
||||
|
||||
for (uint8 i = 0; i < ENCOUNTERS; ++i)
|
||||
if(Encounters[i] == IN_PROGRESS)
|
||||
Encounters[i] = NOT_STARTED;
|
||||
if (uiEncounters[i] == IN_PROGRESS)
|
||||
uiEncounters[i] = NOT_STARTED;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,8 +1,28 @@
|
||||
#ifndef DEF_ARCHAVON_H
|
||||
#define DEF_ARCHAVON_H
|
||||
|
||||
#define DATA_ARCHAVON_EVENT 1
|
||||
#define DATA_EMALON_EVENT 2
|
||||
#define DATA_EMALON 3
|
||||
#define DATA_ARCHAVON 4
|
||||
enum Creatures
|
||||
{
|
||||
CREATURE_ARCHAVON = 31125,
|
||||
CREATURE_EMALON = 33993,
|
||||
CREATURE_KORALON = 35013,
|
||||
CREATURE_TORAVON = 38433,
|
||||
};
|
||||
|
||||
enum Data
|
||||
{
|
||||
DATA_ARCHAVON_EVENT,
|
||||
DATA_EMALON_EVENT,
|
||||
DATA_KORALON_EVENT,
|
||||
DATA_TORAVON_EVENT,
|
||||
};
|
||||
|
||||
enum Data64
|
||||
{
|
||||
DATA_ARCHAVON,
|
||||
DATA_EMALON,
|
||||
DATA_KORALON,
|
||||
DATA_TORAVON,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -3560,6 +3560,14 @@
|
||||
RelativePath="..\..\src\scripts\northrend\vault_of_archavon\boss_emalon.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\scripts\northrend\vault_of_archavon\boss_koralon.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\scripts\northrend\vault_of_archavon\boss_toravon.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\src\scripts\northrend\vault_of_archavon\instance_vault_of_archavon.cpp"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user