mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-16 18:40:28 +00:00
Big re-organization of repository [W.I.P]
This commit is contained in:
@@ -1,249 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum ExarchMaladaar
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_SUMMON = 1,
|
||||
SAY_AGGRO = 2,
|
||||
SAY_ROAR = 3,
|
||||
SAY_SLAY = 4,
|
||||
SAY_DEATH = 5,
|
||||
|
||||
SPELL_RIBBON_OF_SOULS = 32422,
|
||||
SPELL_SOUL_SCREAM = 32421,
|
||||
SPELL_STOLEN_SOUL = 32346,
|
||||
SPELL_STOLEN_SOUL_VISUAL = 32395,
|
||||
SPELL_SUMMON_AVATAR = 32424,
|
||||
|
||||
ENTRY_STOLEN_SOUL = 18441,
|
||||
|
||||
EVENT_SPELL_FEAR = 1,
|
||||
EVENT_SPELL_RIBBON = 2,
|
||||
EVENT_SPELL_SOUL = 3,
|
||||
EVENT_CHECK_HEALTH = 4
|
||||
};
|
||||
|
||||
class boss_exarch_maladaar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_exarch_maladaar() : CreatureScript("boss_exarch_maladaar") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_exarch_maladaarAI (creature);
|
||||
}
|
||||
|
||||
struct boss_exarch_maladaarAI : public ScriptedAI
|
||||
{
|
||||
boss_exarch_maladaarAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
_talked = false;
|
||||
}
|
||||
|
||||
bool _talked;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!_talked && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 150.0f))
|
||||
{
|
||||
Talk(SAY_INTRO);
|
||||
_talked = true;
|
||||
}
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_FEAR, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_RIBBON, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SOUL, 25000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 5000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (urand(0,1))
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
//When Exarch Maladar is defeated D'ore appear.
|
||||
me->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (HealthBelowPct(25))
|
||||
{
|
||||
Talk(SAY_SUMMON);
|
||||
me->CastSpell(me, SPELL_SUMMON_AVATAR, false);
|
||||
events.PopEvent();
|
||||
return;
|
||||
}
|
||||
events.RepeatEvent(2000);
|
||||
break;
|
||||
case EVENT_SPELL_SOUL:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
{
|
||||
Talk(SAY_ROAR);
|
||||
me->CastSpell(target, SPELL_STOLEN_SOUL, false);
|
||||
if (Creature* summon = me->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000))
|
||||
{
|
||||
summon->CastSpell(summon, SPELL_STOLEN_SOUL_VISUAL, false);
|
||||
summon->SetDisplayId(target->GetDisplayId());
|
||||
summon->AI()->DoAction(target->getClass());
|
||||
summon->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
events.RepeatEvent(urand(25000, 30000));
|
||||
break;
|
||||
case EVENT_SPELL_RIBBON:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_RIBBON_OF_SOULS, false);
|
||||
events.RepeatEvent(urand(10000, 20000));
|
||||
break;
|
||||
case EVENT_SPELL_FEAR:
|
||||
me->CastSpell(me, SPELL_SOUL_SCREAM, false);
|
||||
events.RepeatEvent(urand(15000, 25000));
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
enum stolenSoul
|
||||
{
|
||||
SPELL_MOONFIRE = 37328,
|
||||
SPELL_FIREBALL = 37329,
|
||||
SPELL_MIND_FLAY = 37330,
|
||||
SPELL_HEMORRHAGE = 37331,
|
||||
SPELL_FROSTSHOCK = 37332,
|
||||
SPELL_CURSE_OF_AGONY = 37334,
|
||||
SPELL_MORTAL_STRIKE = 37335,
|
||||
SPELL_FREEZING_TRAP = 37368,
|
||||
SPELL_HAMMER_OF_JUSTICE = 37369,
|
||||
SPELL_PLAGUE_STRIKE = 58839,
|
||||
|
||||
EVENT_STOLEN_SOUL_SPELL = 1,
|
||||
};
|
||||
|
||||
class npc_stolen_soul : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_stolen_soul() : CreatureScript("npc_stolen_soul") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_stolen_soulAI (creature);
|
||||
}
|
||||
|
||||
struct npc_stolen_soulAI : public ScriptedAI
|
||||
{
|
||||
npc_stolen_soulAI(Creature* creature) : ScriptedAI(creature) {}
|
||||
|
||||
uint8 myClass;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
myClass = CLASS_WARRIOR;
|
||||
events.ScheduleEvent(EVENT_STOLEN_SOUL_SPELL, 1000);
|
||||
}
|
||||
|
||||
void DoAction(int32 pClass)
|
||||
{
|
||||
myClass = pClass;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (events.GetEvent() == EVENT_STOLEN_SOUL_SPELL)
|
||||
{
|
||||
switch (myClass)
|
||||
{
|
||||
case CLASS_WARRIOR:
|
||||
me->CastSpell(me->GetVictim(), SPELL_MORTAL_STRIKE, false);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
case CLASS_PALADIN:
|
||||
me->CastSpell(me->GetVictim(), SPELL_HAMMER_OF_JUSTICE, false);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
case CLASS_HUNTER:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FREEZING_TRAP, false);
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
case CLASS_ROGUE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_HEMORRHAGE, false);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case CLASS_PRIEST:
|
||||
me->CastSpell(me->GetVictim(), SPELL_MIND_FLAY, false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
case CLASS_SHAMAN:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FROSTSHOCK, false);
|
||||
events.RepeatEvent(8000);
|
||||
break;
|
||||
case CLASS_MAGE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FIREBALL, false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
case CLASS_WARLOCK:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CURSE_OF_AGONY, false);
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
case CLASS_DRUID:
|
||||
me->CastSpell(me->GetVictim(), SPELL_MOONFIRE, false);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case CLASS_DEATH_KNIGHT:
|
||||
me->CastSpell(me->GetVictim(), SPELL_PLAGUE_STRIKE, false);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_exarch_maladaar()
|
||||
{
|
||||
new boss_exarch_maladaar();
|
||||
new npc_stolen_soul();
|
||||
}
|
||||
@@ -1,224 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum eShirrak
|
||||
{
|
||||
|
||||
SPELL_INHIBIT_MAGIC = 32264,
|
||||
SPELL_ATTRACT_MAGIC = 32265,
|
||||
SPELL_CARNIVOROUS_BITE_N = 36383,
|
||||
SPELL_CARNIVOROUS_BITE_H = 39382,
|
||||
|
||||
SPELL_FIERY_BLAST_N = 32302,
|
||||
SPELL_FIERY_BLAST_H = 38382,
|
||||
SPELL_FOCUS_FIRE_VISUAL = 32286,
|
||||
SPELL_FOCUS_CAST = 32300,
|
||||
|
||||
EVENT_SPELL_INHIBIT_MAGIC = 1,
|
||||
EVENT_SPELL_ATTRACT_MAGIC = 2,
|
||||
EVENT_SPELL_CARNIVOROUS = 3,
|
||||
EVENT_SPELL_FOCUS_FIRE = 4,
|
||||
EVENT_SPELL_FOCUS_FIRE_2 = 5,
|
||||
EVENT_SPELL_FOCUS_FIRE_3 = 6,
|
||||
|
||||
ENTRY_FOCUS_FIRE = 18374,
|
||||
|
||||
EMOTE_FOCUSED = 0
|
||||
};
|
||||
|
||||
class boss_shirrak_the_dead_watcher : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_shirrak_the_dead_watcher() : CreatureScript("boss_shirrak_the_dead_watcher") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_shirrak_the_dead_watcherAI (creature);
|
||||
}
|
||||
|
||||
struct boss_shirrak_the_dead_watcherAI : public ScriptedAI
|
||||
{
|
||||
boss_shirrak_the_dead_watcherAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
uint64 focusGUID;
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
focusGUID = 0;
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_INHIBIT_MAGIC, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_ATTRACT_MAGIC, 28000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CARNIVOROUS, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE, 17000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summon->CastSpell(summon, SPELL_FOCUS_FIRE_VISUAL, true);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Id == SPELL_FOCUS_CAST)
|
||||
target->CastSpell(target, DUNGEON_MODE(SPELL_FIERY_BLAST_N, SPELL_FIERY_BLAST_H), false);
|
||||
}
|
||||
|
||||
uint8 getStackCount(float dist)
|
||||
{
|
||||
if (dist < 15)
|
||||
return 4;
|
||||
if (dist < 25)
|
||||
return 3;
|
||||
if (dist < 35)
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events.Update(diff);
|
||||
uint32 eventId = events.GetEvent();
|
||||
|
||||
if (eventId == EVENT_SPELL_INHIBIT_MAGIC)
|
||||
{
|
||||
Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
{
|
||||
float dist = me->GetDistance(player);
|
||||
if (player->IsAlive() && dist < 45.0f)
|
||||
{
|
||||
Aura* aura = player->GetAura(SPELL_INHIBIT_MAGIC);
|
||||
if (!aura)
|
||||
aura = me->AddAura(SPELL_INHIBIT_MAGIC, player);
|
||||
else
|
||||
aura->RefreshDuration();
|
||||
|
||||
if (aura)
|
||||
aura->SetStackAmount(getStackCount(dist));
|
||||
}
|
||||
else
|
||||
player->RemoveAurasDueToSpell(SPELL_INHIBIT_MAGIC);
|
||||
}
|
||||
events.RepeatEvent(3000);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SPELL_ATTRACT_MAGIC:
|
||||
me->CastSpell(me, SPELL_ATTRACT_MAGIC, false);
|
||||
events.RepeatEvent(30000);
|
||||
events.RescheduleEvent(EVENT_SPELL_CARNIVOROUS, 1500);
|
||||
break;
|
||||
case EVENT_SPELL_CARNIVOROUS:
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_CARNIVOROUS_BITE_N, SPELL_CARNIVOROUS_BITE_H), false);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case EVENT_SPELL_FOCUS_FIRE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true))
|
||||
{
|
||||
if (Creature* cr = me->SummonCreature(ENTRY_FOCUS_FIRE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 7000))
|
||||
focusGUID = cr->GetGUID();
|
||||
Talk(EMOTE_FOCUSED, target);
|
||||
}
|
||||
events.RepeatEvent(urand(15000, 20000));
|
||||
events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_2, 3000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_2, 3500);
|
||||
events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_2, 4000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FOCUS_FIRE_3, 5000);
|
||||
me->SetControlled(true, UNIT_STATE_ROOT);
|
||||
break;
|
||||
case EVENT_SPELL_FOCUS_FIRE_2:
|
||||
if (Unit* flare = ObjectAccessor::GetCreature(*me, focusGUID))
|
||||
me->CastSpell(flare, SPELL_FOCUS_CAST, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_SPELL_FOCUS_FIRE_3:
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_auchenai_possess : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_auchenai_possess() : SpellScriptLoader("spell_auchenai_possess") { }
|
||||
|
||||
class spell_auchenai_possess_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_auchenai_possess_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* target = GetTarget())
|
||||
caster->CastSpell(target, 32830 /*POSSESS*/, true);
|
||||
}
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
isPeriodic = true;
|
||||
amplitude = 2000;
|
||||
}
|
||||
|
||||
void Update(AuraEffect* effect)
|
||||
{
|
||||
// Xinef: Charm is removed when target is at or below 50%hp
|
||||
if (Unit* owner = GetUnitOwner())
|
||||
if (owner->GetHealthPct() <= 50)
|
||||
SetDuration(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
// Base channel
|
||||
if (m_scriptSpellId == 33401)
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_auchenai_possess_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
else
|
||||
{
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_auchenai_possess_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_MOD_CHARM);
|
||||
OnEffectUpdatePeriodic += AuraEffectUpdatePeriodicFn(spell_auchenai_possess_AuraScript::Update, EFFECT_0, SPELL_AURA_MOD_CHARM);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_auchenai_possess_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_shirrak_the_dead_watcher()
|
||||
{
|
||||
new boss_shirrak_the_dead_watcher();
|
||||
new spell_auchenai_possess();
|
||||
}
|
||||
@@ -1,161 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum ePrince
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_SUMMON = 3,
|
||||
SAY_DEAD = 4,
|
||||
|
||||
SPELL_BLINK = 34605,
|
||||
SPELL_FROSTBOLT = 32364,
|
||||
SPELL_FIREBALL = 32363,
|
||||
SPELL_FROSTNOVA = 32365,
|
||||
|
||||
SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON
|
||||
SPELL_ETHEREAL_BEACON_VISUAL = 32368,
|
||||
|
||||
NPC_BEACON = 18431,
|
||||
NPC_SHAFFAR = 18344,
|
||||
|
||||
EVENT_SPELL_BEACON = 1,
|
||||
EVENT_SPELL_FR_FI = 2,
|
||||
EVENT_SPELL_FROST_NOVA = 3,
|
||||
EVENT_SPELL_BLINK = 4,
|
||||
};
|
||||
|
||||
class boss_nexusprince_shaffar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_nexusprince_shaffar() : CreatureScript("boss_nexusprince_shaffar") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_nexusprince_shaffarAI (creature);
|
||||
}
|
||||
|
||||
struct boss_nexusprince_shaffarAI : public ScriptedAI
|
||||
{
|
||||
boss_nexusprince_shaffarAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
HasTaunted = false;
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
bool HasTaunted;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
float dist = 8.0f;
|
||||
float posX, posY, posZ, angle;
|
||||
me->GetHomePosition(posX, posY, posZ, angle);
|
||||
|
||||
summons.DespawnAll();
|
||||
events.Reset();
|
||||
me->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
|
||||
me->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
|
||||
me->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 100.0f))
|
||||
{
|
||||
Talk(SAY_INTRO);
|
||||
HasTaunted = true;
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
me->SetInCombatWithZone();
|
||||
summons.DoZoneInCombat();
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_BEACON, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FR_FI, 4000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FROST_NOVA, 15000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
if (me->IsInCombat() && summon->GetEntry() == NPC_BEACON)
|
||||
{
|
||||
summon->CastSpell(summon, SPELL_ETHEREAL_BEACON_VISUAL, false);
|
||||
if (Unit* target = SelectTargetFromPlayerList(50.0f))
|
||||
summon->AI()->AttackStart(target);
|
||||
}
|
||||
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* summon)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEAD);
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_FROST_NOVA:
|
||||
me->CastSpell(me, SPELL_FROSTNOVA, false);
|
||||
events.RepeatEvent(urand(16000, 23000));
|
||||
events.DelayEvents(1500);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLINK, 1500);
|
||||
break;
|
||||
case EVENT_SPELL_FR_FI:
|
||||
me->CastSpell(me->GetVictim(), RAND(SPELL_FROSTBOLT, SPELL_FIREBALL), false);
|
||||
events.RepeatEvent(urand(3000, 4000));
|
||||
break;
|
||||
case EVENT_SPELL_BLINK:
|
||||
me->CastSpell(me, SPELL_BLINK, false);
|
||||
events.PopEvent();
|
||||
events.RescheduleEvent(EVENT_SPELL_FR_FI, 0);
|
||||
break;
|
||||
case EVENT_SPELL_BEACON:
|
||||
if (!urand(0, 3))
|
||||
Talk(SAY_SUMMON);
|
||||
|
||||
me->CastSpell(me, SPELL_ETHEREAL_BEACON, true);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_nexusprince_shaffar()
|
||||
{
|
||||
new boss_nexusprince_shaffar();
|
||||
}
|
||||
@@ -1,324 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "sethekk_halls.h"
|
||||
|
||||
enum TailonkingIkiss
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_DEATH = 3,
|
||||
EMOTE_ARCANE_EXP = 4,
|
||||
|
||||
SPELL_BLINK = 38194,
|
||||
SPELL_BLINK_TELEPORT = 38203,
|
||||
SPELL_MANA_SHIELD = 38151,
|
||||
SPELL_ARCANE_BUBBLE = 9438,
|
||||
SPELL_SLOW = 35032,
|
||||
SPELL_POLYMORPH_N = 38245, // Difficulty data
|
||||
SPELL_POLYMORPH_H = 43309,
|
||||
SPELL_ARCANE_VOLLEY_N = 35059, // Difficulty data
|
||||
SPELL_ARCANE_VOLLEY_H = 40424,
|
||||
SPELL_ARCANE_EXPLOSION_N = 38197, // Difficulty data
|
||||
SPELL_ARCANE_EXPLOSION_H = 40425,
|
||||
|
||||
EVENT_SPELL_BLINK = 1,
|
||||
EVENT_SPELL_POLYMORPH = 2,
|
||||
EVENT_SPELL_SLOW = 3,
|
||||
EVENT_SPELL_ARCANE_VOLLEY = 4,
|
||||
EVENT_SPELL_ARCANE_EXPLO = 5,
|
||||
EVENT_HEALTH_CHECK = 6,
|
||||
EVENT_SPELL_BLINK_2 = 7
|
||||
};
|
||||
|
||||
class boss_talon_king_ikiss : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_talon_king_ikiss() : CreatureScript("boss_talon_king_ikiss") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_talon_king_ikissAI (creature);
|
||||
}
|
||||
|
||||
struct boss_talon_king_ikissAI : public ScriptedAI
|
||||
{
|
||||
boss_talon_king_ikissAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
bool _spoken;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_spoken = false;
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!_spoken && who->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Talk(SAY_INTRO);
|
||||
_spoken = true;
|
||||
}
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_BLINK, 35000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCANE_VOLLEY, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_POLYMORPH, 8000);
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK, 2000);
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SPELL_SLOW, urand(15000, 25000));
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
instance->SetData(DATA_IKISSDOOREVENT, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (urand(0,1))
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_ARCANE_VOLLEY:
|
||||
me->CastSpell(me, SPELL_ARCANE_VOLLEY_N, false);
|
||||
events.RepeatEvent(urand(7000, 12000));
|
||||
break;
|
||||
case EVENT_SPELL_POLYMORPH:
|
||||
if (Unit* target = (IsHeroic() ? SelectTarget(SELECT_TARGET_RANDOM, 0) : SelectTarget(SELECT_TARGET_TOPAGGRO, 1)))
|
||||
me->CastSpell(target, SPELL_POLYMORPH_N, false);
|
||||
events.RepeatEvent(urand(15000, 17500));
|
||||
break;
|
||||
case EVENT_SPELL_SLOW:
|
||||
me->CastSpell(me, SPELL_SLOW, false);
|
||||
events.RepeatEvent(urand(15000, 30000));
|
||||
break;
|
||||
case EVENT_HEALTH_CHECK:
|
||||
if (me->HealthBelowPct(20))
|
||||
{
|
||||
me->CastSpell(me, SPELL_MANA_SHIELD, false);
|
||||
events.PopEvent();
|
||||
return;
|
||||
}
|
||||
events.RepeatEvent(1000);
|
||||
break;
|
||||
case EVENT_SPELL_BLINK:
|
||||
Talk(EMOTE_ARCANE_EXP);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
me->CastSpell(target, SPELL_BLINK, false);
|
||||
me->NearTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), target->GetOrientation());
|
||||
|
||||
DoCast(target, SPELL_BLINK_TELEPORT);
|
||||
}
|
||||
events.RepeatEvent(urand(35000, 40000));
|
||||
events.DelayEvents(500);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLINK_2, 0);
|
||||
return;
|
||||
case EVENT_SPELL_BLINK_2:
|
||||
me->CastSpell(me, SPELL_ARCANE_EXPLOSION_N, false);
|
||||
me->CastSpell(me, SPELL_ARCANE_BUBBLE, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
enum Anzu
|
||||
{
|
||||
SAY_ANZU_INTRO1 = 0,
|
||||
SAY_ANZU_INTRO2 = 1,
|
||||
SAY_SUMMON = 2,
|
||||
|
||||
SPELL_PARALYZING_SCREECH = 40184,
|
||||
SPELL_SPELL_BOMB = 40303,
|
||||
SPELL_CYCLONE = 40321,
|
||||
SPELL_BANISH_SELF = 42354,
|
||||
SPELL_SHADOWFORM = 40973,
|
||||
|
||||
EVENT_SPELL_SCREECH = 1,
|
||||
EVENT_SPELL_BOMB = 2,
|
||||
EVENT_SPELL_CYCLONE = 3,
|
||||
EVENT_ANZU_HEALTH1 = 4,
|
||||
EVENT_ANZU_HEALTH2 = 5
|
||||
};
|
||||
|
||||
class boss_anzu : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_anzu() : CreatureScript("boss_anzu") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_anzuAI (creature);
|
||||
}
|
||||
|
||||
struct boss_anzuAI : public ScriptedAI
|
||||
{
|
||||
boss_anzuAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
talkTimer = 1;
|
||||
me->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->AddAura(SPELL_SHADOWFORM, me);
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
uint32 talkTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
summons.DespawnAll();
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
if (instance->GetData(TYPE_ANZU_ENCOUNTER) != DONE)
|
||||
instance->SetData(TYPE_ANZU_ENCOUNTER, NOT_STARTED);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->AI()->AttackStart(me->GetVictim());
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit*)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
summons.RemoveNotExisting();
|
||||
if (summons.empty())
|
||||
me->RemoveAurasDueToSpell(SPELL_BANISH_SELF);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SPELL_SCREECH, 14000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BOMB, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CYCLONE, 8000);
|
||||
events.ScheduleEvent(EVENT_ANZU_HEALTH1, 2000);
|
||||
events.ScheduleEvent(EVENT_ANZU_HEALTH2, 2001);
|
||||
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
instance->SetData(TYPE_ANZU_ENCOUNTER, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (InstanceScript* instance = me->GetInstanceScript())
|
||||
instance->SetData(TYPE_ANZU_ENCOUNTER, DONE);
|
||||
}
|
||||
|
||||
void SummonBroods()
|
||||
{
|
||||
Talk(SAY_SUMMON);
|
||||
me->CastSpell(me, SPELL_BANISH_SELF, true);
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
me->SummonCreature(23132 /*NPC_BROOD_OF_ANZU*/, me->GetPositionX()+20*cos((float)i), me->GetPositionY()+20*sin((float)i), me->GetPositionZ()+25.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (talkTimer)
|
||||
{
|
||||
talkTimer += diff;
|
||||
if (talkTimer >= 1000 && talkTimer < 10000)
|
||||
{
|
||||
Talk(SAY_ANZU_INTRO1);
|
||||
talkTimer = 10000;
|
||||
}
|
||||
else if (talkTimer >= 16000)
|
||||
{
|
||||
me->SetUInt32Value(UNIT_FIELD_FLAGS, 0);
|
||||
me->RemoveAurasDueToSpell(SPELL_SHADOWFORM);
|
||||
Talk(SAY_ANZU_INTRO2);
|
||||
talkTimer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING|UNIT_STATE_STUNNED))
|
||||
return;
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_SCREECH:
|
||||
me->CastSpell(me, SPELL_PARALYZING_SCREECH, false);
|
||||
events.RepeatEvent(23000);
|
||||
events.DelayEvents(3000);
|
||||
break;
|
||||
case EVENT_SPELL_BOMB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
me->CastSpell(target, SPELL_SPELL_BOMB, false);
|
||||
events.RepeatEvent(urand(16000, 24500));
|
||||
events.DelayEvents(3000);
|
||||
break;
|
||||
case EVENT_SPELL_CYCLONE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45.0f, true))
|
||||
me->CastSpell(target, SPELL_CYCLONE, false);
|
||||
events.RepeatEvent(urand(22000, 27000));
|
||||
events.DelayEvents(3000);
|
||||
break;
|
||||
case EVENT_ANZU_HEALTH1:
|
||||
if (me->HealthBelowPct(66))
|
||||
{
|
||||
SummonBroods();
|
||||
events.PopEvent();
|
||||
events.DelayEvents(10000);
|
||||
return;
|
||||
}
|
||||
events.RepeatEvent(1000);
|
||||
break;
|
||||
case EVENT_ANZU_HEALTH2:
|
||||
if (me->HealthBelowPct(33))
|
||||
{
|
||||
SummonBroods();
|
||||
events.PopEvent();
|
||||
events.DelayEvents(10000);
|
||||
return;
|
||||
}
|
||||
events.RepeatEvent(1000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_talon_king_ikiss()
|
||||
{
|
||||
new boss_talon_king_ikiss();
|
||||
new boss_anzu();
|
||||
}
|
||||
@@ -1,115 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "sethekk_halls.h"
|
||||
|
||||
class instance_sethekk_halls : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_sethekk_halls() : InstanceMapScript("instance_sethekk_halls", 556) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_sethekk_halls_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_sethekk_halls_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_sethekk_halls_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 AnzuEncounter;
|
||||
uint64 m_uiIkissDoorGUID;
|
||||
uint64 _talonKingsCofferGUID;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
AnzuEncounter = NOT_STARTED;
|
||||
m_uiIkissDoorGUID = 0;
|
||||
_talonKingsCofferGUID = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
if (creature->GetEntry() == NPC_ANZU || creature->GetEntry() == NPC_VOICE_OF_THE_RAVEN_GOD)
|
||||
if (AnzuEncounter >= IN_PROGRESS)
|
||||
creature->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_IKISS_DOOR:
|
||||
m_uiIkissDoorGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_THE_TALON_KINGS_COFFER:
|
||||
_talonKingsCofferGUID = go->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_IKISSDOOREVENT:
|
||||
if (data == DONE)
|
||||
{
|
||||
DoUseDoorOrButton(m_uiIkissDoorGUID, DAY*IN_MILLISECONDS);
|
||||
if (GameObject* coffer = instance->GetGameObject(_talonKingsCofferGUID))
|
||||
coffer->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE|GO_FLAG_INTERACT_COND);
|
||||
}
|
||||
break;
|
||||
case TYPE_ANZU_ENCOUNTER:
|
||||
AnzuEncounter = data;
|
||||
SaveToDB();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "S H " << AnzuEncounter;
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* strIn)
|
||||
{
|
||||
if (!strIn)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(strIn);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(strIn);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'S' && dataHead2 == 'H')
|
||||
{
|
||||
loadStream >> AnzuEncounter;
|
||||
if (AnzuEncounter == IN_PROGRESS)
|
||||
AnzuEncounter = NOT_STARTED;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_instance_sethekk_halls()
|
||||
{
|
||||
new instance_sethekk_halls();
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_SETHEKK_HALLS_H
|
||||
#define DEF_SETHEKK_HALLS_H
|
||||
|
||||
enum eTypes
|
||||
{
|
||||
DATA_IKISSDOOREVENT = 1,
|
||||
TYPE_ANZU_ENCOUNTER = 2,
|
||||
};
|
||||
|
||||
enum eIds
|
||||
{
|
||||
NPC_VOICE_OF_THE_RAVEN_GOD = 21851,
|
||||
NPC_ANZU = 23035,
|
||||
|
||||
GO_IKISS_DOOR = 177203,
|
||||
GO_THE_TALON_KINGS_COFFER = 187372
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,161 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "shadow_labyrinth.h"
|
||||
|
||||
enum eEnums
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_HELP = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_DEATH = 4,
|
||||
|
||||
SPELL_BANISH = 30231,
|
||||
SPELL_CORROSIVE_ACID = 33551,
|
||||
SPELL_FEAR = 33547,
|
||||
SPELL_ENRAGE = 34970,
|
||||
|
||||
EVENT_SPELL_CORROSIVE = 1,
|
||||
EVENT_SPELL_FEAR = 2,
|
||||
EVENT_SPELL_ENRAGE = 3
|
||||
};
|
||||
|
||||
class boss_ambassador_hellmaw : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_ambassador_hellmaw() : CreatureScript("boss_ambassador_hellmaw") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_ambassador_hellmawAI(creature);
|
||||
}
|
||||
|
||||
struct boss_ambassador_hellmawAI : public npc_escortAI
|
||||
{
|
||||
boss_ambassador_hellmawAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
bool isBanished;
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param != 1)
|
||||
return;
|
||||
|
||||
me->RemoveAurasDueToSpell(SPELL_BANISH);
|
||||
Talk(SAY_INTRO);
|
||||
Start(true, false, 0, NULL, false, true);
|
||||
isBanished = false;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
isBanished = false;
|
||||
if (instance)
|
||||
{
|
||||
instance->SetData(TYPE_HELLMAW, NOT_STARTED);
|
||||
if (instance->GetData(TYPE_OVERSEER) != DONE)
|
||||
{
|
||||
isBanished = true;
|
||||
me->CastSpell(me, SPELL_BANISH, true);
|
||||
}
|
||||
else
|
||||
Start(true, false, 0, NULL, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
if (isBanished)
|
||||
return;
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_SPELL_CORROSIVE, urand(5000, 10000));
|
||||
events.ScheduleEvent(EVENT_SPELL_FEAR, urand(15000, 20000));
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SPELL_ENRAGE, 180000);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(TYPE_HELLMAW, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (isBanished)
|
||||
return;
|
||||
npc_escortAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (isBanished)
|
||||
return;
|
||||
npc_escortAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 /*waypointId*/)
|
||||
{
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && urand(0,1))
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(TYPE_HELLMAW, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (isBanished)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_CORROSIVE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CORROSIVE_ACID, false);
|
||||
events.RepeatEvent(urand(15000, 25000));
|
||||
break;
|
||||
case EVENT_SPELL_FEAR:
|
||||
me->CastSpell(me, SPELL_FEAR, false);
|
||||
events.RepeatEvent(urand(20000, 35000));
|
||||
break;
|
||||
case EVENT_SPELL_ENRAGE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ENRAGE, false);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_ambassador_hellmaw()
|
||||
{
|
||||
new boss_ambassador_hellmaw();
|
||||
}
|
||||
@@ -1,145 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "shadow_labyrinth.h"
|
||||
|
||||
enum BlackheartTheInciter
|
||||
{
|
||||
SPELL_INCITE_CHAOS = 33676,
|
||||
SPELL_INCITE_CHAOS_B = 33684, //debuff applied to each member of party
|
||||
SPELL_CHARGE = 33709,
|
||||
SPELL_WAR_STOMP = 33707,
|
||||
|
||||
SAY_INTRO = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_HELP = 3,
|
||||
SAY_DEATH = 4,
|
||||
|
||||
EVENT_SPELL_INCITE = 1,
|
||||
EVENT_INCITE_WAIT = 2,
|
||||
EVENT_SPELL_CHARGE = 3,
|
||||
EVENT_SPELL_KNOCKBACK = 4
|
||||
};
|
||||
|
||||
class boss_blackheart_the_inciter : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_blackheart_the_inciter() : CreatureScript("boss_blackheart_the_inciter") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_blackheart_the_inciterAI (creature);
|
||||
}
|
||||
|
||||
struct boss_blackheart_the_inciterAI : public ScriptedAI
|
||||
{
|
||||
boss_blackheart_the_inciterAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
|
||||
bool InciteChaos;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
InciteChaos = false;
|
||||
events.Reset();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && urand(0,1))
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
if (instance)
|
||||
instance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_SPELL_INCITE, 20000);
|
||||
events.ScheduleEvent(EVENT_INCITE_WAIT, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CHARGE, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_KNOCKBACK, 15000);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
if (InciteChaos && SelectTargetFromPlayerList(100.0f))
|
||||
return;
|
||||
CreatureAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_INCITE_WAIT:
|
||||
InciteChaos = false;
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_SPELL_INCITE:
|
||||
{
|
||||
me->CastSpell(me, SPELL_INCITE_CHAOS, false);
|
||||
|
||||
std::list<HostileReference*> t_list = me->getThreatManager().getThreatList();
|
||||
for (std::list<HostileReference*>::const_iterator itr = t_list.begin(); itr!= t_list.end(); ++itr)
|
||||
{
|
||||
Unit* target = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
|
||||
if (target && target->GetTypeId() == TYPEID_PLAYER)
|
||||
me->CastSpell(target, SPELL_INCITE_CHAOS_B, true);
|
||||
}
|
||||
|
||||
DoResetThreat();
|
||||
InciteChaos = true;
|
||||
events.DelayEvents(15000);
|
||||
events.RepeatEvent(40000);
|
||||
events.ScheduleEvent(EVENT_INCITE_WAIT, 15000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SPELL_CHARGE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_CHARGE, false);
|
||||
events.RepeatEvent(urand(15000, 25000));
|
||||
break;
|
||||
case EVENT_SPELL_KNOCKBACK:
|
||||
me->CastSpell(me, SPELL_WAR_STOMP, false);
|
||||
events.RepeatEvent(urand(18000, 24000));
|
||||
break;
|
||||
}
|
||||
|
||||
if (InciteChaos)
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
void AddSC_boss_blackheart_the_inciter()
|
||||
{
|
||||
new boss_blackheart_the_inciter();
|
||||
}
|
||||
@@ -1,263 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "shadow_labyrinth.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum GrandmasterVorpil
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_HELP = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_DEATH = 4,
|
||||
|
||||
SPELL_RAIN_OF_FIRE_N = 33617,
|
||||
SPELL_RAIN_OF_FIRE_H = 39363,
|
||||
|
||||
SPELL_DRAW_SHADOWS = 33563,
|
||||
SPELL_SHADOWBOLT_VOLLEY = 33841,
|
||||
SPELL_BANISH = 38791,
|
||||
|
||||
NPC_VOID_TRAVELER = 19226,
|
||||
SPELL_SACRIFICE = 33587,
|
||||
SPELL_SHADOW_NOVA = 33846,
|
||||
SPELL_EMPOWERING_SHADOWS_N = 33783,
|
||||
SPELL_EMPOWERING_SHADOWS_H = 39364,
|
||||
|
||||
NPC_VOID_PORTAL = 19224,
|
||||
SPELL_VOID_PORTAL_VISUAL = 33569,
|
||||
|
||||
EVENT_SPELL_SHADOWBOLT = 1,
|
||||
EVENT_SPELL_DRAWSHADOWS = 2,
|
||||
EVENT_SUMMON_TRAVELER = 3,
|
||||
EVENT_SPELL_BANISH = 4
|
||||
};
|
||||
|
||||
float VorpilPosition[3] = {-252.8820f, -264.3030f, 17.1f};
|
||||
|
||||
float VoidPortalCoords[5][3] =
|
||||
{
|
||||
{-283.5894f, -239.5718f, 12.7f},
|
||||
{-306.5853f, -258.4539f, 12.7f},
|
||||
{-295.8789f, -269.0899f, 12.7f},
|
||||
{-209.3401f, -262.7564f, 17.1f},
|
||||
{-261.4533f, -297.3298f, 17.1f}
|
||||
};
|
||||
|
||||
class boss_grandmaster_vorpil : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_grandmaster_vorpil() : CreatureScript("boss_grandmaster_vorpil") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_grandmaster_vorpilAI (creature);
|
||||
}
|
||||
|
||||
struct boss_grandmaster_vorpilAI : public ScriptedAI
|
||||
{
|
||||
boss_grandmaster_vorpilAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
sayIntro = false;
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
|
||||
bool sayIntro, sayHelp;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
sayHelp = false;
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void summonPortals()
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
me->SummonCreature(NPC_VOID_PORTAL, VoidPortalCoords[i][0], VoidPortalCoords[i][1], VoidPortalCoords[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 3000000);
|
||||
}
|
||||
|
||||
void spawnVoidTraveler()
|
||||
{
|
||||
uint8 pos = urand(0, 4);
|
||||
me->SummonCreature(NPC_VOID_TRAVELER, VoidPortalCoords[pos][0], VoidPortalCoords[pos][1], VoidPortalCoords[pos][2], 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||
if (!sayHelp)
|
||||
{
|
||||
Talk(SAY_HELP);
|
||||
sayHelp = true;
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (summon->GetEntry() == NPC_VOID_TRAVELER)
|
||||
summon->AI()->SetGUID(me->GetGUID());
|
||||
else if (summon->GetEntry() == NPC_VOID_PORTAL)
|
||||
summon->CastSpell(summon, SPELL_VOID_PORTAL_VISUAL, false);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
summons.DespawnAll();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
summonPortals();
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_SHADOWBOLT, urand(7000, 14000));
|
||||
events.ScheduleEvent(EVENT_SPELL_DRAWSHADOWS, 45000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_TRAVELER, 5000);
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SPELL_BANISH, 17000);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
|
||||
if (!sayIntro && who->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
Talk(SAY_INTRO);
|
||||
sayIntro = true;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHADOWBOLT:
|
||||
me->CastSpell(me, SPELL_SHADOWBOLT_VOLLEY, false);
|
||||
events.RepeatEvent(urand(15000, 30000));
|
||||
break;
|
||||
case EVENT_SPELL_BANISH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30, false))
|
||||
me->CastSpell(target, SPELL_BANISH, false);
|
||||
events.RepeatEvent(16000);
|
||||
break;
|
||||
case EVENT_SUMMON_TRAVELER:
|
||||
spawnVoidTraveler();
|
||||
events.RepeatEvent(HealthBelowPct(20) ? 5000: 10000);
|
||||
break;
|
||||
case EVENT_SPELL_DRAWSHADOWS:
|
||||
{
|
||||
Map* map = me->GetMap();
|
||||
Map::PlayerList const &PlayerList = map->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
if (player->IsAlive() && !player->HasAura(SPELL_BANISH))
|
||||
player->TeleportTo(me->GetMapId(), VorpilPosition[0], VorpilPosition[1], VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT);
|
||||
|
||||
me->NearTeleportTo(VorpilPosition[0], VorpilPosition[1], VorpilPosition[2], 0.0f);
|
||||
me->CastSpell(me, SPELL_DRAW_SHADOWS, true);
|
||||
me->CastSpell(me, SPELL_RAIN_OF_FIRE_N);
|
||||
|
||||
events.RepeatEvent(24000);
|
||||
events.DelayEvents(6000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class npc_voidtraveler : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_voidtraveler() : CreatureScript("npc_voidtraveler") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_voidtravelerAI (creature);
|
||||
}
|
||||
|
||||
struct npc_voidtravelerAI : public ScriptedAI
|
||||
{
|
||||
npc_voidtravelerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
VorpilGUID = 0;
|
||||
moveTimer = 1000;
|
||||
sacrificed = false;
|
||||
}
|
||||
|
||||
uint64 VorpilGUID;
|
||||
uint32 moveTimer;
|
||||
bool sacrificed;
|
||||
|
||||
void SetGUID(uint64 guid, int32)
|
||||
{
|
||||
VorpilGUID = guid;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
moveTimer += diff;
|
||||
if (moveTimer >= 1000)
|
||||
{
|
||||
moveTimer = 0;
|
||||
Creature* Vorpil = ObjectAccessor::GetCreature(*me, VorpilGUID);
|
||||
if (!Vorpil)
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
return;
|
||||
}
|
||||
me->GetMotionMaster()->MoveFollow(Vorpil, 0.0f, 0.0f);
|
||||
|
||||
if (sacrificed)
|
||||
{
|
||||
me->AddAura(DUNGEON_MODE(SPELL_EMPOWERING_SHADOWS_N, SPELL_EMPOWERING_SHADOWS_H), Vorpil);
|
||||
Vorpil->ModifyHealth(int32(Vorpil->CountPctFromMaxHealth(4)));
|
||||
me->CastSpell(me, SPELL_SHADOW_NOVA, true);
|
||||
Unit::Kill(me, me);
|
||||
return;
|
||||
}
|
||||
|
||||
if (me->IsWithinDist(Vorpil, 3.0f))
|
||||
{
|
||||
me->CastSpell(me, SPELL_SACRIFICE, false);
|
||||
sacrificed = true;
|
||||
moveTimer = 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_grandmaster_vorpil()
|
||||
{
|
||||
new boss_grandmaster_vorpil();
|
||||
new npc_voidtraveler();
|
||||
}
|
||||
@@ -1,217 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "shadow_labyrinth.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
enum Murmur
|
||||
{
|
||||
EMOTE_SONIC_BOOM = 0,
|
||||
|
||||
SPELL_RESONANCE = 33657,
|
||||
SPELL_MAGNETIC_PULL = 33689,
|
||||
SPELL_SONIC_SHOCK = 38797,
|
||||
SPELL_THUNDERING_STORM = 39365,
|
||||
|
||||
SPELL_SONIC_BOOM_CAST_N = 33923,
|
||||
SPELL_SONIC_BOOM_CAST_H = 38796,
|
||||
SPELL_SONIC_BOOM_EFFECT_N = 38795,
|
||||
SPELL_SONIC_BOOM_EFFECT_H = 33666,
|
||||
SPELL_MURMURS_TOUCH_N = 33711,
|
||||
SPELL_MURMURS_TOUCH_H = 38794,
|
||||
|
||||
EVENT_SPELL_SONIC_BOOM = 1,
|
||||
EVENT_SPELL_SONIC_BOOM_EFFECT = 2,
|
||||
EVENT_SPELL_MURMURS_TOUCH = 3,
|
||||
EVENT_SPELL_RESONANCE = 4,
|
||||
EVENT_SPELL_MAGNETIC = 5,
|
||||
EVENT_SPELL_THUNDERING = 6,
|
||||
EVENT_SPELL_SONIC_SHOCK = 7
|
||||
};
|
||||
|
||||
class boss_murmur : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_murmur() : CreatureScript("boss_murmur") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_murmurAI (creature);
|
||||
}
|
||||
|
||||
struct boss_murmurAI : public ScriptedAI
|
||||
{
|
||||
boss_murmurAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
me->SetHealth(me->CountPctFromMaxHealth(40));
|
||||
me->ResetPlayerDamageReq();
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_MURMUREVENT, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_SONIC_BOOM, 30000);
|
||||
events.ScheduleEvent(EVENT_SPELL_MURMURS_TOUCH, urand(8000, 20000));
|
||||
events.ScheduleEvent(EVENT_SPELL_RESONANCE, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_MAGNETIC, urand(15000, 30000));
|
||||
if (IsHeroic())
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_THUNDERING, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SONIC_SHOCK, 10000);
|
||||
}
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_MURMUREVENT, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
if (instance)
|
||||
instance->SetData(DATA_MURMUREVENT, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() || me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_SONIC_BOOM:
|
||||
Talk(EMOTE_SONIC_BOOM);
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_SONIC_BOOM_CAST_N, SPELL_SONIC_BOOM_CAST_H), false);
|
||||
events.RepeatEvent(28500);
|
||||
events.DelayEvents(1500);
|
||||
events.ScheduleEvent(EVENT_SPELL_SONIC_BOOM_EFFECT, 0);
|
||||
return;
|
||||
case EVENT_SPELL_SONIC_BOOM_EFFECT:
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_SONIC_BOOM_EFFECT_N, SPELL_SONIC_BOOM_EFFECT_H), true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_SPELL_MURMURS_TOUCH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_MURMURS_TOUCH_N, SPELL_MURMURS_TOUCH_H), false);
|
||||
events.RepeatEvent(urand(25000, 35000));
|
||||
break;
|
||||
case EVENT_SPELL_RESONANCE:
|
||||
if (!me->IsWithinMeleeRange(me->GetVictim()))
|
||||
me->CastSpell(me, SPELL_RESONANCE, false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
case EVENT_SPELL_MAGNETIC:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 80.0f, true))
|
||||
{
|
||||
me->CastSpell(target, SPELL_MAGNETIC_PULL, false);
|
||||
events.RepeatEvent(urand(15000, 30000));
|
||||
return;
|
||||
}
|
||||
events.RepeatEvent(500);
|
||||
break;
|
||||
case EVENT_SPELL_THUNDERING:
|
||||
me->CastSpell(me, SPELL_THUNDERING_STORM, true);
|
||||
events.RepeatEvent(15000);
|
||||
break;
|
||||
case EVENT_SPELL_SONIC_SHOCK:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SONIC_SHOCK, false);
|
||||
events.RepeatEvent(urand(10000, 20000));
|
||||
break;
|
||||
}
|
||||
|
||||
if (!me->isAttackReady())
|
||||
return;
|
||||
|
||||
if (!me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
ThreatContainer::StorageType threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid()))
|
||||
if (target->IsAlive() && me->IsWithinMeleeRange(target))
|
||||
{
|
||||
me->TauntApply(target);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_murmur_sonic_boom_effect : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_murmur_sonic_boom_effect() : SpellScriptLoader("spell_murmur_sonic_boom_effect") { }
|
||||
|
||||
class spell_murmur_sonic_boom_effect_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_murmur_sonic_boom_effect_SpellScript)
|
||||
|
||||
public:
|
||||
spell_murmur_sonic_boom_effect_SpellScript() : SpellScript() { }
|
||||
|
||||
void RecalculateDamage()
|
||||
{
|
||||
SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(90));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_murmur_sonic_boom_effect_SpellScript::RecalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_murmur_sonic_boom_effect_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_murmur_thundering_storm : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_murmur_thundering_storm() : SpellScriptLoader("spell_murmur_thundering_storm") { }
|
||||
|
||||
class spell_murmur_thundering_storm_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_murmur_thundering_storm_SpellScript);
|
||||
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Trinity::AllWorldObjectsInExactRange(GetCaster(), 100.0f, true));
|
||||
targets.remove_if(Trinity::AllWorldObjectsInExactRange(GetCaster(), 25.0f, false));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_murmur_thundering_storm_SpellScript::SelectTarget, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_murmur_thundering_storm_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_murmur()
|
||||
{
|
||||
new boss_murmur();
|
||||
new spell_murmur_sonic_boom_effect();
|
||||
new spell_murmur_thundering_storm();
|
||||
}
|
||||
@@ -1,165 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "shadow_labyrinth.h"
|
||||
|
||||
class instance_shadow_labyrinth : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_shadow_labyrinth() : InstanceMapScript("instance_shadow_labyrinth", 555) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_shadow_labyrinth_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_shadow_labyrinth_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_shadow_labyrinth_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 m_auiEncounter[MAX_ENCOUNTER];
|
||||
|
||||
uint64 m_uiHellmawGUID;
|
||||
uint64 m_uiRefectoryDoorGUID;
|
||||
uint64 m_uiScreamingHallDoorGUID;
|
||||
|
||||
uint32 m_uiFelOverseerCount;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
|
||||
|
||||
m_uiHellmawGUID = 0;
|
||||
m_uiRefectoryDoorGUID = 0;
|
||||
m_uiScreamingHallDoorGUID = 0;
|
||||
|
||||
m_uiFelOverseerCount = 0;
|
||||
}
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case REFECTORY_DOOR:
|
||||
m_uiRefectoryDoorGUID = go->GetGUID();
|
||||
if (m_auiEncounter[DATA_BLACKHEARTTHEINCITEREVENT] == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case SCREAMING_HALL_DOOR:
|
||||
m_uiScreamingHallDoorGUID = go->GetGUID();
|
||||
if (m_auiEncounter[DATA_GRANDMASTERVORPILEVENT] == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_FEL_OVERSEER:
|
||||
if (creature->IsAlive())
|
||||
++m_uiFelOverseerCount;
|
||||
break;
|
||||
case NPC_HELLMAW:
|
||||
m_uiHellmawGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 uiData)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case TYPE_OVERSEER:
|
||||
if (!--m_uiFelOverseerCount)
|
||||
{
|
||||
m_auiEncounter[type] = DONE;
|
||||
if (Creature* cr = instance->GetCreature(m_uiHellmawGUID))
|
||||
cr->AI()->DoAction(1);
|
||||
}
|
||||
break;
|
||||
|
||||
case DATA_BLACKHEARTTHEINCITEREVENT:
|
||||
if (uiData == DONE)
|
||||
DoUseDoorOrButton(m_uiRefectoryDoorGUID);
|
||||
m_auiEncounter[type] = uiData;
|
||||
break;
|
||||
|
||||
case DATA_GRANDMASTERVORPILEVENT:
|
||||
if (uiData == DONE)
|
||||
DoUseDoorOrButton(m_uiScreamingHallDoorGUID);
|
||||
m_auiEncounter[type] = uiData;
|
||||
break;
|
||||
|
||||
case DATA_MURMUREVENT:
|
||||
case TYPE_HELLMAW:
|
||||
m_auiEncounter[type] = uiData;
|
||||
break;
|
||||
}
|
||||
|
||||
if (uiData == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == TYPE_OVERSEER)
|
||||
return m_auiEncounter[0];
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "S L " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
|
||||
<< m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4];
|
||||
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* in)
|
||||
{
|
||||
if (!in)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(in);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(in);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
if (dataHead1 == 'S' && dataHead2 == 'L')
|
||||
{
|
||||
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_shadow_labyrinth()
|
||||
{
|
||||
new instance_shadow_labyrinth();
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_SHADOW_LABYRINTH_H
|
||||
#define DEF_SHADOW_LABYRINTH_H
|
||||
|
||||
enum slData
|
||||
{
|
||||
TYPE_OVERSEER = 0,
|
||||
TYPE_HELLMAW = 1,
|
||||
DATA_BLACKHEARTTHEINCITEREVENT = 2,
|
||||
DATA_GRANDMASTERVORPILEVENT = 3,
|
||||
DATA_MURMUREVENT = 4,
|
||||
MAX_ENCOUNTER = 5
|
||||
};
|
||||
|
||||
enum slNPCandGO
|
||||
{
|
||||
NPC_FEL_OVERSEER = 18796,
|
||||
NPC_HELLMAW = 18731,
|
||||
|
||||
REFECTORY_DOOR = 183296, //door opened when blackheart the inciter dies
|
||||
SCREAMING_HALL_DOOR = 183295 //door opened when grandmaster vorpil dies
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef BLACK_TEMPLE_H_
|
||||
#define BLACK_TEMPLE_H_
|
||||
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_HIGH_WARLORD_NAJENTUS = 0,
|
||||
DATA_SUPREMUS = 1,
|
||||
DATA_SHADE_OF_AKAMA = 2,
|
||||
DATA_TERON_GOREFIEND = 3,
|
||||
DATA_GURTOGG_BLOODBOIL = 4,
|
||||
DATA_RELIQUARY_OF_SOULS = 5,
|
||||
DATA_MOTHER_SHAHRAZ = 6,
|
||||
DATA_ILLIDARI_COUNCIL = 7,
|
||||
DATA_AKAMA_FINISHED = 8,
|
||||
DATA_ILLIDAN_STORMRAGE = 9,
|
||||
MAX_ENCOUNTERS = 10
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_SHADE_OF_AKAMA = 22841,
|
||||
NPC_AKAMA_SHADE = 23191,
|
||||
NPC_STORM_FURY = 22848,
|
||||
NPC_TERON_GOREFIEND = 22871,
|
||||
NPC_VENGEFUL_SPIRIT = 23109,
|
||||
NPC_SHADOWY_CONSTRUCT = 23111,
|
||||
NPC_ANGERED_SOUL_FRAGMENT = 23398,
|
||||
NPC_HUNGERING_SOUL_FRAGMENT = 23401,
|
||||
NPC_SUFFERING_SOUL_FRAGMENT = 23399,
|
||||
NPC_RELIQUARY_OF_THE_LOST = 22856,
|
||||
NPC_ENSLAVED_SOUL = 23469,
|
||||
NPC_GATHIOS_THE_SHATTERER = 22949,
|
||||
NPC_HIGH_NETHERMANCER_ZEREVOR = 22950,
|
||||
NPC_LADY_MALANDE = 22951,
|
||||
NPC_VERAS_DARKSHADOW = 22952,
|
||||
NPC_ILLIDARI_COUNCIL = 23426,
|
||||
NPC_AKAMA = 23089,
|
||||
NPC_ILLIDAN_STORMRAGE = 22917,
|
||||
NPC_PARASITIC_SHADOWFIEND = 23498,
|
||||
NPC_BLADE_OF_AZZINOTH = 22996,
|
||||
NPC_FLAME_OF_AZZINOTH = 22997,
|
||||
|
||||
NPC_DRAGON_TURTLE = 22885
|
||||
};
|
||||
|
||||
enum GameObjectIds
|
||||
{
|
||||
GO_NAJENTUS_GATE = 185483,
|
||||
GO_SUPREMUS_GATE = 185882,
|
||||
GO_SHADE_OF_AKAMA_DOOR = 185478,
|
||||
GO_TERON_DOOR_1 = 185480,
|
||||
GO_TERON_DOOR_2 = 186153,
|
||||
GO_GURTOGG_DOOR = 185892,
|
||||
GO_TEMPLE_DOOR = 185479,
|
||||
GO_MOTHER_SHAHRAZ_DOOR = 185482,
|
||||
GO_COUNCIL_DOOR_1 = 185481,
|
||||
GO_COUNCIL_DOOR_2 = 186152,
|
||||
GO_ILLIDAN_GATE = 185905,
|
||||
GO_ILLIDAN_DOOR_R = 186261,
|
||||
GO_ILLIDAN_DOOR_L = 186262
|
||||
};
|
||||
|
||||
enum MiscIds
|
||||
{
|
||||
SPELL_CHEST_PAINS = 41356,
|
||||
SPELL_WYVERN_STING = 24336,
|
||||
SPELL_SHADOW_INFERNO_DAMAGE = 39646,
|
||||
SPELL_CHAOTIC_CHARGE = 41033,
|
||||
SPELL_DEMENTIA1 = 41406,
|
||||
SPELL_DEMENTIA2 = 41409,
|
||||
|
||||
FACTION_ASHTONGUE = 1820
|
||||
};
|
||||
|
||||
#endif // BLACK_TEMPLE_H_
|
||||
@@ -1,257 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "black_temple.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SLAY = 1,
|
||||
SAY_SPECIAL = 2,
|
||||
SAY_ENRAGE = 3,
|
||||
SAY_DEATH = 4
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ACIDIC_WOUND = 40484,
|
||||
SPELL_FEL_ACID_BREATH1 = 40508,
|
||||
SPELL_FEL_ACID_BREATH2 = 40595,
|
||||
SPELL_ARCING_SMASH1 = 40457,
|
||||
SPELL_ARCING_SMASH2 = 40599,
|
||||
SPELL_EJECT1 = 40486,
|
||||
SPELL_EJECT2 = 40597,
|
||||
SPELL_BEWILDERING_STRIKE = 40491,
|
||||
SPELL_BLOODBOIL = 42005,
|
||||
SPELL_ACID_GEYSER = 40630,
|
||||
SPELL_BERSERK = 45078,
|
||||
SPELL_CHARGE = 40602,
|
||||
|
||||
SPELL_FEL_GEYSER_SUMMON = 40569,
|
||||
SPELL_FEL_GEYSER_STUN = 40591,
|
||||
SPELL_FEL_GEYSER_DAMAGE = 40593,
|
||||
|
||||
SPELL_FEL_RAGE_SELF = 40594,
|
||||
SPELL_FEL_RAGE_TARGET = 40604,
|
||||
SPELL_FEL_RAGE_2 = 40616,
|
||||
SPELL_FEL_RAGE_3 = 41625,
|
||||
SPELL_FEL_RAGE_SIZE = 46787,
|
||||
SPELL_TAUNT_GURTOGG = 40603,
|
||||
SPELL_INSIGNIFICANCE = 40618
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
EVENT_SPELL_BLOOD_BOIL = 1,
|
||||
EVENT_SPELL_BEWILDERING_STRIKE = 2,
|
||||
EVENT_SPELL_FEL_ACID_BREATH = 3,
|
||||
EVENT_SPELL_EJECT = 4,
|
||||
EVENT_SPELL_ARCING_SMASH = 5,
|
||||
EVENT_SPELL_CHARGE = 6,
|
||||
EVENT_SPELL_BERSERK = 7,
|
||||
EVENT_SPELL_FEL_GEYSER = 8,
|
||||
EVENT_KILL_TALK = 9,
|
||||
|
||||
GROUP_DELAY = 1
|
||||
};
|
||||
|
||||
class boss_gurtogg_bloodboil : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_gurtogg_bloodboil() : CreatureScript("boss_gurtogg_bloodboil") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_gurtogg_bloodboilAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_gurtogg_bloodboilAI : public BossAI
|
||||
{
|
||||
boss_gurtogg_bloodboilAI(Creature* creature) : BossAI(creature, DATA_GURTOGG_BLOODBOIL)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
me->CastSpell(me, SPELL_ACIDIC_WOUND, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLOOD_BOIL, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BEWILDERING_STRIKE, 28000, GROUP_DELAY);
|
||||
events.ScheduleEvent(EVENT_SPELL_FEL_ACID_BREATH, 38000);
|
||||
events.ScheduleEvent(EVENT_SPELL_EJECT, 14000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCING_SMASH, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FEL_GEYSER, 60000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BERSERK, 600000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->CastSpell(summon, SPELL_FEL_GEYSER_DAMAGE, false);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_BERSERK:
|
||||
Talk(SAY_ENRAGE);
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
case EVENT_SPELL_BLOOD_BOIL:
|
||||
me->CastCustomSpell(SPELL_BLOODBOIL, SPELLVALUE_MAX_TARGETS, 5, me, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLOOD_BOIL, 10000);
|
||||
break;
|
||||
case EVENT_SPELL_BEWILDERING_STRIKE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_BEWILDERING_STRIKE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BEWILDERING_STRIKE, 30000, GROUP_DELAY);
|
||||
break;
|
||||
case EVENT_SPELL_FEL_ACID_BREATH:
|
||||
me->CastSpell(me->GetVictim(), me->HasAura(SPELL_FEL_RAGE_SELF) ? SPELL_FEL_ACID_BREATH2 : SPELL_FEL_ACID_BREATH1, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_FEL_ACID_BREATH, 30000);
|
||||
break;
|
||||
case EVENT_SPELL_EJECT:
|
||||
me->CastSpell(me->GetVictim(), me->HasAura(SPELL_FEL_RAGE_SELF) ? SPELL_EJECT2 : SPELL_EJECT1, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_EJECT, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_ARCING_SMASH:
|
||||
me->CastSpell(me->GetVictim(), me->HasAura(SPELL_FEL_RAGE_SELF) ? SPELL_ARCING_SMASH2 : SPELL_ARCING_SMASH1, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCING_SMASH, 15000);
|
||||
break;
|
||||
case EVENT_SPELL_FEL_GEYSER:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 40.0f, true))
|
||||
{
|
||||
me->RemoveAurasByType(SPELL_AURA_MOD_TAUNT);
|
||||
me->CastSpell(me, SPELL_FEL_RAGE_SELF, true);
|
||||
me->CastSpell(target, SPELL_FEL_RAGE_TARGET, true);
|
||||
me->CastSpell(target, SPELL_FEL_RAGE_2, true);
|
||||
me->CastSpell(target, SPELL_FEL_RAGE_3, true);
|
||||
me->CastSpell(target, SPELL_FEL_RAGE_SIZE, true);
|
||||
target->CastSpell(me, SPELL_TAUNT_GURTOGG, true);
|
||||
|
||||
me->CastSpell(target, SPELL_FEL_GEYSER_SUMMON, true);
|
||||
me->CastSpell(me, SPELL_FEL_GEYSER_STUN, true);
|
||||
me->CastSpell(me, SPELL_INSIGNIFICANCE, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_CHARGE, 2000);
|
||||
events.DelayEvents(30000, GROUP_DELAY);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_FEL_GEYSER, 90000);
|
||||
break;
|
||||
case EVENT_SPELL_CHARGE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CHARGE, true);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const
|
||||
{
|
||||
return me->GetHomePosition().GetExactDist2d(me) > 105.0f;
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
class spell_gurtogg_bloodboil : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gurtogg_bloodboil() : SpellScriptLoader("spell_gurtogg_bloodboil") { }
|
||||
|
||||
class spell_gurtogg_bloodboil_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gurtogg_bloodboil_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster(), false));
|
||||
if (targets.size() > GetSpellValue()->MaxAffectedTargets)
|
||||
{
|
||||
std::list<WorldObject*>::iterator itr = targets.begin();
|
||||
std::advance(itr, GetSpellValue()->MaxAffectedTargets);
|
||||
targets.erase(itr, targets.end());
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_gurtogg_bloodboil_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gurtogg_bloodboil_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gurtogg_eject : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gurtogg_eject() : SpellScriptLoader("spell_gurtogg_eject") { }
|
||||
|
||||
class spell_gurtogg_eject_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gurtogg_eject_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->getThreatManager().modifyThreatPercent(target, -20);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gurtogg_eject_SpellScript::HandleScriptEffect, EFFECT_2, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gurtogg_eject_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gurtogg_bloodboil()
|
||||
{
|
||||
new boss_gurtogg_bloodboil();
|
||||
new spell_gurtogg_bloodboil();
|
||||
new spell_gurtogg_eject();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,368 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "black_temple.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_TAUNT = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SPELL = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_ENRAGE = 4,
|
||||
SAY_DEATH = 5,
|
||||
SAY_EMOTE_FRENZY = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_PRISMATIC_AURA_SHADOW = 40880,
|
||||
SPELL_PRISMATIC_AURA_FIRE = 40882,
|
||||
SPELL_PRISMATIC_AURA_NATURE = 40883,
|
||||
SPELL_PRISMATIC_AURA_ARCANE = 40891,
|
||||
SPELL_PRISMATIC_AURA_FROST = 40896,
|
||||
SPELL_PRISMATIC_AURA_HOLY = 40897,
|
||||
SPELL_SABER_LASH_AURA = 40816,
|
||||
SPELL_SABER_LASH = 40810,
|
||||
SPELL_SILENCING_SHRIEK = 40823,
|
||||
SPELL_RANDOM_PERIODIC = 40867,
|
||||
SPELL_SINFUL_PERIODIC = 40862,
|
||||
SPELL_SINISTER_PERIODIC = 40863,
|
||||
SPELL_VILE_PERIODIC = 40865,
|
||||
SPELL_WICKED_PERIODIC = 40866,
|
||||
SPELL_FATAL_ATTRACTION = 40869,
|
||||
SPELL_FATAL_ATTRACTION_AURA = 41001,
|
||||
SPELL_FATAL_ATTRACTION_DAMAGE = 40871,
|
||||
SPELL_ENRAGE = 45078,
|
||||
SPELL_FRENZY = 40683,
|
||||
SPELL_SABER_LASH_IMMUNITY = 43690
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
EVENT_KILL_TALK = 1,
|
||||
EVENT_CHECK_HEALTH = 2,
|
||||
EVENT_RANDOM_TALK = 3,
|
||||
EVENT_SPELL_ENRAGE = 4,
|
||||
EVENT_SPELL_PRISMATIC_AURA = 5,
|
||||
EVENT_SPELL_SILENCING_SHRIEK = 6,
|
||||
EVENT_SPELL_FATAL_ATTRACTION = 7,
|
||||
EVENT_SPELL_SABER_LASH = 8
|
||||
};
|
||||
|
||||
class boss_mother_shahraz : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_mother_shahraz() : CreatureScript("boss_mother_shahraz") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_shahrazAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_shahrazAI : public BossAI
|
||||
{
|
||||
boss_shahrazAI(Creature* creature) : BossAI(creature, DATA_MOTHER_SHAHRAZ)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
me->CastSpell(me, SPELL_SABER_LASH_AURA, true);
|
||||
me->CastSpell(me, SPELL_RANDOM_PERIODIC, true);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
events.ScheduleEvent(EVENT_RANDOM_TALK, 60000);
|
||||
events.ScheduleEvent(EVENT_SPELL_PRISMATIC_AURA, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENRAGE, 600000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SILENCING_SHRIEK, 30000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FATAL_ATTRACTION, 50000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SABER_LASH, 4000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (HealthBelowPct(10))
|
||||
{
|
||||
me->CastSpell(me, SPELL_FRENZY, true);
|
||||
Talk(SAY_EMOTE_FRENZY);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_ENRAGE:
|
||||
me->CastSpell(me, SPELL_ENRAGE, true);
|
||||
Talk(SAY_ENRAGE);
|
||||
break;
|
||||
case EVENT_RANDOM_TALK:
|
||||
Talk(SAY_TAUNT);
|
||||
events.ScheduleEvent(EVENT_RANDOM_TALK, urand(60000, 120000));
|
||||
break;
|
||||
case EVENT_SPELL_SABER_LASH:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SABER_LASH, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_SABER_LASH, 30000);
|
||||
break;
|
||||
case EVENT_SPELL_PRISMATIC_AURA:
|
||||
me->CastSpell(me, RAND(SPELL_PRISMATIC_AURA_SHADOW, SPELL_PRISMATIC_AURA_FIRE, SPELL_PRISMATIC_AURA_NATURE, SPELL_PRISMATIC_AURA_ARCANE, SPELL_PRISMATIC_AURA_FROST, SPELL_PRISMATIC_AURA_HOLY), false);
|
||||
events.ScheduleEvent(EVENT_SPELL_PRISMATIC_AURA, 15000);
|
||||
break;
|
||||
case EVENT_SPELL_SILENCING_SHRIEK:
|
||||
me->CastSpell(me, SPELL_SILENCING_SHRIEK, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_SILENCING_SHRIEK, 30000);
|
||||
break;
|
||||
case EVENT_SPELL_FATAL_ATTRACTION:
|
||||
Talk(SAY_SPELL);
|
||||
me->CastCustomSpell(SPELL_FATAL_ATTRACTION, SPELLVALUE_MAX_TARGETS, 3, me, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_FATAL_ATTRACTION, 60000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_random_periodic : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_random_periodic() : SpellScriptLoader("spell_mother_shahraz_random_periodic") { }
|
||||
|
||||
class spell_mother_shahraz_random_periodic_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mother_shahraz_random_periodic_AuraScript);
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (effect->GetTickNumber()%5 == 1)
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_SINFUL_PERIODIC, SPELL_SINISTER_PERIODIC, SPELL_VILE_PERIODIC, SPELL_WICKED_PERIODIC), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_random_periodic_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mother_shahraz_random_periodic_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_beam_periodic : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_beam_periodic() : SpellScriptLoader("spell_mother_shahraz_beam_periodic") { }
|
||||
|
||||
class spell_mother_shahraz_beam_periodic_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mother_shahraz_beam_periodic_AuraScript);
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_beam_periodic_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mother_shahraz_beam_periodic_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_saber_lash : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_saber_lash() : SpellScriptLoader("spell_mother_shahraz_saber_lash") { }
|
||||
|
||||
class spell_mother_shahraz_saber_lash_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mother_shahraz_saber_lash_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->GetVictim())
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_mother_shahraz_saber_lash_AuraScript::CheckProc);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_saber_lash_AuraScript::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mother_shahraz_saber_lash_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_fatal_attraction() : SpellScriptLoader("spell_mother_shahraz_fatal_attraction") { }
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mother_shahraz_fatal_attraction_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(Trinity::UnitAuraCheck(true, SPELL_SABER_LASH_IMMUNITY));
|
||||
if (targets.size() <= 1)
|
||||
FinishCast(SPELL_FAILED_DONT_REPORT);
|
||||
}
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
std::list<Spell::TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
|
||||
for (std::list<Spell::TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*GetCaster(), ihit->targetGUID))
|
||||
{
|
||||
dest.Relocate(*target);
|
||||
if (roll_chance_i(50))
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void HandleTeleportUnits(SpellEffIndex effIndex)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, SPELL_FATAL_ATTRACTION_AURA, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_mother_shahraz_fatal_attraction_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_mother_shahraz_fatal_attraction_SpellScript::SetDest, EFFECT_1, TARGET_DEST_CASTER_RANDOM);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction_SpellScript::HandleTeleportUnits, EFFECT_1, SPELL_EFFECT_TELEPORT_UNITS);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_mother_shahraz_fatal_attraction_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_dummy : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_fatal_attraction_dummy() : SpellScriptLoader("spell_mother_shahraz_fatal_attraction_dummy") { }
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_dummy_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_mother_shahraz_fatal_attraction_dummy_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->CastSpell(target, SPELL_FATAL_ATTRACTION_DAMAGE, true);
|
||||
if (AuraEffect* aurEff = target->GetAuraEffect(SPELL_FATAL_ATTRACTION_AURA, EFFECT_1))
|
||||
aurEff->SetAmount(aurEff->GetTickNumber());
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_mother_shahraz_fatal_attraction_dummy_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_mother_shahraz_fatal_attraction_dummy_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_aura : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mother_shahraz_fatal_attraction_aura() : SpellScriptLoader("spell_mother_shahraz_fatal_attraction_aura") { }
|
||||
|
||||
class spell_mother_shahraz_fatal_attraction_aura_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mother_shahraz_fatal_attraction_aura_AuraScript);
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
if (effect->GetTickNumber() > uint32(effect->GetAmount()+1))
|
||||
{
|
||||
PreventDefaultAction();
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mother_shahraz_fatal_attraction_aura_AuraScript::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mother_shahraz_fatal_attraction_aura_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_mother_shahraz()
|
||||
{
|
||||
new boss_mother_shahraz();
|
||||
new spell_mother_shahraz_random_periodic();
|
||||
new spell_mother_shahraz_beam_periodic();
|
||||
new spell_mother_shahraz_saber_lash();
|
||||
new spell_mother_shahraz_fatal_attraction();
|
||||
new spell_mother_shahraz_fatal_attraction_dummy();
|
||||
new spell_mother_shahraz_fatal_attraction_aura();
|
||||
}
|
||||
@@ -1,777 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "black_temple.h"
|
||||
#include "Spell.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
//Suffering
|
||||
SUFF_SAY_FREED = 0,
|
||||
SUFF_SAY_AGGRO = 1,
|
||||
SUFF_SAY_SLAY = 2,
|
||||
SUFF_SAY_RECAP = 3,
|
||||
SUFF_SAY_AFTER = 4,
|
||||
SUFF_SAY_ENRAGE = 5,
|
||||
SUFF_EMOTE_ENRAGE = 6,
|
||||
|
||||
//Desire
|
||||
DESI_SAY_FREED = 0,
|
||||
DESI_SAY_SLAY = 1,
|
||||
DESI_SAY_SPEC = 2,
|
||||
DESI_SAY_RECAP = 3,
|
||||
DESI_SAY_AFTER = 4,
|
||||
|
||||
//Anger
|
||||
ANGER_SAY_FREED = 0,
|
||||
ANGER_SAY_SLAY = 1,
|
||||
ANGER_SAY_SPEC = 2,
|
||||
ANGER_SAY_RECAP = 3,
|
||||
ANGER_SAY_DEATH = 4
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_EMERGE_VISUAL = 50142,
|
||||
SPELL_SUMMON_ESSENCE_OF_SUFFERING = 41488,
|
||||
SPELL_SUMMON_ESSENCE_OF_DESIRE = 41493,
|
||||
SPELL_SUMMON_ESSENCE_OF_ANGER = 41496,
|
||||
SPELL_SUMMON_ENSLAVED_SOUL = 41537,
|
||||
|
||||
// Suffering
|
||||
SPELL_AURA_OF_SUFFERING = 41292,
|
||||
SPELL_AURA_OF_SUFFERING_TRIGGER = 42017,
|
||||
SPELL_ESSENCE_OF_SUFFERING_PASSIVE = 41296,
|
||||
SPELL_ESSENCE_OF_SUFFERING_PASSIVE2 = 41623,
|
||||
SPELL_FRENZY = 41305,
|
||||
SPELL_SOUL_DRAIN = 41303,
|
||||
|
||||
// Desire
|
||||
SPELL_AURA_OF_DESIRE = 41350,
|
||||
SPELL_AURA_OF_DESIRE_DAMAGE = 41352,
|
||||
SPELL_RUNE_SHIELD = 41431,
|
||||
SPELL_DEADEN = 41410,
|
||||
SPELL_SPIRIT_SHOCK = 41426,
|
||||
|
||||
// Anger
|
||||
SPELL_AURA_OF_ANGER = 41337,
|
||||
SPELL_SPITE = 41376,
|
||||
SPELL_SPITE_DAMAGE = 41377,
|
||||
SPELL_SOUL_SCREAM = 41545,
|
||||
SPELL_SEETHE = 41364
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
ACTION_ESSENCE_OF_SUFFERING = 1,
|
||||
ACTION_ESSENCE_OF_DESIRE = 2,
|
||||
ACTION_ESSENCE_OF_ANGER = 3,
|
||||
ACTION_ENGAGE_ESSENCE = 4,
|
||||
|
||||
EVENT_ESSENCE_OF_SUFFERING = 1,
|
||||
EVENT_ESSENCE_OF_DESIRE = 2,
|
||||
EVENT_ESSENCE_OF_ANGER = 3,
|
||||
EVENT_ENGAGE_ESSENCE = 4,
|
||||
EVENT_SPAWN_ENSLAVED_SOULS = 5,
|
||||
EVENT_SPAWN_SOUL = 6,
|
||||
EVENT_SUCK_ESSENCE = 7,
|
||||
|
||||
EVENT_SUFF_FRENZY = 10,
|
||||
EVENT_SUFF_FRENZY_EMOTE = 11,
|
||||
EVENT_SUFF_SOUL_DRAIN = 12,
|
||||
|
||||
EVENT_DESI_DEADEN = 20,
|
||||
EVENT_DESI_SPIRIT_SHOCK = 21,
|
||||
EVENT_DESI_RUNE_SHIELD = 22,
|
||||
|
||||
EVENT_ANGER_SPITE = 30,
|
||||
EVENT_ANGER_SOUL_SCREAM = 31,
|
||||
EVENT_ANGER_SEETHE = 32,
|
||||
|
||||
EVENT_KILL_TALK = 100,
|
||||
POINT_GO_BACK = 1
|
||||
};
|
||||
|
||||
class SuckBackEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
SuckBackEvent(Creature& owner, uint32 action) : BasicEvent(), _owner(owner), _action(action) { }
|
||||
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*diff*/)
|
||||
{
|
||||
if (_owner.IsSummon())
|
||||
if (Unit* summoner = _owner.ToTempSummon()->GetSummoner())
|
||||
{
|
||||
summoner->GetAI()->DoAction(_action);
|
||||
_owner.SetStandState(UNIT_STAND_STATE_SUBMERGED);
|
||||
_owner.DespawnOrUnsummon(200);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Creature& _owner;
|
||||
uint32 _action;
|
||||
};
|
||||
|
||||
class boss_reliquary_of_souls : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_reliquary_of_souls() : CreatureScript("boss_reliquary_of_souls") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_reliquary_of_soulsAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_reliquary_of_soulsAI : public BossAI
|
||||
{
|
||||
boss_reliquary_of_soulsAI(Creature* creature) : BossAI(creature, DATA_RELIQUARY_OF_SOULS)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->SetStandState(UNIT_STAND_STATE_SLEEP);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!who || me->getStandState() != UNIT_STAND_STATE_SLEEP || who->GetTypeId() != TYPEID_PLAYER || me->GetDistance2d(who) > 90.0f || who->ToPlayer()->IsGameMaster())
|
||||
return;
|
||||
|
||||
me->SetInCombatWithZone();
|
||||
events.ScheduleEvent(EVENT_ESSENCE_OF_SUFFERING, 5000); // ZOMG! 15000);
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_ESSENCE_OF_SUFFERING)
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
events.ScheduleEvent(EVENT_SUCK_ESSENCE, 1000);
|
||||
events.ScheduleEvent(EVENT_SPAWN_ENSLAVED_SOULS, 8000);
|
||||
events.ScheduleEvent(EVENT_ESSENCE_OF_DESIRE, 38000);
|
||||
}
|
||||
else if (param == ACTION_ESSENCE_OF_DESIRE)
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
events.ScheduleEvent(EVENT_SUCK_ESSENCE, 1000);
|
||||
events.ScheduleEvent(EVENT_SPAWN_ENSLAVED_SOULS, 8000);
|
||||
events.ScheduleEvent(EVENT_ESSENCE_OF_ANGER, 38000);
|
||||
}
|
||||
else if (param == ACTION_ESSENCE_OF_ANGER)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (summon->GetEntry() == NPC_ENSLAVED_SOUL)
|
||||
return;
|
||||
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
summon->CastSpell(summon, SPELL_EMERGE_VISUAL, true);
|
||||
events.ScheduleEvent(EVENT_ENGAGE_ESSENCE, 4000);
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit*)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void AttackStart(Unit*) { }
|
||||
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
summons.clear();
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (me->getStandState() == UNIT_STAND_STATE_SLEEP)
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SUCK_ESSENCE:
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
break;
|
||||
case EVENT_ENGAGE_ESSENCE:
|
||||
summons.DoAction(ACTION_ENGAGE_ESSENCE);
|
||||
break;
|
||||
case EVENT_ESSENCE_OF_SUFFERING:
|
||||
me->SetStandState(UNIT_STAND_STATE_SUBMERGED);
|
||||
me->CastSpell(me, SPELL_SUMMON_ESSENCE_OF_SUFFERING, false);
|
||||
break;
|
||||
case EVENT_ESSENCE_OF_DESIRE:
|
||||
summons.DespawnAll();
|
||||
me->SetStandState(UNIT_STAND_STATE_SUBMERGED);
|
||||
me->CastSpell(me, SPELL_SUMMON_ESSENCE_OF_DESIRE, false);
|
||||
break;
|
||||
case EVENT_ESSENCE_OF_ANGER:
|
||||
summons.DespawnAll();
|
||||
me->SetStandState(UNIT_STAND_STATE_SUBMERGED);
|
||||
me->CastSpell(me, SPELL_SUMMON_ESSENCE_OF_ANGER, false);
|
||||
break;
|
||||
case EVENT_SPAWN_ENSLAVED_SOULS:
|
||||
events.ScheduleEvent(EVENT_SPAWN_SOUL, 0);
|
||||
events.ScheduleEvent(EVENT_SPAWN_SOUL, 0);
|
||||
for (uint8 i = 0; i < 16; ++i)
|
||||
events.ScheduleEvent(EVENT_SPAWN_SOUL, i*1200);
|
||||
break;
|
||||
case EVENT_SPAWN_SOUL:
|
||||
me->CastCustomSpell(SPELL_SUMMON_ENSLAVED_SOUL, SPELLVALUE_MAX_TARGETS, 1, me, false);
|
||||
break;
|
||||
}
|
||||
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const
|
||||
{
|
||||
return !SelectTargetFromPlayerList(80.0f);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class boss_essence_of_suffering : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_essence_of_suffering() : CreatureScript("boss_essence_of_suffering") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_essence_of_sufferingAI(creature);
|
||||
}
|
||||
|
||||
struct boss_essence_of_sufferingAI : public ScriptedAI
|
||||
{
|
||||
boss_essence_of_sufferingAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_ENGAGE_ESSENCE)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id != POINT_GO_BACK)
|
||||
return;
|
||||
|
||||
me->m_Events.AddEvent(new SuckBackEvent(*me, ACTION_ESSENCE_OF_SUFFERING), me->m_Events.CalculateTime(1500));
|
||||
me->SetTarget(0);
|
||||
me->SetFacingTo(M_PI/2.0f);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
damage = 0;
|
||||
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_ESSENCE_OF_SUFFERING_PASSIVE); // prevent fixate from triggering
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
Talk(SUFF_SAY_RECAP);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(POINT_GO_BACK, me->GetHomePosition(), false);
|
||||
events.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SUFF_SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SUFF_SAY_FREED);
|
||||
me->CastSpell(me, SPELL_AURA_OF_SUFFERING, true);
|
||||
me->CastSpell(me, SPELL_ESSENCE_OF_SUFFERING_PASSIVE, true);
|
||||
me->CastSpell(me, SPELL_ESSENCE_OF_SUFFERING_PASSIVE2, true);
|
||||
|
||||
events.ScheduleEvent(EVENT_SUFF_FRENZY, 45000);
|
||||
events.ScheduleEvent(EVENT_SUFF_SOUL_DRAIN, 25000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SUFF_SOUL_DRAIN:
|
||||
me->CastCustomSpell(SPELL_SOUL_DRAIN, SPELLVALUE_MAX_TARGETS, 3, me, false);
|
||||
events.ScheduleEvent(EVENT_SUFF_SOUL_DRAIN, 30000);
|
||||
break;
|
||||
case EVENT_SUFF_FRENZY:
|
||||
Talk(SUFF_SAY_ENRAGE);
|
||||
Talk(SUFF_EMOTE_ENRAGE);
|
||||
me->CastSpell(me, SPELL_FRENZY, false);
|
||||
events.ScheduleEvent(EVENT_SUFF_FRENZY, 45000);
|
||||
events.ScheduleEvent(EVENT_SUFF_FRENZY_EMOTE, 3000);
|
||||
break;
|
||||
case EVENT_SUFF_FRENZY_EMOTE:
|
||||
Talk(SUFF_EMOTE_ENRAGE);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class boss_essence_of_desire : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_essence_of_desire() : CreatureScript("boss_essence_of_desire") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_essence_of_desireAI(creature);
|
||||
}
|
||||
|
||||
struct boss_essence_of_desireAI : public ScriptedAI
|
||||
{
|
||||
boss_essence_of_desireAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_ENGAGE_ESSENCE)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id != POINT_GO_BACK)
|
||||
return;
|
||||
|
||||
me->m_Events.AddEvent(new SuckBackEvent(*me, ACTION_ESSENCE_OF_DESIRE), me->m_Events.CalculateTime(1500));
|
||||
me->SetTarget(0);
|
||||
me->SetFacingTo(M_PI/2.0f);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth())
|
||||
{
|
||||
damage = 0;
|
||||
if (!me->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE))
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
Talk(DESI_SAY_RECAP);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MovePoint(POINT_GO_BACK, me->GetHomePosition(), false);
|
||||
events.Reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(DESI_SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(DESI_SAY_FREED);
|
||||
me->CastSpell(me, SPELL_AURA_OF_DESIRE, true);
|
||||
|
||||
events.ScheduleEvent(EVENT_DESI_DEADEN, 28000);
|
||||
events.ScheduleEvent(EVENT_DESI_SPIRIT_SHOCK, 20000);
|
||||
events.ScheduleEvent(EVENT_DESI_RUNE_SHIELD, 13000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_DESI_DEADEN:
|
||||
if (roll_chance_i(50))
|
||||
Talk(DESI_SAY_SPEC);
|
||||
me->CastSpell(me->GetVictim(), SPELL_DEADEN, false);
|
||||
events.ScheduleEvent(EVENT_DESI_DEADEN, 31000);
|
||||
break;
|
||||
case EVENT_DESI_SPIRIT_SHOCK:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SPIRIT_SHOCK, false);
|
||||
events.ScheduleEvent(EVENT_DESI_SPIRIT_SHOCK, 12000);
|
||||
break;
|
||||
case EVENT_DESI_RUNE_SHIELD:
|
||||
me->CastSpell(me, SPELL_RUNE_SHIELD, false);
|
||||
events.ScheduleEvent(EVENT_DESI_RUNE_SHIELD, 15000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class boss_essence_of_anger : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_essence_of_anger() : CreatureScript("boss_essence_of_anger") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_essence_of_angerAI(creature);
|
||||
}
|
||||
|
||||
struct boss_essence_of_angerAI : public ScriptedAI
|
||||
{
|
||||
boss_essence_of_angerAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
EventMap events;
|
||||
uint64 targetGUID;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
targetGUID = 0;
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_ENGAGE_ESSENCE)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(ANGER_SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
Talk(ANGER_SAY_DEATH);
|
||||
if (me->IsSummon())
|
||||
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
|
||||
Unit::Kill(summoner, summoner);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(ANGER_SAY_FREED);
|
||||
me->CastSpell(me, SPELL_AURA_OF_ANGER, true);
|
||||
|
||||
events.ScheduleEvent(EVENT_ANGER_SPITE, 15000);
|
||||
events.ScheduleEvent(EVENT_ANGER_SOUL_SCREAM, 10000);
|
||||
events.ScheduleEvent(EVENT_ANGER_SEETHE, 1000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ANGER_SPITE:
|
||||
if (roll_chance_i(30))
|
||||
Talk(ANGER_SAY_SPEC);
|
||||
me->CastCustomSpell(SPELL_SPITE, SPELLVALUE_MAX_TARGETS, 3, me, false);
|
||||
events.ScheduleEvent(EVENT_ANGER_SPITE, 25000);
|
||||
break;
|
||||
case EVENT_ANGER_SOUL_SCREAM:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SOUL_SCREAM, false);
|
||||
events.ScheduleEvent(EVENT_ANGER_SOUL_SCREAM, 10000);
|
||||
break;
|
||||
case EVENT_ANGER_SEETHE:
|
||||
if (targetGUID && targetGUID != me->GetVictim()->GetGUID())
|
||||
me->CastSpell(me, SPELL_SEETHE, false);
|
||||
// victim can be lost
|
||||
if (me->GetVictim())
|
||||
targetGUID = me->GetVictim()->GetGUID();
|
||||
events.ScheduleEvent(EVENT_ANGER_SEETHE, 1000);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_suffering : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_reliquary_of_souls_aura_of_suffering() : SpellScriptLoader("spell_reliquary_of_souls_aura_of_suffering") { }
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_suffering_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_aura_of_suffering_AuraScript)
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_AURA_OF_SUFFERING_TRIGGER, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_AURA_OF_SUFFERING_TRIGGER);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_reliquary_of_souls_aura_of_suffering_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_aura_of_suffering_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_reliquary_of_souls_aura_of_suffering_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_fixate : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_reliquary_of_souls_fixate() : SpellScriptLoader("spell_reliquary_of_souls_fixate") { }
|
||||
|
||||
class spell_reliquary_of_souls_fixate_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_reliquary_of_souls_fixate_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
targets.sort(Trinity::ObjectDistanceOrderPred(GetCaster()));
|
||||
WorldObject* target = targets.front();
|
||||
targets.clear();
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_reliquary_of_souls_fixate_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_reliquary_of_souls_fixate_SpellScript();
|
||||
}
|
||||
|
||||
class spell_reliquary_of_souls_fixate_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_fixate_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->RemoveAurasDueToSpell(GetSpellInfo()->Effects[EFFECT_1].TriggerSpell, GetTarget()->GetGUID());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_fixate_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_reliquary_of_souls_fixate_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_desire : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_reliquary_of_souls_aura_of_desire() : SpellScriptLoader("spell_reliquary_of_souls_aura_of_desire") { }
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_desire_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_aura_of_desire_AuraScript);
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
return eventInfo.GetActor() && eventInfo.GetActionTarget();
|
||||
}
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
eventInfo.GetActionTarget()->CastCustomSpell(SPELL_AURA_OF_DESIRE_DAMAGE, SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage()/2, eventInfo.GetActor(), true);
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_2))
|
||||
amount = std::max<int32>(-100, -5*int32(effect->GetTickNumber()));
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
|
||||
effect->RecalculateAmount();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::CheckProc);
|
||||
OnEffectProc += AuraEffectProcFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_MOD_HEALING_PCT);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_INCREASE_ENERGY_PERCENT);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_reliquary_of_souls_aura_of_desire_AuraScript::Update, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_reliquary_of_souls_aura_of_desire_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_anger : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_reliquary_of_souls_aura_of_anger() : SpellScriptLoader("spell_reliquary_of_souls_aura_of_anger") { }
|
||||
|
||||
class spell_reliquary_of_souls_aura_of_anger_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_aura_of_anger_AuraScript);
|
||||
|
||||
void CalculateAmount(AuraEffect const* aurEff, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
|
||||
amount = amount*effect->GetTickNumber();
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_0))
|
||||
effect->RecalculateAmount();
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
|
||||
effect->RecalculateAmount();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_anger_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_reliquary_of_souls_aura_of_anger_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_reliquary_of_souls_aura_of_anger_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_reliquary_of_souls_aura_of_anger_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_reliquary_of_souls_spite : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_reliquary_of_souls_spite() : SpellScriptLoader("spell_reliquary_of_souls_spite") { }
|
||||
|
||||
class spell_reliquary_of_souls_spite_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_reliquary_of_souls_spite_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), SPELL_SPITE_DAMAGE, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_reliquary_of_souls_spite_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DAMAGE_IMMUNITY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_reliquary_of_souls_spite_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_reliquary_of_souls()
|
||||
{
|
||||
new boss_reliquary_of_souls();
|
||||
new boss_essence_of_suffering();
|
||||
new boss_essence_of_desire();
|
||||
new boss_essence_of_anger();
|
||||
new spell_reliquary_of_souls_aura_of_suffering();
|
||||
new spell_reliquary_of_souls_fixate();
|
||||
new spell_reliquary_of_souls_aura_of_desire();
|
||||
new spell_reliquary_of_souls_aura_of_anger();
|
||||
new spell_reliquary_of_souls_spite();
|
||||
}
|
||||
@@ -1,616 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "black_temple.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_BROKEN_FREE_0 = 0,
|
||||
SAY_BROKEN_FREE_1 = 1,
|
||||
SAY_BROKEN_FREE_2 = 2,
|
||||
SAY_BROKEN_S1 = 0,
|
||||
SAY_BROKEN_S2 = 1
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_STEALTH = 34189,
|
||||
SPELL_AKAMA_SOUL_CHANNEL = 40447,
|
||||
SPELL_SHADE_SOUL_CHANNEL = 40401,
|
||||
SPELL_CHAIN_LIGHTNING = 39945,
|
||||
SPELL_DESTRUCTIVE_POISON = 40874,
|
||||
SPELL_SHADE_OF_AKAMA_TRIGGER = 40955,
|
||||
SPELL_AKAMA_SOUL_RETRIEVE = 40902,
|
||||
|
||||
SPELL_ASHTONGUE_WAVE_B = 42035,
|
||||
SPELL_SUMMON_ASHTONGUE_SORCERER = 40476,
|
||||
SPELL_SUMMON_ASHTONGUE_DEFENDER = 40474
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
NPC_ASHTONGUE_CHANNELER = 23421,
|
||||
NPC_CREATURE_GENERATOR_AKAMA = 23210,
|
||||
NPC_ASHTONGUE_SORCERER = 23215,
|
||||
NPC_ASHTONGUE_BROKEN = 23319
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
SUMMON_GROUP_BROKENS = 1,
|
||||
|
||||
POINT_START = 0,
|
||||
POINT_CHANNEL_SOUL = 1,
|
||||
|
||||
ACTION_AKAMA_DIED = 1,
|
||||
ACTION_START_ENCOUNTER = 2,
|
||||
ACTION_STOP_SPAWNING = 3,
|
||||
ACTION_DESPAWN_ALL = 4,
|
||||
ACTION_CHANNELERS_START_CHANNEL = 5,
|
||||
ACTION_KILL_CHANNELERS = 6,
|
||||
ACTION_NO_SORCERERS = 7,
|
||||
ACTION_SHADE_DIED = 8,
|
||||
|
||||
EVENT_AKAMA_START_ENCOUNTER = 1,
|
||||
EVENT_AKAMA_START_CHANNEL = 2,
|
||||
EVENT_SPELL_CHAIN_LIGHTNING = 4,
|
||||
EVENT_SPELL_DESTRUCTIVE_POISON = 5,
|
||||
|
||||
EVENT_SHADE_CHECK_DISTANCE = 10,
|
||||
EVENT_SHADE_RESET_ENCOUNTER = 11,
|
||||
EVENT_SHADE_GATHER_NPCS = 12,
|
||||
|
||||
EVENT_SUMMON_WAVE_B = 20,
|
||||
EVENT_SUMMON_ASHTONGUE_SORCERER = 21,
|
||||
EVENT_SUMMON_ASHTONGUE_DEFENDER = 22,
|
||||
|
||||
EVENT_AKAMA_SCENE0 = 29,
|
||||
EVENT_AKAMA_SCENE1 = 30,
|
||||
EVENT_AKAMA_SCENE2 = 31,
|
||||
EVENT_AKAMA_SCENE3 = 32,
|
||||
EVENT_AKAMA_SCENE4 = 33,
|
||||
EVENT_AKAMA_SCENE5 = 34,
|
||||
EVENT_AKAMA_SCENE6 = 35,
|
||||
EVENT_AKAMA_SCENE7 = 36
|
||||
};
|
||||
|
||||
class boss_shade_of_akama : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_shade_of_akama() : CreatureScript("boss_shade_of_akama") { }
|
||||
|
||||
struct boss_shade_of_akamaAI : public BossAI
|
||||
{
|
||||
boss_shade_of_akamaAI(Creature* creature) : BossAI(creature, DATA_SHADE_OF_AKAMA), summonsChanneler(me), summonsGenerator(me)
|
||||
{
|
||||
events2.ScheduleEvent(EVENT_SHADE_GATHER_NPCS, 1000);
|
||||
}
|
||||
|
||||
SummonList summonsChanneler;
|
||||
SummonList summonsGenerator;
|
||||
EventMap events2;
|
||||
|
||||
void ChannelersAction(int32 action)
|
||||
{
|
||||
for (SummonList::const_iterator i = summonsChanneler.begin(); i != summonsChanneler.end(); ++i)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *i))
|
||||
{
|
||||
if (action == ACTION_CHANNELERS_START_CHANNEL)
|
||||
{
|
||||
summon->CastSpell(me, SPELL_SHADE_SOUL_CHANNEL, true);
|
||||
summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
else if (action == ACTION_START_ENCOUNTER)
|
||||
{
|
||||
summon->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
else if (action == ACTION_KILL_CHANNELERS)
|
||||
{
|
||||
Unit::Kill(me, summon);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetWalk(true);
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
BossAI::EnterEvadeMode();
|
||||
summonsGenerator.DoAction(ACTION_DESPAWN_ALL);
|
||||
events2.ScheduleEvent(EVENT_SHADE_RESET_ENCOUNTER, 20000);
|
||||
me->SetVisible(false);
|
||||
ChannelersAction(ACTION_KILL_CHANNELERS);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
summonsGenerator.DoAction(ACTION_DESPAWN_ALL);
|
||||
summonsChanneler.DespawnAll();
|
||||
me->CastSpell(me, SPELL_SHADE_OF_AKAMA_TRIGGER, true);
|
||||
if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
|
||||
{
|
||||
akama->SetHomePosition(*akama);
|
||||
akama->AI()->DoAction(ACTION_SHADE_DIED);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_START_ENCOUNTER)
|
||||
{
|
||||
summonsGenerator.DoAction(ACTION_START_ENCOUNTER);
|
||||
ChannelersAction(ACTION_START_ENCOUNTER);
|
||||
events.ScheduleEvent(EVENT_SHADE_CHECK_DISTANCE, 1000);
|
||||
}
|
||||
else if (param == ACTION_AKAMA_DIED)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events2.Update(diff);
|
||||
switch (events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SHADE_GATHER_NPCS:
|
||||
{
|
||||
std::list<Creature*> ChannelerList;
|
||||
me->GetCreaturesWithEntryInRange(ChannelerList, 100.0f, NPC_ASHTONGUE_CHANNELER);
|
||||
for (std::list<Creature*>::const_iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr)
|
||||
summonsChanneler.Summon(*itr);
|
||||
|
||||
std::list<Creature*> SpawnerList;
|
||||
me->GetCreaturesWithEntryInRange(SpawnerList, 100.0f, NPC_CREATURE_GENERATOR_AKAMA);
|
||||
for (std::list<Creature*>::const_iterator itr = SpawnerList.begin(); itr != SpawnerList.end(); ++itr)
|
||||
summonsGenerator.Summon(*itr);
|
||||
|
||||
summonsChanneler.Respawn();
|
||||
summonsGenerator.Respawn();
|
||||
ChannelersAction(ACTION_CHANNELERS_START_CHANNEL);
|
||||
|
||||
if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
|
||||
akama->Respawn(true);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHADE_RESET_ENCOUNTER:
|
||||
me->SetVisible(true);
|
||||
summonsGenerator.Respawn();
|
||||
summonsChanneler.Respawn();
|
||||
ChannelersAction(ACTION_CHANNELERS_START_CHANNEL);
|
||||
|
||||
if (Creature* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
|
||||
akama->Respawn(true);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SHADE_CHECK_DISTANCE:
|
||||
if (me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE)
|
||||
{
|
||||
int32 slow = me->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
|
||||
if (slow > -100)
|
||||
{
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_START, 510.0f, 400.7993f, 112.7837f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
int32 slow = me->GetMaxNegativeAuraModifier(SPELL_AURA_MOD_DECREASE_SPEED);
|
||||
if (slow < -100)
|
||||
me->GetMotionMaster()->Clear();
|
||||
else if (slow == 0)
|
||||
{
|
||||
summonsGenerator.DoAction(ACTION_NO_SORCERERS);
|
||||
me->SetWalk(false);
|
||||
}
|
||||
}
|
||||
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
DoResetThreat();
|
||||
me->GetVictim()->InterruptNonMeleeSpells(false);
|
||||
me->AddThreat(me->GetVictim(), 1000000.0f);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC|UNIT_FLAG_NOT_SELECTABLE);
|
||||
summonsGenerator.DoAction(ACTION_STOP_SPAWNING);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SHADE_CHECK_DISTANCE, 1000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const
|
||||
{
|
||||
return !SelectTargetFromPlayerList(120.0f);
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_shade_of_akamaAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_akama_shade : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_akama_shade() : CreatureScript("npc_akama_shade") { }
|
||||
|
||||
struct npc_akamaAI : public ScriptedAI
|
||||
{
|
||||
npc_akamaAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
EventMap events2;
|
||||
SummonList summons;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (instance->GetBossState(DATA_SHADE_OF_AKAMA) == DONE)
|
||||
{
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
return;
|
||||
}
|
||||
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
me->CastSpell(me, SPELL_STEALTH, true);
|
||||
events.Reset();
|
||||
events2.Reset();
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 point)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || point != POINT_CHANNEL_SOUL)
|
||||
return;
|
||||
|
||||
me->SetFacingTo(0.0f);
|
||||
events2.ScheduleEvent(EVENT_AKAMA_SCENE1, 1000);
|
||||
events2.ScheduleEvent(EVENT_AKAMA_SCENE2, 16500);
|
||||
events2.ScheduleEvent(EVENT_AKAMA_SCENE3, 17500);
|
||||
events2.ScheduleEvent(EVENT_AKAMA_SCENE4, 27000);
|
||||
events2.ScheduleEvent(EVENT_AKAMA_SCENE5, 37000);
|
||||
events2.ScheduleEvent(EVENT_AKAMA_SCENE6, 51000);
|
||||
events2.ScheduleEvent(EVENT_AKAMA_SCENE7, 56000);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_SHADE_DIED)
|
||||
events2.ScheduleEvent(EVENT_AKAMA_SCENE0, 1000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Creature* shade = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_SHADE_OF_AKAMA)))
|
||||
shade->AI()->DoAction(ACTION_AKAMA_DIED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_CHAIN_LIGHTNING, 2000);
|
||||
events.ScheduleEvent(EVENT_SPELL_DESTRUCTIVE_POISON, 5000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
float dist = frand(30.0f, 32.0f);
|
||||
summon->SetWalk(true);
|
||||
summon->GetMotionMaster()->MovePoint(POINT_START, summon->GetPositionX()+dist*cos(summon->GetOrientation()), summon->GetPositionY()+dist*sin(summon->GetOrientation()), summon->GetPositionZ(), false);
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events2.Update(diff);
|
||||
switch (events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_AKAMA_START_ENCOUNTER:
|
||||
me->RemoveAura(SPELL_STEALTH);
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_START, 517.4877f, 400.7993f, 112.7837f, false);
|
||||
events2.ScheduleEvent(EVENT_AKAMA_START_CHANNEL, 11000);
|
||||
break;
|
||||
case EVENT_AKAMA_START_CHANNEL:
|
||||
me->CastSpell(me, SPELL_AKAMA_SOUL_CHANNEL, false);
|
||||
if (Creature* shade = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_SHADE_OF_AKAMA)))
|
||||
{
|
||||
shade->AI()->AttackStart(me);
|
||||
shade->GetMotionMaster()->Clear();
|
||||
shade->AI()->DoAction(ACTION_START_ENCOUNTER);
|
||||
}
|
||||
break;
|
||||
case EVENT_AKAMA_SCENE0:
|
||||
me->SetWalk(true);
|
||||
me->GetMotionMaster()->MovePoint(POINT_CHANNEL_SOUL, 467.0f, 400.7993f, 118.537f);
|
||||
break;
|
||||
case EVENT_AKAMA_SCENE1:
|
||||
me->CastSpell(me, SPELL_AKAMA_SOUL_RETRIEVE, true);
|
||||
break;
|
||||
case EVENT_AKAMA_SCENE2:
|
||||
Talk(SAY_BROKEN_FREE_0);
|
||||
break;
|
||||
case EVENT_AKAMA_SCENE3:
|
||||
me->SummonCreatureGroup(SUMMON_GROUP_BROKENS);
|
||||
break;
|
||||
case EVENT_AKAMA_SCENE4:
|
||||
Talk(SAY_BROKEN_FREE_1);
|
||||
break;
|
||||
case EVENT_AKAMA_SCENE5:
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* broken = ObjectAccessor::GetCreature(*me, *itr))
|
||||
broken->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
Talk(SAY_BROKEN_FREE_2);
|
||||
break;
|
||||
case EVENT_AKAMA_SCENE6:
|
||||
if (Creature* broken = summons.GetCreatureWithEntry(NPC_ASHTONGUE_BROKEN))
|
||||
broken->AI()->Talk(SAY_BROKEN_S1);
|
||||
break;
|
||||
case EVENT_AKAMA_SCENE7:
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* broken = ObjectAccessor::GetCreature(*me, *itr))
|
||||
broken->AI()->Talk(SAY_BROKEN_S2);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_CHAIN_LIGHTNING:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CHAIN_LIGHTNING, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_CHAIN_LIGHTNING, urand(10000, 15000));
|
||||
break;
|
||||
case EVENT_SPELL_DESTRUCTIVE_POISON:
|
||||
me->CastSpell(me, SPELL_DESTRUCTIVE_POISON, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_DESTRUCTIVE_POISON, urand(4000, 5000));
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void sGossipSelect(Player* player, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
if (action == 0)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
events2.ScheduleEvent(EVENT_AKAMA_START_ENCOUNTER, 0);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_akamaAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
// ########################################################
|
||||
// Creature Generator Akama
|
||||
// ########################################################
|
||||
|
||||
class npc_creature_generator_akama : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_creature_generator_akama() : CreatureScript("npc_creature_generator_akama") { }
|
||||
|
||||
struct npc_creature_generator_akamaAI : public NullCreatureAI
|
||||
{
|
||||
npc_creature_generator_akamaAI(Creature* creature) : NullCreatureAI(creature), summons(me)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (summon->GetEntry() == NPC_ASHTONGUE_SORCERER)
|
||||
{
|
||||
std::list<Creature*> channelerList;
|
||||
me->GetCreaturesWithEntryInRange(channelerList, 120.0f, NPC_ASHTONGUE_CHANNELER);
|
||||
for (std::list<Creature*>::const_iterator itr = channelerList.begin(); itr != channelerList.end(); ++itr)
|
||||
{
|
||||
if ((*itr)->IsAlive() || (*itr)->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE))
|
||||
continue;
|
||||
|
||||
summon->SetInCombatWithZone();
|
||||
summon->SetReactState(REACT_PASSIVE);
|
||||
summon->GetMotionMaster()->MovePoint(POINT_START, **itr);
|
||||
(*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
summon->SetInCombatWithZone();
|
||||
if (Unit* akama = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_AKAMA_SHADE)))
|
||||
{
|
||||
summon->AddThreat(akama, 500.0f);
|
||||
summon->AI()->AttackStart(akama);
|
||||
}
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit*)
|
||||
{
|
||||
summon->DespawnOrUnsummon(10000);
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_STOP_SPAWNING || param == ACTION_DESPAWN_ALL)
|
||||
{
|
||||
events.Reset();
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
{
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
{
|
||||
if (summon->GetEntry() != NPC_ASHTONGUE_SORCERER)
|
||||
continue;
|
||||
summon->InterruptNonMeleeSpells(false);
|
||||
summon->GetMotionMaster()->Clear();
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (param == ACTION_DESPAWN_ALL)
|
||||
summons.DespawnAll();
|
||||
else if (param == ACTION_NO_SORCERERS)
|
||||
events.CancelEvent(EVENT_SUMMON_ASHTONGUE_SORCERER);
|
||||
else if (param == ACTION_START_ENCOUNTER)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SUMMON_WAVE_B, 5000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_DEFENDER, 20000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_SORCERER, 35000);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events.Update(diff);
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SUMMON_WAVE_B:
|
||||
me->CastSpell(me, SPELL_ASHTONGUE_WAVE_B, true);
|
||||
events.ScheduleEvent(EVENT_SUMMON_WAVE_B, 45000);
|
||||
break;
|
||||
case EVENT_SUMMON_ASHTONGUE_SORCERER: // left
|
||||
me->CastSpell(me, SPELL_SUMMON_ASHTONGUE_SORCERER, true);
|
||||
events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_SORCERER, 45000);
|
||||
break;
|
||||
case EVENT_SUMMON_ASHTONGUE_DEFENDER: // right
|
||||
me->CastSpell(me, SPELL_SUMMON_ASHTONGUE_DEFENDER, true);
|
||||
events.ScheduleEvent(EVENT_SUMMON_ASHTONGUE_DEFENDER, 45000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
InstanceScript* instance;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_creature_generator_akamaAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_shade_of_akama_shade_soul_channel : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_shade_of_akama_shade_soul_channel() : SpellScriptLoader("spell_shade_of_akama_shade_soul_channel") { }
|
||||
|
||||
class spell_shade_of_akama_shade_soul_channel_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_shade_of_akama_shade_soul_channel_AuraScript)
|
||||
|
||||
void HandleEffectApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->SetFacingToObject(GetTarget());
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Aura* aura = GetTarget()->GetAura(GetSpellInfo()->Effects[EFFECT_1].TriggerSpell))
|
||||
aura->ModStackAmount(-1);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_shade_of_akama_shade_soul_channel_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_shade_of_akama_shade_soul_channel_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_shade_of_akama_shade_soul_channel_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_shade_of_akama_akama_soul_expel : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_shade_of_akama_akama_soul_expel() : SpellScriptLoader("spell_shade_of_akama_akama_soul_expel") { }
|
||||
|
||||
class spell_shade_of_akama_akama_soul_expel_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_shade_of_akama_akama_soul_expel_SpellScript);
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
// Adjust effect summon position
|
||||
Position const offset = { 0.0f, 0.0f, 25.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_shade_of_akama_akama_soul_expel_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_RADIUS);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_shade_of_akama_akama_soul_expel_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_shade_of_akama()
|
||||
{
|
||||
new boss_shade_of_akama();
|
||||
new npc_akama_shade();
|
||||
new npc_creature_generator_akama();
|
||||
new spell_shade_of_akama_shade_soul_channel();
|
||||
new spell_shade_of_akama_akama_soul_expel();
|
||||
}
|
||||
@@ -1,197 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "black_temple.h"
|
||||
|
||||
enum Supremus
|
||||
{
|
||||
EMOTE_NEW_TARGET = 0,
|
||||
EMOTE_PUNCH_GROUND = 1,
|
||||
EMOTE_GROUND_CRACK = 2,
|
||||
|
||||
SPELL_SNARE_SELF = 41922,
|
||||
SPELL_MOLTEN_PUNCH = 40126,
|
||||
SPELL_HATEFUL_STRIKE = 41926,
|
||||
SPELL_VOLCANIC_ERUPTION = 40276,
|
||||
SPELL_VOLCANIC_ERUPTION_TRIGGER = 40117,
|
||||
SPELL_BERSERK = 45078,
|
||||
SPELL_CHARGE = 41581,
|
||||
|
||||
NPC_SUPREMUS_PUNCH_STALKER = 23095,
|
||||
|
||||
EVENT_SPELL_BERSERK = 1,
|
||||
EVENT_SPELL_HATEFUL_STRIKE = 2,
|
||||
EVENT_SPELL_MOLTEN_FLAMES = 3,
|
||||
EVENT_SWITCH_PHASE = 4,
|
||||
EVENT_SPELL_VOLCANIC_ERUPTION = 5,
|
||||
EVENT_SWITCH_TARGET = 6,
|
||||
EVENT_CHECK_DIST = 7,
|
||||
|
||||
EVENT_GROUP_ABILITIES = 1
|
||||
};
|
||||
|
||||
class boss_supremus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_supremus() : CreatureScript("boss_supremus") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_supremusAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_supremusAI : public BossAI
|
||||
{
|
||||
boss_supremusAI(Creature* creature) : BossAI(creature, DATA_SUPREMUS)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
|
||||
SchedulePhase(false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BERSERK, 900000);
|
||||
events.ScheduleEvent(EVENT_SPELL_MOLTEN_FLAMES, 4000);
|
||||
}
|
||||
|
||||
void SchedulePhase(bool run)
|
||||
{
|
||||
events.CancelEventGroup(EVENT_GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000);
|
||||
DoResetThreat();
|
||||
|
||||
if (!run)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_HATEFUL_STRIKE, 5000, EVENT_GROUP_ABILITIES);
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, false);
|
||||
me->RemoveAurasDueToSpell(SPELL_SNARE_SELF);
|
||||
}
|
||||
else
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_VOLCANIC_ERUPTION, 5000, EVENT_GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_SWITCH_TARGET, 0, EVENT_GROUP_ABILITIES);
|
||||
events.ScheduleEvent(EVENT_CHECK_DIST, 0, EVENT_GROUP_ABILITIES);
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_ATTACK_ME, true);
|
||||
me->CastSpell(me, SPELL_SNARE_SELF, true);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (summon->GetEntry() == NPC_SUPREMUS_PUNCH_STALKER)
|
||||
{
|
||||
summon->ToTempSummon()->InitStats(20000);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
summon->GetMotionMaster()->MoveFollow(target, 0.0f, 0.0f, MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
else
|
||||
summon->CastSpell(summon, SPELL_VOLCANIC_ERUPTION_TRIGGER, true);
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* summon)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
Unit* FindHatefulStrikeTarget()
|
||||
{
|
||||
Unit* target = NULL;
|
||||
ThreatContainer::StorageType const &threatlist = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator i = threatlist.begin(); i != threatlist.end(); ++i)
|
||||
{
|
||||
Unit* unit = ObjectAccessor::GetUnit(*me, (*i)->getUnitGuid());
|
||||
if (unit && me->IsWithinMeleeRange(unit))
|
||||
if (!target || unit->GetHealth() > target->GetHealth())
|
||||
target = unit;
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
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_SPELL_HATEFUL_STRIKE:
|
||||
if (Unit* target = FindHatefulStrikeTarget())
|
||||
me->CastSpell(target, SPELL_HATEFUL_STRIKE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_HATEFUL_STRIKE, urand(1500, 3000), EVENT_GROUP_ABILITIES);
|
||||
break;
|
||||
case EVENT_SPELL_MOLTEN_FLAMES:
|
||||
me->CastSpell(me, SPELL_MOLTEN_PUNCH, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_MOLTEN_FLAMES, 20000, EVENT_GROUP_ABILITIES);
|
||||
break;
|
||||
case EVENT_SWITCH_PHASE:
|
||||
SchedulePhase(!me->HasAura(SPELL_SNARE_SELF));
|
||||
break;
|
||||
case EVENT_SWITCH_TARGET:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
DoResetThreat();
|
||||
me->AddThreat(target, 5000000.0f);
|
||||
Talk(EMOTE_NEW_TARGET);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, EVENT_GROUP_ABILITIES);
|
||||
break;
|
||||
case EVENT_CHECK_DIST:
|
||||
if (me->GetDistance(me->GetVictim()) > 40.0f)
|
||||
{
|
||||
Talk(EMOTE_PUNCH_GROUND);
|
||||
me->CastSpell(me->GetVictim(), SPELL_CHARGE, true);
|
||||
events.ScheduleEvent(EVENT_CHECK_DIST, 5000, EVENT_GROUP_ABILITIES);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_DIST, 1, EVENT_GROUP_ABILITIES);
|
||||
break;
|
||||
case EVENT_SPELL_VOLCANIC_ERUPTION:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true))
|
||||
{
|
||||
me->CastSpell(target, SPELL_VOLCANIC_ERUPTION, true);
|
||||
Talk(EMOTE_GROUND_CRACK);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_VOLCANIC_ERUPTION, urand(10000, 18000), EVENT_GROUP_ABILITIES);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const
|
||||
{
|
||||
return me->GetPositionX() < 565 || me->GetPositionX() > 865 || me->GetPositionY() < 545 || me->GetPositionY() > 1000;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
void AddSC_boss_supremus()
|
||||
{
|
||||
new boss_supremus();
|
||||
}
|
||||
@@ -1,333 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "black_temple.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_BLOSSOM = 3,
|
||||
SAY_INCINERATE = 4,
|
||||
SAY_CRUSHING = 5,
|
||||
SAY_DEATH = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_INCINERATE = 40239,
|
||||
SPELL_SUMMON_DOOM_BLOSSOM = 40188,
|
||||
SPELL_CRUSHING_SHADOWS = 40243,
|
||||
SPELL_SHADOW_OF_DEATH = 40251,
|
||||
SPELL_SHADOW_OF_DEATH_REMOVE = 41999,
|
||||
SPELL_SUMMON_SPIRIT = 40266,
|
||||
SPELL_SUMMON_SKELETON1 = 40270,
|
||||
SPELL_SUMMON_SKELETON2 = 41948,
|
||||
SPELL_SUMMON_SKELETON3 = 41949,
|
||||
SPELL_SUMMON_SKELETON4 = 41950,
|
||||
SPELL_POSSESS_SPIRIT_IMMUNE = 40282,
|
||||
SPELL_SPIRITUAL_VENGEANCE = 40268,
|
||||
SPELL_BRIEF_STUN = 41421,
|
||||
|
||||
SPELL_SPIRIT_LANCE = 40157,
|
||||
SPELL_SPIRIT_CHAINS = 40175,
|
||||
SPELL_SPIRIT_VOLLEY = 40314
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
SET_DATA_INTRO = 1,
|
||||
|
||||
EVENT_SPELL_INCINERATE = 1,
|
||||
EVENT_SPELL_DOOM_BLOSSOM = 2,
|
||||
EVENT_SPELL_CRUSHING_SHADOWS = 3,
|
||||
EVENT_SPELL_SHADOW_OF_DEATH = 4,
|
||||
EVENT_TALK_KILL = 10
|
||||
};
|
||||
|
||||
struct ShadowOfDeathSelector : public std::unary_function<Unit*, bool>
|
||||
{
|
||||
bool operator()(Unit const* target) const
|
||||
{
|
||||
return target && !target->HasAura(SPELL_SHADOW_OF_DEATH) && !target->HasAura(SPELL_POSSESS_SPIRIT_IMMUNE);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_teron_gorefiend : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_teron_gorefiend() : CreatureScript("boss_teron_gorefiend") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_teron_gorefiendAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_teron_gorefiendAI : public BossAI
|
||||
{
|
||||
boss_teron_gorefiendAI(Creature* creature) : BossAI(creature, DATA_TERON_GOREFIEND)
|
||||
{
|
||||
intro = false;
|
||||
}
|
||||
|
||||
bool intro;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->CastSpell(me, SPELL_SHADOW_OF_DEATH_REMOVE, true);
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 id)
|
||||
{
|
||||
if (type || !me->IsAlive())
|
||||
return;
|
||||
|
||||
if (id == SET_DATA_INTRO && !intro)
|
||||
{
|
||||
intro = true;
|
||||
Talk(SAY_INTRO);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
events.ScheduleEvent(EVENT_SPELL_INCINERATE, 24000);
|
||||
events.ScheduleEvent(EVENT_SPELL_DOOM_BLOSSOM, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CRUSHING_SHADOWS, 17000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SHADOW_OF_DEATH, 20000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_TALK_KILL) == 0)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_TALK_KILL, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
me->CastSpell(me, SPELL_SHADOW_OF_DEATH_REMOVE, true);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() )
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_INCINERATE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_INCINERATE);
|
||||
me->CastSpell(target, SPELL_INCINERATE, false);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_INCINERATE, 25000);
|
||||
break;
|
||||
case EVENT_SPELL_DOOM_BLOSSOM:
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_BLOSSOM);
|
||||
|
||||
me->CastSpell(me, SPELL_SUMMON_DOOM_BLOSSOM, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_DOOM_BLOSSOM, 40000);
|
||||
break;
|
||||
case EVENT_SPELL_CRUSHING_SHADOWS:
|
||||
if (roll_chance_i(20))
|
||||
Talk(SAY_CRUSHING);
|
||||
me->CastCustomSpell(SPELL_CRUSHING_SHADOWS, SPELLVALUE_MAX_TARGETS, 5, me, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_CRUSHING_SHADOWS, 15000);
|
||||
break;
|
||||
case EVENT_SPELL_SHADOW_OF_DEATH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, ShadowOfDeathSelector()))
|
||||
me->CastSpell(target, SPELL_SHADOW_OF_DEATH, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_SHADOW_OF_DEATH, 30000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const
|
||||
{
|
||||
return me->GetDistance(me->GetHomePosition()) > 100.0f;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_teron_gorefiend_shadow_of_death : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_teron_gorefiend_shadow_of_death() : SpellScriptLoader("spell_teron_gorefiend_shadow_of_death") { }
|
||||
|
||||
class spell_teron_gorefiend_shadow_of_death_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_teron_gorefiend_shadow_of_death_AuraScript)
|
||||
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
InstanceScript* instance = GetTarget()->GetInstanceScript();
|
||||
if (!GetCaster() || !instance || !instance->IsEncounterInProgress())
|
||||
return;
|
||||
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_SPIRIT, true);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_POSSESS_SPIRIT_IMMUNE, true);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SPIRITUAL_VENGEANCE, true);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_SKELETON1, true);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_SKELETON2, true);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_SKELETON3, true);
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_SUMMON_SKELETON4, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectAbsorb += AuraEffectAbsorbFn(spell_teron_gorefiend_shadow_of_death_AuraScript::Absorb, EFFECT_0);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_teron_gorefiend_shadow_of_death_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_teron_gorefiend_shadow_of_death_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_teron_gorefiend_spirit_lance : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_teron_gorefiend_spirit_lance() : SpellScriptLoader("spell_teron_gorefiend_spirit_lance") { }
|
||||
|
||||
class spell_teron_gorefiend_spirit_lance_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_teron_gorefiend_spirit_lance_AuraScript);
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_2))
|
||||
amount -= (amount / effect->GetTotalTicks()) * effect->GetTickNumber();
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (AuraEffect* effect = GetAura()->GetEffect(EFFECT_1))
|
||||
effect->RecalculateAmount();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_teron_gorefiend_spirit_lance_AuraScript::CalculateAmount, EFFECT_1, SPELL_AURA_MOD_DECREASE_SPEED);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_teron_gorefiend_spirit_lance_AuraScript::Update, EFFECT_2, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_teron_gorefiend_spirit_lance_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_teron_gorefiend_spiritual_vengeance : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_teron_gorefiend_spiritual_vengeance() : SpellScriptLoader("spell_teron_gorefiend_spiritual_vengeance") { }
|
||||
|
||||
class spell_teron_gorefiend_spiritual_vengeance_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_teron_gorefiend_spiritual_vengeance_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit::Kill(NULL, GetTarget());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_teron_gorefiend_spiritual_vengeance_AuraScript::HandleEffectRemove, EFFECT_2, SPELL_AURA_MOD_PACIFY_SILENCE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_teron_gorefiend_spiritual_vengeance_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_teron_gorefiend_shadowy_construct : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_teron_gorefiend_shadowy_construct() : SpellScriptLoader("spell_teron_gorefiend_shadowy_construct") { }
|
||||
|
||||
class spell_teron_gorefiend_shadowy_construct_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_teron_gorefiend_shadowy_construct_AuraScript)
|
||||
|
||||
bool Load()
|
||||
{
|
||||
return GetUnitOwner()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NORMAL, true);
|
||||
GetUnitOwner()->ApplySpellImmune(0, IMMUNITY_ALLOW_ID, SPELL_SPIRIT_LANCE, true);
|
||||
GetUnitOwner()->ApplySpellImmune(0, IMMUNITY_ALLOW_ID, SPELL_SPIRIT_CHAINS, true);
|
||||
GetUnitOwner()->ApplySpellImmune(0, IMMUNITY_ALLOW_ID, SPELL_SPIRIT_VOLLEY, true);
|
||||
|
||||
GetUnitOwner()->ToCreature()->SetInCombatWithZone();
|
||||
Map::PlayerList const& playerList = GetUnitOwner()->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator i = playerList.begin(); i != playerList.end(); ++i)
|
||||
if (Player* player = i->GetSource())
|
||||
{
|
||||
if (GetUnitOwner()->IsValidAttackTarget(player))
|
||||
GetUnitOwner()->AddThreat(player, 1000000.0f);
|
||||
}
|
||||
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_BRIEF_STUN, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectApply += AuraEffectApplyFn(spell_teron_gorefiend_shadowy_construct_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_teron_gorefiend_shadowy_construct_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_teron_gorefiend()
|
||||
{
|
||||
new boss_teron_gorefiend();
|
||||
new spell_teron_gorefiend_shadow_of_death();
|
||||
new spell_teron_gorefiend_spirit_lance();
|
||||
new spell_teron_gorefiend_spiritual_vengeance();
|
||||
new spell_teron_gorefiend_shadowy_construct();
|
||||
}
|
||||
@@ -1,194 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "black_temple.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_NEEDLE = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_SPECIAL = 3,
|
||||
SAY_ENRAGE = 4,
|
||||
SAY_DEATH = 5
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_NEEDLE_SPINE = 39992,
|
||||
SPELL_NEEDLE_SPINE_DAMAGE = 39835,
|
||||
SPELL_TIDAL_BURST = 39878,
|
||||
SPELL_TIDAL_SHIELD = 39872,
|
||||
SPELL_IMPALING_SPINE = 39837,
|
||||
SPELL_SUMMON_IMPALING_SPINE = 39929,
|
||||
SPELL_BERSERK = 26662
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_SPELL_BERSERK = 1,
|
||||
EVENT_YELL = 2,
|
||||
EVENT_SPELL_NEEDLE = 3,
|
||||
EVENT_SPELL_SPINE = 4,
|
||||
EVENT_SPELL_SHIELD = 5,
|
||||
EVENT_KILL_SPEAK = 6
|
||||
};
|
||||
|
||||
class boss_najentus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_najentus() : CreatureScript("boss_najentus") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_najentusAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_najentusAI : public BossAI
|
||||
{
|
||||
boss_najentusAI(Creature* creature) : BossAI(creature, DATA_HIGH_WARLORD_NAJENTUS)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && events.GetNextEventTime(EVENT_KILL_SPEAK) == 0)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_SPEAK, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
BossAI::JustDied(killer);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_SPELL_BERSERK, 480000);
|
||||
events.ScheduleEvent(EVENT_YELL, urand(25000, 100000));
|
||||
events.RescheduleEvent(EVENT_SPELL_NEEDLE, 10000);
|
||||
events.RescheduleEvent(EVENT_SPELL_SPINE, 20001);
|
||||
events.RescheduleEvent(EVENT_SPELL_SHIELD, 60000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHIELD:
|
||||
me->CastSpell(me, SPELL_TIDAL_SHIELD, false);
|
||||
events.DelayEvents(10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SHIELD, 60000);
|
||||
break;
|
||||
case EVENT_SPELL_BERSERK:
|
||||
Talk(SAY_ENRAGE);
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
case EVENT_SPELL_NEEDLE:
|
||||
me->CastCustomSpell(SPELL_NEEDLE_SPINE, SPELLVALUE_MAX_TARGETS, 3, me, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_NEEDLE, 15000);
|
||||
break;
|
||||
case EVENT_SPELL_SPINE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
{
|
||||
me->CastSpell(target, SPELL_IMPALING_SPINE, false);
|
||||
target->CastSpell(target, SPELL_SUMMON_IMPALING_SPINE, true);
|
||||
Talk(SAY_NEEDLE);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_SPINE, 20000);
|
||||
return;
|
||||
case EVENT_YELL:
|
||||
Talk(SAY_SPECIAL);
|
||||
events.ScheduleEvent(EVENT_YELL, urand(25000, 100000));
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_najentus_needle_spine : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_najentus_needle_spine() : SpellScriptLoader("spell_najentus_needle_spine") { }
|
||||
|
||||
class spell_najentus_needle_spine_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_najentus_needle_spine_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, SPELL_NEEDLE_SPINE_DAMAGE, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_najentus_needle_spine_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_najentus_needle_spine_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_najentus_hurl_spine : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_najentus_hurl_spine() : SpellScriptLoader("spell_najentus_hurl_spine") { }
|
||||
|
||||
class spell_najentus_hurl_spine_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_najentus_hurl_spine_SpellScript);
|
||||
|
||||
void HandleSchoolDamage(SpellEffIndex effIndex)
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
if (target && target->HasAura(SPELL_TIDAL_SHIELD))
|
||||
{
|
||||
target->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD);
|
||||
target->CastSpell(target, SPELL_TIDAL_BURST, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_najentus_hurl_spine_SpellScript::HandleSchoolDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_najentus_hurl_spine_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_najentus()
|
||||
{
|
||||
new boss_najentus();
|
||||
new spell_najentus_needle_spine();
|
||||
new spell_najentus_hurl_spine();
|
||||
}
|
||||
@@ -1,753 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "black_temple.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_COUNCIL_AGGRO = 0,
|
||||
SAY_COUNCIL_ENRAGE = 1,
|
||||
SAY_COUNCIL_SPECIAL = 2,
|
||||
SAY_COUNCIL_SLAY = 3,
|
||||
SAY_COUNCIL_DEATH = 4
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_EMPYREAL_BALANCE = 41499,
|
||||
SPELL_BERSERK = 41924,
|
||||
|
||||
// Gathios the Shatterer
|
||||
SPELL_BLESSING_OF_PROTECTION = 41450,
|
||||
SPELL_BLESSING_OF_SPELL_WARDING = 41451,
|
||||
SPELL_CONSECRATION = 41541,
|
||||
SPELL_HAMMER_OF_JUSTICE = 41468,
|
||||
SPELL_SEAL_OF_COMMAND = 41469,
|
||||
SPELL_SEAL_OF_BLOOD = 41459,
|
||||
SPELL_CHROMATIC_RESISTANCE_AURA = 41453,
|
||||
SPELL_DEVOTION_AURA = 41452,
|
||||
SPELL_JUDGEMENT = 41467,
|
||||
|
||||
// High Nethermancer Zerevor
|
||||
SPELL_FLAMESTRIKE = 41481,
|
||||
SPELL_BLIZZARD = 41482,
|
||||
SPELL_ARCANE_BOLT = 41483,
|
||||
SPELL_ARCANE_EXPLOSION = 41524,
|
||||
SPELL_DAMPEN_MAGIC = 41478,
|
||||
|
||||
// Lady Malande
|
||||
SPELL_EMPOWERED_SMITE = 41471,
|
||||
SPELL_CIRCLE_OF_HEALING = 41455,
|
||||
SPELL_REFLECTIVE_SHIELD = 41475,
|
||||
SPELL_REFLECTIVE_SHIELD_T = 33619,
|
||||
SPELL_DIVINE_WRATH = 41472,
|
||||
SPELL_HEAL_VISUAL = 24171,
|
||||
|
||||
// Veras Darkshadow
|
||||
SPELL_DEADLY_STRIKE = 41480,
|
||||
SPELL_DEADLY_POISON = 41485,
|
||||
SPELL_ENVENOM = 41487,
|
||||
SPELL_VANISH = 41476,
|
||||
SPELL_VANISH_OUT = 41479,
|
||||
SPELL_VANISH_VISUAL = 24222
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
ACTION_START_ENCOUNTER = 1,
|
||||
ACTION_END_ENCOUNTER = 2,
|
||||
ACTION_ENRAGE = 3,
|
||||
|
||||
EVENT_SPELL_BLESSING = 1,
|
||||
EVENT_SPELL_AURA = 2,
|
||||
EVENT_SPELL_SEAL = 3,
|
||||
EVENT_SPELL_HAMMER_OF_JUSTICE = 4,
|
||||
EVENT_SPELL_JUDGEMENT = 5,
|
||||
EVENT_SPELL_CONSECRATION = 6,
|
||||
|
||||
EVENT_SPELL_FLAMESTRIKE = 10,
|
||||
EVENT_SPELL_BLIZZARD = 11,
|
||||
EVENT_SPELL_ARCANE_BOLT = 12,
|
||||
EVENT_SPELL_DAMPEN_MAGIC = 13,
|
||||
EVENT_SPELL_ARCANE_EXPLOSION = 14,
|
||||
|
||||
EVENT_SPELL_REFLECTIVE_SHIELD = 20,
|
||||
EVENT_SPELL_CIRCLE_OF_HEALING = 21,
|
||||
EVENT_SPELL_DIVINE_WRATH = 22,
|
||||
EVENT_SPELL_EMPOWERED_SMITE = 23,
|
||||
|
||||
EVENT_SPELL_VANISH = 30,
|
||||
EVENT_SPELL_VANISH_OUT = 31,
|
||||
EVENT_SPELL_ENRAGE = 32,
|
||||
|
||||
EVENT_KILL_TALK = 100
|
||||
};
|
||||
|
||||
struct HammerOfJusticeSelector : public std::unary_function<Unit*, bool>
|
||||
{
|
||||
Unit const* _me;
|
||||
HammerOfJusticeSelector(Unit* me) : _me(me) { }
|
||||
|
||||
bool operator()(Unit const* target) const
|
||||
{
|
||||
return target && target->GetTypeId() == TYPEID_PLAYER && _me->IsInRange(target, 10.0f, 40.0f, true);
|
||||
}
|
||||
};
|
||||
|
||||
class VerasEnvenom : public BasicEvent
|
||||
{
|
||||
public:
|
||||
VerasEnvenom(Unit& owner, uint64 targetGUID) : _owner(owner), _targetGUID(targetGUID) { }
|
||||
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
|
||||
{
|
||||
if (Player* target = ObjectAccessor::GetPlayer(_owner, _targetGUID))
|
||||
{
|
||||
target->m_clientGUIDs.insert(_owner.GetGUID());
|
||||
_owner.CastSpell(target, SPELL_ENVENOM, true);
|
||||
target->RemoveAurasDueToSpell(SPELL_DEADLY_POISON);
|
||||
target->m_clientGUIDs.erase(_owner.GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Unit& _owner;
|
||||
uint64 _targetGUID;
|
||||
};
|
||||
|
||||
class boss_illidari_council : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_illidari_council() : CreatureScript("boss_illidari_council") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_illidari_councilAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_illidari_councilAI : public BossAI
|
||||
{
|
||||
boss_illidari_councilAI(Creature* creature) : BossAI(creature, DATA_ILLIDARI_COUNCIL)
|
||||
{
|
||||
memset(councilGUIDs, 0, sizeof(councilGUIDs));
|
||||
}
|
||||
|
||||
uint64 councilGUIDs[4];
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
Creature* member = NULL;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (member = ObjectAccessor::GetCreature(*me, councilGUIDs[i]))
|
||||
member->AI()->EnterEvadeMode();
|
||||
}
|
||||
|
||||
void AttackStart(Unit*) { }
|
||||
void MoveInLineOfSight(Unit*) { }
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (!me->isActiveObject() && param == ACTION_START_ENCOUNTER)
|
||||
{
|
||||
me->setActive(true);
|
||||
councilGUIDs[0] = instance->GetData64(NPC_GATHIOS_THE_SHATTERER);
|
||||
councilGUIDs[1] = instance->GetData64(NPC_HIGH_NETHERMANCER_ZEREVOR);
|
||||
councilGUIDs[2] = instance->GetData64(NPC_LADY_MALANDE);
|
||||
councilGUIDs[3] = instance->GetData64(NPC_VERAS_DARKSHADOW);
|
||||
|
||||
bool spoken = false;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
if (Creature* member = ObjectAccessor::GetCreature(*me, councilGUIDs[i]))
|
||||
{
|
||||
if (!spoken && (roll_chance_i(33) || i == 3))
|
||||
{
|
||||
spoken = true;
|
||||
member->AI()->Talk(SAY_COUNCIL_AGGRO);
|
||||
}
|
||||
member->SetOwnerGUID(me->GetGUID());
|
||||
member->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (param == ACTION_ENRAGE)
|
||||
{
|
||||
Creature* member = NULL;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (member = ObjectAccessor::GetCreature(*me, councilGUIDs[i]))
|
||||
member->AI()->DoAction(ACTION_ENRAGE);
|
||||
}
|
||||
else if (param == ACTION_END_ENCOUNTER)
|
||||
{
|
||||
me->setActive(false);
|
||||
Creature* member = NULL;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (member = ObjectAccessor::GetCreature(*me, councilGUIDs[i]))
|
||||
if (member->IsAlive())
|
||||
Unit::Kill(me, member);
|
||||
Unit::Kill(me, me);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!me->isActiveObject())
|
||||
return;
|
||||
|
||||
if (!SelectTargetFromPlayerList(115.0f))
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
me->CastSpell(me, SPELL_EMPYREAL_BALANCE, true);
|
||||
}
|
||||
};
|
||||
|
||||
};
|
||||
struct boss_illidari_council_memberAI : public ScriptedAI
|
||||
{
|
||||
boss_illidari_council_memberAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
me->SetOwnerGUID(0);
|
||||
ScriptedAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_ENRAGE)
|
||||
{
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
Talk(SAY_COUNCIL_ENRAGE);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_COUNCIL_SLAY);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
Talk(SAY_COUNCIL_DEATH);
|
||||
if (Creature* council = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_ILLIDARI_COUNCIL)))
|
||||
council->GetAI()->DoAction(ACTION_END_ENCOUNTER);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (Creature* council = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_ILLIDARI_COUNCIL)))
|
||||
council->GetAI()->DoAction(ACTION_START_ENCOUNTER);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_gathios_the_shatterer : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_gathios_the_shatterer() : CreatureScript("boss_gathios_the_shatterer") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_gathios_the_shattererAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_gathios_the_shattererAI : public boss_illidari_council_memberAI
|
||||
{
|
||||
boss_gathios_the_shattererAI(Creature* creature) : boss_illidari_council_memberAI(creature) { }
|
||||
|
||||
Creature* SelectCouncilMember()
|
||||
{
|
||||
if (roll_chance_i(50))
|
||||
return ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_LADY_MALANDE));
|
||||
|
||||
if (roll_chance_i(20))
|
||||
if (Creature* veras = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_VERAS_DARKSHADOW)))
|
||||
if (!veras->HasAura(SPELL_VANISH))
|
||||
return veras;
|
||||
|
||||
return ObjectAccessor::GetCreature(*me, instance->GetData64(RAND(NPC_GATHIOS_THE_SHATTERER, NPC_HIGH_NETHERMANCER_ZEREVOR)));
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
boss_illidari_council_memberAI::EnterCombat(who);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLESSING, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_AURA, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_SEAL, 2000);
|
||||
events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 6000);
|
||||
events.ScheduleEvent(EVENT_SPELL_JUDGEMENT, 8000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CONSECRATION, 4000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_BLESSING:
|
||||
if (Unit* member = SelectCouncilMember())
|
||||
me->CastSpell(member, RAND(SPELL_BLESSING_OF_SPELL_WARDING, SPELL_BLESSING_OF_PROTECTION), false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLESSING, 15000);
|
||||
break;
|
||||
case EVENT_SPELL_AURA:
|
||||
me->CastSpell(me, RAND(SPELL_DEVOTION_AURA, SPELL_CHROMATIC_RESISTANCE_AURA), false);
|
||||
events.ScheduleEvent(EVENT_SPELL_AURA, 60000);
|
||||
break;
|
||||
case EVENT_SPELL_CONSECRATION:
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_COUNCIL_SPECIAL);
|
||||
me->CastSpell(me, SPELL_CONSECRATION, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_AURA, 30000);
|
||||
break;
|
||||
case EVENT_SPELL_HAMMER_OF_JUSTICE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, HammerOfJusticeSelector(me)))
|
||||
{
|
||||
me->CastSpell(target, SPELL_HAMMER_OF_JUSTICE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 20000);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_HAMMER_OF_JUSTICE, 0);
|
||||
break;
|
||||
case EVENT_SPELL_SEAL:
|
||||
me->CastSpell(me, RAND(SPELL_SEAL_OF_COMMAND, SPELL_SEAL_OF_BLOOD), false);
|
||||
events.ScheduleEvent(EVENT_SPELL_SEAL, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_JUDGEMENT:
|
||||
me->CastSpell(me->GetVictim(), SPELL_JUDGEMENT, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_JUDGEMENT, 20000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class boss_high_nethermancer_zerevor : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_high_nethermancer_zerevor() : CreatureScript("boss_high_nethermancer_zerevor") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_high_nethermancer_zerevorAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_high_nethermancer_zerevorAI : public boss_illidari_council_memberAI
|
||||
{
|
||||
boss_high_nethermancer_zerevorAI(Creature* creature) : boss_illidari_council_memberAI(creature) { }
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (who && me->Attack(who, true))
|
||||
me->GetMotionMaster()->MoveChase(who, 20.0f);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
boss_illidari_council_memberAI::EnterCombat(who);
|
||||
events.ScheduleEvent(EVENT_SPELL_FLAMESTRIKE, 25000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLIZZARD, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCANE_BOLT, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_DAMPEN_MAGIC, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCANE_EXPLOSION, 10000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_DAMPEN_MAGIC:
|
||||
me->CastSpell(me, SPELL_DAMPEN_MAGIC, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_DAMPEN_MAGIC, 120000);
|
||||
break;
|
||||
case EVENT_SPELL_ARCANE_BOLT:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ARCANE_BOLT, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCANE_BOLT, 3000);
|
||||
break;
|
||||
case EVENT_SPELL_FLAMESTRIKE:
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_COUNCIL_SPECIAL);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f))
|
||||
me->CastSpell(target, SPELL_FLAMESTRIKE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_FLAMESTRIKE, 40000);
|
||||
break;
|
||||
case EVENT_SPELL_BLIZZARD:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f))
|
||||
me->CastSpell(target, SPELL_BLIZZARD, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLIZZARD, 40000);
|
||||
break;
|
||||
case EVENT_SPELL_ARCANE_EXPLOSION:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f))
|
||||
me->CastSpell(me, SPELL_ARCANE_EXPLOSION, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCANE_EXPLOSION, 10000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class boss_lady_malande : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_lady_malande() : CreatureScript("boss_lady_malande") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_lady_malandeAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_lady_malandeAI : public boss_illidari_council_memberAI
|
||||
{
|
||||
boss_lady_malandeAI(Creature* creature) : boss_illidari_council_memberAI(creature) { }
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (who && me->Attack(who, true))
|
||||
me->GetMotionMaster()->MoveChase(who, 20.0f);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
boss_illidari_council_memberAI::EnterCombat(who);
|
||||
events.ScheduleEvent(EVENT_SPELL_REFLECTIVE_SHIELD, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CIRCLE_OF_HEALING, 20000);
|
||||
events.ScheduleEvent(EVENT_SPELL_DIVINE_WRATH, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_EMPOWERED_SMITE, 15000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_CIRCLE_OF_HEALING:
|
||||
me->CastSpell(me, SPELL_CIRCLE_OF_HEALING, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_CIRCLE_OF_HEALING, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_REFLECTIVE_SHIELD:
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_COUNCIL_SPECIAL);
|
||||
me->CastSpell(me, SPELL_REFLECTIVE_SHIELD, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_REFLECTIVE_SHIELD, 40000);
|
||||
break;
|
||||
case EVENT_SPELL_DIVINE_WRATH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f))
|
||||
me->CastSpell(target, SPELL_DIVINE_WRATH, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_DIVINE_WRATH, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_EMPOWERED_SMITE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_EMPOWERED_SMITE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_EMPOWERED_SMITE, 3000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class boss_veras_darkshadow : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_veras_darkshadow() : CreatureScript("boss_veras_darkshadow") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_veras_darkshadowAI>(creature);
|
||||
}
|
||||
|
||||
struct boss_veras_darkshadowAI : public boss_illidari_council_memberAI
|
||||
{
|
||||
boss_veras_darkshadowAI(Creature* creature) : boss_illidari_council_memberAI(creature) { }
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
me->SetCanDualWield(true);
|
||||
boss_illidari_council_memberAI::EnterCombat(who);
|
||||
events.ScheduleEvent(EVENT_SPELL_VANISH, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENRAGE, 900000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summon->CastSpell(summon, SPELL_VANISH_VISUAL, true);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_VANISH:
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_COUNCIL_SPECIAL);
|
||||
me->CastSpell(me, SPELL_DEADLY_STRIKE, false);
|
||||
me->CastSpell(me, SPELL_VANISH, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_VANISH, 60000);
|
||||
events.ScheduleEvent(EVENT_SPELL_VANISH_OUT, 29000);
|
||||
break;
|
||||
case EVENT_SPELL_VANISH_OUT:
|
||||
me->CastSpell(me, SPELL_VANISH_OUT, false);
|
||||
break;
|
||||
case EVENT_SPELL_ENRAGE:
|
||||
DoResetThreat();
|
||||
if (Creature* council = ObjectAccessor::GetCreature(*me, instance->GetData64(NPC_ILLIDARI_COUNCIL)))
|
||||
council->GetAI()->DoAction(ACTION_ENRAGE);
|
||||
break;
|
||||
}
|
||||
|
||||
if (events.GetNextEventTime(EVENT_SPELL_VANISH_OUT) == 0)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class spell_illidari_council_balance_of_power : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidari_council_balance_of_power() : SpellScriptLoader("spell_illidari_council_balance_of_power") { }
|
||||
|
||||
class spell_illidari_council_balance_of_power_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_illidari_council_balance_of_power_AuraScript);
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
// Set absorbtion amount to unlimited (no absorb)
|
||||
amount = -1;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_illidari_council_balance_of_power_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_illidari_council_balance_of_power_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidari_council_empyreal_balance : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidari_council_empyreal_balance() : SpellScriptLoader("spell_illidari_council_empyreal_balance") { }
|
||||
|
||||
class spell_illidari_council_empyreal_balance_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_illidari_council_empyreal_balance_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
_sharedHealth = 0;
|
||||
_sharedHealthMax = 0;
|
||||
_targetCount = 0;
|
||||
return GetCaster()->GetTypeId() == TYPEID_UNIT;
|
||||
}
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
_targetCount++;
|
||||
_sharedHealth += target->GetHealth();
|
||||
_sharedHealthMax += target->GetMaxHealth();
|
||||
}
|
||||
}
|
||||
|
||||
void HandleAfterCast()
|
||||
{
|
||||
if (_targetCount != 4)
|
||||
{
|
||||
GetCaster()->ToCreature()->AI()->EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
float pct = (_sharedHealth / _sharedHealthMax) * 100.0f;
|
||||
std::list<Spell::TargetInfo> const* targetsInfo = GetSpell()->GetUniqueTargetInfo();
|
||||
for (std::list<Spell::TargetInfo>::const_iterator ihit = targetsInfo->begin(); ihit != targetsInfo->end(); ++ihit)
|
||||
if (Creature* target = ObjectAccessor::GetCreature(*GetCaster(), ihit->targetGUID))
|
||||
{
|
||||
target->LowerPlayerDamageReq(target->GetMaxHealth());
|
||||
target->SetHealth(CalculatePct(target->GetMaxHealth(), pct));
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidari_council_empyreal_balance_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
AfterCast += SpellCastFn(spell_illidari_council_empyreal_balance_SpellScript::HandleAfterCast);
|
||||
}
|
||||
|
||||
private:
|
||||
float _sharedHealth;
|
||||
float _sharedHealthMax;
|
||||
uint8 _targetCount;
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_illidari_council_empyreal_balance_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidari_council_reflective_shield : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidari_council_reflective_shield() : SpellScriptLoader("spell_illidari_council_reflective_shield") { }
|
||||
|
||||
class spell_illidari_council_reflective_shield_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_illidari_council_reflective_shield_AuraScript);
|
||||
|
||||
void ReflectDamage(AuraEffect* aurEff, DamageInfo& dmgInfo, uint32& absorbAmount)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
if (dmgInfo.GetAttacker() == target)
|
||||
return;
|
||||
|
||||
int32 bp = absorbAmount / 2;
|
||||
target->CastCustomSpell(dmgInfo.GetAttacker(), SPELL_REFLECTIVE_SHIELD_T, &bp, NULL, NULL, true, NULL, aurEff);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectAbsorb += AuraEffectAbsorbFn(spell_illidari_council_reflective_shield_AuraScript::ReflectDamage, EFFECT_0);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_illidari_council_reflective_shield_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidari_council_judgement : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidari_council_judgement() : SpellScriptLoader("spell_illidari_council_judgement") { }
|
||||
|
||||
class spell_illidari_council_judgement_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_illidari_council_judgement_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
Unit::AuraEffectList const& auras = GetCaster()->GetAuraEffectsByType(SPELL_AURA_DUMMY);
|
||||
for (Unit::AuraEffectList::const_iterator i = auras.begin(); i != auras.end(); ++i)
|
||||
{
|
||||
if ((*i)->GetSpellInfo()->GetSpellSpecific() == SPELL_SPECIFIC_SEAL && (*i)->GetEffIndex() == EFFECT_2)
|
||||
if (sSpellMgr->GetSpellInfo((*i)->GetAmount()))
|
||||
{
|
||||
GetCaster()->CastSpell(GetHitUnit(), (*i)->GetAmount(), true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_illidari_council_judgement_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_illidari_council_judgement_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_illidari_council_deadly_strike : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_illidari_council_deadly_strike() : SpellScriptLoader("spell_illidari_council_deadly_strike") { }
|
||||
|
||||
class spell_illidari_council_deadly_strike_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_illidari_council_deadly_strike_AuraScript);
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->GetAI()->SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
{
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
GetUnitOwner()->m_Events.AddEvent(new VerasEnvenom(*GetUnitOwner(), target->GetGUID()), GetUnitOwner()->m_Events.CalculateTime(urand(1500, 3500)));
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_illidari_council_deadly_strike_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_illidari_council_deadly_strike_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_illidari_council()
|
||||
{
|
||||
new boss_illidari_council();
|
||||
new boss_gathios_the_shatterer();
|
||||
new boss_lady_malande();
|
||||
new boss_veras_darkshadow();
|
||||
new boss_high_nethermancer_zerevor();
|
||||
new spell_illidari_council_balance_of_power();
|
||||
new spell_illidari_council_empyreal_balance();
|
||||
new spell_illidari_council_reflective_shield();
|
||||
new spell_illidari_council_judgement();
|
||||
new spell_illidari_council_deadly_strike();
|
||||
}
|
||||
@@ -1,683 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "black_temple.h"
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_NAJENTUS_GATE, DATA_HIGH_WARLORD_NAJENTUS, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_NAJENTUS_GATE, DATA_SUPREMUS, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_SUPREMUS_GATE, DATA_SUPREMUS, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_SHADE_OF_AKAMA_DOOR, DATA_SHADE_OF_AKAMA, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_TERON_DOOR_1, DATA_TERON_GOREFIEND, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_TERON_DOOR_2, DATA_TERON_GOREFIEND, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_GURTOGG_DOOR, DATA_GURTOGG_BLOODBOIL, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_TEMPLE_DOOR, DATA_GURTOGG_BLOODBOIL, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_TEMPLE_DOOR, DATA_TERON_GOREFIEND, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_TEMPLE_DOOR, DATA_RELIQUARY_OF_SOULS, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_MOTHER_SHAHRAZ_DOOR, DATA_MOTHER_SHAHRAZ, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_COUNCIL_DOOR_1, DATA_ILLIDARI_COUNCIL, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_COUNCIL_DOOR_2, DATA_ILLIDARI_COUNCIL, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_ILLIDAN_GATE, DATA_AKAMA_FINISHED, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_ILLIDAN_DOOR_L, DATA_ILLIDAN_STORMRAGE, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ GO_ILLIDAN_DOOR_R, DATA_ILLIDAN_STORMRAGE, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }
|
||||
};
|
||||
|
||||
class instance_black_temple : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_black_temple() : InstanceMapScript("instance_black_temple", 564) { }
|
||||
|
||||
struct instance_black_temple_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_black_temple_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTERS);
|
||||
LoadDoorData(doorData);
|
||||
|
||||
ShadeOfAkamaGUID = 0;
|
||||
AkamaShadeGUID = 0;
|
||||
TeronGorefiendGUID = 0;
|
||||
ReliquaryGUID = 0;
|
||||
ashtongueGUIDs.clear();
|
||||
GathiosTheShattererGUID = 0;
|
||||
HighNethermancerZerevorGUID = 0;
|
||||
LadyMalandeGUID = 0;
|
||||
VerasDarkshadowGUID = 0;
|
||||
IllidariCouncilGUID = 0;
|
||||
AkamaGUID = 0;
|
||||
IllidanStormrageGUID = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_SHADE_OF_AKAMA:
|
||||
ShadeOfAkamaGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_AKAMA_SHADE:
|
||||
AkamaShadeGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_TERON_GOREFIEND:
|
||||
TeronGorefiendGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_RELIQUARY_OF_THE_LOST:
|
||||
ReliquaryGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_GATHIOS_THE_SHATTERER:
|
||||
GathiosTheShattererGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_HIGH_NETHERMANCER_ZEREVOR:
|
||||
HighNethermancerZerevorGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_LADY_MALANDE:
|
||||
LadyMalandeGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_VERAS_DARKSHADOW:
|
||||
VerasDarkshadowGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_ILLIDARI_COUNCIL:
|
||||
IllidariCouncilGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_AKAMA:
|
||||
AkamaGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_ILLIDAN_STORMRAGE:
|
||||
IllidanStormrageGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_VENGEFUL_SPIRIT:
|
||||
case NPC_SHADOWY_CONSTRUCT:
|
||||
if (Creature* teron = instance->GetCreature(TeronGorefiendGUID))
|
||||
teron->AI()->JustSummoned(creature);
|
||||
break;
|
||||
case NPC_ENSLAVED_SOUL:
|
||||
if (Creature* reliquary = instance->GetCreature(ReliquaryGUID))
|
||||
reliquary->AI()->JustSummoned(creature);
|
||||
break;
|
||||
case NPC_PARASITIC_SHADOWFIEND:
|
||||
case NPC_BLADE_OF_AZZINOTH:
|
||||
case NPC_FLAME_OF_AZZINOTH:
|
||||
if (Creature* illidan = instance->GetCreature(IllidanStormrageGUID))
|
||||
illidan->AI()->JustSummoned(creature);
|
||||
break;
|
||||
case NPC_ANGERED_SOUL_FRAGMENT:
|
||||
case NPC_HUNGERING_SOUL_FRAGMENT:
|
||||
case NPC_SUFFERING_SOUL_FRAGMENT:
|
||||
creature->SetCorpseDelay(5);
|
||||
break;
|
||||
}
|
||||
|
||||
if (creature->GetName().find("Ashtongue") != std::string::npos || creature->GetEntry() == NPC_STORM_FURY)
|
||||
{
|
||||
ashtongueGUIDs.push_back(creature->GetGUID());
|
||||
if (GetBossState(DATA_SHADE_OF_AKAMA) == DONE)
|
||||
creature->setFaction(FACTION_ASHTONGUE);
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_NAJENTUS_GATE:
|
||||
case GO_SUPREMUS_GATE:
|
||||
case GO_SHADE_OF_AKAMA_DOOR:
|
||||
case GO_TERON_DOOR_1:
|
||||
case GO_TERON_DOOR_2:
|
||||
case GO_GURTOGG_DOOR:
|
||||
case GO_TEMPLE_DOOR:
|
||||
case GO_MOTHER_SHAHRAZ_DOOR:
|
||||
case GO_COUNCIL_DOOR_1:
|
||||
case GO_COUNCIL_DOOR_2:
|
||||
case GO_ILLIDAN_GATE:
|
||||
case GO_ILLIDAN_DOOR_R:
|
||||
case GO_ILLIDAN_DOOR_L:
|
||||
AddDoor(go, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectRemove(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_NAJENTUS_GATE:
|
||||
case GO_SUPREMUS_GATE:
|
||||
case GO_SHADE_OF_AKAMA_DOOR:
|
||||
case GO_TERON_DOOR_1:
|
||||
case GO_TERON_DOOR_2:
|
||||
case GO_GURTOGG_DOOR:
|
||||
case GO_TEMPLE_DOOR:
|
||||
case GO_MOTHER_SHAHRAZ_DOOR:
|
||||
case GO_COUNCIL_DOOR_1:
|
||||
case GO_COUNCIL_DOOR_2:
|
||||
case GO_ILLIDAN_GATE:
|
||||
case GO_ILLIDAN_DOOR_R:
|
||||
case GO_ILLIDAN_DOOR_L:
|
||||
AddDoor(go, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case NPC_SHADE_OF_AKAMA:
|
||||
return ShadeOfAkamaGUID;
|
||||
case NPC_AKAMA_SHADE:
|
||||
return AkamaShadeGUID;
|
||||
case NPC_GATHIOS_THE_SHATTERER:
|
||||
return GathiosTheShattererGUID;
|
||||
case NPC_HIGH_NETHERMANCER_ZEREVOR:
|
||||
return HighNethermancerZerevorGUID;
|
||||
case NPC_LADY_MALANDE:
|
||||
return LadyMalandeGUID;
|
||||
case NPC_VERAS_DARKSHADOW:
|
||||
return VerasDarkshadowGUID;
|
||||
case NPC_ILLIDARI_COUNCIL:
|
||||
return IllidariCouncilGUID;
|
||||
case NPC_AKAMA:
|
||||
return AkamaGUID;
|
||||
case NPC_ILLIDAN_STORMRAGE:
|
||||
return IllidanStormrageGUID;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
if (type == DATA_SHADE_OF_AKAMA && state == DONE)
|
||||
{
|
||||
for (std::list<uint64>::const_iterator itr = ashtongueGUIDs.begin(); itr != ashtongueGUIDs.end(); ++itr)
|
||||
if (Creature* ashtongue = instance->GetCreature(*itr))
|
||||
ashtongue->setFaction(FACTION_ASHTONGUE);
|
||||
}
|
||||
else if (type == DATA_ILLIDARI_COUNCIL && state == DONE)
|
||||
{
|
||||
if (Creature* akama = instance->GetCreature(AkamaGUID))
|
||||
akama->SetVisible(true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "B T " << 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 == 'B' && dataHead2 == 'T')
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint64 ShadeOfAkamaGUID;
|
||||
uint64 AkamaShadeGUID;
|
||||
uint64 TeronGorefiendGUID;
|
||||
uint64 ReliquaryGUID;
|
||||
std::list<uint64> ashtongueGUIDs;
|
||||
uint64 GathiosTheShattererGUID;
|
||||
uint64 HighNethermancerZerevorGUID;
|
||||
uint64 LadyMalandeGUID;
|
||||
uint64 VerasDarkshadowGUID;
|
||||
uint64 IllidariCouncilGUID;
|
||||
uint64 AkamaGUID;
|
||||
uint64 IllidanStormrageGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_black_temple_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_template_harpooners_mark : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_template_harpooners_mark() : SpellScriptLoader("spell_black_template_harpooners_mark") { }
|
||||
|
||||
class spell_black_template_harpooners_mark_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_template_harpooners_mark_AuraScript)
|
||||
|
||||
bool Load()
|
||||
{
|
||||
_turtleSet.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
std::list<Creature*> creatureList;
|
||||
GetUnitOwner()->GetCreaturesWithEntryInRange(creatureList, 80.0f, NPC_DRAGON_TURTLE);
|
||||
for (std::list<Creature*>::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
{
|
||||
(*itr)->TauntApply(GetUnitOwner());
|
||||
(*itr)->AddThreat(GetUnitOwner(), 10000000.0f);
|
||||
_turtleSet.insert((*itr)->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
for (std::set<uint64>::const_iterator itr = _turtleSet.begin(); itr != _turtleSet.end(); ++itr)
|
||||
if (Creature* turtle = ObjectAccessor::GetCreature(*GetUnitOwner(), *itr))
|
||||
{
|
||||
turtle->TauntFadeOut(GetUnitOwner());
|
||||
turtle->AddThreat(GetUnitOwner(), -10000000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_black_template_harpooners_mark_AuraScript::HandleEffectApply, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_black_template_harpooners_mark_AuraScript::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
std::set<uint64> _turtleSet;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_template_harpooners_mark_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_template_free_friend : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_template_free_friend() : SpellScriptLoader("spell_black_template_free_friend") { }
|
||||
|
||||
class spell_black_template_free_friend_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_black_template_free_friend_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Unit* target = GetHitUnit();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
target->RemoveAurasDueToSpell(SPELL_AURA_MOD_CHARM);
|
||||
target->RemoveAurasDueToSpell(SPELL_AURA_MOD_STUN);
|
||||
target->RemoveAurasDueToSpell(SPELL_AURA_MOD_DECREASE_SPEED);
|
||||
target->RemoveAurasDueToSpell(SPELL_AURA_MOD_ROOT);
|
||||
target->RemoveAurasDueToSpell(SPELL_AURA_MOD_CONFUSE);
|
||||
target->RemoveAurasDueToSpell(SPELL_AURA_MOD_FEAR);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_black_template_free_friend_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_black_template_free_friend_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_curse_of_the_bleakheart : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_curse_of_the_bleakheart() : SpellScriptLoader("spell_black_temple_curse_of_the_bleakheart") { }
|
||||
|
||||
class spell_black_temple_curse_of_the_bleakheart_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_curse_of_the_bleakheart_AuraScript);
|
||||
|
||||
void CalcPeriodic(AuraEffect const* /*effect*/, bool& isPeriodic, int32& amplitude)
|
||||
{
|
||||
isPeriodic = true;
|
||||
amplitude = 5000;
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (roll_chance_i(20))
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_CHEST_PAINS, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcPeriodic += AuraEffectCalcPeriodicFn(spell_black_temple_curse_of_the_bleakheart_AuraScript::CalcPeriodic, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_curse_of_the_bleakheart_AuraScript::Update, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_temple_curse_of_the_bleakheart_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_skeleton_shot : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_skeleton_shot() : SpellScriptLoader("spell_black_temple_skeleton_shot") { }
|
||||
|
||||
class spell_black_temple_skeleton_shot_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_skeleton_shot_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_DEATH)
|
||||
GetTarget()->CastSpell(GetTarget(), GetSpellInfo()->Effects[EFFECT_2].CalcValue(), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_black_temple_skeleton_shot_AuraScript::HandleEffectRemove, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_temple_skeleton_shot_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_wyvern_sting : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_wyvern_sting() : SpellScriptLoader("spell_black_temple_wyvern_sting") { }
|
||||
|
||||
class spell_black_temple_wyvern_sting_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_wyvern_sting_AuraScript)
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetTarget(), SPELL_WYVERN_STING, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_black_temple_wyvern_sting_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_temple_wyvern_sting_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_charge_rage : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_charge_rage() : SpellScriptLoader("spell_black_temple_charge_rage") { }
|
||||
|
||||
class spell_black_temple_charge_rage_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_charge_rage_AuraScript);
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetUnitOwner()->SelectNearbyNoTotemTarget((Unit*)NULL, 50.0f))
|
||||
GetUnitOwner()->CastSpell(target, GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_charge_rage_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_temple_charge_rage_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_shadow_inferno : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_shadow_inferno() : SpellScriptLoader("spell_black_temple_shadow_inferno") { }
|
||||
|
||||
class spell_black_temple_shadow_inferno_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_shadow_inferno_AuraScript);
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->CastCustomSpell(SPELL_SHADOW_INFERNO_DAMAGE, SPELLVALUE_BASE_POINT0, effect->GetAmount(), GetUnitOwner(), TRIGGERED_FULL_MASK);
|
||||
GetAura()->GetEffect(effect->GetEffIndex())->SetAmount(effect->GetAmount()+500);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_shadow_inferno_AuraScript::Update, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_temple_shadow_inferno_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_spell_absorption : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_spell_absorption() : SpellScriptLoader("spell_black_temple_spell_absorption") { }
|
||||
|
||||
class spell_black_temple_spell_absorption_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_spell_absorption_AuraScript);
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
// Set absorbtion amount to unlimited
|
||||
amount = -1;
|
||||
}
|
||||
|
||||
void Absorb(AuraEffect* /*aurEff*/, DamageInfo & dmgInfo, uint32 & absorbAmount)
|
||||
{
|
||||
absorbAmount = dmgInfo.GetDamage();
|
||||
}
|
||||
|
||||
void Update(AuraEffect const* effect)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
uint32 count = GetUnitOwner()->GetAuraCount(SPELL_CHAOTIC_CHARGE);
|
||||
if (count == 0)
|
||||
return;
|
||||
|
||||
GetUnitOwner()->CastCustomSpell(GetSpellInfo()->Effects[effect->GetEffIndex()].TriggerSpell, SPELLVALUE_BASE_POINT0, effect->GetAmount()*count, GetUnitOwner(), TRIGGERED_FULL_MASK);
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(SPELL_CHAOTIC_CHARGE);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_black_temple_spell_absorption_AuraScript::CalculateAmount, EFFECT_2, SPELL_AURA_SCHOOL_ABSORB);
|
||||
OnEffectAbsorb += AuraEffectAbsorbFn(spell_black_temple_spell_absorption_AuraScript::Absorb, EFFECT_2);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_spell_absorption_AuraScript::Update, EFFECT_1, SPELL_AURA_PERIODIC_TRIGGER_SPELL_WITH_VALUE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_temple_spell_absorption_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_bloodbolt : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_bloodbolt() : SpellScriptLoader("spell_black_temple_bloodbolt") { }
|
||||
|
||||
class spell_black_temple_bloodbolt_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_black_temple_bloodbolt_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
GetCaster()->CastSpell(target, GetEffectValue(), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_black_temple_bloodbolt_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_black_temple_bloodbolt_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_consuming_strikes : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_consuming_strikes() : SpellScriptLoader("spell_black_temple_consuming_strikes") { }
|
||||
|
||||
class spell_black_temple_consuming_strikes_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_consuming_strikes_AuraScript);
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetTarget()->CastCustomSpell(GetSpellInfo()->Effects[EFFECT_1].CalcValue(), SPELLVALUE_BASE_POINT0, eventInfo.GetDamageInfo()->GetDamage(), GetTarget(), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_black_temple_consuming_strikes_AuraScript::HandleProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_temple_consuming_strikes_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_curse_of_vitality : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_curse_of_vitality() : SpellScriptLoader("spell_black_temple_curse_of_vitality") { }
|
||||
|
||||
class spell_black_temple_curse_of_vitality_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_curse_of_vitality_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (GetUnitOwner()->HealthBelowPct(50))
|
||||
SetDuration(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_curse_of_vitality_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_temple_curse_of_vitality_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_black_temple_dementia : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_black_temple_dementia() : SpellScriptLoader("spell_black_temple_dementia") { }
|
||||
|
||||
class spell_black_temple_dementia_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_black_temple_dementia_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (roll_chance_i(50))
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DEMENTIA1, true);
|
||||
else
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_DEMENTIA2, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_black_temple_dementia_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_black_temple_dementia_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_black_temple()
|
||||
{
|
||||
new instance_black_temple();
|
||||
new spell_black_template_harpooners_mark();
|
||||
new spell_black_template_free_friend();
|
||||
new spell_black_temple_curse_of_the_bleakheart();
|
||||
new spell_black_temple_skeleton_shot();
|
||||
new spell_black_temple_wyvern_sting();
|
||||
new spell_black_temple_charge_rage();
|
||||
new spell_black_temple_shadow_inferno();
|
||||
new spell_black_temple_spell_absorption();
|
||||
new spell_black_temple_bloodbolt();
|
||||
new spell_black_temple_consuming_strikes();
|
||||
new spell_black_temple_curse_of_vitality();
|
||||
new spell_black_temple_dementia();
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
# Copyright (C)
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
set(scripts_STAT_SRCS
|
||||
${scripts_STAT_SRCS}
|
||||
Outland/zone_nagrand.cpp
|
||||
Outland/HellfireCitadel/MagtheridonsLair/magtheridons_lair.h
|
||||
Outland/HellfireCitadel/MagtheridonsLair/instance_magtheridons_lair.cpp
|
||||
Outland/HellfireCitadel/MagtheridonsLair/boss_magtheridon.cpp
|
||||
Outland/HellfireCitadel/HellfireRamparts/instance_hellfire_ramparts.cpp
|
||||
Outland/HellfireCitadel/HellfireRamparts/boss_omor_the_unscarred.cpp
|
||||
Outland/HellfireCitadel/HellfireRamparts/boss_watchkeeper_gargolmar.cpp
|
||||
Outland/HellfireCitadel/HellfireRamparts/boss_vazruden_the_herald.cpp
|
||||
Outland/HellfireCitadel/HellfireRamparts/hellfire_ramparts.h
|
||||
Outland/HellfireCitadel/BloodFurnace/boss_the_maker.cpp
|
||||
Outland/HellfireCitadel/BloodFurnace/boss_kelidan_the_breaker.cpp
|
||||
Outland/HellfireCitadel/BloodFurnace/blood_furnace.h
|
||||
Outland/HellfireCitadel/BloodFurnace/instance_blood_furnace.cpp
|
||||
Outland/HellfireCitadel/BloodFurnace/boss_broggok.cpp
|
||||
Outland/HellfireCitadel/ShatteredHalls/shattered_halls.h
|
||||
Outland/HellfireCitadel/ShatteredHalls/boss_warchief_kargath_bladefist.cpp
|
||||
Outland/HellfireCitadel/ShatteredHalls/boss_nethekurse.cpp
|
||||
Outland/HellfireCitadel/ShatteredHalls/instance_shattered_halls.cpp
|
||||
Outland/HellfireCitadel/ShatteredHalls/boss_warbringer_omrogg.cpp
|
||||
Outland/CoilfangReservoir/SteamVault/boss_mekgineer_steamrigger.cpp
|
||||
Outland/CoilfangReservoir/SteamVault/instance_steam_vault.cpp
|
||||
Outland/CoilfangReservoir/SteamVault/boss_hydromancer_thespia.cpp
|
||||
Outland/CoilfangReservoir/SteamVault/boss_warlord_kalithresh.cpp
|
||||
Outland/CoilfangReservoir/SteamVault/steam_vault.h
|
||||
Outland/CoilfangReservoir/SerpentShrine/boss_hydross_the_unstable.cpp
|
||||
Outland/CoilfangReservoir/SerpentShrine/boss_fathomlord_karathress.cpp
|
||||
Outland/CoilfangReservoir/SerpentShrine/instance_serpent_shrine.cpp
|
||||
Outland/CoilfangReservoir/SerpentShrine/serpent_shrine.h
|
||||
Outland/CoilfangReservoir/SerpentShrine/boss_lady_vashj.cpp
|
||||
Outland/CoilfangReservoir/SerpentShrine/boss_leotheras_the_blind.cpp
|
||||
Outland/CoilfangReservoir/SerpentShrine/boss_lurker_below.cpp
|
||||
Outland/CoilfangReservoir/SerpentShrine/boss_morogrim_tidewalker.cpp
|
||||
Outland/CoilfangReservoir/underbog/boss_the_black_stalker.cpp
|
||||
Outland/CoilfangReservoir/SlavePens/boss_ahune.cpp
|
||||
Outland/zone_shattrath_city.cpp
|
||||
Outland/TempestKeep/Mechanar/boss_mechano_lord_capacitus.cpp
|
||||
Outland/TempestKeep/Mechanar/boss_pathaleon_the_calculator.cpp
|
||||
Outland/TempestKeep/Mechanar/boss_nethermancer_sepethrea.cpp
|
||||
Outland/TempestKeep/Mechanar/mechanar.h
|
||||
Outland/TempestKeep/Mechanar/boss_gatewatcher_gyrokill.cpp
|
||||
Outland/TempestKeep/Mechanar/instance_mechanar.cpp
|
||||
Outland/TempestKeep/Mechanar/boss_gatewatcher_ironhand.cpp
|
||||
Outland/TempestKeep/Eye/the_eye.h
|
||||
Outland/TempestKeep/Eye/instance_the_eye.cpp
|
||||
Outland/TempestKeep/Eye/boss_void_reaver.cpp
|
||||
Outland/TempestKeep/Eye/boss_astromancer.cpp
|
||||
Outland/TempestKeep/Eye/boss_alar.cpp
|
||||
Outland/TempestKeep/Eye/boss_kaelthas.cpp
|
||||
Outland/TempestKeep/botanica/the_botanica.h
|
||||
Outland/TempestKeep/botanica/instance_the_botanica.cpp
|
||||
Outland/TempestKeep/botanica/boss_commander_sarannis.cpp
|
||||
Outland/TempestKeep/botanica/boss_thorngrin_the_tender.cpp
|
||||
Outland/TempestKeep/botanica/boss_high_botanist_freywinn.cpp
|
||||
Outland/TempestKeep/botanica/boss_warp_splinter.cpp
|
||||
Outland/TempestKeep/botanica/boss_laj.cpp
|
||||
Outland/TempestKeep/arcatraz/boss_zereketh_the_unbound.cpp
|
||||
Outland/TempestKeep/arcatraz/boss_dalliah_the_doomsayer.cpp
|
||||
Outland/TempestKeep/arcatraz/boss_wrath_scryer_soccothrates.cpp
|
||||
Outland/TempestKeep/arcatraz/boss_harbinger_skyriss.cpp
|
||||
Outland/TempestKeep/arcatraz/instance_arcatraz.cpp
|
||||
Outland/TempestKeep/arcatraz/arcatraz.h
|
||||
Outland/TempestKeep/arcatraz/arcatraz.cpp
|
||||
Outland/Auchindoun/AuchenaiCrypts/boss_shirrak_the_dead_watcher.cpp
|
||||
Outland/Auchindoun/AuchenaiCrypts/boss_exarch_maladaar.cpp
|
||||
Outland/Auchindoun/ManaTombs/boss_nexusprince_shaffar.cpp
|
||||
Outland/Auchindoun/SethekkHalls/boss_talon_king_ikiss.cpp
|
||||
Outland/Auchindoun/SethekkHalls/instance_sethekk_halls.cpp
|
||||
Outland/Auchindoun/SethekkHalls/sethekk_halls.h
|
||||
Outland/Auchindoun/ShadowLabyrinth/boss_ambassador_hellmaw.cpp
|
||||
Outland/Auchindoun/ShadowLabyrinth/boss_blackheart_the_inciter.cpp
|
||||
Outland/Auchindoun/ShadowLabyrinth/boss_grandmaster_vorpil.cpp
|
||||
Outland/Auchindoun/ShadowLabyrinth/boss_murmur.cpp
|
||||
Outland/Auchindoun/ShadowLabyrinth/instance_shadow_labyrinth.cpp
|
||||
Outland/Auchindoun/ShadowLabyrinth/shadow_labyrinth.h
|
||||
Outland/boss_doomwalker.cpp
|
||||
Outland/zone_terokkar_forest.cpp
|
||||
Outland/zone_hellfire_peninsula.cpp
|
||||
Outland/boss_doomlord_kazzak.cpp
|
||||
Outland/BlackTemple/boss_teron_gorefiend.cpp
|
||||
Outland/BlackTemple/black_temple.h
|
||||
Outland/BlackTemple/illidari_council.cpp
|
||||
Outland/BlackTemple/boss_shade_of_akama.cpp
|
||||
Outland/BlackTemple/boss_supremus.cpp
|
||||
Outland/BlackTemple/boss_mother_shahraz.cpp
|
||||
Outland/BlackTemple/instance_black_temple.cpp
|
||||
Outland/BlackTemple/boss_reliquary_of_souls.cpp
|
||||
Outland/BlackTemple/boss_warlord_najentus.cpp
|
||||
Outland/BlackTemple/boss_bloodboil.cpp
|
||||
Outland/BlackTemple/boss_illidan.cpp
|
||||
Outland/zone_shadowmoon_valley.cpp
|
||||
Outland/zone_blades_edge_mountains.cpp
|
||||
Outland/GruulsLair/boss_high_king_maulgar.cpp
|
||||
Outland/GruulsLair/boss_gruul.cpp
|
||||
Outland/GruulsLair/gruuls_lair.h
|
||||
Outland/GruulsLair/instance_gruuls_lair.cpp
|
||||
Outland/zone_netherstorm.cpp
|
||||
Outland/zone_zangarmarsh.cpp
|
||||
)
|
||||
|
||||
AC_ADD_SCRIPT_LOADER("Outland" "ScriptLoader.h")
|
||||
|
||||
message(" -> Prepared: Outland")
|
||||
@@ -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();
|
||||
}
|
||||
@@ -1,270 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "gruuls_lair.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SLAM = 1,
|
||||
SAY_SHATTER = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_DEATH = 4,
|
||||
|
||||
EMOTE_GROW = 5
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_GROWTH = 36300,
|
||||
SPELL_CAVE_IN = 36240,
|
||||
SPELL_GROUND_SLAM = 33525,
|
||||
SPELL_REVERBERATION = 36297,
|
||||
SPELL_HURTFUL_STRIKE = 33813,
|
||||
SPELL_SHATTER = 33654,
|
||||
|
||||
SPELL_SHATTER_EFFECT = 33671,
|
||||
SPELL_STONED = 33652,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_GROWTH = 1,
|
||||
EVENT_CAVE_IN = 2,
|
||||
EVENT_GROUND_SLAM = 3,
|
||||
EVENT_HURTFUL_STRIKE = 4,
|
||||
EVENT_REVERBERATION = 5,
|
||||
EVENT_SHATTER = 6,
|
||||
EVENT_RECENTLY_SPOKEN = 7
|
||||
};
|
||||
|
||||
class boss_gruul : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_gruul() : CreatureScript("boss_gruul") { }
|
||||
|
||||
struct boss_gruulAI : public BossAI
|
||||
{
|
||||
boss_gruulAI(Creature* creature) : BossAI(creature, DATA_GRUUL) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
_caveInTimer = 29000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_GROWTH, 30000);
|
||||
events.ScheduleEvent(EVENT_CAVE_IN, _caveInTimer);
|
||||
events.ScheduleEvent(EVENT_REVERBERATION, 20000);
|
||||
events.ScheduleEvent(EVENT_HURTFUL_STRIKE, 10000);
|
||||
events.ScheduleEvent(EVENT_GROUND_SLAM, 35000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_RECENTLY_SPOKEN) == 0)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_RECENTLY_SPOKEN, 5000);
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_GROWTH:
|
||||
Talk(EMOTE_GROW);
|
||||
DoCast(me, SPELL_GROWTH);
|
||||
events.ScheduleEvent(EVENT_GROWTH, 30000);
|
||||
break;
|
||||
case EVENT_CAVE_IN:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_CAVE_IN, false);
|
||||
_caveInTimer -= 1500;
|
||||
events.ScheduleEvent(EVENT_CAVE_IN, _caveInTimer);
|
||||
break;
|
||||
case EVENT_REVERBERATION:
|
||||
me->CastSpell(me, SPELL_REVERBERATION, false);
|
||||
events.ScheduleEvent(EVENT_REVERBERATION, 22000);
|
||||
break;
|
||||
case EVENT_HURTFUL_STRIKE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, 1, 5.0f))
|
||||
me->CastSpell(target, SPELL_HURTFUL_STRIKE, false);
|
||||
events.ScheduleEvent(EVENT_HURTFUL_STRIKE, 15000);
|
||||
break;
|
||||
case EVENT_GROUND_SLAM:
|
||||
Talk(SAY_SLAM);
|
||||
me->CastSpell(me, SPELL_GROUND_SLAM, false);
|
||||
events.DelayEvents(8001);
|
||||
events.ScheduleEvent(EVENT_GROUND_SLAM, 60000);
|
||||
events.ScheduleEvent(EVENT_SHATTER, 8000);
|
||||
break;
|
||||
case EVENT_SHATTER:
|
||||
Talk(SAY_SHATTER);
|
||||
me->CastSpell(me, SPELL_SHATTER, false);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _caveInTimer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_gruulAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gruul_ground_slam : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gruul_ground_slam() : SpellScriptLoader("spell_gruul_ground_slam") { }
|
||||
|
||||
class spell_gruul_ground_slam_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gruul_ground_slam_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->KnockbackFrom(GetCaster()->GetPositionX(), GetCaster()->GetPositionY(), 15.0f, 15.0f);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gruul_ground_slam_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gruul_ground_slam_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gruul_ground_slam_trigger : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gruul_ground_slam_trigger() : SpellScriptLoader("spell_gruul_ground_slam_trigger") { }
|
||||
|
||||
class spell_gruul_ground_slam_trigger_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_gruul_ground_slam_trigger_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetUnitOwner()->GetAuraCount(GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell) == 5)
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_STONED, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_gruul_ground_slam_trigger_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_gruul_ground_slam_trigger_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gruul_shatter : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gruul_shatter() : SpellScriptLoader("spell_gruul_shatter") { }
|
||||
|
||||
class spell_gruul_shatter_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gruul_shatter_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->RemoveAurasDueToSpell(SPELL_STONED);
|
||||
target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_gruul_shatter_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gruul_shatter_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_gruul_shatter_effect : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_gruul_shatter_effect() : SpellScriptLoader("spell_gruul_shatter_effect") { }
|
||||
|
||||
class spell_gruul_shatter_effect_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_gruul_shatter_effect_SpellScript);
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
|
||||
float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
|
||||
if (!radius)
|
||||
return;
|
||||
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_gruul_shatter_effect_SpellScript::CalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_gruul_shatter_effect_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gruul()
|
||||
{
|
||||
new boss_gruul();
|
||||
new spell_gruul_ground_slam();
|
||||
new spell_gruul_ground_slam_trigger();
|
||||
new spell_gruul_shatter();
|
||||
new spell_gruul_shatter_effect();
|
||||
}
|
||||
@@ -1,505 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "gruuls_lair.h"
|
||||
|
||||
enum HighKingMaulgar
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_ENRAGE = 1,
|
||||
SAY_OGRE_DEATH = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_DEATH = 4,
|
||||
|
||||
// High King Maulgar
|
||||
SPELL_ARCING_SMASH = 39144,
|
||||
SPELL_MIGHTY_BLOW = 33230,
|
||||
SPELL_WHIRLWIND = 33238,
|
||||
SPELL_BERSERKER_C = 26561,
|
||||
SPELL_ROAR = 16508,
|
||||
SPELL_FLURRY = 33232,
|
||||
|
||||
// Olm the Summoner
|
||||
SPELL_DARK_DECAY = 33129,
|
||||
SPELL_DEATH_COIL = 33130,
|
||||
SPELL_SUMMON_WFH = 33131,
|
||||
|
||||
// Kiggler the Craed
|
||||
SPELL_GREATER_POLYMORPH = 33173,
|
||||
SPELL_LIGHTNING_BOLT = 36152,
|
||||
SPELL_ARCANE_SHOCK = 33175,
|
||||
SPELL_ARCANE_EXPLOSION = 33237,
|
||||
|
||||
// Blindeye the Seer
|
||||
SPELL_GREATER_PW_SHIELD = 33147,
|
||||
SPELL_HEAL = 33144,
|
||||
SPELL_PRAYER_OH = 33152,
|
||||
|
||||
// Krosh Firehand
|
||||
SPELL_GREATER_FIREBALL = 33051,
|
||||
SPELL_SPELLSHIELD = 33054,
|
||||
SPELL_BLAST_WAVE = 33061,
|
||||
|
||||
ACTION_ADD_DEATH = 1
|
||||
};
|
||||
|
||||
enum HKMEvents
|
||||
{
|
||||
EVENT_RECENTLY_SPOKEN = 1,
|
||||
EVENT_ARCING_SMASH = 2,
|
||||
EVENT_MIGHTY_BLOW = 3,
|
||||
EVENT_WHIRLWIND = 4,
|
||||
EVENT_CHARGING = 5,
|
||||
EVENT_ROAR = 6,
|
||||
EVENT_CHECK_HEALTH = 7,
|
||||
|
||||
EVENT_ADD_ABILITY1 = 10,
|
||||
EVENT_ADD_ABILITY2 = 11,
|
||||
EVENT_ADD_ABILITY3 = 12,
|
||||
EVENT_ADD_ABILITY4 = 13
|
||||
};
|
||||
|
||||
class boss_high_king_maulgar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_high_king_maulgar() : CreatureScript("boss_high_king_maulgar") { }
|
||||
|
||||
struct boss_high_king_maulgarAI : public BossAI
|
||||
{
|
||||
boss_high_king_maulgarAI(Creature* creature) : BossAI(creature, DATA_MAULGAR) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
me->SetLootMode(0);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_RECENTLY_SPOKEN) == 0)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_RECENTLY_SPOKEN, 5000);
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
if (instance->GetData(DATA_ADDS_KILLED) == MAX_ADD_NUMBER)
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void DoAction(int32 actionId)
|
||||
{
|
||||
if (me->IsAlive())
|
||||
{
|
||||
Talk(SAY_OGRE_DEATH);
|
||||
if (actionId == MAX_ADD_NUMBER)
|
||||
me->SetLootMode(1);
|
||||
}
|
||||
else if (actionId == MAX_ADD_NUMBER)
|
||||
{
|
||||
me->loot.clear();
|
||||
me->loot.FillLoot(me->GetCreatureTemplate()->lootid, LootTemplates_Creature, me->GetLootRecipient(), false, false, 1);
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);
|
||||
_JustDied();
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_ARCING_SMASH, 6000);
|
||||
events.ScheduleEvent(EVENT_MIGHTY_BLOW, 20000);
|
||||
events.ScheduleEvent(EVENT_WHIRLWIND, 30000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 500);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ARCING_SMASH:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ARCING_SMASH, false);
|
||||
events.ScheduleEvent(EVENT_ARCING_SMASH, 10000);
|
||||
break;
|
||||
case EVENT_MIGHTY_BLOW:
|
||||
me->CastSpell(me->GetVictim(), SPELL_MIGHTY_BLOW, false);
|
||||
events.ScheduleEvent(EVENT_MIGHTY_BLOW, 16000);
|
||||
break;
|
||||
case EVENT_WHIRLWIND:
|
||||
events.DelayEvents(15000);
|
||||
me->CastSpell(me, SPELL_WHIRLWIND, false);
|
||||
events.ScheduleEvent(EVENT_WHIRLWIND, 54000);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(50))
|
||||
{
|
||||
Talk(SAY_ENRAGE);
|
||||
me->CastSpell(me, SPELL_FLURRY, true);
|
||||
events.ScheduleEvent(EVENT_CHARGING, 0);
|
||||
events.ScheduleEvent(EVENT_ROAR, 3000);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 500);
|
||||
break;
|
||||
case EVENT_ROAR:
|
||||
me->CastSpell(me, SPELL_ROAR, false);
|
||||
events.ScheduleEvent(EVENT_ROAR, 40000);
|
||||
break;
|
||||
case EVENT_CHARGING:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
me->CastSpell(target, SPELL_BERSERKER_C, false);
|
||||
events.ScheduleEvent(EVENT_CHARGING, 35000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_high_king_maulgarAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_olm_the_summoner : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_olm_the_summoner() : CreatureScript("boss_olm_the_summoner") { }
|
||||
|
||||
struct boss_olm_the_summonerAI : public ScriptedAI
|
||||
{
|
||||
boss_olm_the_summonerAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
SummonList summons;
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
instance->SetBossState(DATA_MAULGAR, NOT_STARTED);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (me->Attack(who, true))
|
||||
me->GetMotionMaster()->MoveChase(who, 25.0f);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
me->SetInCombatWithZone();
|
||||
instance->SetBossState(DATA_MAULGAR, IN_PROGRESS);
|
||||
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY1, 10000);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY2, 15000);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY3, 20000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
instance->SetData(DATA_ADDS_KILLED, 1);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ADD_ABILITY1:
|
||||
me->CastSpell(me->GetVictim(), SPELL_DARK_DECAY, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY1, 20000);
|
||||
break;
|
||||
case EVENT_ADD_ABILITY2:
|
||||
me->CastSpell(me, SPELL_SUMMON_WFH, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY2, 30000);
|
||||
break;
|
||||
case EVENT_ADD_ABILITY3:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_DEATH_COIL, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY3, 20000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_olm_the_summonerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_kiggler_the_crazed : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_kiggler_the_crazed() : CreatureScript("boss_kiggler_the_crazed") { }
|
||||
|
||||
struct boss_kiggler_the_crazedAI : public ScriptedAI
|
||||
{
|
||||
boss_kiggler_the_crazedAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
instance->SetBossState(DATA_MAULGAR, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
me->SetInCombatWithZone();
|
||||
instance->SetBossState(DATA_MAULGAR, IN_PROGRESS);
|
||||
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY1, 5000);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY2, 10000);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY3, 20000);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY4, 30000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
instance->SetData(DATA_ADDS_KILLED, 1);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ADD_ABILITY1:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
me->CastSpell(target, SPELL_GREATER_POLYMORPH, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY1, 20000);
|
||||
break;
|
||||
case EVENT_ADD_ABILITY2:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1))
|
||||
me->CastSpell(target, SPELL_LIGHTNING_BOLT, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY2, 15000);
|
||||
break;
|
||||
case EVENT_ADD_ABILITY3:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ARCANE_SHOCK, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY3, 20000);
|
||||
break;
|
||||
case EVENT_ADD_ABILITY4:
|
||||
me->CastSpell(me, SPELL_ARCANE_EXPLOSION, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY4, 30000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_kiggler_the_crazedAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_blindeye_the_seer : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_blindeye_the_seer() : CreatureScript("boss_blindeye_the_seer") { }
|
||||
|
||||
struct boss_blindeye_the_seerAI : public ScriptedAI
|
||||
{
|
||||
boss_blindeye_the_seerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
instance->SetBossState(DATA_MAULGAR, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
me->SetInCombatWithZone();
|
||||
instance->SetBossState(DATA_MAULGAR, IN_PROGRESS);
|
||||
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY1, 5000);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY2, 10000);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY3, 20000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
instance->SetData(DATA_ADDS_KILLED, 1);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ADD_ABILITY1:
|
||||
me->CastSpell(me, SPELL_GREATER_PW_SHIELD, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY1, 30000);
|
||||
break;
|
||||
case EVENT_ADD_ABILITY2:
|
||||
if (Unit* target = DoSelectLowestHpFriendly(60.0f, 50000))
|
||||
me->CastSpell(target, SPELL_HEAL, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY2, 25000);
|
||||
break;
|
||||
case EVENT_ADD_ABILITY3:
|
||||
me->CastSpell(me, SPELL_PRAYER_OH, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY3, 30000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_blindeye_the_seerAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_krosh_firehand : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_krosh_firehand() : CreatureScript("boss_krosh_firehand") { }
|
||||
|
||||
struct boss_krosh_firehandAI : public ScriptedAI
|
||||
{
|
||||
boss_krosh_firehandAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
InstanceScript* instance;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
instance->SetBossState(DATA_MAULGAR, NOT_STARTED);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
if (me->Attack(who, true))
|
||||
me->GetMotionMaster()->MoveChase(who, 25.0f);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
me->SetInCombatWithZone();
|
||||
instance->SetBossState(DATA_MAULGAR, IN_PROGRESS);
|
||||
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY1, 1000);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY2, 5000);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY3, 20000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
instance->SetData(DATA_ADDS_KILLED, 1);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ADD_ABILITY1:
|
||||
me->CastSpell(me->GetVictim(), SPELL_GREATER_FIREBALL, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY1, 3500);
|
||||
break;
|
||||
case EVENT_ADD_ABILITY2:
|
||||
me->CastSpell(me, SPELL_SPELLSHIELD, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY2, 40000);
|
||||
break;
|
||||
case EVENT_ADD_ABILITY3:
|
||||
me->CastSpell(me, SPELL_BLAST_WAVE, false);
|
||||
events.ScheduleEvent(EVENT_ADD_ABILITY3, 20000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_krosh_firehandAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_high_king_maulgar()
|
||||
{
|
||||
new boss_high_king_maulgar();
|
||||
new boss_kiggler_the_crazed();
|
||||
new boss_blindeye_the_seer();
|
||||
new boss_olm_the_summoner();
|
||||
new boss_krosh_firehand();
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef GRUULS_LAIR_H_
|
||||
#define GRUULS_LAIR_H_
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_MAULGAR = 0,
|
||||
DATA_GRUUL = 1,
|
||||
MAX_ENCOUNTER = 2,
|
||||
|
||||
DATA_ADDS_KILLED = 10,
|
||||
MAX_ADD_NUMBER = 4
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_MAULGAR = 18831,
|
||||
NPC_KROSH_FIREHAND = 18832,
|
||||
NPC_OLM_THE_SUMMONER = 18834,
|
||||
NPC_KIGGLER_THE_CRAZED = 18835,
|
||||
NPC_BLINDEYE_THE_SEER = 18836
|
||||
};
|
||||
|
||||
enum GameObjectIds
|
||||
{
|
||||
GO_MAULGAR_DOOR = 184468,
|
||||
GO_GRUUL_DOOR = 184662
|
||||
};
|
||||
|
||||
#endif // GRUULS_LAIR_H_
|
||||
@@ -1,175 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "gruuls_lair.h"
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_MAULGAR_DOOR, DATA_MAULGAR, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_GRUUL_DOOR, DATA_GRUUL, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END
|
||||
};
|
||||
|
||||
MinionData const minionData[] =
|
||||
{
|
||||
{ NPC_MAULGAR, DATA_MAULGAR },
|
||||
{ NPC_KROSH_FIREHAND, DATA_MAULGAR },
|
||||
{ NPC_OLM_THE_SUMMONER, DATA_MAULGAR },
|
||||
{ NPC_KIGGLER_THE_CRAZED, DATA_MAULGAR },
|
||||
{ NPC_BLINDEYE_THE_SEER, DATA_MAULGAR }
|
||||
};
|
||||
|
||||
class instance_gruuls_lair : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_gruuls_lair() : InstanceMapScript("instance_gruuls_lair", 565) { }
|
||||
|
||||
struct instance_gruuls_lair_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_gruuls_lair_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
LoadDoorData(doorData);
|
||||
LoadMinionData(minionData);
|
||||
|
||||
_maulgarGUID = 0;
|
||||
_addsKilled = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_MAULGAR:
|
||||
_maulgarGUID = creature->GetGUID();
|
||||
// no break;
|
||||
case NPC_KROSH_FIREHAND:
|
||||
case NPC_OLM_THE_SUMMONER:
|
||||
case NPC_KIGGLER_THE_CRAZED:
|
||||
case NPC_BLINDEYE_THE_SEER:
|
||||
AddMinion(creature, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureRemove(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_MAULGAR:
|
||||
case NPC_KROSH_FIREHAND:
|
||||
case NPC_OLM_THE_SUMMONER:
|
||||
case NPC_KIGGLER_THE_CRAZED:
|
||||
case NPC_BLINDEYE_THE_SEER:
|
||||
AddMinion(creature, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_MAULGAR_DOOR:
|
||||
case GO_GRUUL_DOOR:
|
||||
AddDoor(go, true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectRemove(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_MAULGAR_DOOR:
|
||||
case GO_GRUUL_DOOR:
|
||||
AddDoor(go, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 id, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(id, state))
|
||||
return false;
|
||||
|
||||
if (id == DATA_MAULGAR && state == NOT_STARTED)
|
||||
_addsKilled = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == DATA_ADDS_KILLED)
|
||||
if (Creature* maulgar = instance->GetCreature(_maulgarGUID))
|
||||
maulgar->AI()->DoAction(++_addsKilled);
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
if (type == DATA_ADDS_KILLED)
|
||||
return _addsKilled;
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "G L " << 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 == 'G' && dataHead2 == 'L')
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_ENCOUNTER; ++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;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint32 _addsKilled;
|
||||
uint64 _maulgarGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_gruuls_lair_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_gruuls_lair()
|
||||
{
|
||||
new instance_gruuls_lair();
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_BLOOD_FURNACE_H
|
||||
#define DEF_BLOOD_FURNACE_H
|
||||
|
||||
enum bloodFurnace
|
||||
{
|
||||
DATA_THE_MAKER = 0,
|
||||
DATA_BROGGOK = 1,
|
||||
DATA_KELIDAN = 2,
|
||||
MAX_ENCOUNTER = 3,
|
||||
|
||||
DATA_DOOR1 = 10,
|
||||
DATA_DOOR2 = 11,
|
||||
DATA_DOOR3 = 12,
|
||||
DATA_DOOR4 = 13,
|
||||
DATA_DOOR5 = 14,
|
||||
DATA_DOOR6 = 15,
|
||||
|
||||
DATA_PRISON_CELL1 = 20,
|
||||
DATA_PRISON_CELL2 = 21,
|
||||
DATA_PRISON_CELL3 = 22,
|
||||
DATA_PRISON_CELL4 = 23,
|
||||
|
||||
ACTION_ACTIVATE_BROGGOK = 30,
|
||||
ACTION_PREPARE_BROGGOK = 31
|
||||
};
|
||||
|
||||
enum bloodFurnaceNPC
|
||||
{
|
||||
NPC_THE_MAKER = 17381,
|
||||
NPC_BROGGOK = 17380,
|
||||
NPC_KELIDAN = 17377,
|
||||
NPC_NASCENT_FEL_ORC = 17398,
|
||||
NPC_CHANNELER = 17653
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,197 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blood_furnace.h"
|
||||
|
||||
enum eEnums
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
|
||||
SPELL_SLIME_SPRAY = 30913,
|
||||
SPELL_POISON_CLOUD = 30916,
|
||||
SPELL_POISON_BOLT = 30917,
|
||||
SPELL_POISON = 30914,
|
||||
|
||||
EVENT_SPELL_SLIME = 1,
|
||||
EVENT_SPELL_POISON = 2,
|
||||
EVENT_SPELL_BOLT = 3
|
||||
};
|
||||
|
||||
class boss_broggok : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_broggok() : CreatureScript("boss_broggok")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_broggokAI : public ScriptedAI
|
||||
{
|
||||
boss_broggokAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
bool canAttack;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
|
||||
canAttack = false;
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_BROGGOK, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
summoned->setFaction(16);
|
||||
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
summoned->CastSpell(summoned, SPELL_POISON, false, 0, 0, me->GetGUID());
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim() || !canAttack)
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_SLIME:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SLIME_SPRAY, false);
|
||||
events.RepeatEvent(urand(7000, 12000));
|
||||
break;
|
||||
case EVENT_SPELL_BOLT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_POISON_BOLT, false);
|
||||
events.RepeatEvent(urand(6000, 11000));
|
||||
break;
|
||||
case EVENT_SPELL_POISON:
|
||||
me->CastSpell(me, SPELL_POISON_CLOUD, false);
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (instance)
|
||||
{
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR4), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR5), true);
|
||||
instance->SetData(DATA_BROGGOK, DONE);
|
||||
}
|
||||
}
|
||||
|
||||
void DoAction(int32 action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case ACTION_PREPARE_BROGGOK:
|
||||
me->SetInCombatWithZone();
|
||||
break;
|
||||
case ACTION_ACTIVATE_BROGGOK:
|
||||
events.ScheduleEvent(EVENT_SPELL_SLIME, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_POISON, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BOLT, 7000);
|
||||
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
|
||||
canAttack = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_broggokAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class go_broggok_lever : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_broggok_lever() : GameObjectScript("go_broggok_lever") {}
|
||||
|
||||
bool OnGossipHello(Player* /*player*/, GameObject* go)
|
||||
{
|
||||
if (InstanceScript* instance = go->GetInstanceScript())
|
||||
if (instance->GetData(DATA_BROGGOK) != DONE && instance->GetData(DATA_BROGGOK) != IN_PROGRESS)
|
||||
if (Creature* broggok = ObjectAccessor::GetCreature(*go, instance->GetData64(DATA_BROGGOK)))
|
||||
{
|
||||
instance->SetData(DATA_BROGGOK, IN_PROGRESS);
|
||||
broggok->AI()->DoAction(ACTION_PREPARE_BROGGOK);
|
||||
}
|
||||
|
||||
go->UseDoorOrButton();
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
// 30914, 38462 - Poison (Broggok)
|
||||
class spell_broggok_poison_cloud : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_broggok_poison_cloud() : SpellScriptLoader("spell_broggok_poison_cloud") { }
|
||||
|
||||
class spell_broggok_poison_cloud_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_broggok_poison_cloud_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(spellInfo->Effects[EFFECT_0].TriggerSpell))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void PeriodicTick(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
uint32 triggerSpell = GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
|
||||
int32 mod = int32(((float(aurEff->GetTickNumber()) / aurEff->GetTotalTicks()) * 0.9f + 0.1f) * 10000 * 2 / 3);
|
||||
GetTarget()->CastCustomSpell(triggerSpell, SPELLVALUE_RADIUS_MOD, mod, (Unit*)NULL, TRIGGERED_FULL_MASK, NULL, aurEff);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_broggok_poison_cloud_AuraScript::PeriodicTick, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_broggok_poison_cloud_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_broggok()
|
||||
{
|
||||
new boss_broggok();
|
||||
new go_broggok_lever();
|
||||
new spell_broggok_poison_cloud();
|
||||
}
|
||||
@@ -1,352 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "blood_furnace.h"
|
||||
|
||||
enum eKelidan
|
||||
{
|
||||
SAY_WAKE = 0,
|
||||
SAY_ADD_AGGRO = 1,
|
||||
SAY_KILL = 2,
|
||||
SAY_NOVA = 3,
|
||||
SAY_DIE = 4,
|
||||
|
||||
// Keldian spells
|
||||
SPELL_CORRUPTION = 30938,
|
||||
SPELL_EVOCATION = 30935,
|
||||
SPELL_FIRE_NOVA = 33132,
|
||||
SPELL_SHADOW_BOLT_VOLLEY = 28599,
|
||||
SPELL_BURNING_NOVA = 30940,
|
||||
SPELL_VORTEX = 37370,
|
||||
|
||||
// Channelers spells
|
||||
SPELL_SHADOW_BOLT = 12739,
|
||||
SPELL_SHADOW_BOLT_H = 15472,
|
||||
SPELL_MARK_OF_SHADOW = 30937,
|
||||
SPELL_CHANNELING = 39123,
|
||||
|
||||
// Events
|
||||
EVENT_SPELL_VOLLEY = 1,
|
||||
EVENT_SPELL_CORRUPTION = 2,
|
||||
EVENT_SPELL_BURNING_NOVA = 3,
|
||||
EVENT_SPELL_FIRE_NOVA = 4,
|
||||
EVENT_SPELL_SHADOW_BOLT = 5,
|
||||
EVENT_SPELL_MARK = 6,
|
||||
|
||||
// Actions
|
||||
ACTION_CHANNELER_ENGAGED = 1,
|
||||
ACTION_CHANNELER_DIED = 2,
|
||||
};
|
||||
|
||||
const float ShadowmoonChannelers[5][4] =
|
||||
{
|
||||
{302.0f, -87.0f, -24.4f, 0.157f},
|
||||
{321.0f, -63.5f, -24.6f, 4.887f},
|
||||
{346.0f, -74.5f, -24.6f, 3.595f},
|
||||
{344.0f, -103.5f, -24.5f, 2.356f},
|
||||
{316.0f, -109.0f, -24.6f, 1.257f}
|
||||
};
|
||||
|
||||
class boss_kelidan_the_breaker : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_kelidan_the_breaker() : CreatureScript("boss_kelidan_the_breaker")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_kelidan_the_breakerAI : public ScriptedAI
|
||||
{
|
||||
boss_kelidan_the_breakerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
memset(&channelers, 0, sizeof(channelers));
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
uint64 channelers[5];
|
||||
uint32 checkTimer;
|
||||
bool addYell;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
addYell = false;
|
||||
checkTimer = 5000;
|
||||
|
||||
events.Reset();
|
||||
ApplyImmunities(true);
|
||||
SummonChannelers();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (instance)
|
||||
instance->SetData(DATA_KELIDAN, NOT_STARTED);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_VOLLEY, 1000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CORRUPTION, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BURNING_NOVA, 15000);
|
||||
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
Talk(SAY_WAKE);
|
||||
|
||||
if (instance)
|
||||
instance->SetData(DATA_KELIDAN, IN_PROGRESS);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (urand(0,1))
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_CHANNELER_ENGAGED)
|
||||
{
|
||||
if (!addYell)
|
||||
{
|
||||
addYell = true;
|
||||
Talk(SAY_ADD_AGGRO);
|
||||
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
Creature* channeler = ObjectAccessor::GetCreature(*me, channelers[i]);
|
||||
if (channeler && !channeler->IsInCombat())
|
||||
channeler->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (param == ACTION_CHANNELER_DIED)
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
Creature* channeler = ObjectAccessor::GetCreature(*me, channelers[i]);
|
||||
if (channeler && channeler->IsAlive())
|
||||
return;
|
||||
}
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (Unit* target = me->SelectNearestPlayer(100.0f))
|
||||
AttackStart(target);
|
||||
}
|
||||
}
|
||||
|
||||
void CheckChannelers()
|
||||
{
|
||||
if (addYell)
|
||||
{
|
||||
if (!SelectTargetFromPlayerList(100.0f))
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
SummonChannelers();
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
Creature* channeler = ObjectAccessor::GetCreature(*me, channelers[i]);
|
||||
if (channeler && !channeler->HasUnitState(UNIT_STATE_CASTING) && !channeler->IsInCombat())
|
||||
{
|
||||
Creature* target = ObjectAccessor::GetCreature(*me, channelers[(i+2)%5]);
|
||||
if (target)
|
||||
channeler->CastSpell(target, SPELL_CHANNELING, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SummonChannelers()
|
||||
{
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
{
|
||||
Creature* channeler = ObjectAccessor::GetCreature(*me, channelers[i]);
|
||||
if (channeler && channeler->isDead())
|
||||
{
|
||||
channeler->DespawnOrUnsummon(1);
|
||||
channeler = NULL;
|
||||
}
|
||||
if (!channeler)
|
||||
channeler = me->SummonCreature(NPC_CHANNELER, ShadowmoonChannelers[i][0], ShadowmoonChannelers[i][1], ShadowmoonChannelers[i][2], ShadowmoonChannelers[i][3], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000);
|
||||
|
||||
channelers[i] = channeler ? channeler->GetGUID() : 0;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DIE);
|
||||
if (instance)
|
||||
{
|
||||
// Xinef: load grid with start doors
|
||||
me->GetMap()->LoadGrid(0, -111.0f);
|
||||
instance->SetData(DATA_KELIDAN, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR1), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR6), true);
|
||||
}
|
||||
}
|
||||
|
||||
void ApplyImmunities(bool apply)
|
||||
{
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_CHARM, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_DISORIENTED, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_DISTRACT, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_FEAR, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_ROOT, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_SILENCE, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_SLEEP, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_SNARE, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_FREEZE, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_KNOCKOUT, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_POLYMORPH, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_BANISH, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_SHACKLE, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_TURN, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_HORROR, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_DAZE, apply);
|
||||
me->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_SAPPED, apply);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
{
|
||||
checkTimer += diff;
|
||||
if (checkTimer >= 5000)
|
||||
{
|
||||
checkTimer = 0;
|
||||
CheckChannelers();
|
||||
if (!me->HasUnitState(UNIT_STATE_CASTING))
|
||||
me->CastSpell(me, SPELL_EVOCATION, false);
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_VOLLEY:
|
||||
me->CastSpell(me, SPELL_SHADOW_BOLT_VOLLEY, false);
|
||||
events.RepeatEvent(urand(8000, 13000));
|
||||
break;
|
||||
case EVENT_SPELL_CORRUPTION:
|
||||
me->CastSpell(me, SPELL_CORRUPTION, false);
|
||||
events.RepeatEvent(urand(30000, 50000));
|
||||
break;
|
||||
case EVENT_SPELL_BURNING_NOVA:
|
||||
Talk(SAY_NOVA);
|
||||
|
||||
ApplyImmunities(false);
|
||||
me->AddAura(SPELL_BURNING_NOVA, me);
|
||||
ApplyImmunities(true);
|
||||
|
||||
if (IsHeroic())
|
||||
DoTeleportAll(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), me->GetOrientation());
|
||||
|
||||
events.DelayEvents(6000, 0);
|
||||
events.RepeatEvent(urand(25000, 32000));
|
||||
events.ScheduleEvent(EVENT_SPELL_FIRE_NOVA, 5000);
|
||||
break;
|
||||
case EVENT_SPELL_FIRE_NOVA:
|
||||
me->CastSpell(me, SPELL_FIRE_NOVA, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_kelidan_the_breakerAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_shadowmoon_channeler : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
npc_shadowmoon_channeler() : CreatureScript("npc_shadowmoon_channeler") {}
|
||||
|
||||
struct npc_shadowmoon_channelerAI : public ScriptedAI
|
||||
{
|
||||
npc_shadowmoon_channelerAI(Creature* creature) : ScriptedAI(creature){}
|
||||
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
Creature* GetKelidan()
|
||||
{
|
||||
if (me->GetInstanceScript())
|
||||
return ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetData64(DATA_KELIDAN));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (Creature* kelidan = GetKelidan())
|
||||
kelidan->AI()->DoAction(ACTION_CHANNELER_ENGAGED);
|
||||
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
events.ScheduleEvent(EVENT_SPELL_SHADOW_BOLT, urand(1500, 3500));
|
||||
events.ScheduleEvent(EVENT_SPELL_MARK, urand(5000, 6500));
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
if (Creature* kelidan = GetKelidan())
|
||||
kelidan->AI()->DoAction(ACTION_CHANNELER_DIED);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHADOW_BOLT:
|
||||
me->CastSpell(me->GetVictim(), IsHeroic() ? SPELL_SHADOW_BOLT_H : SPELL_SHADOW_BOLT, false);
|
||||
events.RepeatEvent(urand(6000, 7500));
|
||||
break;
|
||||
case EVENT_SPELL_MARK:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_MARK_OF_SHADOW, false);
|
||||
events.RepeatEvent(urand(16000, 17500));
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_shadowmoon_channelerAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_kelidan_the_breaker()
|
||||
{
|
||||
new boss_kelidan_the_breaker();
|
||||
new npc_shadowmoon_channeler();
|
||||
}
|
||||
|
||||
@@ -1,133 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "blood_furnace.h"
|
||||
|
||||
enum eEnums
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_KILL = 1,
|
||||
SAY_DIE = 2,
|
||||
|
||||
SPELL_ACID_SPRAY = 38153,
|
||||
SPELL_EXPLODING_BREAKER = 30925,
|
||||
SPELL_KNOCKDOWN = 20276,
|
||||
SPELL_DOMINATION = 25772,
|
||||
|
||||
EVENT_SPELL_ACID = 1,
|
||||
EVENT_SPELL_EXPLODING = 2,
|
||||
EVENT_SPELL_DOMINATION = 3,
|
||||
EVENT_SPELL_KNOCKDOWN = 4,
|
||||
};
|
||||
|
||||
class boss_the_maker : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_the_maker() : CreatureScript("boss_the_maker")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_the_makerAI : public ScriptedAI
|
||||
{
|
||||
boss_the_makerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
instance->SetData(DATA_THE_MAKER, NOT_STARTED);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR2), true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_SPELL_ACID, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_EXPLODING, 6000);
|
||||
events.ScheduleEvent(EVENT_SPELL_DOMINATION, 120000);
|
||||
events.ScheduleEvent(EVENT_SPELL_KNOCKDOWN, 10000);
|
||||
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
instance->SetData(DATA_THE_MAKER, IN_PROGRESS);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR2), false);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && urand(0,1))
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DIE);
|
||||
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
instance->SetData(DATA_THE_MAKER, DONE);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR2), true);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_DOOR3), true);
|
||||
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_SPELL_ACID:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ACID_SPRAY, false);
|
||||
events.RepeatEvent(urand(15000, 23000));
|
||||
break;
|
||||
case EVENT_SPELL_EXPLODING:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_EXPLODING_BREAKER, false);
|
||||
events.RepeatEvent(urand(7000, 11000));
|
||||
break;
|
||||
case EVENT_SPELL_DOMINATION:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_DOMINATION, false);
|
||||
events.RepeatEvent(120000);
|
||||
break;
|
||||
case EVENT_SPELL_KNOCKDOWN:
|
||||
me->CastSpell(me->GetVictim(), SPELL_KNOCKDOWN, false);
|
||||
events.RepeatEvent(urand(4000, 12000));
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_the_makerAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_the_maker()
|
||||
{
|
||||
new boss_the_maker();
|
||||
}
|
||||
|
||||
@@ -1,329 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "blood_furnace.h"
|
||||
#include "CreatureAI.h"
|
||||
|
||||
class instance_blood_furnace : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_blood_furnace() : InstanceMapScript("instance_blood_furnace", 542) {}
|
||||
|
||||
struct instance_blood_furnace_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_blood_furnace_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint32 _auiEncounter[MAX_ENCOUNTER];
|
||||
uint64 _bossGUIDs[3];
|
||||
uint64 _doorGUIDs[6];
|
||||
uint64 _prisonGUIDs[4];
|
||||
|
||||
std::set<uint64> _prisonersCell[4];
|
||||
|
||||
uint8 _prisonerCounter[4];
|
||||
|
||||
uint64 _broggokLeverGUID;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
memset(&_auiEncounter, 0, sizeof(_auiEncounter));
|
||||
memset(&_bossGUIDs, 0, sizeof(_bossGUIDs));
|
||||
memset(&_doorGUIDs, 0, sizeof(_doorGUIDs));
|
||||
memset(&_prisonGUIDs, 0, sizeof(_prisonGUIDs));
|
||||
memset(&_prisonerCounter, 0, sizeof(_prisonerCounter));
|
||||
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
_prisonersCell[i].clear();
|
||||
|
||||
_broggokLeverGUID = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_THE_MAKER:
|
||||
_bossGUIDs[DATA_THE_MAKER] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_BROGGOK:
|
||||
_bossGUIDs[DATA_BROGGOK] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_KELIDAN:
|
||||
_bossGUIDs[DATA_KELIDAN] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_NASCENT_FEL_ORC:
|
||||
StorePrisoner(creature);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnUnitDeath(Unit* unit)
|
||||
{
|
||||
if (unit && unit->GetTypeId() == TYPEID_UNIT && unit->GetEntry() == NPC_NASCENT_FEL_ORC)
|
||||
PrisonerDied(unit->GetGUID());
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
if (go->GetEntry() == 181766) //Final exit door
|
||||
_doorGUIDs[0] = go->GetGUID();
|
||||
if (go->GetEntry() == 181811) //The Maker Front door
|
||||
_doorGUIDs[1] = go->GetGUID();
|
||||
if (go->GetEntry() == 181812) //The Maker Rear door
|
||||
{
|
||||
_doorGUIDs[2] = go->GetGUID();
|
||||
if (GetData(DATA_THE_MAKER) == DONE)
|
||||
HandleGameObject(go->GetGUID(), true);
|
||||
}
|
||||
if (go->GetEntry() == 181822) //Broggok Front door
|
||||
_doorGUIDs[3] = go->GetGUID();
|
||||
if (go->GetEntry() == 181819) //Broggok Rear door
|
||||
{
|
||||
_doorGUIDs[4] = go->GetGUID();
|
||||
if (GetData(DATA_BROGGOK) == DONE)
|
||||
HandleGameObject(go->GetGUID(), true);
|
||||
}
|
||||
if (go->GetEntry() == 181823) //Kelidan exit door
|
||||
_doorGUIDs[5] = go->GetGUID();
|
||||
|
||||
if (go->GetEntry() == 181821) //Broggok prison cell front right
|
||||
_prisonGUIDs[0] = go->GetGUID();
|
||||
if (go->GetEntry() == 181818) //Broggok prison cell back right
|
||||
_prisonGUIDs[1] = go->GetGUID();
|
||||
if (go->GetEntry() == 181820) //Broggok prison cell front left
|
||||
_prisonGUIDs[2] = go->GetGUID();
|
||||
if (go->GetEntry() == 181817) //Broggok prison cell back left
|
||||
_prisonGUIDs[3] = go->GetGUID();
|
||||
|
||||
if (go->GetEntry() == 181982)
|
||||
_broggokLeverGUID = go->GetGUID(); //Broggok lever
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 data) const
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case DATA_THE_MAKER:
|
||||
case DATA_BROGGOK:
|
||||
case DATA_KELIDAN:
|
||||
return _bossGUIDs[data];
|
||||
|
||||
case DATA_DOOR1:
|
||||
case DATA_DOOR2:
|
||||
case DATA_DOOR3:
|
||||
case DATA_DOOR4:
|
||||
case DATA_DOOR5:
|
||||
case DATA_DOOR6:
|
||||
return _doorGUIDs[data-DATA_DOOR1];
|
||||
|
||||
case DATA_PRISON_CELL1:
|
||||
case DATA_PRISON_CELL2:
|
||||
case DATA_PRISON_CELL3:
|
||||
case DATA_PRISON_CELL4:
|
||||
return _prisonGUIDs[data-DATA_PRISON_CELL1];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_THE_MAKER:
|
||||
case DATA_BROGGOK:
|
||||
case DATA_KELIDAN:
|
||||
_auiEncounter[type] = data;
|
||||
if (type == DATA_BROGGOK)
|
||||
UpdateBroggokEvent(data);
|
||||
break;
|
||||
}
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "B F " << _auiEncounter[0] << ' ' << _auiEncounter[1] << ' ' << _auiEncounter[2];
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_THE_MAKER:
|
||||
case DATA_BROGGOK:
|
||||
case DATA_KELIDAN:
|
||||
return _auiEncounter[type];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Load(const char* strIn)
|
||||
{
|
||||
if (!strIn)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(strIn);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(strIn);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'B' && dataHead2 == 'F')
|
||||
{
|
||||
loadStream >> _auiEncounter[0] >> _auiEncounter[1] >> _auiEncounter[2];
|
||||
|
||||
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
if (_auiEncounter[i] == IN_PROGRESS || _auiEncounter[i] == FAIL)
|
||||
_auiEncounter[i] = NOT_STARTED;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
void UpdateBroggokEvent(uint32 data)
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case IN_PROGRESS:
|
||||
ActivateCell(DATA_PRISON_CELL1);
|
||||
HandleGameObject(_doorGUIDs[3], false);
|
||||
break;
|
||||
case NOT_STARTED:
|
||||
ResetPrisons();
|
||||
HandleGameObject(_doorGUIDs[4], false);
|
||||
HandleGameObject(_doorGUIDs[3], true);
|
||||
if (GameObject* lever = instance->GetGameObject(_broggokLeverGUID))
|
||||
lever->Respawn();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ResetPrisons()
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
_prisonerCounter[i] = _prisonersCell[i].size();
|
||||
ResetPrisoners(_prisonersCell[i]);
|
||||
HandleGameObject(_prisonGUIDs[i], false);
|
||||
}
|
||||
}
|
||||
|
||||
void ResetPrisoners(std::set<uint64> prisoners)
|
||||
{
|
||||
for (std::set<uint64>::iterator i = prisoners.begin(); i != prisoners.end(); ++i)
|
||||
if (Creature* prisoner = instance->GetCreature(*i))
|
||||
ResetPrisoner(prisoner);
|
||||
}
|
||||
|
||||
void ResetPrisoner(Creature* prisoner)
|
||||
{
|
||||
if (!prisoner->IsAlive())
|
||||
prisoner->Respawn(true);
|
||||
prisoner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
void StorePrisoner(Creature* creature)
|
||||
{
|
||||
float posX = creature->GetPositionX();
|
||||
float posY = creature->GetPositionY();
|
||||
|
||||
if (posX >= 405.0f && posX <= 423.0f)
|
||||
{
|
||||
if (posY >= 106.0f && posY <= 123.0f)
|
||||
{
|
||||
_prisonersCell[0].insert(creature->GetGUID());
|
||||
++_prisonerCounter[0];
|
||||
ResetPrisoner(creature);
|
||||
}
|
||||
else if (posY >= 76.0f && posY <= 91.0f)
|
||||
{
|
||||
_prisonersCell[1].insert(creature->GetGUID());
|
||||
++_prisonerCounter[1];
|
||||
ResetPrisoner(creature);
|
||||
}
|
||||
}
|
||||
else if (posX >= 490.0f && posX <= 506.0f)
|
||||
{
|
||||
if (posY >= 106.0f && posY <= 123.0f)
|
||||
{
|
||||
_prisonersCell[2].insert(creature->GetGUID());
|
||||
++_prisonerCounter[2];
|
||||
ResetPrisoner(creature);
|
||||
}
|
||||
else if (posY >= 76.0f && posY <= 91.0f)
|
||||
{
|
||||
_prisonersCell[3].insert(creature->GetGUID());
|
||||
++_prisonerCounter[3];
|
||||
ResetPrisoner(creature);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PrisonerDied(uint64 guid)
|
||||
{
|
||||
if (_prisonersCell[0].find(guid) != _prisonersCell[0].end() && --_prisonerCounter[0] <= 0)
|
||||
ActivateCell(DATA_PRISON_CELL2);
|
||||
else if (_prisonersCell[1].find(guid) != _prisonersCell[1].end() && --_prisonerCounter[1] <= 0)
|
||||
ActivateCell(DATA_PRISON_CELL3);
|
||||
else if (_prisonersCell[2].find(guid) != _prisonersCell[2].end() && --_prisonerCounter[2] <= 0)
|
||||
ActivateCell(DATA_PRISON_CELL4);
|
||||
else if (_prisonersCell[3].find(guid) != _prisonersCell[3].end() && --_prisonerCounter[3] <= 0)
|
||||
ActivateCell(DATA_DOOR5);
|
||||
}
|
||||
|
||||
void ActivateCell(uint8 id)
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case DATA_PRISON_CELL1:
|
||||
case DATA_PRISON_CELL2:
|
||||
case DATA_PRISON_CELL3:
|
||||
case DATA_PRISON_CELL4:
|
||||
HandleGameObject(_prisonGUIDs[id-DATA_PRISON_CELL1], true);
|
||||
ActivatePrisoners(_prisonersCell[id-DATA_PRISON_CELL1]);
|
||||
break;
|
||||
case DATA_DOOR5:
|
||||
HandleGameObject(_doorGUIDs[4], true);
|
||||
if (Creature* broggok = instance->GetCreature(GetData64(DATA_BROGGOK)))
|
||||
broggok->AI()->DoAction(ACTION_ACTIVATE_BROGGOK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void ActivatePrisoners(std::set<uint64> prisoners)
|
||||
{
|
||||
for (std::set<uint64>::iterator i = prisoners.begin(); i != prisoners.end(); ++i)
|
||||
if (Creature* prisoner = instance->GetCreature(*i))
|
||||
{
|
||||
prisoner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_NON_ATTACKABLE);
|
||||
prisoner->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_blood_furnace_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_blood_furnace()
|
||||
{
|
||||
new instance_blood_furnace();
|
||||
}
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "hellfire_ramparts.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SUMMON = 1,
|
||||
SAY_CURSE = 2,
|
||||
SAY_KILL = 3,
|
||||
SAY_DIE = 4,
|
||||
SAY_WIPE = 5
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SHADOW_BOLT = 30686,
|
||||
SPELL_SUMMON_FIENDISH_HOUND = 30707,
|
||||
SPELL_TREACHEROUS_AURA = 30695,
|
||||
SPELL_DEMONIC_SHIELD = 31901,
|
||||
SPELL_ORBITAL_STRIKE = 30637,
|
||||
SPELL_SHADOW_WHIP = 30638
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
EVENT_SUMMON1 = 1,
|
||||
EVENT_SUMMON2 = 2,
|
||||
EVENT_TREACHEROUS_AURA = 3,
|
||||
EVENT_DEMONIC_SHIELD = 4,
|
||||
EVENT_KILL_TALK = 5,
|
||||
EVENT_ORBITAL_STRIKE = 6,
|
||||
EVENT_SHADOW_WHIP = 7
|
||||
};
|
||||
|
||||
class boss_omor_the_unscarred : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_omor_the_unscarred() : CreatureScript("boss_omor_the_unscarred") { }
|
||||
|
||||
struct boss_omor_the_unscarredAI : public BossAI
|
||||
{
|
||||
boss_omor_the_unscarredAI(Creature* creature) : BossAI(creature, DATA_OMOR_THE_UNSCARRED)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Talk(SAY_WIPE);
|
||||
BossAI::Reset();
|
||||
_targetGUID = 0;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
BossAI::EnterCombat(who);
|
||||
|
||||
events.ScheduleEvent(EVENT_SUMMON1, 10000);
|
||||
events.ScheduleEvent(EVENT_SUMMON2, 25000);
|
||||
events.ScheduleEvent(EVENT_TREACHEROUS_AURA, 6000);
|
||||
events.ScheduleEvent(EVENT_DEMONIC_SHIELD, 1000);
|
||||
events.ScheduleEvent(EVENT_ORBITAL_STRIKE, 20000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
Talk(SAY_SUMMON);
|
||||
summons.Summon(summon);
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
Talk(SAY_DIE);
|
||||
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_SUMMON1:
|
||||
Talk(SAY_SUMMON);
|
||||
me->CastSpell(me, SPELL_SUMMON_FIENDISH_HOUND, false);
|
||||
break;
|
||||
case EVENT_SUMMON2:
|
||||
me->CastSpell(me, SPELL_SUMMON_FIENDISH_HOUND, false);
|
||||
events.ScheduleEvent(EVENT_SUMMON2, 15000);
|
||||
break;
|
||||
case EVENT_TREACHEROUS_AURA:
|
||||
if (roll_chance_i(33))
|
||||
Talk(SAY_CURSE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_TREACHEROUS_AURA, false);
|
||||
events.ScheduleEvent(EVENT_TREACHEROUS_AURA, urand(12000, 18000));
|
||||
break;
|
||||
case EVENT_DEMONIC_SHIELD:
|
||||
if (me->HealthBelowPct(21))
|
||||
{
|
||||
me->CastSpell(me, SPELL_DEMONIC_SHIELD, false);
|
||||
events.ScheduleEvent(EVENT_DEMONIC_SHIELD, 15000);
|
||||
}
|
||||
else
|
||||
events.ScheduleEvent(EVENT_DEMONIC_SHIELD, 1000);
|
||||
break;
|
||||
case EVENT_ORBITAL_STRIKE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 15.0f, true))
|
||||
{
|
||||
_targetGUID = target->GetGUID();
|
||||
me->CastSpell(target, SPELL_ORBITAL_STRIKE, false);
|
||||
events.DelayEvents(5000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_WHIP, 4000);
|
||||
me->GetMotionMaster()->Clear();
|
||||
}
|
||||
events.ScheduleEvent(EVENT_ORBITAL_STRIKE, 20000);
|
||||
break;
|
||||
case EVENT_SHADOW_WHIP:
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, _targetGUID))
|
||||
me->CastSpell(target, SPELL_SHADOW_WHIP, false);
|
||||
_targetGUID = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!me->GetVictim() || !me->isAttackReady())
|
||||
return;
|
||||
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
else
|
||||
{
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->CastSpell(me->GetVictim(), SPELL_SHADOW_BOLT, false);
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _targetGUID;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_omor_the_unscarredAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_omor_the_unscarred()
|
||||
{
|
||||
new boss_omor_the_unscarred();
|
||||
}
|
||||
|
||||
@@ -1,375 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "hellfire_ramparts.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_WIPE = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_KILL = 2,
|
||||
SAY_DIE = 3,
|
||||
EMOTE_NAZAN = 0
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_FIREBALL = 33793,
|
||||
SPELL_SUMMON_LIQUID_FIRE = 31706,
|
||||
SPELL_REVENGE = 19130,
|
||||
SPELL_REVENGE_H = 40392,
|
||||
SPELL_CALL_NAZAN = 30693,
|
||||
SPELL_BELLOWING_ROAR = 39427,
|
||||
SPELL_CONE_OF_FIRE = 30926
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
ACTION_FLY_DOWN = 0,
|
||||
|
||||
POINT_MIDDLE = 0,
|
||||
POINT_FLIGHT = 1,
|
||||
|
||||
EVENT_SPELL_REVENGE = 1,
|
||||
EVENT_KILL_TALK = 2,
|
||||
EVENT_AGGRO_TALK = 3,
|
||||
EVENT_SPELL_FIREBALL = 4,
|
||||
EVENT_SPELL_CONE_OF_FIRE = 5,
|
||||
EVENT_SPELL_BELLOWING_ROAR = 6,
|
||||
EVENT_CHANGE_POS = 7,
|
||||
EVENT_RESTORE_COMBAT = 8
|
||||
};
|
||||
|
||||
const Position NazanPos[3] =
|
||||
{
|
||||
{-1430.37f, 1710.03f, 111.0f, 0.0f},
|
||||
{-1428.40f, 1772.09f, 111.0f, 0.0f},
|
||||
{-1373.84f, 1771.57f, 111.0f, 0.0f}
|
||||
};
|
||||
|
||||
class boss_vazruden_the_herald : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_vazruden_the_herald() : CreatureScript("boss_vazruden_the_herald") { }
|
||||
|
||||
struct boss_vazruden_the_heraldAI : public BossAI
|
||||
{
|
||||
boss_vazruden_the_heraldAI(Creature* creature) : BossAI(creature, DATA_VAZRUDEN)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->SetVisible(true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SummonCreature(NPC_HELLFIRE_SENTRY, -1372.56f, 1724.31f, 82.967f, 5.3058f);
|
||||
me->SummonCreature(NPC_HELLFIRE_SENTRY, -1383.39f, 1711.82f, 82.7961f, 5.67232f);
|
||||
}
|
||||
|
||||
void AttackStart(Unit*)
|
||||
{
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (summon->GetEntry() != NPC_HELLFIRE_SENTRY)
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
instance->SetBossState(DATA_VAZRUDEN, DONE);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && id == POINT_MIDDLE)
|
||||
{
|
||||
me->SetVisible(false);
|
||||
me->SummonCreature(NPC_VAZRUDEN, me->GetPositionX(), me->GetPositionY(), 81.2f, 5.46f);
|
||||
me->SummonCreature(NPC_NAZAN, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 5.46f);
|
||||
}
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit*)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
if (summon->GetEntry() == NPC_HELLFIRE_SENTRY && summons.size() == 0)
|
||||
{
|
||||
Talk(SAY_INTRO);
|
||||
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 85.0f, false);
|
||||
me->setActive(true);
|
||||
}
|
||||
else if (summons.size() == 0)
|
||||
{
|
||||
Unit::Kill(me, me);
|
||||
}
|
||||
}
|
||||
|
||||
void SummonedCreatureDespawn(Creature* summon)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
if (summon->GetEntry() != NPC_HELLFIRE_SENTRY)
|
||||
BossAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!me->IsVisible() && summons.size() == 0)
|
||||
BossAI::EnterEvadeMode();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_vazruden_the_heraldAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_nazan : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_nazan() : CreatureScript("boss_nazan") { }
|
||||
|
||||
struct boss_nazanAI : public ScriptedAI
|
||||
{
|
||||
boss_nazanAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->SetCanFly(true);
|
||||
me->SetDisableGravity(true);
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
me->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_CHANGE_POS, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_FIREBALL, 5000);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (me->IsLevitating())
|
||||
me->Attack(who, true);
|
||||
else
|
||||
ScriptedAI::AttackStart(who);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
if (param == ACTION_FLY_DOWN)
|
||||
{
|
||||
Talk(EMOTE_NAZAN);
|
||||
events.Reset();
|
||||
me->GetMotionMaster()->MovePoint(POINT_MIDDLE, -1406.5f, 1746.5f, 81.2f, false);
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && id == POINT_MIDDLE)
|
||||
{
|
||||
me->SetDisableGravity(false);
|
||||
me->SetCanFly(false);
|
||||
events.ScheduleEvent(EVENT_RESTORE_COMBAT, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_CONE_OF_FIRE, 5000);
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SPELL_BELLOWING_ROAR, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_FIREBALL:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_FIREBALL, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_FIREBALL, urand(4000, 6000));
|
||||
break;
|
||||
case EVENT_CHANGE_POS:
|
||||
me->GetMotionMaster()->MovePoint(POINT_FLIGHT, NazanPos[urand(0,2)], false);
|
||||
events.DelayEvents(7000);
|
||||
events.ScheduleEvent(EVENT_CHANGE_POS, 30000);
|
||||
break;
|
||||
case EVENT_RESTORE_COMBAT:
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
break;
|
||||
case EVENT_SPELL_CONE_OF_FIRE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CONE_OF_FIRE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_CONE_OF_FIRE, 12000);
|
||||
break;
|
||||
case EVENT_SPELL_BELLOWING_ROAR:
|
||||
me->CastSpell(me, SPELL_BELLOWING_ROAR, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BELLOWING_ROAR, 30000);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!me->IsLevitating())
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_nazanAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class boss_vazruden : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_vazruden() : CreatureScript("boss_vazruden") { }
|
||||
|
||||
struct boss_vazrudenAI : public ScriptedAI
|
||||
{
|
||||
boss_vazrudenAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
Talk(SAY_WIPE);
|
||||
me->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_AGGRO_TALK, 5000);
|
||||
events.ScheduleEvent(EVENT_SPELL_REVENGE, 4000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
me->CastSpell(me, SPELL_CALL_NAZAN, true);
|
||||
Talk(SAY_DIE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_AGGRO_TALK:
|
||||
Talk(SAY_AGGRO);
|
||||
break;
|
||||
case EVENT_SPELL_REVENGE:
|
||||
me->CastSpell(me->GetVictim(), DUNGEON_MODE(SPELL_REVENGE, SPELL_REVENGE_H), false);
|
||||
events.ScheduleEvent(EVENT_SPELL_REVENGE, 6000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_vazrudenAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_vazruden_fireball : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_vazruden_fireball() : SpellScriptLoader("spell_vazruden_fireball") { }
|
||||
|
||||
class spell_vazruden_fireball_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_vazruden_fireball_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SPELL_SUMMON_LIQUID_FIRE, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_vazruden_fireball_SpellScript::HandleScriptEffect, EFFECT_1, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_vazruden_fireball_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_vazruden_call_nazan : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_vazruden_call_nazan() : SpellScriptLoader("spell_vazruden_call_nazan") { }
|
||||
|
||||
class spell_vazruden_call_nazan_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_vazruden_call_nazan_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->GetAI()->DoAction(ACTION_FLY_DOWN);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_vazruden_call_nazan_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_vazruden_call_nazan_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_vazruden_the_herald()
|
||||
{
|
||||
new boss_vazruden_the_herald();
|
||||
new boss_vazruden();
|
||||
new boss_nazan();
|
||||
new spell_vazruden_fireball();
|
||||
new spell_vazruden_call_nazan();
|
||||
}
|
||||
@@ -1,153 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "hellfire_ramparts.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_TAUNT = 0,
|
||||
SAY_HEAL = 1,
|
||||
SAY_SURGE = 2,
|
||||
SAY_AGGRO = 3,
|
||||
SAY_KILL = 4,
|
||||
SAY_DIE = 5
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_MORTAL_WOUND = 30641,
|
||||
SPELL_SURGE = 34645,
|
||||
SPELL_RETALIATION = 22857
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
NPC_HELLFIRE_WATCHER = 17309,
|
||||
|
||||
EVENT_MORTAL_WOUND = 1,
|
||||
EVENT_SURGE = 2,
|
||||
EVENT_RETALIATION = 3,
|
||||
EVENT_KILL_TALK = 4,
|
||||
EVENT_CHECK_HEALTH = 5
|
||||
};
|
||||
|
||||
class boss_watchkeeper_gargolmar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_watchkeeper_gargolmar() : CreatureScript("boss_watchkeeper_gargolmar") { }
|
||||
|
||||
struct boss_watchkeeper_gargolmarAI : public BossAI
|
||||
{
|
||||
boss_watchkeeper_gargolmarAI(Creature* creature) : BossAI(creature, DATA_WATCHKEEPER_GARGOLMAR)
|
||||
{
|
||||
_taunted = false;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
BossAI::EnterCombat(who);
|
||||
events.ScheduleEvent(EVENT_MORTAL_WOUND, 5000);
|
||||
events.ScheduleEvent(EVENT_SURGE, 3000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
events.ScheduleEvent(EVENT_RETALIATION, 1000);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!_taunted)
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
_taunted = true;
|
||||
Talk(SAY_TAUNT);
|
||||
}
|
||||
}
|
||||
|
||||
BossAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_KILL_TALK) == 0)
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
events.ScheduleEvent(EVENT_KILL_TALK, 6000);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
Talk(SAY_DIE);
|
||||
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_MORTAL_WOUND:
|
||||
me->CastSpell(me->GetVictim(), SPELL_MORTAL_WOUND, false);
|
||||
events.ScheduleEvent(EVENT_MORTAL_WOUND, 8000);
|
||||
break;
|
||||
case EVENT_SURGE:
|
||||
Talk(SAY_SURGE);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0))
|
||||
me->CastSpell(target, SPELL_SURGE, false);
|
||||
events.ScheduleEvent(EVENT_SURGE, 11000);
|
||||
break;
|
||||
case EVENT_RETALIATION:
|
||||
if (me->HealthBelowPct(20))
|
||||
{
|
||||
me->CastSpell(me, SPELL_RETALIATION, false);
|
||||
events.ScheduleEvent(EVENT_RETALIATION, 30000);
|
||||
}
|
||||
else
|
||||
events.ScheduleEvent(EVENT_RETALIATION, 500);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(50))
|
||||
{
|
||||
Talk(SAY_HEAL);
|
||||
std::list<Creature*> clist;
|
||||
me->GetCreaturesWithEntryInRange(clist, 100.0f, NPC_HELLFIRE_WATCHER);
|
||||
for (std::list<Creature*>::const_iterator itr = clist.begin(); itr != clist.end(); ++itr)
|
||||
(*itr)->AI()->SetData(NPC_HELLFIRE_WATCHER, 0);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 500);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
bool _taunted;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_watchkeeper_gargolmarAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_watchkeeper_gargolmar()
|
||||
{
|
||||
new boss_watchkeeper_gargolmar();
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_RAMPARTS_H
|
||||
#define DEF_RAMPARTS_H
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_WATCHKEEPER_GARGOLMAR = 0,
|
||||
DATA_OMOR_THE_UNSCARRED = 1,
|
||||
DATA_VAZRUDEN = 2,
|
||||
MAX_ENCOUNTERS = 3
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_HELLFIRE_SENTRY = 17517,
|
||||
NPC_VAZRUDEN_HERALD = 17307,
|
||||
NPC_VAZRUDEN = 17537,
|
||||
NPC_NAZAN = 17536
|
||||
};
|
||||
|
||||
enum GameobjectIds
|
||||
{
|
||||
GO_FEL_IRON_CHEST_NORMAL = 185168,
|
||||
GO_FEL_IRON_CHECT_HEROIC = 185169
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "hellfire_ramparts.h"
|
||||
|
||||
class instance_ramparts : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_ramparts() : InstanceMapScript("instance_ramparts", 543) { }
|
||||
|
||||
struct instance_ramparts_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_ramparts_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTERS);
|
||||
felIronChestGUID = 0;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_FEL_IRON_CHEST_NORMAL:
|
||||
case GO_FEL_IRON_CHECT_HEROIC:
|
||||
felIronChestGUID = go->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
if (type == DATA_VAZRUDEN && state == DONE)
|
||||
if (GameObject* chest = instance->GetGameObject(felIronChestGUID))
|
||||
chest->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "H R " << GetBossSaveData();
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* strIn)
|
||||
{
|
||||
if (!strIn)
|
||||
return;
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
std::istringstream loadStream(strIn);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'H' && dataHead2 == 'R')
|
||||
{
|
||||
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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
uint64 felIronChestGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_ramparts_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_ramparts()
|
||||
{
|
||||
new instance_ramparts();
|
||||
}
|
||||
@@ -1,328 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "magtheridons_lair.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_TAUNT = 0,
|
||||
SAY_FREE = 1,
|
||||
SAY_AGGRO = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_BANISH = 4,
|
||||
SAY_PHASE3 = 5,
|
||||
SAY_DEATH = 6,
|
||||
};
|
||||
|
||||
enum Emotes
|
||||
{
|
||||
SAY_EMOTE_BEGIN = 7,
|
||||
SAY_EMOTE_NEARLY = 8,
|
||||
SAY_EMOTE_FREE = 9,
|
||||
SAY_EMOTE_NOVA = 10
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SHADOW_CAGE = 30205,
|
||||
SPELL_BLAST_NOVA = 30616,
|
||||
SPELL_CLEAVE = 30619,
|
||||
SPELL_BLAZE = 30541,
|
||||
SPELL_BLAZE_SUMMON = 30542,
|
||||
SPELL_BERSERK = 27680,
|
||||
SPELL_SHADOW_GRASP_VISUAL = 30166,
|
||||
SPELL_MIND_EXHAUSTION = 44032,
|
||||
SPELL_QUAKE = 30657,
|
||||
SPELL_COLLAPSE_DAMAGE = 36449,
|
||||
SPELL_CAMERA_SHAKE = 36455,
|
||||
SPELL_DEBRIS_VISUAL = 30632,
|
||||
SPELL_DEBRIS_DAMAGE = 30631
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_EMOTE1 = 1,
|
||||
EVENT_EMOTE2 = 2,
|
||||
EVENT_EMOTE3 = 3,
|
||||
EVENT_ENTER_COMBAT = 4,
|
||||
EVENT_RECENTLY_SPOKEN = 5,
|
||||
|
||||
EVENT_CLEAVE = 10,
|
||||
EVENT_BLAST_NOVA = 11,
|
||||
EVENT_BLAZE = 12,
|
||||
EVENT_ENRAGE = 13,
|
||||
EVENT_QUAKE = 14,
|
||||
EVENT_CHECK_HEALTH = 15,
|
||||
EVENT_COLLAPSE_CEIL = 16,
|
||||
EVENT_COLLAPSE_DAMAGE = 17,
|
||||
EVENT_DEBRIS = 18,
|
||||
|
||||
EVENT_RANDOM_TAUNT = 30,
|
||||
EVENT_CHECK_GRASP = 31,
|
||||
EVENT_CANCEL_GRASP_CHECK = 32
|
||||
};
|
||||
|
||||
class DealDebrisDamage : public BasicEvent
|
||||
{
|
||||
public:
|
||||
DealDebrisDamage(Creature& creature, uint64 targetGUID) : _owner(creature), _targetGUID(targetGUID) { }
|
||||
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*updateTime*/)
|
||||
{
|
||||
if (Unit* target = ObjectAccessor::GetUnit(_owner, _targetGUID))
|
||||
target->CastSpell(target, SPELL_DEBRIS_DAMAGE, true, NULL, NULL, _owner.GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _targetGUID;
|
||||
Creature& _owner;
|
||||
};
|
||||
|
||||
class boss_magtheridon : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_magtheridon() : CreatureScript("boss_magtheridon") { }
|
||||
|
||||
struct boss_magtheridonAI : public BossAI
|
||||
{
|
||||
boss_magtheridonAI(Creature* creature) : BossAI(creature, TYPE_MAGTHERIDON) { }
|
||||
|
||||
EventMap events2;
|
||||
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events2.Reset();
|
||||
events2.ScheduleEvent(EVENT_RANDOM_TAUNT, 90000);
|
||||
_Reset();
|
||||
me->CastSpell(me, SPELL_SHADOW_CAGE, true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_IMMUNE_TO_PC);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (events.GetNextEventTime(EVENT_RECENTLY_SPOKEN) == 0)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_RECENTLY_SPOKEN, 5000);
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* /*who*/) { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events2.Reset();
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_EMOTE1, 0);
|
||||
events.ScheduleEvent(EVENT_EMOTE2, 60000);
|
||||
events.ScheduleEvent(EVENT_EMOTE3, 120000);
|
||||
events.ScheduleEvent(EVENT_ENTER_COMBAT, 123000);
|
||||
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events2.Update(diff);
|
||||
switch (events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_RANDOM_TAUNT:
|
||||
Talk(SAY_TAUNT);
|
||||
events2.ScheduleEvent(EVENT_RANDOM_TAUNT, 90000);
|
||||
break;
|
||||
case EVENT_CHECK_GRASP:
|
||||
if (me->GetAuraCount(SPELL_SHADOW_GRASP_VISUAL) == 5)
|
||||
{
|
||||
Talk(SAY_BANISH);
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
break;
|
||||
}
|
||||
events2.ScheduleEvent(EVENT_CHECK_GRASP, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_EMOTE1:
|
||||
Talk(SAY_EMOTE_BEGIN);
|
||||
break;
|
||||
case EVENT_EMOTE2:
|
||||
Talk(SAY_EMOTE_NEARLY);
|
||||
break;
|
||||
case EVENT_EMOTE3:
|
||||
Talk(SAY_EMOTE_FREE);
|
||||
Talk(SAY_FREE);
|
||||
break;
|
||||
case EVENT_ENTER_COMBAT:
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_IMMUNE_TO_PC);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
events.ScheduleEvent(EVENT_CLEAVE, 9000);
|
||||
events.ScheduleEvent(EVENT_BLAST_NOVA, 60000);
|
||||
events.ScheduleEvent(EVENT_BLAZE, 10000);
|
||||
events.ScheduleEvent(EVENT_QUAKE, 40000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 500);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 22*MINUTE*IN_MILLISECONDS);
|
||||
|
||||
instance->SetData(DATA_ACTIVATE_CUBES, 1);
|
||||
me->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE);
|
||||
break;
|
||||
case EVENT_CLEAVE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CLEAVE, false);
|
||||
events.ScheduleEvent(EVENT_CLEAVE, 10000);
|
||||
break;
|
||||
case EVENT_BLAST_NOVA:
|
||||
me->CastSpell(me, SPELL_BLAST_NOVA, false);
|
||||
events.ScheduleEvent(EVENT_BLAST_NOVA, 60000);
|
||||
events.ScheduleEvent(EVENT_CANCEL_GRASP_CHECK, 12000);
|
||||
events2.ScheduleEvent(EVENT_CHECK_GRASP, 0);
|
||||
break;
|
||||
case EVENT_BLAZE:
|
||||
me->CastCustomSpell(SPELL_BLAZE, SPELLVALUE_MAX_TARGETS, 1);
|
||||
events.ScheduleEvent(EVENT_BLAZE, 30000);
|
||||
break;
|
||||
case EVENT_ENRAGE:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
case EVENT_CANCEL_GRASP_CHECK:
|
||||
events2.Reset();
|
||||
break;
|
||||
case EVENT_QUAKE:
|
||||
me->CastSpell(me, SPELL_QUAKE, false);
|
||||
events.ScheduleEvent(EVENT_QUAKE, 50000);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(30))
|
||||
{
|
||||
Talk(SAY_PHASE3);
|
||||
events.SetPhase(1);
|
||||
events.DelayEvents(18000);
|
||||
events.ScheduleEvent(EVENT_COLLAPSE_CEIL, 8000);
|
||||
events.ScheduleEvent(EVENT_COLLAPSE_DAMAGE, 15000);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 500);
|
||||
break;
|
||||
case EVENT_COLLAPSE_CEIL:
|
||||
me->CastSpell(me, SPELL_CAMERA_SHAKE, true);
|
||||
instance->SetData(DATA_COLLAPSE, GO_STATE_ACTIVE);
|
||||
break;
|
||||
case EVENT_COLLAPSE_DAMAGE:
|
||||
me->CastSpell(me, SPELL_COLLAPSE_DAMAGE, true);
|
||||
me->resetAttackTimer();
|
||||
events.SetPhase(0);
|
||||
events.ScheduleEvent(EVENT_DEBRIS, 20000);
|
||||
break;
|
||||
case EVENT_DEBRIS:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
{
|
||||
target->CastSpell(target, SPELL_DEBRIS_VISUAL, true, NULL, NULL, me->GetGUID());
|
||||
me->m_Events.AddEvent(new DealDebrisDamage(*me, target->GetGUID()), me->m_Events.CalculateTime(5000));
|
||||
}
|
||||
events.ScheduleEvent(EVENT_DEBRIS, 20000);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!events.IsInPhase(1))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_magtheridonAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_magtheridon_blaze : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_magtheridon_blaze() : SpellScriptLoader("spell_magtheridon_blaze") { }
|
||||
|
||||
class spell_magtheridon_blaze_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_magtheridon_blaze_SpellScript);
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, SPELL_BLAZE_SUMMON, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_magtheridon_blaze_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_magtheridon_blaze_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_magtheridon_shadow_grasp : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_magtheridon_shadow_grasp() : SpellScriptLoader("spell_magtheridon_shadow_grasp") { }
|
||||
|
||||
class spell_magtheridon_shadow_grasp_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_magtheridon_shadow_grasp_AuraScript)
|
||||
|
||||
void HandleDummyApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->CastSpell((Unit*)NULL, SPELL_SHADOW_GRASP_VISUAL, false);
|
||||
}
|
||||
|
||||
void HandleDummyRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->InterruptNonMeleeSpells(true);
|
||||
}
|
||||
|
||||
void HandlePeriodicRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), SPELL_MIND_EXHAUSTION, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_magtheridon_shadow_grasp_AuraScript::HandleDummyApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_magtheridon_shadow_grasp_AuraScript::HandleDummyRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_magtheridon_shadow_grasp_AuraScript::HandlePeriodicRemove, EFFECT_1, SPELL_AURA_PERIODIC_DAMAGE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_magtheridon_shadow_grasp_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_magtheridon()
|
||||
{
|
||||
new boss_magtheridon();
|
||||
new spell_magtheridon_blaze();
|
||||
new spell_magtheridon_shadow_grasp();
|
||||
}
|
||||
|
||||
@@ -1,227 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "magtheridons_lair.h"
|
||||
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_MAGTHERIDON_DOORS, TYPE_MAGTHERIDON, DOOR_TYPE_ROOM, BOUNDARY_S },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END
|
||||
};
|
||||
|
||||
MinionData const minionData[] =
|
||||
{
|
||||
{ NPC_HELLFIRE_CHANNELER, TYPE_MAGTHERIDON }
|
||||
};
|
||||
|
||||
class instance_magtheridons_lair : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_magtheridons_lair() : InstanceMapScript("instance_magtheridons_lair", 544) { }
|
||||
|
||||
struct instance_magtheridons_lair_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_magtheridons_lair_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
LoadDoorData(doorData);
|
||||
LoadMinionData(minionData);
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_wardersSet.clear();
|
||||
_cubesSet.clear();
|
||||
_columnSet.clear();
|
||||
_magtheridonGUID = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_MAGTHERIDON:
|
||||
_magtheridonGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_HELLFIRE_CHANNELER:
|
||||
AddMinion(creature, true);
|
||||
break;
|
||||
case NPC_HELLFIRE_WARDER:
|
||||
_wardersSet.insert(creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureRemove(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_HELLFIRE_CHANNELER:
|
||||
AddMinion(creature, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_MAGTHERIDON_DOORS:
|
||||
AddDoor(go, true);
|
||||
break;
|
||||
case GO_MANTICRON_CUBE:
|
||||
_cubesSet.insert(go->GetGUID());
|
||||
break;
|
||||
case GO_MAGTHERIDON_HALL:
|
||||
case GO_MAGTHERIDON_COLUMN0:
|
||||
case GO_MAGTHERIDON_COLUMN1:
|
||||
case GO_MAGTHERIDON_COLUMN2:
|
||||
case GO_MAGTHERIDON_COLUMN3:
|
||||
case GO_MAGTHERIDON_COLUMN4:
|
||||
case GO_MAGTHERIDON_COLUMN5:
|
||||
_columnSet.insert(go->GetGUID());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectRemove(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_MAGTHERIDON_DOORS:
|
||||
AddDoor(go, false);
|
||||
break;
|
||||
case GO_MANTICRON_CUBE:
|
||||
_cubesSet.erase(go->GetGUID());
|
||||
break;
|
||||
case GO_MAGTHERIDON_HALL:
|
||||
case GO_MAGTHERIDON_COLUMN0:
|
||||
case GO_MAGTHERIDON_COLUMN1:
|
||||
case GO_MAGTHERIDON_COLUMN2:
|
||||
case GO_MAGTHERIDON_COLUMN3:
|
||||
case GO_MAGTHERIDON_COLUMN4:
|
||||
case GO_MAGTHERIDON_COLUMN5:
|
||||
_columnSet.erase(go->GetGUID());
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 id, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(id, state))
|
||||
return false;
|
||||
|
||||
if (id == TYPE_MAGTHERIDON)
|
||||
{
|
||||
if (state == IN_PROGRESS)
|
||||
{
|
||||
for (std::set<uint64>::const_iterator itr = _wardersSet.begin(); itr != _wardersSet.end(); ++itr)
|
||||
if (Creature* warder = instance->GetCreature(*itr))
|
||||
if (warder->IsAlive())
|
||||
{
|
||||
warder->InterruptNonMeleeSpells(true);
|
||||
warder->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (std::set<uint64>::const_iterator itr = _cubesSet.begin(); itr != _cubesSet.end(); ++itr)
|
||||
if (GameObject* cube = instance->GetGameObject(*itr))
|
||||
cube->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
|
||||
if (state == NOT_STARTED)
|
||||
SetData(DATA_COLLAPSE, GO_READY);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_CHANNELER_COMBAT:
|
||||
if (GetBossState(TYPE_MAGTHERIDON) != IN_PROGRESS)
|
||||
if (Creature* magtheridon = instance->GetCreature(_magtheridonGUID))
|
||||
magtheridon->SetInCombatWithZone();
|
||||
break;
|
||||
case DATA_ACTIVATE_CUBES:
|
||||
for (std::set<uint64>::const_iterator itr = _cubesSet.begin(); itr != _cubesSet.end(); ++itr)
|
||||
if (GameObject* cube = instance->GetGameObject(*itr))
|
||||
cube->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_NOT_SELECTABLE);
|
||||
break;
|
||||
case DATA_COLLAPSE:
|
||||
for (std::set<uint64>::const_iterator itr = _columnSet.begin(); itr != _columnSet.end(); ++itr)
|
||||
if (GameObject* column = instance->GetGameObject(*itr))
|
||||
column->SetGoState(GOState(data));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "M L " << 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 == 'M' && dataHead2 == 'L')
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_ENCOUNTER; ++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 _magtheridonGUID;
|
||||
std::set<uint64> _wardersSet;
|
||||
std::set<uint64> _cubesSet;
|
||||
std::set<uint64> _columnSet;
|
||||
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_magtheridons_lair_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_magtheridons_lair()
|
||||
{
|
||||
new instance_magtheridons_lair();
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_MAGTHERIDONS_LAIR_H
|
||||
#define DEF_MAGTHERIDONS_LAIR_H
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
TYPE_MAGTHERIDON = 0,
|
||||
MAX_ENCOUNTER = 1,
|
||||
|
||||
DATA_CHANNELER_COMBAT = 10,
|
||||
DATA_ACTIVATE_CUBES = 11,
|
||||
DATA_COLLAPSE = 12
|
||||
};
|
||||
|
||||
enum NpcIds
|
||||
{
|
||||
NPC_MAGTHERIDON = 17257,
|
||||
NPC_HELLFIRE_CHANNELER = 17256,
|
||||
NPC_HELLFIRE_WARDER = 18829
|
||||
};
|
||||
|
||||
enum GoIds
|
||||
{
|
||||
GO_MAGTHERIDON_DOORS = 183847,
|
||||
GO_MANTICRON_CUBE = 181713,
|
||||
|
||||
GO_MAGTHERIDON_HALL = 184653,
|
||||
GO_MAGTHERIDON_COLUMN0 = 184634,
|
||||
GO_MAGTHERIDON_COLUMN1 = 184635,
|
||||
GO_MAGTHERIDON_COLUMN2 = 184636,
|
||||
GO_MAGTHERIDON_COLUMN3 = 184637,
|
||||
GO_MAGTHERIDON_COLUMN4 = 184638,
|
||||
GO_MAGTHERIDON_COLUMN5 = 184639
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,270 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "shattered_halls.h"
|
||||
|
||||
enum eGrandWarlockNethekurse
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_PEON_ATTACKED = 1,
|
||||
SAY_PEON_DIES = 2,
|
||||
SAY_TAUNT = 3,
|
||||
SAY_AGGRO = 4,
|
||||
SAY_SLAY = 5,
|
||||
SAY_DIE = 6,
|
||||
|
||||
SPELL_DEATH_COIL_N = 30741,
|
||||
SPELL_DEATH_COIL_H = 30500,
|
||||
SPELL_DARK_SPIN = 30502,
|
||||
SPELL_SHADOW_FISSURE = 30496,
|
||||
SPELL_SHADOW_CLEAVE_N = 30495,
|
||||
SPELL_SHADOW_SLAM_H = 35953,
|
||||
SPELL_SHADOW_SEAR = 30735,
|
||||
|
||||
SETDATA_DATA = 1,
|
||||
SETDATA_PEON_AGGRO = 1,
|
||||
SETDATA_PEON_DEATH = 2,
|
||||
|
||||
EVENT_STAGE_NONE = 0,
|
||||
EVENT_STAGE_INTRO = 1,
|
||||
EVENT_STAGE_TAUNT = 2,
|
||||
EVENT_STAGE_MAIN = 3,
|
||||
|
||||
EVENT_INTRO = 1,
|
||||
EVENT_SPELL_DEATH_COIL = 2,
|
||||
EVENT_SPELL_SHADOW_FISSURE = 3,
|
||||
EVENT_SPELL_CLEAVE = 4,
|
||||
EVENT_CHECK_HEALTH = 5,
|
||||
EVENT_START_ATTACK = 6
|
||||
};
|
||||
|
||||
// ########################################################
|
||||
// Grand Warlock Nethekurse
|
||||
// ########################################################
|
||||
|
||||
class boss_grand_warlock_nethekurse : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_grand_warlock_nethekurse() : CreatureScript("boss_grand_warlock_nethekurse") { }
|
||||
|
||||
struct boss_grand_warlock_nethekurseAI : public BossAI
|
||||
{
|
||||
boss_grand_warlock_nethekurseAI(Creature* creature) : BossAI(creature, DATA_NETHEKURSE) { }
|
||||
|
||||
EventMap events2;
|
||||
void Reset()
|
||||
{
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
EventStage = EVENT_STAGE_NONE;
|
||||
PeonEngagedCount = 0;
|
||||
PeonKilledCount = 0;
|
||||
_Reset();
|
||||
SummonMinions();
|
||||
events2.Reset();
|
||||
}
|
||||
|
||||
void SummonMinions()
|
||||
{
|
||||
me->SummonCreature(NPC_FEL_ORC_CONVERT, 172.556f, 258.227f, -13.191f, 1.41189f);
|
||||
me->SummonCreature(NPC_FEL_ORC_CONVERT, 165.181f, 261.511f, -13.1926f, 0.942743f);
|
||||
me->SummonCreature(NPC_FEL_ORC_CONVERT, 182.482f, 258.635f, -13.1788f, 1.70929f);
|
||||
me->SummonCreature(NPC_FEL_ORC_CONVERT, 189.616f, 259.866f, -13.1966f, 1.95748f);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DIE);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void SetData(uint32 data, uint32 value)
|
||||
{
|
||||
if (data != SETDATA_DATA)
|
||||
return;
|
||||
|
||||
switch (value)
|
||||
{
|
||||
case SETDATA_PEON_AGGRO:
|
||||
if (PeonEngagedCount >= 4)
|
||||
return;
|
||||
|
||||
if (EventStage < EVENT_STAGE_TAUNT)
|
||||
Talk(SAY_PEON_ATTACKED);
|
||||
break;
|
||||
case SETDATA_PEON_DEATH:
|
||||
if (PeonKilledCount >= 4)
|
||||
return;
|
||||
|
||||
if (EventStage < EVENT_STAGE_TAUNT)
|
||||
Talk(SAY_PEON_DIES);
|
||||
|
||||
if (++PeonKilledCount == 4)
|
||||
events2.ScheduleEvent(EVENT_START_ATTACK, 5000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (EventStage < EVENT_STAGE_MAIN)
|
||||
return;
|
||||
|
||||
if (me->Attack(who, true))
|
||||
{
|
||||
if (me->HealthBelowPct(21))
|
||||
DoStartNoMovement(who);
|
||||
else
|
||||
DoStartMovement(who);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->SetReactState(REACT_DEFENSIVE);
|
||||
summon->SetRegeneratingHealth(false);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (EventStage == EVENT_STAGE_NONE && me->IsWithinDistInMap(who, 30.0f))
|
||||
{
|
||||
if (who->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
events2.ScheduleEvent(EVENT_INTRO, 90000);
|
||||
Talk(SAY_INTRO);
|
||||
EventStage = EVENT_STAGE_INTRO;
|
||||
instance->SetBossState(DATA_NETHEKURSE, IN_PROGRESS);
|
||||
me->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
if (EventStage < EVENT_STAGE_MAIN)
|
||||
return;
|
||||
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events2.Update(diff);
|
||||
uint32 eventId = events2.ExecuteEvent();
|
||||
|
||||
if (EventStage < EVENT_STAGE_MAIN && instance->GetBossState(DATA_NETHEKURSE) == IN_PROGRESS)
|
||||
{
|
||||
if (eventId == EVENT_INTRO)
|
||||
{
|
||||
Talk(SAY_TAUNT);
|
||||
EventStage = EVENT_STAGE_TAUNT;
|
||||
me->CastSpell(me, SPELL_SHADOW_SEAR, false);
|
||||
}
|
||||
else if (eventId == EVENT_START_ATTACK)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
EventStage = EVENT_STAGE_MAIN;
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
if (Unit* target = me->SelectNearestPlayer(50.0f))
|
||||
AttackStart(target);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_DEATH_COIL, 20000);
|
||||
events.ScheduleEvent(EVENT_SPELL_SHADOW_FISSURE, 8000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (EventStage < EVENT_STAGE_MAIN || me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_SHADOW_FISSURE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_SHADOW_FISSURE, false);
|
||||
events.RescheduleEvent(eventId, urand(7500, 10000));
|
||||
break;
|
||||
case EVENT_SPELL_DEATH_COIL:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_DEATH_COIL_N, SPELL_DEATH_COIL_H), false);
|
||||
events.RescheduleEvent(eventId, urand(15000, 20000));
|
||||
break;
|
||||
case EVENT_SPELL_CLEAVE:
|
||||
me->CastSpell(me->GetVictim(), DUNGEON_MODE(SPELL_SHADOW_CLEAVE_N, SPELL_SHADOW_SLAM_H), false);
|
||||
events.RescheduleEvent(EVENT_SPELL_CLEAVE, urand(6000, 8000));
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(21))
|
||||
{
|
||||
me->CastSpell(me, SPELL_DARK_SPIN, true);
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SPELL_CLEAVE, 3000);
|
||||
me->GetMotionMaster()->Clear();
|
||||
break;
|
||||
}
|
||||
events.RescheduleEvent(eventId, 1000);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!me->HealthBelowPct(21))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 PeonEngagedCount;
|
||||
uint32 PeonKilledCount;
|
||||
uint32 EventStage;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_grand_warlock_nethekurseAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_tsh_shadow_sear : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_tsh_shadow_sear() : SpellScriptLoader("spell_tsh_shadow_sear") { }
|
||||
|
||||
class spell_tsh_shadow_sear_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_tsh_shadow_sear_AuraScript);
|
||||
|
||||
void CalculateDamageAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
amount = 1000;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_tsh_shadow_sear_AuraScript::CalculateDamageAmount, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_tsh_shadow_sear_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_grand_warlock_nethekurse()
|
||||
{
|
||||
new boss_grand_warlock_nethekurse();
|
||||
new spell_tsh_shadow_sear();
|
||||
}
|
||||
@@ -1,259 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "shattered_halls.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_BLAST_WAVE = 30600,
|
||||
SPELL_FEAR = 30584,
|
||||
SPELL_THUNDERCLAP = 30633,
|
||||
SPELL_BURNING_MAUL_N = 30598,
|
||||
SPELL_BURNING_MAUL_H = 36056,
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
NPC_LEFT_HEAD = 19523,
|
||||
NPC_RIGHT_HEAD = 19524
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
EMOTE_ENRAGE = 0,
|
||||
|
||||
SETDATA_DATA = 1,
|
||||
SETDATA_YELL = 1
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_AGGRO_YELL_1 = 1,
|
||||
EVENT_AGGRO_YELL_2 = 2,
|
||||
EVENT_AGGRO_YELL_3 = 3,
|
||||
|
||||
EVENT_THREAT_YELL_L_1 = 4,
|
||||
EVENT_THREAT_YELL_L_2 = 5,
|
||||
EVENT_THREAT_YELL_L_3 = 6,
|
||||
|
||||
EVENT_THREAT_YELL_R_1 = 7,
|
||||
|
||||
EVENT_KILL_YELL_LEFT = 8,
|
||||
EVENT_KILL_YELL_RIGHT = 9,
|
||||
EVENT_DEATH_YELL = 10,
|
||||
|
||||
EVENT_SPELL_FEAR = 20,
|
||||
EVENT_SPELL_BURNING_MAUL = 21,
|
||||
EVENT_SPELL_THUNDER_CLAP = 22,
|
||||
EVENT_RESET_THREAT = 23,
|
||||
EVENT_SPELL_BLAST_WAVE = 24
|
||||
};
|
||||
|
||||
// ########################################################
|
||||
// Warbringer_Omrogg
|
||||
// ########################################################
|
||||
|
||||
class boss_warbringer_omrogg : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_warbringer_omrogg() : CreatureScript("boss_warbringer_omrogg") { }
|
||||
|
||||
struct boss_warbringer_omroggAI : public BossAI
|
||||
{
|
||||
boss_warbringer_omroggAI(Creature* creature) : BossAI(creature, DATA_OMROGG)
|
||||
{
|
||||
}
|
||||
|
||||
EventMap events2;
|
||||
|
||||
Creature* GetLeftHead()
|
||||
{
|
||||
return summons.GetCreatureWithEntry(NPC_LEFT_HEAD);
|
||||
}
|
||||
|
||||
Creature* GetRightHead()
|
||||
{
|
||||
return summons.GetCreatureWithEntry(NPC_RIGHT_HEAD);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
me->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
me->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0);
|
||||
|
||||
if (Creature* LeftHead = GetLeftHead())
|
||||
{
|
||||
uint8 aggroYell = urand(EVENT_AGGRO_YELL_1, EVENT_AGGRO_YELL_3);
|
||||
LeftHead->AI()->Talk(aggroYell-1);
|
||||
events2.ScheduleEvent(aggroYell, 3000);
|
||||
}
|
||||
|
||||
_EnterCombat();
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_FEAR, 8000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BURNING_MAUL, 25000);
|
||||
events.ScheduleEvent(EVENT_SPELL_THUNDER_CLAP, 15000);
|
||||
events.ScheduleEvent(EVENT_RESET_THREAT, 30000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
summons.Summon(summoned);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Creature* head = NULL;
|
||||
uint32 eventId = EVENT_KILL_YELL_LEFT;
|
||||
if (urand(0, 1))
|
||||
{
|
||||
head = GetLeftHead();
|
||||
eventId = EVENT_KILL_YELL_LEFT;
|
||||
}
|
||||
else
|
||||
{
|
||||
head = GetRightHead();
|
||||
eventId = EVENT_KILL_YELL_RIGHT;
|
||||
}
|
||||
|
||||
if (head)
|
||||
head->AI()->Talk(eventId-1);
|
||||
|
||||
events2.ScheduleEvent(eventId, 3000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Creature* LeftHead = GetLeftHead();
|
||||
Creature* RightHead = GetRightHead();
|
||||
if (!LeftHead || !RightHead)
|
||||
return;
|
||||
|
||||
LeftHead->DespawnOrUnsummon(5000);
|
||||
RightHead->DespawnOrUnsummon(5000);
|
||||
|
||||
LeftHead->AI()->Talk(EVENT_DEATH_YELL-1);
|
||||
RightHead->AI()->SetData(SETDATA_DATA, SETDATA_YELL);
|
||||
|
||||
instance->SetBossState(DATA_OMROGG, DONE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events2.Update(diff);
|
||||
switch (uint32 eventId = events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_AGGRO_YELL_1:
|
||||
case EVENT_AGGRO_YELL_2:
|
||||
case EVENT_AGGRO_YELL_3:
|
||||
case EVENT_KILL_YELL_LEFT:
|
||||
case EVENT_THREAT_YELL_L_1:
|
||||
case EVENT_THREAT_YELL_L_2:
|
||||
case EVENT_THREAT_YELL_L_3:
|
||||
if (Creature* RightHead = GetRightHead())
|
||||
RightHead->AI()->Talk(eventId-1);
|
||||
break;
|
||||
case EVENT_KILL_YELL_RIGHT:
|
||||
case EVENT_THREAT_YELL_R_1:
|
||||
if (Creature* LeftHead = GetLeftHead())
|
||||
LeftHead->AI()->Talk(eventId-1);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_FEAR:
|
||||
me->CastSpell(me, SPELL_FEAR, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_FEAR, 22000);
|
||||
break;
|
||||
case EVENT_SPELL_THUNDER_CLAP:
|
||||
me->CastSpell(me, SPELL_THUNDERCLAP, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_THUNDER_CLAP, 25000);
|
||||
break;
|
||||
case EVENT_RESET_THREAT:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
{
|
||||
uint8 threatYell = urand(EVENT_THREAT_YELL_L_1, EVENT_THREAT_YELL_R_1);
|
||||
if (Creature* head = threatYell == EVENT_THREAT_YELL_R_1 ? GetRightHead() : GetLeftHead())
|
||||
head->AI()->Talk(threatYell-1);
|
||||
events.ScheduleEvent(threatYell, 3000);
|
||||
|
||||
DoResetThreat();
|
||||
me->AddThreat(target, 10.0f);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_RESET_THREAT, 30000);
|
||||
break;
|
||||
case EVENT_SPELL_BURNING_MAUL:
|
||||
Talk(EMOTE_ENRAGE);
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_BURNING_MAUL_N, SPELL_BURNING_MAUL_H), false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BURNING_MAUL, 40000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLAST_WAVE, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLAST_WAVE, 20000);
|
||||
break;
|
||||
case EVENT_SPELL_BLAST_WAVE:
|
||||
me->CastSpell(me, SPELL_BLAST_WAVE, false);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_warbringer_omroggAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class npc_omrogg_heads : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_omrogg_heads() : CreatureScript("npc_omrogg_heads") { }
|
||||
|
||||
struct npc_omrogg_headsAI : public NullCreatureAI
|
||||
{
|
||||
npc_omrogg_headsAI(Creature* creature) : NullCreatureAI(creature) { timer = 0; }
|
||||
|
||||
void SetData(uint32 data, uint32 value)
|
||||
{
|
||||
if (data == SETDATA_DATA && value == SETDATA_YELL)
|
||||
timer = 1;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (timer)
|
||||
{
|
||||
timer += diff;
|
||||
if (timer >= 3000)
|
||||
{
|
||||
timer = 0;
|
||||
Talk(EVENT_DEATH_YELL-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uint32 timer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<npc_omrogg_headsAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_warbringer_omrogg()
|
||||
{
|
||||
new boss_warbringer_omrogg();
|
||||
new npc_omrogg_heads();
|
||||
}
|
||||
@@ -1,177 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "shattered_halls.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SLAY = 1,
|
||||
SAY_DEATH = 2
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_BLADE_DANCE = 30739,
|
||||
SPELL_CHARGE = 25821,
|
||||
SPELL_SPRINT = 32720,
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
NPC_SHATTERED_ASSASSIN = 17695,
|
||||
NPC_HEARTHEN_GUARD = 17621,
|
||||
NPC_SHARPSHOOTER_GUARD = 17622,
|
||||
NPC_REAVER_GUARD = 17623
|
||||
};
|
||||
|
||||
float AssassEntrance[3] = { 275.136f, -84.29f, 2.3f }; // y -8
|
||||
float AssassExit[3] = { 184.233f, -84.29f, 2.3f }; // y -8
|
||||
float AddsEntrance[3] = { 306.036f, -84.29f, 1.93f };
|
||||
|
||||
enum Misc
|
||||
{
|
||||
EVENT_CHECK_ROOM = 1,
|
||||
EVENT_SUMMON_ADDS = 2,
|
||||
EVENT_SUMMON_ASSASSINS = 3,
|
||||
EVENT_SPELL_CHARGE = 4,
|
||||
EVENT_MOVE_TO_NEXT_POINT = 5,
|
||||
EVENT_BLADE_DANCE = 6,
|
||||
EVENT_FINISH_BLADE_DANCE = 7
|
||||
};
|
||||
|
||||
class boss_warchief_kargath_bladefist : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_warchief_kargath_bladefist() : CreatureScript("boss_warchief_kargath_bladefist") { }
|
||||
|
||||
struct boss_warchief_kargath_bladefistAI : public BossAI
|
||||
{
|
||||
boss_warchief_kargath_bladefistAI(Creature* creature) : BossAI(creature, DATA_KARGATH) { }
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
BossAI::InitializeAI();
|
||||
if (instance)
|
||||
if (Creature* executioner = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_EXECUTIONER)))
|
||||
executioner->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
_JustDied();
|
||||
|
||||
if (instance)
|
||||
if (Creature* executioner = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_EXECUTIONER)))
|
||||
executioner->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
_EnterCombat();
|
||||
|
||||
events.ScheduleEvent(EVENT_CHECK_ROOM, 5000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_ADDS, 30000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_ASSASSINS, 5000);
|
||||
events.ScheduleEvent(EVENT_BLADE_DANCE, 30000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CHARGE, 0);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
if (summon->GetEntry() != NPC_SHATTERED_ASSASSIN)
|
||||
summon->AI()->AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0));
|
||||
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id != 1)
|
||||
return;
|
||||
|
||||
me->CastSpell(me, SPELL_BLADE_DANCE, true);
|
||||
events.ScheduleEvent(EVENT_MOVE_TO_NEXT_POINT, 0);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_ROOM:
|
||||
if (me->GetPositionX() > 255 || me->GetPositionX() < 205)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_ROOM, 5000);
|
||||
break;
|
||||
case EVENT_SUMMON_ASSASSINS:
|
||||
me->SummonCreature(NPC_SHATTERED_ASSASSIN, AssassEntrance[0], AssassEntrance[1]+8, AssassEntrance[2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
me->SummonCreature(NPC_SHATTERED_ASSASSIN, AssassEntrance[0], AssassEntrance[1]-8, AssassEntrance[2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
me->SummonCreature(NPC_SHATTERED_ASSASSIN, AssassExit[0], AssassExit[1]+8, AssassExit[2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
me->SummonCreature(NPC_SHATTERED_ASSASSIN, AssassExit[0], AssassExit[1]-8, AssassExit[2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
break;
|
||||
case EVENT_SUMMON_ADDS:
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
me->SummonCreature(NPC_HEARTHEN_GUARD+urand(0,2), AddsEntrance[0], AddsEntrance[1], AddsEntrance[2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
|
||||
events.ScheduleEvent(EVENT_SUMMON_ADDS, 30000);
|
||||
break;
|
||||
case EVENT_BLADE_DANCE:
|
||||
events.DelayEvents(10001);
|
||||
events.ScheduleEvent(EVENT_BLADE_DANCE, 40000);
|
||||
events.ScheduleEvent(EVENT_MOVE_TO_NEXT_POINT, 0);
|
||||
events.ScheduleEvent(EVENT_FINISH_BLADE_DANCE, 10000);
|
||||
events.SetPhase(1);
|
||||
me->CastSpell(me, SPELL_SPRINT, true);
|
||||
break;
|
||||
case EVENT_MOVE_TO_NEXT_POINT:
|
||||
{
|
||||
float x = 210 + frand(0.0f, 35.0f);
|
||||
float y = -65.0f - frand(0.0f, 35.0f);
|
||||
me->GetMotionMaster()->MovePoint(1, x, y, me->GetPositionZ());
|
||||
break;
|
||||
}
|
||||
case EVENT_FINISH_BLADE_DANCE:
|
||||
events.SetPhase(0);
|
||||
me->GetMotionMaster()->Clear();
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SPELL_CHARGE, 3000);
|
||||
break;
|
||||
case EVENT_SPELL_CHARGE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_CHARGE, false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!events.IsInPhase(1))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_warchief_kargath_bladefistAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_warchief_kargath_bladefist()
|
||||
{
|
||||
new boss_warchief_kargath_bladefist();
|
||||
}
|
||||
@@ -1,290 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "shattered_halls.h"
|
||||
#include "CreatureTextMgr.h"
|
||||
|
||||
class instance_shattered_halls : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_shattered_halls() : InstanceMapScript("instance_shattered_halls", 540) { }
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_shattered_halls_InstanceMapScript(map);
|
||||
}
|
||||
|
||||
struct instance_shattered_halls_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_shattered_halls_InstanceMapScript(Map* map) : InstanceScript(map) { }
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
SetBossNumber(ENCOUNTER_COUNT);
|
||||
nethekurseDoor1GUID = 0;
|
||||
nethekurseDoor2GUID = 0;
|
||||
warchiefKargathGUID = 0;
|
||||
|
||||
executionerGUID = 0;
|
||||
memset(&prisonerGUID, 0, sizeof(prisonerGUID));
|
||||
TeamIdInInstance = TEAM_NEUTRAL;
|
||||
RescueTimer = 100*MINUTE*IN_MILLISECONDS;
|
||||
}
|
||||
|
||||
void OnPlayerEnter(Player* player)
|
||||
{
|
||||
if (TeamIdInInstance == TEAM_NEUTRAL)
|
||||
TeamIdInInstance = player->GetTeamId();
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_GRAND_WARLOCK_CHAMBER_DOOR_1:
|
||||
nethekurseDoor1GUID = go->GetGUID();
|
||||
if (GetBossState(DATA_NETHEKURSE) == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
case GO_GRAND_WARLOCK_CHAMBER_DOOR_2:
|
||||
nethekurseDoor2GUID = go->GetGUID();
|
||||
if (GetBossState(DATA_NETHEKURSE) == DONE)
|
||||
HandleGameObject(0, true, go);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
if (TeamIdInInstance == TEAM_NEUTRAL)
|
||||
{
|
||||
Map::PlayerList const &players = instance->GetPlayers();
|
||||
if (!players.isEmpty())
|
||||
if (Player* player = players.begin()->GetSource())
|
||||
TeamIdInInstance = player->GetTeamId();
|
||||
}
|
||||
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_WARCHIEF_KARGATH:
|
||||
warchiefKargathGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SHATTERED_EXECUTIONER:
|
||||
if (RescueTimer > 25*MINUTE*IN_MILLISECONDS)
|
||||
creature->AddLootMode(2);
|
||||
executionerGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_RIFLEMAN_BROWNBEARD:
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_KORAG_PROUDMANE);
|
||||
prisonerGUID[0] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_CAPTAIN_ALINA:
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_CAPTAIN_BONESHATTER);
|
||||
prisonerGUID[1] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_PRIVATE_JACINT:
|
||||
if (TeamIdInInstance == TEAM_HORDE)
|
||||
creature->UpdateEntry(NPC_SCOUT_ORGARR);
|
||||
prisonerGUID[2] = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case DATA_NETHEKURSE:
|
||||
if (state == IN_PROGRESS)
|
||||
{
|
||||
HandleGameObject(nethekurseDoor1GUID, false);
|
||||
HandleGameObject(nethekurseDoor2GUID, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
HandleGameObject(nethekurseDoor1GUID, true);
|
||||
HandleGameObject(nethekurseDoor2GUID, true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
if (type == DATA_ENTERED_ROOM && data == DATA_ENTERED_ROOM && RescueTimer == 100*MINUTE*IN_MILLISECONDS)
|
||||
{
|
||||
DoCastSpellOnPlayers(SPELL_KARGATHS_EXECUTIONER_1);
|
||||
instance->LoadGrid(230, -80);
|
||||
|
||||
if (Creature* kargath = instance->GetCreature(warchiefKargathGUID))
|
||||
sCreatureTextMgr->SendChat(kargath, TeamIdInInstance == TEAM_ALLIANCE ? 3 : 4, NULL, CHAT_MSG_ADDON, LANG_ADDON, TEXT_RANGE_MAP);
|
||||
|
||||
RescueTimer = 80*MINUTE*IN_MILLISECONDS;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 data) const
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case DATA_PRISONER_1:
|
||||
case DATA_PRISONER_2:
|
||||
case DATA_PRISONER_3:
|
||||
return prisonerGUID[data-DATA_PRISONER_1];
|
||||
case DATA_EXECUTIONER:
|
||||
return executionerGUID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
if (RescueTimer && RescueTimer < 100*MINUTE*IN_MILLISECONDS)
|
||||
{
|
||||
RescueTimer -= std::min(RescueTimer, diff);
|
||||
|
||||
if ((RescueTimer / IN_MILLISECONDS) == 25*MINUTE)
|
||||
{
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_KARGATHS_EXECUTIONER_1);
|
||||
DoCastSpellOnPlayers(SPELL_KARGATHS_EXECUTIONER_2);
|
||||
if (Creature* prisoner = instance->GetCreature(prisonerGUID[0]))
|
||||
Unit::Kill(prisoner, prisoner);
|
||||
if (Creature* executioner = instance->GetCreature(executionerGUID))
|
||||
executioner->RemoveLootMode(2);
|
||||
}
|
||||
else if ((RescueTimer / IN_MILLISECONDS) == 15*MINUTE)
|
||||
{
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_KARGATHS_EXECUTIONER_2);
|
||||
DoCastSpellOnPlayers(SPELL_KARGATHS_EXECUTIONER_3);
|
||||
if (Creature* prisoner = instance->GetCreature(prisonerGUID[1]))
|
||||
Unit::Kill(prisoner, prisoner);
|
||||
}
|
||||
else if ((RescueTimer / IN_MILLISECONDS) == 0)
|
||||
{
|
||||
DoRemoveAurasDueToSpellOnPlayers(SPELL_KARGATHS_EXECUTIONER_3);
|
||||
if (Creature* prisoner = instance->GetCreature(prisonerGUID[2]))
|
||||
Unit::Kill(prisoner, prisoner);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "S H " << GetBossSaveData() << ' ' << RescueTimer;
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* strIn)
|
||||
{
|
||||
if (!strIn)
|
||||
{
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
OUT_LOAD_INST_DATA(strIn);
|
||||
|
||||
char dataHead1, dataHead2;
|
||||
|
||||
std::istringstream loadStream(strIn);
|
||||
loadStream >> dataHead1 >> dataHead2;
|
||||
|
||||
if (dataHead1 == 'S' && dataHead2 == 'H')
|
||||
{
|
||||
for (uint8 i = 0; i < ENCOUNTER_COUNT; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
|
||||
loadStream >> RescueTimer;
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint64 warchiefKargathGUID;
|
||||
uint64 nethekurseDoor1GUID;
|
||||
uint64 nethekurseDoor2GUID;
|
||||
|
||||
uint64 executionerGUID;
|
||||
uint64 prisonerGUID[3];
|
||||
uint32 RescueTimer;
|
||||
TeamId TeamIdInInstance;
|
||||
};
|
||||
};
|
||||
|
||||
class spell_tsh_shoot_flame_arrow : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_tsh_shoot_flame_arrow() : SpellScriptLoader("spell_tsh_shoot_flame_arrow") { }
|
||||
|
||||
class spell_tsh_shoot_flame_arrow_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_tsh_shoot_flame_arrow_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||
{
|
||||
Trinity::Containers::RandomResizeList(unitList, 1);
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, 30953, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_tsh_shoot_flame_arrow_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENTRY);
|
||||
OnEffectHitTarget += SpellEffectFn(spell_tsh_shoot_flame_arrow_SpellScript::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_tsh_shoot_flame_arrow_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class at_shattered_halls_execution : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_shattered_halls_execution() : AreaTriggerScript("at_shattered_halls_execution") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/)
|
||||
{
|
||||
if (InstanceScript* instanceScript = player->GetInstanceScript())
|
||||
instanceScript->SetData(DATA_ENTERED_ROOM, DATA_ENTERED_ROOM);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_shattered_halls()
|
||||
{
|
||||
new instance_shattered_halls();
|
||||
new spell_tsh_shoot_flame_arrow();
|
||||
new at_shattered_halls_execution();
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_SHATTERED_H
|
||||
#define DEF_SHATTERED_H
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_NETHEKURSE = 0,
|
||||
DATA_OMROGG = 1,
|
||||
DATA_KARGATH = 2,
|
||||
ENCOUNTER_COUNT = 3,
|
||||
|
||||
DATA_ENTERED_ROOM = 10,
|
||||
DATA_PRISONER_1 = 11,
|
||||
DATA_PRISONER_2 = 12,
|
||||
DATA_PRISONER_3 = 13,
|
||||
DATA_EXECUTIONER = 14
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_GRAND_WARLOCK_NETHEKURSE = 16807,
|
||||
NPC_WARCHIEF_KARGATH = 16808,
|
||||
NPC_FEL_ORC_CONVERT = 17083,
|
||||
|
||||
// Trial of the Naaru: Mercy
|
||||
NPC_SHATTERED_EXECUTIONER = 17301,
|
||||
NPC_RIFLEMAN_BROWNBEARD = 17289,
|
||||
NPC_CAPTAIN_ALINA = 17290,
|
||||
NPC_PRIVATE_JACINT = 17292,
|
||||
NPC_KORAG_PROUDMANE = 17295,
|
||||
NPC_CAPTAIN_BONESHATTER = 17296,
|
||||
NPC_SCOUT_ORGARR = 17297,
|
||||
};
|
||||
|
||||
enum GameobjectIds
|
||||
{
|
||||
GO_GRAND_WARLOCK_CHAMBER_DOOR_1 = 182539,
|
||||
GO_GRAND_WARLOCK_CHAMBER_DOOR_2 = 182540
|
||||
};
|
||||
|
||||
enum SpellIds
|
||||
{
|
||||
SPELL_KARGATHS_EXECUTIONER_1 = 39288,
|
||||
SPELL_KARGATHS_EXECUTIONER_2 = 39289,
|
||||
SPELL_KARGATHS_EXECUTIONER_3 = 39290
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,491 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "the_eye.h"
|
||||
#include "WaypointManager.h"
|
||||
#include "MoveSplineInit.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_BERSERK = 45078,
|
||||
SPELL_FLAME_QUILLS = 34229,
|
||||
SPELL_QUILL_MISSILE_1 = 34269, // 21
|
||||
SPELL_QUILL_MISSILE_2 = 34314, // 3
|
||||
SPELL_FLAME_BUFFET = 34121,
|
||||
SPELL_EMBER_BLAST = 34341,
|
||||
SPELL_REBIRTH_PHASE2 = 34342,
|
||||
SPELL_MELT_ARMOR = 35410,
|
||||
SPELL_CHARGE = 35412,
|
||||
SPELL_REBIRTH_DIVE = 35369,
|
||||
SPELL_DIVE_BOMB_VISUAL = 35367,
|
||||
SPELL_DIVE_BOMB = 35181
|
||||
};
|
||||
|
||||
const Position alarPoints[7] =
|
||||
{
|
||||
{340.15f, 58.65f, 17.71f, 4.60f},
|
||||
{388.09f, 31.54f, 20.18f, 1.61f},
|
||||
{388.18f, -32.85f, 20.18f, 0.52f},
|
||||
{340.29f, -60.19f, 17.72f, 5.71f},
|
||||
{332.0f, 0.01f, 43.0f, 0.0f},
|
||||
{331.0f, 0.01f, -2.38f, 0.0f},
|
||||
{332.0f, 0.01f, 43.0f, 0.0f}
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
DISPLAYID_INVISIBLE = 23377,
|
||||
NPC_EMBER_OF_ALAR = 19551,
|
||||
NPC_FLAME_PATCH = 20602,
|
||||
|
||||
POINT_PLATFORM = 0,
|
||||
POINT_QUILL = 4,
|
||||
POINT_MIDDLE = 5,
|
||||
POINT_DIVE = 6,
|
||||
|
||||
EVENT_SWITCH_PLATFORM = 1,
|
||||
EVENT_START_QUILLS = 2,
|
||||
EVENT_RELOCATE_MIDDLE = 3,
|
||||
EVENT_REBIRTH = 4,
|
||||
EVENT_SPELL_MELT_ARMOR = 5,
|
||||
EVENT_SPELL_FLAME_PATCH = 6,
|
||||
EVENT_SPELL_CHARGE = 7,
|
||||
EVENT_SPELL_DIVE_BOMB = 8,
|
||||
EVENT_START_DIVE = 9,
|
||||
EVENT_CAST_DIVE_BOMB = 10,
|
||||
EVENT_SUMMON_DIVE_PHOENIX = 11,
|
||||
EVENT_REBIRTH_DIVE = 12,
|
||||
EVENT_SPELL_BERSERK = 13,
|
||||
|
||||
EVENT_MOVE_TO_PHASE_2 = 20,
|
||||
EVENT_FINISH_DIVE = 21
|
||||
|
||||
};
|
||||
|
||||
// Xinef: Ruse of the Ashtongue (10946)
|
||||
enum qruseoftheAshtongue
|
||||
{
|
||||
SPELL_ASHTONGUE_RUSE = 42090,
|
||||
QUEST_RUSE_OF_THE_ASHTONGUE = 10946,
|
||||
};
|
||||
|
||||
class boss_alar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_alar() : CreatureScript("boss_alar") { }
|
||||
|
||||
struct boss_alarAI : public BossAI
|
||||
{
|
||||
boss_alarAI(Creature* creature) : BossAI(creature, DATA_ALAR)
|
||||
{
|
||||
startPath = true;
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
|
||||
uint8 platform;
|
||||
uint8 noQuillTimes;
|
||||
bool startPath;
|
||||
|
||||
void JustReachedHome()
|
||||
{
|
||||
BossAI::JustReachedHome();
|
||||
startPath = true;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
platform = 0;
|
||||
noQuillTimes = 0;
|
||||
me->SetModelVisible(true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_FIRE, true);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
BossAI::EnterCombat(who);
|
||||
events.ScheduleEvent(EVENT_SWITCH_PLATFORM, 0);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
me->SetModelVisible(true);
|
||||
BossAI::JustDied(killer);
|
||||
|
||||
// Xinef: Ruse of the Ashtongue (10946)
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
{
|
||||
Player* player = itr->GetSource();
|
||||
if (player->GetQuestStatus(QUEST_RUSE_OF_THE_ASHTONGUE) == QUEST_STATUS_INCOMPLETE)
|
||||
if (player->HasAura(SPELL_ASHTONGUE_RUSE))
|
||||
player->AreaExploredOrEventHappens(QUEST_RUSE_OF_THE_ASHTONGUE);
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (summon->GetEntry() == NPC_EMBER_OF_ALAR)
|
||||
summon->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_FIRE, true);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* /*who*/) { }
|
||||
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth() && platform < POINT_MIDDLE)
|
||||
{
|
||||
damage = 0;
|
||||
if (events.GetNextEventTime(EVENT_REBIRTH) == 0)
|
||||
{
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->SetHealth(me->GetMaxHealth());
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->CastSpell(me, SPELL_EMBER_BLAST, true);
|
||||
|
||||
me->setAttackTimer(BASE_ATTACK, 16000);
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_RELOCATE_MIDDLE, 8000);
|
||||
events.ScheduleEvent(EVENT_MOVE_TO_PHASE_2, 12000);
|
||||
events.ScheduleEvent(EVENT_REBIRTH, 16001);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE)
|
||||
{
|
||||
if (type == ESCORT_MOTION_TYPE && me->movespline->Finalized() && !me->IsInCombat())
|
||||
startPath = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (id == POINT_PLATFORM)
|
||||
me->setAttackTimer(BASE_ATTACK, 1000);
|
||||
else if (id == POINT_QUILL)
|
||||
events.ScheduleEvent(EVENT_START_QUILLS, 1000);
|
||||
else if (id == POINT_DIVE)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_START_DIVE, 1000);
|
||||
events.ScheduleEvent(EVENT_CAST_DIVE_BOMB, 5000);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (startPath)
|
||||
{
|
||||
me->StopMoving();
|
||||
startPath = false;
|
||||
if (WaypointPath const* i_path = sWaypointMgr->GetPath(me->GetWaypointPath()))
|
||||
{
|
||||
Movement::PointsArray pathPoints;
|
||||
pathPoints.push_back(G3D::Vector3(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()));
|
||||
for (uint8 i = 0; i < i_path->size(); ++i)
|
||||
{
|
||||
WaypointData const* node = i_path->at(i);
|
||||
pathPoints.push_back(G3D::Vector3(node->x, node->y, node->z));
|
||||
}
|
||||
me->GetMotionMaster()->MoveSplinePath(&pathPoints);
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SWITCH_PLATFORM:
|
||||
if (roll_chance_i(20*noQuillTimes))
|
||||
{
|
||||
noQuillTimes = 0;
|
||||
platform = RAND(0, 3);
|
||||
me->GetMotionMaster()->MovePoint(POINT_QUILL, alarPoints[POINT_QUILL], false, true);
|
||||
events.ScheduleEvent(EVENT_SWITCH_PLATFORM, 16000);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (noQuillTimes++ > 0)
|
||||
{
|
||||
me->SetOrientation(alarPoints[platform].GetOrientation());
|
||||
me->SummonCreature(NPC_EMBER_OF_ALAR, *me, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000);
|
||||
}
|
||||
me->GetMotionMaster()->MovePoint(POINT_PLATFORM, alarPoints[platform], false, true);
|
||||
platform = (++platform)%4;
|
||||
events.ScheduleEvent(EVENT_SWITCH_PLATFORM, 30000);
|
||||
}
|
||||
me->setAttackTimer(BASE_ATTACK, 20000);
|
||||
break;
|
||||
case EVENT_START_QUILLS:
|
||||
me->CastSpell(me, SPELL_FLAME_QUILLS, false);
|
||||
break;
|
||||
case EVENT_RELOCATE_MIDDLE:
|
||||
me->SetPosition(alarPoints[POINT_MIDDLE]);
|
||||
break;
|
||||
case EVENT_MOVE_TO_PHASE_2:
|
||||
me->RemoveAurasDueToSpell(SPELL_EMBER_BLAST);
|
||||
me->CastSpell(me, SPELL_REBIRTH_PHASE2, false);
|
||||
break;
|
||||
case EVENT_REBIRTH:
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
platform = POINT_MIDDLE;
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_MELT_ARMOR, 67000);
|
||||
events.ScheduleEvent(EVENT_SPELL_CHARGE, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FLAME_PATCH, 20000);
|
||||
events.ScheduleEvent(EVENT_SPELL_DIVE_BOMB, 30000);
|
||||
break;
|
||||
case EVENT_SPELL_MELT_ARMOR:
|
||||
me->CastSpell(me->GetVictim(), SPELL_MELT_ARMOR, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_MELT_ARMOR, 60000);
|
||||
break;
|
||||
case EVENT_SPELL_CHARGE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
me->CastSpell(target, SPELL_CHARGE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_CHARGE, 30000);
|
||||
break;
|
||||
case EVENT_SPELL_FLAME_PATCH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true))
|
||||
me->SummonCreature(NPC_FLAME_PATCH, *target, TEMPSUMMON_TIMED_DESPAWN, 2*MINUTE*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_SPELL_FLAME_PATCH, 30000);
|
||||
break;
|
||||
case EVENT_SPELL_DIVE_BOMB:
|
||||
me->GetMotionMaster()->MovePoint(POINT_DIVE, alarPoints[POINT_DIVE], false, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_DIVE_BOMB, 30000);
|
||||
events.DelayEvents(15000);
|
||||
me->setAttackTimer(BASE_ATTACK, 20000);
|
||||
break;
|
||||
case EVENT_START_DIVE:
|
||||
me->CastSpell(me, SPELL_DIVE_BOMB_VISUAL, false);
|
||||
break;
|
||||
case EVENT_CAST_DIVE_BOMB:
|
||||
events.ScheduleEvent(EVENT_SUMMON_DIVE_PHOENIX, 2000);
|
||||
events.ScheduleEvent(EVENT_REBIRTH_DIVE, 6000);
|
||||
events.ScheduleEvent(EVENT_FINISH_DIVE, 10000);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 90.0f, true))
|
||||
{
|
||||
me->CastSpell(target, SPELL_DIVE_BOMB, false);
|
||||
me->SetPosition(*target);
|
||||
me->StopMovingOnCurrentPos();
|
||||
}
|
||||
|
||||
me->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL);
|
||||
break;
|
||||
case EVENT_SUMMON_DIVE_PHOENIX:
|
||||
{
|
||||
Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 10.0f, true);
|
||||
me->SummonCreature(NPC_EMBER_OF_ALAR, target ? *target : *me, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000);
|
||||
me->SummonCreature(NPC_EMBER_OF_ALAR, target ? *target : *me, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 6000);
|
||||
break;
|
||||
}
|
||||
case EVENT_REBIRTH_DIVE:
|
||||
me->SetModelVisible(true);
|
||||
me->CastSpell(me, SPELL_REBIRTH_DIVE, false);
|
||||
break;
|
||||
case EVENT_FINISH_DIVE:
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
break;
|
||||
case EVENT_SPELL_BERSERK:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
}
|
||||
|
||||
if (me->isAttackReady())
|
||||
{
|
||||
if (me->IsWithinMeleeRange(me->GetVictim()))
|
||||
{
|
||||
me->AttackerStateUpdate(me->GetVictim());
|
||||
me->resetAttackTimer();
|
||||
}
|
||||
else
|
||||
{
|
||||
me->resetAttackTimer();
|
||||
ThreatContainer::StorageType const &threatList = me->getThreatManager().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
if (Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
if (me->IsWithinMeleeRange(unit))
|
||||
{
|
||||
me->AttackerStateUpdate(unit);
|
||||
return;
|
||||
}
|
||||
|
||||
me->CastSpell(me, SPELL_FLAME_BUFFET, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_alarAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class CastQuill : public BasicEvent
|
||||
{
|
||||
public:
|
||||
CastQuill(Unit* caster, uint32 spellId) : _caster(caster), _spellId(spellId)
|
||||
{
|
||||
}
|
||||
|
||||
bool Execute(uint64 /*execTime*/, uint32 /*diff*/)
|
||||
{
|
||||
_caster->CastSpell(_caster, _spellId, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Unit* _caster;
|
||||
uint32 _spellId;
|
||||
};
|
||||
|
||||
class spell_alar_flame_quills : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_alar_flame_quills() : SpellScriptLoader("spell_alar_flame_quills") { }
|
||||
|
||||
class spell_alar_flame_quills_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_alar_flame_quills_AuraScript);
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
// 24 spells in total
|
||||
for (uint8 i = 0; i < 21; ++i)
|
||||
GetUnitOwner()->m_Events.AddEvent(new CastQuill(GetUnitOwner(), SPELL_QUILL_MISSILE_1+i), GetUnitOwner()->m_Events.CalculateTime(i*40));
|
||||
GetUnitOwner()->m_Events.AddEvent(new CastQuill(GetUnitOwner(), SPELL_QUILL_MISSILE_2+0), GetUnitOwner()->m_Events.CalculateTime(22*40));
|
||||
GetUnitOwner()->m_Events.AddEvent(new CastQuill(GetUnitOwner(), SPELL_QUILL_MISSILE_2+1), GetUnitOwner()->m_Events.CalculateTime(23*40));
|
||||
GetUnitOwner()->m_Events.AddEvent(new CastQuill(GetUnitOwner(), SPELL_QUILL_MISSILE_2+2), GetUnitOwner()->m_Events.CalculateTime(24*40));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_alar_flame_quills_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_alar_flame_quills_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_alar_ember_blast : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_alar_ember_blast() : SpellScriptLoader("spell_alar_ember_blast") { }
|
||||
|
||||
class spell_alar_ember_blast_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_alar_ember_blast_SpellScript);
|
||||
|
||||
void HandleForceCast(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitEffect(effIndex);
|
||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||
if (Creature* alar = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(NPC_ALAR)))
|
||||
Unit::DealDamage(GetCaster(), alar, alar->CountPctFromMaxHealth(2));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_alar_ember_blast_SpellScript::HandleForceCast, EFFECT_2, SPELL_EFFECT_FORCE_CAST);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_alar_ember_blast_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_alar_ember_blast_death : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_alar_ember_blast_death() : SpellScriptLoader("spell_alar_ember_blast_death") { }
|
||||
|
||||
class spell_alar_ember_blast_death_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_alar_ember_blast_death_AuraScript);
|
||||
|
||||
void OnApply(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PreventDefaultAction(); // xinef: prevent default action after change that invisibility in instances is executed instantly even for creatures
|
||||
Unit* target = GetTarget();
|
||||
InvisibilityType type = InvisibilityType(aurEff->GetMiscValue());
|
||||
target->m_invisibility.AddFlag(type);
|
||||
target->m_invisibility.AddValue(type, aurEff->GetAmount());
|
||||
|
||||
GetUnitOwner()->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
GetUnitOwner()->SetStandState(UNIT_STAND_STATE_DEAD);
|
||||
GetUnitOwner()->m_last_notify_position.Relocate(0.0f, 0.0f, 0.0f);
|
||||
GetUnitOwner()->m_delayed_unit_relocation_timer = 1000;
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
GetUnitOwner()->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_alar_ember_blast_death_AuraScript::OnApply, EFFECT_2, SPELL_AURA_MOD_INVISIBILITY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_alar_ember_blast_death_AuraScript::OnRemove, EFFECT_2, SPELL_AURA_MOD_INVISIBILITY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_alar_ember_blast_death_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_alar_dive_bomb : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_alar_dive_bomb() : SpellScriptLoader("spell_alar_dive_bomb") { }
|
||||
|
||||
class spell_alar_dive_bomb_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_alar_dive_bomb_AuraScript);
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->SetModelVisible(false);
|
||||
GetUnitOwner()->SetDisplayId(DISPLAYID_INVISIBLE);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_alar_dive_bomb_AuraScript::OnApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_alar_dive_bomb_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_alar()
|
||||
{
|
||||
new boss_alar();
|
||||
new spell_alar_flame_quills();
|
||||
new spell_alar_ember_blast();
|
||||
new spell_alar_ember_blast_death();
|
||||
new spell_alar_dive_bomb();
|
||||
}
|
||||
@@ -1,304 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "the_eye.h"
|
||||
|
||||
enum Yells
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SUMMON1 = 1,
|
||||
SAY_SUMMON2 = 2,
|
||||
SAY_KILL = 3,
|
||||
SAY_DEATH = 4,
|
||||
SAY_VOIDA = 5,
|
||||
SAY_VOIDB = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SOLARIAN_TRANSFORM = 39117,
|
||||
SPELL_ARCANE_MISSILES = 33031,
|
||||
SPELL_WRATH_OF_THE_ASTROMANCER = 42783,
|
||||
SPELL_BLINDING_LIGHT = 33009,
|
||||
SPELL_PSYCHIC_SCREAM = 34322,
|
||||
SPELL_VOID_BOLT = 39329
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
DISPLAYID_INVISIBLE = 11686,
|
||||
NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT = 18928,
|
||||
NPC_SOLARIUM_AGENT = 18925,
|
||||
NPC_SOLARIUM_PRIEST = 18806,
|
||||
|
||||
EVENT_CHECK_HEALTH = 1,
|
||||
EVENT_SPELL_ARCANE_MISSILES = 2,
|
||||
EVENT_SPELL_WRATH_OF_ASTROMANCER = 3,
|
||||
EVENT_SPELL_BLINDING_LIGHT = 4,
|
||||
EVENT_SPAWN_PORTALS = 5,
|
||||
EVENT_SUMMON_ADDS = 6,
|
||||
EVENT_REAPPEAR = 7,
|
||||
EVENT_SPELL_PSYCHIC_SCREAM = 8,
|
||||
EVENT_SPELL_VOID_BOLT = 9
|
||||
};
|
||||
|
||||
|
||||
#define INNER_PORTAL_RADIUS 14.0f
|
||||
#define OUTER_PORTAL_RADIUS 28.0f
|
||||
#define CENTER_X 432.909f
|
||||
#define CENTER_Y -373.424f
|
||||
#define CENTER_Z 17.9608f
|
||||
#define CENTER_O 1.06421f
|
||||
#define PORTAL_Z 17.005f
|
||||
|
||||
|
||||
class boss_high_astromancer_solarian : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_high_astromancer_solarian() : CreatureScript("boss_high_astromancer_solarian") { }
|
||||
|
||||
struct boss_high_astromancer_solarianAI : public BossAI
|
||||
{
|
||||
boss_high_astromancer_solarianAI(Creature* creature) : BossAI(creature, DATA_ASTROMANCER)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
me->SetModelVisible(true);
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (who && me->Attack(who, true))
|
||||
me->GetMotionMaster()->MoveChase(who, (events.GetNextEventTime(EVENT_SPELL_VOID_BOLT) == 0 ? 30.0f : 0.0f));
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && roll_chance_i(50))
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
me->SetModelVisible(true);
|
||||
Talk(SAY_DEATH);
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
BossAI::EnterCombat(who);
|
||||
me->CallForHelp(105.0f);
|
||||
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCANE_MISSILES, 3000);
|
||||
events.ScheduleEvent(EVENT_SPELL_WRATH_OF_ASTROMANCER, 1000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLINDING_LIGHT, 40000);
|
||||
events.ScheduleEvent(EVENT_SPAWN_PORTALS, 50000);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (!summon->IsTrigger())
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (me->HealthBelowPct(21))
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SPELL_VOID_BOLT, 3000);
|
||||
events.ScheduleEvent(EVENT_SPELL_PSYCHIC_SCREAM, 7000);
|
||||
me->CastSpell(me, SPELL_SOLARIAN_TRANSFORM, true);
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_ARCANE_MISSILES:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 40.0f, true))
|
||||
me->CastSpell(target, SPELL_ARCANE_MISSILES, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCANE_MISSILES, 3000);
|
||||
break;
|
||||
case EVENT_SPELL_WRATH_OF_ASTROMANCER:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true))
|
||||
me->CastSpell(target, SPELL_WRATH_OF_THE_ASTROMANCER, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_WRATH_OF_ASTROMANCER, 22000);
|
||||
break;
|
||||
case EVENT_SPELL_BLINDING_LIGHT:
|
||||
me->CastSpell(me, SPELL_BLINDING_LIGHT, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_BLINDING_LIGHT, 40000);
|
||||
break;
|
||||
case EVENT_SPAWN_PORTALS:
|
||||
me->setAttackTimer(BASE_ATTACK, 21000);
|
||||
me->SetModelVisible(false);
|
||||
events.ScheduleEvent(EVENT_SPAWN_PORTALS, 50000);
|
||||
events.DelayEvents(21000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_ADDS, 6000);
|
||||
events.ScheduleEvent(EVENT_REAPPEAR, 20000);
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
float o = rand_norm()*2*M_PI;
|
||||
if (i == 0)
|
||||
me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, CENTER_X + cos(o)*INNER_PORTAL_RADIUS, CENTER_Y + sin(o)*INNER_PORTAL_RADIUS, CENTER_Z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 26000);
|
||||
else
|
||||
me->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, CENTER_X + cos(o)*OUTER_PORTAL_RADIUS, CENTER_Y + sin(o)*OUTER_PORTAL_RADIUS, PORTAL_Z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 26000);
|
||||
}
|
||||
break;
|
||||
case EVENT_SUMMON_ADDS:
|
||||
Talk(SAY_SUMMON1);
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
{
|
||||
if (Creature* light = ObjectAccessor::GetCreature(*me, *itr))
|
||||
if (light->GetEntry() == NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT)
|
||||
{
|
||||
if (light->GetDistance2d(CENTER_X, CENTER_Y) < 20.0f)
|
||||
{
|
||||
me->SetPosition(*light);
|
||||
me->StopMovingOnCurrentPos();
|
||||
}
|
||||
for (uint8 j = 0; j < 4; ++j)
|
||||
me->SummonCreature(NPC_SOLARIUM_AGENT, light->GetPositionX()+frand(-3.0f, 3.0f), light->GetPositionY()+frand(-3.0f, 3.0f), light->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EVENT_REAPPEAR:
|
||||
Talk(SAY_SUMMON2);
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
{
|
||||
if (Creature* light = ObjectAccessor::GetCreature(*me, *itr))
|
||||
{
|
||||
if (light->GetEntry() == NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT)
|
||||
{
|
||||
light->RemoveAllAuras();
|
||||
if (light->GetDistance2d(CENTER_X, CENTER_Y) < 20.0f)
|
||||
me->SetModelVisible(true);
|
||||
else
|
||||
me->SummonCreature(NPC_SOLARIUM_PRIEST, light->GetPositionX()+frand(-3.0f, 3.0f), light->GetPositionY()+frand(-3.0f, 3.0f), light->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
}
|
||||
}
|
||||
}
|
||||
// protection
|
||||
if (me->GetDisplayId() != me->GetNativeDisplayId())
|
||||
{
|
||||
me->SetModelVisible(true);
|
||||
me->SummonCreature(NPC_SOLARIUM_PRIEST, me->GetPositionX()+frand(-3.0f, 3.0f), me->GetPositionY()+frand(-3.0f, 3.0f), me->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
me->SummonCreature(NPC_SOLARIUM_PRIEST, me->GetPositionX()+frand(-3.0f, 3.0f), me->GetPositionY()+frand(-3.0f, 3.0f), me->GetPositionZ(), 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 10000);
|
||||
}
|
||||
break;
|
||||
case EVENT_SPELL_VOID_BOLT:
|
||||
me->CastSpell(me->GetVictim(), SPELL_VOID_BOLT, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_VOID_BOLT, 7000);
|
||||
break;
|
||||
case EVENT_SPELL_PSYCHIC_SCREAM:
|
||||
me->CastSpell(me, SPELL_PSYCHIC_SCREAM, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_PSYCHIC_SCREAM, 12000);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const
|
||||
{
|
||||
return me->GetDistance2d(432.59f, -371.93f) > 105.0f;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_high_astromancer_solarianAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_astromancer_wrath_of_the_astromancer : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_astromancer_wrath_of_the_astromancer() : SpellScriptLoader("spell_astromancer_wrath_of_the_astromancer") { }
|
||||
|
||||
class spell_astromancer_wrath_of_the_astromancer_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_astromancer_wrath_of_the_astromancer_AuraScript);
|
||||
|
||||
void AfterRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
Unit* target = GetUnitOwner();
|
||||
target->CastSpell(target, GetSpellInfo()->Effects[EFFECT_1].CalcValue(), false);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_astromancer_wrath_of_the_astromancer_AuraScript::AfterRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_astromancer_wrath_of_the_astromancer_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_astromancer_solarian_transform : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_astromancer_solarian_transform() : SpellScriptLoader("spell_astromancer_solarian_transform") { }
|
||||
|
||||
class spell_astromancer_solarian_transform_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_astromancer_solarian_transform_AuraScript);
|
||||
|
||||
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->HandleStatModifier(UnitMods(UNIT_MOD_ARMOR), TOTAL_PCT, 400.0f, true);
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
GetUnitOwner()->HandleStatModifier(UnitMods(UNIT_MOD_ARMOR), TOTAL_PCT, 400.0f, false);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_astromancer_solarian_transform_AuraScript::OnApply, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_astromancer_solarian_transform_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_TRANSFORM, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_astromancer_solarian_transform_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_high_astromancer_solarian()
|
||||
{
|
||||
new boss_high_astromancer_solarian();
|
||||
new spell_astromancer_wrath_of_the_astromancer();
|
||||
new spell_astromancer_solarian_transform();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,125 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "the_eye.h"
|
||||
|
||||
enum voidReaver
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SLAY = 1,
|
||||
SAY_DEATH = 2,
|
||||
SAY_POUNDING = 3,
|
||||
|
||||
SPELL_POUNDING = 34162,
|
||||
SPELL_ARCANE_ORB = 34172,
|
||||
SPELL_KNOCK_AWAY = 25778,
|
||||
SPELL_BERSERK = 26662,
|
||||
|
||||
EVENT_SPELL_POUNDING = 1,
|
||||
EVENT_SPELL_ARCANEORB = 2,
|
||||
EVENT_SPELL_KNOCK_AWAY = 3,
|
||||
EVENT_SPELL_BERSERK = 4
|
||||
};
|
||||
|
||||
class boss_void_reaver : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_void_reaver() : CreatureScript("boss_void_reaver") { }
|
||||
|
||||
struct boss_void_reaverAI : public BossAI
|
||||
{
|
||||
boss_void_reaverAI(Creature* creature) : BossAI(creature, DATA_REAVER)
|
||||
{
|
||||
me->ApplySpellImmune(0, IMMUNITY_DISPEL, DISPEL_POISON, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_HEALTH_LEECH, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_POWER_DRAIN, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_PERIODIC_LEECH, true);
|
||||
me->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_PERIODIC_MANA_LEECH, true);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
BossAI::Reset();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && roll_chance_i(50))
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* killer)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
BossAI::JustDied(killer);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
BossAI::EnterCombat(who);
|
||||
|
||||
events.ScheduleEvent(EVENT_SPELL_POUNDING, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCANEORB, 3000);
|
||||
events.ScheduleEvent(EVENT_SPELL_KNOCK_AWAY, 30000);
|
||||
events.ScheduleEvent(EVENT_SPELL_BERSERK, 600000);
|
||||
me->CallForHelp(105.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_SPELL_POUNDING:
|
||||
Talk(SAY_POUNDING);
|
||||
me->CastSpell(me, SPELL_POUNDING, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_POUNDING, 15000);
|
||||
break;
|
||||
case EVENT_SPELL_ARCANEORB:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, -18.0f, true))
|
||||
me->CastSpell(target, SPELL_ARCANE_ORB, false);
|
||||
else if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 20.0f, true))
|
||||
me->CastSpell(target, SPELL_ARCANE_ORB, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_ARCANEORB, 4000);
|
||||
break;
|
||||
case EVENT_SPELL_KNOCK_AWAY:
|
||||
me->CastSpell(me->GetVictim(), SPELL_KNOCK_AWAY, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_POUNDING, 25000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
EnterEvadeIfOutOfCombatArea();
|
||||
}
|
||||
|
||||
bool CheckEvadeIfOutOfCombatArea() const
|
||||
{
|
||||
return me->GetDistance2d(432.59f, 371.93f) > 105.0f;
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return GetInstanceAI<boss_void_reaverAI>(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_void_reaver()
|
||||
{
|
||||
new boss_void_reaver();
|
||||
}
|
||||
|
||||
@@ -1,182 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "the_eye.h"
|
||||
|
||||
class instance_the_eye : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_the_eye() : InstanceMapScript("instance_the_eye", 550) { }
|
||||
|
||||
struct instance_the_eye_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_the_eye_InstanceMapScript(Map* map) : InstanceScript(map) {}
|
||||
|
||||
uint64 ThaladredTheDarkenerGUID;
|
||||
uint64 LordSanguinarGUID;
|
||||
uint64 GrandAstromancerCapernianGUID;
|
||||
uint64 MasterEngineerTelonicusGUID;
|
||||
uint64 AlarGUID;
|
||||
uint64 KaelthasGUID;
|
||||
uint64 BridgeWindowGUID;
|
||||
uint64 KaelStateRightGUID;
|
||||
uint64 KaelStateLeftGUID;
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
AlarGUID = 0;
|
||||
KaelthasGUID = 0;
|
||||
ThaladredTheDarkenerGUID = 0;
|
||||
LordSanguinarGUID = 0;
|
||||
GrandAstromancerCapernianGUID = 0;
|
||||
MasterEngineerTelonicusGUID = 0;
|
||||
BridgeWindowGUID = 0;
|
||||
KaelStateRightGUID = 0;
|
||||
KaelStateLeftGUID = 0;
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_ALAR:
|
||||
AlarGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_KAELTHAS:
|
||||
KaelthasGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_THALADRED:
|
||||
ThaladredTheDarkenerGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_TELONICUS:
|
||||
MasterEngineerTelonicusGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_CAPERNIAN:
|
||||
GrandAstromancerCapernianGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_LORD_SANGUINAR:
|
||||
LordSanguinarGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gobject)
|
||||
{
|
||||
switch (gobject->GetEntry())
|
||||
{
|
||||
case GO_BRIDGE_WINDOW:
|
||||
BridgeWindowGUID = gobject->GetGUID();
|
||||
break;
|
||||
case GO_KAEL_STATUE_RIGHT:
|
||||
KaelStateRightGUID = gobject->GetGUID();
|
||||
break;
|
||||
case GO_KAEL_STATUE_LEFT:
|
||||
KaelStateLeftGUID = gobject->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 identifier) const
|
||||
{
|
||||
switch (identifier)
|
||||
{
|
||||
case GO_BRIDGE_WINDOW: return BridgeWindowGUID;
|
||||
case GO_KAEL_STATUE_RIGHT: return KaelStateRightGUID;
|
||||
case GO_KAEL_STATUE_LEFT: return KaelStateLeftGUID;
|
||||
case NPC_ALAR: return AlarGUID;
|
||||
case NPC_KAELTHAS: return KaelthasGUID;
|
||||
case DATA_KAEL_ADVISOR1: return ThaladredTheDarkenerGUID;
|
||||
case DATA_KAEL_ADVISOR2: return LordSanguinarGUID;
|
||||
case DATA_KAEL_ADVISOR3: return GrandAstromancerCapernianGUID;
|
||||
case DATA_KAEL_ADVISOR4: return MasterEngineerTelonicusGUID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "E Y " << 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 == 'E' && dataHead2 == 'Y')
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_ENCOUNTER; ++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;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_the_eye_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_the_eye_countercharge : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_the_eye_countercharge() : SpellScriptLoader("spell_the_eye_countercharge") { }
|
||||
|
||||
class spell_the_eye_counterchargeScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_the_eye_counterchargeScript);
|
||||
|
||||
bool PrepareProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
// xinef: prevent charge drop
|
||||
PreventDefaultAction();
|
||||
return true;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_the_eye_counterchargeScript::PrepareProc);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_the_eye_counterchargeScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_the_eye()
|
||||
{
|
||||
new instance_the_eye();
|
||||
new spell_the_eye_countercharge();
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_THE_EYE_H
|
||||
#define DEF_THE_EYE_H
|
||||
|
||||
enum EyeData
|
||||
{
|
||||
DATA_ALAR = 0,
|
||||
DATA_ASTROMANCER = 1,
|
||||
DATA_REAVER = 2,
|
||||
DATA_KAELTHAS = 3,
|
||||
MAX_ENCOUNTER = 4,
|
||||
|
||||
DATA_KAEL_ADVISOR1 = 10,
|
||||
DATA_KAEL_ADVISOR2 = 11,
|
||||
DATA_KAEL_ADVISOR3 = 12,
|
||||
DATA_KAEL_ADVISOR4 = 13
|
||||
};
|
||||
|
||||
enum EyeNPCs
|
||||
{
|
||||
NPC_ALAR = 19514,
|
||||
NPC_KAELTHAS = 19622,
|
||||
NPC_THALADRED = 20064,
|
||||
NPC_LORD_SANGUINAR = 20060,
|
||||
NPC_CAPERNIAN = 20062,
|
||||
NPC_TELONICUS = 20063
|
||||
};
|
||||
|
||||
enum EyeGOs
|
||||
{
|
||||
GO_BRIDGE_WINDOW = 184069,
|
||||
GO_KAEL_STATUE_RIGHT = 184596,
|
||||
GO_KAEL_STATUE_LEFT = 184597
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,101 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
enum Say
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SLAY = 1,
|
||||
SAY_SAW_BLADE = 2,
|
||||
SAY_DEATH = 3
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_STREAM_OF_MACHINE_FLUID = 35311,
|
||||
SPELL_SAW_BLADE = 35318,
|
||||
SPELL_SHADOW_POWER = 35322
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_STREAM_OF_MACHINE_FLUID = 1,
|
||||
EVENT_SAW_BLADE = 2,
|
||||
EVENT_SHADOW_POWER = 3
|
||||
};
|
||||
|
||||
class boss_gatewatcher_gyrokill : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_gatewatcher_gyrokill() : CreatureScript("boss_gatewatcher_gyrokill") { }
|
||||
|
||||
struct boss_gatewatcher_gyrokillAI : public BossAI
|
||||
{
|
||||
boss_gatewatcher_gyrokillAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_GYROKILL) { }
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 10000);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, 20000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_POWER, 30000);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_STREAM_OF_MACHINE_FLUID:
|
||||
me->CastSpell(me->GetVictim(), SPELL_STREAM_OF_MACHINE_FLUID, false);
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, urand(12000, 14000));
|
||||
break;
|
||||
case EVENT_SAW_BLADE:
|
||||
if (Unit* target= SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f))
|
||||
me->CastSpell(target, SPELL_SAW_BLADE, false);
|
||||
Talk(SAY_SAW_BLADE);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, 25000);
|
||||
break;
|
||||
case EVENT_SHADOW_POWER:
|
||||
me->CastSpell(me, SPELL_SHADOW_POWER, false);
|
||||
events.ScheduleEvent(EVENT_SAW_BLADE, 25000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gatewatcher_gyrokillAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gatewatcher_gyrokill()
|
||||
{
|
||||
new boss_gatewatcher_gyrokill();
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_HAMMER = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_DEATH = 3,
|
||||
EMOTE_HAMMER = 4
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SHADOW_POWER = 35322,
|
||||
SPELL_JACKHAMMER = 35327,
|
||||
SPELL_STREAM_OF_MACHINE_FLUID = 35311
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_STREAM_OF_MACHINE_FLUID = 1,
|
||||
EVENT_JACKHAMMER = 2,
|
||||
EVENT_SHADOW_POWER = 3
|
||||
};
|
||||
|
||||
class boss_gatewatcher_iron_hand : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_gatewatcher_iron_hand(): CreatureScript("boss_gatewatcher_iron_hand") { }
|
||||
|
||||
struct boss_gatewatcher_iron_handAI : public BossAI
|
||||
{
|
||||
boss_gatewatcher_iron_handAI(Creature* creature) : BossAI(creature, DATA_GATEWATCHER_IRON_HAND) { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 15000);
|
||||
events.ScheduleEvent(EVENT_JACKHAMMER, 35000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_POWER, 25000);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_STREAM_OF_MACHINE_FLUID:
|
||||
me->CastSpell(me->GetVictim(), SPELL_STREAM_OF_MACHINE_FLUID, false);
|
||||
events.ScheduleEvent(EVENT_STREAM_OF_MACHINE_FLUID, 20000);
|
||||
break;
|
||||
case EVENT_JACKHAMMER:
|
||||
Talk(EMOTE_HAMMER);
|
||||
Talk(SAY_HAMMER);
|
||||
me->CastSpell(me, SPELL_JACKHAMMER, false);
|
||||
events.ScheduleEvent(EVENT_JACKHAMMER, 40000);
|
||||
break;
|
||||
case EVENT_SHADOW_POWER:
|
||||
me->CastSpell(me, SPELL_SHADOW_POWER, false);
|
||||
events.ScheduleEvent(EVENT_SHADOW_POWER, 25000);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_gatewatcher_iron_handAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_gatewatcher_iron_hand()
|
||||
{
|
||||
new boss_gatewatcher_iron_hand();
|
||||
}
|
||||
|
||||
@@ -1,222 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellScript.h"
|
||||
#include "mechanar.h"
|
||||
#include "Player.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_HEADCRACK = 35161,
|
||||
SPELL_REFLECTIVE_MAGIC_SHIELD = 35158,
|
||||
SPELL_REFLECTIVE_DAMAGE_SHIELD = 35159,
|
||||
SPELL_POLARITY_SHIFT = 39096,
|
||||
SPELL_BERSERK = 26662
|
||||
};
|
||||
|
||||
enum Yells
|
||||
{
|
||||
YELL_AGGRO = 0,
|
||||
YELL_REFLECTIVE_MAGIC_SHIELD = 1,
|
||||
YELL_REFLECTIVE_DAMAGE_SHIELD = 2,
|
||||
YELL_KILL = 3,
|
||||
YELL_DEATH = 4
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
NPC_NETHER_CHARGE = 20405
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_HEADCRACK = 1,
|
||||
EVENT_REFLECTIVE_DAMAGE_SHIELD = 2,
|
||||
EVENT_REFLECTIVE_MAGIE_SHIELD = 3,
|
||||
EVENT_POSITIVE_SHIFT = 4,
|
||||
EVENT_SUMMON_NETHER_CHARGE = 5,
|
||||
EVENT_BERSERK = 6
|
||||
};
|
||||
|
||||
class boss_mechano_lord_capacitus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_mechano_lord_capacitus() : CreatureScript("boss_mechano_lord_capacitus") { }
|
||||
|
||||
struct boss_mechano_lord_capacitusAI : public BossAI
|
||||
{
|
||||
boss_mechano_lord_capacitusAI(Creature* creature) : BossAI(creature, DATA_MECHANOLORD_CAPACITUS) { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(YELL_AGGRO);
|
||||
events.ScheduleEvent(EVENT_HEADCRACK, 6000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 10000);
|
||||
events.ScheduleEvent(EVENT_BERSERK, 180000);
|
||||
events.ScheduleEvent(IsHeroic() ? EVENT_POSITIVE_SHIFT : EVENT_REFLECTIVE_DAMAGE_SHIELD, 15000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(YELL_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*victim*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(YELL_DEATH);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
summon->GetMotionMaster()->MoveRandom(30.0f);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_HEADCRACK:
|
||||
me->CastSpell(me->GetVictim(), SPELL_HEADCRACK, false);
|
||||
events.ScheduleEvent(EVENT_HEADCRACK, 20000);
|
||||
break;
|
||||
case EVENT_REFLECTIVE_DAMAGE_SHIELD:
|
||||
Talk(YELL_REFLECTIVE_DAMAGE_SHIELD);
|
||||
me->CastSpell(me, SPELL_REFLECTIVE_DAMAGE_SHIELD, false);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_MAGIE_SHIELD, 20000);
|
||||
break;
|
||||
case EVENT_REFLECTIVE_MAGIE_SHIELD:
|
||||
Talk(YELL_REFLECTIVE_MAGIC_SHIELD);
|
||||
me->CastSpell(me, SPELL_REFLECTIVE_MAGIC_SHIELD, false);
|
||||
events.ScheduleEvent(EVENT_REFLECTIVE_DAMAGE_SHIELD, 20000);
|
||||
break;
|
||||
case EVENT_SUMMON_NETHER_CHARGE:
|
||||
Position pos;
|
||||
me->GetRandomNearPosition(pos, 8.0f);
|
||||
me->SummonCreature(NPC_NETHER_CHARGE, pos, TEMPSUMMON_TIMED_DESPAWN, 18000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_NETHER_CHARGE, 5000);
|
||||
break;
|
||||
case EVENT_POSITIVE_SHIFT:
|
||||
me->CastSpell(me, SPELL_POLARITY_SHIFT, true);
|
||||
events.ScheduleEvent(EVENT_POSITIVE_SHIFT, 30000);
|
||||
break;
|
||||
case EVENT_BERSERK:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_mechano_lord_capacitusAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
enum polarityShift
|
||||
{
|
||||
SPELL_POSITIVE_POLARITY = 39088,
|
||||
SPELL_POSITIVE_CHARGE_STACK = 39089,
|
||||
SPELL_POSITIVE_CHARGE = 39090,
|
||||
|
||||
SPELL_NEGATIVE_POLARITY = 39091,
|
||||
SPELL_NEGATIVE_CHARGE_STACK = 39092,
|
||||
SPELL_NEGATIVE_CHARGE = 39093
|
||||
};
|
||||
|
||||
class spell_capacitus_polarity_charge : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_capacitus_polarity_charge() : SpellScriptLoader("spell_capacitus_polarity_charge") { }
|
||||
|
||||
class spell_capacitus_polarity_charge_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_capacitus_polarity_charge_SpellScript);
|
||||
|
||||
void HandleTargets(std::list<WorldObject*>& targetList)
|
||||
{
|
||||
uint8 count = 0;
|
||||
for (std::list<WorldObject*>::iterator ihit = targetList.begin(); ihit != targetList.end(); ++ihit)
|
||||
if ((*ihit)->GetGUID() != GetCaster()->GetGUID())
|
||||
if (Player* target = (*ihit)->ToPlayer())
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
++count;
|
||||
|
||||
if (count)
|
||||
{
|
||||
uint32 spellId = GetSpellInfo()->Id == SPELL_POSITIVE_CHARGE ? SPELL_POSITIVE_CHARGE_STACK : SPELL_NEGATIVE_CHARGE_STACK;
|
||||
GetCaster()->SetAuraStack(spellId, GetCaster(), count);
|
||||
}
|
||||
}
|
||||
|
||||
void HandleDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!GetTriggeringSpell())
|
||||
return;
|
||||
|
||||
Unit* target = GetHitUnit();
|
||||
if (target->HasAura(GetTriggeringSpell()->Id))
|
||||
SetHitDamage(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_charge_SpellScript::HandleDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_capacitus_polarity_charge_SpellScript::HandleTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ALLY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_capacitus_polarity_charge_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_capacitus_polarity_shift : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_capacitus_polarity_shift() : SpellScriptLoader("spell_capacitus_polarity_shift") { }
|
||||
|
||||
class spell_capacitus_polarity_shift_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_capacitus_polarity_shift_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
target->CastSpell(target, roll_chance_i(50) ? SPELL_POSITIVE_POLARITY : SPELL_NEGATIVE_POLARITY, true, NULL, NULL, GetCaster()->GetGUID());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_capacitus_polarity_shift_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_capacitus_polarity_shift_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_mechano_lord_capacitus()
|
||||
{
|
||||
new boss_mechano_lord_capacitus();
|
||||
new spell_capacitus_polarity_charge();
|
||||
new spell_capacitus_polarity_shift();
|
||||
}
|
||||
@@ -1,218 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SUMMON = 1,
|
||||
SAY_DRAGONS_BREATH = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_DEATH = 4
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SUMMON_RAGIN_FLAMES = 35275,
|
||||
SPELL_FROST_ATTACK = 35263,
|
||||
SPELL_ARCANE_BLAST = 35314,
|
||||
SPELL_DRAGONS_BREATH = 35250,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_FROST_ATTACK = 1,
|
||||
EVENT_ARCANE_BLAST = 2,
|
||||
EVENT_DRAGONS_BREATH = 3,
|
||||
};
|
||||
|
||||
class boss_nethermancer_sepethrea : public CreatureScript
|
||||
{
|
||||
public: boss_nethermancer_sepethrea(): CreatureScript("boss_nethermancer_sepethrea") { }
|
||||
|
||||
struct boss_nethermancer_sepethreaAI : public BossAI
|
||||
{
|
||||
boss_nethermancer_sepethreaAI(Creature* creature) : BossAI(creature, DATA_NETHERMANCER_SEPRETHREA) { }
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, 6000);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, 14000);
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, 18000);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
me->CastSpell(me, SPELL_SUMMON_RAGIN_FLAMES, true);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
if (Unit* victim = me->GetVictim())
|
||||
{
|
||||
summon->AI()->AttackStart(victim);
|
||||
summon->AddThreat(victim, 1000.0f);
|
||||
summon->SetInCombatWithZone();
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
events.Reset();
|
||||
if (instance)
|
||||
{
|
||||
instance->SetBossState(DATA_NETHERMANCER_SEPRETHREA, DONE);
|
||||
instance->SaveToDB();
|
||||
}
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
Unit::Kill(summon, summon);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_FROST_ATTACK:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FROST_ATTACK, false);
|
||||
events.ScheduleEvent(EVENT_FROST_ATTACK, 8000);
|
||||
break;
|
||||
case EVENT_ARCANE_BLAST:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ARCANE_BLAST, false);
|
||||
events.ScheduleEvent(EVENT_ARCANE_BLAST, 12000);
|
||||
break;
|
||||
case EVENT_DRAGONS_BREATH:
|
||||
me->CastSpell(me->GetVictim(), SPELL_DRAGONS_BREATH, true);
|
||||
events.ScheduleEvent(EVENT_DRAGONS_BREATH, 16000);
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_DRAGONS_BREATH);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_nethermancer_sepethreaAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
enum raginFlames
|
||||
{
|
||||
SPELL_INFERNO = 35268,
|
||||
SPELL_FIRE_TAIL = 35278,
|
||||
SPELL_INFERNO_DAMAGE = 35283,
|
||||
|
||||
EVENT_SPELL_FIRE_TAIL = 1,
|
||||
EVENT_SPELL_INFERNO = 2
|
||||
};
|
||||
|
||||
class npc_ragin_flames : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_ragin_flames() : CreatureScript("npc_ragin_flames") { }
|
||||
|
||||
struct npc_ragin_flamesAI : public ScriptedAI
|
||||
{
|
||||
npc_ragin_flamesAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ALL, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_SPELL_FIRE_TAIL, 500);
|
||||
events.ScheduleEvent(EVENT_SPELL_INFERNO, urand(10000, 20000));
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_INFERNO:
|
||||
if (me->IsWithinCombatRange(me->GetVictim(), 5.0f))
|
||||
{
|
||||
me->CastSpell(me, SPELL_INFERNO, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_INFERNO, 20000);
|
||||
}
|
||||
else
|
||||
events.ScheduleEvent(EVENT_SPELL_INFERNO, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_FIRE_TAIL:
|
||||
me->CastSpell(me, SPELL_FIRE_TAIL, true);
|
||||
events.ScheduleEvent(EVENT_SPELL_FIRE_TAIL, 500);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
};
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_ragin_flamesAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_ragin_flames_inferno : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_ragin_flames_inferno() : SpellScriptLoader("spell_ragin_flames_inferno") { }
|
||||
|
||||
class spell_ragin_flames_inferno_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_ragin_flames_inferno_AuraScript);
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
int32 damage = aurEff->GetAmount();
|
||||
GetUnitOwner()->CastCustomSpell(SPELL_INFERNO_DAMAGE, SPELLVALUE_BASE_POINT0, aurEff->GetAmount(), GetUnitOwner(), TRIGGERED_FULL_MASK);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_ragin_flames_inferno_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_ragin_flames_inferno_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_nethermancer_sepethrea()
|
||||
{
|
||||
new boss_nethermancer_sepethrea();
|
||||
new npc_ragin_flames();
|
||||
new spell_ragin_flames_inferno();
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_DOMINATION = 1,
|
||||
SAY_SUMMON = 2,
|
||||
SAY_ENRAGE = 3,
|
||||
SAY_SLAY = 4,
|
||||
SAY_DEATH = 5,
|
||||
SAY_APPEAR = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ARCANE_EXPLOSION = 15453,
|
||||
SPELL_DISGRUNTLED_ANGER = 35289,
|
||||
SPELL_ARCANE_TORRENT = 36022,
|
||||
SPELL_MANA_TAP = 36021,
|
||||
SPELL_DOMINATION = 35280,
|
||||
SPELL_SUMMON_NETHER_WRAITH_1 = 35285,
|
||||
SPELL_SUMMON_NETHER_WRAITH_2 = 35286,
|
||||
SPELL_SUMMON_NETHER_WRAITH_3 = 35287,
|
||||
SPELL_SUMMON_NETHER_WRAITH_4 = 35288,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_SUMMON = 1,
|
||||
EVENT_MANA_TAP = 2,
|
||||
EVENT_ARCANE_TORRENT = 3,
|
||||
EVENT_DOMINATION = 4,
|
||||
EVENT_ARCANE_EXPLOSION = 5,
|
||||
EVENT_FRENZY = 6,
|
||||
};
|
||||
|
||||
class boss_pathaleon_the_calculator : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_pathaleon_the_calculator(): CreatureScript("boss_pathaleon_the_calculator") { }
|
||||
|
||||
struct boss_pathaleon_the_calculatorAI : public BossAI
|
||||
{
|
||||
boss_pathaleon_the_calculatorAI(Creature* creature) : BossAI(creature, DATA_PATHALEON_THE_CALCULATOR) { }
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
BossAI::InitializeAI();
|
||||
me->SetVisible(false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void DoAction(int32 param)
|
||||
{
|
||||
me->SetVisible(true);
|
||||
me->CastSpell(me, SPELL_TELEPORT_VISUAL, true);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY1H);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
Talk(SAY_APPEAR);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_SUMMON, 30000);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, 12000);
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, 16000);
|
||||
events.ScheduleEvent(EVENT_DOMINATION, 25000);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 8000);
|
||||
events.ScheduleEvent(EVENT_FRENZY, 1000);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ARCANE_EXPLOSION:
|
||||
me->CastSpell(me, SPELL_ARCANE_EXPLOSION, false);
|
||||
events.ScheduleEvent(EVENT_ARCANE_EXPLOSION, 12000);
|
||||
break;
|
||||
case EVENT_ARCANE_TORRENT:
|
||||
me->RemoveAurasDueToSpell(SPELL_MANA_TAP);
|
||||
me->ModifyPower(POWER_MANA, 5000);
|
||||
me->CastSpell(me, SPELL_ARCANE_TORRENT, false);
|
||||
events.ScheduleEvent(EVENT_ARCANE_TORRENT, 15000);
|
||||
break;
|
||||
case EVENT_MANA_TAP:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, PowerUsersSelector(me, POWER_MANA, 40.0f, false)))
|
||||
me->CastSpell(target, SPELL_MANA_TAP, false);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, 18000);
|
||||
break;
|
||||
case EVENT_DOMINATION:
|
||||
Talk(SAY_DOMINATION);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 50.0f))
|
||||
me->CastSpell(target, SPELL_DOMINATION, false);
|
||||
events.ScheduleEvent(EVENT_DOMINATION, 30000);
|
||||
break;
|
||||
case EVENT_FRENZY:
|
||||
if (me->HealthBelowPct(20))
|
||||
{
|
||||
summons.DespawnAll();
|
||||
me->CastSpell(me, SPELL_DISGRUNTLED_ANGER, true);
|
||||
Talk(SAY_ENRAGE);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_FRENZY, 1000);
|
||||
break;
|
||||
case EVENT_SUMMON:
|
||||
for (uint8 i = 0; i < DUNGEON_MODE(3, 4); ++i)
|
||||
me->CastSpell(me, SPELL_SUMMON_NETHER_WRAITH_1+i, true);
|
||||
|
||||
Talk(SAY_SUMMON);
|
||||
events.ScheduleEvent(EVENT_SUMMON, urand(30000, 45000));
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_pathaleon_the_calculatorAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_pathaleon_the_calculator()
|
||||
{
|
||||
new boss_pathaleon_the_calculator();
|
||||
}
|
||||
|
||||
@@ -1,255 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "mechanar.h"
|
||||
|
||||
static DoorData const doorData[] =
|
||||
{
|
||||
{ GO_DOOR_MOARG_1, DATA_GATEWATCHER_IRON_HAND, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_DOOR_MOARG_2, DATA_GATEWATCHER_GYROKILL, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_DOOR_NETHERMANCER, DATA_NETHERMANCER_SEPRETHREA, DOOR_TYPE_ROOM, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE }
|
||||
};
|
||||
|
||||
class instance_mechanar : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_mechanar(): InstanceMapScript("instance_mechanar", 554) { }
|
||||
|
||||
struct instance_mechanar_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_mechanar_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
LoadDoorData(doorData);
|
||||
|
||||
_pathaleonGUID = 0;
|
||||
_passageEncounter = 0;
|
||||
_passageTimer = 0;
|
||||
_passageGUIDs.clear();
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* gameObject)
|
||||
{
|
||||
switch (gameObject->GetEntry())
|
||||
{
|
||||
case GO_DOOR_MOARG_1:
|
||||
case GO_DOOR_MOARG_2:
|
||||
case GO_DOOR_NETHERMANCER:
|
||||
AddDoor(gameObject, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectRemove(GameObject* gameObject)
|
||||
{
|
||||
switch (gameObject->GetEntry())
|
||||
{
|
||||
case GO_DOOR_MOARG_1:
|
||||
case GO_DOOR_MOARG_2:
|
||||
case GO_DOOR_NETHERMANCER:
|
||||
AddDoor(gameObject, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
if (creature->GetEntry() == NPC_PATHALEON_THE_CALCULATOR)
|
||||
_pathaleonGUID = creature->GetGUID();
|
||||
}
|
||||
|
||||
void OnUnitDeath(Unit* unit)
|
||||
{
|
||||
if (unit->GetTypeId() == TYPEID_UNIT)
|
||||
if (_passageEncounter > ENCOUNTER_PASSAGE_NOT_STARTED && _passageEncounter < ENCOUNTER_PASSAGE_DONE)
|
||||
if (_passageGUIDs.find(unit->GetGUID()) != _passageGUIDs.end())
|
||||
_passageGUIDs.erase(unit->GetGUID());
|
||||
}
|
||||
|
||||
Player* GetPassagePlayer(float x)
|
||||
{
|
||||
Map::PlayerList const& pl = instance->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr)
|
||||
if (Player* player = itr->GetSource())
|
||||
if (player->GetPositionX() < x && player->GetPositionZ() > 24.0f && player->GetPositionY() > -30.0f)
|
||||
return player;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void DoSummonAction(Creature* summon, Player* player)
|
||||
{
|
||||
summon->CastSpell(summon, SPELL_TELEPORT_VISUAL, true);
|
||||
summon->AI()->AttackStart(player);
|
||||
_passageGUIDs.insert(summon->GetGUID());
|
||||
}
|
||||
|
||||
void Update(uint32 diff)
|
||||
{
|
||||
if (_passageEncounter == ENCOUNTER_PASSAGE_DONE)
|
||||
return;
|
||||
|
||||
_passageTimer += diff;
|
||||
if (_passageTimer >= 1000)
|
||||
{
|
||||
_passageTimer = 0;
|
||||
if (_passageEncounter == ENCOUNTER_PASSAGE_NOT_STARTED)
|
||||
{
|
||||
if (Player* player = GetPassagePlayer(250.0f))
|
||||
{
|
||||
_passageEncounter++;
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Position pos = {238.0f, -27.0f + 3.0f*i, 26.328f, 0.0f};
|
||||
if (Creature* creature = instance->SummonCreature(i==1 || i==2 ? NPC_SUNSEEKER_ASTROMAGE : NPC_BLOODWARDER_CENTURION, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!_passageGUIDs.empty())
|
||||
return;
|
||||
|
||||
if (_passageEncounter < ENCOUNTER_PASSAGE_PHASE3)
|
||||
{
|
||||
if (Player* player = GetPassagePlayer(250.0f))
|
||||
{
|
||||
if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE1)
|
||||
{
|
||||
Position pos = {214.37f, -23.5f, 24.88f, 0.0f};
|
||||
if (Creature* creature = instance->SummonCreature(NPC_TEMPEST_KEEPER_DESTROYER, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
else if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE2)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
Position pos = {199.76f, -26.0f + 2.5f*i, 24.88f, 0.0f};
|
||||
if (Creature* creature = instance->SummonCreature(i==1 ? NPC_SUNSEEKER_ENGINEER : NPC_BLOODWARDER_PHYSICIAN, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
}
|
||||
_passageEncounter++;
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Player* player = GetPassagePlayer(148.0f))
|
||||
{
|
||||
if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE3)
|
||||
{
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
Position pos = {135.0f + 2.5f*i, 36.76f, 24.88f};
|
||||
if (Creature* creature = instance->SummonCreature(i==1 ? NPC_SUNSEEKER_ASTROMAGE : NPC_BLOODWARDER_PHYSICIAN, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
}
|
||||
else if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE4)
|
||||
{
|
||||
Position pos = {137.62f, 62.23f, 24.88f, M_PI*1.5f};
|
||||
if (Creature* creature = instance->SummonCreature(NPC_TEMPEST_KEEPER_DESTROYER, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
else if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE5)
|
||||
{
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
{
|
||||
Position pos = {133.0f + 3.5f*i, 92.88f, 26.38f, M_PI*1.5f};
|
||||
if (Creature* creature = instance->SummonCreature(i==1||i==2 ? NPC_SUNSEEKER_ASTROMAGE : NPC_SUNSEEKER_ENGINEER, pos))
|
||||
DoSummonAction(creature, player);
|
||||
}
|
||||
}
|
||||
else if (_passageEncounter == ENCOUNTER_PASSAGE_PHASE6)
|
||||
{
|
||||
if (Creature* creature = instance->GetCreature(_pathaleonGUID))
|
||||
creature->AI()->DoAction(1);
|
||||
}
|
||||
_passageEncounter++;
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
// Xinef: no space needed
|
||||
saveStream << "M E " << GetBossSaveData() << _passageEncounter;
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
}
|
||||
|
||||
void Load(const char* 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 == 'M' && dataHead2 == 'E')
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_ENCOUNTER; ++i)
|
||||
{
|
||||
uint32 tmpState;
|
||||
loadStream >> tmpState;
|
||||
if (tmpState == IN_PROGRESS || tmpState > SPECIAL)
|
||||
tmpState = NOT_STARTED;
|
||||
SetBossState(i, EncounterState(tmpState));
|
||||
}
|
||||
|
||||
loadStream >> _passageEncounter;
|
||||
if (_passageEncounter == ENCOUNTER_PASSAGE_DONE)
|
||||
_passageEncounter = ENCOUNTER_PASSAGE_PHASE6;
|
||||
}
|
||||
else
|
||||
OUT_LOAD_INST_DATA_FAIL;
|
||||
|
||||
OUT_LOAD_INST_DATA_COMPLETE;
|
||||
}
|
||||
|
||||
private:
|
||||
uint64 _pathaleonGUID;
|
||||
uint32 _passageTimer;
|
||||
uint32 _passageEncounter;
|
||||
std::set<uint64> _passageGUIDs;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_mechanar_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_mechanar()
|
||||
{
|
||||
new instance_mechanar();
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_MECHANAR_H
|
||||
#define DEF_MECHANAR_H
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_GATEWATCHER_GYROKILL = 0,
|
||||
DATA_GATEWATCHER_IRON_HAND = 1,
|
||||
DATA_MECHANOLORD_CAPACITUS = 2,
|
||||
DATA_NETHERMANCER_SEPRETHREA = 3,
|
||||
DATA_PATHALEON_THE_CALCULATOR = 4,
|
||||
MAX_ENCOUNTER = 5,
|
||||
|
||||
ENCOUNTER_PASSAGE_NOT_STARTED = 0,
|
||||
ENCOUNTER_PASSAGE_PHASE1 = 1,
|
||||
ENCOUNTER_PASSAGE_PHASE2 = 2,
|
||||
ENCOUNTER_PASSAGE_PHASE3 = 3,
|
||||
ENCOUNTER_PASSAGE_PHASE4 = 4,
|
||||
ENCOUNTER_PASSAGE_PHASE5 = 5,
|
||||
ENCOUNTER_PASSAGE_PHASE6 = 6,
|
||||
ENCOUNTER_PASSAGE_DONE = 7,
|
||||
};
|
||||
|
||||
enum NpcIds
|
||||
{
|
||||
NPC_SUNSEEKER_ASTROMAGE = 19168,
|
||||
NPC_SUNSEEKER_ENGINEER = 20988,
|
||||
NPC_BLOODWARDER_CENTURION = 19510,
|
||||
NPC_BLOODWARDER_PHYSICIAN = 20990,
|
||||
NPC_TEMPEST_KEEPER_DESTROYER = 19735,
|
||||
|
||||
NPC_PATHALEON_THE_CALCULATOR = 19220
|
||||
};
|
||||
|
||||
enum GameobjectIds
|
||||
{
|
||||
GO_DOOR_MOARG_1 = 184632,
|
||||
GO_DOOR_MOARG_2 = 184322,
|
||||
GO_DOOR_NETHERMANCER = 184449
|
||||
};
|
||||
|
||||
enum SpellIds
|
||||
{
|
||||
SPELL_TELEPORT_VISUAL = 35517
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,609 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "arcatraz.h"
|
||||
|
||||
|
||||
enum MillhouseSays
|
||||
{
|
||||
SAY_INTRO_1 = 0,
|
||||
SAY_INTRO_2 = 1,
|
||||
SAY_WATER = 2,
|
||||
SAY_BUFFS = 3,
|
||||
SAY_DRINK = 4,
|
||||
SAY_READY = 5,
|
||||
SAY_KILL = 6,
|
||||
SAY_PYRO = 7,
|
||||
SAY_ICEBLOCK = 8,
|
||||
SAY_LOWHP = 9,
|
||||
SAY_DEATH = 10,
|
||||
SAY_COMPLETE = 11,
|
||||
SAY_INTRO_3 = 12,
|
||||
SAY_INTRO_4 = 13,
|
||||
};
|
||||
|
||||
enum MillhouseSpells
|
||||
{
|
||||
SPELL_CONJURE_WATER = 36879,
|
||||
SPELL_ARCANE_INTELLECT = 36880,
|
||||
SPELL_ICE_ARMOR = 36881,
|
||||
SPELL_ARCANE_MISSILES = 33832,
|
||||
SPELL_CONE_OF_COLD = 12611,
|
||||
SPELL_FIRE_BLAST = 13341,
|
||||
SPELL_FIREBALL = 14034,
|
||||
SPELL_FROSTBOLT = 15497,
|
||||
SPELL_PYROBLAST = 33975,
|
||||
SPELL_ICEBLOCK = 36911,
|
||||
};
|
||||
|
||||
enum MillhouseEvents
|
||||
{
|
||||
EVENT_MILLHOUSE_INTRO1 = 1,
|
||||
EVENT_MILLHOUSE_INTRO2 = 2,
|
||||
EVENT_MILLHOUSE_INTRO3 = 3,
|
||||
EVENT_MILLHOUSE_INTRO4 = 4,
|
||||
EVENT_MILLHOUSE_INTRO5 = 5,
|
||||
EVENT_MILLHOUSE_INTRO6 = 6,
|
||||
EVENT_MILLHOUSE_INTRO7 = 7,
|
||||
EVENT_MILLHOUSE_INTRO8 = 8,
|
||||
EVENT_MILLHOUSE_INTRO9 = 9,
|
||||
EVENT_SEARCH_FIGHT = 10,
|
||||
EVENT_TELEPORT_VISUAL = 11,
|
||||
|
||||
EVENT_MILL_CHECK_HEALTH = 20,
|
||||
EVENT_MILL_PYROBLAST = 21,
|
||||
EVENT_MILL_BASE_SPELL = 22,
|
||||
EVENT_MILL_ICEBLOCK = 23
|
||||
};
|
||||
|
||||
class npc_millhouse_manastorm : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_millhouse_manastorm() : CreatureScript("npc_millhouse_manastorm") { }
|
||||
|
||||
struct npc_millhouse_manastormAI : public ScriptedAI
|
||||
{
|
||||
npc_millhouse_manastormAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
EventMap events;
|
||||
EventMap events2;
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
ScriptedAI::InitializeAI();
|
||||
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
events2.Reset();
|
||||
events2.ScheduleEvent(EVENT_TELEPORT_VISUAL, 0);
|
||||
events2.ScheduleEvent(EVENT_MILLHOUSE_INTRO1, 3000);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void AttackStart(Unit* who)
|
||||
{
|
||||
if (who && me->Attack(who, true))
|
||||
me->GetMotionMaster()->MoveChase(who, 20.0f);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_MILL_CHECK_HEALTH, 1000);
|
||||
events.ScheduleEvent(EVENT_MILL_PYROBLAST, 30000);
|
||||
events.ScheduleEvent(EVENT_MILL_BASE_SPELL, 2000);
|
||||
events.ScheduleEvent(EVENT_MILL_ICEBLOCK, 1000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events2.Update(diff);
|
||||
switch (events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_TELEPORT_VISUAL:
|
||||
me->CastSpell(me, SPELL_TELEPORT_VISUAL, true);
|
||||
break;
|
||||
case EVENT_MILLHOUSE_INTRO1:
|
||||
Talk(SAY_INTRO_1);
|
||||
events2.ScheduleEvent(EVENT_MILLHOUSE_INTRO2, 18000);
|
||||
break;
|
||||
case EVENT_MILLHOUSE_INTRO2:
|
||||
Talk(SAY_INTRO_2);
|
||||
events2.ScheduleEvent(EVENT_MILLHOUSE_INTRO3, 8000);
|
||||
break;
|
||||
case EVENT_MILLHOUSE_INTRO3:
|
||||
Talk(SAY_INTRO_3);
|
||||
events2.ScheduleEvent(EVENT_MILLHOUSE_INTRO4, 6000);
|
||||
break;
|
||||
case EVENT_MILLHOUSE_INTRO4:
|
||||
Talk(SAY_INTRO_4);
|
||||
events2.ScheduleEvent(EVENT_MILLHOUSE_INTRO5, 8000);
|
||||
break;
|
||||
case EVENT_MILLHOUSE_INTRO5:
|
||||
Talk(SAY_WATER);
|
||||
me->CastSpell(me, SPELL_CONJURE_WATER, false);
|
||||
events2.ScheduleEvent(EVENT_MILLHOUSE_INTRO6, 7000);
|
||||
break;
|
||||
case EVENT_MILLHOUSE_INTRO6:
|
||||
Talk(SAY_BUFFS);
|
||||
me->CastSpell(me, SPELL_ICE_ARMOR, false);
|
||||
events2.ScheduleEvent(EVENT_MILLHOUSE_INTRO7, 7000);
|
||||
break;
|
||||
case EVENT_MILLHOUSE_INTRO7:
|
||||
Talk(SAY_DRINK);
|
||||
me->CastSpell(me, SPELL_ARCANE_INTELLECT, false);
|
||||
events2.ScheduleEvent(EVENT_MILLHOUSE_INTRO8, 7000);
|
||||
break;
|
||||
case EVENT_MILLHOUSE_INTRO8:
|
||||
Talk(SAY_READY);
|
||||
me->GetMotionMaster()->MovePoint(1, 445.82f, -158.38f, 43.067f);
|
||||
events2.ScheduleEvent(EVENT_MILLHOUSE_INTRO9, 5000);
|
||||
break;
|
||||
case EVENT_MILLHOUSE_INTRO9:
|
||||
me->SetFacingTo(M_PI*1.5f);
|
||||
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), M_PI*1.5f);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
events2.ScheduleEvent(EVENT_SEARCH_FIGHT, 1000);
|
||||
break;
|
||||
case EVENT_SEARCH_FIGHT:
|
||||
if (!me->IsInCombat() && !me->IsInEvadeMode())
|
||||
if (Unit* target = me->SelectNearbyTarget(NULL, 30.0f))
|
||||
AttackStart(target);
|
||||
events2.ScheduleEvent(EVENT_SEARCH_FIGHT, 1000);
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_MILL_CHECK_HEALTH:
|
||||
if (HealthBelowPct(20))
|
||||
{
|
||||
Talk(SAY_LOWHP);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MILL_CHECK_HEALTH, 1000);
|
||||
break;
|
||||
case EVENT_MILL_PYROBLAST:
|
||||
Talk(SAY_PYRO);
|
||||
me->CastSpell(me->GetVictim(), SPELL_PYROBLAST, false);
|
||||
events.ScheduleEvent(EVENT_MILL_PYROBLAST, 30000);
|
||||
break;
|
||||
case EVENT_MILL_ICEBLOCK:
|
||||
if (me->GetDistance(me->GetVictim()) < 5.0f)
|
||||
{
|
||||
Talk(SAY_ICEBLOCK);
|
||||
me->CastSpell(me, SPELL_ICEBLOCK, true);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_MILL_ICEBLOCK, 1000);
|
||||
break;
|
||||
case EVENT_MILL_BASE_SPELL:
|
||||
switch (RAND(SPELL_FIREBALL, SPELL_ARCANE_MISSILES, SPELL_FROSTBOLT))
|
||||
{
|
||||
case SPELL_FIREBALL:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FIREBALL, false);
|
||||
events.ScheduleEvent(EVENT_MILL_BASE_SPELL, 4000);
|
||||
break;
|
||||
case SPELL_ARCANE_MISSILES:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ARCANE_MISSILES, false);
|
||||
events.ScheduleEvent(EVENT_MILL_BASE_SPELL, 9000);
|
||||
break;
|
||||
case SPELL_FROSTBOLT:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FROSTBOLT, false);
|
||||
events.ScheduleEvent(EVENT_MILL_BASE_SPELL, 4000);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_millhouse_manastormAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
enum WardenSays
|
||||
{
|
||||
YELL_INTRO1 = 0,
|
||||
YELL_INTRO2 = 1,
|
||||
YELL_RELEASE1 = 2,
|
||||
YELL_RELEASE2A = 3,
|
||||
YELL_RELEASE2B = 4,
|
||||
YELL_RELEASE3 = 5,
|
||||
YELL_RELEASE4 = 6,
|
||||
YELL_WELCOME = 7,
|
||||
|
||||
SAY_HARBINGER_INTRO = 0,
|
||||
};
|
||||
|
||||
enum WardenUnits
|
||||
{
|
||||
NPC_TRICKSTER = 20905,
|
||||
NPC_PH_HUNTER = 20906,
|
||||
NPC_MILLHOUSE = 20977,
|
||||
NPC_AKKIRIS = 20908,
|
||||
NPC_SULFURON = 20909,
|
||||
NPC_TW_DRAK = 20910,
|
||||
NPC_BL_DRAK = 20911,
|
||||
};
|
||||
|
||||
enum WardenSpells
|
||||
{
|
||||
SPELL_TARGET_ALPHA = 36858,
|
||||
SPELL_TARGET_BETA = 36854,
|
||||
SPELL_TARGET_DELTA = 36856,
|
||||
SPELL_TARGET_GAMMA = 36857,
|
||||
SPELL_TARGET_OMEGA = 36852,
|
||||
SPELL_BUBBLE_VISUAL = 36849,
|
||||
|
||||
SPELL_MIND_REND = 36859,
|
||||
SPELL_QID10886 = 39564 // Trial of the Naaru: Tenacity
|
||||
};
|
||||
|
||||
enum WardenEvents
|
||||
{
|
||||
EVENT_WARDEN_CHECK_PLAYERS = 1,
|
||||
EVENT_WARDEN_INTRO1 = 2,
|
||||
EVENT_WARDEN_INTRO2,
|
||||
EVENT_WARDEN_INTRO3,
|
||||
EVENT_WARDEN_INTRO4,
|
||||
EVENT_WARDEN_INTRO5,
|
||||
EVENT_WARDEN_INTRO6,
|
||||
EVENT_WARDEN_INTRO7,
|
||||
EVENT_WARDEN_INTRO8,
|
||||
EVENT_WARDEN_INTRO9,
|
||||
EVENT_WARDEN_INTRO10,
|
||||
EVENT_WARDEN_INTRO11,
|
||||
EVENT_WARDEN_INTRO12,
|
||||
EVENT_WARDEN_INTRO13,
|
||||
EVENT_WARDEN_INTRO14,
|
||||
EVENT_WARDEN_INTRO15,
|
||||
EVENT_WARDEN_INTRO16,
|
||||
EVENT_WARDEN_INTRO17,
|
||||
EVENT_WARDEN_INTRO18,
|
||||
EVENT_WARDEN_INTRO19,
|
||||
EVENT_WARDEN_INTRO20,
|
||||
EVENT_WARDEN_INTRO21,
|
||||
EVENT_WARDEN_INTRO22,
|
||||
EVENT_WARDEN_INTRO23,
|
||||
EVENT_WARDEN_INTRO24,
|
||||
EVENT_WARDEN_INTRO25,
|
||||
EVENT_WARDEN_INTRO26,
|
||||
EVENT_WARDEN_INTRO27,
|
||||
EVENT_WARDEN_INTRO28,
|
||||
EVENT_WARDEN_INTRO29
|
||||
};
|
||||
|
||||
class npc_warden_mellichar : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_warden_mellichar() : CreatureScript("npc_warden_mellichar") { }
|
||||
|
||||
struct npc_warden_mellicharAI : public BossAI
|
||||
{
|
||||
npc_warden_mellicharAI(Creature* creature) : BossAI(creature, DATA_WARDEN_MELLICHAR)
|
||||
{
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summons.Summon(summon);
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit*)
|
||||
{
|
||||
if (summon->GetEntry() == NPC_HARBINGER_SKYRISS)
|
||||
{
|
||||
Unit::Kill(me, me);
|
||||
me->setActive(false);
|
||||
instance->SetBossState(DATA_WARDEN_MELLICHAR, DONE);
|
||||
if (Creature* creature = summons.GetCreatureWithEntry(NPC_MILLHOUSE))
|
||||
{
|
||||
instance->DoCastSpellOnPlayers(SPELL_QID10886);
|
||||
creature->AI()->Talk(SAY_COMPLETE);
|
||||
creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit*) { }
|
||||
void AttackStart(Unit*) { }
|
||||
void EnterCombat(Unit*) { }
|
||||
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
me->setActive(false);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
me->setActive(false);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
|
||||
me->CastSpell((Unit*)NULL, SPELL_TARGET_OMEGA, false);
|
||||
instance->HandleGameObject(instance->GetData64(DATA_WARDENS_SHIELD), true);
|
||||
instance->SetBossState(DATA_WARDEN_MELLICHAR, NOT_STARTED);
|
||||
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* attacker, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (attacker && IS_PLAYER_GUID(attacker->GetCharmerOrOwnerOrOwnGUID()) && damage > 0 && !me->isActiveObject())
|
||||
{
|
||||
me->setActive(true);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO1, 1500);
|
||||
events.ScheduleEvent(EVENT_WARDEN_CHECK_PLAYERS, 1000);
|
||||
instance->SetBossState(DATA_WARDEN_MELLICHAR, IN_PROGRESS);
|
||||
}
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
if (data == FAIL)
|
||||
{
|
||||
CreatureAI::EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
if (data != DONE)
|
||||
return;
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case DATA_WARDEN_1:
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO8, 2000);
|
||||
break;
|
||||
case DATA_WARDEN_3:
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO19, 2000);
|
||||
break;
|
||||
case DATA_WARDEN_4:
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO24, 2000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_WARDEN_CHECK_PLAYERS:
|
||||
if (!SelectTargetFromPlayerList(100.0f))
|
||||
{
|
||||
CreatureAI::EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_WARDEN_CHECK_PLAYERS, 1000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO1:
|
||||
Talk(YELL_INTRO1);
|
||||
me->SetFacingTo(M_PI/2.0f);
|
||||
me->CastSpell(me, SPELL_BUBBLE_VISUAL, false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO2, 1400);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO2:
|
||||
instance->HandleGameObject(instance->GetData64(DATA_WARDENS_SHIELD), false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO3, 20000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO3:
|
||||
Talk(YELL_INTRO2);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO4, 5000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO4:
|
||||
me->SetFacingTo(0.5f);
|
||||
me->CastSpell((Unit*)NULL, SPELL_TARGET_ALPHA, false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO5, 2000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO5:
|
||||
instance->SetData(DATA_WARDEN_1, IN_PROGRESS);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO6, 3000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO6:
|
||||
me->SetFacingTo(M_PI*1.5f);
|
||||
me->CastSpell((Unit*)NULL, SPELL_TARGET_OMEGA, false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO7, 5000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO7:
|
||||
me->SummonCreature(RAND(NPC_TRICKSTER, NPC_PH_HUNTER), 478.326f, -148.505f, 42.56f, 3.19f, TEMPSUMMON_MANUAL_DESPAWN);
|
||||
// Wait for kill
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO8:
|
||||
Talk(YELL_RELEASE1);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->SetFacingTo(2.6f);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO10, 4000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO10:
|
||||
me->CastSpell((Unit*)NULL, SPELL_TARGET_BETA, false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO11, 2000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO11:
|
||||
Talk(YELL_RELEASE2A);
|
||||
instance->SetData(DATA_WARDEN_2, IN_PROGRESS);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO12, 2000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO12:
|
||||
me->SetFacingTo(M_PI*1.5f);
|
||||
me->CastSpell((Unit*)NULL, SPELL_TARGET_OMEGA, false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO13, 6000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO13:
|
||||
me->SummonCreature(NPC_MILLHOUSE, 413.292f, -148.378f, 42.56f, 6.27f, TEMPSUMMON_MANUAL_DESPAWN);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO14, 14000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO14:
|
||||
Talk(YELL_RELEASE2B);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->SetFacingTo(3.3f);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO15, 5000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO15:
|
||||
me->CastSpell((Unit*)NULL, SPELL_TARGET_DELTA, false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO16, 2000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO16:
|
||||
instance->SetData(DATA_WARDEN_3, IN_PROGRESS);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO17, 2000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO17:
|
||||
me->SetFacingTo(M_PI*1.5f);
|
||||
me->CastSpell((Unit*)NULL, SPELL_TARGET_OMEGA, false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO18, 6000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO18:
|
||||
me->SummonCreature(RAND(NPC_AKKIRIS, NPC_SULFURON), 420.179f, -174.396f, 42.58f, 0.02f, TEMPSUMMON_MANUAL_DESPAWN);
|
||||
// Wait for kill
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO19:
|
||||
Talk(YELL_RELEASE3);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->SetFacingTo(6.05f);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO20, 4000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO20:
|
||||
me->CastSpell((Unit*)NULL, SPELL_TARGET_GAMMA, false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO21, 2000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO21:
|
||||
instance->SetData(DATA_WARDEN_4, IN_PROGRESS);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO22, 2000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO22:
|
||||
me->SetFacingTo(M_PI*1.5f);
|
||||
me->CastSpell((Unit*)NULL, SPELL_TARGET_OMEGA, false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO23, 6000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO23:
|
||||
me->SummonCreature(RAND(NPC_TW_DRAK, NPC_BL_DRAK), 471.795f, -174.58f, 42.58f, 3.06f, TEMPSUMMON_MANUAL_DESPAWN);
|
||||
// Wait for kill
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO24:
|
||||
instance->SetData(DATA_WARDEN_5, IN_PROGRESS);
|
||||
Talk(YELL_RELEASE4);
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO25, 8000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO25:
|
||||
if (Creature* cr = me->SummonCreature(NPC_HARBINGER_SKYRISS, 445.763f, -191.639f, 44.64f, 1.60f, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
{
|
||||
cr->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
cr->CastSpell(cr, SPELL_TELEPORT_VISUAL, true);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO26, 1000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO26:
|
||||
if (Creature* creature = summons.GetCreatureWithEntry(NPC_HARBINGER_SKYRISS))
|
||||
creature->AI()->Talk(SAY_HARBINGER_INTRO);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO27, 23000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO27:
|
||||
Talk(YELL_WELCOME);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO28, 5000);
|
||||
break;
|
||||
case EVENT_WARDEN_INTRO28:
|
||||
instance->HandleGameObject(instance->GetData64(DATA_WARDENS_SHIELD), true);
|
||||
if (Creature* creature = summons.GetCreatureWithEntry(NPC_HARBINGER_SKYRISS))
|
||||
creature->CastSpell((Unit*)NULL, SPELL_MIND_REND, false);
|
||||
events.ScheduleEvent(EVENT_WARDEN_INTRO29, 4000);
|
||||
break;
|
||||
|
||||
case EVENT_WARDEN_INTRO29:
|
||||
events.Reset();
|
||||
me->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS_2, UNIT_FLAG2_FEIGN_DEATH);
|
||||
if (Creature* creature = summons.GetCreatureWithEntry(NPC_HARBINGER_SKYRISS))
|
||||
{
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
if (Player* player = SelectTargetFromPlayerList(50.0f))
|
||||
AttackStart(player);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_warden_mellicharAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_arcatraz_soul_steal : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_arcatraz_soul_steal() : SpellScriptLoader("spell_arcatraz_soul_steal") { }
|
||||
|
||||
class spell_arcatraz_soul_steal_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_arcatraz_soul_steal_AuraScript)
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, SPELL_SOUL_STEAL, true);
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->RemoveAurasDueToSpell(SPELL_SOUL_STEAL);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_arcatraz_soul_steal_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_arcatraz_soul_steal_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_MOD_DAMAGE_PERCENT_DONE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_arcatraz_soul_steal_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_arcatraz()
|
||||
{
|
||||
new npc_millhouse_manastorm();
|
||||
new npc_warden_mellichar();
|
||||
|
||||
new spell_arcatraz_soul_steal();
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef ARCATRAZ_H
|
||||
#define ARCATRAZ_H
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
// Encounter States/Boss GUIDs
|
||||
DATA_ZEREKETH = 0,
|
||||
DATA_DALLIAH = 1,
|
||||
DATA_SOCCOTHRATES = 2,
|
||||
DATA_WARDEN_MELLICHAR = 3,
|
||||
MAX_ENCOUTER = 4,
|
||||
|
||||
// Additional Data
|
||||
DATA_WARDEN_1 = 5, // used by SmartAI
|
||||
DATA_WARDEN_2 = 6, // used by SmartAI
|
||||
DATA_WARDEN_3 = 7, // used by SmartAI
|
||||
DATA_WARDEN_4 = 8, // used by SmartAI
|
||||
DATA_WARDEN_5 = 9, // used by SmartAI
|
||||
DATA_WARDENS_SHIELD = 10
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_DALLIAH = 20885,
|
||||
NPC_SOCCOTHRATES = 20886,
|
||||
NPC_MELLICHAR = 20904,
|
||||
NPC_HARBINGER_SKYRISS = 20912,
|
||||
NPC_ALPHA_POD_TARGET = 21436
|
||||
};
|
||||
|
||||
enum GameObjectIds
|
||||
{
|
||||
GO_CONTAINMENT_CORE_SECURITY_FIELD_ALPHA = 184318, // door opened when Wrath-Scryer Soccothrates dies
|
||||
GO_CONTAINMENT_CORE_SECURITY_FIELD_BETA = 184319, // door opened when Dalliah the Doomsayer dies
|
||||
GO_STASIS_POD_ALPHA = 183961, // pod first boss wave
|
||||
GO_STASIS_POD_BETA = 183963, // pod second boss wave
|
||||
GO_STASIS_POD_DELTA = 183964, // pod third boss wave
|
||||
GO_STASIS_POD_GAMMA = 183962, // pod fourth boss wave
|
||||
GO_STASIS_POD_OMEGA = 183965, // pod fifth boss wave
|
||||
GO_WARDENS_SHIELD = 184802 // shield 'protecting' mellichar
|
||||
};
|
||||
|
||||
enum SpellIds
|
||||
{
|
||||
SPELL_TELEPORT_VISUAL = 35517,
|
||||
SPELL_SOUL_STEAL = 36782
|
||||
};
|
||||
|
||||
#endif // ARCATRAZ_H
|
||||
@@ -1,171 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "arcatraz.h"
|
||||
|
||||
enum Say
|
||||
{
|
||||
// Dalliah the Doomsayer
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_WHIRLWIND = 3,
|
||||
SAY_HEAL = 4,
|
||||
SAY_DEATH = 5,
|
||||
SAY_SOCCOTHRATES_DEATH = 7,
|
||||
|
||||
// Wrath-Scryer Soccothrates
|
||||
SAY_AGGRO_DALLIAH_FIRST = 0,
|
||||
SAY_DALLIAH_25_PERCENT = 5
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_GIFT_OF_THE_DOOMSAYER = 36173,
|
||||
SPELL_WHIRLWIND = 36142,
|
||||
SPELL_HEAL = 36144,
|
||||
SPELL_SHADOW_WAVE = 39016
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_GIFT_OF_THE_DOOMSAYER = 1,
|
||||
EVENT_WHIRLWIND = 2,
|
||||
EVENT_HEAL = 3,
|
||||
EVENT_SHADOW_WAVE = 4,
|
||||
EVENT_ME_FIRST = 5,
|
||||
EVENT_SOCCOTHRATES_DEATH = 6,
|
||||
EVENT_CHECK_HEALTH = 7,
|
||||
};
|
||||
|
||||
class boss_dalliah_the_doomsayer : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_dalliah_the_doomsayer() : CreatureScript("boss_dalliah_the_doomsayer") { }
|
||||
|
||||
struct boss_dalliah_the_doomsayerAI : public BossAI
|
||||
{
|
||||
boss_dalliah_the_doomsayerAI(Creature* creature) : BossAI(creature, DATA_DALLIAH) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
events2.Reset();
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
BossAI::InitializeAI();
|
||||
if (instance->GetBossState(DATA_SOCCOTHRATES) != DONE)
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (Creature* soccothrates = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SOCCOTHRATES)))
|
||||
if (soccothrates->IsAlive() && !soccothrates->IsInCombat())
|
||||
soccothrates->AI()->SetData(1, 1);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_GIFT_OF_THE_DOOMSAYER, urand(1000, 4000));
|
||||
events.ScheduleEvent(EVENT_WHIRLWIND, urand(7000, 9000));
|
||||
events.ScheduleEvent(EVENT_ME_FIRST, 6000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SHADOW_WAVE, urand(11000, 16000));
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void SetData(uint32 /*type*/, uint32 data)
|
||||
{
|
||||
if (data == 1)
|
||||
events2.ScheduleEvent(EVENT_SOCCOTHRATES_DEATH, 6000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events2.Update(diff);
|
||||
switch (events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SOCCOTHRATES_DEATH:
|
||||
Talk(SAY_SOCCOTHRATES_DEATH);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_GIFT_OF_THE_DOOMSAYER:
|
||||
me->CastSpell(me->GetVictim(), SPELL_GIFT_OF_THE_DOOMSAYER, false);
|
||||
events.ScheduleEvent(EVENT_GIFT_OF_THE_DOOMSAYER, urand(16000, 21000));
|
||||
break;
|
||||
case EVENT_WHIRLWIND:
|
||||
me->CastSpell(me, SPELL_WHIRLWIND, false);
|
||||
Talk(SAY_WHIRLWIND);
|
||||
events.ScheduleEvent(EVENT_WHIRLWIND, urand(19000, 21000));
|
||||
events.ScheduleEvent(EVENT_HEAL, 6000);
|
||||
break;
|
||||
case EVENT_HEAL:
|
||||
me->CastSpell(me, SPELL_HEAL, false);
|
||||
Talk(SAY_HEAL);
|
||||
break;
|
||||
case EVENT_SHADOW_WAVE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SHADOW_WAVE, false);
|
||||
events.ScheduleEvent(EVENT_SHADOW_WAVE, urand(11000, 16000));
|
||||
break;
|
||||
case EVENT_ME_FIRST:
|
||||
if (Creature* soccothrates = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SOCCOTHRATES)))
|
||||
if (soccothrates->IsAlive() && !soccothrates->IsInCombat())
|
||||
soccothrates->AI()->Talk(SAY_AGGRO_DALLIAH_FIRST);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (HealthBelowPct(25))
|
||||
{
|
||||
if (Creature* soccothrates = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_SOCCOTHRATES)))
|
||||
soccothrates->AI()->Talk(SAY_DALLIAH_25_PERCENT);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events2;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_dalliah_the_doomsayerAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_dalliah_the_doomsayer()
|
||||
{
|
||||
new boss_dalliah_the_doomsayer();
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "arcatraz.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_KILL = 2,
|
||||
SAY_MIND = 3,
|
||||
SAY_FEAR = 4,
|
||||
SAY_IMAGE = 5,
|
||||
SAY_DEATH = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_FEAR = 39415,
|
||||
SPELL_MIND_REND = 36924,
|
||||
SPELL_DOMINATION = 37162,
|
||||
SPELL_MANA_BURN = 39020,
|
||||
SPELL_66_ILLUSION = 36931,
|
||||
SPELL_33_ILLUSION = 36932,
|
||||
|
||||
SPELL_MIND_REND_IMAGE = 36929,
|
||||
H_SPELL_MIND_REND_IMAGE = 39021
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
NPC_HARBINGER_SKYRISS_66 = 21466,
|
||||
|
||||
EVENT_SUMMON_IMAGE1 = 1,
|
||||
EVENT_SUMMON_IMAGE2 = 2,
|
||||
EVENT_SPELL_MIND_REND = 3,
|
||||
EVENT_SPELL_FEAR = 4,
|
||||
EVENT_SPELL_DOMINATION = 5,
|
||||
EVENT_SPELL_MANA_BURN = 6
|
||||
};
|
||||
|
||||
class boss_harbinger_skyriss : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_harbinger_skyriss() : CreatureScript("boss_harbinger_skyriss") { }
|
||||
|
||||
struct boss_harbinger_skyrissAI : public ScriptedAI
|
||||
{
|
||||
boss_harbinger_skyrissAI(Creature* creature) : ScriptedAI(creature), summons(me)
|
||||
{
|
||||
instance = creature->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* instance;
|
||||
SummonList summons;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
me->SetInCombatWithZone();
|
||||
|
||||
events.ScheduleEvent(EVENT_SUMMON_IMAGE1, 1000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_IMAGE2, 1000);
|
||||
events.ScheduleEvent(EVENT_SPELL_MIND_REND, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FEAR, 15000);
|
||||
events.ScheduleEvent(EVENT_SPELL_DOMINATION, 30000);
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_SPELL_MANA_BURN, 25000);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summon)
|
||||
{
|
||||
summon->SetHealth(summon->CountPctFromMaxHealth(summon->GetEntry() == NPC_HARBINGER_SKYRISS_66 ? 66 : 33));
|
||||
summons.Summon(summon);
|
||||
summon->SetInCombatWithZone();
|
||||
me->UpdatePosition(*summon, true);
|
||||
me->SendMovementFlagUpdate();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SUMMON_IMAGE1:
|
||||
if (HealthBelowPct(67))
|
||||
{
|
||||
Talk(SAY_IMAGE);
|
||||
me->CastSpell(me, SPELL_66_ILLUSION, false);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SUMMON_IMAGE1, 1000);
|
||||
break;
|
||||
case EVENT_SUMMON_IMAGE2:
|
||||
if (HealthBelowPct(34))
|
||||
{
|
||||
Talk(SAY_IMAGE);
|
||||
me->CastSpell(me, SPELL_33_ILLUSION, false);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SUMMON_IMAGE2, 1000);
|
||||
break;
|
||||
case EVENT_SPELL_MIND_REND:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f))
|
||||
me->CastSpell(target, SPELL_MIND_REND, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_MIND_REND, 10000);
|
||||
break;
|
||||
case EVENT_SPELL_FEAR:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 20.0f))
|
||||
{
|
||||
Talk(SAY_FEAR);
|
||||
me->CastSpell(target, SPELL_FEAR, false);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_FEAR, 25000);
|
||||
break;
|
||||
case EVENT_SPELL_DOMINATION:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 30.0f))
|
||||
{
|
||||
Talk(SAY_MIND);
|
||||
me->CastSpell(target, SPELL_DOMINATION, false);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SPELL_DOMINATION, 30000);
|
||||
break;
|
||||
case EVENT_SPELL_MANA_BURN:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, PowerUsersSelector(me, POWER_MANA, 40.0f, false)))
|
||||
me->CastSpell(target, SPELL_MANA_BURN, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_MANA_BURN, 30000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_harbinger_skyrissAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_harbinger_skyriss()
|
||||
{
|
||||
new boss_harbinger_skyriss();
|
||||
}
|
||||
|
||||
@@ -1,252 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "arcatraz.h"
|
||||
|
||||
enum Say
|
||||
{
|
||||
// Wrath-Scryer Soccothrates
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SLAY = 2,
|
||||
SAY_KNOCK_AWAY = 3,
|
||||
SAY_DEATH = 4,
|
||||
SAY_DALLIAH_DEATH = 6,
|
||||
SAY_SOCCOTHRATES_CONVO_1 = 7,
|
||||
SAY_SOCCOTHRATES_CONVO_2 = 8,
|
||||
SAY_SOCCOTHRATES_CONVO_3 = 9,
|
||||
SAY_SOCCOTHRATES_CONVO_4 = 10,
|
||||
|
||||
// Dalliah the Doomsayer
|
||||
SAY_AGGRO_SOCCOTHRATES_FIRST = 0,
|
||||
SAY_SOCCOTHRATES_25_PERCENT = 6,
|
||||
SAY_DALLIAH_CONVO_1 = 8,
|
||||
SAY_DALLIAH_CONVO_2 = 9,
|
||||
SAY_DALLIAH_CONVO_3 = 10
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_FEL_IMMOLATION = 36051,
|
||||
SPELL_FELFIRE_SHOCK = 35759,
|
||||
SPELL_KNOCK_AWAY = 36512,
|
||||
SPELL_FELFIRE = 35769,
|
||||
SPELL_CHARGE = 35754
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_FELFIRE_SHOCK = 1,
|
||||
EVENT_KNOCK_AWAY = 2,
|
||||
|
||||
EVENT_PREFIGHT_1 = 3,
|
||||
EVENT_PREFIGHT_2 = 4,
|
||||
EVENT_PREFIGHT_3 = 5,
|
||||
EVENT_PREFIGHT_4 = 6,
|
||||
EVENT_PREFIGHT_5 = 7,
|
||||
EVENT_PREFIGHT_6 = 8,
|
||||
EVENT_PREFIGHT_7 = 9,
|
||||
EVENT_PREFIGHT_8 = 10,
|
||||
EVENT_PREFIGHT_9 = 11,
|
||||
EVENT_ME_FIRST = 12,
|
||||
EVENT_DALLIAH_DEATH = 13,
|
||||
EVENT_CHECK_HEALTH = 14,
|
||||
EVENT_SPELL_CHARGE = 15,
|
||||
EVENT_FELFIRE = 16,
|
||||
};
|
||||
|
||||
class boss_wrath_scryer_soccothrates : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_wrath_scryer_soccothrates() : CreatureScript("boss_wrath_scryer_soccothrates") { }
|
||||
|
||||
struct boss_wrath_scryer_soccothratesAI : public BossAI
|
||||
{
|
||||
boss_wrath_scryer_soccothratesAI(Creature* creature) : BossAI(creature, DATA_SOCCOTHRATES)
|
||||
{
|
||||
preFight = instance->GetBossState(DATA_DALLIAH) == DONE;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
events2.Reset();
|
||||
me->CastSpell(me, SPELL_FEL_IMMOLATION, true);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
BossAI::InitializeAI();
|
||||
if (!preFight)
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
if (Creature* dalliah = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DALLIAH)))
|
||||
if (dalliah->IsAlive() && !dalliah->IsInCombat())
|
||||
dalliah->AI()->SetData(1, 1);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events2.Reset();
|
||||
events.ScheduleEvent(EVENT_FELFIRE_SHOCK, urand(12000, 14000));
|
||||
events.ScheduleEvent(EVENT_KNOCK_AWAY, urand(11000, 12000));
|
||||
events.ScheduleEvent(EVENT_ME_FIRST, 6000);
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!preFight && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 70.0f))
|
||||
{
|
||||
Talk(SAY_SOCCOTHRATES_CONVO_1);
|
||||
events2.ScheduleEvent(EVENT_PREFIGHT_1, 2000);
|
||||
preFight = true;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 /*type*/, uint32 data)
|
||||
{
|
||||
if (data == 1)
|
||||
events2.RescheduleEvent(EVENT_DALLIAH_DEATH, 6000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
events2.Update(diff);
|
||||
switch (events2.ExecuteEvent())
|
||||
{
|
||||
case EVENT_PREFIGHT_1:
|
||||
if (Creature* dalliah = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DALLIAH)))
|
||||
dalliah->AI()->Talk(SAY_DALLIAH_CONVO_1);
|
||||
events2.ScheduleEvent(EVENT_PREFIGHT_2, 3000);
|
||||
break;
|
||||
case EVENT_PREFIGHT_2:
|
||||
Talk(SAY_SOCCOTHRATES_CONVO_2);
|
||||
events2.ScheduleEvent(EVENT_PREFIGHT_3, 3000);
|
||||
break;
|
||||
case EVENT_PREFIGHT_3:
|
||||
if (Creature* dalliah = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DALLIAH)))
|
||||
dalliah->AI()->Talk(SAY_DALLIAH_CONVO_2);
|
||||
events2.ScheduleEvent(EVENT_PREFIGHT_4, 6000);
|
||||
break;
|
||||
case EVENT_PREFIGHT_4:
|
||||
Talk(SAY_SOCCOTHRATES_CONVO_3);
|
||||
events2.ScheduleEvent(EVENT_PREFIGHT_5, 2000);
|
||||
break;
|
||||
case EVENT_PREFIGHT_5:
|
||||
if (Creature* dalliah = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DALLIAH)))
|
||||
dalliah->AI()->Talk(SAY_DALLIAH_CONVO_3);
|
||||
events2.ScheduleEvent(EVENT_PREFIGHT_6, 3000);
|
||||
break;
|
||||
case EVENT_PREFIGHT_6:
|
||||
Talk(SAY_SOCCOTHRATES_CONVO_4);
|
||||
events2.ScheduleEvent(EVENT_PREFIGHT_7, 2000);
|
||||
break;
|
||||
case EVENT_PREFIGHT_7:
|
||||
if (Creature* dalliah = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DALLIAH)))
|
||||
dalliah->GetMotionMaster()->MovePoint(0, 118.6048f, 96.84852f, 22.44115f);
|
||||
events2.ScheduleEvent(EVENT_PREFIGHT_8, 4000);
|
||||
break;
|
||||
case EVENT_PREFIGHT_8:
|
||||
me->GetMotionMaster()->MovePoint(0, 122.1035f, 192.7203f, 22.44115f);
|
||||
events2.ScheduleEvent(EVENT_PREFIGHT_9, 4000);
|
||||
break;
|
||||
case EVENT_PREFIGHT_9:
|
||||
if (Creature* dalliah = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DALLIAH)))
|
||||
{
|
||||
dalliah->SetFacingToObject(me);
|
||||
dalliah->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
me->SetFacingToObject(dalliah);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
dalliah->SetHomePosition(dalliah->GetPositionX(), dalliah->GetPositionY(), dalliah->GetPositionZ(), 1.51737f);
|
||||
me->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 4.725722f);
|
||||
}
|
||||
break;
|
||||
case EVENT_DALLIAH_DEATH:
|
||||
Talk(SAY_DALLIAH_DEATH);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_FELFIRE_SHOCK:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FELFIRE_SHOCK, false);
|
||||
events.ScheduleEvent(EVENT_FELFIRE_SHOCK, urand(12000, 14000));
|
||||
break;
|
||||
case EVENT_KNOCK_AWAY:
|
||||
me->CastSpell(me, SPELL_KNOCK_AWAY, false);
|
||||
Talk(SAY_KNOCK_AWAY);
|
||||
events.ScheduleEvent(EVENT_KNOCK_AWAY, urand(11000, 12000));
|
||||
events.ScheduleEvent(EVENT_SPELL_CHARGE, 4600);
|
||||
break;
|
||||
case EVENT_SPELL_CHARGE:
|
||||
me->CastSpell(me, SPELL_CHARGE, true);
|
||||
me->CastSpell(me, SPELL_FELFIRE, true);
|
||||
events.ScheduleEvent(EVENT_FELFIRE, 300);
|
||||
events.ScheduleEvent(EVENT_FELFIRE, 600);
|
||||
events.ScheduleEvent(EVENT_FELFIRE, 900);
|
||||
events.ScheduleEvent(EVENT_FELFIRE, 1200);
|
||||
events.ScheduleEvent(EVENT_FELFIRE, 1500);
|
||||
events.ScheduleEvent(EVENT_FELFIRE, 1800);
|
||||
break;
|
||||
case EVENT_FELFIRE:
|
||||
me->CastSpell(me, SPELL_FELFIRE, true);
|
||||
break;
|
||||
case EVENT_ME_FIRST:
|
||||
if (Creature* dalliah = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DALLIAH)))
|
||||
if (dalliah->IsAlive() && !dalliah->IsInCombat())
|
||||
dalliah->AI()->Talk(SAY_AGGRO_SOCCOTHRATES_FIRST);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (HealthBelowPct(25))
|
||||
{
|
||||
if (Creature* dalliah = ObjectAccessor::GetCreature(*me, instance->GetData64(DATA_DALLIAH)))
|
||||
dalliah->AI()->Talk(SAY_SOCCOTHRATES_25_PERCENT);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
bool preFight;
|
||||
EventMap events2;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_wrath_scryer_soccothratesAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_wrath_scryer_soccothrates()
|
||||
{
|
||||
new boss_wrath_scryer_soccothrates();
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "arcatraz.h"
|
||||
|
||||
enum Say
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SLAY = 1,
|
||||
SAY_SHADOW_NOVA = 2,
|
||||
SAY_DEATH = 3
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_VOID_ZONE = 36119,
|
||||
SPELL_SHADOW_NOVA = 36127,
|
||||
SPELL_SEED_OF_CORRUPTION = 36123
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_VOID_ZONE = 1,
|
||||
EVENT_SHADOW_NOVA = 2,
|
||||
EVENT_SEED_OF_CORRUPTION = 3
|
||||
};
|
||||
|
||||
class boss_zereketh_the_unbound : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_zereketh_the_unbound() : CreatureScript("boss_zereketh_the_unbound") { }
|
||||
|
||||
struct boss_zereketh_the_unboundAI : public BossAI
|
||||
{
|
||||
boss_zereketh_the_unboundAI(Creature* creature) : BossAI(creature, DATA_ZEREKETH) { }
|
||||
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
events.ScheduleEvent(EVENT_VOID_ZONE, 6000);
|
||||
events.ScheduleEvent(EVENT_SHADOW_NOVA, 10000);
|
||||
events.ScheduleEvent(EVENT_SEED_OF_CORRUPTION, 16000);
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_VOID_ZONE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 60.0f, true))
|
||||
me->CastSpell(target, SPELL_VOID_ZONE, false);
|
||||
events.ScheduleEvent(EVENT_VOID_ZONE, 15000);
|
||||
break;
|
||||
case EVENT_SHADOW_NOVA:
|
||||
me->CastSpell(me, SPELL_SHADOW_NOVA, false);
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_SHADOW_NOVA);
|
||||
events.ScheduleEvent(EVENT_SHADOW_NOVA, 12000);
|
||||
break;
|
||||
case EVENT_SEED_OF_CORRUPTION:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 30.0f, true))
|
||||
me->CastSpell(target, SPELL_SEED_OF_CORRUPTION, false);
|
||||
events.ScheduleEvent(EVENT_SEED_OF_CORRUPTION, 16000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_zereketh_the_unboundAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_zereketh_the_unbound()
|
||||
{
|
||||
new boss_zereketh_the_unbound();
|
||||
}
|
||||
@@ -1,211 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "arcatraz.h"
|
||||
|
||||
DoorData const doorData[] =
|
||||
{
|
||||
{ GO_CONTAINMENT_CORE_SECURITY_FIELD_ALPHA, DATA_SOCCOTHRATES, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ GO_CONTAINMENT_CORE_SECURITY_FIELD_BETA, DATA_DALLIAH, DOOR_TYPE_PASSAGE, BOUNDARY_NONE },
|
||||
{ 0, 0, DOOR_TYPE_ROOM, BOUNDARY_NONE } // END
|
||||
};
|
||||
|
||||
class instance_arcatraz : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_arcatraz() : InstanceMapScript("instance_arcatraz", 552) { }
|
||||
|
||||
struct instance_arcatraz_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_arcatraz_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUTER);
|
||||
LoadDoorData(doorData);
|
||||
|
||||
DalliahGUID = 0;
|
||||
SoccothratesGUID = 0;
|
||||
MellicharGUID = 0;
|
||||
WardensShieldGUID = 0;
|
||||
|
||||
memset(StasisPodGUIDs, 0, 5 * sizeof(uint64));
|
||||
}
|
||||
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch (creature->GetEntry())
|
||||
{
|
||||
case NPC_DALLIAH:
|
||||
DalliahGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SOCCOTHRATES:
|
||||
SoccothratesGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_MELLICHAR:
|
||||
MellicharGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_CONTAINMENT_CORE_SECURITY_FIELD_ALPHA:
|
||||
case GO_CONTAINMENT_CORE_SECURITY_FIELD_BETA:
|
||||
AddDoor(go, true);
|
||||
break;
|
||||
case GO_STASIS_POD_ALPHA:
|
||||
StasisPodGUIDs[0] = go->GetGUID();
|
||||
break;
|
||||
case GO_STASIS_POD_BETA:
|
||||
StasisPodGUIDs[1] = go->GetGUID();
|
||||
break;
|
||||
case GO_STASIS_POD_DELTA:
|
||||
StasisPodGUIDs[2] = go->GetGUID();
|
||||
break;
|
||||
case GO_STASIS_POD_GAMMA:
|
||||
StasisPodGUIDs[3] = go->GetGUID();
|
||||
break;
|
||||
case GO_STASIS_POD_OMEGA:
|
||||
StasisPodGUIDs[4] = go->GetGUID();
|
||||
break;
|
||||
case GO_WARDENS_SHIELD:
|
||||
WardensShieldGUID = go->GetGUID();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void OnGameObjectRemove(GameObject* go)
|
||||
{
|
||||
switch (go->GetEntry())
|
||||
{
|
||||
case GO_CONTAINMENT_CORE_SECURITY_FIELD_ALPHA:
|
||||
case GO_CONTAINMENT_CORE_SECURITY_FIELD_BETA:
|
||||
AddDoor(go, false);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_WARDEN_1:
|
||||
case DATA_WARDEN_2:
|
||||
case DATA_WARDEN_3:
|
||||
case DATA_WARDEN_4:
|
||||
case DATA_WARDEN_5:
|
||||
if (data < FAIL)
|
||||
HandleGameObject(StasisPodGUIDs[type - DATA_WARDEN_1], data == IN_PROGRESS);
|
||||
if (Creature* warden = instance->GetCreature(MellicharGUID))
|
||||
warden->AI()->SetData(type, data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 type) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64 GetData64(uint32 data) const
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case DATA_DALLIAH:
|
||||
return DalliahGUID;
|
||||
case DATA_SOCCOTHRATES:
|
||||
return SoccothratesGUID;
|
||||
case DATA_WARDENS_SHIELD:
|
||||
return WardensShieldGUID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
if (type == DATA_WARDEN_MELLICHAR && state == NOT_STARTED)
|
||||
{
|
||||
SetData(DATA_WARDEN_1, NOT_STARTED);
|
||||
SetData(DATA_WARDEN_2, NOT_STARTED);
|
||||
SetData(DATA_WARDEN_3, NOT_STARTED);
|
||||
SetData(DATA_WARDEN_4, NOT_STARTED);
|
||||
SetData(DATA_WARDEN_5, NOT_STARTED);
|
||||
HandleGameObject(WardensShieldGUID, true);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "A Z " << 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 == 'A' && dataHead2 == 'Z')
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_ENCOUTER; ++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;
|
||||
}
|
||||
|
||||
protected:
|
||||
uint64 DalliahGUID;
|
||||
uint64 SoccothratesGUID;
|
||||
uint64 StasisPodGUIDs[5];
|
||||
uint64 MellicharGUID;
|
||||
uint64 WardensShieldGUID;
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_arcatraz_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_arcatraz()
|
||||
{
|
||||
new instance_arcatraz();
|
||||
}
|
||||
|
||||
@@ -1,162 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "the_botanica.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_KILL = 1,
|
||||
SAY_ARCANE_RESONANCE = 2,
|
||||
SAY_ARCANE_DEVASTATION = 3,
|
||||
EMOTE_SUMMON = 4,
|
||||
SAY_SUMMON = 5,
|
||||
SAY_DEATH = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ARCANE_RESONANCE = 34794,
|
||||
SPELL_ARCANE_DEVASTATION = 34799,
|
||||
SPELL_SUMMON_REINFORCEMENTS = 34803
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_ARCANE_RESONANCE = 1,
|
||||
EVENT_ARCANE_DEVASTATION = 2,
|
||||
EVENT_HEALTH_CHECK = 3
|
||||
};
|
||||
|
||||
class boss_commander_sarannis : public CreatureScript
|
||||
{
|
||||
public: boss_commander_sarannis() : CreatureScript("boss_commander_sarannis") { }
|
||||
|
||||
struct boss_commander_sarannisAI : public BossAI
|
||||
{
|
||||
boss_commander_sarannisAI(Creature* creature) : BossAI(creature, DATA_COMMANDER_SARANNIS) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_ARCANE_RESONANCE, 20000);
|
||||
events.ScheduleEvent(EVENT_ARCANE_DEVASTATION, 10000);
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK, 500);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ARCANE_RESONANCE:
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_ARCANE_RESONANCE);
|
||||
me->CastSpell(me->GetVictim(), SPELL_ARCANE_RESONANCE, false);
|
||||
events.ScheduleEvent(EVENT_ARCANE_RESONANCE, 27000);
|
||||
break;
|
||||
case EVENT_ARCANE_DEVASTATION:
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_ARCANE_DEVASTATION);
|
||||
me->CastSpell(me->GetVictim(), SPELL_ARCANE_DEVASTATION, false);
|
||||
events.ScheduleEvent(EVENT_ARCANE_DEVASTATION, 17000);
|
||||
break;
|
||||
case EVENT_HEALTH_CHECK:
|
||||
if (me->HealthBelowPct(50))
|
||||
{
|
||||
Talk(EMOTE_SUMMON);
|
||||
Talk(SAY_SUMMON);
|
||||
me->CastSpell(me, SPELL_SUMMON_REINFORCEMENTS, true);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK, 500);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_commander_sarannisAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
Position const PosSummonReinforcements[4] =
|
||||
{
|
||||
{ 160.4483f, 287.6435f, -3.887904f, 2.3841f },
|
||||
{ 153.4406f, 289.9929f, -4.736916f, 2.3841f },
|
||||
{ 154.4137f, 292.8956f, -4.683603f, 2.3841f },
|
||||
{ 157.1544f, 294.2599f, -4.726504f, 2.3841f }
|
||||
};
|
||||
|
||||
enum Creatures
|
||||
{
|
||||
NPC_SUMMONED_BLOODWARDER_MENDER = 20083,
|
||||
NPC_SUMMONED_BLOODWARDER_RESERVIST = 20078
|
||||
};
|
||||
|
||||
class spell_commander_sarannis_summon_reinforcements : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_commander_sarannis_summon_reinforcements() : SpellScriptLoader("spell_commander_sarannis_summon_reinforcements") { }
|
||||
|
||||
class spell_commander_sarannis_summon_reinforcements_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_commander_sarannis_summon_reinforcements_SpellScript);
|
||||
|
||||
void HandleCast(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_MENDER, PosSummonReinforcements[0], TEMPSUMMON_CORPSE_DESPAWN);
|
||||
GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_RESERVIST, PosSummonReinforcements[1], TEMPSUMMON_CORPSE_DESPAWN);
|
||||
GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_RESERVIST, PosSummonReinforcements[2], TEMPSUMMON_CORPSE_DESPAWN);
|
||||
if (GetCaster()->GetMap()->IsHeroic())
|
||||
GetCaster()->SummonCreature(NPC_SUMMONED_BLOODWARDER_RESERVIST, PosSummonReinforcements[3], TEMPSUMMON_CORPSE_DESPAWN);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_commander_sarannis_summon_reinforcements_SpellScript::HandleCast, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_commander_sarannis_summon_reinforcements_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_commander_sarannis()
|
||||
{
|
||||
new boss_commander_sarannis();
|
||||
new spell_commander_sarannis_summon_reinforcements();
|
||||
}
|
||||
@@ -1,149 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "the_botanica.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_KILL = 1,
|
||||
SAY_TREE = 2,
|
||||
SAY_SUMMON = 3,
|
||||
SAY_DEATH = 4,
|
||||
SAY_OOC_RANDOM = 5
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_TRANQUILITY = 34550,
|
||||
SPELL_TREE_FORM = 34551,
|
||||
SPELL_SUMMON_FRAYER = 34557,
|
||||
SPELL_PLANT_WHITE = 34759,
|
||||
SPELL_PLANT_GREEN = 34761,
|
||||
SPELL_PLANT_BLUE = 34762,
|
||||
SPELL_PLANT_RED = 34763
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
NPC_FRAYER = 19953,
|
||||
|
||||
EVENT_SUMMON_SEEDLING = 1,
|
||||
EVENT_TREE_FORM = 2,
|
||||
EVENT_CHECK_FRAYERS = 3,
|
||||
EVENT_RESTORE_COMBAT = 4
|
||||
};
|
||||
|
||||
class boss_high_botanist_freywinn : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_high_botanist_freywinn() : CreatureScript("boss_high_botanist_freywinn")
|
||||
{
|
||||
}
|
||||
|
||||
struct boss_high_botanist_freywinnAI : public BossAI
|
||||
{
|
||||
boss_high_botanist_freywinnAI(Creature* creature) : BossAI(creature, DATA_HIGH_BOTANIST_FREYWINN) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_SUMMON_SEEDLING, 6000);
|
||||
events.ScheduleEvent(EVENT_TREE_FORM, 30000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
_JustDied();
|
||||
}
|
||||
|
||||
void SummonedCreatureDies(Creature* summon, Unit*)
|
||||
{
|
||||
summons.Despawn(summon);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (!events.IsInPhase(1) && me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SUMMON_SEEDLING:
|
||||
if (roll_chance_i(20))
|
||||
Talk(SAY_OOC_RANDOM);
|
||||
me->CastSpell(me, RAND(SPELL_PLANT_WHITE, SPELL_PLANT_GREEN, SPELL_PLANT_BLUE, SPELL_PLANT_RED), false);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SEEDLING, 6000);
|
||||
break;
|
||||
case EVENT_TREE_FORM:
|
||||
events.Reset();
|
||||
events.SetPhase(1);
|
||||
events.ScheduleEvent(EVENT_CHECK_FRAYERS, 1000);
|
||||
events.ScheduleEvent(EVENT_TREE_FORM, 75000);
|
||||
events.ScheduleEvent(EVENT_RESTORE_COMBAT, 46000);
|
||||
|
||||
Talk(SAY_TREE);
|
||||
me->RemoveAllAuras();
|
||||
me->GetMotionMaster()->MoveIdle();
|
||||
me->GetMotionMaster()->Clear(false);
|
||||
|
||||
me->CastSpell(me, SPELL_SUMMON_FRAYER, true);
|
||||
me->CastSpell(me, SPELL_TRANQUILITY, true);
|
||||
me->CastSpell(me, SPELL_TREE_FORM, true);
|
||||
break;
|
||||
case EVENT_RESTORE_COMBAT:
|
||||
events.SetPhase(0);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SEEDLING, 6000);
|
||||
me->GetMotionMaster()->MoveChase(me->GetVictim());
|
||||
break;
|
||||
case EVENT_CHECK_FRAYERS:
|
||||
if (!summons.HasEntry(NPC_FRAYER))
|
||||
{
|
||||
me->InterruptNonMeleeSpells(true);
|
||||
me->RemoveAllAuras();
|
||||
events.RescheduleEvent(EVENT_RESTORE_COMBAT, 0);
|
||||
events.RescheduleEvent(EVENT_TREE_FORM, 30000);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_CHECK_FRAYERS, 500);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!events.IsInPhase(1))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_high_botanist_freywinnAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_high_botanist_freywinn()
|
||||
{
|
||||
new boss_high_botanist_freywinn();
|
||||
}
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "the_botanica.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_ALLERGIC_REACTION = 34697,
|
||||
SPELL_TELEPORT_SELF = 34673,
|
||||
|
||||
SPELL_SUMMON_LASHER_1 = 34681,
|
||||
SPELL_SUMMON_FLAYER_1 = 34682,
|
||||
SPELL_SUMMON_LASHER_2 = 34684,
|
||||
SPELL_SUMMON_FLAYER_2 = 34685,
|
||||
SPELL_SUMMON_LASHER_3 = 34686,
|
||||
SPELL_SUMMON_FLAYER_4 = 34687,
|
||||
SPELL_SUMMON_LASHER_4 = 34688,
|
||||
SPELL_SUMMON_FLAYER_3 = 34690,
|
||||
|
||||
SPELL_DAMAGE_IMMUNE_ARCANE = 34304,
|
||||
SPELL_DAMAGE_IMMUNE_FIRE = 34305,
|
||||
SPELL_DAMAGE_IMMUNE_FROST = 34306,
|
||||
SPELL_DAMAGE_IMMUNE_NATURE = 34308,
|
||||
SPELL_DAMAGE_IMMUNE_SHADOW = 34309
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
EMOTE_SUMMON = 0,
|
||||
MODEL_DEFAULT = 13109,
|
||||
MODEL_ARCANE = 14213,
|
||||
MODEL_FIRE = 13110,
|
||||
MODEL_FROST = 14112,
|
||||
MODEL_NATURE = 14214,
|
||||
|
||||
EVENT_ALERGIC_REACTION = 1,
|
||||
EVENT_TRANSFORM = 2,
|
||||
EVENT_TELEPORT = 3,
|
||||
EVENT_SUMMON = 4
|
||||
};
|
||||
|
||||
class boss_laj : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_laj() : CreatureScript("boss_laj") { }
|
||||
|
||||
struct boss_lajAI : public BossAI
|
||||
{
|
||||
boss_lajAI(Creature* creature) : BossAI(creature, DATA_LAJ) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
me->SetDisplayId(MODEL_DEFAULT);
|
||||
_lastTransform = SPELL_DAMAGE_IMMUNE_SHADOW;
|
||||
me->CastSpell(me, SPELL_DAMAGE_IMMUNE_SHADOW, true);
|
||||
}
|
||||
|
||||
void DoTransform()
|
||||
{
|
||||
me->RemoveAurasDueToSpell(_lastTransform);
|
||||
|
||||
switch (_lastTransform = RAND(SPELL_DAMAGE_IMMUNE_SHADOW, SPELL_DAMAGE_IMMUNE_FIRE, SPELL_DAMAGE_IMMUNE_FROST, SPELL_DAMAGE_IMMUNE_NATURE, SPELL_DAMAGE_IMMUNE_ARCANE))
|
||||
{
|
||||
case SPELL_DAMAGE_IMMUNE_SHADOW: me->SetDisplayId(MODEL_DEFAULT); break;
|
||||
case SPELL_DAMAGE_IMMUNE_ARCANE: me->SetDisplayId(MODEL_ARCANE); break;
|
||||
case SPELL_DAMAGE_IMMUNE_FIRE: me->SetDisplayId(MODEL_FIRE); break;
|
||||
case SPELL_DAMAGE_IMMUNE_FROST: me->SetDisplayId(MODEL_FROST); break;
|
||||
case SPELL_DAMAGE_IMMUNE_NATURE: me->SetDisplayId(MODEL_NATURE); break;
|
||||
}
|
||||
|
||||
me->CastSpell(me, _lastTransform, true);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
|
||||
events.ScheduleEvent(EVENT_ALERGIC_REACTION, 5000);
|
||||
events.ScheduleEvent(EVENT_TRANSFORM, 30000);
|
||||
events.ScheduleEvent(EVENT_TELEPORT, 20000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ALERGIC_REACTION:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ALLERGIC_REACTION, false);
|
||||
events.ScheduleEvent(EVENT_ALERGIC_REACTION, 25000);
|
||||
break;
|
||||
case EVENT_TELEPORT:
|
||||
me->CastSpell(me, SPELL_TELEPORT_SELF, false);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 2500);
|
||||
events.ScheduleEvent(EVENT_TELEPORT, 30000);
|
||||
break;
|
||||
case EVENT_SUMMON:
|
||||
Talk(EMOTE_SUMMON);
|
||||
me->CastSpell(me, SPELL_SUMMON_LASHER_1, true);
|
||||
me->CastSpell(me, SPELL_SUMMON_FLAYER_1, true);
|
||||
break;
|
||||
case EVENT_TRANSFORM:
|
||||
DoTransform();
|
||||
events.ScheduleEvent(EVENT_TRANSFORM, 35000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
uint32 _lastTransform;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_lajAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_laj()
|
||||
{
|
||||
new boss_laj();
|
||||
}
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "the_botanica.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_20_PERCENT_HP = 1,
|
||||
SAY_KILL = 2,
|
||||
SAY_CAST_SACRIFICE = 3,
|
||||
SAY_50_PERCENT_HP = 4,
|
||||
SAY_CAST_HELLFIRE = 5,
|
||||
SAY_DEATH = 6,
|
||||
EMOTE_ENRAGE = 7,
|
||||
SAY_INTRO = 8
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SACRIFICE = 34661,
|
||||
SPELL_HELLFIRE = 34659,
|
||||
SPELL_ENRAGE = 34670
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_SACRIFICE = 1,
|
||||
EVENT_HELLFIRE = 2,
|
||||
EVENT_ENRAGE = 3,
|
||||
EVENT_HEALTH_CHECK_50 = 4,
|
||||
EVENT_HEALTH_CHECK_20 = 5
|
||||
};
|
||||
|
||||
class boss_thorngrin_the_tender : public CreatureScript
|
||||
{
|
||||
public: boss_thorngrin_the_tender() : CreatureScript("thorngrin_the_tender") { }
|
||||
|
||||
struct boss_thorngrin_the_tenderAI : public BossAI
|
||||
{
|
||||
boss_thorngrin_the_tenderAI(Creature* creature) : BossAI(creature, DATA_THORNGRIN_THE_TENDER)
|
||||
{
|
||||
me->m_SightDistance = 100.0f;
|
||||
_intro = false;
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!_intro && who->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
_intro = true;
|
||||
Talk(SAY_INTRO);
|
||||
}
|
||||
BossAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_SACRIFICE, 6000);
|
||||
events.ScheduleEvent(EVENT_HELLFIRE, 18000);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 15000);
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK_50, 500);
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK_20, 500);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SACRIFICE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
|
||||
{
|
||||
Talk(SAY_CAST_SACRIFICE);
|
||||
me->CastSpell(target, SPELL_SACRIFICE, false);
|
||||
}
|
||||
events.ScheduleEvent(EVENT_SACRIFICE, 30000);
|
||||
break;
|
||||
case EVENT_HELLFIRE:
|
||||
if (roll_chance_i(50))
|
||||
Talk(SAY_CAST_HELLFIRE);
|
||||
me->CastSpell(me, SPELL_HELLFIRE, false);
|
||||
events.ScheduleEvent(EVENT_HELLFIRE, 22000);
|
||||
break;
|
||||
case EVENT_ENRAGE:
|
||||
Talk(EMOTE_ENRAGE);
|
||||
me->CastSpell(me, SPELL_ENRAGE, false);
|
||||
events.ScheduleEvent(EVENT_ENRAGE, 30000);
|
||||
break;
|
||||
case EVENT_HEALTH_CHECK_50:
|
||||
if (me->HealthBelowPct(50))
|
||||
{
|
||||
Talk(SAY_50_PERCENT_HP);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK_50, 500);
|
||||
break;
|
||||
case EVENT_HEALTH_CHECK_20:
|
||||
if (me->HealthBelowPct(20))
|
||||
{
|
||||
Talk(SAY_20_PERCENT_HP);
|
||||
break;
|
||||
}
|
||||
events.ScheduleEvent(EVENT_HEALTH_CHECK_20, 500);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
bool _intro;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_thorngrin_the_tenderAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_thorngrin_the_tender()
|
||||
{
|
||||
new boss_thorngrin_the_tender();
|
||||
}
|
||||
@@ -1,112 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "the_botanica.h"
|
||||
|
||||
enum Says
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SLAY = 1,
|
||||
SAY_SUMMON = 2,
|
||||
SAY_DEATH = 3
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_WAR_STOMP = 34716,
|
||||
SPELL_SUMMON_TREANTS = 34730, // 34727, 34730 - 34737, 34739
|
||||
SPELL_ARCANE_VOLLEY = 36705,
|
||||
|
||||
SPELL_SUMMON_SAPLINGS_SUMMON = 34730,
|
||||
SPELL_SUMMON_SAPLINGS_PERIODIC = 34741
|
||||
};
|
||||
|
||||
enum Misc
|
||||
{
|
||||
EVENT_ARCANE_VOLLEY = 1,
|
||||
EVENT_WAR_STOMP = 2,
|
||||
EVENT_SUMMON_TREANT = 3
|
||||
};
|
||||
|
||||
class boss_warp_splinter : public CreatureScript
|
||||
{
|
||||
public:
|
||||
|
||||
boss_warp_splinter() : CreatureScript("boss_warp_splinter") { }
|
||||
struct boss_warp_splinterAI : public BossAI
|
||||
{
|
||||
boss_warp_splinterAI(Creature* creature) : BossAI(creature, DATA_WARP_SPLINTER) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
events.ScheduleEvent(EVENT_ARCANE_VOLLEY, 8000);
|
||||
events.ScheduleEvent(EVENT_WAR_STOMP, 15000);
|
||||
events.ScheduleEvent(EVENT_SUMMON_TREANT, 20000);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_ARCANE_VOLLEY:
|
||||
me->CastSpell(me, SPELL_ARCANE_VOLLEY, false);
|
||||
events.ScheduleEvent(EVENT_ARCANE_VOLLEY, 20000);
|
||||
break;
|
||||
case EVENT_WAR_STOMP:
|
||||
me->CastSpell(me, SPELL_WAR_STOMP, false);
|
||||
events.ScheduleEvent(EVENT_WAR_STOMP, 30000);
|
||||
break;
|
||||
case EVENT_SUMMON_TREANT:
|
||||
Talk(SAY_SUMMON);
|
||||
me->CastSpell(me, SPELL_SUMMON_SAPLINGS_PERIODIC, true);
|
||||
for (uint8 i = 0; i < 6; ++i)
|
||||
me->CastSpell(me, SPELL_SUMMON_SAPLINGS_SUMMON+i, true);
|
||||
events.ScheduleEvent(EVENT_SUMMON_TREANT, 40000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_warp_splinterAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_warp_splinter()
|
||||
{
|
||||
new boss_warp_splinter();
|
||||
}
|
||||
|
||||
@@ -1,200 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "the_botanica.h"
|
||||
|
||||
class instance_the_botanica : public InstanceMapScript
|
||||
{
|
||||
public:
|
||||
instance_the_botanica() : InstanceMapScript("instance_the_botanica", 553) { }
|
||||
|
||||
struct instance_the_botanica_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_the_botanica_InstanceMapScript(Map* map) : InstanceScript(map)
|
||||
{
|
||||
SetBossNumber(MAX_ENCOUNTER);
|
||||
}
|
||||
|
||||
bool SetBossState(uint32 type, EncounterState state)
|
||||
{
|
||||
if (!InstanceScript::SetBossState(type, state))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
std::string GetSaveData()
|
||||
{
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "B O " << 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 == 'B' && dataHead2 == 'O')
|
||||
{
|
||||
for (uint32 i = 0; i < MAX_ENCOUNTER; ++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;
|
||||
}
|
||||
};
|
||||
|
||||
InstanceScript* GetInstanceScript(InstanceMap* map) const
|
||||
{
|
||||
return new instance_the_botanica_InstanceMapScript(map);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_botanica_call_of_the_falcon : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_botanica_call_of_the_falcon() : SpellScriptLoader("spell_botanica_call_of_the_falcon") { }
|
||||
|
||||
class spell_botanica_call_of_the_falcon_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_botanica_call_of_the_falcon_AuraScript)
|
||||
|
||||
bool Load()
|
||||
{
|
||||
_falconSet.clear();
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
std::list<Creature*> creatureList;
|
||||
GetUnitOwner()->GetCreaturesWithEntryInRange(creatureList, 80.0f, NPC_BLOODFALCON);
|
||||
for (std::list<Creature*>::const_iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
{
|
||||
(*itr)->TauntApply(GetUnitOwner());
|
||||
(*itr)->AddThreat(GetUnitOwner(), 10000000.0f);
|
||||
_falconSet.insert((*itr)->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
for (std::set<uint64>::const_iterator itr = _falconSet.begin(); itr != _falconSet.end(); ++itr)
|
||||
if (Creature* falcon = ObjectAccessor::GetCreature(*GetUnitOwner(), *itr))
|
||||
{
|
||||
falcon->TauntFadeOut(GetUnitOwner());
|
||||
falcon->AddThreat(GetUnitOwner(), -10000000.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectApply += AuraEffectApplyFn(spell_botanica_call_of_the_falcon_AuraScript::HandleEffectApply, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_botanica_call_of_the_falcon_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
|
||||
private:
|
||||
std::set<uint64> _falconSet;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_botanica_call_of_the_falcon_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_botanica_shift_form : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_botanica_shift_form() : SpellScriptLoader("spell_botanica_shift_form") { }
|
||||
|
||||
class spell_botanica_shift_form_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_botanica_shift_form_AuraScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
_lastSchool = 0;
|
||||
_lastForm = 0;
|
||||
_swapTime = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CheckProc(ProcEventInfo& eventInfo)
|
||||
{
|
||||
if (SpellInfo const* spellInfo = eventInfo.GetDamageInfo()->GetSpellInfo())
|
||||
{
|
||||
if ((spellInfo->GetSchoolMask() & _lastSchool) && _swapTime > time(NULL))
|
||||
return false;
|
||||
|
||||
uint32 form = 0;
|
||||
switch (GetFirstSchoolInMask(spellInfo->GetSchoolMask()))
|
||||
{
|
||||
case SPELL_SCHOOL_FIRE: form = SPELL_FIRE_FORM; break;
|
||||
case SPELL_SCHOOL_FROST: form = SPELL_FROST_FORM; break;
|
||||
case SPELL_SCHOOL_ARCANE: form = SPELL_ARCANE_FORM; break;
|
||||
case SPELL_SCHOOL_SHADOW: form = SPELL_SHADOW_FORM; break;
|
||||
}
|
||||
|
||||
if (form)
|
||||
{
|
||||
_swapTime = time(NULL) + 6;
|
||||
_lastSchool = spellInfo->GetSchoolMask();
|
||||
GetUnitOwner()->RemoveAurasDueToSpell(_lastForm);
|
||||
_lastForm = form;
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), _lastForm, true);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoCheckProc += AuraCheckProcFn(spell_botanica_shift_form_AuraScript::CheckProc);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 _lastSchool;
|
||||
uint32 _lastForm;
|
||||
uint32 _swapTime;
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_botanica_shift_form_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_instance_the_botanica()
|
||||
{
|
||||
new instance_the_botanica();
|
||||
new spell_botanica_call_of_the_falcon();
|
||||
new spell_botanica_shift_form();
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
REWRITTEN BY XINEF
|
||||
*/
|
||||
|
||||
#ifndef DEF_THE_BOTANICA_H
|
||||
#define DEF_THE_BOTANICA_H
|
||||
|
||||
enum DataTypes
|
||||
{
|
||||
DATA_COMMANDER_SARANNIS = 0,
|
||||
DATA_HIGH_BOTANIST_FREYWINN = 1,
|
||||
DATA_THORNGRIN_THE_TENDER = 2,
|
||||
DATA_LAJ = 3,
|
||||
DATA_WARP_SPLINTER = 4,
|
||||
MAX_ENCOUNTER = 5
|
||||
};
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NPC_COMMANDER_SARANNIS = 17976,
|
||||
NPC_HIGH_BOTANIST_FREYWINN = 17975,
|
||||
NPC_THORNGRIN_THE_TENDER = 17978,
|
||||
NPC_LAJ = 17980,
|
||||
NPC_WARP_SPLINTER = 17977,
|
||||
|
||||
NPC_BLOODFALCON = 18155
|
||||
};
|
||||
|
||||
enum SpellIds
|
||||
{
|
||||
SPELL_ARCANE_FORM = 34204,
|
||||
SPELL_FIRE_FORM = 34203,
|
||||
SPELL_FROST_FORM = 34202,
|
||||
SPELL_SHADOW_FORM = 34205
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,229 +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/>.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellScript.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
SAY_INTRO = 0,
|
||||
SAY_AGGRO = 1,
|
||||
SAY_SURPREME = 2,
|
||||
SAY_KILL = 3,
|
||||
SAY_DEATH = 4,
|
||||
EMOTE_FRENZY = 5,
|
||||
SAY_RAND = 6
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SHADOW_VOLLEY = 32963,
|
||||
SPELL_CLEAVE = 31779,
|
||||
SPELL_THUNDERCLAP = 36706,
|
||||
SPELL_VOID_BOLT = 39329,
|
||||
SPELL_MARK_OF_KAZZAK = 32960,
|
||||
SPELL_MARK_OF_KAZZAK_DAMAGE = 32961,
|
||||
SPELL_ENRAGE = 32964,
|
||||
SPELL_CAPTURE_SOUL = 32966,
|
||||
SPELL_TWISTED_REFLECTION = 21063,
|
||||
SPELL_BERSERK = 32965,
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_SHADOW_VOLLEY = 1,
|
||||
EVENT_CLEAVE = 2,
|
||||
EVENT_THUNDERCLAP = 3,
|
||||
EVENT_VOID_BOLT = 4,
|
||||
EVENT_MARK_OF_KAZZAK = 5,
|
||||
EVENT_ENRAGE = 6,
|
||||
EVENT_TWISTED_REFLECTION = 7,
|
||||
EVENT_BERSERK = 8
|
||||
};
|
||||
|
||||
class boss_doomlord_kazzak : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_doomlord_kazzak() : CreatureScript("boss_doomlord_kazzak") { }
|
||||
|
||||
struct boss_doomlordkazzakAI : public ScriptedAI
|
||||
{
|
||||
boss_doomlordkazzakAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_events.Reset();
|
||||
_events.ScheduleEvent(EVENT_SHADOW_VOLLEY, urand(6000, 10000));
|
||||
_events.ScheduleEvent(EVENT_CLEAVE, 7000);
|
||||
_events.ScheduleEvent(EVENT_THUNDERCLAP, urand(14000, 18000));
|
||||
_events.ScheduleEvent(EVENT_VOID_BOLT, 30000);
|
||||
_events.ScheduleEvent(EVENT_MARK_OF_KAZZAK, 25000);
|
||||
_events.ScheduleEvent(EVENT_ENRAGE, 60000);
|
||||
_events.ScheduleEvent(EVENT_TWISTED_REFLECTION, 33000);
|
||||
_events.ScheduleEvent(EVENT_BERSERK, 180000);
|
||||
}
|
||||
|
||||
void JustRespawned()
|
||||
{
|
||||
Talk(SAY_INTRO);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
// When Kazzak kills a player (not pets/totems), he regens some health
|
||||
if (victim->GetTypeId() != TYPEID_PLAYER)
|
||||
return;
|
||||
|
||||
DoCast(me, SPELL_CAPTURE_SOUL);
|
||||
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
// Return since we have no target
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_SHADOW_VOLLEY:
|
||||
DoCastVictim(SPELL_SHADOW_VOLLEY);
|
||||
_events.ScheduleEvent(EVENT_SHADOW_VOLLEY, urand(4000, 6000));
|
||||
break;
|
||||
case EVENT_CLEAVE:
|
||||
DoCastVictim(SPELL_CLEAVE);
|
||||
_events.ScheduleEvent(EVENT_CLEAVE, urand(8000, 12000));
|
||||
break;
|
||||
case EVENT_THUNDERCLAP:
|
||||
DoCastVictim(SPELL_THUNDERCLAP);
|
||||
_events.ScheduleEvent(EVENT_THUNDERCLAP, urand(10000, 14000));
|
||||
break;
|
||||
case EVENT_VOID_BOLT:
|
||||
DoCastVictim(SPELL_VOID_BOLT);
|
||||
_events.ScheduleEvent(EVENT_VOID_BOLT, urand(15000, 18000));
|
||||
break;
|
||||
case EVENT_MARK_OF_KAZZAK:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, PowerUsersSelector(me, POWER_MANA, 100.0f, true)))
|
||||
DoCast(target, SPELL_MARK_OF_KAZZAK);
|
||||
_events.ScheduleEvent(EVENT_MARK_OF_KAZZAK, 20000);
|
||||
break;
|
||||
case EVENT_ENRAGE:
|
||||
Talk(EMOTE_FRENZY);
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
_events.ScheduleEvent(EVENT_ENRAGE, 30000);
|
||||
break;
|
||||
case EVENT_TWISTED_REFLECTION:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0.0f, true))
|
||||
DoCast(target, SPELL_TWISTED_REFLECTION);
|
||||
_events.ScheduleEvent(EVENT_TWISTED_REFLECTION, 15000);
|
||||
break;
|
||||
case EVENT_BERSERK:
|
||||
DoCast(me, SPELL_BERSERK);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_doomlordkazzakAI (creature);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_mark_of_kazzak : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_mark_of_kazzak() : SpellScriptLoader("spell_mark_of_kazzak") { }
|
||||
|
||||
class spell_mark_of_kazzak_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_mark_of_kazzak_AuraScript);
|
||||
|
||||
bool Validate(SpellInfo const* /*spell*/)
|
||||
{
|
||||
if (!sSpellMgr->GetSpellInfo(SPELL_MARK_OF_KAZZAK_DAMAGE))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void CalculateAmount(AuraEffect const* /*aurEff*/, int32& amount, bool& /*canBeRecalculated*/)
|
||||
{
|
||||
if (Unit* owner = GetUnitOwner())
|
||||
amount = CalculatePct(owner->GetPower(POWER_MANA), 5);
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
|
||||
if (target->GetPower(POWER_MANA) == 0)
|
||||
{
|
||||
target->CastSpell(target, SPELL_MARK_OF_KAZZAK_DAMAGE, true, NULL, aurEff);
|
||||
// Remove aura
|
||||
SetDuration(0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
DoEffectCalcAmount += AuraEffectCalcAmountFn(spell_mark_of_kazzak_AuraScript::CalculateAmount, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_mark_of_kazzak_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_MANA_LEECH);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mark_of_kazzak_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_doomlordkazzak()
|
||||
{
|
||||
new boss_doomlord_kazzak();
|
||||
new spell_mark_of_kazzak();
|
||||
}
|
||||
@@ -1,170 +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/>.
|
||||
*/
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
|
||||
enum Texts
|
||||
{
|
||||
SAY_AGGRO = 0,
|
||||
SAY_EARTHQUAKE = 1,
|
||||
SAY_OVERRUN = 2,
|
||||
SAY_SLAY = 3,
|
||||
SAY_DEATH = 4
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_EARTHQUAKE = 32686,
|
||||
SPELL_SUNDER_ARMOR = 33661,
|
||||
SPELL_CHAIN_LIGHTNING = 33665,
|
||||
SPELL_OVERRUN = 32636,
|
||||
SPELL_ENRAGE = 33653,
|
||||
SPELL_MARK_DEATH = 37128,
|
||||
SPELL_AURA_DEATH = 37131
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_ENRAGE = 1,
|
||||
EVENT_ARMOR = 2,
|
||||
EVENT_CHAIN = 3,
|
||||
EVENT_QUAKE = 4,
|
||||
EVENT_OVERRUN = 5
|
||||
};
|
||||
|
||||
class boss_doomwalker : public CreatureScript
|
||||
{
|
||||
public:
|
||||
boss_doomwalker() : CreatureScript("boss_doomwalker") { }
|
||||
|
||||
struct boss_doomwalkerAI : public ScriptedAI
|
||||
{
|
||||
boss_doomwalkerAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
_events.Reset();
|
||||
_events.ScheduleEvent(EVENT_ENRAGE, 0);
|
||||
_events.ScheduleEvent(EVENT_ARMOR, urand(5000, 13000));
|
||||
_events.ScheduleEvent(EVENT_CHAIN, urand(10000, 30000));
|
||||
_events.ScheduleEvent(EVENT_QUAKE, urand(25000, 35000));
|
||||
_events.ScheduleEvent(EVENT_OVERRUN, urand(30000, 45000));
|
||||
_inEnrage = false;
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
victim->CastSpell(victim, SPELL_MARK_DEATH, 0);
|
||||
|
||||
if (urand(0, 4))
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsValidAttackTarget(who))
|
||||
if (who->HasAura(SPELL_MARK_DEATH,0) && !who->HasAura(27827)) // Spirit of Redemption
|
||||
who->CastSpell(who, SPELL_AURA_DEATH, 1);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = _events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_ENRAGE:
|
||||
if (!HealthAbovePct(20))
|
||||
{
|
||||
DoCast(me, SPELL_ENRAGE);
|
||||
_events.ScheduleEvent(EVENT_ENRAGE, 6000);
|
||||
_inEnrage = true;
|
||||
}
|
||||
break;
|
||||
case EVENT_OVERRUN:
|
||||
Talk(SAY_OVERRUN);
|
||||
DoCastVictim(SPELL_OVERRUN);
|
||||
_events.ScheduleEvent(EVENT_OVERRUN, urand(25000, 40000));
|
||||
break;
|
||||
case EVENT_QUAKE:
|
||||
if (urand(0, 1))
|
||||
return;
|
||||
|
||||
Talk(SAY_EARTHQUAKE);
|
||||
|
||||
//remove enrage before casting earthquake because enrage + earthquake = 16000dmg over 8sec and all dead
|
||||
if (_inEnrage)
|
||||
me->RemoveAurasDueToSpell(SPELL_ENRAGE);
|
||||
|
||||
DoCast(me, SPELL_EARTHQUAKE);
|
||||
_events.ScheduleEvent(EVENT_QUAKE, urand(30000, 55000));
|
||||
break;
|
||||
case EVENT_CHAIN:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0.0f, true))
|
||||
DoCast(target, SPELL_CHAIN_LIGHTNING);
|
||||
_events.ScheduleEvent(EVENT_CHAIN, urand(7000, 27000));
|
||||
break;
|
||||
case EVENT_ARMOR:
|
||||
DoCastVictim(SPELL_SUNDER_ARMOR);
|
||||
_events.ScheduleEvent(EVENT_ARMOR, urand(10000, 25000));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap _events;
|
||||
bool _inEnrage;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new boss_doomwalkerAI (creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_doomwalker()
|
||||
{
|
||||
new boss_doomwalker();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,409 +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: Hellfire_Peninsula
|
||||
SD%Complete: 100
|
||||
SDComment: Quest support: 9375, 9410, 9418, 10129, 10146, 10162, 10163, 10340, 10346, 10347, 10382 (Special flight paths) "Needs update"
|
||||
SDCategory: Hellfire Peninsula
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_aeranas
|
||||
npc_ancestral_wolf
|
||||
npc_wounded_blood_elf
|
||||
npc_fel_guard_hound
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
// Ours
|
||||
|
||||
class spell_q10935_the_exorcism_of_colonel_jules : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q10935_the_exorcism_of_colonel_jules() : SpellScriptLoader("spell_q10935_the_exorcism_of_colonel_jules") { }
|
||||
|
||||
class spell_q10935_the_exorcism_of_colonel_jules_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q10935_the_exorcism_of_colonel_jules_SpellScript);
|
||||
|
||||
void HandleDummy(SpellEffIndex effIndex)
|
||||
{
|
||||
PreventHitDefaultEffect(effIndex);
|
||||
Creature* target = GetHitCreature();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
if (GetCaster()->IsHostileTo(target))
|
||||
GetCaster()->CastSpell(target, 39323 /*SPELL_HOLY_FIRE*/, true);
|
||||
else
|
||||
GetCaster()->CastSpell(target, 39322 /*SPELL_HEAL_BARADA*/, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_q10935_the_exorcism_of_colonel_jules_SpellScript::HandleDummy, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q10935_the_exorcism_of_colonel_jules_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Theirs
|
||||
/*######
|
||||
## npc_aeranas
|
||||
######*/
|
||||
|
||||
enum Aeranas
|
||||
{
|
||||
SAY_SUMMON = 0,
|
||||
SAY_FREE = 1,
|
||||
FACTION_HOSTILE = 16,
|
||||
FACTION_FRIENDLY = 35,
|
||||
SPELL_ENVELOPING_WINDS = 15535,
|
||||
SPELL_SHOCK = 12553
|
||||
};
|
||||
|
||||
class npc_aeranas : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_aeranas() : CreatureScript("npc_aeranas") { }
|
||||
|
||||
struct npc_aeranasAI : public ScriptedAI
|
||||
{
|
||||
npc_aeranasAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
faction_Timer = 8000;
|
||||
envelopingWinds_Timer = 9000;
|
||||
shock_Timer = 5000;
|
||||
|
||||
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->setFaction(FACTION_FRIENDLY);
|
||||
|
||||
Talk(SAY_SUMMON);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (faction_Timer)
|
||||
{
|
||||
if (faction_Timer <= diff)
|
||||
{
|
||||
me->setFaction(FACTION_HOSTILE);
|
||||
faction_Timer = 0;
|
||||
} else faction_Timer -= diff;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (HealthBelowPct(30))
|
||||
{
|
||||
me->setFaction(FACTION_FRIENDLY);
|
||||
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(true);
|
||||
Talk(SAY_FREE);
|
||||
return;
|
||||
}
|
||||
|
||||
if (shock_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SHOCK);
|
||||
shock_Timer = 10000;
|
||||
} else shock_Timer -= diff;
|
||||
|
||||
if (envelopingWinds_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_ENVELOPING_WINDS);
|
||||
envelopingWinds_Timer = 25000;
|
||||
} else envelopingWinds_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 faction_Timer;
|
||||
uint32 envelopingWinds_Timer;
|
||||
uint32 shock_Timer;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_aeranasAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_ancestral_wolf
|
||||
######*/
|
||||
|
||||
enum AncestralWolf
|
||||
{
|
||||
EMOTE_WOLF_LIFT_HEAD = 0,
|
||||
EMOTE_WOLF_HOWL = 1,
|
||||
SAY_WOLF_WELCOME = 2,
|
||||
SPELL_ANCESTRAL_WOLF_BUFF = 29981,
|
||||
NPC_RYGA = 17123
|
||||
};
|
||||
|
||||
class npc_ancestral_wolf : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_ancestral_wolf() : CreatureScript("npc_ancestral_wolf") { }
|
||||
|
||||
struct npc_ancestral_wolfAI : public npc_escortAI
|
||||
{
|
||||
npc_ancestral_wolfAI(Creature* creature) : npc_escortAI(creature)
|
||||
{
|
||||
if (creature->GetOwner() && creature->GetOwner()->GetTypeId() == TYPEID_PLAYER)
|
||||
Start(false, true, creature->GetOwner()->GetGUID());
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ryga = NULL;
|
||||
me->CastSpell(me, SPELL_ANCESTRAL_WOLF_BUFF, false);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
|
||||
{
|
||||
if (!ryga && who->GetEntry() == NPC_RYGA && me->IsWithinDistInMap(who, 15.0f))
|
||||
if (Creature* temp = who->ToCreature())
|
||||
ryga = temp;
|
||||
|
||||
npc_escortAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
me->CastSpell(me, SPELL_ANCESTRAL_WOLF_BUFF, false);
|
||||
switch (waypointId)
|
||||
{
|
||||
case 0:
|
||||
Talk(EMOTE_WOLF_LIFT_HEAD);
|
||||
break;
|
||||
case 2:
|
||||
Talk(EMOTE_WOLF_HOWL);
|
||||
break;
|
||||
case 50:
|
||||
if (ryga && ryga->IsAlive() && !ryga->IsInCombat())
|
||||
ryga->AI()->Talk(SAY_WOLF_WELCOME);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
Creature* ryga;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_ancestral_wolfAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_wounded_blood_elf
|
||||
######*/
|
||||
|
||||
enum WoundedBloodElf
|
||||
{
|
||||
SAY_ELF_START = 0,
|
||||
SAY_ELF_SUMMON1 = 1,
|
||||
SAY_ELF_RESTING = 2,
|
||||
SAY_ELF_SUMMON2 = 3,
|
||||
SAY_ELF_COMPLETE = 4,
|
||||
SAY_ELF_AGGRO = 5,
|
||||
QUEST_ROAD_TO_FALCON_WATCH = 9375,
|
||||
NPC_HAALESHI_WINDWALKER = 16966,
|
||||
NPC_HAALESHI_TALONGUARD = 16967,
|
||||
FACTION_FALCON_WATCH_QUEST = 775
|
||||
};
|
||||
|
||||
class npc_wounded_blood_elf : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_wounded_blood_elf() : CreatureScript("npc_wounded_blood_elf") { }
|
||||
|
||||
struct npc_wounded_blood_elfAI : public npc_escortAI
|
||||
{
|
||||
npc_wounded_blood_elfAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void Reset() { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
if (HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
Talk(SAY_ELF_AGGRO);
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
summoned->AI()->AttackStart(me);
|
||||
}
|
||||
|
||||
void sQuestAccept(Player* player, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ROAD_TO_FALCON_WATCH)
|
||||
{
|
||||
me->setFaction(FACTION_FALCON_WATCH_QUEST);
|
||||
npc_escortAI::Start(true, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 0:
|
||||
Talk(SAY_ELF_START, player);
|
||||
break;
|
||||
case 9:
|
||||
Talk(SAY_ELF_SUMMON1, player);
|
||||
// Spawn two Haal'eshi Talonguard
|
||||
DoSpawnCreature(NPC_HAALESHI_TALONGUARD, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
DoSpawnCreature(NPC_HAALESHI_TALONGUARD, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
break;
|
||||
case 13:
|
||||
Talk(SAY_ELF_RESTING, player);
|
||||
break;
|
||||
case 14:
|
||||
Talk(SAY_ELF_SUMMON2, player);
|
||||
// Spawn two Haal'eshi Windwalker
|
||||
DoSpawnCreature(NPC_HAALESHI_WINDWALKER, -15, -15, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
DoSpawnCreature(NPC_HAALESHI_WINDWALKER, -17, -17, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000);
|
||||
break;
|
||||
case 27:
|
||||
Talk(SAY_ELF_COMPLETE, player);
|
||||
// Award quest credit
|
||||
player->GroupEventHappens(QUEST_ROAD_TO_FALCON_WATCH, me);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_wounded_blood_elfAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_fel_guard_hound
|
||||
######*/
|
||||
|
||||
enum FelGuard
|
||||
{
|
||||
SPELL_SUMMON_POO = 37688,
|
||||
NPC_DERANGED_HELBOAR = 16863
|
||||
};
|
||||
|
||||
class npc_fel_guard_hound : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_fel_guard_hound() : CreatureScript("npc_fel_guard_hound") { }
|
||||
|
||||
struct npc_fel_guard_houndAI : public ScriptedAI
|
||||
{
|
||||
npc_fel_guard_houndAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset()
|
||||
{
|
||||
checkTimer = 5000; //check for creature every 5 sec
|
||||
helboarGUID = 0;
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type != POINT_MOTION_TYPE || id != 1)
|
||||
return;
|
||||
|
||||
if (Creature* helboar = ObjectAccessor::GetCreature(*me, helboarGUID))
|
||||
{
|
||||
helboar->RemoveCorpse();
|
||||
DoCast(SPELL_SUMMON_POO);
|
||||
|
||||
if (Player* owner = me->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
me->GetMotionMaster()->MoveFollow(owner, 0.0f, 0.0f);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (checkTimer <= diff)
|
||||
{
|
||||
if (Creature* helboar = me->FindNearestCreature(NPC_DERANGED_HELBOAR, 10.0f, false))
|
||||
{
|
||||
if (helboar->GetGUID() != helboarGUID && me->GetMotionMaster()->GetCurrentMovementGeneratorType() != POINT_MOTION_TYPE && !me->FindCurrentSpellBySpellId(SPELL_SUMMON_POO))
|
||||
{
|
||||
helboarGUID = helboar->GetGUID();
|
||||
me->GetMotionMaster()->MovePoint(1, helboar->GetPositionX(), helboar->GetPositionY(), helboar->GetPositionZ());
|
||||
}
|
||||
}
|
||||
checkTimer = 5000;
|
||||
}
|
||||
else checkTimer -= diff;
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 checkTimer;
|
||||
uint64 helboarGUID;
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_fel_guard_houndAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_hellfire_peninsula()
|
||||
{
|
||||
// Ours
|
||||
new spell_q10935_the_exorcism_of_colonel_jules();
|
||||
|
||||
// Theirs
|
||||
new npc_aeranas();
|
||||
new npc_ancestral_wolf();
|
||||
new npc_wounded_blood_elf();
|
||||
new npc_fel_guard_hound();
|
||||
}
|
||||
@@ -1,610 +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: Nagrand
|
||||
SD%Complete: 90
|
||||
SDComment: Quest support: 9868, 9874, 10085. TextId's unknown for altruis_the_sufferer and greatmother_geyah (npc_text)
|
||||
SDCategory: Nagrand
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_maghar_captive
|
||||
npc_creditmarker_visit_with_ancestors
|
||||
EndContentData */
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "Player.h"
|
||||
#include "SpellInfo.h"
|
||||
|
||||
/*#####
|
||||
## npc_maghar_captive
|
||||
#####*/
|
||||
|
||||
enum MagharCaptive
|
||||
{
|
||||
SAY_MAG_START = 0,
|
||||
SAY_MAG_NO_ESCAPE = 0,
|
||||
SAY_MAG_MORE = 1,
|
||||
SAY_MAG_MORE_REPLY = 0,
|
||||
SAY_MAG_LIGHTNING = 2,
|
||||
SAY_MAG_SHOCK = 3,
|
||||
SAY_MAG_COMPLETE = 4,
|
||||
|
||||
SPELL_CHAIN_LIGHTNING = 16006,
|
||||
SPELL_EARTHBIND_TOTEM = 15786,
|
||||
SPELL_FROST_SHOCK = 12548,
|
||||
SPELL_HEALING_WAVE = 12491,
|
||||
|
||||
QUEST_TOTEM_KARDASH_H = 9868,
|
||||
|
||||
NPC_MURK_RAIDER = 18203,
|
||||
NPC_MURK_BRUTE = 18211,
|
||||
NPC_MURK_SCAVENGER = 18207,
|
||||
NPC_MURK_PUTRIFIER = 18202
|
||||
};
|
||||
|
||||
static float m_afAmbushA[]= {-1568.805786f, 8533.873047f, 1.958f};
|
||||
static float m_afAmbushB[]= {-1491.554321f, 8506.483398f, 1.248f};
|
||||
|
||||
class npc_maghar_captive : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_maghar_captive() : CreatureScript("npc_maghar_captive") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_TOTEM_KARDASH_H)
|
||||
{
|
||||
if (npc_maghar_captiveAI* EscortAI = dynamic_cast<npc_maghar_captiveAI*>(creature->AI()))
|
||||
{
|
||||
creature->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
creature->setFaction(232);
|
||||
EscortAI->Start(true, false, player->GetGUID(), quest);
|
||||
creature->AI()->Talk(SAY_MAG_START);
|
||||
|
||||
creature->SummonCreature(NPC_MURK_RAIDER, m_afAmbushA[0]+2.5f, m_afAmbushA[1]-2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
creature->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushA[0]-2.5f, m_afAmbushA[1]+2.5f, m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
creature->SummonCreature(NPC_MURK_BRUTE, m_afAmbushA[0], m_afAmbushA[1], m_afAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_maghar_captiveAI(creature);
|
||||
}
|
||||
|
||||
struct npc_maghar_captiveAI : public npc_escortAI
|
||||
{
|
||||
npc_maghar_captiveAI(Creature* creature) : npc_escortAI(creature) { Reset(); }
|
||||
|
||||
uint32 ChainLightningTimer;
|
||||
uint32 HealTimer;
|
||||
uint32 FrostShockTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ChainLightningTimer = 1000;
|
||||
HealTimer = 0;
|
||||
FrostShockTimer = 6000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoCast(me, SPELL_EARTHBIND_TOTEM, false);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
return;
|
||||
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_TOTEM_KARDASH_H) != QUEST_STATUS_COMPLETE)
|
||||
player->FailQuest(QUEST_TOTEM_KARDASH_H);
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
switch (waypointId)
|
||||
{
|
||||
case 7:
|
||||
Talk(SAY_MAG_MORE);
|
||||
|
||||
if (Creature* temp = me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0], m_afAmbushB[1], m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
|
||||
temp->AI()->Talk(SAY_MAG_MORE_REPLY);
|
||||
|
||||
me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
break;
|
||||
case 16:
|
||||
Talk(SAY_MAG_COMPLETE);
|
||||
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
player->GroupEventHappens(QUEST_TOTEM_KARDASH_H, me);
|
||||
|
||||
SetRun();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
if (summoned->GetEntry() == NPC_MURK_BRUTE)
|
||||
summoned->AI()->Talk(SAY_MAG_NO_ESCAPE);
|
||||
|
||||
if (summoned->IsTotem())
|
||||
return;
|
||||
|
||||
summoned->SetWalk(false);
|
||||
summoned->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
|
||||
summoned->AI()->AttackStart(me);
|
||||
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_CHAIN_LIGHTNING)
|
||||
{
|
||||
if (rand()%10)
|
||||
return;
|
||||
|
||||
Talk(SAY_MAG_LIGHTNING);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (ChainLightningTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_CHAIN_LIGHTNING);
|
||||
ChainLightningTimer = urand(7000, 14000);
|
||||
}
|
||||
else
|
||||
ChainLightningTimer -= diff;
|
||||
|
||||
if (HealthBelowPct(30))
|
||||
{
|
||||
if (HealTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_HEALING_WAVE);
|
||||
HealTimer = 5000;
|
||||
}
|
||||
else
|
||||
HealTimer -= diff;
|
||||
}
|
||||
|
||||
if (FrostShockTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FROST_SHOCK);
|
||||
FrostShockTimer = urand(7500, 15000);
|
||||
}
|
||||
else
|
||||
FrostShockTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_creditmarker_visist_with_ancestors
|
||||
######*/
|
||||
|
||||
class npc_creditmarker_visit_with_ancestors : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_creditmarker_visit_with_ancestors() : CreatureScript("npc_creditmarker_visit_with_ancestors") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_creditmarker_visit_with_ancestorsAI(creature);
|
||||
}
|
||||
|
||||
struct npc_creditmarker_visit_with_ancestorsAI : public ScriptedAI
|
||||
{
|
||||
npc_creditmarker_visit_with_ancestorsAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() { }
|
||||
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
|
||||
{
|
||||
if (!who)
|
||||
return;
|
||||
|
||||
Player* player = who->ToPlayer();
|
||||
if (player && player->GetQuestStatus(10085) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
uint32 creditMarkerId = me->GetEntry();
|
||||
if (creditMarkerId >= 18840 && creditMarkerId <= 18843)
|
||||
{
|
||||
// 18840: Sunspring, 18841: Laughing, 18842: Garadar, 18843: Bleeding
|
||||
if (!player->GetReqKillOrCastCurrentCount(10085, creditMarkerId))
|
||||
player->KilledMonsterCredit(creditMarkerId, me->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## go_corkis_prison and npc_corki
|
||||
######*/
|
||||
|
||||
enum CorkiData
|
||||
{
|
||||
// first quest
|
||||
QUEST_HELP = 9923,
|
||||
NPC_CORKI = 18445,
|
||||
NPC_CORKI_CREDIT_1 = 18369,
|
||||
GO_CORKIS_PRISON = 182349,
|
||||
CORKI_SAY_THANKS = 0,
|
||||
// 2nd quest
|
||||
QUEST_CORKIS_GONE_MISSING_AGAIN = 9924,
|
||||
NPC_CORKI_2 = 20812,
|
||||
GO_CORKIS_PRISON_2 = 182350,
|
||||
CORKI_SAY_PROMISE = 0,
|
||||
// 3rd quest
|
||||
QUEST_CHOWAR_THE_PILLAGER = 9955,
|
||||
NPC_CORKI_3 = 18369,
|
||||
NPC_CORKI_CREDIT_3 = 18444,
|
||||
GO_CORKIS_PRISON_3 = 182521,
|
||||
CORKI_SAY_LAST = 0
|
||||
};
|
||||
|
||||
class go_corkis_prison : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_corkis_prison() : GameObjectScript("go_corkis_prison") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
if (go->GetEntry() == GO_CORKIS_PRISON)
|
||||
{
|
||||
if (Creature* corki = go->FindNearestCreature(NPC_CORKI, 25, true))
|
||||
{
|
||||
corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+5, go->GetPositionY(), go->GetPositionZ());
|
||||
if (player)
|
||||
player->KilledMonsterCredit(NPC_CORKI_CREDIT_1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (go->GetEntry() == GO_CORKIS_PRISON_2)
|
||||
{
|
||||
if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true))
|
||||
{
|
||||
corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()-5, go->GetPositionY(), go->GetPositionZ());
|
||||
if (player)
|
||||
player->KilledMonsterCredit(NPC_CORKI_2, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (go->GetEntry() == GO_CORKIS_PRISON_3)
|
||||
{
|
||||
if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true))
|
||||
{
|
||||
corki->GetMotionMaster()->MovePoint(1, go->GetPositionX()+4, go->GetPositionY(), go->GetPositionZ());
|
||||
if (player)
|
||||
player->KilledMonsterCredit(NPC_CORKI_CREDIT_3, 0);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
class npc_corki : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_corki() : CreatureScript("npc_corki") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_corkiAI(creature);
|
||||
}
|
||||
|
||||
struct npc_corkiAI : public ScriptedAI
|
||||
{
|
||||
npc_corkiAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 Say_Timer;
|
||||
bool ReleasedFromCage;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Say_Timer = 5000;
|
||||
ReleasedFromCage = false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (ReleasedFromCage)
|
||||
{
|
||||
if (Say_Timer <= diff)
|
||||
{
|
||||
me->DespawnOrUnsummon();
|
||||
ReleasedFromCage = false;
|
||||
}
|
||||
else
|
||||
Say_Timer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
void MovementInform(uint32 type, uint32 id)
|
||||
{
|
||||
if (type == POINT_MOTION_TYPE && id == 1)
|
||||
{
|
||||
Say_Timer = 5000;
|
||||
ReleasedFromCage = true;
|
||||
if (me->GetEntry() == NPC_CORKI)
|
||||
Talk(CORKI_SAY_THANKS);
|
||||
if (me->GetEntry() == NPC_CORKI_2)
|
||||
Talk(CORKI_SAY_PROMISE);
|
||||
if (me->GetEntry() == NPC_CORKI_3)
|
||||
Talk(CORKI_SAY_LAST);
|
||||
}
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
/*#####
|
||||
## npc_kurenai_captive
|
||||
#####*/
|
||||
|
||||
enum KurenaiCaptive
|
||||
{
|
||||
SAY_KUR_START = 0,
|
||||
SAY_KUR_NO_ESCAPE = 1,
|
||||
SAY_KUR_MORE = 2,
|
||||
SAY_KUR_MORE_TWO = 3,
|
||||
SAY_KUR_LIGHTNING = 4,
|
||||
SAY_KUR_SHOCK = 5,
|
||||
SAY_KUR_COMPLETE = 6,
|
||||
|
||||
SPELL_KUR_CHAIN_LIGHTNING = 16006,
|
||||
SPELL_KUR_EARTHBIND_TOTEM = 15786,
|
||||
SPELL_KUR_FROST_SHOCK = 12548,
|
||||
SPELL_KUR_HEALING_WAVE = 12491,
|
||||
|
||||
QUEST_TOTEM_KARDASH_A = 9879,
|
||||
|
||||
NPC_KUR_MURK_RAIDER = 18203,
|
||||
NPC_KUR_MURK_BRUTE = 18211,
|
||||
NPC_KUR_MURK_SCAVENGER = 18207,
|
||||
NPC_KUR_MURK_PUTRIFIER = 18202,
|
||||
};
|
||||
|
||||
static float kurenaiAmbushA[]= {-1520.6f, 8468.4f, -4.1f};
|
||||
static float kurenaiAmbushB[]= {-1491.554321f, 8506.483398f, 1.248f};
|
||||
|
||||
class npc_kurenai_captive : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_kurenai_captive() : CreatureScript("npc_kurenai_captive") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_TOTEM_KARDASH_A)
|
||||
creature->AI()->SetGUID(player->GetGUID(), quest->GetQuestId());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_kurenai_captiveAI(creature);
|
||||
}
|
||||
|
||||
struct npc_kurenai_captiveAI : public npc_escortAI
|
||||
{
|
||||
npc_kurenai_captiveAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
uint32 ChainLightningTimer;
|
||||
uint32 HealTimer;
|
||||
uint32 FrostShockTimer;
|
||||
|
||||
void SetGUID(uint64 guid, int32 questId)
|
||||
{
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
Start(true, false, guid);
|
||||
Talk(SAY_KUR_START);
|
||||
|
||||
me->SummonCreature(NPC_KUR_MURK_RAIDER, kurenaiAmbushA[0]+2.5f, kurenaiAmbushA[1]-2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000);
|
||||
me->SummonCreature(NPC_KUR_MURK_BRUTE, kurenaiAmbushA[0]-2.5f, kurenaiAmbushA[1]+2.5f, kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000);
|
||||
me->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushA[0], kurenaiAmbushA[1], kurenaiAmbushA[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 50000);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
ChainLightningTimer = 1000;
|
||||
HealTimer = 0;
|
||||
FrostShockTimer = 6000;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
DoCast(me, SPELL_KUR_EARTHBIND_TOTEM, false);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (!HasEscortState(STATE_ESCORT_ESCORTING))
|
||||
return;
|
||||
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_TOTEM_KARDASH_A) != QUEST_STATUS_COMPLETE)
|
||||
player->FailQuest(QUEST_TOTEM_KARDASH_A);
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
switch (waypointId)
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
Talk(SAY_KUR_MORE);
|
||||
|
||||
if (Creature* cr = me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0], kurenaiAmbushB[1], kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000))
|
||||
cr->AI()->Talk(SAY_KUR_MORE_TWO);
|
||||
|
||||
me->SummonCreature(NPC_KUR_MURK_PUTRIFIER, kurenaiAmbushB[0]-2.5f, kurenaiAmbushB[1]-2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
me->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushB[0]+2.5f, kurenaiAmbushB[1]+2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
me->SummonCreature(NPC_KUR_MURK_SCAVENGER, kurenaiAmbushB[0]+2.5f, kurenaiAmbushB[1]-2.5f, kurenaiAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
break;
|
||||
}
|
||||
case 7:
|
||||
{
|
||||
Talk(SAY_KUR_COMPLETE);
|
||||
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
player->GroupEventHappens(QUEST_TOTEM_KARDASH_A, me);
|
||||
|
||||
SetRun();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
if (summoned->GetEntry() == NPC_KUR_MURK_BRUTE)
|
||||
summoned->AI()->Talk(SAY_KUR_NO_ESCAPE);
|
||||
|
||||
// This function is for when we summoned enemies to fight - so that does NOT mean we should make our totem count in this!
|
||||
if (summoned->IsTotem())
|
||||
return;
|
||||
|
||||
summoned->AI()->AttackStart(me);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* /*target*/, const SpellInfo* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_KUR_CHAIN_LIGHTNING)
|
||||
{
|
||||
if (rand()%30)
|
||||
return;
|
||||
|
||||
Talk(SAY_KUR_LIGHTNING);
|
||||
}
|
||||
|
||||
if (spell->Id == SPELL_KUR_FROST_SHOCK)
|
||||
{
|
||||
if (rand()%30)
|
||||
return;
|
||||
|
||||
Talk(SAY_KUR_SHOCK);
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateEscortAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
if (ChainLightningTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_KUR_CHAIN_LIGHTNING);
|
||||
ChainLightningTimer = urand(7000, 14000);
|
||||
} else ChainLightningTimer -= diff;
|
||||
|
||||
if (HealthBelowPct(30))
|
||||
{
|
||||
if (HealTimer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_KUR_HEALING_WAVE);
|
||||
HealTimer = 5000;
|
||||
} else HealTimer -= diff;
|
||||
}
|
||||
|
||||
if (FrostShockTimer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_KUR_FROST_SHOCK);
|
||||
FrostShockTimer = urand(7500, 15000);
|
||||
} else FrostShockTimer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## go_warmaul_prison
|
||||
######*/
|
||||
|
||||
enum FindingTheSurvivorsData
|
||||
{
|
||||
QUEST_FINDING_THE_SURVIVORS = 9948,
|
||||
NPC_MAGHAR_PRISONER = 18428,
|
||||
|
||||
SAY_FREE = 0,
|
||||
};
|
||||
|
||||
class go_warmaul_prison : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_warmaul_prison() : GameObjectScript("go_warmaul_prison") { }
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
go->UseDoorOrButton();
|
||||
if (player->GetQuestStatus(QUEST_FINDING_THE_SURVIVORS) != QUEST_STATUS_INCOMPLETE)
|
||||
return false;
|
||||
|
||||
if (Creature* prisoner = go->FindNearestCreature(NPC_MAGHAR_PRISONER, 5.0f))
|
||||
{
|
||||
player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0);
|
||||
|
||||
prisoner->AI()->Talk(SAY_FREE, player);
|
||||
prisoner->DespawnOrUnsummon(6000);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_nagrand()
|
||||
{
|
||||
new npc_maghar_captive();
|
||||
new npc_creditmarker_visit_with_ancestors();
|
||||
new npc_corki();
|
||||
new go_corkis_prison();
|
||||
new npc_kurenai_captive();
|
||||
new go_warmaul_prison();
|
||||
}
|
||||
@@ -1,981 +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: Netherstorm
|
||||
SD%Complete: 80
|
||||
SDComment: Quest support: 10337, 10438, 10652 (special flight paths), 10198, 10191
|
||||
SDCategory: Netherstorm
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_commander_dawnforge
|
||||
npc_bessy
|
||||
npc_maxx_a_million
|
||||
go_captain_tyralius_prison
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "Player.h"
|
||||
#include "GameObjectAI.h"
|
||||
|
||||
// Ours
|
||||
enum saeed
|
||||
{
|
||||
NPC_PROTECTORATE_AVENGER = 21805,
|
||||
NPC_PROTECTORATE_DEFENDER = 20984,
|
||||
NPC_DIMENSIUS = 19554,
|
||||
|
||||
EVENT_START_WALK = 1,
|
||||
EVENT_START_FIGHT1 = 2,
|
||||
EVENT_START_FIGHT2 = 3,
|
||||
|
||||
DATA_START_ENCOUNTER = 1,
|
||||
DATA_START_FIGHT = 2,
|
||||
|
||||
SAY_SAEED_0 = 0,
|
||||
SAY_SAEED_1 = 1,
|
||||
SAY_SAEED_2 = 2,
|
||||
SAY_SAEED_3 = 3,
|
||||
SAY_DIMENSISIUS_1 = 1,
|
||||
|
||||
QUEST_DIMENSIUS_DEVOURING = 10439,
|
||||
|
||||
SPELL_DIMENSIUS_TRANSFORM = 35939
|
||||
};
|
||||
|
||||
class npc_captain_saeed : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_captain_saeed() : CreatureScript("npc_captain_saeed") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_captain_saeedAI(creature);
|
||||
}
|
||||
|
||||
struct npc_captain_saeedAI : public npc_escortAI
|
||||
{
|
||||
npc_captain_saeedAI(Creature* creature) : npc_escortAI(creature), summons(me) {}
|
||||
|
||||
SummonList summons;
|
||||
EventMap events;
|
||||
bool started, fight;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
if (!summons.empty())
|
||||
{
|
||||
for (std::list<uint64>::iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*me, *itr))
|
||||
{
|
||||
float x, y, z, o;
|
||||
cr->GetRespawnPosition(x, y, z, &o);
|
||||
cr->SetHomePosition(x, y, z, o);
|
||||
}
|
||||
}
|
||||
events.Reset();
|
||||
summons.clear();
|
||||
started = false;
|
||||
fight = false;
|
||||
me->RestoreFaction();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
if (me->GetDistance(who) < 10.0f && !me->GetVictim())
|
||||
if (player->IsValidAttackTarget(who))
|
||||
{
|
||||
AttackStart(who);
|
||||
return;
|
||||
}
|
||||
|
||||
npc_escortAI::MoveInLineOfSight(who);
|
||||
}
|
||||
|
||||
void SetGUID(uint64 playerGUID, int32 type)
|
||||
{
|
||||
if (type == DATA_START_ENCOUNTER)
|
||||
{
|
||||
Start(true, true, playerGUID);
|
||||
SetEscortPaused(true);
|
||||
started = true;
|
||||
|
||||
std::list<Creature*> cl;
|
||||
me->GetCreaturesWithEntryInRange(cl, 20.0f, NPC_PROTECTORATE_AVENGER);
|
||||
for (std::list<Creature*>::iterator itr = cl.begin(); itr != cl.end(); ++itr)
|
||||
{
|
||||
summons.Summon(*itr);
|
||||
(*itr)->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
|
||||
(*itr)->setFaction(250);
|
||||
}
|
||||
cl.clear();
|
||||
me->GetCreaturesWithEntryInRange(cl, 20.0f, NPC_PROTECTORATE_DEFENDER);
|
||||
for (std::list<Creature*>::iterator itr = cl.begin(); itr != cl.end(); ++itr)
|
||||
{
|
||||
summons.Summon(*itr);
|
||||
(*itr)->HandleEmoteCommand(EMOTE_ONESHOT_ROAR);
|
||||
(*itr)->setFaction(250);
|
||||
}
|
||||
|
||||
me->setFaction(250);
|
||||
Talk(SAY_SAEED_0);
|
||||
events.ScheduleEvent(EVENT_START_WALK, 3000);
|
||||
}
|
||||
else if (type == DATA_START_FIGHT)
|
||||
{
|
||||
Talk(SAY_SAEED_2);
|
||||
SetEscortPaused(false);
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterEvadeMode()
|
||||
{
|
||||
if (fight)
|
||||
SetEscortPaused(false);
|
||||
|
||||
SummonsAction(NULL);
|
||||
npc_escortAI::EnterEvadeMode();
|
||||
}
|
||||
|
||||
void SummonsAction(Unit* who)
|
||||
{
|
||||
float i = 0;
|
||||
for (std::list<uint64>::iterator itr = summons.begin(); itr != summons.end(); ++itr, i += 1.0f)
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*me, *itr))
|
||||
{
|
||||
if (who == NULL)
|
||||
{
|
||||
cr->GetMotionMaster()->Clear(false);
|
||||
cr->GetMotionMaster()->MoveFollow(me, 2.0f, M_PI/2.0f + (i / summons.size() * M_PI));
|
||||
}
|
||||
else
|
||||
{
|
||||
cr->SetHomePosition(cr->GetPositionX(), cr->GetPositionY(), cr->GetPositionZ(), cr->GetOrientation());
|
||||
cr->AI()->AttackStart(who);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 i)
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 16:
|
||||
Talk(SAY_SAEED_1);
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
|
||||
SetEscortPaused(true);
|
||||
break;
|
||||
case 18:
|
||||
events.ScheduleEvent(EVENT_START_FIGHT1, 0);
|
||||
SetEscortPaused(true);
|
||||
break;
|
||||
case 19:
|
||||
summons.DespawnAll();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
SummonsAction(who);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (player)
|
||||
player->FailQuest(QUEST_DIMENSIUS_DEVOURING);
|
||||
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void CorpseRemoved(uint32&)
|
||||
{
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 data) const
|
||||
{
|
||||
if (data == 1)
|
||||
return (uint32)started;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(diff);
|
||||
|
||||
events.Update(diff);
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_START_WALK:
|
||||
SummonsAction(NULL);
|
||||
SetEscortPaused(false);
|
||||
break;
|
||||
case EVENT_START_FIGHT1:
|
||||
Talk(SAY_SAEED_3);
|
||||
events.ScheduleEvent(EVENT_START_FIGHT2, 3000);
|
||||
break;
|
||||
case EVENT_START_FIGHT2:
|
||||
if (Creature* dimensius = me->FindNearestCreature(NPC_DIMENSIUS, 50.0f))
|
||||
{
|
||||
dimensius->RemoveAurasDueToSpell(SPELL_DIMENSIUS_TRANSFORM);
|
||||
dimensius->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE);
|
||||
AttackStart(dimensius);
|
||||
fight = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
creature->AI()->SetGUID(player->GetGUID(), DATA_START_ENCOUNTER);
|
||||
player->KilledMonsterCredit(creature->GetEntry(), 0);
|
||||
}
|
||||
else if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
|
||||
{
|
||||
creature->AI()->SetGUID(player->GetGUID(), DATA_START_FIGHT);
|
||||
}
|
||||
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (player->GetQuestStatus(QUEST_DIMENSIUS_DEVOURING) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
if (!creature->AI()->GetData(1))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Let's move out.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
else
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Let's start the battle.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
}
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Theirs
|
||||
/*######
|
||||
## npc_commander_dawnforge
|
||||
######*/
|
||||
|
||||
// The Speech of Dawnforge, Ardonis & Pathaleon
|
||||
enum CommanderDawnforgeData
|
||||
{
|
||||
SAY_COMMANDER_DAWNFORGE_1 = 0,
|
||||
SAY_COMMANDER_DAWNFORGE_2 = 1,
|
||||
SAY_COMMANDER_DAWNFORGE_3 = 2,
|
||||
SAY_COMMANDER_DAWNFORGE_4 = 3,
|
||||
SAY_COMMANDER_DAWNFORGE_5 = 4,
|
||||
|
||||
SAY_ARCANIST_ARDONIS_1 = 0,
|
||||
SAY_ARCANIST_ARDONIS_2 = 1,
|
||||
|
||||
SAY_PATHALEON_CULATOR_IMAGE_1 = 0,
|
||||
SAY_PATHALEON_CULATOR_IMAGE_2 = 1,
|
||||
SAY_PATHALEON_CULATOR_IMAGE_2_1 = 2,
|
||||
SAY_PATHALEON_CULATOR_IMAGE_2_2 = 3,
|
||||
|
||||
QUEST_INFO_GATHERING = 10198,
|
||||
SPELL_SUNFURY_DISGUISE = 34603,
|
||||
};
|
||||
|
||||
// Entries of Arcanist Ardonis, Commander Dawnforge, Pathaleon the Curators Image
|
||||
const uint32 CreatureEntry[3] =
|
||||
{
|
||||
19830, // Ardonis
|
||||
19831, // Dawnforge
|
||||
21504 // Pathaleon
|
||||
};
|
||||
|
||||
class npc_commander_dawnforge : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_commander_dawnforge() : CreatureScript("npc_commander_dawnforge") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_commander_dawnforgeAI(creature);
|
||||
}
|
||||
|
||||
struct npc_commander_dawnforgeAI : public ScriptedAI
|
||||
{
|
||||
npc_commander_dawnforgeAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint64 PlayerGUID;
|
||||
uint64 ardonisGUID;
|
||||
uint64 pathaleonGUID;
|
||||
|
||||
uint32 Phase;
|
||||
uint32 PhaseSubphase;
|
||||
uint32 Phase_Timer;
|
||||
bool isEvent;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
PlayerGUID = 0;
|
||||
ardonisGUID = 0;
|
||||
pathaleonGUID = 0;
|
||||
|
||||
Phase = 1;
|
||||
PhaseSubphase = 0;
|
||||
Phase_Timer = 4000;
|
||||
isEvent = false;
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
pathaleonGUID = summoned->GetGUID();
|
||||
}
|
||||
|
||||
// Emote Ardonis and Pathaleon
|
||||
void Turn_to_Pathaleons_Image()
|
||||
{
|
||||
Creature* ardonis = ObjectAccessor::GetCreature(*me, ardonisGUID);
|
||||
Creature* pathaleon = ObjectAccessor::GetCreature(*me, pathaleonGUID);
|
||||
|
||||
if (!ardonis || !pathaleon)
|
||||
return;
|
||||
|
||||
// Turn Dawnforge
|
||||
me->SetFacingToObject(pathaleon);
|
||||
|
||||
// Turn Ardonis
|
||||
ardonis->SetFacingToObject(pathaleon);
|
||||
|
||||
//Set them to kneel
|
||||
me->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
ardonis->SetStandState(UNIT_STAND_STATE_KNEEL);
|
||||
}
|
||||
|
||||
//Set them back to each other
|
||||
void Turn_to_eachother()
|
||||
{
|
||||
if (Unit* ardonis = ObjectAccessor::GetUnit(*me, ardonisGUID))
|
||||
{
|
||||
// Turn Dawnforge
|
||||
me->SetFacingToObject(ardonis);
|
||||
|
||||
// Turn Ardonis
|
||||
ardonis->SetFacingToObject(me);
|
||||
|
||||
//Set state
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
ardonis->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
}
|
||||
}
|
||||
|
||||
bool CanStartEvent(Player* player)
|
||||
{
|
||||
if (!isEvent)
|
||||
{
|
||||
Creature* ardonis = me->FindNearestCreature(CreatureEntry[0], 10.0f);
|
||||
if (!ardonis)
|
||||
return false;
|
||||
|
||||
ardonisGUID = ardonis->GetGUID();
|
||||
PlayerGUID = player->GetGUID();
|
||||
|
||||
isEvent = true;
|
||||
|
||||
Turn_to_eachother();
|
||||
return true;
|
||||
}
|
||||
|
||||
;//sLog->outDebug(LOG_FILTER_TSCR, "TSCR: npc_commander_dawnforge event already in progress, need to wait.");
|
||||
return false;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
//Is event even running?
|
||||
if (!isEvent)
|
||||
return;
|
||||
|
||||
//Phase timing
|
||||
if (Phase_Timer >= diff)
|
||||
{
|
||||
Phase_Timer -= diff;
|
||||
return;
|
||||
}
|
||||
|
||||
Creature* ardonis = ObjectAccessor::GetCreature(*me, ardonisGUID);
|
||||
Creature* pathaleon = ObjectAccessor::GetCreature(*me, pathaleonGUID);
|
||||
Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID);
|
||||
|
||||
if (!ardonis || !player)
|
||||
{
|
||||
Reset();
|
||||
return;
|
||||
}
|
||||
|
||||
if (Phase > 4 && !pathaleon)
|
||||
{
|
||||
Reset();
|
||||
return;
|
||||
}
|
||||
|
||||
//Phase 1 Dawnforge say
|
||||
switch (Phase)
|
||||
{
|
||||
case 1:
|
||||
Talk(SAY_COMMANDER_DAWNFORGE_1);
|
||||
++Phase;
|
||||
Phase_Timer = 16000;
|
||||
break;
|
||||
//Phase 2 Ardonis say
|
||||
case 2:
|
||||
ardonis->AI()->Talk(SAY_ARCANIST_ARDONIS_1);
|
||||
++Phase;
|
||||
Phase_Timer = 16000;
|
||||
break;
|
||||
//Phase 3 Dawnforge say
|
||||
case 3:
|
||||
Talk(SAY_COMMANDER_DAWNFORGE_2);
|
||||
++Phase;
|
||||
Phase_Timer = 16000;
|
||||
break;
|
||||
//Phase 4 Pathaleon spawns up to phase 9
|
||||
case 4:
|
||||
//spawn pathaleon's image
|
||||
me->SummonCreature(CreatureEntry[2], 2325.851563f, 2799.534668f, 133.084229f, 6.038996f, TEMPSUMMON_TIMED_DESPAWN, 90000);
|
||||
++Phase;
|
||||
Phase_Timer = 500;
|
||||
break;
|
||||
//Phase 5 Pathaleon say
|
||||
case 5:
|
||||
pathaleon->AI()->Talk(SAY_PATHALEON_CULATOR_IMAGE_1);
|
||||
++Phase;
|
||||
Phase_Timer = 6000;
|
||||
break;
|
||||
//Phase 6
|
||||
case 6:
|
||||
switch (PhaseSubphase)
|
||||
{
|
||||
//Subphase 1: Turn Dawnforge and Ardonis
|
||||
case 0:
|
||||
Turn_to_Pathaleons_Image();
|
||||
++PhaseSubphase;
|
||||
Phase_Timer = 8000;
|
||||
break;
|
||||
//Subphase 2 Dawnforge say
|
||||
case 1:
|
||||
Talk(SAY_COMMANDER_DAWNFORGE_3);
|
||||
PhaseSubphase = 0;
|
||||
++Phase;
|
||||
Phase_Timer = 8000;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
//Phase 7 Pathaleons say 3 Sentence, every sentence need a subphase
|
||||
case 7:
|
||||
switch (PhaseSubphase)
|
||||
{
|
||||
//Subphase 1
|
||||
case 0:
|
||||
pathaleon->AI()->Talk(SAY_PATHALEON_CULATOR_IMAGE_2);
|
||||
++PhaseSubphase;
|
||||
Phase_Timer = 12000;
|
||||
break;
|
||||
//Subphase 2
|
||||
case 1:
|
||||
pathaleon->AI()->Talk(SAY_PATHALEON_CULATOR_IMAGE_2_1);
|
||||
++PhaseSubphase;
|
||||
Phase_Timer = 16000;
|
||||
break;
|
||||
//Subphase 3
|
||||
case 2:
|
||||
pathaleon->AI()->Talk(SAY_PATHALEON_CULATOR_IMAGE_2_2);
|
||||
PhaseSubphase = 0;
|
||||
++Phase;
|
||||
Phase_Timer = 10000;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
//Phase 8 Dawnforge & Ardonis say
|
||||
case 8:
|
||||
Talk(SAY_COMMANDER_DAWNFORGE_4);
|
||||
ardonis->AI()->Talk(SAY_ARCANIST_ARDONIS_2);
|
||||
++Phase;
|
||||
Phase_Timer = 4000;
|
||||
break;
|
||||
//Phase 9 Pathaleons Despawn, Reset Dawnforge & Ardonis angle
|
||||
case 9:
|
||||
Turn_to_eachother();
|
||||
//hide pathaleon, unit will despawn shortly
|
||||
pathaleon->SetVisible(false);
|
||||
PhaseSubphase = 0;
|
||||
++Phase;
|
||||
Phase_Timer = 3000;
|
||||
break;
|
||||
//Phase 10 Dawnforge say
|
||||
case 10:
|
||||
Talk(SAY_COMMANDER_DAWNFORGE_5);
|
||||
player->AreaExploredOrEventHappens(QUEST_INFO_GATHERING);
|
||||
Reset();
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
class at_commander_dawnforge : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_commander_dawnforge() : AreaTriggerScript("at_commander_dawnforge") { }
|
||||
|
||||
bool OnTrigger(Player* player, const AreaTriggerEntry* /*at*/)
|
||||
{
|
||||
//if player lost aura or not have at all, we should not try start event.
|
||||
if (!player->HasAura(SPELL_SUNFURY_DISGUISE))
|
||||
return false;
|
||||
|
||||
if (player->IsAlive() && player->GetQuestStatus(QUEST_INFO_GATHERING) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
Creature* Dawnforge = player->FindNearestCreature(CreatureEntry[1], 30.0f);
|
||||
if (!Dawnforge)
|
||||
return false;
|
||||
|
||||
if (CAST_AI(npc_commander_dawnforge::npc_commander_dawnforgeAI, Dawnforge->AI())->CanStartEvent(player))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_professor_dabiri
|
||||
######*/
|
||||
enum ProfessorDabiriData
|
||||
{
|
||||
SPELL_PHASE_DISTRUPTOR = 35780,
|
||||
|
||||
//WHISPER_DABIRI = 0, not existing in database
|
||||
|
||||
QUEST_DIMENSIUS = 10439,
|
||||
QUEST_ON_NETHERY_WINGS = 10438,
|
||||
};
|
||||
|
||||
#define GOSSIP_ITEM "I need a new phase distruptor, Professor"
|
||||
|
||||
class npc_professor_dabiri : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_professor_dabiri() : CreatureScript("npc_professor_dabiri") { }
|
||||
|
||||
//OnQuestAccept:
|
||||
//if (quest->GetQuestId() == QUEST_DIMENSIUS)
|
||||
//creature->AI()->Talk(WHISPER_DABIRI, player);
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
creature->CastSpell(player, SPELL_PHASE_DISTRUPTOR, false);
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (player->GetQuestStatus(QUEST_ON_NETHERY_WINGS) == QUEST_STATUS_INCOMPLETE && !player->HasItemCount(29778))
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_phase_hunter
|
||||
######*/
|
||||
|
||||
enum PhaseHunterData
|
||||
{
|
||||
QUEST_RECHARGING_THE_BATTERIES = 10190,
|
||||
|
||||
NPC_PHASE_HUNTER_ENTRY = 18879,
|
||||
NPC_DRAINED_PHASE_HUNTER_ENTRY = 19595,
|
||||
|
||||
EMOTE_WEAK = 0,
|
||||
|
||||
// Spells
|
||||
SPELL_RECHARGING_BATTERY = 34219,
|
||||
SPELL_PHASE_SLIP = 36574,
|
||||
SPELL_MANA_BURN = 13321,
|
||||
SPELL_MATERIALIZE = 34804,
|
||||
SPELL_DE_MATERIALIZE = 34814,
|
||||
};
|
||||
|
||||
class npc_phase_hunter : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_phase_hunter() : CreatureScript("npc_phase_hunter") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_phase_hunterAI(creature);
|
||||
}
|
||||
|
||||
struct npc_phase_hunterAI : public ScriptedAI
|
||||
{
|
||||
npc_phase_hunterAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
bool Weak;
|
||||
bool Materialize;
|
||||
bool Drained;
|
||||
uint8 WeakPercent;
|
||||
|
||||
uint64 PlayerGUID;
|
||||
|
||||
uint32 ManaBurnTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Weak = false;
|
||||
Materialize = false;
|
||||
Drained = false;
|
||||
WeakPercent = 25 + (rand() % 16); // 25-40
|
||||
|
||||
PlayerGUID = 0;
|
||||
|
||||
ManaBurnTimer = 5000 + (rand() % 3 * 1000); // 5-8 sec cd
|
||||
|
||||
if (me->GetEntry() == NPC_DRAINED_PHASE_HUNTER_ENTRY)
|
||||
me->UpdateEntry(NPC_PHASE_HUNTER_ENTRY);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* who)
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
PlayerGUID = who->GetGUID();
|
||||
}
|
||||
|
||||
//void SpellHit(Unit* /*caster*/, const SpellInfo* /*spell*/)
|
||||
//{
|
||||
// DoCast(me, SPELL_DE_MATERIALIZE);
|
||||
//}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!Materialize)
|
||||
{
|
||||
DoCast(me, SPELL_MATERIALIZE);
|
||||
Materialize = true;
|
||||
}
|
||||
|
||||
if (me->HasAuraType(SPELL_AURA_MOD_DECREASE_SPEED) || me->HasUnitState(UNIT_STATE_ROOT)) // if the mob is rooted/slowed by spells eg.: Entangling Roots, Frost Nova, Hamstring, Crippling Poison, etc. => remove it
|
||||
DoCast(me, SPELL_PHASE_SLIP);
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
// some code to cast spell Mana Burn on random target which has mana
|
||||
if (ManaBurnTimer <= diff)
|
||||
{
|
||||
std::list<HostileReference*> AggroList = me->getThreatManager().getThreatList();
|
||||
std::list<Unit*> UnitsWithMana;
|
||||
|
||||
for (std::list<HostileReference*>::const_iterator itr = AggroList.begin(); itr != AggroList.end(); ++itr)
|
||||
{
|
||||
if (Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid()))
|
||||
{
|
||||
if (unit->GetCreateMana() > 0)
|
||||
UnitsWithMana.push_back(unit);
|
||||
}
|
||||
}
|
||||
if (!UnitsWithMana.empty())
|
||||
{
|
||||
DoCast(Trinity::Containers::SelectRandomContainerElement(UnitsWithMana), SPELL_MANA_BURN);
|
||||
ManaBurnTimer = 8000 + (rand() % 10 * 1000); // 8-18 sec cd
|
||||
}
|
||||
else
|
||||
ManaBurnTimer = 3500;
|
||||
} else ManaBurnTimer -= diff;
|
||||
|
||||
if (Player* player = ObjectAccessor::GetPlayer(*me, PlayerGUID)) // start: support for quest 10190
|
||||
{
|
||||
if (!Weak && HealthBelowPct(WeakPercent)
|
||||
&& player->GetQuestStatus(QUEST_RECHARGING_THE_BATTERIES) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
Talk(EMOTE_WEAK);
|
||||
Weak = true;
|
||||
}
|
||||
if (Weak && !Drained && me->HasAura(SPELL_RECHARGING_BATTERY))
|
||||
{
|
||||
Drained = true;
|
||||
int32 uHpPct = int32(me->GetHealthPct());
|
||||
|
||||
me->UpdateEntry(NPC_DRAINED_PHASE_HUNTER_ENTRY);
|
||||
|
||||
me->SetHealth(me->CountPctFromMaxHealth(uHpPct));
|
||||
me->LowerPlayerDamageReq(me->GetMaxHealth() - me->GetHealth());
|
||||
me->SetInCombatWith(player);
|
||||
}
|
||||
} // end: support for quest 10190
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_bessy
|
||||
######*/
|
||||
enum BessyData
|
||||
{
|
||||
Q_ALMABTRIEB = 10337,
|
||||
N_THADELL = 20464,
|
||||
SPAWN_FIRST = 20512,
|
||||
SPAWN_SECOND = 19881,
|
||||
SAY_THADELL_1 = 0,
|
||||
SAY_THADELL_2 = 1,
|
||||
SAY_BESSY_0 = 0,
|
||||
SAY_BESSY_1 = 1
|
||||
};
|
||||
|
||||
class npc_bessy : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_bessy() : CreatureScript("npc_bessy") { }
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == Q_ALMABTRIEB)
|
||||
{
|
||||
creature->setFaction(113);
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
creature->AI()->Talk(SAY_BESSY_0);
|
||||
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_bessyAI(creature);
|
||||
}
|
||||
|
||||
struct npc_bessyAI : public npc_escortAI
|
||||
{
|
||||
npc_bessyAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
player->FailQuest(Q_ALMABTRIEB);
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 3: //first spawn
|
||||
Talk(SAY_BESSY_1);
|
||||
me->SummonCreature(SPAWN_FIRST, 2449.67f, 2183.11f, 96.85f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
me->SummonCreature(SPAWN_FIRST, 2449.53f, 2184.43f, 96.36f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
me->SummonCreature(SPAWN_FIRST, 2449.85f, 2186.34f, 97.57f, 6.08f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
break;
|
||||
case 7:
|
||||
Talk(SAY_BESSY_1);
|
||||
me->SummonCreature(SPAWN_SECOND, 2309.64f, 2186.24f, 92.25f, 6.06f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
me->SummonCreature(SPAWN_SECOND, 2309.25f, 2183.46f, 91.75f, 6.22f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
|
||||
break;
|
||||
case 12:
|
||||
player->GroupEventHappens(Q_ALMABTRIEB, me);
|
||||
if (me->FindNearestCreature(N_THADELL, 30))
|
||||
Talk(SAY_THADELL_1);
|
||||
break;
|
||||
case 13:
|
||||
if (me->FindNearestCreature(N_THADELL, 30))
|
||||
Talk(SAY_THADELL_2, player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustSummoned(Creature* summoned)
|
||||
{
|
||||
summoned->AI()->AttackStart(me);
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->RestoreFaction();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_maxx_a_million
|
||||
######*/
|
||||
|
||||
enum MaxxAMillion
|
||||
{
|
||||
QUEST_MARK_V_IS_ALIVE = 10191,
|
||||
GO_DRAENEI_MACHINE = 183771
|
||||
};
|
||||
|
||||
class npc_maxx_a_million_escort : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_maxx_a_million_escort() : CreatureScript("npc_maxx_a_million_escort") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_maxx_a_million_escortAI(creature);
|
||||
}
|
||||
|
||||
struct npc_maxx_a_million_escortAI : public npc_escortAI
|
||||
{
|
||||
npc_maxx_a_million_escortAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
bool bTake;
|
||||
uint32 uiTakeTimer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
bTake=false;
|
||||
uiTakeTimer=3000;
|
||||
}
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 7:
|
||||
case 17:
|
||||
case 29:
|
||||
//Find Object and "work"
|
||||
if (GetClosestGameObjectWithEntry(me, GO_DRAENEI_MACHINE, INTERACTION_DISTANCE))
|
||||
{
|
||||
// take the GO -> animation
|
||||
me->HandleEmoteCommand(EMOTE_STATE_LOOT);
|
||||
SetEscortPaused(true);
|
||||
bTake=true;
|
||||
}
|
||||
break;
|
||||
case 36: //return and quest_complete
|
||||
player->CompleteQuest(QUEST_MARK_V_IS_ALIVE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
player->FailQuest(QUEST_MARK_V_IS_ALIVE);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 uiDiff)
|
||||
{
|
||||
npc_escortAI::UpdateAI(uiDiff);
|
||||
|
||||
if (bTake)
|
||||
{
|
||||
if (uiTakeTimer < uiDiff)
|
||||
{
|
||||
me->HandleEmoteCommand(EMOTE_STATE_NONE);
|
||||
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_DRAENEI_MACHINE, INTERACTION_DISTANCE))
|
||||
{
|
||||
SetEscortPaused(false);
|
||||
bTake=false;
|
||||
uiTakeTimer = 3000;
|
||||
go->Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
uiTakeTimer -= uiDiff;
|
||||
}
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, const Quest* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_MARK_V_IS_ALIVE)
|
||||
{
|
||||
if (npc_maxx_a_million_escortAI* pEscortAI = CAST_AI(npc_maxx_a_million_escort::npc_maxx_a_million_escortAI, creature->AI()))
|
||||
{
|
||||
creature->setFaction(113);
|
||||
pEscortAI->Start(false, false, player->GetGUID());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_netherstorm()
|
||||
{
|
||||
// Ours
|
||||
new npc_captain_saeed();
|
||||
|
||||
// Theirs
|
||||
new npc_commander_dawnforge();
|
||||
new at_commander_dawnforge();
|
||||
new npc_professor_dabiri();
|
||||
new npc_phase_hunter();
|
||||
new npc_bessy();
|
||||
new npc_maxx_a_million_escort();
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,475 +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: Shattrath_City
|
||||
SD%Complete: 100
|
||||
SDComment: Quest support: 10004, 10009, 10211. Flask vendors, Teleport to Caverns of Time
|
||||
SDCategory: Shattrath City
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_raliq_the_drunk
|
||||
npc_salsalabim
|
||||
npc_shattrathflaskvendors
|
||||
npc_zephyr
|
||||
npc_kservant
|
||||
npc_ishanah
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
/*######
|
||||
## npc_raliq_the_drunk
|
||||
######*/
|
||||
|
||||
#define GOSSIP_RALIQ "You owe Sim'salabim money. Hand them over or die!"
|
||||
|
||||
enum Raliq
|
||||
{
|
||||
SPELL_UPPERCUT = 10966,
|
||||
QUEST_CRACK_SKULLS = 10009,
|
||||
FACTION_HOSTILE_RD = 45
|
||||
};
|
||||
|
||||
class npc_raliq_the_drunk : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_raliq_the_drunk() : CreatureScript("npc_raliq_the_drunk") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
creature->setFaction(FACTION_HOSTILE_RD);
|
||||
creature->AI()->AttackStart(player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_RALIQ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(9440, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_raliq_the_drunkAI(creature);
|
||||
}
|
||||
|
||||
struct npc_raliq_the_drunkAI : public ScriptedAI
|
||||
{
|
||||
npc_raliq_the_drunkAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
m_uiNormFaction = creature->getFaction();
|
||||
}
|
||||
|
||||
uint32 m_uiNormFaction;
|
||||
uint32 Uppercut_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Uppercut_Timer = 5000;
|
||||
me->RestoreFaction();
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Uppercut_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_UPPERCUT);
|
||||
Uppercut_Timer = 15000;
|
||||
} else Uppercut_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
# npc_salsalabim
|
||||
######*/
|
||||
|
||||
enum Salsalabim
|
||||
{
|
||||
// Factions
|
||||
FACTION_HOSTILE_SA = 90,
|
||||
FACTION_FRIENDLY_SA = 35,
|
||||
|
||||
// Quests
|
||||
QUEST_10004 = 10004,
|
||||
|
||||
// Spells
|
||||
SPELL_MAGNETIC_PULL = 31705
|
||||
|
||||
};
|
||||
|
||||
class npc_salsalabim : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_salsalabim() : CreatureScript("npc_salsalabim") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_10004) == QUEST_STATUS_INCOMPLETE)
|
||||
{
|
||||
creature->setFaction(FACTION_HOSTILE_SA);
|
||||
creature->AI()->AttackStart(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_salsalabimAI(creature);
|
||||
}
|
||||
|
||||
struct npc_salsalabimAI : public ScriptedAI
|
||||
{
|
||||
npc_salsalabimAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
uint32 MagneticPull_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
MagneticPull_Timer = 15000;
|
||||
me->RestoreFaction();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* done_by, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
// xinef: some corrections
|
||||
if (done_by)
|
||||
if (Player* player = done_by->GetCharmerOrOwnerPlayerOrPlayerItself())
|
||||
if (me->HealthBelowPctDamaged(20, damage))
|
||||
{
|
||||
player->GroupEventHappens(QUEST_10004, me);
|
||||
damage = 0;
|
||||
EnterEvadeMode();
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (MagneticPull_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_MAGNETIC_PULL);
|
||||
MagneticPull_Timer = 15000;
|
||||
} else MagneticPull_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*
|
||||
##################################################
|
||||
Shattrath City Flask Vendors provides flasks to people exalted with 3 fActions:
|
||||
Haldor the Compulsive
|
||||
Arcanist Xorith
|
||||
Both sell special flasks for use in Outlands 25man raids only,
|
||||
purchasable for one Mark of Illidari each
|
||||
Purchase requires exalted reputation with Scryers/Aldor, Cenarion Expedition and The Sha'tar
|
||||
##################################################
|
||||
*/
|
||||
|
||||
class npc_shattrathflaskvendors : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_shattrathflaskvendors() : CreatureScript("npc_shattrathflaskvendors") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_TRADE)
|
||||
player->GetSession()->SendListInventory(creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (creature->GetEntry() == 23484)
|
||||
{
|
||||
// Aldor vendor
|
||||
if (creature->IsVendor() && (player->GetReputationRank(932) == REP_EXALTED) && (player->GetReputationRank(935) == REP_EXALTED) && (player->GetReputationRank(942) == REP_EXALTED))
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
player->SEND_GOSSIP_MENU(11085, creature->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
player->SEND_GOSSIP_MENU(11083, creature->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
if (creature->GetEntry() == 23483)
|
||||
{
|
||||
// Scryers vendor
|
||||
if (creature->IsVendor() && (player->GetReputationRank(934) == REP_EXALTED) && (player->GetReputationRank(935) == REP_EXALTED) && (player->GetReputationRank(942) == REP_EXALTED))
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
player->SEND_GOSSIP_MENU(11085, creature->GetGUID());
|
||||
}
|
||||
else
|
||||
{
|
||||
player->SEND_GOSSIP_MENU(11084, creature->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
# npc_zephyr
|
||||
######*/
|
||||
|
||||
#define GOSSIP_HZ "Take me to the Caverns of Time."
|
||||
|
||||
class npc_zephyr : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_zephyr() : CreatureScript("npc_zephyr") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* /*creature*/, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
player->CastSpell(player, 37778, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (player->GetReputationRank(989) >= REP_REVERED)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HZ, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
# npc_kservant
|
||||
######*/
|
||||
|
||||
enum KServant
|
||||
{
|
||||
SAY1 = 0,
|
||||
WHISP1 = 1,
|
||||
WHISP2 = 2,
|
||||
WHISP3 = 3,
|
||||
WHISP4 = 4,
|
||||
WHISP5 = 5,
|
||||
WHISP6 = 6,
|
||||
WHISP7 = 7,
|
||||
WHISP8 = 8,
|
||||
WHISP9 = 9,
|
||||
WHISP10 = 10,
|
||||
WHISP11 = 11,
|
||||
WHISP12 = 12,
|
||||
WHISP13 = 13,
|
||||
WHISP14 = 14,
|
||||
WHISP15 = 15,
|
||||
WHISP16 = 16,
|
||||
WHISP17 = 17,
|
||||
WHISP18 = 18,
|
||||
WHISP19 = 19,
|
||||
WHISP20 = 20,
|
||||
WHISP21 = 21
|
||||
};
|
||||
|
||||
class npc_kservant : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_kservant() : CreatureScript("npc_kservant") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_kservantAI(creature);
|
||||
}
|
||||
|
||||
struct npc_kservantAI : public npc_escortAI
|
||||
{
|
||||
public:
|
||||
npc_kservantAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 0:
|
||||
Talk(SAY1, player);
|
||||
break;
|
||||
case 4:
|
||||
Talk(WHISP1, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(WHISP2, player);
|
||||
break;
|
||||
case 7:
|
||||
Talk(WHISP3, player);
|
||||
break;
|
||||
case 8:
|
||||
Talk(WHISP4, player);
|
||||
break;
|
||||
case 17:
|
||||
Talk(WHISP5, player);
|
||||
break;
|
||||
case 18:
|
||||
Talk(WHISP6, player);
|
||||
break;
|
||||
case 19:
|
||||
Talk(WHISP7, player);
|
||||
break;
|
||||
case 33:
|
||||
Talk(WHISP8, player);
|
||||
break;
|
||||
case 34:
|
||||
Talk(WHISP9, player);
|
||||
break;
|
||||
case 35:
|
||||
Talk(WHISP10, player);
|
||||
break;
|
||||
case 36:
|
||||
Talk(WHISP11, player);
|
||||
break;
|
||||
case 43:
|
||||
Talk(WHISP12, player);
|
||||
break;
|
||||
case 44:
|
||||
Talk(WHISP13, player);
|
||||
break;
|
||||
case 49:
|
||||
Talk(WHISP14, player);
|
||||
break;
|
||||
case 50:
|
||||
Talk(WHISP15, player);
|
||||
break;
|
||||
case 51:
|
||||
Talk(WHISP16, player);
|
||||
break;
|
||||
case 52:
|
||||
Talk(WHISP17, player);
|
||||
break;
|
||||
case 53:
|
||||
Talk(WHISP18, player);
|
||||
break;
|
||||
case 54:
|
||||
Talk(WHISP19, player);
|
||||
break;
|
||||
case 55:
|
||||
Talk(WHISP20, player);
|
||||
break;
|
||||
case 56:
|
||||
Talk(WHISP21, player);
|
||||
player->GroupEventHappens(10211, me);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* summoner)
|
||||
{
|
||||
if (!summoner)
|
||||
return;
|
||||
|
||||
Player* player = summoner->ToPlayer();
|
||||
if (player && player->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE)
|
||||
Start(false, false, summoner->GetGUID());
|
||||
}
|
||||
|
||||
void Reset() { }
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
# npc_ishanah
|
||||
######*/
|
||||
|
||||
#define ISANAH_GOSSIP_1 "Who are the Sha'tar?"
|
||||
#define ISANAH_GOSSIP_2 "Isn't Shattrath a draenei city? Why do you allow others here?"
|
||||
|
||||
class npc_ishanah : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_ishanah() : CreatureScript("npc_ishanah") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
player->SEND_GOSSIP_MENU(9458, creature->GetGUID());
|
||||
else if (action == GOSSIP_ACTION_INFO_DEF+2)
|
||||
player->SEND_GOSSIP_MENU(9459, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, ISANAH_GOSSIP_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_shattrath_city()
|
||||
{
|
||||
new npc_raliq_the_drunk();
|
||||
new npc_salsalabim();
|
||||
new npc_shattrathflaskvendors();
|
||||
new npc_zephyr();
|
||||
new npc_kservant();
|
||||
new npc_ishanah();
|
||||
}
|
||||
@@ -1,878 +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: Terokkar_Forest
|
||||
SD%Complete: 85
|
||||
SDComment: Quest support: 9889, 10009, 10873, 10896, 10898, 11096, 10052, 10051. Skettis->Ogri'la Flight
|
||||
SDCategory: Terokkar Forest
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npc_unkor_the_ruthless
|
||||
npc_infested_root_walker
|
||||
npc_rotting_forest_rager
|
||||
npc_netherweb_victim
|
||||
npc_floon
|
||||
npc_isla_starmane
|
||||
npc_slim
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "SpellScript.h"
|
||||
#include "Group.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
// Ours
|
||||
enum fumping
|
||||
{
|
||||
SPELL_SUMMON_SAND_GNOME1 = 39240,
|
||||
SPELL_SUMMON_SAND_GNOME3 = 39247,
|
||||
SPELL_SUMMON_MATURE_BONE_SIFTER1 = 39241,
|
||||
SPELL_SUMMON_MATURE_BONE_SIFTER3 = 39245,
|
||||
SPELL_SUMMON_HAISHULUD = 39248,
|
||||
};
|
||||
|
||||
class spell_q10930_big_bone_worm : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q10930_big_bone_worm() : SpellScriptLoader("spell_q10930_big_bone_worm") { }
|
||||
|
||||
class spell_q10930_big_bone_worm_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q10930_big_bone_worm_SpellScript);
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
Position const offset = { 0.5f, 0.5f, 5.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q10930_big_bone_worm_SpellScript::SetDest, EFFECT_1, TARGET_DEST_CASTER);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q10930_big_bone_worm_SpellScript();
|
||||
}
|
||||
|
||||
class spell_q10930_big_bone_worm_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_q10930_big_bone_worm_AuraScript);
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_SUMMON_HAISHULUD, SPELL_SUMMON_MATURE_BONE_SIFTER1, SPELL_SUMMON_MATURE_BONE_SIFTER3), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_q10930_big_bone_worm_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_q10930_big_bone_worm_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_q10929_fumping : SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q10929_fumping() : SpellScriptLoader("spell_q10929_fumping") { }
|
||||
|
||||
class spell_q10929_fumping_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q10929_fumping_SpellScript);
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
Position const offset = { 0.5f, 0.5f, 5.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q10929_fumping_SpellScript::SetDest, EFFECT_1, TARGET_DEST_CASTER);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q10929_fumping_SpellScript();
|
||||
}
|
||||
|
||||
class spell_q10929_fumping_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_q10929_fumping_AuraScript);
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (GetTargetApplication()->GetRemoveMode() != AURA_REMOVE_BY_EXPIRE)
|
||||
return;
|
||||
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_SUMMON_SAND_GNOME1, SPELL_SUMMON_SAND_GNOME3, SPELL_SUMMON_MATURE_BONE_SIFTER1, SPELL_SUMMON_MATURE_BONE_SIFTER3), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_q10929_fumping_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_q10929_fumping_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class npc_greatfather_aldrimus : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_greatfather_aldrimus() : CreatureScript("npc_greatfather_aldrimus") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_greatfather_aldrimusAI(creature);
|
||||
}
|
||||
|
||||
struct npc_greatfather_aldrimusAI : public ScriptedAI
|
||||
{
|
||||
npc_greatfather_aldrimusAI(Creature* c) : ScriptedAI(c) {}
|
||||
|
||||
bool CanBeSeen(Player const* player)
|
||||
{
|
||||
return player->GetQuestStatus(10253) == QUEST_STATUS_REWARDED;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
enum q10036Torgos
|
||||
{
|
||||
NPC_TORGOS = 18707
|
||||
};
|
||||
|
||||
class spell_q10036_torgos : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q10036_torgos() : SpellScriptLoader("spell_q10036_torgos") { }
|
||||
|
||||
class spell_q10036_torgos_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q10036_torgos_SpellScript);
|
||||
|
||||
void HandleSendEvent(SpellEffIndex effIndex)
|
||||
{
|
||||
if (Creature* torgos = GetCaster()->FindNearestCreature(NPC_TORGOS, 100.0f, true))
|
||||
torgos->GetAI()->AttackStart(GetCaster());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectLaunch += SpellEffectFn(spell_q10036_torgos_SpellScript::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q10036_torgos_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
enum eQ10923EvilDrawsNear
|
||||
{
|
||||
SPELL_DUSTIN_UNDEAD_DRAGON_VISUAL1 = 39256,
|
||||
SPELL_DUSTIN_UNDEAD_DRAGON_VISUAL2 = 39257,
|
||||
SPELL_DUSTIN_UNDEAD_DRAGON_VISUAL_AURA = 39259,
|
||||
|
||||
NPC_AUCHENAI_DEATH_SPIRIT = 21967
|
||||
};
|
||||
|
||||
class spell_q10923_evil_draws_near_summon : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q10923_evil_draws_near_summon() : SpellScriptLoader("spell_q10923_evil_draws_near_summon") { }
|
||||
|
||||
class spell_q10923_evil_draws_near_summon_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q10923_evil_draws_near_summon_SpellScript);
|
||||
|
||||
void HandleSendEvent(SpellEffIndex effIndex)
|
||||
{
|
||||
if (Creature* auchenai = GetCaster()->FindNearestCreature(NPC_AUCHENAI_DEATH_SPIRIT, 10.0f, true))
|
||||
auchenai->CastSpell(auchenai, SPELL_DUSTIN_UNDEAD_DRAGON_VISUAL_AURA, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectLaunch += SpellEffectFn(spell_q10923_evil_draws_near_summon_SpellScript::HandleSendEvent, EFFECT_0, SPELL_EFFECT_SEND_EVENT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q10923_evil_draws_near_summon_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_q10923_evil_draws_near_periodic : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q10923_evil_draws_near_periodic() : SpellScriptLoader("spell_q10923_evil_draws_near_periodic") { }
|
||||
|
||||
class spell_q10923_evil_draws_near_periodic_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_q10923_evil_draws_near_periodic_AuraScript);
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
GetUnitOwner()->CastSpell(GetUnitOwner(), RAND(SPELL_DUSTIN_UNDEAD_DRAGON_VISUAL1, SPELL_DUSTIN_UNDEAD_DRAGON_VISUAL2), true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_q10923_evil_draws_near_periodic_AuraScript::HandlePeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_q10923_evil_draws_near_periodic_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_q10923_evil_draws_near_visual : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q10923_evil_draws_near_visual() : SpellScriptLoader("spell_q10923_evil_draws_near_visual") { }
|
||||
|
||||
class spell_q10923_evil_draws_near_visual_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q10923_evil_draws_near_visual_SpellScript);
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
// Adjust effect summon position
|
||||
Position const offset = { 0.0f, 0.0f, 20.0f, 0.0f };
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q10923_evil_draws_near_visual_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_RADIUS);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q10923_evil_draws_near_visual_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_q10898_skywing : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_q10898_skywing() : SpellScriptLoader("spell_q10898_skywing") { }
|
||||
|
||||
class spell_q10898_skywing_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_q10898_skywing_SpellScript);
|
||||
|
||||
void SetDest(SpellDestination& dest)
|
||||
{
|
||||
// Adjust effect summon position
|
||||
Position const offset = { frand(-7.0f, 7.0f), frand(-7.0f, 7.0f), 11.0f, 0.0f };
|
||||
dest.Relocate(*GetCaster());
|
||||
dest.RelocateOffset(offset);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnDestinationTargetSelect += SpellDestinationTargetSelectFn(spell_q10898_skywing_SpellScript::SetDest, EFFECT_0, TARGET_DEST_CASTER_RANDOM);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_q10898_skywing_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Theirs
|
||||
/*######
|
||||
## npc_unkor_the_ruthless
|
||||
######*/
|
||||
|
||||
enum UnkorTheRuthless
|
||||
{
|
||||
SAY_SUBMIT = 0,
|
||||
|
||||
FACTION_HOSTILE = 45,
|
||||
FACTION_FRIENDLY = 35,
|
||||
QUEST_DONTKILLTHEFATONE = 9889,
|
||||
|
||||
SPELL_PULVERIZE = 2676
|
||||
};
|
||||
|
||||
class npc_unkor_the_ruthless : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_unkor_the_ruthless() : CreatureScript("npc_unkor_the_ruthless") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_unkor_the_ruthlessAI(creature);
|
||||
}
|
||||
|
||||
struct npc_unkor_the_ruthlessAI : public ScriptedAI
|
||||
{
|
||||
npc_unkor_the_ruthlessAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
bool CanDoQuest;
|
||||
uint32 UnkorUnfriendly_Timer;
|
||||
uint32 Pulverize_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
CanDoQuest = false;
|
||||
UnkorUnfriendly_Timer = 0;
|
||||
Pulverize_Timer = 3000;
|
||||
me->SetStandState(UNIT_STAND_STATE_STAND);
|
||||
me->setFaction(FACTION_HOSTILE);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
void DoNice()
|
||||
{
|
||||
Talk(SAY_SUBMIT);
|
||||
me->setFaction(FACTION_FRIENDLY);
|
||||
me->SetStandState(UNIT_STAND_STATE_SIT);
|
||||
me->RemoveAllAuras();
|
||||
me->DeleteThreatList();
|
||||
me->CombatStop(true);
|
||||
UnkorUnfriendly_Timer = 60000;
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* done_by, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!done_by)
|
||||
return;
|
||||
|
||||
Player* player = done_by->ToPlayer();
|
||||
if (player && me->HealthBelowPctDamaged(30, damage))
|
||||
{
|
||||
if (Group* group = player->GetGroup())
|
||||
{
|
||||
for (GroupReference* itr = group->GetFirstMember(); itr != NULL; itr = itr->next())
|
||||
{
|
||||
Player* groupie = itr->GetSource();
|
||||
if (groupie && groupie->IsInMap(player) &&
|
||||
groupie->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
|
||||
groupie->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
|
||||
{
|
||||
groupie->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
|
||||
if (!CanDoQuest)
|
||||
CanDoQuest = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (player->GetQuestStatus(QUEST_DONTKILLTHEFATONE) == QUEST_STATUS_INCOMPLETE &&
|
||||
player->GetReqKillOrCastCurrentCount(QUEST_DONTKILLTHEFATONE, 18260) == 10)
|
||||
{
|
||||
player->AreaExploredOrEventHappens(QUEST_DONTKILLTHEFATONE);
|
||||
CanDoQuest = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (CanDoQuest)
|
||||
{
|
||||
if (!UnkorUnfriendly_Timer)
|
||||
{
|
||||
//DoCast(me, SPELL_QUID9889); //not using spell for now
|
||||
DoNice();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (UnkorUnfriendly_Timer <= diff)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
} else UnkorUnfriendly_Timer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Pulverize_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_PULVERIZE);
|
||||
Pulverize_Timer = 9000;
|
||||
} else Pulverize_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_infested_root_walker
|
||||
######*/
|
||||
|
||||
class npc_infested_root_walker : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_infested_root_walker() : CreatureScript("npc_infested_root_walker") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_infested_root_walkerAI(creature);
|
||||
}
|
||||
|
||||
struct npc_infested_root_walkerAI : public ScriptedAI
|
||||
{
|
||||
npc_infested_root_walkerAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() { }
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
void DamageTaken(Unit* done_by, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (done_by && done_by->GetTypeId() == TYPEID_PLAYER)
|
||||
if (me->GetHealth() <= damage)
|
||||
if (rand()%100 < 75)
|
||||
//Summon Wood Mites
|
||||
DoCast(me, 39130, true);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_rotting_forest_rager
|
||||
######*/
|
||||
|
||||
class npc_rotting_forest_rager : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_rotting_forest_rager() : CreatureScript("npc_rotting_forest_rager") { }
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_rotting_forest_ragerAI(creature);
|
||||
}
|
||||
|
||||
struct npc_rotting_forest_ragerAI : public ScriptedAI
|
||||
{
|
||||
npc_rotting_forest_ragerAI(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() { }
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
void DamageTaken(Unit* done_by, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (done_by && done_by->GetTypeId() == TYPEID_PLAYER)
|
||||
if (me->GetHealth() <= damage)
|
||||
if (rand()%100 < 75)
|
||||
//Summon Lots of Wood Mights
|
||||
DoCast(me, 39134, true);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_floon
|
||||
######*/
|
||||
|
||||
#define GOSSIP_FLOON1 "You owe Sim'salabim money. Hand them over or die!"
|
||||
#define GOSSIP_FLOON2 "Hand over the money or die...again!"
|
||||
|
||||
enum Floon
|
||||
{
|
||||
SAY_FLOON_ATTACK = 0,
|
||||
|
||||
SPELL_SILENCE = 6726,
|
||||
SPELL_FROSTBOLT = 9672,
|
||||
SPELL_FROST_NOVA = 11831,
|
||||
|
||||
FACTION_HOSTILE_FL = 1738,
|
||||
QUEST_CRACK_SKULLS = 10009
|
||||
};
|
||||
|
||||
class npc_floon : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_floon() : CreatureScript("npc_floon") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
player->SEND_GOSSIP_MENU(9443, creature->GetGUID());
|
||||
}
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
creature->setFaction(FACTION_HOSTILE_FL);
|
||||
creature->AI()->Talk(SAY_FLOON_ATTACK, player);
|
||||
creature->AI()->AttackStart(player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_FLOON1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
player->SEND_GOSSIP_MENU(9442, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_floonAI(creature);
|
||||
}
|
||||
|
||||
struct npc_floonAI : public ScriptedAI
|
||||
{
|
||||
npc_floonAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
m_uiNormFaction = creature->getFaction();
|
||||
}
|
||||
|
||||
uint32 m_uiNormFaction;
|
||||
uint32 Silence_Timer;
|
||||
uint32 Frostbolt_Timer;
|
||||
uint32 FrostNova_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
Silence_Timer = 2000;
|
||||
Frostbolt_Timer = 4000;
|
||||
FrostNova_Timer = 9000;
|
||||
if (me->getFaction() != m_uiNormFaction)
|
||||
me->setFaction(m_uiNormFaction);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (Silence_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_SILENCE);
|
||||
Silence_Timer = 30000;
|
||||
} else Silence_Timer -= diff;
|
||||
|
||||
if (FrostNova_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SPELL_FROST_NOVA);
|
||||
FrostNova_Timer = 20000;
|
||||
} else FrostNova_Timer -= diff;
|
||||
|
||||
if (Frostbolt_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_FROSTBOLT);
|
||||
Frostbolt_Timer = 5000;
|
||||
} else Frostbolt_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_isla_starmane
|
||||
######*/
|
||||
enum IslaStarmaneData
|
||||
{
|
||||
SAY_PROGRESS_1 = 0,
|
||||
SAY_PROGRESS_2 = 1,
|
||||
SAY_PROGRESS_3 = 2,
|
||||
SAY_PROGRESS_4 = 3,
|
||||
|
||||
QUEST_EFTW_H = 10052,
|
||||
QUEST_EFTW_A = 10051,
|
||||
GO_CAGE = 182794,
|
||||
SPELL_CAT = 32447,
|
||||
|
||||
EVENT_SPELL_WRATH = 1,
|
||||
EVENT_SPELL_MOONFIRE = 2,
|
||||
EVENT_SPELL_ENTANGLING_ROOTS = 3,
|
||||
|
||||
SPELL_WRATH = 9739,
|
||||
SPELL_MOONFIRE = 15798,
|
||||
SPELL_ENTANGLING_ROOTS = 33844
|
||||
};
|
||||
|
||||
class npc_isla_starmane : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_isla_starmane() : CreatureScript("npc_isla_starmane") { }
|
||||
|
||||
struct npc_isla_starmaneAI : public npc_escortAI
|
||||
{
|
||||
npc_isla_starmaneAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 0:
|
||||
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10))
|
||||
Cage->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case 2:
|
||||
Talk(SAY_PROGRESS_1, player);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_PROGRESS_2, player);
|
||||
break;
|
||||
case 6:
|
||||
Talk(SAY_PROGRESS_3, player);
|
||||
break;
|
||||
case 29:
|
||||
Talk(SAY_PROGRESS_4, player);
|
||||
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||
player->GroupEventHappens(QUEST_EFTW_A, me);
|
||||
else if (player->GetTeamId() == TEAM_HORDE)
|
||||
player->GroupEventHappens(QUEST_EFTW_H, me);
|
||||
me->SetInFront(player);
|
||||
break;
|
||||
case 30:
|
||||
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
|
||||
break;
|
||||
case 31:
|
||||
DoCast(me, SPELL_CAT);
|
||||
me->SetWalk(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void Reset()
|
||||
{
|
||||
me->RestoreFaction();
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (Player* player = GetPlayerForEscort())
|
||||
{
|
||||
if (player->GetTeamId() == TEAM_ALLIANCE)
|
||||
player->FailQuest(QUEST_EFTW_A);
|
||||
else if (player->GetTeamId() == TEAM_HORDE)
|
||||
player->FailQuest(QUEST_EFTW_H);
|
||||
}
|
||||
}
|
||||
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_SPELL_WRATH, 0);
|
||||
events.ScheduleEvent(EVENT_SPELL_MOONFIRE, 4000);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENTANGLING_ROOTS, 10000);
|
||||
}
|
||||
|
||||
void UpdateEscortAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
switch (events.ExecuteEvent())
|
||||
{
|
||||
case EVENT_SPELL_WRATH:
|
||||
me->CastSpell(me->GetVictim(), SPELL_WRATH, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_WRATH, 3000);
|
||||
break;
|
||||
case EVENT_SPELL_MOONFIRE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_MOONFIRE, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_MOONFIRE, 12000);
|
||||
break;
|
||||
case EVENT_SPELL_ENTANGLING_ROOTS:
|
||||
me->CastSpell(me->GetVictim(), SPELL_ENTANGLING_ROOTS, false);
|
||||
events.ScheduleEvent(EVENT_SPELL_ENTANGLING_ROOTS, 20000);
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_EFTW_H || quest->GetQuestId() == QUEST_EFTW_A)
|
||||
{
|
||||
CAST_AI(npc_escortAI, (creature->AI()))->Start(true, false, player->GetGUID());
|
||||
creature->setFaction(250);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_isla_starmaneAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## go_skull_pile
|
||||
######*/
|
||||
#define GOSSIP_S_DARKSCREECHER_AKKARAI "Summon Darkscreecher Akkarai"
|
||||
#define GOSSIP_S_KARROG "Summon Karrog"
|
||||
#define GOSSIP_S_GEZZARAK_THE_HUNTRESS "Summon Gezzarak the Huntress"
|
||||
#define GOSSIP_S_VAKKIZ_THE_WINDRAGER "Summon Vakkiz the Windrager"
|
||||
|
||||
class go_skull_pile : public GameObjectScript
|
||||
{
|
||||
public:
|
||||
go_skull_pile() : GameObjectScript("go_skull_pile") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, GameObject* go, uint32 sender, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch (sender)
|
||||
{
|
||||
case GOSSIP_SENDER_MAIN: SendActionMenu(player, go, action); break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, GameObject* go)
|
||||
{
|
||||
if ((player->GetQuestStatus(11885) == QUEST_STATUS_INCOMPLETE) || player->GetQuestRewardStatus(11885))
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_DARKSCREECHER_AKKARAI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_KARROG, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_GEZZARAK_THE_HUNTRESS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_S_VAKKIZ_THE_WINDRAGER, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
}
|
||||
|
||||
player->SEND_GOSSIP_MENU(go->GetGOInfo()->questgiver.gossipID, go->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
void SendActionMenu(Player* player, GameObject* /*go*/, uint32 action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
player->CastSpell(player, 40642, false);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
player->CastSpell(player, 40640, false);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 3:
|
||||
player->CastSpell(player, 40632, false);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 4:
|
||||
player->CastSpell(player, 40644, false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_slim
|
||||
######*/
|
||||
|
||||
enum Slim
|
||||
{
|
||||
FACTION_CONSORTIUM = 933
|
||||
};
|
||||
|
||||
class npc_slim : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_slim() : CreatureScript("npc_slim") { }
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_TRADE)
|
||||
player->GetSession()->SendListInventory(creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (creature->IsVendor() && player->GetReputationRank(FACTION_CONSORTIUM) >= REP_FRIENDLY)
|
||||
{
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
player->SEND_GOSSIP_MENU(9896, creature->GetGUID());
|
||||
}
|
||||
else
|
||||
player->SEND_GOSSIP_MENU(9895, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_terokkar_forest()
|
||||
{
|
||||
// Ours
|
||||
new spell_q10930_big_bone_worm();
|
||||
new spell_q10929_fumping();
|
||||
new npc_greatfather_aldrimus();
|
||||
new spell_q10036_torgos();
|
||||
new spell_q10923_evil_draws_near_summon();
|
||||
new spell_q10923_evil_draws_near_periodic();
|
||||
new spell_q10923_evil_draws_near_visual();
|
||||
new spell_q10898_skywing();
|
||||
|
||||
// Theirs
|
||||
new npc_unkor_the_ruthless();
|
||||
new npc_infested_root_walker();
|
||||
new npc_rotting_forest_rager();
|
||||
new npc_floon();
|
||||
new npc_isla_starmane();
|
||||
new go_skull_pile();
|
||||
new npc_slim();
|
||||
}
|
||||
@@ -1,540 +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: Zangarmarsh
|
||||
SD%Complete: 100
|
||||
SDComment: Quest support: 9752, 9785, 9803, 10009. Mark Of ... buffs.
|
||||
SDCategory: Zangarmarsh
|
||||
EndScriptData */
|
||||
|
||||
/* ContentData
|
||||
npcs_ashyen_and_keleth
|
||||
npc_cooshcoosh
|
||||
npc_elder_kuruti
|
||||
npc_mortog_steamhead
|
||||
npc_kayra_longmane
|
||||
npc_timothy_daniels
|
||||
EndContentData */
|
||||
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptedGossip.h"
|
||||
#include "ScriptedEscortAI.h"
|
||||
#include "Player.h"
|
||||
#include "WorldSession.h"
|
||||
|
||||
// Ours
|
||||
enum eNaturalist
|
||||
{
|
||||
SPELL_MARK_OF_BITE = 34906,
|
||||
GO_CAGE_ENTRY = 182094,
|
||||
};
|
||||
|
||||
class npc_natrualist_bite : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_natrualist_bite() : CreatureScript("npc_natrualist_bite") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
uint32 menuId = creature->AI()->GetData(1) ? 7540 : 7520;
|
||||
player->PrepareGossipMenu(creature, menuId, false);
|
||||
player->SendPreparedGossip(creature);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
if (creature->AI()->GetData(1))
|
||||
{
|
||||
creature->CastSpell(player, SPELL_MARK_OF_BITE, true);
|
||||
player->KilledMonsterCredit(creature->GetEntry(), 0);
|
||||
creature->DespawnOrUnsummon(1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC|UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
Creature* cr;
|
||||
if (cr = creature->SummonCreature(17957, -186, -790, 43.8f, 4.2f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
cr->AI()->AttackStart(creature);
|
||||
if (cr = creature->SummonCreature(17960, -188, -783, 43.8f, 4.2f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
cr->AI()->AttackStart(player);
|
||||
if (cr = creature->SummonCreature(17957, -196, -783, 43.8f, 4.4f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000))
|
||||
cr->AI()->AttackStart(player);
|
||||
if (GameObject* cage = creature->FindNearestGameObject(GO_CAGE_ENTRY, 20.0f))
|
||||
cage->SetGoState(GO_STATE_ACTIVE);
|
||||
creature->SetHomePosition(-195.39f, -795.91f, 43.8f, 1.0f);
|
||||
creature->AI()->Talk(1);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
struct npc_natrualist_biteAI : public ScriptedAI
|
||||
{
|
||||
npc_natrualist_biteAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
_spoken = 0;
|
||||
}
|
||||
|
||||
uint8 _spoken;
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!_spoken && !me->IsHostileTo(who))
|
||||
{
|
||||
_spoken = 1;
|
||||
Talk(0);
|
||||
}
|
||||
ScriptedAI::MoveInLineOfSight(who);
|
||||
}
|
||||
void EnterCombat(Unit*) { _spoken = 2; }
|
||||
uint32 GetData(uint32) const { return _spoken == 2; }
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_natrualist_biteAI (creature);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
// Theirs
|
||||
/*######
|
||||
## npcs_ashyen_and_keleth
|
||||
######*/
|
||||
|
||||
#define GOSSIP_ITEM_BLESS_ASH "Grant me your mark, wise ancient."
|
||||
#define GOSSIP_ITEM_BLESS_KEL "Grant me your mark, mighty ancient."
|
||||
|
||||
enum AshyenAndKeleth
|
||||
{
|
||||
GOSSIP_REWARD_BLESS = 0,
|
||||
|
||||
NPC_ASHYEN = 17900,
|
||||
NPC_KELETH = 17901,
|
||||
|
||||
SPELL_BLESS_ASH_EXA = 31815,
|
||||
SPELL_BLESS_ASH_REV = 31811,
|
||||
SPELL_BLESS_ASH_HON = 31810,
|
||||
SPELL_BLESS_ASH_FRI = 31808,
|
||||
|
||||
SPELL_BLESS_KEL_EXA = 31814,
|
||||
SPELL_BLESS_KEL_REV = 31813,
|
||||
SPELL_BLESS_KEL_HON = 31812,
|
||||
SPELL_BLESS_KEL_FRI = 31807
|
||||
};
|
||||
|
||||
class npcs_ashyen_and_keleth : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npcs_ashyen_and_keleth() : CreatureScript("npcs_ashyen_and_keleth") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (player->GetReputationRank(942) > REP_NEUTRAL)
|
||||
{
|
||||
if (creature->GetEntry() == NPC_ASHYEN)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
|
||||
if (creature->GetEntry() == NPC_KELETH)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
}
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF+1)
|
||||
{
|
||||
creature->setPowerType(POWER_MANA);
|
||||
creature->SetMaxPower(POWER_MANA, 200); //set a "fake" mana value, we can't depend on database doing it in this case
|
||||
creature->SetPower(POWER_MANA, 200);
|
||||
|
||||
if (creature->GetEntry() == NPC_ASHYEN) //check which Creature we are dealing with
|
||||
{
|
||||
uint32 spell = 0;
|
||||
switch (player->GetReputationRank(942))
|
||||
{ //mark of lore
|
||||
case REP_FRIENDLY:
|
||||
spell = SPELL_BLESS_ASH_FRI;
|
||||
break;
|
||||
case REP_HONORED:
|
||||
spell = SPELL_BLESS_ASH_HON;
|
||||
break;
|
||||
case REP_REVERED:
|
||||
spell = SPELL_BLESS_ASH_REV;
|
||||
break;
|
||||
case REP_EXALTED:
|
||||
spell = SPELL_BLESS_ASH_EXA;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (spell)
|
||||
{
|
||||
creature->CastSpell(player, spell, true);
|
||||
creature->AI()->Talk(GOSSIP_REWARD_BLESS);
|
||||
}
|
||||
}
|
||||
|
||||
if (creature->GetEntry() == NPC_KELETH)
|
||||
{
|
||||
uint32 spell = 0;
|
||||
switch (player->GetReputationRank(942)) //mark of war
|
||||
{
|
||||
case REP_FRIENDLY:
|
||||
spell = SPELL_BLESS_KEL_FRI;
|
||||
break;
|
||||
case REP_HONORED:
|
||||
spell = SPELL_BLESS_KEL_HON;
|
||||
break;
|
||||
case REP_REVERED:
|
||||
spell = SPELL_BLESS_KEL_REV;
|
||||
break;
|
||||
case REP_EXALTED:
|
||||
spell = SPELL_BLESS_KEL_EXA;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (spell)
|
||||
{
|
||||
creature->CastSpell(player, spell, true);
|
||||
creature->AI()->Talk(GOSSIP_REWARD_BLESS);
|
||||
}
|
||||
}
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_cooshcoosh
|
||||
######*/
|
||||
|
||||
#define GOSSIP_COOSH "You owe Sim'salabim money. Hand them over or die!"
|
||||
|
||||
enum Cooshhooosh
|
||||
{
|
||||
SPELL_LIGHTNING_BOLT = 9532,
|
||||
QUEST_CRACK_SKULLS = 10009,
|
||||
FACTION_HOSTILE_CO = 45
|
||||
};
|
||||
|
||||
class npc_cooshcoosh : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_cooshcoosh() : CreatureScript("npc_cooshcoosh") { }
|
||||
|
||||
struct npc_cooshcooshAI : public ScriptedAI
|
||||
{
|
||||
npc_cooshcooshAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
m_uiNormFaction = creature->getFaction();
|
||||
}
|
||||
|
||||
uint32 m_uiNormFaction;
|
||||
uint32 LightningBolt_Timer;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
LightningBolt_Timer = 2000;
|
||||
if (me->getFaction() != m_uiNormFaction)
|
||||
me->setFaction(m_uiNormFaction);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit* /*who*/) { }
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (LightningBolt_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SPELL_LIGHTNING_BOLT);
|
||||
LightningBolt_Timer = 5000;
|
||||
} else LightningBolt_Timer -= diff;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_cooshcooshAI(creature);
|
||||
}
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (player->GetQuestStatus(QUEST_CRACK_SKULLS) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_COOSH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
player->SEND_GOSSIP_MENU(9441, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_INFO_DEF)
|
||||
{
|
||||
player->CLOSE_GOSSIP_MENU();
|
||||
creature->setFaction(FACTION_HOSTILE_CO);
|
||||
creature->AI()->AttackStart(player);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_elder_kuruti
|
||||
######*/
|
||||
|
||||
#define GOSSIP_ITEM_KUR1 "Greetings, elder. It is time for your people to end their hostility towards the draenei and their allies."
|
||||
#define GOSSIP_ITEM_KUR2 "I did not mean to deceive you, elder. The draenei of Telredor thought to approach you in a way that would seem familiar to you."
|
||||
#define GOSSIP_ITEM_KUR3 "I will tell them. Farewell, elder."
|
||||
|
||||
class npc_elder_kuruti : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_elder_kuruti() : CreatureScript("npc_elder_kuruti") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (player->GetQuestStatus(9803) == QUEST_STATUS_INCOMPLETE)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
|
||||
|
||||
player->SEND_GOSSIP_MENU(9226, creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF:
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
player->SEND_GOSSIP_MENU(9227, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 1:
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_KUR3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
player->SEND_GOSSIP_MENU(9229, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF + 2:
|
||||
{
|
||||
if (!player->HasItemCount(24573))
|
||||
{
|
||||
ItemPosCountVec dest;
|
||||
uint32 itemId = 24573;
|
||||
InventoryResult msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, itemId, 1, NULL);
|
||||
if (msg == EQUIP_ERR_OK)
|
||||
{
|
||||
player->StoreNewItem(dest, itemId, true);
|
||||
}
|
||||
else
|
||||
player->SendEquipError(msg, NULL, NULL, itemId);
|
||||
}
|
||||
player->SEND_GOSSIP_MENU(9231, creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_mortog_steamhead
|
||||
######*/
|
||||
class npc_mortog_steamhead : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_mortog_steamhead() : CreatureScript("npc_mortog_steamhead") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (creature->IsVendor() && player->GetReputationRank(942) == REP_EXALTED)
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
if (action == GOSSIP_ACTION_TRADE)
|
||||
player->GetSession()->SendListInventory(creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_kayra_longmane
|
||||
######*/
|
||||
|
||||
enum Kayra
|
||||
{
|
||||
SAY_START = 0,
|
||||
SAY_AMBUSH1 = 1,
|
||||
SAY_PROGRESS = 2,
|
||||
SAY_AMBUSH2 = 3,
|
||||
SAY_END = 4,
|
||||
|
||||
QUEST_ESCAPE_FROM = 9752,
|
||||
NPC_SLAVEBINDER = 18042
|
||||
};
|
||||
|
||||
class npc_kayra_longmane : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_kayra_longmane() : CreatureScript("npc_kayra_longmane") { }
|
||||
|
||||
struct npc_kayra_longmaneAI : public npc_escortAI
|
||||
{
|
||||
npc_kayra_longmaneAI(Creature* creature) : npc_escortAI(creature) { }
|
||||
|
||||
void Reset() { }
|
||||
|
||||
void WaypointReached(uint32 waypointId)
|
||||
{
|
||||
Player* player = GetPlayerForEscort();
|
||||
if (!player)
|
||||
return;
|
||||
|
||||
switch (waypointId)
|
||||
{
|
||||
case 4:
|
||||
Talk(SAY_AMBUSH1, player);
|
||||
DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
break;
|
||||
case 5:
|
||||
Talk(SAY_PROGRESS, player);
|
||||
SetRun();
|
||||
break;
|
||||
case 16:
|
||||
Talk(SAY_AMBUSH2, player);
|
||||
DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
|
||||
break;
|
||||
case 17:
|
||||
SetRun(false);
|
||||
break;
|
||||
case 25:
|
||||
Talk(SAY_END, player);
|
||||
player->GroupEventHappens(QUEST_ESCAPE_FROM, me);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest)
|
||||
{
|
||||
if (quest->GetQuestId() == QUEST_ESCAPE_FROM)
|
||||
{
|
||||
creature->AI()->Talk(SAY_START, player);
|
||||
|
||||
if (npc_escortAI* pEscortAI = CAST_AI(npc_kayra_longmane::npc_kayra_longmaneAI, creature->AI()))
|
||||
pEscortAI->Start(false, false, player->GetGUID());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const
|
||||
{
|
||||
return new npc_kayra_longmaneAI(creature);
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## npc_timothy_daniels
|
||||
######*/
|
||||
|
||||
#define GOSSIP_TIMOTHY_DANIELS_ITEM1 "Specialist, eh? Just what kind of specialist are you, anyway?"
|
||||
#define GOSSIP_TEXT_BROWSE_POISONS "Let me browse your reagents and poison supplies."
|
||||
|
||||
enum Timothy
|
||||
{
|
||||
GOSSIP_TEXTID_TIMOTHY_DANIELS1 = 9239
|
||||
};
|
||||
|
||||
class npc_timothy_daniels : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_timothy_daniels() : CreatureScript("npc_timothy_daniels") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature)
|
||||
{
|
||||
if (creature->IsQuestGiver())
|
||||
player->PrepareQuestMenu(creature->GetGUID());
|
||||
|
||||
if (creature->IsVendor())
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_POISONS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
|
||||
|
||||
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TIMOTHY_DANIELS_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
|
||||
{
|
||||
player->PlayerTalkClass->ClearMenus();
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
player->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TIMOTHY_DANIELS1, creature->GetGUID());
|
||||
break;
|
||||
case GOSSIP_ACTION_TRADE:
|
||||
player->GetSession()->SendListInventory(creature->GetGUID());
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
/*######
|
||||
## AddSC
|
||||
######*/
|
||||
|
||||
void AddSC_zangarmarsh()
|
||||
{
|
||||
// Ours
|
||||
new npc_natrualist_bite();
|
||||
|
||||
// Theris
|
||||
new npcs_ashyen_and_keleth();
|
||||
new npc_cooshcoosh();
|
||||
new npc_elder_kuruti();
|
||||
new npc_mortog_steamhead();
|
||||
new npc_kayra_longmane();
|
||||
new npc_timothy_daniels();
|
||||
}
|
||||
Reference in New Issue
Block a user