mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-30 00:53:46 +00:00
Big re-organization of repository [W.I.P]
This commit is contained in:
@@ -1,205 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "serpent_shrine.h"
|
||||
|
||||
enum Talk
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_GAIN_BLESSING = 1,
|
||||
SAY_GAIN_ABILITY1 = 2,
|
||||
SAY_GAIN_ABILITY2 = 3,
|
||||
SAY_GAIN_ABILITY3 = 4,
|
||||
SAY_SLAY = 5,
|
||||
SAY_DEATH = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CATACLYSMIC_BOLT = 38441,
|
||||
SPELL_SEAR_NOVA = 38445,
|
||||
SPELL_ENRAGE = 24318,
|
||||
SPELL_BLESSING_OF_THE_TIDES = 38449
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
MAX_ADVISORS = 3,
|
||||
NPC_FATHOM_GUARD_CARIBDIS = 21964,
|
||||
NPC_FATHOM_GUARD_TIDALVESS = 21965,
|
||||
NPC_FATHOM_GUARD_SHARKKIS = 21966,
|
||||
NPC_SEER_OLUM = 22820,
|
||||
GO_CAGE = 185952,
|
||||
|
||||
EVENT_SPELL_CATACLYSMIC_BOLT = 1,
|
||||
EVENT_SPELL_ENRAGE = 2,
|
||||
EVENT_SPELL_SEAR_NOVA = 3,
|
||||
EVENT_HEALTH_CHECK = 4,
|
||||
EVENT_KILL_TALK = 5
|
||||
};
|
||||
|
||||
const Position advisorsPosition[MAX_ADVISORS+2] =
|
||||
{
|
||||
{459.61f, -534.81f, -7.54f, 3.82f},
|
||||
{463.83f, -540.23f, -7.54f, 3.15f},
|
||||
{459.94f, -547.28f, -7.54f, 2.42f},
|
||||
{448.37f, -544.71f, -7.54f, 0.00f},
|
||||
{457.37f, -544.71f, -7.54f, 0.00f}
|
||||
};
|
||||
|
||||
class boss_fathomlord_karathress : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_fathomlord_karathress() : CreatureScript("boss_fathomlord_karathress") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_fathomlord_karathressAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_fathomlord_karathressAI : public BossAI
|
||||
{
|
||||
boss_fathomlord_karathressAI(Creature* creature) : BossAI(creature, DATA_FATHOM_LORD_KARATHRESS)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
|
||||
me->SummonCreature(NPC_FATHOM_GUARD_TIDALVESS, advisorsPosition[0], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 600000);
|
||||
me->SummonCreature(NPC_FATHOM_GUARD_SHARKKIS, advisorsPosition[1], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 600000);
|
||||
me->SummonCreature(NPC_FATHOM_GUARD_CARIBDIS, advisorsPosition[2], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 600000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (summon->GetEntry() == NPC_SEER_OLUM)
|
||||
{
|
||||
summon->SetWalk(true);
|
||||
summon->GetMotionMaster()->MovePoint(0, advisorsPosition[MAX_ADVISORS+1], false);
|
||||
}
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit*)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
if (summon->GetEntry() == NPC_FATHOM_GUARD_TIDALVESS)
|
||||
Talk(SAY_GAIN_ABILITY1);
|
||||
if (summon->GetEntry() == NPC_FATHOM_GUARD_SHARKKIS)
|
||||
Talk(SAY_GAIN_ABILITY2);
|
||||
if (summon->GetEntry() == NPC_FATHOM_GUARD_CARIBDIS)
|
||||
Talk(SAY_GAIN_ABILITY3);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
BossAI::JustDied(killer);
|
||||
me->SummonCreature(NPC_SEER_OLUM, advisorsPosition[MAX_ADVISORS], TEMPSUMMON_TIMED_DESPAWN, 3600000);
|
||||
if (GameObject* gobject = me->FindNearestGameObject(GO_CAGE, 100.0f))
|
||||
gobject->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
me->CallForHelp(10.0f);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_CATACLYSMIC_BOLT, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENRAGE, 600000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SEAR_NOVA, 25000);
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_ENRAGE:
|
||||
me->CastSpell(me, SPELL_ENRAGE, true);
|
||||
break;
|
||||
case EVENT_SPELL_CATACLYSMIC_BOLT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, PowerUsersSelector(me, POWER_MANA, 50.0f, true)))
|
||||
me->CastSpell(target, SPELL_CATACLYSMIC_BOLT, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_CATACLYSMIC_BOLT, 6000);
|
||||
break;
|
||||
case EVENT_SPELL_SEAR_NOVA:
|
||||
me->CastSpell(me, SPELL_SEAR_NOVA, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_SEAR_NOVA, 20000+urand(0, 20000));
|
||||
break;
|
||||
case EVENT_HEALTH_CHECK:
|
||||
if (me->HealthBelowPct(76))
|
||||
{
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
if (summon->GetMaxHealth() > 500000)
|
||||
summon->CastSpell(me, SPELL_BLESSING_OF_THE_TIDES, true);
|
||||
|
||||
if (me->HasAura(SPELL_BLESSING_OF_THE_TIDES))
|
||||
Talk(SAY_GAIN_BLESSING);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_karathress_power_of_caribdis : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_karathress_power_of_caribdis() : SpellScriptLoader("spell_karathress_power_of_caribdis") { }
|
||||
|
||||
class spell_karathress_power_of_caribdis_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_karathress_power_of_caribdis_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* victim = GetUnitOwner()->GetVictim())
|
||||
GetUnitOwner()->CastSpell(victim, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_karathress_power_of_caribdis_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_karathress_power_of_caribdis_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_fathomlord_karathress()
|
||||
{
|
||||
new boss_fathomlord_karathress();
|
||||
new spell_karathress_power_of_caribdis();
|
||||
}
|
||||
@@ -1,372 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "serpent_shrine.h"
|
||||
|
||||
enum Talk
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SWITCH_TO_CLEAN = 1,
|
||||
SAY_CLEAN_SLAY = 2,
|
||||
SAY_CLEAN_DEATH = 3,
|
||||
SAY_SWITCH_TO_CORRUPT = 4,
|
||||
SAY_CORRUPT_SLAY = 5,
|
||||
SAY_CORRUPT_DEATH = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_CLEANSING_FIELD_AURA = 37935,
|
||||
SPELL_CLEANSING_FIELD = 37934,
|
||||
SPELL_BLUE_BEAM = 38015,
|
||||
SPELL_ELEMENTAL_SPAWNIN = 25035,
|
||||
|
||||
SPELL_SUMMON_CORRUPTED1 = 38188,
|
||||
SPELL_SUMMON_CORRUPTED2 = 38189,
|
||||
SPELL_SUMMON_CORRUPTED3 = 38190,
|
||||
SPELL_SUMMON_CORRUPTED4 = 38191,
|
||||
SPELL_SUMMON_PURIFIED1 = 38198,
|
||||
SPELL_SUMMON_PURIFIED2 = 38199,
|
||||
SPELL_SUMMON_PURIFIED3 = 38200,
|
||||
SPELL_SUMMON_PURIFIED4 = 38201,
|
||||
|
||||
SPELL_CORRUPTION = 37961,
|
||||
SPELL_WATER_TOMB = 38235,
|
||||
SPELL_VILE_SLUDGE = 38246,
|
||||
SPELL_ENRAGE = 27680,
|
||||
|
||||
SPELL_MARK_OF_HYDROSS1 = 38215,
|
||||
SPELL_MARK_OF_HYDROSS2 = 38216,
|
||||
SPELL_MARK_OF_HYDROSS3 = 38217,
|
||||
SPELL_MARK_OF_HYDROSS4 = 38218,
|
||||
SPELL_MARK_OF_HYDROSS5 = 38231,
|
||||
SPELL_MARK_OF_HYDROSS6 = 40584,
|
||||
SPELL_MARK_OF_CORRUPTION1 = 38219,
|
||||
SPELL_MARK_OF_CORRUPTION2 = 38220,
|
||||
SPELL_MARK_OF_CORRUPTION3 = 38221,
|
||||
SPELL_MARK_OF_CORRUPTION4 = 38222,
|
||||
SPELL_MARK_OF_CORRUPTION5 = 38230,
|
||||
SPELL_MARK_OF_CORRUPTION6 = 40583,
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
GROUP_ABILITIES = 1,
|
||||
NPC_PURE_SPAWN_OF_HYDROSS = 22035,
|
||||
|
||||
EVENT_SPELL_MARK_OF_CORRUPTION1 = 1,
|
||||
EVENT_SPELL_MARK_OF_CORRUPTION2 = 2,
|
||||
EVENT_SPELL_MARK_OF_CORRUPTION3 = 3,
|
||||
EVENT_SPELL_MARK_OF_CORRUPTION4 = 4,
|
||||
EVENT_SPELL_MARK_OF_CORRUPTION5 = 5,
|
||||
EVENT_SPELL_MARK_OF_CORRUPTION6 = 6,
|
||||
EVENT_SPELL_MARK_OF_HYDROSS1 = 7,
|
||||
EVENT_SPELL_MARK_OF_HYDROSS2 = 8,
|
||||
EVENT_SPELL_MARK_OF_HYDROSS3 = 9,
|
||||
EVENT_SPELL_MARK_OF_HYDROSS4 = 10,
|
||||
EVENT_SPELL_MARK_OF_HYDROSS5 = 11,
|
||||
EVENT_SPELL_MARK_OF_HYDROSS6 = 12,
|
||||
EVENT_SPELL_WATER_TOMB = 13,
|
||||
EVENT_SPELL_VILE_SLUDGE = 14,
|
||||
EVENT_SPELL_ENRAGE = 15,
|
||||
EVENT_CHECK_AURA = 16,
|
||||
EVENT_KILL_TALK = 17
|
||||
};
|
||||
|
||||
class boss_hydross_the_unstable : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_hydross_the_unstable() : CreatureScript("boss_hydross_the_unstable") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_hydross_the_unstableAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_hydross_the_unstableAI : public BossAI
|
||||
{
|
||||
boss_hydross_the_unstableAI(Creature* creature) : BossAI(creature, DATA_HYDROSS_THE_UNSTABLE)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
BossAI::JustReachedHome();
|
||||
if (!me->HasAura(SPELL_BLUE_BEAM))
|
||||
me->RemoveAurasDueToSpell(SPELL_CLEANSING_FIELD_AURA);
|
||||
}
|
||||
|
||||
void SetForm(bool corrupt, bool initial)
|
||||
{
|
||||
events.CancelEventGroup(GROUP_ABILITIES);
|
||||
DoResetThreat();
|
||||
|
||||
if (corrupt)
|
||||
{
|
||||
me->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE);
|
||||
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false);
|
||||
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
|
||||
me->CastSpell(me, SPELL_CORRUPTION, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_CORRUPTION1, 0, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_CORRUPTION2, 15000, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_CORRUPTION3, 30000, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_CORRUPTION4, 45000, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_CORRUPTION5, 60000, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_CORRUPTION6, 75000, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_VILE_SLUDGE, 7000, GROUP_ABILITIES);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->SetMeleeDamageSchool(SPELL_SCHOOL_FROST);
|
||||
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false);
|
||||
me->RemoveAurasDueToSpell(SPELL_CORRUPTION);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_HYDROSS1, 0, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_HYDROSS2, 15000, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_HYDROSS3, 30000, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_HYDROSS4, 45000, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_HYDROSS5, 60000, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_HYDROSS6, 75000, GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SPELL_WATER_TOMB, 7000, GROUP_ABILITIES);
|
||||
}
|
||||
|
||||
if (initial)
|
||||
return;
|
||||
|
||||
if (corrupt)
|
||||
{
|
||||
Talk(SAY_SWITCH_TO_CORRUPT);
|
||||
for (uint32 i = SPELL_SUMMON_CORRUPTED1; i <= SPELL_SUMMON_CORRUPTED4; ++i)
|
||||
me->CastSpell(me, i, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
Talk(SAY_SWITCH_TO_CLEAN);
|
||||
for (uint32 i = SPELL_SUMMON_PURIFIED1; i <= SPELL_SUMMON_PURIFIED4; ++i)
|
||||
me->CastSpell(me, i, true);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_ENRAGE, 600000);
|
||||
events.ScheduleEvent(EVENT_CHECK_AURA, 1000);
|
||||
SetForm(false, true);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(me->HasAura(SPELL_CORRUPTION) ? SAY_CORRUPT_SLAY : SAY_CLEAN_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->CastSpell(summon, SPELL_ELEMENTAL_SPAWNIN, true);
|
||||
summon->SetInCombatWithZone();
|
||||
|
||||
if (summon->GetEntry() == NPC_PURE_SPAWN_OF_HYDROSS)
|
||||
summon->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true);
|
||||
else
|
||||
summon->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true);
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* summon)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
Talk(me->HasAura(SPELL_CORRUPTION) ? SAY_CORRUPT_DEATH : SAY_CLEAN_DEATH);
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_AURA:
|
||||
if (me->HasAura(SPELL_BLUE_BEAM) == me->HasAura(SPELL_CORRUPTION))
|
||||
SetForm(!me->HasAura(SPELL_BLUE_BEAM), false);
|
||||
events.ScheduleEvent(EVENT_CHECK_AURA, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_ENRAGE:
|
||||
me->CastSpell(me, SPELL_ENRAGE, true);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_HYDROSS1:
|
||||
me->CastSpell(me, SPELL_MARK_OF_HYDROSS1, false);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_HYDROSS2:
|
||||
me->CastSpell(me, SPELL_MARK_OF_HYDROSS2, false);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_HYDROSS3:
|
||||
me->CastSpell(me, SPELL_MARK_OF_HYDROSS3, false);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_HYDROSS4:
|
||||
me->CastSpell(me, SPELL_MARK_OF_HYDROSS4, false);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_HYDROSS5:
|
||||
me->CastSpell(me, SPELL_MARK_OF_HYDROSS5, false);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_HYDROSS6:
|
||||
me->CastSpell(me, SPELL_MARK_OF_HYDROSS6, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_HYDROSS6, 15000, GROUP_ABILITIES);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_CORRUPTION1:
|
||||
me->CastSpell(me, SPELL_MARK_OF_CORRUPTION1, false);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_CORRUPTION2:
|
||||
me->CastSpell(me, SPELL_MARK_OF_CORRUPTION2, false);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_CORRUPTION3:
|
||||
me->CastSpell(me, SPELL_MARK_OF_CORRUPTION3, false);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_CORRUPTION4:
|
||||
me->CastSpell(me, SPELL_MARK_OF_CORRUPTION4, false);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_CORRUPTION5:
|
||||
me->CastSpell(me, SPELL_MARK_OF_CORRUPTION5, false);
|
||||
break;
|
||||
case EVENT_SPELL_MARK_OF_CORRUPTION6:
|
||||
me->CastSpell(me, SPELL_MARK_OF_CORRUPTION6, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK_OF_CORRUPTION6, 15000, GROUP_ABILITIES);
|
||||
break;
|
||||
case EVENT_SPELL_WATER_TOMB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true))
|
||||
me->CastSpell(target, SPELL_WATER_TOMB, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_WATER_TOMB, 7000, GROUP_ABILITIES);
|
||||
break;
|
||||
case EVENT_SPELL_VILE_SLUDGE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true))
|
||||
me->CastSpell(target, SPELL_VILE_SLUDGE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_VILE_SLUDGE, 15000, GROUP_ABILITIES);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_hydross_cleansing_field_aura : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hydross_cleansing_field_aura() : SpellScriptLoader("spell_hydross_cleansing_field_aura") { }
|
||||
|
||||
class spell_hydross_cleansing_field_aura_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hydross_cleansing_field_aura_AuraScript)
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTarget()->GetEntry() == NPC_HYDROSS_THE_UNSTABLE)
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, SPELL_CLEANSING_FIELD, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTarget()->GetEntry() == NPC_HYDROSS_THE_UNSTABLE)
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, SPELL_CLEANSING_FIELD, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_hydross_cleansing_field_aura_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_hydross_cleansing_field_aura_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_hydross_cleansing_field_aura_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hydross_cleansing_field_command : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hydross_cleansing_field_command() : SpellScriptLoader("spell_hydross_cleansing_field_command") { }
|
||||
|
||||
class spell_hydross_cleansing_field_command_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hydross_cleansing_field_command_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTarget()->HasUnitState(UNIT_STATE_CASTING))
|
||||
GetTarget()->InterruptNonMeleeSpells(false);
|
||||
else
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_BLUE_BEAM, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectApplyFn(spell_hydross_cleansing_field_command_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_hydross_cleansing_field_command_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hydross_mark_of_hydross : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hydross_mark_of_hydross() : SpellScriptLoader("spell_hydross_mark_of_hydross") { }
|
||||
|
||||
class spell_hydross_mark_of_hydross_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hydross_mark_of_hydross_AuraScript)
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasByType(SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, GetCasterGUID(), GetAura());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_hydross_mark_of_hydross_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_TAKEN, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_hydross_mark_of_hydross_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_hydross_the_unstable()
|
||||
{
|
||||
new boss_hydross_the_unstable();
|
||||
new spell_hydross_cleansing_field_aura();
|
||||
new spell_hydross_cleansing_field_command();
|
||||
new spell_hydross_mark_of_hydross();
|
||||
}
|
||||
@@ -1,501 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "serpent_shrine.h"
|
||||
#include "Spell.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_PHASE1 = 2,
|
||||
SAY_PHASE2 = 3,
|
||||
SAY_PHASE3 = 4,
|
||||
SAY_BOWSHOT = 5,
|
||||
SAY_SLAY = 6,
|
||||
SAY_DEATH = 7
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SHOOT = 37770,
|
||||
SPELL_MULTI_SHOT = 38310,
|
||||
SPELL_SHOCK_BLAST = 38509,
|
||||
SPELL_STATIC_CHARGE = 38280,
|
||||
SPELL_ENTANGLE = 38316,
|
||||
SPELL_MAGIC_BARRIER = 38112,
|
||||
SPELL_FORKED_LIGHTNING = 38145,
|
||||
|
||||
SPELL_SUMMON_ENCHANTED_ELEMENTAL= 38017,
|
||||
SPELL_SUMMON_COILFANG_ELITE = 38248,
|
||||
SPELL_SUMMON_COILFANG_STRIDER = 38241,
|
||||
SPELL_SUMMON_TAINTED_ELEMENTAL = 38140,
|
||||
SPELL_SURGE = 38044,
|
||||
|
||||
SPELL_REMOVE_TAINTED_CORES = 39495,
|
||||
SPELL_SUMMON_TOXIC_SPOREBAT = 38494,
|
||||
SPELL_SUMMON_SPOREBAT1 = 38489,
|
||||
SPELL_SUMMON_SPOREBAT2 = 38490,
|
||||
SPELL_SUMMON_SPOREBAT3 = 38492,
|
||||
SPELL_SUMMON_SPOREBAT4 = 38493,
|
||||
SPELL_TOXIC_SPORES = 38574
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
ITEM_TAINTED_CORE = 31088,
|
||||
|
||||
POINT_HOME = 1,
|
||||
|
||||
EVENT_SPELL_SHOCK_BLAST = 1,
|
||||
EVENT_SPELL_STATIC_CHARGE = 2,
|
||||
EVENT_SPELL_ENTANGLE = 3,
|
||||
EVENT_CHECK_HEALTH = 4,
|
||||
EVENT_SPELL_FORKED_LIGHTNING = 5,
|
||||
EVENT_SUMMON_A = 6,
|
||||
EVENT_SUMMON_B = 7,
|
||||
EVENT_SUMMON_C = 8,
|
||||
EVENT_SUMMON_D = 9,
|
||||
EVENT_CHECK_HEALTH2 = 10,
|
||||
EVENT_SUMMON_SPOREBAT = 11,
|
||||
|
||||
EVENT_KILL_TALK = 20
|
||||
};
|
||||
|
||||
class startFollow : public BasicEvent
|
||||
{
|
||||
public:
|
||||
startFollow(Unit* owner) : _owner(owner) { }
|
||||
|
||||
bool Execute(uint64 /*execTime*/, uint32 /*diff*/)
|
||||
{
|
||||
if (InstanceScript* instance = _owner->GetInstanceScript())
|
||||
if (Creature* vashj = ObjectAccessor::GetCreature(*_owner, instance->GetData64(NPC_LADY_VASHJ)))
|
||||
_owner->GetMotionMaster()->MoveFollow(vashj, 3.0f, vashj->GetAngle(_owner), MOTION_SLOT_CONTROLLED);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _owner;
|
||||
};
|
||||
|
||||
class boss_lady_vashj : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_lady_vashj() : CreatureScript("boss_lady_vashj") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_lady_vashjAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_lady_vashjAI : public BossAI
|
||||
{
|
||||
boss_lady_vashjAI(Creature* creature) : BossAI(creature, DATA_LADY_VASHJ)
|
||||
{
|
||||
intro = false;
|
||||
}
|
||||
|
||||
bool intro;
|
||||
int32 count;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
count = 0;
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
me->CastSpell(me, SPELL_REMOVE_TAINTED_CORES, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_SHOCK_BLAST, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_STATIC_CHARGE, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENTANGLE, 20000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (summon->GetEntry() == WORLD_TRIGGER)
|
||||
summon->CastSpell(summon, SPELL_MAGIC_BARRIER, false);
|
||||
else if (summon->GetEntry() == NPC_ENCHANTED_ELEMENTAL)
|
||||
{
|
||||
summon->SetWalk(true);
|
||||
summon->m_Events.AddEvent(new startFollow(summon), summon->m_Events.CalculateTime(0));
|
||||
}
|
||||
else if (summon->GetEntry() == NPC_TOXIC_SPOREBAT)
|
||||
summon->GetMotionMaster()->MoveRandom(30.0f);
|
||||
else if (summon->GetEntry() != NPC_TAINTED_ELEMENTAL)
|
||||
summon->GetMotionMaster()->MovePoint(POINT_HOME, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), true, true);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!intro && who->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
intro = true;
|
||||
Talk(SAY_INTRO);
|
||||
}
|
||||
|
||||
BossAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id != POINT_HOME)
|
||||
return;
|
||||
|
||||
me->SetFacingTo(me->GetHomePosition().GetOrientation());
|
||||
instance->SetData(DATA_ACTIVATE_SHIELD, 0);
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SPELL_FORKED_LIGHTNING, 3000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_A, 0);
|
||||
events.ScheduleEvent(EVENT_SUMMON_B, 45000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_C, 60000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_D, 50000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH2, 1000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHOCK_BLAST:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SHOCK_BLAST, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_SHOCK_BLAST, urand(10000, 20000));
|
||||
break;
|
||||
case EVENT_SPELL_STATIC_CHARGE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f))
|
||||
me->CastSpell(target, SPELL_STATIC_CHARGE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_STATIC_CHARGE, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_ENTANGLE:
|
||||
me->CastSpell(me, SPELL_ENTANGLE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENTANGLE, 30000);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(71))
|
||||
{
|
||||
Talk(SAY_PHASE2);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->MovePoint(POINT_HOME, me->GetHomePosition().GetPositionX(), me->GetHomePosition().GetPositionY(), me->GetHomePosition().GetPositionZ(), true, true);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_FORKED_LIGHTNING:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f))
|
||||
me->CastSpell(target, SPELL_FORKED_LIGHTNING, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_FORKED_LIGHTNING, urand(2500, 5000));
|
||||
break;
|
||||
case EVENT_SUMMON_A:
|
||||
me->CastSpell(me, SPELL_SUMMON_ENCHANTED_ELEMENTAL, true);
|
||||
events.ScheduleEvent(EVENT_SUMMON_A, 2500);
|
||||
break;
|
||||
case EVENT_SUMMON_B:
|
||||
me->CastSpell(me, SPELL_SUMMON_COILFANG_ELITE, true);
|
||||
events.ScheduleEvent(EVENT_SUMMON_B, 45000);
|
||||
break;
|
||||
case EVENT_SUMMON_C:
|
||||
me->CastSpell(me, SPELL_SUMMON_COILFANG_STRIDER, true);
|
||||
events.ScheduleEvent(EVENT_SUMMON_C, 60000);
|
||||
break;
|
||||
case EVENT_SUMMON_D:
|
||||
me->CastSpell(me, SPELL_SUMMON_TAINTED_ELEMENTAL, true);
|
||||
events.ScheduleEvent(EVENT_SUMMON_D, 50000);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH2:
|
||||
if (!me->HasAura(SPELL_MAGIC_BARRIER))
|
||||
{
|
||||
Talk(SAY_PHASE3);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SPELL_SHOCK_BLAST, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_STATIC_CHARGE, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENTANGLE, 20000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SPOREBAT, 5000);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH2, 1000);
|
||||
break;
|
||||
case EVENT_SUMMON_SPOREBAT:
|
||||
me->CastSpell(me, SPELL_SUMMON_TOXIC_SPOREBAT, true);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SPOREBAT, 20000 - 1000*std::min(count++, 16));
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->GetReactState() != REACT_AGGRESSIVE || !me->isAttackReady())
|
||||
return;
|
||||
|
||||
if (!me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
me->resetAttackTimer();
|
||||
me->SetSheath(SHEATH_STATE_RANGED);
|
||||
me->CastSpell(me->GetVictim(), roll_chance_i(33) ? SPELL_MULTI_SHOT : SPELL_SHOOT, false);
|
||||
if (roll_chance_i(15))
|
||||
Talk(SAY_BOWSHOT);
|
||||
}
|
||||
else
|
||||
{
|
||||
me->SetSheath(SHEATH_STATE_MELEE);
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const
|
||||
{
|
||||
return me->GetHomePosition().GetExactDist2d(me) > 80.0f || !SelectTargetFromPlayerList(100.0f);
|
||||
}
|
||||
};
|
||||
};
|
||||
/*
|
||||
|
||||
//Toxic Sporebat
|
||||
//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it.
|
||||
class npc_toxic_sporebat : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_toxic_sporebat() : CreatureScript("npc_toxic_sporebat") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_toxic_sporebatAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_toxic_sporebatAI : public ScriptedAI
|
||||
{
|
||||
npc_toxic_sporebatAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
EnterEvadeMode();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
|
||||
uint32 MovementTimer;
|
||||
uint32 ToxicSporeTimer;
|
||||
uint32 BoltTimer;
|
||||
uint32 CheckTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->SetDisableGravity(true);
|
||||
me->setFaction(14);
|
||||
MovementTimer = 0;
|
||||
ToxicSporeTimer = 5000;
|
||||
BoltTimer = 5500;
|
||||
CheckTimer = 1000;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
|
||||
{
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
return;
|
||||
|
||||
if (id == 1)
|
||||
MovementTimer = 0;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
// Random movement
|
||||
if (MovementTimer <= diff)
|
||||
{
|
||||
uint32 rndpos = rand()%8;
|
||||
me->GetMotionMaster()->MovePoint(1, SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]);
|
||||
MovementTimer = 6000;
|
||||
} else MovementTimer -= diff;
|
||||
|
||||
// toxic spores
|
||||
if (BoltTimer <= diff)
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (Creature* trig = me->SummonCreature(TOXIC_SPORES_TRIGGER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 30000))
|
||||
{
|
||||
trig->setFaction(14);
|
||||
trig->CastSpell(trig, SPELL_TOXIC_SPORES, true);
|
||||
}
|
||||
}
|
||||
BoltTimer = 10000+rand()%5000;
|
||||
}
|
||||
else BoltTimer -= diff;
|
||||
|
||||
// CheckTimer
|
||||
if (CheckTimer <= diff)
|
||||
{
|
||||
// check if vashj is death
|
||||
Unit* Vashj = ObjectAccessor::GetUnit(*me, instance->GetData64(DATA_LADYVASHJ));
|
||||
if (!Vashj || !Vashj->IsAlive() || CAST_AI(boss_lady_vashj::boss_lady_vashjAI, Vashj->ToCreature()->AI())->Phase != 3)
|
||||
{
|
||||
// remove
|
||||
me->setDeathState(DEAD);
|
||||
me->RemoveCorpse();
|
||||
me->setFaction(35);
|
||||
}
|
||||
|
||||
CheckTimer = 1000;
|
||||
}
|
||||
else
|
||||
CheckTimer -= diff;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
*/
|
||||
|
||||
class spell_lady_vashj_magic_barrier : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_lady_vashj_magic_barrier() : SpellScriptLoader("spell_lady_vashj_magic_barrier") { }
|
||||
|
||||
class spell_lady_vashj_magic_barrier_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_lady_vashj_magic_barrier_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit::DealDamage(GetTarget(), GetTarget(), GetTarget()->CountPctFromMaxHealth(5));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_lady_vashj_magic_barrier_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_SCHOOL_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_lady_vashj_magic_barrier_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_lady_vashj_remove_tainted_cores : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_lady_vashj_remove_tainted_cores() : SpellScriptLoader("spell_lady_vashj_remove_tainted_cores") { }
|
||||
|
||||
class spell_lady_vashj_remove_tainted_cores_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_lady_vashj_remove_tainted_cores_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Player* target = GetHitPlayer())
|
||||
target->DestroyItemCount(ITEM_TAINTED_CORE, -1, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_lady_vashj_remove_tainted_cores_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_lady_vashj_remove_tainted_cores_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_lady_vashj_summon_sporebat : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_lady_vashj_summon_sporebat() : SpellScriptLoader("spell_lady_vashj_summon_sporebat") { }
|
||||
|
||||
class spell_lady_vashj_summon_sporebat_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_lady_vashj_summon_sporebat_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
GetCaster()->CastSpell(GetCaster(), RAND(SPELL_SUMMON_SPOREBAT1, SPELL_SUMMON_SPOREBAT2, SPELL_SUMMON_SPOREBAT3, SPELL_SUMMON_SPOREBAT4), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_lady_vashj_summon_sporebat_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_lady_vashj_summon_sporebat_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_lady_vashj_spore_drop_effect : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_lady_vashj_spore_drop_effect() : SpellScriptLoader("spell_lady_vashj_spore_drop_effect") { }
|
||||
|
||||
class spell_lady_vashj_spore_drop_effect_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_lady_vashj_spore_drop_effect_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SPELL_TOXIC_SPORES, true, NULL, NULL, GetCaster()->GetGUID());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_lady_vashj_spore_drop_effect_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_lady_vashj_spore_drop_effect_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_lady_vashj()
|
||||
{
|
||||
new boss_lady_vashj();
|
||||
new spell_lady_vashj_magic_barrier();
|
||||
new spell_lady_vashj_remove_tainted_cores();
|
||||
new spell_lady_vashj_summon_sporebat();
|
||||
new spell_lady_vashj_spore_drop_effect();
|
||||
}
|
||||
@@ -1,514 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "serpent_shrine.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum Talk
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SWITCH_TO_DEMON = 1,
|
||||
SAY_INNER_DEMONS = 2,
|
||||
SAY_DEMON_SLAY = 3,
|
||||
SAY_NIGHTELF_SLAY = 4,
|
||||
SAY_FINAL_FORM = 5,
|
||||
SAY_DEATH = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_DUAL_WIELD = 42459,
|
||||
SPELL_BANISH = 37546,
|
||||
SPELL_TAUNT = 37548,
|
||||
SPELL_BERSERK = 26662,
|
||||
SPELL_WHIRLWIND = 37640,
|
||||
SPELL_SUMMON_SHADOW_OF_LEOTHERAS = 37781,
|
||||
|
||||
// Demon Form
|
||||
SPELL_CHAOS_BLAST = 37674,
|
||||
SPELL_CHAOS_BLAST_TRIGGER = 37675,
|
||||
SPELL_INSIDIOUS_WHISPER = 37676,
|
||||
SPELL_METAMORPHOSIS = 37673,
|
||||
SPELL_SUMMON_INNER_DEMON = 37735,
|
||||
SPELL_CONSUMING_MADNESS = 37749,
|
||||
|
||||
// Other
|
||||
SPELL_CLEAR_CONSUMING_MADNESS = 37750,
|
||||
SPELL_SHADOW_BOLT = 39309
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
MAX_CHANNELERS = 3,
|
||||
|
||||
NPC_GREYHEART_SPELLBINDER = 21806,
|
||||
NPC_SHADOW_OF_LEOTHERAS = 21875,
|
||||
|
||||
EVENT_SPELL_BERSERK = 1,
|
||||
EVENT_HEALTH_CHECK = 2,
|
||||
EVENT_SWITCH_TO_DEMON = 3,
|
||||
EVENT_SPELL_WHIRLWIND = 4,
|
||||
EVENT_KILL_TALK = 5,
|
||||
EVENT_SWITCH_TO_ELF = 6,
|
||||
EVENT_SPELL_INSIDIOUS_WHISPER = 7,
|
||||
EVENT_SUMMON_DEMON = 8,
|
||||
EVENT_RESTORE_FIGHT = 9,
|
||||
|
||||
EVENT_SPELL_SHADOW_BOLT = 20
|
||||
};
|
||||
|
||||
const Position channelersPos[MAX_CHANNELERS] =
|
||||
{
|
||||
{367.11f, -421.48f, 29.52f, 5.0f},
|
||||
{380.11f, -435.48f, 29.52f, 2.5f},
|
||||
{362.11f, -437.48f, 29.52f, 0.9f}
|
||||
};
|
||||
|
||||
class boss_leotheras_the_blind : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_leotheras_the_blind() : CreatureScript("boss_leotheras_the_blind") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_leotheras_the_blindAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_leotheras_the_blindAI : public BossAI
|
||||
{
|
||||
boss_leotheras_the_blindAI(Creature* creature) : BossAI(creature, DATA_LEOTHERAS_THE_BLIND)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->CastSpell(me, SPELL_CLEAR_CONSUMING_MADNESS, true);
|
||||
me->CastSpell(me, SPELL_DUAL_WIELD, true);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
me->LoadEquipment(0, true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
BossAI::InitializeAI();
|
||||
SummonChannelers();
|
||||
}
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
BossAI::JustReachedHome();
|
||||
SummonChannelers();
|
||||
}
|
||||
|
||||
void SummonChannelers()
|
||||
{
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_BANISH, false);
|
||||
me->CastSpell(me, SPELL_BANISH, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_BANISH, true);
|
||||
|
||||
summons.DespawnAll();
|
||||
for (uint8 i = 0; i < MAX_CHANNELERS; ++i)
|
||||
me->SummonCreature(NPC_GREYHEART_SPELLBINDER, channelersPos[i], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) { }
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit*)
|
||||
{
|
||||
me->SetInCombatWithZone();
|
||||
summons.Despawn(summon);
|
||||
if (summon->GetEntry() == NPC_GREYHEART_SPELLBINDER)
|
||||
if (!summons.HasEntry(NPC_GREYHEART_SPELLBINDER))
|
||||
{
|
||||
me->RemoveAllAuras();
|
||||
me->LoadEquipment();
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_BERSERK, 600000);
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000);
|
||||
events.ScheduleEvent(EVENT_SWITCH_TO_DEMON, 55000);
|
||||
events.ScheduleEvent(EVENT_SPELL_WHIRLWIND, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(me->GetDisplayId() != me->GetNativeDisplayId() ? SAY_DEMON_SLAY : SAY_NIGHTELF_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
me->CastSpell(me, SPELL_CLEAR_CONSUMING_MADNESS, true);
|
||||
Talk(SAY_DEATH);
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (who && me->Attack(who, true))
|
||||
me->GetMotionMaster()->MoveChase(who, me->GetDisplayId() == me->GetNativeDisplayId() ? 0.0f : 25.0f);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_BERSERK:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
case EVENT_HEALTH_CHECK:
|
||||
if (me->HealthBelowPct(15))
|
||||
{
|
||||
if (me->GetDisplayId() != me->GetNativeDisplayId())
|
||||
{
|
||||
DoResetThreat();
|
||||
me->LoadEquipment();
|
||||
me->RemoveAurasDueToSpell(SPELL_METAMORPHOSIS);
|
||||
events.ScheduleEvent(EVENT_SPELL_WHIRLWIND, 10000);
|
||||
}
|
||||
events.CancelEvent(EVENT_SWITCH_TO_DEMON);
|
||||
events.CancelEvent(EVENT_SPELL_INSIDIOUS_WHISPER);
|
||||
events.DelayEvents(10000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_DEMON, 4000);
|
||||
events.ScheduleEvent(EVENT_RESTORE_FIGHT, 6000);
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->StopMoving();
|
||||
Talk(SAY_FINAL_FORM);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK, 1000);
|
||||
break;
|
||||
case EVENT_SWITCH_TO_DEMON:
|
||||
DoResetThreat();
|
||||
Talk(SAY_SWITCH_TO_DEMON);
|
||||
me->LoadEquipment(0, true);
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim(), 25.0f);
|
||||
me->CastSpell(me, SPELL_METAMORPHOSIS, true);
|
||||
|
||||
events.CancelEvent(EVENT_SPELL_WHIRLWIND);
|
||||
events.ScheduleEvent(EVENT_SPELL_INSIDIOUS_WHISPER, 25000);
|
||||
events.ScheduleEvent(EVENT_SWITCH_TO_ELF, 60000);
|
||||
break;
|
||||
case EVENT_SWITCH_TO_ELF:
|
||||
DoResetThreat();
|
||||
me->LoadEquipment();
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim(), 0.0f);
|
||||
me->RemoveAurasDueToSpell(SPELL_METAMORPHOSIS);
|
||||
events.ScheduleEvent(EVENT_SWITCH_TO_DEMON, 55000);
|
||||
events.ScheduleEvent(EVENT_SPELL_WHIRLWIND, 10000);
|
||||
break;
|
||||
case EVENT_SPELL_WHIRLWIND:
|
||||
me->CastSpell(me, SPELL_WHIRLWIND, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_WHIRLWIND, 27000);
|
||||
break;
|
||||
case EVENT_SPELL_INSIDIOUS_WHISPER:
|
||||
Talk(SAY_INNER_DEMONS);
|
||||
me->CastCustomSpell(SPELL_INSIDIOUS_WHISPER, SPELLVALUE_MAX_TARGETS, 5, me, false);
|
||||
break;
|
||||
case EVENT_SUMMON_DEMON:
|
||||
me->CastSpell(me, SPELL_SUMMON_SHADOW_OF_LEOTHERAS, true);
|
||||
break;
|
||||
case EVENT_RESTORE_FIGHT:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->GetDisplayId() == me->GetNativeDisplayId())
|
||||
DoMeleeAttackIfReady();
|
||||
else if (me->isAttackReady(BASE_ATTACK))
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), SPELL_CHAOS_BLAST, false);
|
||||
me->setAttackTimer(BASE_ATTACK, 2000);
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class npc_inner_demon : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_inner_demon() : CreatureScript("npc_inner_demon") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_inner_demonAI(creature);
|
||||
}
|
||||
|
||||
struct npc_inner_demonAI : public ScriptedAI
|
||||
{
|
||||
npc_inner_demonAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
uint64 ownerGUID;
|
||||
EventMap events;
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
me->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* summoner)
|
||||
{
|
||||
if (!summoner)
|
||||
return;
|
||||
|
||||
ownerGUID = summoner->GetGUID();
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SPELL_SHADOW_BOLT, 4000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Unit* unit = ObjectAccessor::GetUnit(*me, ownerGUID))
|
||||
unit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* who, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!who || who->GetGUID() != ownerGUID)
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
bool CanAIAttack(const Unit* who) const
|
||||
{
|
||||
return who->GetGUID() == ownerGUID;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHADOW_BOLT:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SHADOW_BOLT, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_SHADOW_BOLT, 6000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_leotheras_whirlwind : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_leotheras_whirlwind() : SpellScriptLoader("spell_leotheras_whirlwind") { }
|
||||
|
||||
class spell_leotheras_whirlwind_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_leotheras_whirlwind_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
GetCaster()->getThreatManager().resetAllAggro();
|
||||
|
||||
if (roll_chance_i(33))
|
||||
if (Unit* target = GetCaster()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
|
||||
target->CastSpell(GetCaster(), SPELL_TAUNT, true);
|
||||
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_leotheras_whirlwind_SpellScript::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_leotheras_whirlwind_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_leotheras_chaos_blast : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_leotheras_chaos_blast() : SpellScriptLoader("spell_leotheras_chaos_blast") { }
|
||||
|
||||
class spell_leotheras_chaos_blast_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_leotheras_chaos_blast_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, SPELL_CHAOS_BLAST_TRIGGER, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_leotheras_chaos_blast_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_leotheras_chaos_blast_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_leotheras_insidious_whisper : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_leotheras_insidious_whisper() : SpellScriptLoader("spell_leotheras_insidious_whisper") { }
|
||||
|
||||
class spell_leotheras_insidious_whisper_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_leotheras_insidious_whisper_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||
{
|
||||
if (Unit* victim = GetCaster()->GetVictim())
|
||||
unitList.remove_if(Trinity::ObjectGUIDCheck(victim->GetGUID(), true));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_leotheras_insidious_whisper_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_leotheras_insidious_whisper_SpellScript();
|
||||
}
|
||||
|
||||
class spell_leotheras_insidious_whisper_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_leotheras_insidious_whisper_AuraScript)
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SUMMON_INNER_DEMON, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_DEFAULT)
|
||||
if (InstanceScript* instance = GetUnitOwner()->GetInstanceScript())
|
||||
if (Creature* leotheras = ObjectAccessor::GetCreature(*GetUnitOwner(), instance->GetData64(NPC_LEOTHERAS_THE_BLIND)))
|
||||
leotheras->CastSpell(GetUnitOwner(), SPELL_CONSUMING_MADNESS, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_leotheras_insidious_whisper_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_leotheras_insidious_whisper_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_leotheras_insidious_whisper_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_leotheras_demon_link : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_leotheras_demon_link() : SpellScriptLoader("spell_leotheras_demon_link") { }
|
||||
|
||||
class spell_leotheras_demon_link_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_leotheras_demon_link_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* victim = GetUnitOwner()->GetVictim())
|
||||
GetUnitOwner()->CastSpell(victim, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_leotheras_demon_link_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_leotheras_demon_link_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_leotheras_clear_consuming_madness : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_leotheras_clear_consuming_madness() : SpellScriptLoader("spell_leotheras_clear_consuming_madness") { }
|
||||
|
||||
class spell_leotheras_clear_consuming_madness_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_leotheras_clear_consuming_madness_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
Unit::Kill(GetCaster(), target);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_leotheras_clear_consuming_madness_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_leotheras_clear_consuming_madness_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_leotheras_the_blind()
|
||||
{
|
||||
new boss_leotheras_the_blind();
|
||||
new npc_inner_demon();
|
||||
new spell_leotheras_whirlwind();
|
||||
new spell_leotheras_chaos_blast();
|
||||
new spell_leotheras_insidious_whisper();
|
||||
new spell_leotheras_demon_link();
|
||||
new spell_leotheras_clear_consuming_madness();
|
||||
}
|
||||
@@ -1,310 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "serpent_shrine.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_WATER_BOLT = 37138,
|
||||
SPELL_WHIRL = 37660,
|
||||
SPELL_GEYSER = 37478,
|
||||
SPELL_SPOUT_VISUAL = 37431,
|
||||
SPELL_SPOUT_PERIODIC = 37430,
|
||||
SPELL_LURKER_SPAWN_TRIGGER = 54587 // Needed for achievement
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
EMOTE_TAKE_BREATH = 0,
|
||||
ACTION_START_EVENT = 1,
|
||||
MAX_SUMMONS = 9,
|
||||
|
||||
NPC_COILFANG_GUARDIAN = 21873,
|
||||
NPC_COILFANG_AMBUSHER = 21865,
|
||||
|
||||
EVENT_PHASE_1 = 1,
|
||||
EVENT_PHASE_2 = 2,
|
||||
EVENT_SPELL_WHIRL = 3,
|
||||
EVENT_SPELL_SPOUT = 4,
|
||||
EVENT_SPELL_GEYSER = 5,
|
||||
EVENT_SPELL_SPOUT_PERIODIC = 6
|
||||
};
|
||||
|
||||
const Position positions[MAX_SUMMONS] =
|
||||
{
|
||||
{2.8553810f, -459.823914f, -19.182686f, 0.0f},
|
||||
{12.400000f, -466.042267f, -19.182686f, 0.0f},
|
||||
{51.366653f, -460.836060f, -19.182686f, 0.0f},
|
||||
{62.597980f, -457.433044f, -19.182686f, 0.0f},
|
||||
{77.607452f, -384.302765f, -19.182686f, 0.0f},
|
||||
{63.897900f, -378.984924f, -19.182686f, 0.0f},
|
||||
{34.447250f, -387.333618f, -19.182686f, 0.0f},
|
||||
{14.388216f, -423.468018f, -19.625271f, 0.0f},
|
||||
{42.471519f, -445.115295f, -19.769423f, 0.0f}
|
||||
};
|
||||
|
||||
class boss_the_lurker_below : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_the_lurker_below() : CreatureScript("boss_the_lurker_below") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_the_lurker_belowAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_the_lurker_belowAI : public BossAI
|
||||
{
|
||||
boss_the_lurker_belowAI(Creature* creature) : BossAI(creature, DATA_THE_LURKER_BELOW)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->SetStandState(UNIT_STAND_STATE_SUBMERGED);
|
||||
me->SetVisible(false);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summon->SetInCombatWithZone();
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_START_EVENT)
|
||||
me->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (who && me->GetReactState() == REACT_AGGRESSIVE)
|
||||
me->Attack(who, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
me->setAttackTimer(BASE_ATTACK, 6000);
|
||||
me->SetVisible(true);
|
||||
me->UpdateObjectVisibility(true);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_WHIRL, 18000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SPOUT, 45000);
|
||||
events.ScheduleEvent(EVENT_SPELL_GEYSER, 10000);
|
||||
events.ScheduleEvent(EVENT_PHASE_2, 125000);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_WHIRL:
|
||||
me->CastSpell(me, SPELL_WHIRL, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_WHIRL, 18000);
|
||||
break;
|
||||
case EVENT_SPELL_GEYSER:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_GEYSER, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_GEYSER, 10000);
|
||||
break;
|
||||
case EVENT_SPELL_SPOUT:
|
||||
Talk(EMOTE_TAKE_BREATH);
|
||||
me->CastSpell(me, SPELL_SPOUT_VISUAL, TRIGGERED_IGNORE_SET_FACING);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFacingToObject(me->GetVictim());
|
||||
me->SetTarget(0);
|
||||
events.ScheduleEvent(EVENT_SPELL_SPOUT, 60000);
|
||||
events.RescheduleEvent(EVENT_SPELL_WHIRL, 18000);
|
||||
events.RescheduleEvent(EVENT_SPELL_GEYSER, 25000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SPOUT_PERIODIC, 3000);
|
||||
break;
|
||||
case EVENT_SPELL_SPOUT_PERIODIC:
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->CastSpell(me, SPELL_SPOUT_PERIODIC, true);
|
||||
break;
|
||||
case EVENT_PHASE_2:
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_PHASE_1, 60000);
|
||||
me->SetStandState(UNIT_STAND_STATE_SUBMERGED);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
for (uint8 i = 0; i < MAX_SUMMONS; ++i)
|
||||
me->SummonCreature(i < 6 ? NPC_COILFANG_AMBUSHER : NPC_COILFANG_GUARDIAN, positions[i].GetPositionX(), positions[i].GetPositionY(), positions[i].GetPositionZ(), positions[i].GetAngle(me), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000);
|
||||
break;
|
||||
case EVENT_PHASE_1:
|
||||
me->setAttackTimer(BASE_ATTACK, 6000);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SPELL_SPOUT, 10000);
|
||||
events.ScheduleEvent(EVENT_PHASE_2, 120000);
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->getStandState() != UNIT_STAND_STATE_STAND || !me->isAttackReady() || me->GetReactState() != REACT_AGGRESSIVE)
|
||||
return;
|
||||
|
||||
Unit* target = NULL;
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
target = me->GetVictim();
|
||||
else
|
||||
{
|
||||
ThreatContainer::StorageType const &t_list = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
if (Unit* threatTarget = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
if (me->IsWithinMeleeRange(threatTarget))
|
||||
{
|
||||
target = threatTarget;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (target)
|
||||
me->AttackerStateUpdate(target);
|
||||
else if (target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_WATER_BOLT, false);
|
||||
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class go_strange_pool : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_strange_pool() : GameObjectScript("go_strange_pool") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
if (roll_chance_i(instance->GetBossState(DATA_THE_LURKER_BELOW) != DONE ? 25 : 0) && !instance->IsEncounterInProgress())
|
||||
{
|
||||
player->CastSpell(player, SPELL_LURKER_SPAWN_TRIGGER, true);
|
||||
if (Creature* lurker = ObjectAccessor::GetCreature(*go, instance->GetData64(NPC_THE_LURKER_BELOW)))
|
||||
lurker->AI()->DoAction(ACTION_START_EVENT);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class spell_lurker_below_spout : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_lurker_below_spout() : SpellScriptLoader("spell_lurker_below_spout") { }
|
||||
|
||||
class spell_lurker_below_spout_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_lurker_below_spout_AuraScript);
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
SetDuration(13000);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Creature* creature = GetUnitOwner()->ToCreature())
|
||||
{
|
||||
creature->resetAttackTimer();
|
||||
creature->SetReactState(REACT_AGGRESSIVE);
|
||||
if (Unit* target = creature->GetVictim())
|
||||
creature->SetTarget(target->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->SetFacingTo(Position::NormalizeOrientation(GetUnitOwner()->GetOrientation()+0.1f));
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), aurEff->GetAmount(), true);
|
||||
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_lurker_below_spout_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_lurker_below_spout_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_lurker_below_spout_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_lurker_below_spout_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class HasInLineCheck
|
||||
{
|
||||
public:
|
||||
HasInLineCheck(Unit* caster) : _caster(caster) { }
|
||||
|
||||
bool operator()(WorldObject* unit)
|
||||
{
|
||||
return !_caster->HasInLine(unit, 5.0f) || (unit->GetTypeId() == TYPEID_UNIT && unit->ToUnit()->IsUnderWater());
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _caster;
|
||||
};
|
||||
|
||||
class spell_lurker_below_spout_cone : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_lurker_below_spout_cone() : SpellScriptLoader("spell_lurker_below_spout_cone") { }
|
||||
|
||||
class spell_lurker_below_spout_cone_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_lurker_below_spout_cone_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(HasInLineCheck(GetCaster()));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_lurker_below_spout_cone_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_CONE_ENEMY_24);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_lurker_below_spout_cone_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_the_lurker_below()
|
||||
{
|
||||
new boss_the_lurker_below();
|
||||
new go_strange_pool();
|
||||
new spell_lurker_below_spout();
|
||||
new spell_lurker_below_spout_cone();
|
||||
}
|
||||
@@ -1,238 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "serpent_shrine.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SUMMON = 1,
|
||||
SAY_SUMMON_BUBLE = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_DEATH = 4,
|
||||
EMOTE_WATERY_GRAVE = 5,
|
||||
EMOTE_EARTHQUAKE = 6,
|
||||
EMOTE_WATERY_GLOBULES = 7
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_TIDAL_WAVE = 37730,
|
||||
SPELL_WATERY_GRAVE = 38028,
|
||||
SPELL_WATERY_GRAVE_1 = 38023,
|
||||
SPELL_WATERY_GRAVE_2 = 38024,
|
||||
SPELL_WATERY_GRAVE_3 = 38025,
|
||||
SPELL_WATERY_GRAVE_4 = 37850,
|
||||
SPELL_EARTHQUAKE = 37764,
|
||||
SPELL_SUMMON_MURLOC1 = 39813,
|
||||
SPELL_SUMMON_WATER_GLOBULE_1 = 37854,
|
||||
SPELL_SUMMON_WATER_GLOBULE_2 = 37858,
|
||||
SPELL_SUMMON_WATER_GLOBULE_3 = 37860,
|
||||
SPELL_SUMMON_WATER_GLOBULE_4 = 37861
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
// Creatures
|
||||
NPC_WATER_GLOBULE = 21913,
|
||||
NPC_TIDEWALKER_LURKER = 21920,
|
||||
|
||||
EVENT_SPELL_TIDAL_WAVE = 1,
|
||||
EVENT_SPELL_WATERY_GRAVE = 2,
|
||||
EVENT_SPELL_EARTHQUAKE = 3,
|
||||
EVENT_SUMMON_MURLOCS = 4,
|
||||
EVENT_KILL_TALK = 5
|
||||
|
||||
};
|
||||
|
||||
const uint32 wateryGraveId[4] = {SPELL_WATERY_GRAVE_1, SPELL_WATERY_GRAVE_2, SPELL_WATERY_GRAVE_3, SPELL_WATERY_GRAVE_4};
|
||||
const uint32 waterGlobuleId[4] = {SPELL_SUMMON_WATER_GLOBULE_1, SPELL_SUMMON_WATER_GLOBULE_2, SPELL_SUMMON_WATER_GLOBULE_3, SPELL_SUMMON_WATER_GLOBULE_4};
|
||||
|
||||
class boss_morogrim_tidewalker : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_morogrim_tidewalker() : CreatureScript("boss_morogrim_tidewalker") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_morogrim_tidewalkerAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_morogrim_tidewalkerAI : public BossAI
|
||||
{
|
||||
boss_morogrim_tidewalkerAI(Creature* creature) : BossAI(creature, DATA_MOROGRIM_TIDEWALKER)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_TIDAL_WAVE, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_WATERY_GRAVE, 28000);
|
||||
events.ScheduleEvent(EVENT_SPELL_EARTHQUAKE, 40000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_TIDAL_WAVE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_TIDAL_WAVE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_TIDAL_WAVE, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_WATERY_GRAVE:
|
||||
Talk(SAY_SUMMON_BUBLE);
|
||||
if (me->HealthAbovePct(25))
|
||||
{
|
||||
Talk(EMOTE_WATERY_GRAVE);
|
||||
me->CastCustomSpell(SPELL_WATERY_GRAVE, SPELLVALUE_MAX_TARGETS, 4, me, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
Talk(EMOTE_WATERY_GLOBULES);
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
me->CastSpell(me, waterGlobuleId[i], true);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_WATERY_GRAVE, 25000);
|
||||
break;
|
||||
case EVENT_SPELL_EARTHQUAKE:
|
||||
Talk(EMOTE_EARTHQUAKE);
|
||||
me->CastSpell(me, SPELL_EARTHQUAKE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_EARTHQUAKE, urand(45000, 60000));
|
||||
events.ScheduleEvent(EVENT_SUMMON_MURLOCS, 8000);
|
||||
break;
|
||||
case EVENT_SUMMON_MURLOCS:
|
||||
Talk(SAY_SUMMON);
|
||||
for (uint32 i = SPELL_SUMMON_MURLOC1; i < SPELL_SUMMON_MURLOC1+11; ++i)
|
||||
me->CastSpell(me, i, true);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_morogrim_tidewalker_watery_grave : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_morogrim_tidewalker_watery_grave() : SpellScriptLoader("spell_morogrim_tidewalker_watery_grave") { }
|
||||
|
||||
class spell_morogrim_tidewalker_watery_grave_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_morogrim_tidewalker_watery_grave_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
targetNumber = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
if (targetNumber < 4)
|
||||
GetCaster()->CastSpell(target, wateryGraveId[targetNumber++], true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_morogrim_tidewalker_watery_grave_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
|
||||
private:
|
||||
uint8 targetNumber;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_morogrim_tidewalker_watery_grave_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_morogrim_tidewalker_water_globule_new_target : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_morogrim_tidewalker_water_globule_new_target() : SpellScriptLoader("spell_morogrim_tidewalker_water_globule_new_target") { }
|
||||
|
||||
class spell_morogrim_tidewalker_water_globule_new_target_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_morogrim_tidewalker_water_globule_new_target_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||
{
|
||||
Trinity::Containers::RandomResizeList(unitList, 1);
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
|
||||
// Xinef: if we have target we currently follow, return
|
||||
if (Unit* target = GetCaster()->GetVictim())
|
||||
if (GetCaster()->getThreatManager().getThreat(target) >= 100000.0f)
|
||||
return;
|
||||
|
||||
// Xinef: acquire new target
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->AddThreat(target, 1000000.0f);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_morogrim_tidewalker_water_globule_new_target_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_morogrim_tidewalker_water_globule_new_target_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_morogrim_tidewalker_water_globule_new_target_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_morogrim_tidewalker()
|
||||
{
|
||||
new boss_morogrim_tidewalker();
|
||||
new spell_morogrim_tidewalker_watery_grave();
|
||||
new spell_morogrim_tidewalker_water_globule_new_target();
|
||||
}
|
||||
@@ -1,405 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "serpent_shrine.h"
|
||||
#include "Player.h"
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_LADY_VASHJ_BRIDGE_CONSOLE, DATA_BRIDGE_EMERGED, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_COILFANG_BRIDGE1, DATA_BRIDGE_EMERGED, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_COILFANG_BRIDGE2, DATA_BRIDGE_EMERGED, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_COILFANG_BRIDGE3, DATA_BRIDGE_EMERGED, DOOR_TYPE_PASSAGE, BOUNDARY_NONE }
|
||||
};
|
||||
|
||||
class instance_serpent_shrine : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_serpent_shrine() : InstanceMapScript("instance_serpent_shrine", 548) { }
|
||||
|
||||
struct instance_serpentshrine_cavern_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_serpentshrine_cavern_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTERS);
|
||||
LoadDoorData(doorData);
|
||||
|
||||
LadyVashjGUID = 0;
|
||||
memset(&ShieldGeneratorGUID, 0, sizeof(ShieldGeneratorGUID));
|
||||
AliveKeepersCount = 0;
|
||||
LeotherasTheBlindGUID = 0;
|
||||
LurkerBelowGUID = 0;
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
if (type == DATA_LADY_VASHJ)
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (GameObject* gobject = instance->GetGameObject(ShieldGeneratorGUID[i]))
|
||||
gobject->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_LADY_VASHJ_BRIDGE_CONSOLE:
|
||||
case GO_COILFANG_BRIDGE1:
|
||||
case GO_COILFANG_BRIDGE2:
|
||||
case GO_COILFANG_BRIDGE3:
|
||||
AddDoor(go, true);
|
||||
break;
|
||||
case GO_SHIELD_GENERATOR1:
|
||||
case GO_SHIELD_GENERATOR2:
|
||||
case GO_SHIELD_GENERATOR3:
|
||||
case GO_SHIELD_GENERATOR4:
|
||||
ShieldGeneratorGUID[go->GetEntry()-GO_SHIELD_GENERATOR1] = go->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectRemove(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_LADY_VASHJ_BRIDGE_CONSOLE:
|
||||
case GO_COILFANG_BRIDGE1:
|
||||
case GO_COILFANG_BRIDGE2:
|
||||
case GO_COILFANG_BRIDGE3:
|
||||
AddDoor(go, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_COILFANG_SHATTERER:
|
||||
case NPC_COILFANG_PRIESTESS:
|
||||
if (creature->GetPositionX() > -110.0f && creature->GetPositionX() < 155.0f && creature->GetPositionY() > -610.0f && creature->GetPositionY() < -280.0f)
|
||||
AliveKeepersCount += creature->IsAlive() ? 0 : -1; // retarded SmartAI calls JUST_RESPAWNED in AIInit...
|
||||
break;
|
||||
case NPC_THE_LURKER_BELOW:
|
||||
LurkerBelowGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_LEOTHERAS_THE_BLIND:
|
||||
LeotherasTheBlindGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_CYCLONE_KARATHRESS:
|
||||
creature->GetMotionMaster()->MoveRandom(50.0f);
|
||||
break;
|
||||
case NPC_LADY_VASHJ:
|
||||
LadyVashjGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_ENCHANTED_ELEMENTAL:
|
||||
case NPC_COILFANG_ELITE:
|
||||
case NPC_COILFANG_STRIDER:
|
||||
case NPC_TAINTED_ELEMENTAL:
|
||||
if (Creature* vashj = instance->GetCreature(LadyVashjGUID))
|
||||
vashj->AI()->JustSummoned(creature);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier) const
|
||||
{
|
||||
switch (identifier)
|
||||
{
|
||||
case NPC_THE_LURKER_BELOW:
|
||||
return LurkerBelowGUID;
|
||||
case NPC_LEOTHERAS_THE_BLIND:
|
||||
return LeotherasTheBlindGUID;
|
||||
case NPC_LADY_VASHJ:
|
||||
return LadyVashjGUID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_PLATFORM_KEEPER_RESPAWNED:
|
||||
++AliveKeepersCount;
|
||||
break;
|
||||
case DATA_PLATFORM_KEEPER_DIED:
|
||||
--AliveKeepersCount;
|
||||
break;
|
||||
case DATA_BRIDGE_ACTIVATED:
|
||||
SetBossState(DATA_BRIDGE_EMERGED, NOT_STARTED);
|
||||
SetBossState(DATA_BRIDGE_EMERGED, DONE);
|
||||
break;
|
||||
case DATA_ACTIVATE_SHIELD:
|
||||
if (Creature* vashj = instance->GetCreature(LadyVashjGUID))
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (GameObject* gobject = instance->GetGameObject(ShieldGeneratorGUID[i]))
|
||||
{
|
||||
gobject->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
vashj->SummonTrigger(gobject->GetPositionX(), gobject->GetPositionY(), gobject->GetPositionZ(), 0.0f, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == DATA_ALIVE_KEEPERS)
|
||||
return AliveKeepersCount;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "S C " << GetBossSaveData();
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(char const* str)
|
||||
{
|
||||
if (!str)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(str);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(str);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'S' && dataHead2 == 'C')
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 LadyVashjGUID;
|
||||
uint64 ShieldGeneratorGUID[4];
|
||||
uint64 LurkerBelowGUID;
|
||||
uint64 LeotherasTheBlindGUID;
|
||||
int32 AliveKeepersCount;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_serpentshrine_cavern_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_serpentshrine_cavern_serpentshrine_parasite : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_serpentshrine_cavern_serpentshrine_parasite() : SpellScriptLoader("spell_serpentshrine_cavern_serpentshrine_parasite") { }
|
||||
|
||||
class spell_serpentshrine_cavern_serpentshrine_parasite_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_serpentshrine_cavern_serpentshrine_parasite_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTarget()->GetInstanceScript() && GetTarget()->GetInstanceScript()->IsEncounterInProgress())
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_SERPENTSHRINE_PARASITE, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_serpentshrine_cavern_serpentshrine_parasite_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_serpentshrine_cavern_serpentshrine_parasite_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_serpentshrine_cavern_serpentshrine_parasite_trigger : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_serpentshrine_cavern_serpentshrine_parasite_trigger() : SpellScriptLoader("spell_serpentshrine_cavern_serpentshrine_parasite_trigger") { }
|
||||
|
||||
class spell_serpentshrine_cavern_serpentshrine_parasite_trigger_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_serpentshrine_cavern_serpentshrine_parasite_trigger_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTarget()->GetInstanceScript() && GetTarget()->GetInstanceScript()->IsEncounterInProgress())
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_SERPENTSHRINE_PARASITE, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_serpentshrine_cavern_serpentshrine_parasite_trigger_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_serpentshrine_cavern_serpentshrine_parasite_trigger_AuraScript();
|
||||
}
|
||||
|
||||
class spell_serpentshrine_cavern_serpentshrine_parasite_trigger_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_serpentshrine_cavern_serpentshrine_parasite_trigger_SpellScript);
|
||||
|
||||
void HandleApplyAura(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Creature* target = GetHitCreature())
|
||||
target->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_serpentshrine_cavern_serpentshrine_parasite_trigger_SpellScript::HandleApplyAura, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_serpentshrine_cavern_serpentshrine_parasite_trigger_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_serpentshrine_cavern_infection : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_serpentshrine_cavern_infection() : SpellScriptLoader("spell_serpentshrine_cavern_infection") { }
|
||||
|
||||
class spell_serpentshrine_cavern_infection_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_serpentshrine_cavern_infection_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTarget()->GetInstanceScript())
|
||||
{
|
||||
CustomSpellValues values;
|
||||
values.AddSpellMod(SPELLVALUE_MAX_TARGETS, 1);
|
||||
values.AddSpellMod(SPELLVALUE_BASE_POINT0, aurEff->GetAmount()+500);
|
||||
values.AddSpellMod(SPELLVALUE_BASE_POINT1, aurEff->GetAmount()+500);
|
||||
GetTarget()->CastCustomSpell(SPELL_RAMPART_INFECTION, values, GetTarget(), TRIGGERED_FULL_MASK, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_serpentshrine_cavern_infection_AuraScript::HandleEffectRemove, EFFECT_1, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_serpentshrine_cavern_infection_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_serpentshrine_cavern_coilfang_water : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_serpentshrine_cavern_coilfang_water() : SpellScriptLoader("spell_serpentshrine_cavern_coilfang_water") { }
|
||||
|
||||
class spell_serpentshrine_cavern_coilfang_water_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_serpentshrine_cavern_coilfang_water_AuraScript)
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (InstanceScript* instance = GetUnitOwner()->GetInstanceScript())
|
||||
if (instance->GetBossState(DATA_THE_LURKER_BELOW) != DONE)
|
||||
if (instance->GetData(DATA_ALIVE_KEEPERS) == 0)
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_SCALDING_WATER, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_SCALDING_WATER);
|
||||
}
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*aurEff*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
InstanceScript* instance = GetUnitOwner()->GetInstanceScript();
|
||||
if (!instance || instance->GetBossState(DATA_THE_LURKER_BELOW) == DONE)
|
||||
return;
|
||||
|
||||
isPeriodic = true;
|
||||
amplitude = 8*IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
InstanceScript* instance = GetUnitOwner()->GetInstanceScript();
|
||||
if (!instance || GetUnitOwner()->GetMapId() != 548)
|
||||
{
|
||||
SetDuration(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (instance->GetBossState(DATA_THE_LURKER_BELOW) == DONE || instance->GetData(DATA_ALIVE_KEEPERS) == 0 || GetUnitOwner()->GetPositionZ() > -20.5f || !GetUnitOwner()->IsInWater())
|
||||
return;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_FRENZY_WATER, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_serpentshrine_cavern_coilfang_water_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_serpentshrine_cavern_coilfang_water_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_serpentshrine_cavern_coilfang_water_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_serpentshrine_cavern_coilfang_water_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_serpentshrine_cavern_coilfang_water_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_serpentshrine_cavern()
|
||||
{
|
||||
new instance_serpent_shrine();
|
||||
new spell_serpentshrine_cavern_serpentshrine_parasite();
|
||||
new spell_serpentshrine_cavern_serpentshrine_parasite_trigger();
|
||||
new spell_serpentshrine_cavern_infection();
|
||||
new spell_serpentshrine_cavern_coilfang_water();
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_SERPENT_SHRINE_H
|
||||
#define DEF_SERPENT_SHRINE_H
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_HYDROSS_THE_UNSTABLE = 0,
|
||||
DATA_THE_LURKER_BELOW = 1,
|
||||
DATA_LEOTHERAS_THE_BLIND = 2,
|
||||
DATA_FATHOM_LORD_KARATHRESS = 3,
|
||||
DATA_MOROGRIM_TIDEWALKER = 4,
|
||||
DATA_BRIDGE_EMERGED = 5,
|
||||
DATA_LADY_VASHJ = 6,
|
||||
MAX_ENCOUNTERS = 7,
|
||||
|
||||
DATA_PLATFORM_KEEPER_RESPAWNED = 20,
|
||||
DATA_PLATFORM_KEEPER_DIED = 21,
|
||||
DATA_ALIVE_KEEPERS = 22,
|
||||
DATA_BRIDGE_ACTIVATED = 23,
|
||||
DATA_ACTIVATE_SHIELD = 24,
|
||||
|
||||
|
||||
};
|
||||
|
||||
enum SSNPCs
|
||||
{
|
||||
NPC_HYDROSS_THE_UNSTABLE = 21216,
|
||||
NPC_THE_LURKER_BELOW = 21217,
|
||||
NPC_LEOTHERAS_THE_BLIND = 21215,
|
||||
NPC_CYCLONE_KARATHRESS = 22104,
|
||||
NPC_LADY_VASHJ = 21212,
|
||||
|
||||
NPC_COILFANG_SHATTERER = 21301,
|
||||
NPC_COILFANG_PRIESTESS = 21220,
|
||||
|
||||
NPC_ENCHANTED_ELEMENTAL = 21958,
|
||||
NPC_COILFANG_ELITE = 22055,
|
||||
NPC_COILFANG_STRIDER = 22056,
|
||||
NPC_TAINTED_ELEMENTAL = 22009,
|
||||
NPC_TOXIC_SPOREBAT = 22140,
|
||||
|
||||
GO_LADY_VASHJ_BRIDGE_CONSOLE = 184568,
|
||||
GO_COILFANG_BRIDGE1 = 184203,
|
||||
GO_COILFANG_BRIDGE2 = 184204,
|
||||
GO_COILFANG_BRIDGE3 = 184205,
|
||||
|
||||
GO_SHIELD_GENERATOR1 = 185051,
|
||||
GO_SHIELD_GENERATOR2 = 185052,
|
||||
GO_SHIELD_GENERATOR3 = 185053,
|
||||
GO_SHIELD_GENERATOR4 = 185054
|
||||
};
|
||||
|
||||
enum SSSpells
|
||||
{
|
||||
SPELL_SUMMON_SERPENTSHRINE_PARASITE = 39045,
|
||||
SPELL_RAMPART_INFECTION = 39042,
|
||||
SPELL_SCALDING_WATER = 37284,
|
||||
SPELL_FRENZY_WATER = 37026
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,391 +0,0 @@
|
||||
/*
|
||||
REWRITTEN FROM SCRATCH BY PUSSYWIZARD, IT OWNS NOW!
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "PassiveAI.h"
|
||||
#include "Player.h"
|
||||
#include "Group.h"
|
||||
#include "LFGMgr.h"
|
||||
|
||||
#define GOSSIP_TEXT_ID 15864
|
||||
#define QUEST_SUMMON_AHUNE 11691
|
||||
#define ITEM_MAGMA_TOTEM 34953
|
||||
#define AHUNE_DEFAULT_MODEL 23344
|
||||
#define TEXT_RETREAT "Ahune Retreats. His defenses diminish."
|
||||
#define TEXT_RESURFACE "Ahune will soon resurface."
|
||||
|
||||
const Position AhuneSummonPos = {-97.3473f, -233.139f, -1.27587f, M_PI/2};
|
||||
const Position TotemPos[3] = { {-115.141f, -143.317f, -2.09467f, 4.92772f}, {-120.178f, -144.398f, -2.23786f, 4.92379f}, {-125.277f, -145.463f, -1.95209f, 4.97877f} };
|
||||
const Position MinionSummonPos = {-97.154404f, -204.382675f, -1.19f, M_PI/2};
|
||||
|
||||
enum NPCs
|
||||
{
|
||||
NPC_AHUNE = 25740,
|
||||
NPC_FROZEN_CORE = 25865,
|
||||
NPC_AHUNE_SUMMON_LOC_BUNNY = 25745,
|
||||
NPC_TOTEM = 25961,
|
||||
NPC_TOTEM_BUNNY_1 = 25971,
|
||||
NPC_TOTEM_BUNNY_2 = 25972,
|
||||
NPC_TOTEM_BUNNY_3 = 25973,
|
||||
};
|
||||
|
||||
enum EventSpells
|
||||
{
|
||||
SPELL_STARTING_BEAM = 46593,
|
||||
SPELL_MAKE_BONFIRE = 45930,
|
||||
SPELL_TOTEM_BEAM = 46363,
|
||||
SPELL_SELF_STUN = 46416,
|
||||
SPELL_EMERGE_0 = 66947,
|
||||
SPELL_SUBMERGE_0 = 37550,
|
||||
SPELL_AHUNE_RESURFACES = 46402,
|
||||
|
||||
SPELL_AHUNES_SHIELD = 45954,
|
||||
SPELL_COLD_SLAP = 46198,
|
||||
SPELL_SUMMON_HAILSTONE = 45951,
|
||||
SPELL_SUMMON_COLDWAVE = 45952,
|
||||
SPELL_SUMMON_FROSTWIND = 45953,
|
||||
|
||||
/*
|
||||
SPELL_SUMMON_ICE_SPEAR_BUNNY= 46359, // any dest
|
||||
SPELL_ICE_SPEAR_KNOCKBACK = 46360, // src caster
|
||||
SPELL_ICE_SPEAR_SUMMON_OBJ = 46369,
|
||||
SPELL_ICE_SPEAR_CONTROL_AURA= 46371, // periodic dummy
|
||||
*/
|
||||
};
|
||||
|
||||
enum eEvents
|
||||
{
|
||||
EVENT_EMERGE = 1,
|
||||
EVENT_INVOKER_SAY_1,
|
||||
EVENT_INVOKER_SAY_2,
|
||||
EVENT_INVOKER_SAY_3,
|
||||
EVENT_SUMMON_TOTEMS,
|
||||
EVENT_ATTACK,
|
||||
EVENT_TOTEMS_ATTACK,
|
||||
EVENT_SUBMERGE,
|
||||
EVENT_COMBAT_EMERGE,
|
||||
EVENT_EMERGE_WARNING,
|
||||
|
||||
EVENT_SPELL_COLD_SLAP,
|
||||
EVENT_SPELL_SUMMON_HAILSTONE,
|
||||
EVENT_SPELL_SUMMON_COLDWAVE,
|
||||
};
|
||||
|
||||
class boss_ahune : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_ahune() : CreatureScript("boss_ahune") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new boss_ahuneAI (pCreature);
|
||||
}
|
||||
|
||||
struct boss_ahuneAI : public ScriptedAI
|
||||
{
|
||||
boss_ahuneAI(Creature *c) : ScriptedAI(c), summons(me)
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
SetEquipmentSlots(false, 54806, EQUIP_UNEQUIP, EQUIP_UNEQUIP);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
InvokerGUID = 0;
|
||||
events.Reset();
|
||||
events.RescheduleEvent(EVENT_EMERGE, 12000);
|
||||
events.RescheduleEvent(EVENT_INVOKER_SAY_1, 1000);
|
||||
events.RescheduleEvent(EVENT_SUMMON_TOTEMS, 4000);
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
uint64 InvokerGUID;
|
||||
|
||||
void StartPhase1()
|
||||
{
|
||||
me->CastSpell(me, SPELL_AHUNES_SHIELD, true);
|
||||
events.RescheduleEvent(EVENT_TOTEMS_ATTACK, 80000);
|
||||
events.RescheduleEvent(EVENT_SPELL_COLD_SLAP, 1200);
|
||||
events.RescheduleEvent(EVENT_SPELL_SUMMON_HAILSTONE, 2000);
|
||||
events.RescheduleEvent(EVENT_SPELL_SUMMON_COLDWAVE, 5000);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoZoneInCombat();
|
||||
events.Reset();
|
||||
StartPhase1();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() && !me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch(events.GetEvent())
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case EVENT_EMERGE:
|
||||
me->SetVisible(true);
|
||||
me->CastSpell(me, SPELL_EMERGE_0, false);
|
||||
events.PopEvent();
|
||||
events.RescheduleEvent(EVENT_ATTACK, 2000);
|
||||
break;
|
||||
case EVENT_SUMMON_TOTEMS:
|
||||
for (uint8 i=0; i<3; ++i)
|
||||
DoSummon(NPC_TOTEM, TotemPos[i], 10*60*1000, TEMPSUMMON_TIMED_DESPAWN);
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_INVOKER_SAY_1:
|
||||
if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID))
|
||||
{
|
||||
plr->MonsterSay("The Ice Stone has melted!", LANG_UNIVERSAL, 0);
|
||||
plr->CastSpell(plr, SPELL_MAKE_BONFIRE, true);
|
||||
}
|
||||
events.PopEvent();
|
||||
events.RescheduleEvent(EVENT_INVOKER_SAY_2, 2000);
|
||||
break;
|
||||
case EVENT_INVOKER_SAY_2:
|
||||
if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID))
|
||||
plr->MonsterSay("Ahune, your strength grows no more!", LANG_UNIVERSAL, 0);
|
||||
events.PopEvent();
|
||||
events.RescheduleEvent(EVENT_INVOKER_SAY_3, 2000);
|
||||
break;
|
||||
case EVENT_INVOKER_SAY_3:
|
||||
if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID))
|
||||
plr->MonsterSay("Your frozen reign will not come to pass!", LANG_UNIVERSAL, 0);
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_ATTACK:
|
||||
events.Reset();
|
||||
if (Player* plr = ObjectAccessor::GetPlayer(*me, InvokerGUID))
|
||||
AttackStart(plr);
|
||||
me->SetInCombatWithZone();
|
||||
if (!me->IsInCombat())
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
else
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
break;
|
||||
case EVENT_TOTEMS_ATTACK:
|
||||
for (uint8 i=0; i<3; ++i)
|
||||
if (Creature* bunny = me->FindNearestCreature(NPC_TOTEM_BUNNY_1+i, 150.0f, true))
|
||||
bunny->CastSpell(me, SPELL_TOTEM_BEAM, false);
|
||||
events.PopEvent();
|
||||
events.RescheduleEvent(EVENT_SUBMERGE, 10000);
|
||||
break;
|
||||
case EVENT_SUBMERGE:
|
||||
me->MonsterTextEmote(TEXT_RETREAT, 0, true);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->CastSpell(me, SPELL_SUBMERGE_0, true);
|
||||
me->CastSpell(me, SPELL_SELF_STUN, true);
|
||||
if (Creature* c = DoSummon(NPC_FROZEN_CORE, *me, 24000, TEMPSUMMON_TIMED_DESPAWN))
|
||||
{
|
||||
c->SetHealth(me->GetHealth());
|
||||
}
|
||||
events.Reset();
|
||||
events.RescheduleEvent(EVENT_COMBAT_EMERGE, 25000);
|
||||
events.RescheduleEvent(EVENT_EMERGE_WARNING, 20000);
|
||||
break;
|
||||
case EVENT_EMERGE_WARNING:
|
||||
me->MonsterTextEmote(TEXT_RESURFACE, 0, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_COMBAT_EMERGE:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveAura(SPELL_SELF_STUN);
|
||||
me->CastSpell(me, SPELL_EMERGE_0, false);
|
||||
// me->CastSpell(me, SPELL_AHUNE_RESURFACES, true); // done in SummonedCreatureDespawn
|
||||
me->RemoveAura(SPELL_SUBMERGE_0);
|
||||
events.PopEvent();
|
||||
StartPhase1();
|
||||
break;
|
||||
|
||||
case EVENT_SPELL_COLD_SLAP:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_NEAREST, 0, 5.0f, true))
|
||||
if (target->GetPositionZ() < me->GetPositionZ()+6.0f)
|
||||
{
|
||||
int32 dmg = urand(5500,6000);
|
||||
me->CastCustomSpell(target, SPELL_COLD_SLAP, &dmg, NULL, NULL, false);
|
||||
float x, y, z;
|
||||
target->GetNearPoint(target, x, y, z, target->GetObjectSize(), 30.0f, target->GetAngle(me->GetPositionX(), me->GetPositionY()) + M_PI);
|
||||
target->GetMotionMaster()->MoveJump(x, y, z+20.0f, 10.0f, 20.0f);
|
||||
}
|
||||
events.RepeatEvent(1500);
|
||||
break;
|
||||
case EVENT_SPELL_SUMMON_HAILSTONE:
|
||||
{
|
||||
float dist = (float)urand(3,10);
|
||||
float angle = rand_norm()*2*M_PI;
|
||||
me->CastSpell(MinionSummonPos.GetPositionX()+cos(angle)*dist, MinionSummonPos.GetPositionY()+sin(angle)*dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_HAILSTONE, false);
|
||||
events.RepeatEvent(30000);
|
||||
}
|
||||
break;
|
||||
case EVENT_SPELL_SUMMON_COLDWAVE:
|
||||
for (uint8 i=0; i<2; ++i)
|
||||
{
|
||||
float dist = (float)urand(3,10);
|
||||
float angle = rand_norm()*2*M_PI;
|
||||
me->CastSpell(MinionSummonPos.GetPositionX()+cos(angle)*dist, MinionSummonPos.GetPositionY()+sin(angle)*dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_COLDWAVE, false);
|
||||
}
|
||||
{
|
||||
float dist = (float)urand(3,10);
|
||||
float angle = rand_norm()*2*M_PI;
|
||||
me->CastSpell(MinionSummonPos.GetPositionX()+cos(angle)*dist, MinionSummonPos.GetPositionY()+sin(angle)*dist, MinionSummonPos.GetPositionZ(), SPELL_SUMMON_FROSTWIND, false);
|
||||
}
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
|
||||
default:
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
me->DespawnOrUnsummon(1);
|
||||
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
if (summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* summon)
|
||||
{
|
||||
if (summon && summon->GetEntry() == NPC_FROZEN_CORE)
|
||||
{
|
||||
if (summon->GetHealth() > 0)
|
||||
{
|
||||
me->SetHealth(summon->GetHealth());
|
||||
summon->CastSpell(summon, SPELL_AHUNE_RESURFACES, true);
|
||||
}
|
||||
else
|
||||
Unit::Kill(me, me, false);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
summons.DespawnAll();
|
||||
me->DespawnOrUnsummon(15000);
|
||||
if (GameObject* chest = me->SummonGameObject(187892, MinionSummonPos.GetPositionX(), MinionSummonPos.GetPositionY(), MinionSummonPos.GetPositionZ(), M_PI/2, 0.0f, 0.0f, 0.0f, 0.0f, 900000000)) // loot
|
||||
me->RemoveGameObject(chest, false);
|
||||
|
||||
bool finished = false;
|
||||
Map::PlayerList const& players = me->GetMap()->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = players.begin(); i != players.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
{
|
||||
player->UpdateAchievementCriteria(ACHIEVEMENT_CRITERIA_TYPE_KILL_CREATURE, 25740, 1, me);
|
||||
|
||||
if (player->GetGroup() && !finished)
|
||||
{
|
||||
finished = true;
|
||||
sLFGMgr->FinishDungeon(player->GetGroup()->GetGUID(), 286, me->FindMap());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class go_ahune_ice_stone : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_ahune_ice_stone() : GameObjectScript("go_ahune_ice_stone") { }
|
||||
|
||||
bool OnGossipHello(Player *pPlayer, GameObject *pGO)
|
||||
{
|
||||
if (!pPlayer || !pGO)
|
||||
return true;
|
||||
if (!pPlayer->HasItemCount(ITEM_MAGMA_TOTEM))
|
||||
return true;
|
||||
if (Creature* c = pGO->FindNearestCreature(NPC_AHUNE, 200.0f, true))
|
||||
return true;
|
||||
|
||||
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Disturb the stone and summon Lord Ahune.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1337);
|
||||
pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_ID, pGO->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player *pPlayer, GameObject *pGO, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
if (!pPlayer || !pGO)
|
||||
return true;
|
||||
if (action != GOSSIP_ACTION_INFO_DEF+1337)
|
||||
return true;
|
||||
if (!pPlayer->HasItemCount(ITEM_MAGMA_TOTEM))
|
||||
return true;
|
||||
if (Creature* c = pGO->FindNearestCreature(NPC_AHUNE, 200.0f, true))
|
||||
return true;
|
||||
|
||||
if (Creature* c = pGO->SummonCreature(NPC_AHUNE, AhuneSummonPos, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
{
|
||||
pPlayer->DestroyItemCount(ITEM_MAGMA_TOTEM, 1, true, false);
|
||||
pPlayer->AreaExploredOrEventHappens(QUEST_SUMMON_AHUNE); // auto rewarded
|
||||
|
||||
c->SetVisible(false);
|
||||
c->SetDisplayId(AHUNE_DEFAULT_MODEL);
|
||||
c->SetFloatValue(UNIT_FIELD_COMBATREACH, 18.0f);
|
||||
CAST_AI(boss_ahune::boss_ahuneAI, c->AI())->InvokerGUID = pPlayer->GetGUID();
|
||||
if (Creature* bunny = pGO->SummonCreature(NPC_AHUNE_SUMMON_LOC_BUNNY, AhuneSummonPos, TEMPSUMMON_TIMED_DESPAWN, 12000))
|
||||
if (Creature* crystal_trigger = pGO->SummonCreature(WORLD_TRIGGER, pGO->GetPositionX(), pGO->GetPositionY(), 5.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 12000))
|
||||
crystal_trigger->CastSpell(bunny, SPELL_STARTING_BEAM, false);
|
||||
}
|
||||
|
||||
pPlayer->CLOSE_GOSSIP_MENU();
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class npc_ahune_frozen_core : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_ahune_frozen_core() : CreatureScript("npc_ahune_frozen_core") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* pCreature) const
|
||||
{
|
||||
return new npc_ahune_frozen_coreAI (pCreature);
|
||||
}
|
||||
|
||||
struct npc_ahune_frozen_coreAI : public NullCreatureAI
|
||||
{
|
||||
npc_ahune_frozen_coreAI(Creature *c) : NullCreatureAI(c) {}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_ahune()
|
||||
{
|
||||
new go_ahune_ice_stone();
|
||||
new boss_ahune();
|
||||
new npc_ahune_frozen_core();
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "steam_vault.h"
|
||||
|
||||
enum HydromancerThespia
|
||||
{
|
||||
SAY_SUMMON = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_DEAD = 3,
|
||||
|
||||
SPELL_LIGHTNING_CLOUD = 25033,
|
||||
SPELL_LUNG_BURST = 31481,
|
||||
SPELL_ENVELOPING_WINDS = 31718,
|
||||
|
||||
EVENT_SPELL_LIGHTNING = 1,
|
||||
EVENT_SPELL_LUNG = 2,
|
||||
EVENT_SPELL_ENVELOPING = 3
|
||||
};
|
||||
|
||||
class boss_hydromancer_thespia : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_hydromancer_thespia() : CreatureScript("boss_hydromancer_thespia") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_thespiaAI (creature);
|
||||
}
|
||||
|
||||
struct boss_thespiaAI : public ScriptedAI
|
||||
{
|
||||
boss_thespiaAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
if (instance)
|
||||
instance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEAD);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_HYDROMANCER_THESPIA, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_SPELL_LIGHTNING, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_LUNG, 7000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENVELOPING, 9000);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_LIGHTNING:
|
||||
for (uint8 i = 0; i < DUNGEON_MODE(1, 2); ++i)
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_LIGHTNING_CLOUD, false);
|
||||
events.RepeatEvent(urand(15000, 25000));
|
||||
break;
|
||||
case EVENT_SPELL_LUNG:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
DoCast(target, SPELL_LUNG_BURST);
|
||||
events.RepeatEvent(urand(7000, 12000));
|
||||
break;
|
||||
case EVENT_SPELL_ENVELOPING:
|
||||
for (uint8 i = 0; i < DUNGEON_MODE(1, 2); ++i)
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_ENVELOPING_WINDS, false);
|
||||
events.RepeatEvent(urand(10000, 15000));
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_hydromancer_thespia()
|
||||
{
|
||||
new boss_hydromancer_thespia();
|
||||
}
|
||||
@@ -1,201 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "steam_vault.h"
|
||||
|
||||
enum MekgineerSteamrigger
|
||||
{
|
||||
SAY_MECHANICS = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_DEATH = 3,
|
||||
|
||||
SPELL_SUPER_SHRINK_RAY = 31485,
|
||||
SPELL_SAW_BLADE = 31486,
|
||||
SPELL_ELECTRIFIED_NET = 35107,
|
||||
SPELL_REPAIR_N = 31532,
|
||||
SPELL_REPAIR_H = 37936,
|
||||
|
||||
NPC_STREAMRIGGER_MECHANIC = 17951,
|
||||
|
||||
EVENT_CHECK_HP25 = 1,
|
||||
EVENT_CHECK_HP50 = 2,
|
||||
EVENT_CHECK_HP75 = 3,
|
||||
EVENT_SPELL_SHRINK = 4,
|
||||
EVENT_SPELL_SAW = 5,
|
||||
EVENT_SPELL_NET = 6
|
||||
|
||||
};
|
||||
|
||||
class boss_mekgineer_steamrigger : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_mekgineer_steamrigger() : CreatureScript("boss_mekgineer_steamrigger") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_mekgineer_steamriggerAI (creature);
|
||||
}
|
||||
|
||||
struct boss_mekgineer_steamriggerAI : public ScriptedAI
|
||||
{
|
||||
boss_mekgineer_steamriggerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_SPELL_SHRINK, 20000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SAW, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_NET, 10000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HP75, 5000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HP50, 5000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HP25, 5000);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void SummonMechanics()
|
||||
{
|
||||
Talk(SAY_MECHANICS);
|
||||
|
||||
me->SummonCreature(NPC_STREAMRIGGER_MECHANIC, me->GetPositionX()+15.0f, me->GetPositionY()+15.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
me->SummonCreature(NPC_STREAMRIGGER_MECHANIC, me->GetPositionX()-15.0f, me->GetPositionY()+15.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
me->SummonCreature(NPC_STREAMRIGGER_MECHANIC, me->GetPositionX()-15.0f, me->GetPositionY()-15.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
if (urand(0,1))
|
||||
me->SummonCreature(NPC_STREAMRIGGER_MECHANIC, me->GetPositionX()+15.0f, me->GetPositionY()-15.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* cr)
|
||||
{
|
||||
cr->GetMotionMaster()->MoveFollow(me, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (uint32 eventId = events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHRINK:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SUPER_SHRINK_RAY, false);
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
case EVENT_SPELL_SAW:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
me->CastSpell(target, SPELL_SAW_BLADE, false);
|
||||
else
|
||||
me->CastSpell(me->GetVictim(), SPELL_SAW_BLADE, false);
|
||||
events.RepeatEvent(15000);
|
||||
break;
|
||||
case EVENT_SPELL_NET:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_ELECTRIFIED_NET, false);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case EVENT_CHECK_HP25:
|
||||
case EVENT_CHECK_HP50:
|
||||
case EVENT_CHECK_HP75:
|
||||
if (me->HealthBelowPct(eventId*25))
|
||||
{
|
||||
SummonMechanics();
|
||||
events.PopEvent();
|
||||
return;
|
||||
}
|
||||
events.RepeatEvent(2000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class npc_steamrigger_mechanic : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_steamrigger_mechanic() : CreatureScript("npc_steamrigger_mechanic") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_steamrigger_mechanicAI (creature);
|
||||
}
|
||||
|
||||
struct npc_steamrigger_mechanicAI : public ScriptedAI
|
||||
{
|
||||
npc_steamrigger_mechanicAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
uint32 repairTimer;
|
||||
uint64 bossGUID;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
repairTimer = 0;
|
||||
bossGUID = 0;
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
bossGUID = instance->GetData64(TYPE_MEKGINEER_STEAMRIGGER);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
repairTimer += diff;
|
||||
if (repairTimer >= 2000)
|
||||
{
|
||||
repairTimer = 0;
|
||||
if (Unit* boss = ObjectAccessor::GetUnit(*me, bossGUID))
|
||||
{
|
||||
if (me->IsWithinDistInMap(boss, 13.0f))
|
||||
if (!me->HasUnitState(UNIT_STATE_CASTING))
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_REPAIR_N, SPELL_REPAIR_H), false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_mekgineer_steamrigger()
|
||||
{
|
||||
new boss_mekgineer_steamrigger();
|
||||
new npc_steamrigger_mechanic();
|
||||
}
|
||||
@@ -1,175 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "steam_vault.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
enum NagaDistiller
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_REGEN = 1,
|
||||
SAY_AGGRO = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_DEATH = 4,
|
||||
|
||||
SPELL_SPELL_REFLECTION = 31534,
|
||||
SPELL_IMPALE = 39061,
|
||||
SPELL_WARLORDS_RAGE = 37081,
|
||||
SPELL_WARLORDS_RAGE_NAGA = 31543,
|
||||
SPELL_WARLORDS_RAGE_PROC = 36453,
|
||||
|
||||
NPC_NAGA_DISTILLER = 17954,
|
||||
|
||||
EVENT_SPELL_REFLECTION = 1,
|
||||
EVENT_SPELL_IMPALE = 2,
|
||||
EVENT_SPELL_RAGE = 3
|
||||
};
|
||||
|
||||
class boss_warlord_kalithresh : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_warlord_kalithresh() : CreatureScript("boss_warlord_kalithresh") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_warlord_kalithreshAI (creature);
|
||||
}
|
||||
|
||||
struct boss_warlord_kalithreshAI : public ScriptedAI
|
||||
{
|
||||
boss_warlord_kalithreshAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
if (instance)
|
||||
instance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_SPELL_REFLECTION, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_IMPALE, urand(7000, 14000));
|
||||
events.ScheduleEvent(EVENT_SPELL_RAGE, 20000);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_WARLORD_KALITHRESH, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_REFLECTION:
|
||||
me->CastSpell(me, SPELL_SPELL_REFLECTION, false);
|
||||
events.RepeatEvent(urand(15000, 20000));
|
||||
break;
|
||||
case EVENT_SPELL_IMPALE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f, true))
|
||||
me->CastSpell(target, SPELL_IMPALE, false);
|
||||
events.RepeatEvent(urand(7500, 12500));
|
||||
break;
|
||||
case EVENT_SPELL_RAGE:
|
||||
if (Creature* distiller = me->FindNearestCreature(NPC_NAGA_DISTILLER, 100.0f))
|
||||
{
|
||||
Talk(SAY_REGEN);
|
||||
//me->CastSpell(me, SPELL_WARLORDS_RAGE, false);
|
||||
distiller->AI()->DoAction(1);
|
||||
}
|
||||
events.RepeatEvent(45000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class npc_naga_distiller : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_naga_distiller() : CreatureScript("npc_naga_distiller") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_naga_distillerAI (creature);
|
||||
}
|
||||
|
||||
struct npc_naga_distillerAI : public NullCreatureAI
|
||||
{
|
||||
npc_naga_distillerAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
uint32 spellTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
spellTimer = 0;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param != 1)
|
||||
return;
|
||||
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->CastSpell(me, SPELL_WARLORDS_RAGE_NAGA, true);
|
||||
spellTimer = 1;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (spellTimer)
|
||||
{
|
||||
spellTimer += diff;
|
||||
if (spellTimer >= 12000)
|
||||
{
|
||||
if (Creature* kali = me->FindNearestCreature(NPC_WARLORD_KALITHRESH, 100.0f))
|
||||
kali->CastSpell(kali, SPELL_WARLORDS_RAGE_PROC, true);
|
||||
Unit::Kill(me, me);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_warlord_kalithresh()
|
||||
{
|
||||
new boss_warlord_kalithresh();
|
||||
new npc_naga_distiller();
|
||||
}
|
||||
@@ -1,213 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "steam_vault.h"
|
||||
|
||||
class go_main_chambers_access_panel : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_main_chambers_access_panel() : GameObjectScript("go_main_chambers_access_panel") { }
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go)
|
||||
{
|
||||
InstanceScript* instance = go->GetInstanceScript();
|
||||
if (!instance)
|
||||
return false;
|
||||
|
||||
if (go->GetEntry() == GO_ACCESS_PANEL_HYDRO)
|
||||
if (instance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE)
|
||||
{
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
instance->SetData(TYPE_HYDROMANCER_THESPIA, SPECIAL);
|
||||
}
|
||||
|
||||
if (go->GetEntry() == GO_ACCESS_PANEL_MEK)
|
||||
if (instance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE)
|
||||
{
|
||||
go->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
instance->SetData(TYPE_MEKGINEER_STEAMRIGGER, SPECIAL);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
class instance_steam_vault : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_steam_vault() : InstanceMapScript("instance_steam_vault", 545) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_steam_vault_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_steam_vault_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_steam_vault_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
uint64 MekgineerGUID;
|
||||
uint64 MainChambersDoor;
|
||||
uint64 AccessPanelHydro;
|
||||
uint64 AccessPanelMek;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
MekgineerGUID = 0;
|
||||
MainChambersDoor = 0;
|
||||
AccessPanelHydro = 0;
|
||||
AccessPanelMek = 0;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_MEKGINEER_STEAMRIGGER: MekgineerGUID = creature->GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_MAIN_CHAMBERS_DOOR:
|
||||
MainChambersDoor = go->GetGUID();
|
||||
if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL && GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
case GO_ACCESS_PANEL_HYDRO:
|
||||
AccessPanelHydro = go->GetGUID();
|
||||
if (GetData(TYPE_HYDROMANCER_THESPIA) == DONE)
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
else if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
case GO_ACCESS_PANEL_MEK:
|
||||
AccessPanelMek = go->GetGUID();
|
||||
if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE)
|
||||
go->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
else if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_HYDROMANCER_THESPIA:
|
||||
if (data == SPECIAL)
|
||||
{
|
||||
if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)
|
||||
HandleGameObject(MainChambersDoor, true);
|
||||
}
|
||||
else if (data == DONE)
|
||||
{
|
||||
if (GameObject* panel = instance->GetGameObject(AccessPanelHydro))
|
||||
panel->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
m_auiEncounter[type] = data;
|
||||
break;
|
||||
case TYPE_MEKGINEER_STEAMRIGGER:
|
||||
if (data == SPECIAL)
|
||||
{
|
||||
if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)
|
||||
HandleGameObject(MainChambersDoor, true);
|
||||
}
|
||||
else if (data == DONE)
|
||||
{
|
||||
if (GameObject* panel = instance->GetGameObject(AccessPanelMek))
|
||||
panel->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
|
||||
m_auiEncounter[type] = data;
|
||||
break;
|
||||
case TYPE_WARLORD_KALITHRESH:
|
||||
m_auiEncounter[type] = data;
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE || data == SPECIAL)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_HYDROMANCER_THESPIA:
|
||||
case TYPE_MEKGINEER_STEAMRIGGER:
|
||||
case TYPE_WARLORD_KALITHRESH:
|
||||
return m_auiEncounter[type];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 data) const
|
||||
{
|
||||
if (data == TYPE_MEKGINEER_STEAMRIGGER)
|
||||
return MekgineerGUID;
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream stream;
|
||||
stream << "S V " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' ' << m_auiEncounter[2] << ' ' << m_auiEncounter[3];
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return stream.str();
|
||||
}
|
||||
|
||||
void Load(const char* strIn)
|
||||
{
|
||||
if (!strIn)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(strIn);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'S' && dataHead2 == 'V')
|
||||
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;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_instance_steam_vault()
|
||||
{
|
||||
new go_main_chambers_access_panel();
|
||||
new instance_steam_vault();
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_STEAM_VAULT_H
|
||||
#define DEF_STEAM_VAULT_H
|
||||
|
||||
enum steamVault
|
||||
{
|
||||
TYPE_HYDROMANCER_THESPIA = 0,
|
||||
TYPE_MEKGINEER_STEAMRIGGER = 1,
|
||||
TYPE_WARLORD_KALITHRESH = 2,
|
||||
MAX_ENCOUNTER = 3
|
||||
};
|
||||
|
||||
enum steamVaultNPCGO
|
||||
{
|
||||
GO_MAIN_CHAMBERS_DOOR = 183049,
|
||||
GO_ACCESS_PANEL_HYDRO = 184125,
|
||||
GO_ACCESS_PANEL_MEK = 184126,
|
||||
|
||||
NPC_MEKGINEER_STEAMRIGGER = 17796,
|
||||
NPC_WARLORD_KALITHRESH = 17798,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
/*
|
||||
* Copyright (C)
|
||||
* Copyright (C)
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/* ScriptData
|
||||
SDName: Boss_the_black_stalker
|
||||
SD%Complete: 95
|
||||
SDComment: Timers may be incorrect
|
||||
SDCategory: Coilfang Resevoir, Underbog
|
||||
EndScriptData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum eBlackStalker
|
||||
{
|
||||
SPELL_LEVITATE = 31704,
|
||||
SPELL_SUSPENSION = 31719,
|
||||
SPELL_LEVITATION_PULSE = 31701,
|
||||
SPELL_MAGNETIC_PULL = 31705,
|
||||
SPELL_CHAIN_LIGHTNING = 31717,
|
||||
SPELL_STATIC_CHARGE = 31715,
|
||||
SPELL_SUMMON_SPORE_STRIDER = 38755,
|
||||
|
||||
EVENT_LEVITATE = 1,
|
||||
EVENT_SPELL_CHAIN = 2,
|
||||
EVENT_SPELL_STATIC = 3,
|
||||
EVENT_SPELL_SPORES = 4,
|
||||
EVENT_CHECK = 5,
|
||||
EVENT_LEVITATE_TARGET_1 = 6,
|
||||
EVENT_LEVITATE_TARGET_2 = 7,
|
||||
|
||||
ENTRY_SPORE_STRIDER = 22299
|
||||
};
|
||||
|
||||
class boss_the_black_stalker : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_the_black_stalker() : CreatureScript("boss_the_black_stalker") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_the_black_stalkerAI (creature);
|
||||
}
|
||||
|
||||
struct boss_the_black_stalkerAI : public ScriptedAI
|
||||
{
|
||||
boss_the_black_stalkerAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
uint64 lTarget;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
lTarget = 0;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_LEVITATE, 12000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CHAIN, 6000);
|
||||
events.ScheduleEvent(EVENT_SPELL_STATIC, 10000);
|
||||
events.ScheduleEvent(EVENT_CHECK, 5000);
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SPELL_SPORES, urand(10000, 15000));
|
||||
}
|
||||
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
summon->AI()->AttackStart(target);
|
||||
else if (me->GetVictim())
|
||||
summon->AI()->AttackStart(me->GetVictim());
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit*)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
me->CastSpell(me, SPELL_SUMMON_SPORE_STRIDER, false);
|
||||
}
|
||||
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_CHECK:
|
||||
float x, y, z, o;
|
||||
me->GetHomePosition(x, y, z, o);
|
||||
if (!me->IsWithinDist3d(x, y, z, 60))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
case EVENT_SPELL_SPORES:
|
||||
me->CastSpell(me, SPELL_SUMMON_SPORE_STRIDER, false);
|
||||
events.RepeatEvent(urand(10000, 15000));
|
||||
break;
|
||||
case EVENT_SPELL_CHAIN:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
|
||||
events.DelayEvents(3000);
|
||||
events.RepeatEvent(9000);
|
||||
break;
|
||||
case EVENT_SPELL_STATIC:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, true))
|
||||
me->CastSpell(target, SPELL_STATIC_CHARGE, false);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case EVENT_LEVITATE:
|
||||
events.RepeatEvent(15000);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
{
|
||||
me->CastSpell(target, SPELL_LEVITATE, false);
|
||||
lTarget = target->GetGUID();
|
||||
events.DelayEvents(5000);
|
||||
events.ScheduleEvent(EVENT_LEVITATE_TARGET_1, 2000);
|
||||
}
|
||||
break;
|
||||
case EVENT_LEVITATE_TARGET_1:
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, lTarget))
|
||||
{
|
||||
if (!target->HasAura(SPELL_LEVITATE))
|
||||
lTarget = 0;
|
||||
else
|
||||
{
|
||||
target->CastSpell(target, SPELL_MAGNETIC_PULL, true);
|
||||
events.ScheduleEvent(EVENT_LEVITATE_TARGET_2, 1500);
|
||||
}
|
||||
}
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_LEVITATE_TARGET_2:
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, lTarget))
|
||||
{
|
||||
if (!target->HasAura(SPELL_LEVITATE))
|
||||
lTarget = 0;
|
||||
else
|
||||
{
|
||||
target->AddAura(SPELL_SUSPENSION, target);
|
||||
lTarget = 0;
|
||||
}
|
||||
}
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_gen_allergies : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gen_allergies() : SpellScriptLoader("spell_gen_allergies") { }
|
||||
|
||||
class spell_gen_allergies_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gen_allergies_AuraScript);
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
isPeriodic = true;
|
||||
amplitude = urand(10*IN_MILLISECONDS, 200*IN_MILLISECONDS);
|
||||
}
|
||||
|
||||
void Update(AuraEffect* effect)
|
||||
{
|
||||
SetDuration(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_gen_allergies_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_gen_allergies_AuraScript::Update, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_gen_allergies_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_the_black_stalker()
|
||||
{
|
||||
new boss_the_black_stalker();
|
||||
new spell_gen_allergies();
|
||||
}
|
||||
Reference in New Issue
Block a user