mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 13:16:23 +00:00
converted all tabs to 4 spaces
This commit is contained in:
@@ -10,14 +10,14 @@ REWRITTEN FROM SCRATCH BY XINEF, IT OWNS NOW!
|
||||
|
||||
enum Archavon
|
||||
{
|
||||
SPELL_ROCK_SHARDS = 58678,
|
||||
SPELL_CRUSHING_LEAP_10 = 58960,
|
||||
SPELL_CRUSHING_LEAP_25 = 60894, //Instant (10-80yr range) -- Leaps at an enemy, inflicting 8000 Physical damage, knocking all nearby enemies away, and creating a cloud of choking debris.
|
||||
SPELL_STOMP_10 = 58663,
|
||||
SPELL_STOMP_25 = 60880,
|
||||
SPELL_IMPALE_10 = 58666,
|
||||
SPELL_IMPALE_25 = 60882, //Lifts an enemy off the ground with a spiked fist, inflicting 47125 to 52875 Physical damage and 9425 to 10575 additional damage each second for 8 sec.
|
||||
SPELL_BERSERK = 47008,
|
||||
SPELL_ROCK_SHARDS = 58678,
|
||||
SPELL_CRUSHING_LEAP_10 = 58960,
|
||||
SPELL_CRUSHING_LEAP_25 = 60894, //Instant (10-80yr range) -- Leaps at an enemy, inflicting 8000 Physical damage, knocking all nearby enemies away, and creating a cloud of choking debris.
|
||||
SPELL_STOMP_10 = 58663,
|
||||
SPELL_STOMP_25 = 60880,
|
||||
SPELL_IMPALE_10 = 58666,
|
||||
SPELL_IMPALE_25 = 60882, //Lifts an enemy off the ground with a spiked fist, inflicting 47125 to 52875 Physical damage and 9425 to 10575 additional damage each second for 8 sec.
|
||||
SPELL_BERSERK = 47008,
|
||||
};
|
||||
|
||||
enum
|
||||
@@ -44,36 +44,36 @@ class boss_archavon : public CreatureScript
|
||||
{
|
||||
boss_archavonAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
pInstance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_STONED))
|
||||
{
|
||||
if (Aura* aur = me->AddAura(SPELL_STONED_AURA, me))
|
||||
{
|
||||
aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
aur->SetDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
pInstance->SetData(EVENT_ARCHAVON, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_STONED))
|
||||
{
|
||||
if (Aura* aur = me->AddAura(SPELL_STONED_AURA, me))
|
||||
{
|
||||
aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
aur->SetDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
pInstance->SetData(EVENT_ARCHAVON, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (me->HasAura(SPELL_STONED_AURA))
|
||||
return;
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (me->HasAura(SPELL_STONED_AURA))
|
||||
return;
|
||||
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
@@ -81,15 +81,15 @@ class boss_archavon : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000);
|
||||
events.ScheduleEvent(EVENT_STOMP, 45000);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 300000);
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_ARCHAVON, IN_PROGRESS);
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_ARCHAVON, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* )
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_ARCHAVON, DONE);
|
||||
}
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_ARCHAVON, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
@@ -105,34 +105,34 @@ class boss_archavon : public CreatureScript
|
||||
{
|
||||
case EVENT_ROCK_SHARDS:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_ROCK_SHARDS, false);
|
||||
me->CastSpell(target, SPELL_ROCK_SHARDS, false);
|
||||
|
||||
events.RepeatEvent(15000);
|
||||
events.RepeatEvent(15000);
|
||||
break;
|
||||
case EVENT_CHOKING_CLOUD:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
me->CastSpell(target, RAID_MODE(SPELL_CRUSHING_LEAP_10, SPELL_CRUSHING_LEAP_25), true); //10y~80y, ignore range
|
||||
me->CastSpell(target, RAID_MODE(SPELL_CRUSHING_LEAP_10, SPELL_CRUSHING_LEAP_25), true); //10y~80y, ignore range
|
||||
|
||||
events.RepeatEvent(30000);
|
||||
events.RepeatEvent(30000);
|
||||
break;
|
||||
case EVENT_STOMP:
|
||||
{
|
||||
char buffer[100];
|
||||
sprintf(buffer, "Archavon the Stone Watcher lunges for %s!", me->GetVictim()->GetName().c_str());
|
||||
me->MonsterTextEmote(buffer, 0);
|
||||
me->CastSpell(me->GetVictim(), RAID_MODE(SPELL_STOMP_10, SPELL_STOMP_25), false);
|
||||
{
|
||||
char buffer[100];
|
||||
sprintf(buffer, "Archavon the Stone Watcher lunges for %s!", me->GetVictim()->GetName().c_str());
|
||||
me->MonsterTextEmote(buffer, 0);
|
||||
me->CastSpell(me->GetVictim(), RAID_MODE(SPELL_STOMP_10, SPELL_STOMP_25), false);
|
||||
events.RepeatEvent(45000);
|
||||
events.ScheduleEvent(EVENT_IMPALE, 3000);
|
||||
events.ScheduleEvent(EVENT_IMPALE, 3000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
case EVENT_IMPALE:
|
||||
me->CastSpell(me->GetVictim(), RAID_MODE(SPELL_IMPALE_10, SPELL_IMPALE_25), false);
|
||||
events.PopEvent();
|
||||
me->CastSpell(me->GetVictim(), RAID_MODE(SPELL_IMPALE_10, SPELL_IMPALE_25), false);
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_BERSERK:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
Talk(EMOTE_BERSERK);
|
||||
events.PopEvent();
|
||||
events.PopEvent();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -159,18 +159,18 @@ class spell_archavon_rock_shards : public SpellScriptLoader
|
||||
|
||||
void HandleScript(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Unit* target = GetHitUnit();
|
||||
Unit* caster = GetOriginalCaster();
|
||||
if (target && caster && caster->GetMap())
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Unit* target = GetHitUnit();
|
||||
Unit* caster = GetOriginalCaster();
|
||||
if (target && caster && caster->GetMap())
|
||||
{
|
||||
for (uint32 i = 0; i < 3; ++i)
|
||||
for (uint32 i = 0; i < 3; ++i)
|
||||
{
|
||||
caster->CastSpell(target, 58689, true);
|
||||
caster->CastSpell(target, 58692, true);
|
||||
}
|
||||
|
||||
caster->CastSpell(target, caster->GetMap()->Is25ManRaid() ? 60883 : 58695, true);
|
||||
caster->CastSpell(target, caster->GetMap()->Is25ManRaid() ? 60883 : 58695, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -190,5 +190,5 @@ class spell_archavon_rock_shards : public SpellScriptLoader
|
||||
void AddSC_boss_archavon()
|
||||
{
|
||||
new boss_archavon();
|
||||
new spell_archavon_rock_shards();
|
||||
new spell_archavon_rock_shards();
|
||||
}
|
||||
|
||||
@@ -10,24 +10,24 @@ REWRITTEN FROM SCRATCH BY XINEF, IT OWNS NOW!
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_OVERCHARGED = 64217,
|
||||
SPELL_OVERCHARGED_BLAST = 64219,
|
||||
SPELL_OVERCHARGE = 64218,
|
||||
SPELL_BERSERK = 26662,
|
||||
SPELL_OVERCHARGED = 64217,
|
||||
SPELL_OVERCHARGED_BLAST = 64219,
|
||||
SPELL_OVERCHARGE = 64218,
|
||||
SPELL_BERSERK = 26662,
|
||||
|
||||
SPELL_CHAIN_LIGHTNING_10 = 64213,
|
||||
SPELL_CHAIN_LIGHTNING_25 = 64215,
|
||||
SPELL_LIGHTNING_NOVA_10 = 64216,
|
||||
SPELL_LIGHTNING_NOVA_25 = 65279,
|
||||
SPELL_CHAIN_LIGHTNING_10 = 64213,
|
||||
SPELL_CHAIN_LIGHTNING_25 = 64215,
|
||||
SPELL_LIGHTNING_NOVA_10 = 64216,
|
||||
SPELL_LIGHTNING_NOVA_25 = 65279,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_CHAIN_LIGHTNING = 1,
|
||||
EVENT_LIGHTNING_NOVA = 2,
|
||||
EVENT_OVERCHARGE = 3,
|
||||
EVENT_BERSERK = 4,
|
||||
EVENT_SUMMON_NEXT_MINION = 5,
|
||||
EVENT_CHAIN_LIGHTNING = 1,
|
||||
EVENT_LIGHTNING_NOVA = 2,
|
||||
EVENT_OVERCHARGE = 3,
|
||||
EVENT_BERSERK = 4,
|
||||
EVENT_SUMMON_NEXT_MINION = 5,
|
||||
};
|
||||
|
||||
enum Misc
|
||||
@@ -36,8 +36,8 @@ enum Misc
|
||||
EMOTE_MINION_RESPAWN = 1,
|
||||
EMOTE_BERSERK = 2,
|
||||
|
||||
NPC_TEMPEST_MINION = 33998,
|
||||
MAX_TEMPEST_MINIONS = 4,
|
||||
NPC_TEMPEST_MINION = 33998,
|
||||
MAX_TEMPEST_MINIONS = 4,
|
||||
};
|
||||
|
||||
struct Position TempestMinions[MAX_TEMPEST_MINIONS] =
|
||||
@@ -60,70 +60,70 @@ class boss_emalon : public CreatureScript
|
||||
{
|
||||
boss_emalonAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
pInstance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
|
||||
void ResetSummons()
|
||||
{
|
||||
summons.DespawnAll();
|
||||
void ResetSummons()
|
||||
{
|
||||
summons.DespawnAll();
|
||||
for (uint8 i = 0; i < MAX_TEMPEST_MINIONS; ++i)
|
||||
me->SummonCreature(NPC_TEMPEST_MINION, TempestMinions[i], TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
ResetSummons();
|
||||
events.Reset();
|
||||
ResetSummons();
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_STONED))
|
||||
{
|
||||
if (Aura* aur = me->AddAura(SPELL_STONED_AURA, me))
|
||||
{
|
||||
aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
aur->SetDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
pInstance->SetData(EVENT_EMALON, NOT_STARTED);
|
||||
}
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_STONED))
|
||||
{
|
||||
if (Aura* aur = me->AddAura(SPELL_STONED_AURA, me))
|
||||
{
|
||||
aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
aur->SetDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
pInstance->SetData(EVENT_EMALON, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (me->HasAura(SPELL_STONED_AURA))
|
||||
return;
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (me->HasAura(SPELL_STONED_AURA))
|
||||
return;
|
||||
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* cr, Unit*)
|
||||
{
|
||||
summons.Despawn(cr);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NEXT_MINION, 4000);
|
||||
}
|
||||
void SummonedCreatureDies(Creature* cr, Unit*)
|
||||
{
|
||||
summons.Despawn(cr);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NEXT_MINION, 4000);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
|
||||
{
|
||||
// restore minions health
|
||||
if (spellInfo->Id == SPELL_OVERCHARGE)
|
||||
target->SetFullHealth();
|
||||
}
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
|
||||
{
|
||||
// restore minions health
|
||||
if (spellInfo->Id == SPELL_OVERCHARGE)
|
||||
target->SetFullHealth();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
events.Reset();
|
||||
if (summons.size() < 4)
|
||||
ResetSummons();
|
||||
events.Reset();
|
||||
if (summons.size() < 4)
|
||||
ResetSummons();
|
||||
|
||||
summons.DoZoneInCombat();
|
||||
|
||||
@@ -132,17 +132,17 @@ class boss_emalon : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_BERSERK, 360000);
|
||||
events.ScheduleEvent(EVENT_OVERCHARGE, 47000);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_EMALON, IN_PROGRESS);
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_EMALON, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* )
|
||||
{
|
||||
summons.DespawnAll();
|
||||
events.Reset();
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_EMALON, DONE);
|
||||
}
|
||||
void JustDied(Unit* )
|
||||
{
|
||||
summons.DespawnAll();
|
||||
events.Reset();
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_EMALON, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
@@ -157,27 +157,27 @@ class boss_emalon : public CreatureScript
|
||||
{
|
||||
case EVENT_CHAIN_LIGHTNING:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, RAID_MODE(SPELL_CHAIN_LIGHTNING_10, SPELL_CHAIN_LIGHTNING_25), false);
|
||||
me->CastSpell(target, RAID_MODE(SPELL_CHAIN_LIGHTNING_10, SPELL_CHAIN_LIGHTNING_25), false);
|
||||
events.RepeatEvent(25000);
|
||||
break;
|
||||
case EVENT_LIGHTNING_NOVA:
|
||||
me->CastSpell(me, RAID_MODE(SPELL_LIGHTNING_NOVA_10, SPELL_LIGHTNING_NOVA_25), false);
|
||||
me->CastSpell(me, RAID_MODE(SPELL_LIGHTNING_NOVA_10, SPELL_LIGHTNING_NOVA_25), false);
|
||||
events.RepeatEvent(40000);
|
||||
break;
|
||||
case EVENT_OVERCHARGE:
|
||||
if (!summons.empty())
|
||||
me->CastCustomSpell(SPELL_OVERCHARGE, SPELLVALUE_MAX_TARGETS, 1, me, true);
|
||||
if (!summons.empty())
|
||||
me->CastCustomSpell(SPELL_OVERCHARGE, SPELLVALUE_MAX_TARGETS, 1, me, true);
|
||||
Talk(EMOTE_OVERCHARGE);
|
||||
events.RepeatEvent(40000);
|
||||
events.RepeatEvent(40000);
|
||||
break;
|
||||
case EVENT_BERSERK:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
Talk(EMOTE_BERSERK);
|
||||
break;
|
||||
case EVENT_SUMMON_NEXT_MINION:
|
||||
me->SummonCreature(NPC_TEMPEST_MINION, TempestMinions[urand(0,3)], TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_SUMMON_NEXT_MINION:
|
||||
me->SummonCreature(NPC_TEMPEST_MINION, TempestMinions[urand(0,3)], TEMPSUMMON_CORPSE_DESPAWN, 0);
|
||||
events.PopEvent();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -204,13 +204,13 @@ class spell_voa_overcharge : public SpellScriptLoader
|
||||
void HandlePeriodicDummy(AuraEffect const* aurEff)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (target->GetTypeId() == TYPEID_UNIT && GetAura()->GetStackAmount() >= 10)
|
||||
{
|
||||
target->CastSpell(target, SPELL_OVERCHARGED_BLAST, true);
|
||||
target->ToCreature()->DespawnOrUnsummon(500);
|
||||
}
|
||||
if (target->GetTypeId() == TYPEID_UNIT && GetAura()->GetStackAmount() >= 10)
|
||||
{
|
||||
target->CastSpell(target, SPELL_OVERCHARGED_BLAST, true);
|
||||
target->ToCreature()->DespawnOrUnsummon(500);
|
||||
}
|
||||
|
||||
PreventDefaultAction();
|
||||
PreventDefaultAction();
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -236,14 +236,14 @@ class spell_voa_lightning_nova : public SpellScriptLoader
|
||||
|
||||
void HandleOnHit()
|
||||
{
|
||||
int32 damage = 0;
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
float dist = target->GetDistance(GetCaster());
|
||||
damage = int32(GetHitDamage() * (70.0f - std::min(70.0f, dist)) / 70.0f);
|
||||
}
|
||||
int32 damage = 0;
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
float dist = target->GetDistance(GetCaster());
|
||||
damage = int32(GetHitDamage() * (70.0f - std::min(70.0f, dist)) / 70.0f);
|
||||
}
|
||||
|
||||
SetHitDamage(damage);
|
||||
SetHitDamage(damage);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -262,6 +262,6 @@ void AddSC_boss_emalon()
|
||||
{
|
||||
new boss_emalon();
|
||||
|
||||
new spell_voa_overcharge();
|
||||
new spell_voa_lightning_nova();
|
||||
new spell_voa_overcharge();
|
||||
new spell_voa_lightning_nova();
|
||||
}
|
||||
|
||||
@@ -11,19 +11,19 @@ REWRITTEN FROM SCRATCH BY XINEF, IT OWNS NOW!
|
||||
enum Events
|
||||
{
|
||||
// Koralon
|
||||
EVENT_BURNING_BREATH = 1,
|
||||
EVENT_FLAME_CINDER = 2,
|
||||
EVENT_METEOR_FISTS = 3,
|
||||
EVENT_BURNING_BREATH = 1,
|
||||
EVENT_FLAME_CINDER = 2,
|
||||
EVENT_METEOR_FISTS = 3,
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_BURNING_FURY = 68168,
|
||||
SPELL_BURNING_BREATH = 66665, // handled by spell_difficulty
|
||||
SPELL_BURNING_BREATH = 66665, // handled by spell_difficulty
|
||||
|
||||
SPELL_FLAMING_CINDER = 66681,
|
||||
SPELL_FLAMING_CINDER_DUMMY = 66690,
|
||||
SPELL_FLAMING_CINDER_MISSILE = 66682, // trigger of missile handled by spell_difficulty
|
||||
SPELL_FLAMING_CINDER_DUMMY = 66690,
|
||||
SPELL_FLAMING_CINDER_MISSILE = 66682, // trigger of missile handled by spell_difficulty
|
||||
|
||||
SPELL_METEOR_FISTS = 66725, // handled by spell_difficulty
|
||||
SPELL_METEOR_FISTS_DAMAGE = 66765,
|
||||
@@ -39,38 +39,38 @@ class boss_koralon : public CreatureScript
|
||||
{
|
||||
boss_koralonAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
pInstance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
uint32 rotateTimer;
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
uint32 rotateTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
rotateTimer = 0;
|
||||
events.Reset();
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_STONED))
|
||||
{
|
||||
if (Aura* aur = me->AddAura(SPELL_STONED_AURA, me))
|
||||
{
|
||||
aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
aur->SetDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
pInstance->SetData(EVENT_KORALON, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
void Reset()
|
||||
{
|
||||
rotateTimer = 0;
|
||||
events.Reset();
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_STONED))
|
||||
{
|
||||
if (Aura* aur = me->AddAura(SPELL_STONED_AURA, me))
|
||||
{
|
||||
aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
aur->SetDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
pInstance->SetData(EVENT_KORALON, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (me->HasAura(SPELL_STONED_AURA))
|
||||
return;
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (me->HasAura(SPELL_STONED_AURA))
|
||||
return;
|
||||
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
@@ -81,38 +81,38 @@ class boss_koralon : public CreatureScript
|
||||
events.ScheduleEvent(EVENT_FLAME_CINDER, 20000);
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_KORALON, IN_PROGRESS);
|
||||
pInstance->SetData(EVENT_KORALON, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* )
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_KORALON, DONE);
|
||||
}
|
||||
void JustDied(Unit* )
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_KORALON, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (rotateTimer)
|
||||
{
|
||||
rotateTimer += diff;
|
||||
if (rotateTimer >= 3000)
|
||||
{
|
||||
if (!me->HasUnitMovementFlag(MOVEMENTFLAG_LEFT))
|
||||
{
|
||||
me->SetUnitMovementFlags(MOVEMENTFLAG_LEFT);
|
||||
me->SendMovementFlagUpdate();
|
||||
rotateTimer = 1;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEFT);
|
||||
me->SendMovementFlagUpdate();
|
||||
rotateTimer = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (rotateTimer)
|
||||
{
|
||||
rotateTimer += diff;
|
||||
if (rotateTimer >= 3000)
|
||||
{
|
||||
if (!me->HasUnitMovementFlag(MOVEMENTFLAG_LEFT))
|
||||
{
|
||||
me->SetUnitMovementFlags(MOVEMENTFLAG_LEFT);
|
||||
me->SendMovementFlagUpdate();
|
||||
rotateTimer = 1;
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEFT);
|
||||
me->SendMovementFlagUpdate();
|
||||
rotateTimer = 0;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
@@ -124,7 +124,7 @@ class boss_koralon : public CreatureScript
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_BURNING_BREATH:
|
||||
rotateTimer = 1500;
|
||||
rotateTimer = 1500;
|
||||
me->CastSpell(me, SPELL_BURNING_BREATH, false);
|
||||
events.RepeatEvent(45000);
|
||||
break;
|
||||
@@ -161,8 +161,8 @@ class spell_voa_flaming_cinder : public SpellScriptLoader
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SPELL_FLAMING_CINDER_MISSILE, true);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), SPELL_FLAMING_CINDER_MISSILE, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
@@ -248,7 +248,7 @@ class spell_flame_warder_meteor_fists : public SpellScriptLoader
|
||||
void AddSC_boss_koralon()
|
||||
{
|
||||
new boss_koralon();
|
||||
new spell_voa_flaming_cinder();
|
||||
new spell_koralon_meteor_fists();
|
||||
new spell_flame_warder_meteor_fists();
|
||||
new spell_voa_flaming_cinder();
|
||||
new spell_koralon_meteor_fists();
|
||||
new spell_flame_warder_meteor_fists();
|
||||
}
|
||||
|
||||
@@ -12,30 +12,30 @@ REWRITTEN FROM SCRATCH BY XINEF, IT OWNS NOW!
|
||||
enum Spells
|
||||
{
|
||||
// Toravon
|
||||
SPELL_FREEZING_GROUND = 72090,
|
||||
SPELL_FROZEN_ORB = 72091,
|
||||
SPELL_WHITEOUT = 72034,
|
||||
SPELL_FROZEN_MALLET = 71993,
|
||||
SPELL_FREEZING_GROUND = 72090,
|
||||
SPELL_FROZEN_ORB = 72091,
|
||||
SPELL_WHITEOUT = 72034,
|
||||
SPELL_FROZEN_MALLET = 71993,
|
||||
|
||||
// Frozen Orb
|
||||
SPELL_FROZEN_ORB_DMG = 72081, // priodic dmg aura
|
||||
SPELL_FROZEN_ORB_AURA = 72067, // make visible
|
||||
SPELL_FROZEN_ORB_DMG = 72081, // priodic dmg aura
|
||||
SPELL_FROZEN_ORB_AURA = 72067, // make visible
|
||||
|
||||
// Frozen Orb Stalker
|
||||
SPELL_FROZEN_ORB_STALKER_VISUAL = 72094,
|
||||
SPELL_FROZEN_ORB_STALKER_VISUAL = 72094,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_FREEZING_GROUND = 1,
|
||||
EVENT_FROZEN_ORB_STALKER = 2,
|
||||
EVENT_CHECK_SUMMONS = 3,
|
||||
EVENT_FREEZING_GROUND = 1,
|
||||
EVENT_FROZEN_ORB_STALKER = 2,
|
||||
EVENT_CHECK_SUMMONS = 3,
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
NPC_FROZEN_ORB = 38456,
|
||||
NPC_FROZEN_ORB_STALKER = 38461,
|
||||
NPC_FROZEN_ORB = 38456,
|
||||
NPC_FROZEN_ORB_STALKER = 38461,
|
||||
};
|
||||
|
||||
|
||||
@@ -48,62 +48,62 @@ class boss_toravon : public CreatureScript
|
||||
{
|
||||
boss_toravonAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
pInstance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_STONED))
|
||||
{
|
||||
if (Aura* aur = me->AddAura(SPELL_STONED_AURA, me))
|
||||
{
|
||||
aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
aur->SetDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
pInstance->SetData(EVENT_TORAVON, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
if (pInstance)
|
||||
{
|
||||
if (pInstance->GetData(DATA_STONED))
|
||||
{
|
||||
if (Aura* aur = me->AddAura(SPELL_STONED_AURA, me))
|
||||
{
|
||||
aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
aur->SetDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
pInstance->SetData(EVENT_TORAVON, NOT_STARTED);
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (me->HasAura(SPELL_STONED_AURA))
|
||||
return;
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (me->HasAura(SPELL_STONED_AURA))
|
||||
return;
|
||||
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
me->CastSpell(me, SPELL_FROZEN_MALLET, true);
|
||||
me->CastSpell(me, SPELL_FROZEN_MALLET, true);
|
||||
|
||||
events.ScheduleEvent(EVENT_FROZEN_ORB_STALKER, 12000);
|
||||
events.ScheduleEvent(EVENT_FREEZING_GROUND, 7000);
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_TORAVON, IN_PROGRESS);
|
||||
if (pInstance)
|
||||
pInstance->SetData(EVENT_TORAVON, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* )
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(EVENT_TORAVON, DONE);
|
||||
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_WHITEOUT);
|
||||
}
|
||||
}
|
||||
void JustDied(Unit* )
|
||||
{
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(EVENT_TORAVON, DONE);
|
||||
pInstance->DoRemoveAurasDueToSpellOnPlayers(SPELL_WHITEOUT);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* cr)
|
||||
{
|
||||
summons.Summon(cr);
|
||||
}
|
||||
void JustSummoned(Creature* cr)
|
||||
{
|
||||
summons.Summon(cr);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
@@ -116,37 +116,37 @@ class boss_toravon : public CreatureScript
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_FREEZING_GROUND:
|
||||
case EVENT_FREEZING_GROUND:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
me->CastSpell(target, SPELL_FREEZING_GROUND, false);
|
||||
me->CastSpell(target, SPELL_FREEZING_GROUND, false);
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
case EVENT_FROZEN_ORB_STALKER:
|
||||
me->CastCustomSpell(SPELL_FROZEN_ORB, SPELLVALUE_MAX_TARGETS, RAID_MODE(1, 3), me, false);
|
||||
events.RepeatEvent(35000);
|
||||
events.ScheduleEvent(EVENT_CHECK_SUMMONS, 10000);
|
||||
events.ScheduleEvent(EVENT_CHECK_SUMMONS, 10000);
|
||||
break;
|
||||
case EVENT_CHECK_SUMMONS:
|
||||
for (SummonList::iterator i = summons.begin(); i != summons.end();)
|
||||
{
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*me, *i))
|
||||
{
|
||||
if (!cr->IsAlive())
|
||||
summons.erase(i++);
|
||||
else
|
||||
++i;
|
||||
}
|
||||
else
|
||||
summons.erase(i++);
|
||||
}
|
||||
if (summons.empty())
|
||||
{
|
||||
events.PopEvent();
|
||||
me->CastSpell(me, SPELL_WHITEOUT, false);
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(2000);
|
||||
break;
|
||||
case EVENT_CHECK_SUMMONS:
|
||||
for (SummonList::iterator i = summons.begin(); i != summons.end();)
|
||||
{
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*me, *i))
|
||||
{
|
||||
if (!cr->IsAlive())
|
||||
summons.erase(i++);
|
||||
else
|
||||
++i;
|
||||
}
|
||||
else
|
||||
summons.erase(i++);
|
||||
}
|
||||
if (summons.empty())
|
||||
{
|
||||
events.PopEvent();
|
||||
me->CastSpell(me, SPELL_WHITEOUT, false);
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(2000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -170,13 +170,13 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
uint32 switchTimer;
|
||||
uint32 switchTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
switchTimer = 9000;
|
||||
me->CastSpell(me, SPELL_FROZEN_ORB_AURA, true);
|
||||
me->CastSpell(me, SPELL_FROZEN_ORB_DMG, true);
|
||||
switchTimer = 9000;
|
||||
me->CastSpell(me, SPELL_FROZEN_ORB_AURA, true);
|
||||
me->CastSpell(me, SPELL_FROZEN_ORB_DMG, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
@@ -186,14 +186,14 @@ public:
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
switchTimer += diff;
|
||||
if (switchTimer >= 10000)
|
||||
{
|
||||
switchTimer = 0;
|
||||
me->getThreatManager().resetAllAggro();
|
||||
if (Player* player = SelectTargetFromPlayerList(100.0f))
|
||||
me->AddThreat(player, 100000.0f);
|
||||
}
|
||||
switchTimer += diff;
|
||||
if (switchTimer >= 10000)
|
||||
{
|
||||
switchTimer = 0;
|
||||
me->getThreatManager().resetAllAggro();
|
||||
if (Player* player = SelectTargetFromPlayerList(100.0f))
|
||||
me->AddThreat(player, 100000.0f);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -212,20 +212,20 @@ public:
|
||||
{
|
||||
npc_frozen_orb_stalkerAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->CastSpell(me, SPELL_FROZEN_ORB_STALKER_VISUAL, true);
|
||||
}
|
||||
void Reset()
|
||||
{
|
||||
me->CastSpell(me, SPELL_FROZEN_ORB_STALKER_VISUAL, true);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* cr)
|
||||
{
|
||||
if (InstanceScript* pInstance = me->GetInstanceScript())
|
||||
if (Creature* toravon = ObjectAccessor::GetCreature(*me, pInstance->GetData64(EVENT_TORAVON)))
|
||||
if (toravon->AI())
|
||||
toravon->AI()->JustSummoned(cr);
|
||||
}
|
||||
void JustSummoned(Creature* cr)
|
||||
{
|
||||
if (InstanceScript* pInstance = me->GetInstanceScript())
|
||||
if (Creature* toravon = ObjectAccessor::GetCreature(*me, pInstance->GetData64(EVENT_TORAVON)))
|
||||
if (toravon->AI())
|
||||
toravon->AI()->JustSummoned(cr);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
@@ -239,5 +239,5 @@ void AddSC_boss_toravon()
|
||||
{
|
||||
new boss_toravon();
|
||||
new npc_frozen_orb();
|
||||
new npc_frozen_orb_stalker();
|
||||
new npc_frozen_orb_stalker();
|
||||
}
|
||||
|
||||
@@ -43,101 +43,101 @@ class instance_vault_of_archavon : public InstanceMapScript
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
memset(&bossGUIDs, 0, sizeof(bossGUIDs));
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
memset(&bossGUIDs, 0, sizeof(bossGUIDs));
|
||||
|
||||
ArchavonDeath = 0;
|
||||
EmalonDeath = 0;
|
||||
KoralonDeath = 0;
|
||||
checkTimer = 0;
|
||||
stoned = false;
|
||||
checkTimer = 0;
|
||||
stoned = false;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* )
|
||||
{
|
||||
if (stoned)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (Creature* cr = instance->GetCreature(bossGUIDs[i]))
|
||||
if (!cr->IsInCombat())
|
||||
cr->RemoveAllAuras();
|
||||
void OnPlayerEnter(Player* )
|
||||
{
|
||||
if (stoned)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (Creature* cr = instance->GetCreature(bossGUIDs[i]))
|
||||
if (!cr->IsInCombat())
|
||||
cr->RemoveAllAuras();
|
||||
|
||||
stoned = false;
|
||||
}
|
||||
}
|
||||
stoned = false;
|
||||
}
|
||||
}
|
||||
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
checkTimer += diff;
|
||||
if (checkTimer >= 60000)
|
||||
{
|
||||
checkTimer -= 60000; // one minute
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
|
||||
{
|
||||
if (!bf->IsWarTime())
|
||||
{
|
||||
if (bf->GetTimer() <= (16 * MINUTE * IN_MILLISECONDS) && bf->GetTimer() >= (15 * MINUTE * IN_MILLISECONDS))
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
player->MonsterTextEmote("This instance will reset in 15 minutes.", 0, true);
|
||||
}
|
||||
else if (bf->GetTimer() <= (10 * MINUTE * IN_MILLISECONDS) && bf->GetTimer() >= (9 * MINUTE * IN_MILLISECONDS))
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (Creature* cr = instance->GetCreature(bossGUIDs[i]))
|
||||
if (!cr->IsInCombat())
|
||||
{
|
||||
cr->RemoveAllAuras();
|
||||
if (Aura* aur = cr->AddAura(SPELL_STONED_AURA, cr))
|
||||
{
|
||||
aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
aur->SetDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
checkTimer += diff;
|
||||
if (checkTimer >= 60000)
|
||||
{
|
||||
checkTimer -= 60000; // one minute
|
||||
if (Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG))
|
||||
{
|
||||
if (!bf->IsWarTime())
|
||||
{
|
||||
if (bf->GetTimer() <= (16 * MINUTE * IN_MILLISECONDS) && bf->GetTimer() >= (15 * MINUTE * IN_MILLISECONDS))
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
player->MonsterTextEmote("This instance will reset in 15 minutes.", 0, true);
|
||||
}
|
||||
else if (bf->GetTimer() <= (10 * MINUTE * IN_MILLISECONDS) && bf->GetTimer() >= (9 * MINUTE * IN_MILLISECONDS))
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (Creature* cr = instance->GetCreature(bossGUIDs[i]))
|
||||
if (!cr->IsInCombat())
|
||||
{
|
||||
cr->RemoveAllAuras();
|
||||
if (Aura* aur = cr->AddAura(SPELL_STONED_AURA, cr))
|
||||
{
|
||||
aur->SetMaxDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
aur->SetDuration(60 * MINUTE* IN_MILLISECONDS);
|
||||
}
|
||||
}
|
||||
|
||||
stoned = true;
|
||||
}
|
||||
else if (bf->GetTimer() <= (2 * MINUTE * IN_MILLISECONDS) && bf->GetTimer() > (MINUTE * IN_MILLISECONDS))
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
player->MonsterTextEmote("This instance is about to reset. Prepare to be removed.", 0, true);
|
||||
}
|
||||
else if (bf->GetTimer() <= MINUTE * IN_MILLISECONDS)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (Creature* cr = instance->GetCreature(bossGUIDs[i]))
|
||||
if (cr->IsInCombat() && cr->AI())
|
||||
cr->AI()->EnterEvadeMode();
|
||||
stoned = true;
|
||||
}
|
||||
else if (bf->GetTimer() <= (2 * MINUTE * IN_MILLISECONDS) && bf->GetTimer() > (MINUTE * IN_MILLISECONDS))
|
||||
{
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
player->MonsterTextEmote("This instance is about to reset. Prepare to be removed.", 0, true);
|
||||
}
|
||||
else if (bf->GetTimer() <= MINUTE * IN_MILLISECONDS)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (Creature* cr = instance->GetCreature(bossGUIDs[i]))
|
||||
if (cr->IsInCombat() && cr->AI())
|
||||
cr->AI()->EnterEvadeMode();
|
||||
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Map::PlayerList const &PlayerList = instance->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
player->TeleportTo(player->m_homebindMapId, player->m_homebindX, player->m_homebindY, player->m_homebindZ, player->GetOrientation());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
|
||||
if (!bf || bf->IsWarTime() || bf->GetTimer() <= 10 * MINUTE * IN_MILLISECONDS)
|
||||
return true;
|
||||
Battlefield* bf = sBattlefieldMgr->GetBattlefieldByBattleId(BATTLEFIELD_BATTLEID_WG);
|
||||
if (!bf || bf->IsWarTime() || bf->GetTimer() <= 10 * MINUTE * IN_MILLISECONDS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
@@ -146,13 +146,13 @@ class instance_vault_of_archavon : public InstanceMapScript
|
||||
case CREATURE_TORAVON:
|
||||
bossGUIDs[EVENT_TORAVON] = creature->GetGUID();
|
||||
break;
|
||||
case CREATURE_ARCHAVON:
|
||||
case CREATURE_ARCHAVON:
|
||||
bossGUIDs[EVENT_ARCHAVON] = creature->GetGUID();
|
||||
break;
|
||||
case CREATURE_KORALON:
|
||||
case CREATURE_KORALON:
|
||||
bossGUIDs[EVENT_KORALON] = creature->GetGUID();
|
||||
break;
|
||||
case CREATURE_EMALON:
|
||||
case CREATURE_EMALON:
|
||||
bossGUIDs[EVENT_EMALON] = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
@@ -165,47 +165,47 @@ class instance_vault_of_archavon : public InstanceMapScript
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 identifier) const
|
||||
{
|
||||
if (identifier == DATA_STONED)
|
||||
return (uint32)stoned;
|
||||
return 0;
|
||||
}
|
||||
uint32 GetData(uint32 identifier) const
|
||||
{
|
||||
if (identifier == DATA_STONED)
|
||||
return (uint32)stoned;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case EVENT_ARCHAVON:
|
||||
case EVENT_EMALON:
|
||||
case EVENT_KORALON:
|
||||
case EVENT_TORAVON:
|
||||
m_auiEncounter[type] = data;
|
||||
break;
|
||||
}
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case EVENT_ARCHAVON:
|
||||
case EVENT_EMALON:
|
||||
case EVENT_KORALON:
|
||||
case EVENT_TORAVON:
|
||||
m_auiEncounter[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
{
|
||||
SaveToDB();
|
||||
switch (type)
|
||||
{
|
||||
case EVENT_ARCHAVON:
|
||||
ArchavonDeath = time(NULL);
|
||||
break;
|
||||
case EVENT_EMALON:
|
||||
EmalonDeath = time(NULL);
|
||||
break;
|
||||
case EVENT_KORALON:
|
||||
KoralonDeath = time(NULL);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
if (data == DONE)
|
||||
{
|
||||
SaveToDB();
|
||||
switch (type)
|
||||
{
|
||||
case EVENT_ARCHAVON:
|
||||
ArchavonDeath = time(NULL);
|
||||
break;
|
||||
case EVENT_EMALON:
|
||||
EmalonDeath = time(NULL);
|
||||
break;
|
||||
case EVENT_KORALON:
|
||||
KoralonDeath = time(NULL);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
// on every death of Archavon, Emalon and Koralon check our achievement
|
||||
DoCastSpellOnPlayers(SPELL_EARTH_WIND_FIRE_ACHIEVEMENT_CHECK);
|
||||
}
|
||||
}
|
||||
// on every death of Archavon, Emalon and Koralon check our achievement
|
||||
DoCastSpellOnPlayers(SPELL_EARTH_WIND_FIRE_ACHIEVEMENT_CHECK);
|
||||
}
|
||||
}
|
||||
|
||||
bool CheckAchievementCriteriaMeet(uint32 criteria_id, Player const* /*source*/, Unit const* /*target*/, uint32 /*miscvalue1*/)
|
||||
{
|
||||
@@ -229,55 +229,55 @@ class instance_vault_of_archavon : public InstanceMapScript
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "V O A " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "V O A " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
char dataHead1, dataHead2, dataHead3;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> dataHead3;
|
||||
char dataHead1, dataHead2, dataHead3;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2 >> dataHead3;
|
||||
|
||||
if (dataHead1 == 'V' && dataHead2 == 'O' && dataHead3 == 'A')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
{
|
||||
loadStream >> m_auiEncounter[i];
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
}
|
||||
if (dataHead1 == 'V' && dataHead2 == 'O' && dataHead3 == 'A')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
{
|
||||
loadStream >> m_auiEncounter[i];
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
m_auiEncounter[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
}
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
}
|
||||
|
||||
private:
|
||||
time_t ArchavonDeath;
|
||||
time_t EmalonDeath;
|
||||
time_t KoralonDeath;
|
||||
uint32 checkTimer;
|
||||
bool stoned;
|
||||
private:
|
||||
time_t ArchavonDeath;
|
||||
time_t EmalonDeath;
|
||||
time_t KoralonDeath;
|
||||
uint32 checkTimer;
|
||||
bool stoned;
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint64 bossGUIDs[MAX_ENCOUNTER];
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
uint64 bossGUIDs[MAX_ENCOUNTER];
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
|
||||
@@ -28,12 +28,12 @@ enum Creatures
|
||||
|
||||
enum Data
|
||||
{
|
||||
EVENT_ARCHAVON = 0,
|
||||
EVENT_EMALON = 1,
|
||||
EVENT_KORALON = 2,
|
||||
EVENT_TORAVON = 3,
|
||||
MAX_ENCOUNTER = 4,
|
||||
DATA_STONED = 5,
|
||||
EVENT_ARCHAVON = 0,
|
||||
EVENT_EMALON = 1,
|
||||
EVENT_KORALON = 2,
|
||||
EVENT_TORAVON = 3,
|
||||
MAX_ENCOUNTER = 4,
|
||||
DATA_STONED = 5,
|
||||
};
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ enum AchievementCriteriaIds
|
||||
enum AchievementSpells
|
||||
{
|
||||
SPELL_EARTH_WIND_FIRE_ACHIEVEMENT_CHECK = 68308,
|
||||
SPELL_STONED_AURA = 63080,
|
||||
SPELL_STONED_AURA = 63080,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user