137#define TIME_PHASE_2_3 120000
138#define TIME_PHASE_3_4 180000
159 me->SetMaxHealth(
me->GetMaxHealth() / 2);
174 Kaelthas->AI()->EnterEvadeMode();
198 me->SetMaxHealth(
me->GetMaxHealth() * 2);
209 if (damage < me->GetHealth())
226 me->InterruptNonMeleeSpells(
false);
229 me->ClearComboPointHolders();
230 me->RemoveAllAurasOnDeath();
234 me->ClearAllReactives();
236 me->GetMotionMaster()->Clear();
237 me->GetMotionMaster()->MoveIdle();
254 Target =
me->GetVictim();
258 me->GetMotionMaster()->Clear();
259 me->GetMotionMaster()->MoveChase(Target);
260 me->AddThreat(Target, 0.0f);
325 if (
me->IsInCombat())
345 creature->setFaction(
me->getFaction());
346 creature->AI()->EnterEvadeMode();
363 SF_LOG_ERROR(
"scripts",
"Kael'Thas One or more advisors missing, Skipping Phases 1-3");
400 float attackRadius =
me->GetAttackDistance(who);
401 if (
me->IsWithinDistInMap(who, attackRadius) &&
me->IsWithinLOSInMap(who))
403 if (!
me->GetVictim() &&
Phase >= 4)
408 else if (
me->GetMap()->IsDungeon())
413 who->SetInCombatWith(
me);
414 me->AddThreat(who, 0.0f);
437 summoned->AI()->AttackStart(target);
463 pAdvisor->Kill(pAdvisor);
655 for (
uint32 i = 0; i < uiMaxWeapon; ++i)
691 SF_LOG_ERROR(
"scripts",
"SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i);
739 if (!
me->IsNonMeleeSpellCasted(
false))
743 int32 dmg = 20000+rand()%5000;
781 if (
me->getThreatManager().getThreatList().size() >= 2)
782 for (
uint32 i = 0; i < 3; ++i)
784 SF_LOG_DEBUG(
"scripts",
"Kael'Thas mind control not supported.");
818 me->GetMotionMaster()->Clear();
819 me->GetMotionMaster()->MoveIdle();
823 me->InterruptNonMeleeSpells(
false);
860 me->InterruptNonMeleeSpells(
false);
880 ThreatContainer::StorageType::const_iterator i = threatlist.begin();
886 me->GetMotionMaster()->Clear();
887 me->GetMotionMaster()->MoveIdle();
892 for (i = threatlist.begin(); i != threatlist.end(); ++i)
913 for (i = threatlist.begin(); i != threatlist.end(); ++i)
925 data.
append(unit->GetPackGUID());
927 unit->SendMessageToSet(&data,
true);
936 me->InterruptNonMeleeSpells(
false);
945 for (i = threatlist.begin(); i != threatlist.end(); ++i)
951 data.
append(unit->GetPackGUID());
953 unit->SendMessageToSet(&data,
true);
1038 me->AddThreat(who, 5000000.0f);
1065 me->AddThreat(target, 5000000.0f);
1207 if (
me->Attack(who,
true))
1209 me->AddThreat(who, 0.0f);
1210 me->SetInCombatWith(who);
1211 who->SetInCombatWith(
me);
1262 Unit* target = NULL;
1265 if (target &&
me->IsWithinDistInMap(target, 30))
1278 bool InMeleeRange =
false;
1279 Unit* target = NULL;
1281 for (ThreatContainer::StorageType::const_iterator i = threatlist.begin(); i!= threatlist.end(); ++i)
1287 InMeleeRange =
true;
1440 me->InterruptNonMeleeSpells(
false);
1495 uint32 dmg = std::rand() % 5500 + 4500;
1496 if (
me->GetHealth() > dmg)
1497 me->ModifyHealth(-
int32(dmg));
1538 if (
me->Attack(who,
false))
1540 me->SetInCombatWith(who);
1541 who->SetInCombatWith(
me);
1549 summoned->AddThreat(
me->GetVictim(), 0.0f);
#define CREATURE_Z_ATTACK_RANGE
#define SF_LOG_DEBUG(filterType__,...)
#define SF_LOG_ERROR(filterType__,...)
@ TEMPSUMMON_CORPSE_DESPAWN
@ TEMPSUMMON_TIMED_DESPAWN
@ SPELL_EFFECT_INTERRUPT_CAST
@ AURA_STATE_HEALTHLESS_35_PERCENT
@ AURA_STATE_HEALTHLESS_20_PERCENT
@ UNIT_FLAG_NON_ATTACKABLE
@ UNIT_FLAG_NOT_SELECTABLE
const float CAPERNIAN_DISTANCE
uint32 m_auiSpellSummonWeapon[]
@ SPELL_CAPERNIAN_FIREBALL
@ SPELL_PHOENIX_ANIMATION
@ SPELL_ARCANE_DISRUPTION
@ SPELL_GRAVITY_LAPSE_AURA
void AddSC_boss_kaelthas()
const float afGravityPos[3]
virtual void MoveInLineOfSight(Unit *)
void Talk(uint8 id, WorldObject const *whisperTarget=NULL)
CreatureScript(const char *name)
void RemoveFlag(uint16 index, uint32 oldFlag)
std::list< HostileReference * > StorageType
void DoMeleeAttackIfReady()
void DoCast(uint32 spellId)
Unit * SelectTarget(SelectAggroTarget targetType, uint32 position=0, float dist=0.0f, bool playerOnly=false, int32 aura=0)
void DoCastVictim(uint32 spellId, bool triggered=false)
virtual void AttackStart(Unit *)
void setFaction(uint32 faction)
static Creature * GetCreature(WorldObject &object, uint64 guid)
static Unit * GetUnit(WorldObject &object, uint64 guid)
uint8 getStandState() const
InstanceScript * GetInstanceScript()
bool IsWithinDistInMap(WorldObject const *obj, float dist2compare, bool is3D=true) const
boss_grand_astromancer_capernian()
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
boss_master_engineer_telonicus()
CreatureAI * GetAI(Creature *creature) const OVERRIDE
boss_thaladred_the_darkener()
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
CreatureAI * GetAI(Creature *creature) const OVERRIDE
@ SPELL_ARCANE_DISRUPTION
@ SMSG_MOVE_UNSET_CAN_FLY
float GetOrientation() const
void DoStartNoMovement(Unit *target)
void SetCombatMovement(bool allowMovement)
void DoTeleportPlayer(Unit *unit, float x, float y, float z, float o)
bool HealthBelowPct(uint32 pct) const
void JustDied(Unit *) OVERRIDE
ScriptedAI(Creature *creature)
void AttackStart(Unit *) OVERRIDE
void AttackStart(Unit *who) OVERRIDE
void DamageTaken(Unit *killer, uint32 &damage) OVERRIDE
void MoveInLineOfSight(Unit *who) OVERRIDE
advisorbase_ai(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
InstanceScript * instance
uint32 ArcaneExplosion_Timer
uint32 Conflagration_Timer
void AttackStart(Unit *who) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void JustDied(Unit *) OVERRIDE
void EnterCombat(Unit *who) OVERRIDE
boss_grand_astromancer_capernianAI(Creature *creature)
InstanceScript * instance
uint64 m_auiAdvisorGuid[MAX_ADVISORS]
void KilledUnit(Unit *) OVERRIDE
void JustSummoned(Creature *summoned) OVERRIDE
void MoveInLineOfSight(Unit *who) OVERRIDE
void JustDied(Unit *) OVERRIDE
boss_kaelthasAI(Creature *creature)
void SummonedCreatureDespawn(Creature *summon) OVERRIDE
uint32 ArcaneDisruption_Timer
void EnterCombat(Unit *) OVERRIDE
uint32 GravityLapse_Timer
uint32 ShockBarrier_Timer
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
uint32 GravityLapse_Phase
void EnterCombat(Unit *who) OVERRIDE
void JustDied(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
boss_lord_sanguinarAI(Creature *creature)
boss_master_engineer_telonicusAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void JustDied(Unit *) OVERRIDE
void EnterCombat(Unit *who) OVERRIDE
void JustDied(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void EnterCombat(Unit *who) OVERRIDE
boss_thaladred_the_darkenerAI(Creature *creature)
void EnterCombat(Unit *) OVERRIDE
void MoveInLineOfSight(Unit *) OVERRIDE
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
npc_kael_flamestrikeAI(Creature *creature)
void AttackStart(Unit *who) OVERRIDE
void JustSummoned(Creature *summoned) OVERRIDE
void MoveInLineOfSight(Unit *) OVERRIDE
npc_phoenix_egg_tkAI(Creature *creature)
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
void UpdateAI(uint32 diff) OVERRIDE
== Triggered Actions Requested ==================
npc_phoenix_tkAI(Creature *creature)
void JustDied(Unit *) OVERRIDE
@ DATA_MASTERENGINEERTELONICUS
@ DATA_GRANDASTROMANCERCAPERNIAN
@ DATA_THALADREDTHEDARKENER