mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-02-02 18:43:48 +00:00
refactor(Core/Scripts): restyle scripts lib with astyle (#3467)
This commit is contained in:
@@ -22,7 +22,7 @@ enum BjarngrimSpells
|
||||
SPELL_BERSERKER_AURA = 41107,
|
||||
SPELL_MORTAL_STRIKE = 16856,
|
||||
SPELL_WHIRLWIND = 52027,
|
||||
|
||||
|
||||
// BATTLE STANCE
|
||||
SPELL_BATTLE_STANCE = 53792,
|
||||
SPELL_BATTLE_AURA = 41106,
|
||||
@@ -124,7 +124,7 @@ public:
|
||||
AddWaypoint(12, 1311.3f, -26.9f, 40.03f, 0);
|
||||
AddWaypoint(13, 1281.2f, -26.8f, 33.5f, 0);
|
||||
AddWaypoint(14, 1262, -26.9f, 33.5f, 0);
|
||||
|
||||
|
||||
Start(true, false, 0, NULL, false, true);
|
||||
}
|
||||
|
||||
@@ -139,9 +139,9 @@ public:
|
||||
summons.DespawnAll();
|
||||
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
if (Creature* dwarf = me->SummonCreature(NPC_STORMFORGED_LIEUTENANT, me->GetPositionX()+urand(4,12), me->GetPositionY()+urand(4,12), me->GetPositionZ()))
|
||||
if (Creature* dwarf = me->SummonCreature(NPC_STORMFORGED_LIEUTENANT, me->GetPositionX() + urand(4, 12), me->GetPositionY() + urand(4, 12), me->GetPositionZ()))
|
||||
{
|
||||
dwarf->GetMotionMaster()->MoveFollow(me, 3, rand_norm()*2*3.14f);
|
||||
dwarf->GetMotionMaster()->MoveFollow(me, 3, rand_norm() * 2 * 3.14f);
|
||||
summons.Summon(dwarf);
|
||||
}
|
||||
|
||||
@@ -167,13 +167,13 @@ public:
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_IRONFORM, 12000, STANCE_DEFENSIVE);
|
||||
|
||||
// BERSERKER STANCE
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_MORTAL_STRIKE, 20000+4000, STANCE_BERSERKER);
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_WHIRLWIND, 20000+6000, STANCE_BERSERKER);
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_MORTAL_STRIKE, 20000 + 4000, STANCE_BERSERKER);
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_WHIRLWIND, 20000 + 6000, STANCE_BERSERKER);
|
||||
|
||||
// BATTLE STANCE
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_INTERCEPT, 20000+3000, STANCE_BATTLE);
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_CLEAVE, 20000+5000, STANCE_BATTLE);
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_SLAM, 20000+10000, STANCE_BATTLE);
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_INTERCEPT, 20000 + 3000, STANCE_BATTLE);
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_CLEAVE, 20000 + 5000, STANCE_BATTLE);
|
||||
events.ScheduleEvent(EVENT_BJARNGRIM_SLAM, 20000 + 10000, STANCE_BATTLE);
|
||||
|
||||
if (m_pInstance)
|
||||
{
|
||||
@@ -219,14 +219,14 @@ public:
|
||||
|
||||
void RollStance(uint8 stance, uint8 force = 0)
|
||||
{
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
stance = (++stance == 4 ? 1 : stance);
|
||||
else
|
||||
stance = (--stance == 0 ? 3 : stance);
|
||||
|
||||
if (force)
|
||||
stance = force;
|
||||
|
||||
|
||||
switch (stance)
|
||||
{
|
||||
case STANCE_DEFENSIVE:
|
||||
@@ -306,19 +306,19 @@ public:
|
||||
///////////////////////////////////////////////////////
|
||||
case EVENT_BJARNGRIM_REFLECTION:
|
||||
me->CastSpell(me, SPELL_BJARNGRIM_REFLETION, true);
|
||||
events.RepeatEvent(8000 + rand()%1000);
|
||||
events.RepeatEvent(8000 + rand() % 1000);
|
||||
break;
|
||||
case EVENT_BJARNGRIM_PUMMEL:
|
||||
me->CastSpell(me->GetVictim(), SPELL_PUMMEL, false);
|
||||
events.RepeatEvent(10000 + rand()%1000);
|
||||
events.RepeatEvent(10000 + rand() % 1000);
|
||||
break;
|
||||
case EVENT_BJARNGRIM_KNOCK:
|
||||
me->CastSpell(me, SPELL_KNOCK_AWAY, false);
|
||||
events.RepeatEvent(20000 + rand()%1000);
|
||||
events.RepeatEvent(20000 + rand() % 1000);
|
||||
break;
|
||||
case EVENT_BJARNGRIM_IRONFORM:
|
||||
me->CastSpell(me, SPELL_IRONFORM, true);
|
||||
events.RepeatEvent(18000 + rand()%5000);
|
||||
events.RepeatEvent(18000 + rand() % 5000);
|
||||
break;
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
@@ -332,7 +332,7 @@ public:
|
||||
me->CastSpell(me, SPELL_WHIRLWIND, true);
|
||||
events.RepeatEvent(25000);
|
||||
break;
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////
|
||||
///// BATTLE STANCE
|
||||
///////////////////////////////////////////////////////
|
||||
@@ -348,7 +348,7 @@ public:
|
||||
break;
|
||||
case EVENT_BJARNGRIM_SLAM:
|
||||
me->CastSpell(me->GetVictim(), SPELL_SLAM, false);
|
||||
events.RepeatEvent(10000 + rand()%2000);
|
||||
events.RepeatEvent(10000 + rand() % 2000);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ public:
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_ARC_WELD, 2000);
|
||||
events.ScheduleEvent(EVENT_RENEW_STEEL, 10000 + rand()%1000);
|
||||
events.ScheduleEvent(EVENT_RENEW_STEEL, 10000 + rand() % 1000);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
@@ -410,7 +410,7 @@ public:
|
||||
if (bjarngrim->IsAlive())
|
||||
me->CastSpell(bjarngrim, me->GetMap()->IsHeroic() ? SPELL_RENEW_STEEL_H : SPELL_RENEW_STEEL_N, true);
|
||||
|
||||
events.RepeatEvent(10000 + rand()%4000);
|
||||
events.RepeatEvent(10000 + rand() % 4000);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -146,14 +146,14 @@ public:
|
||||
summons.Summon(spark);
|
||||
spark->CastSpell(spark, me->GetMap()->IsHeroic() ? SPELL_SPARK_VISUAL_TRIGGER_H : SPELL_SPARK_VISUAL_TRIGGER_N, true);
|
||||
spark->CastSpell(spark, SPELL_RANDOM_LIGHTNING, true);
|
||||
spark->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED|UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE);
|
||||
spark->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PACIFIED | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE);
|
||||
spark->SetHomePosition(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0);
|
||||
|
||||
if (Player* tgt = SelectTargetFromPlayerList(100))
|
||||
spark->GetMotionMaster()->MoveFollow(tgt, 0.0f, 0.0f, MOTION_SLOT_CONTROLLED);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
me->SetVisible(false);
|
||||
me->SetControlled(true, UNIT_STATE_STUNNED);
|
||||
|
||||
@@ -176,14 +176,14 @@ public:
|
||||
case EVENT_BALL_LIGHTNING:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
me->CastSpell(target, me->GetMap()->IsHeroic() ? SPELL_BALL_LIGHTNING_H : SPELL_BALL_LIGHTNING_N, false);
|
||||
|
||||
events.RepeatEvent(10000 + rand()%1000);
|
||||
|
||||
events.RepeatEvent(10000 + rand() % 1000);
|
||||
break;
|
||||
case EVENT_STATIC_OVERLOAD:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
me->CastSpell(target, me->GetMap()->IsHeroic() ? SPELL_STATIC_OVERLOAD_H : SPELL_STATIC_OVERLOAD_N, false);
|
||||
|
||||
events.RepeatEvent(5000 + rand()%1000);
|
||||
events.RepeatEvent(5000 + rand() % 1000);
|
||||
break;
|
||||
case EVENT_CHECK_HEALTH:
|
||||
if (HealthBelowPct(HealthCheck))
|
||||
@@ -192,13 +192,13 @@ public:
|
||||
events.RepeatEvent(1000);
|
||||
return;
|
||||
case EVENT_CALL_SPARKS:
|
||||
{
|
||||
EntryCheckPredicate pred(NPC_SPARK_OF_IONAR);
|
||||
summons.DoAction(ACTION_CALLBACK, pred);
|
||||
events.PopEvent();
|
||||
events.ScheduleEvent(EVENT_RESTORE, 2000, 0, 2);
|
||||
return;
|
||||
}
|
||||
{
|
||||
EntryCheckPredicate pred(NPC_SPARK_OF_IONAR);
|
||||
summons.DoAction(ACTION_CALLBACK, pred);
|
||||
events.PopEvent();
|
||||
events.ScheduleEvent(EVENT_RESTORE, 2000, 0, 2);
|
||||
return;
|
||||
}
|
||||
case EVENT_RESTORE:
|
||||
EntryCheckPredicate pred(NPC_SPARK_OF_IONAR);
|
||||
summons.DoAction(ACTION_SPARK_DESPAWN, pred);
|
||||
@@ -237,7 +237,7 @@ public:
|
||||
|
||||
void Reset() { returning = false; }
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
damage = 0;
|
||||
}
|
||||
|
||||
@@ -131,9 +131,15 @@ public:
|
||||
{
|
||||
switch(HealthCheck)
|
||||
{
|
||||
case 75: Talk(SAY_75HEALTH); break;
|
||||
case 50: Talk(SAY_50HEALTH); break;
|
||||
case 25: Talk(SAY_25HEALTH); break;
|
||||
case 75:
|
||||
Talk(SAY_75HEALTH);
|
||||
break;
|
||||
case 50:
|
||||
Talk(SAY_50HEALTH);
|
||||
break;
|
||||
case 25:
|
||||
Talk(SAY_25HEALTH);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -177,7 +183,7 @@ public:
|
||||
|
||||
me->SetControlled(false, UNIT_STATE_STUNNED);
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
|
||||
|
||||
if (Player* target = SelectTargetFromPlayerList(80))
|
||||
AttackStart(target);
|
||||
}
|
||||
@@ -238,33 +244,33 @@ public:
|
||||
|
||||
class spell_loken_pulsing_shockwave : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_loken_pulsing_shockwave() : SpellScriptLoader("spell_loken_pulsing_shockwave") { }
|
||||
public:
|
||||
spell_loken_pulsing_shockwave() : SpellScriptLoader("spell_loken_pulsing_shockwave") { }
|
||||
|
||||
class spell_loken_pulsing_shockwave_SpellScript : public SpellScript
|
||||
class spell_loken_pulsing_shockwave_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_loken_pulsing_shockwave_SpellScript);
|
||||
|
||||
void CalculateDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_loken_pulsing_shockwave_SpellScript);
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
|
||||
void CalculateDamage(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * distance));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_loken_pulsing_shockwave_SpellScript();
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * distance));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_loken_pulsing_shockwave_SpellScript::CalculateDamage, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_loken_pulsing_shockwave_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_loken()
|
||||
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
HealthCheck = 100;
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
me->SetSpeed(MOVE_RUN, 1.2f,true);
|
||||
me->SetSpeed(MOVE_RUN, 1.2f, true);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
|
||||
if (m_pInstance)
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
{
|
||||
if (me->GetPositionX() > 1330)
|
||||
x = 1355;
|
||||
else
|
||||
else
|
||||
x = 1308;
|
||||
|
||||
y = -178;
|
||||
@@ -143,7 +143,7 @@ public:
|
||||
{
|
||||
if (me->GetPositionX() > 1330)
|
||||
x = 1355;
|
||||
else
|
||||
else
|
||||
x = 1308;
|
||||
|
||||
y = -137;
|
||||
@@ -153,7 +153,7 @@ public:
|
||||
{
|
||||
if (me->GetPositionX() > 1330)
|
||||
x = 1343;
|
||||
else
|
||||
else
|
||||
x = 1320;
|
||||
|
||||
y = -123;
|
||||
@@ -214,7 +214,7 @@ public:
|
||||
|
||||
if (id == POINT_ANVIL)
|
||||
{
|
||||
me->SetSpeed(MOVE_RUN, 1.2f,true);
|
||||
me->SetSpeed(MOVE_RUN, 1.2f, true);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->CastSpell(me, SPELL_TEMPER, false);
|
||||
PointID = 0;
|
||||
@@ -233,7 +233,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_MOVE_TO_ANVIL, 0, 0, 2);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit* /*who*/, const SpellInfo *spellInfo)
|
||||
void SpellHitTarget(Unit* /*who*/, const SpellInfo* spellInfo)
|
||||
{
|
||||
if (spellInfo->Id == SPELL_TEMPER)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ public:
|
||||
{
|
||||
events.SetPhase(2);
|
||||
HealthCheck -= 20;
|
||||
me->SetSpeed(MOVE_RUN, 4.0f,true);
|
||||
me->SetSpeed(MOVE_RUN, 4.0f, true);
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
|
||||
Talk(SAY_FORGE);
|
||||
@@ -283,11 +283,11 @@ public:
|
||||
events.RepeatEvent(1000);
|
||||
return;
|
||||
case EVENT_SHATTER:
|
||||
{
|
||||
events.RepeatEvent(10000);
|
||||
summons.DoAction(ACTION_SHATTER);
|
||||
break;
|
||||
}
|
||||
{
|
||||
events.RepeatEvent(10000);
|
||||
summons.DoAction(ACTION_SHATTER);
|
||||
break;
|
||||
}
|
||||
case EVENT_MOVE_TO_ANVIL:
|
||||
GetNextPos();
|
||||
me->GetMotionMaster()->MovePoint(PointID, x, y, z);
|
||||
@@ -298,10 +298,10 @@ public:
|
||||
EnterEvadeMode();
|
||||
else
|
||||
events.RepeatEvent(4000);
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
@@ -334,7 +334,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_IMMOLATION, 3000);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &uiDamage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& uiDamage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (me->GetEntry() == NPC_BRITTLE_GOLEM)
|
||||
{
|
||||
@@ -446,7 +446,7 @@ public:
|
||||
npc_hol_monumentAI(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
_attackGUID = 0;
|
||||
_isActive = urand(0,1);
|
||||
_isActive = urand(0, 1);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->CastSpell(me, SPELL_FREEZE_ANIM, true);
|
||||
}
|
||||
@@ -480,15 +480,15 @@ public:
|
||||
events.Reset();
|
||||
if (me->GetEntry() == 28961) // NPC_TITANIUM_SIEGEBREAKER
|
||||
{
|
||||
events.ScheduleEvent(EVENT_PIERCING_HOWL, 10000+rand()%15000);
|
||||
events.ScheduleEvent(EVENT_PENETRATING_STRIKE, 5000+rand()%5000);
|
||||
events.ScheduleEvent(EVENT_FRIGHTENING_SHOUT, 20000+rand()%8000);
|
||||
events.ScheduleEvent(EVENT_PIERCING_HOWL, 10000 + rand() % 15000);
|
||||
events.ScheduleEvent(EVENT_PENETRATING_STRIKE, 5000 + rand() % 5000);
|
||||
events.ScheduleEvent(EVENT_FRIGHTENING_SHOUT, 20000 + rand() % 8000);
|
||||
events.ScheduleEvent(EVENT_BLADE_TURNING, 12000);
|
||||
}
|
||||
else
|
||||
{
|
||||
events.ScheduleEvent(EVENT_THROW, 10000+rand()%15000);
|
||||
events.ScheduleEvent(EVENT_DEADLY_THROW, 15000+rand()%15000);
|
||||
events.ScheduleEvent(EVENT_THROW, 10000 + rand() % 15000);
|
||||
events.ScheduleEvent(EVENT_DEADLY_THROW, 15000 + rand() % 15000);
|
||||
events.ScheduleEvent(EVENT_DEFLECTION, 15000);
|
||||
}
|
||||
}
|
||||
@@ -531,27 +531,27 @@ public:
|
||||
{
|
||||
case EVENT_PIERCING_HOWL:
|
||||
me->CastSpell(me->GetVictim(), SPELL_PIERCING_HOWL, false);
|
||||
events.RepeatEvent(10000+rand()%1500);
|
||||
events.RepeatEvent(10000 + rand() % 1500);
|
||||
break;
|
||||
case EVENT_PENETRATING_STRIKE:
|
||||
me->CastSpell(me->GetVictim(), SPELL_PENETRATING_STRIKE, false);
|
||||
events.RepeatEvent(5000+rand()%5000);
|
||||
events.RepeatEvent(5000 + rand() % 5000);
|
||||
break;
|
||||
case EVENT_FRIGHTENING_SHOUT:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FRIGHTENING_SHOUT, false);
|
||||
events.RepeatEvent(20000+rand()%8000);
|
||||
events.RepeatEvent(20000 + rand() % 8000);
|
||||
break;
|
||||
case EVENT_BLADE_TURNING:
|
||||
me->CastSpell(me->GetVictim(), me->GetMap()->IsHeroic() ? SPELL_BLADE_TURNING_H : SPELL_BLADE_TURNING_N, false);
|
||||
events.RepeatEvent(12000);
|
||||
break;
|
||||
case EVENT_THROW:
|
||||
me->CastSpell(SelectTarget(SELECT_TARGET_RANDOM,0,50.0f, true,0), me->GetMap()->IsHeroic() ? SPELL_THROW_H : SPELL_THROW_N, true);
|
||||
events.RepeatEvent(10000+rand()%15000);
|
||||
me->CastSpell(SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0), me->GetMap()->IsHeroic() ? SPELL_THROW_H : SPELL_THROW_N, true);
|
||||
events.RepeatEvent(10000 + rand() % 15000);
|
||||
break;
|
||||
case EVENT_DEADLY_THROW:
|
||||
me->CastSpell(SelectTarget(SELECT_TARGET_RANDOM,0,50.0f, true,0), me->GetMap()->IsHeroic() ? SPELL_DEADLY_THROW_H : SPELL_DEADLY_THROW_N, true);
|
||||
events.RepeatEvent(15000+rand()%15000);
|
||||
me->CastSpell(SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0), me->GetMap()->IsHeroic() ? SPELL_DEADLY_THROW_H : SPELL_DEADLY_THROW_N, true);
|
||||
events.RepeatEvent(15000 + rand() % 15000);
|
||||
break;
|
||||
case EVENT_DEFLECTION:
|
||||
me->CastSpell(me, me->GetMap()->IsHeroic() ? SPELL_DEFLECTION_H : SPELL_DEFLECTION_N, false);
|
||||
|
||||
@@ -173,8 +173,8 @@ public:
|
||||
OUT_SAVE_INST_DATA;
|
||||
|
||||
std::ostringstream saveStream;
|
||||
saveStream << "H L " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
|
||||
<< m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4];
|
||||
saveStream << "H L " << m_auiEncounter[0] << ' ' << m_auiEncounter[1] << ' '
|
||||
<< m_auiEncounter[2] << ' ' << m_auiEncounter[3] << ' ' << m_auiEncounter[4];
|
||||
|
||||
OUT_SAVE_INST_DATA_COMPLETE;
|
||||
return saveStream.str();
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
struct boss_krystallusAI : public ScriptedAI
|
||||
{
|
||||
boss_krystallusAI(Creature *c) : ScriptedAI(c)
|
||||
boss_krystallusAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
EventMap events;
|
||||
InstanceScript* pInstance;
|
||||
|
||||
void Reset()
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
if (pInstance)
|
||||
@@ -87,7 +87,7 @@ public:
|
||||
Map* map = me->GetMap();
|
||||
if (map->IsDungeon())
|
||||
{
|
||||
Map::PlayerList const &players = map->GetPlayers();
|
||||
Map::PlayerList const& players = map->GetPlayers();
|
||||
for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr)
|
||||
if (itr->GetSource()->IsAlive())
|
||||
itr->GetSource()->RemoveAura(GROUND_SLAM_STONED_EFFECT);
|
||||
@@ -107,47 +107,47 @@ public:
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_BOULDER:
|
||||
{
|
||||
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
me->CastSpell(target, DUNGEON_MODE(BOULDER_TOSS, BOULDER_TOSS_H), false);
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
me->CastSpell(target, DUNGEON_MODE(BOULDER_TOSS, BOULDER_TOSS_H), false);
|
||||
|
||||
events.RepeatEvent(5000 + rand()%2000);
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(5000 + rand() % 2000);
|
||||
break;
|
||||
}
|
||||
case EVENT_GROUND_SPIKE:
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), GROUND_SPIKE_H, false); // current enemy target
|
||||
events.RepeatEvent(8000 + rand()%3000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), GROUND_SPIKE_H, false); // current enemy target
|
||||
events.RepeatEvent(8000 + rand() % 3000);
|
||||
break;
|
||||
}
|
||||
case EVENT_STOMP:
|
||||
{
|
||||
me->CastSpell(me, DUNGEON_MODE(STOMP, STOMP_H), false);
|
||||
events.RepeatEvent(13000 + rand()% 5000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
me->CastSpell(me, DUNGEON_MODE(STOMP, STOMP_H), false);
|
||||
events.RepeatEvent(13000 + rand() % 5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_GROUND_SLAM:
|
||||
{
|
||||
events.RepeatEvent(10000 + rand()%3000);
|
||||
me->CastSpell(me->GetVictim(), GROUND_SLAM, true);
|
||||
events.DelayEvents(10000);
|
||||
events.RescheduleEvent(EVENT_SHATTER, 8000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
events.RepeatEvent(10000 + rand() % 3000);
|
||||
me->CastSpell(me->GetVictim(), GROUND_SLAM, true);
|
||||
events.DelayEvents(10000);
|
||||
events.RescheduleEvent(EVENT_SHATTER, 8000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHATTER:
|
||||
{
|
||||
me->CastSpell((Unit*)NULL, DUNGEON_MODE(SHATTER, SHATTER_H), false);
|
||||
Talk(SAY_SHATTER);
|
||||
events.RescheduleEvent(EVENT_REMOVE_STONED, 1500);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
{
|
||||
me->CastSpell((Unit*)NULL, DUNGEON_MODE(SHATTER, SHATTER_H), false);
|
||||
Talk(SAY_SHATTER);
|
||||
events.RescheduleEvent(EVENT_REMOVE_STONED, 1500);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
case EVENT_REMOVE_STONED:
|
||||
{
|
||||
RemoveStonedEffect();
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
{
|
||||
RemoveStonedEffect();
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -160,7 +160,7 @@ public:
|
||||
pInstance->SetData(BOSS_KRYSTALLUS, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
Talk(SAY_KILL);
|
||||
}
|
||||
@@ -170,67 +170,67 @@ public:
|
||||
|
||||
class spell_krystallus_shatter : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_krystallus_shatter() : SpellScriptLoader("spell_krystallus_shatter") { }
|
||||
public:
|
||||
spell_krystallus_shatter() : SpellScriptLoader("spell_krystallus_shatter") { }
|
||||
|
||||
class spell_krystallus_shatter_SpellScript : public SpellScript
|
||||
class spell_krystallus_shatter_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_krystallus_shatter_SpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_krystallus_shatter_SpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex /*effIndex*/)
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
if (Unit* target = GetHitUnit())
|
||||
{
|
||||
target->RemoveAurasDueToSpell(GROUND_SLAM_STONED_EFFECT);
|
||||
target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true);
|
||||
}
|
||||
target->RemoveAurasDueToSpell(GROUND_SLAM_STONED_EFFECT);
|
||||
target->CastSpell((Unit*)NULL, SPELL_SHATTER_EFFECT, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_krystallus_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_krystallus_shatter_SpellScript();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_krystallus_shatter_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_krystallus_shatter_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_krystallus_shatter_effect : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_krystallus_shatter_effect() : SpellScriptLoader("spell_krystallus_shatter_effect") { }
|
||||
public:
|
||||
spell_krystallus_shatter_effect() : SpellScriptLoader("spell_krystallus_shatter_effect") { }
|
||||
|
||||
class spell_krystallus_shatter_effect_SpellScript : public SpellScript
|
||||
class spell_krystallus_shatter_effect_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_krystallus_shatter_effect_SpellScript);
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
PrepareSpellScript(spell_krystallus_shatter_effect_SpellScript);
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
|
||||
void CalculateDamage()
|
||||
{
|
||||
if (!GetHitUnit())
|
||||
return;
|
||||
float radius = GetSpellInfo()->Effects[EFFECT_0].CalcRadius(GetCaster());
|
||||
if (!radius)
|
||||
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_krystallus_shatter_effect_SpellScript::CalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_krystallus_shatter_effect_SpellScript();
|
||||
float distance = GetCaster()->GetDistance2d(GetHitUnit());
|
||||
if (distance > 1.0f)
|
||||
SetHitDamage(int32(GetHitDamage() * ((radius - distance) / radius)));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnHit += SpellHitFn(spell_krystallus_shatter_effect_SpellScript::CalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_krystallus_shatter_effect_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_krystallus()
|
||||
|
||||
@@ -44,15 +44,15 @@ public:
|
||||
|
||||
struct boss_maiden_of_griefAI : public ScriptedAI
|
||||
{
|
||||
boss_maiden_of_griefAI(Creature *c) : ScriptedAI(c)
|
||||
{
|
||||
boss_maiden_of_griefAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
}
|
||||
|
||||
InstanceScript* pInstance;
|
||||
EventMap events;
|
||||
|
||||
void Reset()
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
if (pInstance)
|
||||
@@ -65,8 +65,8 @@ public:
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_STORM, 5000);
|
||||
events.ScheduleEvent(EVENT_SHOCK, 26000+rand()%6000);
|
||||
events.ScheduleEvent(EVENT_PILLAR, 12000+rand()%8000);
|
||||
events.ScheduleEvent(EVENT_SHOCK, 26000 + rand() % 6000);
|
||||
events.ScheduleEvent(EVENT_PILLAR, 12000 + rand() % 8000);
|
||||
events.ScheduleEvent(EVENT_PARTING, 8000);
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
@@ -90,35 +90,35 @@ public:
|
||||
switch( events.GetEvent() )
|
||||
{
|
||||
case EVENT_STORM:
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), DUNGEON_MODE(STORM_OF_GRIEF, STORM_OF_GRIEF_H), true);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), DUNGEON_MODE(STORM_OF_GRIEF, STORM_OF_GRIEF_H), true);
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHOCK:
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), DUNGEON_MODE(SHOCK_OF_SORROW, SHOCK_OF_SORROW_H), false);
|
||||
Talk(SAY_STUN);
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), DUNGEON_MODE(SHOCK_OF_SORROW, SHOCK_OF_SORROW_H), false);
|
||||
Talk(SAY_STUN);
|
||||
|
||||
events.RepeatEvent(16000+rand()%6000);
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(16000 + rand() % 6000);
|
||||
break;
|
||||
}
|
||||
case EVENT_PILLAR:
|
||||
{
|
||||
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
me->CastSpell(target, DUNGEON_MODE(PILLAR_OF_WOE, PILLAR_OF_WOE_H), false);
|
||||
|
||||
events.RepeatEvent(12000+rand()%8000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
me->CastSpell(target, DUNGEON_MODE(PILLAR_OF_WOE, PILLAR_OF_WOE_H), false);
|
||||
|
||||
events.RepeatEvent(12000 + rand() % 8000);
|
||||
break;
|
||||
}
|
||||
case EVENT_PARTING:
|
||||
{
|
||||
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
me->CastSpell(target, PARTING_SORROW, false);
|
||||
|
||||
events.RepeatEvent(6000+rand()%10000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
me->CastSpell(target, PARTING_SORROW, false);
|
||||
|
||||
events.RepeatEvent(6000 + rand() % 10000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -127,14 +127,14 @@ public:
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
Talk(SAY_DEATH);
|
||||
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(BOSS_MAIDEN_OF_GRIEF, DONE);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
|
||||
@@ -17,7 +17,7 @@ enum Spells
|
||||
SPELL_LIGHTNING_SHIELD_H = 59845,
|
||||
SPELL_STATIC_CHARGE = 50834,
|
||||
SPELL_STATIC_CHARGE_H = 59846,
|
||||
SPELL_LIGHTNING_RING = 50840,
|
||||
SPELL_LIGHTNING_RING = 50840,
|
||||
SPELL_LIGHTNING_RING_H = 59848,
|
||||
|
||||
// IRON SLUDGE
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
|
||||
struct boss_sjonnirAI : public ScriptedAI
|
||||
{
|
||||
boss_sjonnirAI(Creature *c) : ScriptedAI(c), summons(me)
|
||||
boss_sjonnirAI(Creature* c) : ScriptedAI(c), summons(me)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
uint8 SummonPhase;
|
||||
uint8 SlugeCount;
|
||||
|
||||
void Reset()
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
@@ -123,22 +123,22 @@ public:
|
||||
SlugeCount = 0;
|
||||
SummonPhase = PHASE_SUMMON_UNFRIENDLY_DWARFES;
|
||||
|
||||
if (pInstance)
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(BOSS_SJONNIR, NOT_STARTED);
|
||||
pInstance->SetData(DATA_SJONNIR_ACHIEVEMENT, false);
|
||||
|
||||
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (pInstance->GetData(BOSS_TRIBUNAL_OF_AGES) == DONE)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (GameObject *doors = me->GetMap()->GetGameObject(pInstance->GetData64(GO_SJONNIR_DOOR)))
|
||||
if (GameObject* doors = me->GetMap()->GetGameObject(pInstance->GetData64(GO_SJONNIR_DOOR)))
|
||||
doors->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
if (GameObject *console = me->GetMap()->GetGameObject( pInstance->GetData64(GO_SJONNIR_CONSOLE)))
|
||||
if (GameObject* console = me->GetMap()->GetGameObject( pInstance->GetData64(GO_SJONNIR_CONSOLE)))
|
||||
console->SetGoState(GO_STATE_READY);
|
||||
|
||||
if (Creature *brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
{
|
||||
brann->setDeathState(JUST_DIED);
|
||||
brann->Respawn();
|
||||
@@ -151,12 +151,12 @@ public:
|
||||
void EnterCombat(Unit* /*who*/)
|
||||
{
|
||||
Talk(SAY_AGGRO);
|
||||
|
||||
|
||||
events.ScheduleEvent(EVENT_CHECK_HEALTH, 1000);
|
||||
events.ScheduleEvent(EVENT_SHIELD, 14000 + rand()%5000);
|
||||
events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 6000 + rand()%6000);
|
||||
events.ScheduleEvent(EVENT_SHIELD, 14000 + rand() % 5000);
|
||||
events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 6000 + rand() % 6000);
|
||||
events.ScheduleEvent(EVENT_STATIC_CHARGE, 24000);
|
||||
events.ScheduleEvent(EVENT_LIGHTNING_RING, 25000 + rand()%6000);
|
||||
events.ScheduleEvent(EVENT_LIGHTNING_RING, 25000 + rand() % 6000);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 20000);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 21500);
|
||||
events.ScheduleEvent(EVENT_SUMMON_SPEACH, 20000);
|
||||
@@ -165,11 +165,11 @@ public:
|
||||
{
|
||||
pInstance->SetData(BOSS_SJONNIR, IN_PROGRESS);
|
||||
|
||||
if (GameObject *doors = me->GetMap()->GetGameObject(pInstance->GetData64(GO_SJONNIR_DOOR)))
|
||||
if (GameObject* doors = me->GetMap()->GetGameObject(pInstance->GetData64(GO_SJONNIR_DOOR)))
|
||||
doors->SetGoState(GO_STATE_READY);
|
||||
|
||||
|
||||
if (pInstance->GetData(BOSS_TRIBUNAL_OF_AGES) == DONE)
|
||||
if (Creature *brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
brann->AI()->DoAction(3);
|
||||
}
|
||||
}
|
||||
@@ -196,116 +196,116 @@ public:
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_CHECK_HEALTH:
|
||||
{
|
||||
if (SummonPhase == PHASE_SUMMON_UNFRIENDLY_DWARFES && HealthBelowPct(50))
|
||||
{
|
||||
SummonPhase = PHASE_SUMMON_OOZE;
|
||||
events.CancelEvent(EVENT_SUMMON);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 0);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 1500);
|
||||
|
||||
if (pInstance)
|
||||
if (Creature *brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
{
|
||||
brann->MonsterYell("What in the name o' Madoran did THAT do? Oh! Wait: I just about got it...", LANG_UNIVERSAL, 0);
|
||||
brann->PlayDirectSound(14276);
|
||||
}
|
||||
}
|
||||
|
||||
if (HealthBelowPct(20))
|
||||
{
|
||||
if (Creature *brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
if (SummonPhase == PHASE_SUMMON_UNFRIENDLY_DWARFES && HealthBelowPct(50))
|
||||
{
|
||||
brann->MonsterYell("Ha, that did it! Help's a-comin'! Take this, ya glowin' iron brute!", LANG_UNIVERSAL, 0);
|
||||
brann->PlayDirectSound(14277);
|
||||
}
|
||||
SummonPhase = PHASE_SUMMON_FRIENDLY_DWARFES;
|
||||
me->CastSpell(me, SPELL_FRENZY, false);
|
||||
SummonPhase = PHASE_SUMMON_OOZE;
|
||||
events.CancelEvent(EVENT_SUMMON);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 0);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 1500);
|
||||
|
||||
events.CancelEvent(EVENT_SUMMON);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 0);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
|
||||
events.RepeatEvent(1000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHIELD:
|
||||
{
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_LIGHTNING_SHIELD, SPELL_LIGHTNING_SHIELD_H), false);
|
||||
events.RepeatEvent(14000 + rand()%5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_CHAIN_LIGHTNING:
|
||||
{
|
||||
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_CHAIN_LIGHTNING, SPELL_CHAIN_LIGHTNING_H), false);
|
||||
|
||||
events.RepeatEvent(6000 + rand()%6000);
|
||||
break;
|
||||
}
|
||||
case EVENT_STATIC_CHARGE:
|
||||
{
|
||||
if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_STATIC_CHARGE, SPELL_STATIC_CHARGE_H), false);
|
||||
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
}
|
||||
case EVENT_LIGHTNING_RING:
|
||||
{
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_LIGHTNING_RING, SPELL_LIGHTNING_RING_H), false);
|
||||
events.RepeatEvent(25000 + rand()%6000);
|
||||
events.DelayEvents(10000); // Channel duration
|
||||
break;
|
||||
}
|
||||
case EVENT_SUMMON_SPEACH:
|
||||
{
|
||||
if (Creature *brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
{
|
||||
brann->MonsterYell("This is a wee bit trickier that before... Oh, bloody--incomin'!", LANG_UNIVERSAL, 0);
|
||||
brann->PlayDirectSound(14275);
|
||||
}
|
||||
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
case EVENT_SUMMON:
|
||||
{
|
||||
switch (SummonPhase)
|
||||
{
|
||||
case PHASE_SUMMON_UNFRIENDLY_DWARFES:
|
||||
{
|
||||
SummonDwarfes(false);
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
}
|
||||
case PHASE_SUMMON_OOZE:
|
||||
{
|
||||
for (uint8 i = POS_GEN_RIGHT; i <= POS_GEN_LEFT; i++)
|
||||
{
|
||||
if (Creature* ooze = me->SummonCreature(NPC_OOZE, RoomPosition[i].GetPositionX(), RoomPosition[i].GetPositionY(), RoomPosition[i].GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
|
||||
if (pInstance)
|
||||
if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
{
|
||||
ActivatePipe(i);
|
||||
ooze->GetMotionMaster()->MovePoint(0, RoomPosition[POS_ROOM_CENTER].GetPositionX(), RoomPosition[POS_ROOM_CENTER].GetPositionY(), RoomPosition[POS_ROOM_CENTER].GetPositionZ());
|
||||
summons.Summon(ooze);
|
||||
brann->MonsterYell("What in the name o' Madoran did THAT do? Oh! Wait: I just about got it...", LANG_UNIVERSAL, 0);
|
||||
brann->PlayDirectSound(14276);
|
||||
}
|
||||
}
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
}
|
||||
case PHASE_SUMMON_FRIENDLY_DWARFES:
|
||||
|
||||
if (HealthBelowPct(20))
|
||||
{
|
||||
SummonDwarfes(true);
|
||||
if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
{
|
||||
brann->MonsterYell("Ha, that did it! Help's a-comin'! Take this, ya glowin' iron brute!", LANG_UNIVERSAL, 0);
|
||||
brann->PlayDirectSound(14277);
|
||||
}
|
||||
SummonPhase = PHASE_SUMMON_FRIENDLY_DWARFES;
|
||||
me->CastSpell(me, SPELL_FRENZY, false);
|
||||
|
||||
events.CancelEvent(EVENT_SUMMON);
|
||||
events.ScheduleEvent(EVENT_SUMMON, 0);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
|
||||
events.RepeatEvent(1000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHIELD:
|
||||
{
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_LIGHTNING_SHIELD, SPELL_LIGHTNING_SHIELD_H), false);
|
||||
events.RepeatEvent(14000 + rand() % 5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_CHAIN_LIGHTNING:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_CHAIN_LIGHTNING, SPELL_CHAIN_LIGHTNING_H), false);
|
||||
|
||||
events.RepeatEvent(6000 + rand() % 6000);
|
||||
break;
|
||||
}
|
||||
case EVENT_STATIC_CHARGE:
|
||||
{
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50.0f, true, 0))
|
||||
me->CastSpell(target, DUNGEON_MODE(SPELL_STATIC_CHARGE, SPELL_STATIC_CHARGE_H), false);
|
||||
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
}
|
||||
case EVENT_LIGHTNING_RING:
|
||||
{
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_LIGHTNING_RING, SPELL_LIGHTNING_RING_H), false);
|
||||
events.RepeatEvent(25000 + rand() % 6000);
|
||||
events.DelayEvents(10000); // Channel duration
|
||||
break;
|
||||
}
|
||||
case EVENT_SUMMON_SPEACH:
|
||||
{
|
||||
if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
{
|
||||
brann->MonsterYell("This is a wee bit trickier that before... Oh, bloody--incomin'!", LANG_UNIVERSAL, 0);
|
||||
brann->PlayDirectSound(14275);
|
||||
}
|
||||
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
case EVENT_SUMMON:
|
||||
{
|
||||
switch (SummonPhase)
|
||||
{
|
||||
case PHASE_SUMMON_UNFRIENDLY_DWARFES:
|
||||
{
|
||||
SummonDwarfes(false);
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
}
|
||||
case PHASE_SUMMON_OOZE:
|
||||
{
|
||||
for (uint8 i = POS_GEN_RIGHT; i <= POS_GEN_LEFT; i++)
|
||||
{
|
||||
if (Creature* ooze = me->SummonCreature(NPC_OOZE, RoomPosition[i].GetPositionX(), RoomPosition[i].GetPositionY(), RoomPosition[i].GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
|
||||
{
|
||||
ActivatePipe(i);
|
||||
ooze->GetMotionMaster()->MovePoint(0, RoomPosition[POS_ROOM_CENTER].GetPositionX(), RoomPosition[POS_ROOM_CENTER].GetPositionY(), RoomPosition[POS_ROOM_CENTER].GetPositionZ());
|
||||
summons.Summon(ooze);
|
||||
}
|
||||
}
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
}
|
||||
case PHASE_SUMMON_FRIENDLY_DWARFES:
|
||||
{
|
||||
SummonDwarfes(true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
@@ -317,17 +317,17 @@ public:
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(BOSS_SJONNIR, DONE);
|
||||
if (GameObject *sd = me->GetMap()->GetGameObject(pInstance->GetData64(GO_SJONNIR_DOOR)))
|
||||
if (GameObject* sd = me->GetMap()->GetGameObject(pInstance->GetData64(GO_SJONNIR_DOOR)))
|
||||
sd->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
if (Creature *brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
brann->AI()->DoAction(4);
|
||||
}
|
||||
}
|
||||
|
||||
void KilledUnit(Unit * /*victim*/)
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
@@ -336,7 +336,7 @@ public:
|
||||
void ActivatePipe(uint8 side)
|
||||
{
|
||||
if (pInstance)
|
||||
if (GameObject *pipe = me->GetMap()->GetGameObject(pInstance->GetData64(side == POS_GEN_RIGHT ? GO_RIGHT_PIPE : GO_LEFT_PIPE)))
|
||||
if (GameObject* pipe = me->GetMap()->GetGameObject(pInstance->GetData64(side == POS_GEN_RIGHT ? GO_RIGHT_PIPE : GO_LEFT_PIPE)))
|
||||
pipe->SendCustomAnim(0);
|
||||
}
|
||||
|
||||
@@ -347,9 +347,9 @@ public:
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
uint8 Pos = urand(POS_GEN_RIGHT, POS_GEN_LEFT);
|
||||
if (Creature* dwarf = me->SummonCreature(NPC_DWARFES_FRIENDLY, RoomPosition[Pos].GetPositionX(), RoomPosition[Pos].GetPositionY() , RoomPosition[Pos].GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
|
||||
if (Creature* dwarf = me->SummonCreature(NPC_DWARFES_FRIENDLY, RoomPosition[Pos].GetPositionX(), RoomPosition[Pos].GetPositionY(), RoomPosition[Pos].GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
|
||||
{
|
||||
if (Player *plr = SelectTargetFromPlayerList(100.0f))
|
||||
if (Player* plr = SelectTargetFromPlayerList(100.0f))
|
||||
dwarf->setFaction(plr->getFaction());
|
||||
|
||||
ActivatePipe(Pos);
|
||||
@@ -363,7 +363,7 @@ public:
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
uint8 Pos = urand(POS_GEN_RIGHT, POS_GEN_LEFT);
|
||||
if (Creature* dwarf = me->SummonCreature(urand(0,1) ? NPC_FORGED_IRON_TROGG : NPC_FORGED_IRON_DWARF, RoomPosition[Pos].GetPositionX(), RoomPosition[Pos].GetPositionY() , RoomPosition[Pos].GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
|
||||
if (Creature* dwarf = me->SummonCreature(urand(0, 1) ? NPC_FORGED_IRON_TROGG : NPC_FORGED_IRON_DWARF, RoomPosition[Pos].GetPositionX(), RoomPosition[Pos].GetPositionY(), RoomPosition[Pos].GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000))
|
||||
{
|
||||
ActivatePipe(Pos);
|
||||
dwarf->SetInCombatWithZone();
|
||||
@@ -387,12 +387,12 @@ public:
|
||||
|
||||
struct boss_sjonnir_dwarfAI : public ScriptedAI
|
||||
{
|
||||
boss_sjonnir_dwarfAI(Creature *c) : ScriptedAI(c) { }
|
||||
boss_sjonnir_dwarfAI(Creature* c) : ScriptedAI(c) { }
|
||||
|
||||
void UpdateAI(uint32 /*diff*/)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
return;
|
||||
|
||||
DoSpellAttackIfReady((me->GetEntry() == NPC_FORGED_IRON_DWARF) ? DUNGEON_MODE(SPELL_LIGHTNING_TETHER, SPELL_LIGHTNING_TETHER_H) : DUNGEON_MODE(SPELL_LIGHTNING_SHOCK, SPELL_LIGHTNING_SHOCK_H));
|
||||
}
|
||||
@@ -411,28 +411,28 @@ public:
|
||||
|
||||
struct boss_sjonnir_iron_sludgeAI : public ScriptedAI
|
||||
{
|
||||
boss_sjonnir_iron_sludgeAI(Creature *c) : ScriptedAI(c) { }
|
||||
|
||||
boss_sjonnir_iron_sludgeAI(Creature* c) : ScriptedAI(c) { }
|
||||
|
||||
EventMap events;
|
||||
void Reset()
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *)
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_TOXIC_VOLLEY, 5000);
|
||||
}
|
||||
void JustDied(Unit* /*killer*/)
|
||||
{
|
||||
if (InstanceScript *pInstance = me->GetInstanceScript())
|
||||
if (Creature *sjonnir = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_SJONNIR)))
|
||||
if (InstanceScript* pInstance = me->GetInstanceScript())
|
||||
if (Creature* sjonnir = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_SJONNIR)))
|
||||
sjonnir->AI()->DoAction(ACTION_SLUG_KILLED);
|
||||
}
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
@@ -442,11 +442,11 @@ public:
|
||||
{
|
||||
// Every 5 seconds
|
||||
case EVENT_TOXIC_VOLLEY:
|
||||
{
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_TOXIC_VOLLEY, SPELL_TOXIC_VOLLEY_H), false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
me->CastSpell(me, DUNGEON_MODE(SPELL_TOXIC_VOLLEY, SPELL_TOXIC_VOLLEY_H), false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -467,7 +467,7 @@ public:
|
||||
|
||||
struct boss_sjonnir_malformed_oozeAI : public ScriptedAI
|
||||
{
|
||||
boss_sjonnir_malformed_oozeAI(Creature *c) : ScriptedAI(c) { }
|
||||
boss_sjonnir_malformed_oozeAI(Creature* c) : ScriptedAI(c) { }
|
||||
|
||||
EventMap events;
|
||||
void MovementInform(uint32 type, uint32 point)
|
||||
@@ -476,8 +476,8 @@ public:
|
||||
events.RescheduleEvent(EVENT_MALFORMED_OOZE_CHECK, 1000);
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *) { }
|
||||
void MoveInLineOfSight(Unit *) { }
|
||||
void EnterCombat(Unit*) { }
|
||||
void MoveInLineOfSight(Unit*) { }
|
||||
|
||||
void UpdateAI(uint32 diff)
|
||||
{
|
||||
@@ -485,22 +485,22 @@ public:
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_MALFORMED_OOZE_CHECK:
|
||||
{
|
||||
std::list<Creature*> oozeList;
|
||||
me->GetCreaturesWithEntryInRange(oozeList, 5.0f, NPC_OOZE);
|
||||
for (std::list<Creature*>::const_iterator itr = oozeList.begin(); itr != oozeList.end(); ++itr)
|
||||
if ((*itr)->GetGUID() != me->GetGUID() && (*itr)->IsAlive() && me->IsAlive())
|
||||
if (Creature* is = me->SummonCreature(NPC_IRON_SLUDGE, me->GetPositionX(), me->GetPositionY() , me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000))
|
||||
{
|
||||
Unit::Kill(me, me);
|
||||
Unit::Kill(*itr, *itr);
|
||||
is->SetInCombatWithZone();
|
||||
break;
|
||||
}
|
||||
{
|
||||
std::list<Creature*> oozeList;
|
||||
me->GetCreaturesWithEntryInRange(oozeList, 5.0f, NPC_OOZE);
|
||||
for (std::list<Creature*>::const_iterator itr = oozeList.begin(); itr != oozeList.end(); ++itr)
|
||||
if ((*itr)->GetGUID() != me->GetGUID() && (*itr)->IsAlive() && me->IsAlive())
|
||||
if (Creature* is = me->SummonCreature(NPC_IRON_SLUDGE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000))
|
||||
{
|
||||
Unit::Kill(me, me);
|
||||
Unit::Kill(*itr, *itr);
|
||||
is->SetInCombatWithZone();
|
||||
break;
|
||||
}
|
||||
|
||||
events.RepeatEvent(1000);
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(1000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -101,7 +101,7 @@ struct Yells
|
||||
uint32 creature, timer;
|
||||
};
|
||||
|
||||
static Yells Conversation[]=
|
||||
static Yells Conversation[] =
|
||||
{
|
||||
{14259, "Time to get some answers! Let's get this show on the road!", NPC_BRANN, 0},
|
||||
{14247, "Take a moment and relish this with me. Soon... all will be revealed. Okay then, let's do this!", NPC_BRANN, 5000},
|
||||
@@ -161,22 +161,23 @@ public:
|
||||
uint32 brann = pInstance->GetData(BRANN_BRONZEBEARD);
|
||||
switch (brann)
|
||||
{
|
||||
case 1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
break;
|
||||
case 2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
|
||||
break;
|
||||
case 3:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
|
||||
break;
|
||||
case 4:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
|
||||
break;
|
||||
case 5:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
break;
|
||||
default: break;
|
||||
case 1:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
break;
|
||||
case 2:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
|
||||
break;
|
||||
case 3:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
|
||||
break;
|
||||
case 4:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
|
||||
break;
|
||||
case 5:
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, GOSSIP_ITEM_4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -184,32 +185,32 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player *player, Creature *creature, uint32 /*sender*/, uint32 action) override
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action) override
|
||||
{
|
||||
if (action)
|
||||
{
|
||||
switch (action)
|
||||
{
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
creature->AI()->DoAction(ACTION_START_EVENT);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
creature->AI()->DoAction(ACTION_START_TRIBUNAL);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
creature->AI()->DoAction(ACTION_GO_TO_SJONNIR);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
creature->AI()->DoAction(ACTION_WIPE_START);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+5:
|
||||
creature->AI()->DoAction(ACTION_OPEN_DOOR);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+1:
|
||||
creature->AI()->DoAction(ACTION_START_EVENT);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+2:
|
||||
creature->AI()->DoAction(ACTION_START_TRIBUNAL);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+3:
|
||||
creature->AI()->DoAction(ACTION_GO_TO_SJONNIR);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+4:
|
||||
creature->AI()->DoAction(ACTION_WIPE_START);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case GOSSIP_ACTION_INFO_DEF+5:
|
||||
creature->AI()->DoAction(ACTION_OPEN_DOOR);
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -223,7 +224,7 @@ public:
|
||||
struct brann_bronzebeardAI : public npc_escortAI
|
||||
{
|
||||
|
||||
brann_bronzebeardAI(Creature *c) : npc_escortAI(c), summons(me)
|
||||
brann_bronzebeardAI(Creature* c) : npc_escortAI(c), summons(me)
|
||||
{
|
||||
AbedneumGUID = MarnakGUID = KaddrakGUID = 0;
|
||||
pInstance = c->GetInstanceScript();
|
||||
@@ -242,7 +243,7 @@ public:
|
||||
|
||||
void DespawnHeads()
|
||||
{
|
||||
Creature *cr;
|
||||
Creature* cr;
|
||||
if ((cr = GetAbedneum())) cr->DespawnOrUnsummon();
|
||||
if ((cr = GetMarnak())) cr->DespawnOrUnsummon();
|
||||
if ((cr = GetKaddrak())) cr->DespawnOrUnsummon();
|
||||
@@ -254,7 +255,7 @@ public:
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
GameObject *go = nullptr;
|
||||
GameObject* go = nullptr;
|
||||
if (headMask & 0x1) // Kaddrak
|
||||
if ((go = me->GetMap()->GetGameObject(pInstance->GetData64(GO_KADDRAK))))
|
||||
activate ? go->SendCustomAnim(0) : go->SetGoState(GO_STATE_READY);
|
||||
@@ -270,7 +271,7 @@ public:
|
||||
|
||||
void ResetEvent()
|
||||
{
|
||||
if (GameObject *tribunal = ObjectAccessor::GetGameObject(*me, pInstance->GetData64(GO_TRIBUNAL_CONSOLE)))
|
||||
if (GameObject* tribunal = ObjectAccessor::GetGameObject(*me, pInstance->GetData64(GO_TRIBUNAL_CONSOLE)))
|
||||
tribunal->SetGoState(GO_STATE_READY);
|
||||
|
||||
events.Reset();
|
||||
@@ -291,7 +292,7 @@ public:
|
||||
Creature* GetKaddrak() { return ObjectAccessor::GetCreature(*me, KaddrakGUID); }
|
||||
|
||||
void MoveInLineOfSight(Unit* /*pWho*/) override { }
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask) override
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask) override
|
||||
{
|
||||
if (damage && pInstance)
|
||||
pInstance->SetData(DATA_BRANN_ACHIEVEMENT, false);
|
||||
@@ -326,8 +327,8 @@ public:
|
||||
Start(false, true, 0, 0, true, false);
|
||||
break;
|
||||
case ACTION_START_TRIBUNAL:
|
||||
{
|
||||
Map::PlayerList const &PlayerList = me->GetMap()->GetPlayers();
|
||||
{
|
||||
Map::PlayerList const& PlayerList = me->GetMap()->GetPlayers();
|
||||
if (!PlayerList.isEmpty())
|
||||
for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i)
|
||||
{
|
||||
@@ -335,11 +336,11 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
SetEscortPaused(false);
|
||||
InitializeEvent();
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
break;
|
||||
}
|
||||
SetEscortPaused(false);
|
||||
InitializeEvent();
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
break;
|
||||
}
|
||||
case ACTION_GO_TO_SJONNIR:
|
||||
SetEscortPaused(false);
|
||||
ResetEvent();
|
||||
@@ -370,7 +371,7 @@ public:
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
break;
|
||||
case ACTION_OPEN_DOOR:
|
||||
if (GameObject *door = ObjectAccessor::GetGameObject(*me, pInstance->GetData64(GO_SJONNIR_DOOR)))
|
||||
if (GameObject* door = ObjectAccessor::GetGameObject(*me, pInstance->GetData64(GO_SJONNIR_DOOR)))
|
||||
door->SetGoState(GO_STATE_ACTIVE);
|
||||
SetEscortPaused(false);
|
||||
me->RemoveAura(58506);
|
||||
@@ -392,152 +393,152 @@ public:
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_KADDRAK_VISUAL:
|
||||
{
|
||||
SwitchHeadVisaul(0x1, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
{
|
||||
SwitchHeadVisaul(0x1, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
case EVENT_MARNAK_VISUAL:
|
||||
{
|
||||
SwitchHeadVisaul(0x2, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
{
|
||||
SwitchHeadVisaul(0x2, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
case EVENT_ABEDNEUM_VISUAL:
|
||||
{
|
||||
SwitchHeadVisaul(0x4, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
{
|
||||
SwitchHeadVisaul(0x4, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
case EVENT_KADDRAK_HEAD: // First
|
||||
{
|
||||
if (Creature *kaddrak = GetKaddrak())
|
||||
{
|
||||
if (Player *plr = SelectTargetFromPlayerList(100.0f))
|
||||
kaddrak->CastSpell(plr, DUNGEON_MODE(SPELL_GLARE_OF_THE_TRIBUNAL, SPELL_GLARE_OF_THE_TRIBUNAL_H), true);
|
||||
}
|
||||
|
||||
events.RescheduleEvent(EVENT_KADDRAK_SWITCH_EYE, 1500);
|
||||
events.RepeatEvent(2000+urand(0,2000));
|
||||
break;
|
||||
}
|
||||
case EVENT_KADDRAK_SWITCH_EYE:
|
||||
{
|
||||
if (Creature *kaddrak = GetKaddrak())
|
||||
{
|
||||
if (urand(0,1))
|
||||
kaddrak->UpdatePosition(927.9f, 330.9f, 219.4f, 2.4f, true);
|
||||
else
|
||||
kaddrak->UpdatePosition(923.7f, 326.9f, 219.5f, 2.1f, true);
|
||||
|
||||
kaddrak->StopMovingOnCurrentPos();
|
||||
}
|
||||
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
case EVENT_MARNAK_HEAD: // Second
|
||||
{
|
||||
if (Creature *marnak = GetMarnak())
|
||||
{
|
||||
if (Creature *cr = me->SummonCreature(NPC_DARK_MATTER_TRIGGER, marnak->GetPositionX(), marnak->GetPositionY(), marnak->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 7000))
|
||||
if (Creature* kaddrak = GetKaddrak())
|
||||
{
|
||||
cr->CastSpell(cr, SPELL_DARK_MATTER_VISUAL, true);
|
||||
if (Player *plr = SelectTargetFromPlayerList(100.0f))
|
||||
if (Player* plr = SelectTargetFromPlayerList(100.0f))
|
||||
kaddrak->CastSpell(plr, DUNGEON_MODE(SPELL_GLARE_OF_THE_TRIBUNAL, SPELL_GLARE_OF_THE_TRIBUNAL_H), true);
|
||||
}
|
||||
|
||||
events.RescheduleEvent(EVENT_KADDRAK_SWITCH_EYE, 1500);
|
||||
events.RepeatEvent(2000 + urand(0, 2000));
|
||||
break;
|
||||
}
|
||||
case EVENT_KADDRAK_SWITCH_EYE:
|
||||
{
|
||||
if (Creature* kaddrak = GetKaddrak())
|
||||
{
|
||||
if (urand(0, 1))
|
||||
kaddrak->UpdatePosition(927.9f, 330.9f, 219.4f, 2.4f, true);
|
||||
else
|
||||
kaddrak->UpdatePosition(923.7f, 326.9f, 219.5f, 2.1f, true);
|
||||
|
||||
kaddrak->StopMovingOnCurrentPos();
|
||||
}
|
||||
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
case EVENT_MARNAK_HEAD: // Second
|
||||
{
|
||||
if (Creature* marnak = GetMarnak())
|
||||
{
|
||||
if (Creature* cr = me->SummonCreature(NPC_DARK_MATTER_TRIGGER, marnak->GetPositionX(), marnak->GetPositionY(), marnak->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 7000))
|
||||
{
|
||||
float speed = me->GetDistance(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ()) / (4000.0f * 0.001f);
|
||||
cr->MonsterMoveWithSpeed(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), speed);
|
||||
cr->CastSpell(cr, SPELL_DARK_MATTER_VISUAL, true);
|
||||
if (Player* plr = SelectTargetFromPlayerList(100.0f))
|
||||
{
|
||||
float speed = me->GetDistance(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ()) / (4000.0f * 0.001f);
|
||||
cr->MonsterMoveWithSpeed(plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), speed);
|
||||
}
|
||||
}
|
||||
}
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(20000);
|
||||
break;
|
||||
}
|
||||
case EVENT_ABEDNEUM_HEAD: // Third
|
||||
{
|
||||
if (GetAbedneum())
|
||||
{
|
||||
Player *plr = SelectTargetFromPlayerList(100.0f);
|
||||
if (!plr)
|
||||
break;
|
||||
|
||||
if (Creature *cr = me->SummonCreature(NPC_SEARING_GAZE_TRIGGER, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000))
|
||||
if (GetAbedneum())
|
||||
{
|
||||
// summon another abedneum to create double beam, despawn just after trigger despawn
|
||||
me->SummonCreature(NPC_ABEDNEUM, 897.0f, 326.9f, 223.5f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 12000);
|
||||
cr->CastSpell(cr, DUNGEON_MODE(SPELL_SEARING_GAZE, SPELL_SEARING_GAZE_H), true);
|
||||
Player* plr = SelectTargetFromPlayerList(100.0f);
|
||||
if (!plr)
|
||||
break;
|
||||
|
||||
if (Creature* cr = me->SummonCreature(NPC_SEARING_GAZE_TRIGGER, plr->GetPositionX(), plr->GetPositionY(), plr->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 10000))
|
||||
{
|
||||
// summon another abedneum to create double beam, despawn just after trigger despawn
|
||||
me->SummonCreature(NPC_ABEDNEUM, 897.0f, 326.9f, 223.5f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 12000);
|
||||
cr->CastSpell(cr, DUNGEON_MODE(SPELL_SEARING_GAZE, SPELL_SEARING_GAZE_H), true);
|
||||
}
|
||||
}
|
||||
events.RepeatEvent(30000);
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(30000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SUMMON_MONSTERS:
|
||||
{
|
||||
uint32 Time = 45000 - (2500*WaveNum);
|
||||
SummonCreatures(NPC_DARK_RUNE_PROTECTOR, 3);
|
||||
if (WaveNum > 2)
|
||||
SummonCreatures(NPC_DARK_RUNE_STORMCALLER, 2);
|
||||
if (WaveNum > 5)
|
||||
SummonCreatures(NPC_IRON_GOLEM_CUSTODIAN, 1);
|
||||
|
||||
WaveNum++;
|
||||
events.RepeatEvent(Time);
|
||||
break;
|
||||
}
|
||||
case EVENT_TRIBUNAL_END:
|
||||
{
|
||||
// Has to be here!
|
||||
events.Reset();
|
||||
//DespawnHeads();
|
||||
summons.DespawnAll();
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, DONE);
|
||||
pInstance->SetData(BRANN_BRONZEBEARD, 3);
|
||||
me->CastSpell(me, 59046, true); // credit
|
||||
uint32 Time = 45000 - (2500 * WaveNum);
|
||||
SummonCreatures(NPC_DARK_RUNE_PROTECTOR, 3);
|
||||
if (WaveNum > 2)
|
||||
SummonCreatures(NPC_DARK_RUNE_STORMCALLER, 2);
|
||||
if (WaveNum > 5)
|
||||
SummonCreatures(NPC_IRON_GOLEM_CUSTODIAN, 1);
|
||||
|
||||
WaveNum++;
|
||||
events.RepeatEvent(Time);
|
||||
break;
|
||||
}
|
||||
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
|
||||
|
||||
// Spawn Chest and quest credit
|
||||
if (Player *plr = SelectTargetFromPlayerList(200.0f))
|
||||
case EVENT_TRIBUNAL_END:
|
||||
{
|
||||
if (GameObject* go = plr->SummonGameObject((IsHeroic() ? GO_TRIBUNAL_CHEST_H : GO_TRIBUNAL_CHEST), 880.406f, 345.164f, 203.706f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0))
|
||||
// Has to be here!
|
||||
events.Reset();
|
||||
//DespawnHeads();
|
||||
summons.DespawnAll();
|
||||
|
||||
if (pInstance)
|
||||
{
|
||||
plr->RemoveGameObject(go, false);
|
||||
go->SetLootMode(1);
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
|
||||
pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, DONE);
|
||||
pInstance->SetData(BRANN_BRONZEBEARD, 3);
|
||||
me->CastSpell(me, 59046, true); // credit
|
||||
}
|
||||
|
||||
plr->GroupEventHappens(QUEST_HALLS_OF_STONE, me);
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
|
||||
|
||||
// Spawn Chest and quest credit
|
||||
if (Player* plr = SelectTargetFromPlayerList(200.0f))
|
||||
{
|
||||
if (GameObject* go = plr->SummonGameObject((IsHeroic() ? GO_TRIBUNAL_CHEST_H : GO_TRIBUNAL_CHEST), 880.406f, 345.164f, 203.706f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0))
|
||||
{
|
||||
plr->RemoveGameObject(go, false);
|
||||
go->SetLootMode(1);
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
|
||||
}
|
||||
|
||||
plr->GroupEventHappens(QUEST_HALLS_OF_STONE, me);
|
||||
}
|
||||
|
||||
events.ScheduleEvent(EVENT_GO_TO_SJONNIR, 279000);
|
||||
break;
|
||||
}
|
||||
|
||||
events.ScheduleEvent(EVENT_GO_TO_SJONNIR, 279000);
|
||||
break;
|
||||
}
|
||||
case EVENT_GO_TO_SJONNIR:
|
||||
{
|
||||
{
|
||||
|
||||
if (GameObject *door = ObjectAccessor::GetGameObject(*me, pInstance->GetData64(GO_SJONNIR_DOOR)))
|
||||
door->SetGoState(GO_STATE_ACTIVE);
|
||||
SetEscortPaused(false);
|
||||
ResetEvent();
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
break;
|
||||
}
|
||||
if (GameObject* door = ObjectAccessor::GetGameObject(*me, pInstance->GetData64(GO_SJONNIR_DOOR)))
|
||||
door->SetGoState(GO_STATE_ACTIVE);
|
||||
SetEscortPaused(false);
|
||||
ResetEvent();
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE);
|
||||
break;
|
||||
}
|
||||
case EVENT_END:
|
||||
{
|
||||
events.Reset();
|
||||
if (pInstance)
|
||||
pInstance->SetData(BRANN_BRONZEBEARD, 6);
|
||||
{
|
||||
events.Reset();
|
||||
if (pInstance)
|
||||
pInstance->SetData(BRANN_BRONZEBEARD, 6);
|
||||
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->MonsterYell("I'll use the forge to make batches o' earthen to stand guard... But our greatest challenge still remains: find and stop Loken!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(14279);
|
||||
break;
|
||||
}
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
me->MonsterYell("I'll use the forge to make batches o' earthen to stand guard... But our greatest challenge still remains: find and stop Loken!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(14279);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (TalkEvent)
|
||||
@@ -548,10 +549,18 @@ public:
|
||||
Creature* cs = nullptr;
|
||||
switch (Conversation[SpeechCount].creature)
|
||||
{
|
||||
case NPC_BRANN: cs = me; break;
|
||||
case NPC_ABEDNEUM: cs = GetAbedneum(); break;
|
||||
case NPC_KADDRAK: cs = GetKaddrak(); break;
|
||||
case NPC_MARNAK: cs = GetMarnak(); break;
|
||||
case NPC_BRANN:
|
||||
cs = me;
|
||||
break;
|
||||
case NPC_ABEDNEUM:
|
||||
cs = GetAbedneum();
|
||||
break;
|
||||
case NPC_KADDRAK:
|
||||
cs = GetKaddrak();
|
||||
break;
|
||||
case NPC_MARNAK:
|
||||
cs = GetMarnak();
|
||||
break;
|
||||
}
|
||||
|
||||
if (cs)
|
||||
@@ -567,12 +576,12 @@ public:
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void SummonCreatures(uint32 entry, uint8 count)
|
||||
{
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
Creature* cr = me->SummonCreature(entry, 946.5971f+urand(0,6), 383.5330f+urand(0,6), 205.9943f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000);
|
||||
Creature* cr = me->SummonCreature(entry, 946.5971f + urand(0, 6), 383.5330f + urand(0, 6), 205.9943f, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 20000);
|
||||
if(cr)
|
||||
{
|
||||
cr->AI()->AttackStart(me);
|
||||
@@ -587,7 +596,7 @@ public:
|
||||
ResetEvent();
|
||||
if(pInstance)
|
||||
{
|
||||
if (Creature *brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
if (Creature* brann = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_BRANN)))
|
||||
{
|
||||
brann->setDeathState(JUST_DIED);
|
||||
brann->Respawn();
|
||||
@@ -652,7 +661,7 @@ void brann_bronzebeard::brann_bronzebeardAI::WaypointReached(uint32 id)
|
||||
if(pInstance)
|
||||
{
|
||||
pInstance->SetData(BOSS_TRIBUNAL_OF_AGES, IN_PROGRESS);
|
||||
if (GameObject *tribunal = ObjectAccessor::GetGameObject(*me, pInstance->GetData64(GO_TRIBUNAL_CONSOLE)))
|
||||
if (GameObject* tribunal = ObjectAccessor::GetGameObject(*me, pInstance->GetData64(GO_TRIBUNAL_CONSOLE)))
|
||||
tribunal->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
break;
|
||||
@@ -663,7 +672,7 @@ void brann_bronzebeard::brann_bronzebeardAI::WaypointReached(uint32 id)
|
||||
{
|
||||
pInstance->SetData(BRANN_BRONZEBEARD, 5);
|
||||
me->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP | UNIT_NPC_FLAG_QUESTGIVER);
|
||||
if (Creature *cr = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_SJONNIR)))
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*me, pInstance->GetData64(NPC_SJONNIR)))
|
||||
cr->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
me->SetOrientation(3.132660f);
|
||||
DoCast(me, 58506, false);
|
||||
@@ -676,7 +685,7 @@ void brann_bronzebeard::brann_bronzebeardAI::WaypointReached(uint32 id)
|
||||
SetEscortPaused(true);
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_USE_STANDING);
|
||||
if (pInstance)
|
||||
if (GameObject *console = ObjectAccessor::GetGameObject(*me, pInstance->GetData64(GO_SJONNIR_CONSOLE)))
|
||||
if (GameObject* console = ObjectAccessor::GetGameObject(*me, pInstance->GetData64(GO_SJONNIR_CONSOLE)))
|
||||
console->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
break;
|
||||
@@ -695,7 +704,7 @@ public:
|
||||
|
||||
struct dark_rune_protectorsAI : public ScriptedAI
|
||||
{
|
||||
dark_rune_protectorsAI(Creature *c) : ScriptedAI(c) { }
|
||||
dark_rune_protectorsAI(Creature* c) : ScriptedAI(c) { }
|
||||
|
||||
EventMap events;
|
||||
void Reset()
|
||||
@@ -703,7 +712,7 @@ public:
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *)
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_DRP_CHARGE, 10000);
|
||||
events.ScheduleEvent(EVENT_DRP_CLEAVE, 7000);
|
||||
@@ -721,19 +730,19 @@ public:
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_DRP_CHARGE:
|
||||
{
|
||||
if (Unit *tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(tgt, SPELL_DRP_CHARGE, false);
|
||||
{
|
||||
if (Unit* tgt = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(tgt, SPELL_DRP_CHARGE, false);
|
||||
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
}
|
||||
case EVENT_DRP_CLEAVE:
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), SPELL_DRP_CLEAVE, false);
|
||||
events.RepeatEvent(7000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), SPELL_DRP_CLEAVE, false);
|
||||
events.RepeatEvent(7000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -753,7 +762,7 @@ public:
|
||||
|
||||
struct dark_rune_stormcallerAI : public ScriptedAI
|
||||
{
|
||||
dark_rune_stormcallerAI(Creature *c) : ScriptedAI(c) { }
|
||||
dark_rune_stormcallerAI(Creature* c) : ScriptedAI(c) { }
|
||||
|
||||
EventMap events;
|
||||
void Reset()
|
||||
@@ -761,7 +770,7 @@ public:
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *)
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_DRS_LIGHTNING_BOLD, 5000);
|
||||
events.ScheduleEvent(EVENT_DRS_SHADOW_WORD_PAIN, 12000);
|
||||
@@ -779,17 +788,17 @@ public:
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_DRS_LIGHTNING_BOLD:
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), IsHeroic() ? SPELL_DRS_LIGHTING_BOLT_H : SPELL_DRS_LIGHTING_BOLT, false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), IsHeroic() ? SPELL_DRS_LIGHTING_BOLT_H : SPELL_DRS_LIGHTING_BOLT, false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
}
|
||||
case EVENT_DRS_SHADOW_WORD_PAIN:
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), IsHeroic() ? SPELL_DRS_SHADOW_WORD_PAIN_H : SPELL_DRS_SHADOW_WORD_PAIN, false);
|
||||
events.RepeatEvent(12000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), IsHeroic() ? SPELL_DRS_SHADOW_WORD_PAIN_H : SPELL_DRS_SHADOW_WORD_PAIN, false);
|
||||
events.RepeatEvent(12000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -809,14 +818,14 @@ public:
|
||||
|
||||
struct iron_golem_custodianAI : public ScriptedAI
|
||||
{
|
||||
iron_golem_custodianAI(Creature *c) : ScriptedAI(c) { }
|
||||
iron_golem_custodianAI(Creature* c) : ScriptedAI(c) { }
|
||||
EventMap events;
|
||||
void Reset()
|
||||
{
|
||||
events.Reset();
|
||||
}
|
||||
|
||||
void EnterCombat(Unit *)
|
||||
void EnterCombat(Unit*)
|
||||
{
|
||||
events.ScheduleEvent(EVENT_IGC_CRUSH, 6000);
|
||||
events.ScheduleEvent(EVENT_IGC_GROUND_SMASH, 4000);
|
||||
@@ -833,17 +842,17 @@ public:
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_IGC_CRUSH:
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), SPELL_IGC_CRUSH_ARMOR, false);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), SPELL_IGC_CRUSH_ARMOR, false);
|
||||
events.RepeatEvent(6000);
|
||||
break;
|
||||
}
|
||||
case EVENT_IGC_GROUND_SMASH:
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), IsHeroic() ? SPELL_IGC_GROUND_SMASH_H : SPELL_IGC_GROUND_SMASH, false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
}
|
||||
{
|
||||
me->CastSpell(me->GetVictim(), IsHeroic() ? SPELL_IGC_GROUND_SMASH_H : SPELL_IGC_GROUND_SMASH, false);
|
||||
events.RepeatEvent(5000);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -853,29 +862,29 @@ public:
|
||||
|
||||
class spell_hos_dark_matter : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_hos_dark_matter() : SpellScriptLoader("spell_hos_dark_matter") { }
|
||||
public:
|
||||
spell_hos_dark_matter() : SpellScriptLoader("spell_hos_dark_matter") { }
|
||||
|
||||
class spell_hos_dark_matter_AuraScript : public AuraScript
|
||||
class spell_hos_dark_matter_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hos_dark_matter_AuraScript);
|
||||
|
||||
void HandleEffectRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_hos_dark_matter_AuraScript);
|
||||
|
||||
void HandleEffectRemove(AuraEffect const * /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit *caster = GetCaster())
|
||||
caster->CastSpell(caster, caster->GetMap()->IsHeroic() ? SPELL_DARK_MATTER_H : SPELL_DARK_MATTER, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_hos_dark_matter_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
{
|
||||
return new spell_hos_dark_matter_AuraScript();
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, caster->GetMap()->IsHeroic() ? SPELL_DARK_MATTER_H : SPELL_DARK_MATTER, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_hos_dark_matter_AuraScript::HandleEffectRemove, EFFECT_0, SPELL_AURA_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_hos_dark_matter_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_brann_bronzebeard()
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
|
||||
struct instance_halls_of_stone_InstanceMapScript : public InstanceScript
|
||||
{
|
||||
instance_halls_of_stone_InstanceMapScript(Map* map) : InstanceScript(map){ Initialize(); }
|
||||
instance_halls_of_stone_InstanceMapScript(Map* map) : InstanceScript(map) { Initialize(); }
|
||||
|
||||
uint32 Encounter[MAX_ENCOUNTER];
|
||||
|
||||
@@ -75,37 +75,37 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
void OnGameObjectCreate(GameObject *go)
|
||||
void OnGameObjectCreate(GameObject* go)
|
||||
{
|
||||
switch(go->GetEntry())
|
||||
{
|
||||
case GO_KADDRAK:
|
||||
case GO_KADDRAK:
|
||||
goKaddrakGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_ABEDNEUM:
|
||||
case GO_ABEDNEUM:
|
||||
goAbedneumGUID = go->GetGUID();
|
||||
if (Encounter[BOSS_TRIBUNAL_OF_AGES] == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_MARNAK:
|
||||
goMarnakGUID = go->GetGUID();
|
||||
case GO_MARNAK:
|
||||
goMarnakGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_TRIBUNAL_CONSOLE:
|
||||
goTribunalConsoleGUID = go->GetGUID();
|
||||
case GO_TRIBUNAL_CONSOLE:
|
||||
goTribunalConsoleGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_TRIBUNAL_ACCESS_DOOR:
|
||||
goTribunalDoorGUID = go->GetGUID();
|
||||
go->SetGoState(GO_STATE_READY);
|
||||
break;
|
||||
case GO_SKY_FLOOR:
|
||||
case GO_SKY_FLOOR:
|
||||
goSkyRoomFloorGUID = go->GetGUID();
|
||||
if (Encounter[BOSS_TRIBUNAL_OF_AGES] == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
break;
|
||||
case GO_SJONNIR_CONSOLE:
|
||||
case GO_SJONNIR_CONSOLE:
|
||||
goSjonnirConsoleGUID = go->GetGUID();
|
||||
break;
|
||||
case GO_SJONNIR_DOOR:
|
||||
case GO_SJONNIR_DOOR:
|
||||
goSjonnirDoorGUID = go->GetGUID();
|
||||
if (Encounter[BOSS_TRIBUNAL_OF_AGES] == DONE)
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
@@ -120,16 +120,16 @@ public:
|
||||
}
|
||||
|
||||
|
||||
void OnCreatureCreate(Creature *creature)
|
||||
void OnCreatureCreate(Creature* creature)
|
||||
{
|
||||
switch(creature->GetEntry())
|
||||
{
|
||||
case NPC_SJONNIR:
|
||||
SjonnirGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_BRANN:
|
||||
BrannGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SJONNIR:
|
||||
SjonnirGUID = creature->GetGUID();
|
||||
break;
|
||||
case NPC_BRANN:
|
||||
BrannGUID = creature->GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -137,18 +137,29 @@ public:
|
||||
{
|
||||
switch(id)
|
||||
{
|
||||
case GO_TRIBUNAL_CONSOLE: return goTribunalConsoleGUID;
|
||||
case GO_TRIBUNAL_ACCESS_DOOR: return goTribunalDoorGUID;
|
||||
case GO_SJONNIR_CONSOLE: return goSjonnirConsoleGUID;
|
||||
case GO_SJONNIR_DOOR: return goSjonnirDoorGUID;
|
||||
case GO_LEFT_PIPE: return goLeftPipeGUID;
|
||||
case GO_RIGHT_PIPE: return goRightPipeGUID;
|
||||
case GO_KADDRAK: return goKaddrakGUID;
|
||||
case GO_MARNAK: return goMarnakGUID;
|
||||
case GO_ABEDNEUM: return goAbedneumGUID;
|
||||
case GO_TRIBUNAL_CONSOLE:
|
||||
return goTribunalConsoleGUID;
|
||||
case GO_TRIBUNAL_ACCESS_DOOR:
|
||||
return goTribunalDoorGUID;
|
||||
case GO_SJONNIR_CONSOLE:
|
||||
return goSjonnirConsoleGUID;
|
||||
case GO_SJONNIR_DOOR:
|
||||
return goSjonnirDoorGUID;
|
||||
case GO_LEFT_PIPE:
|
||||
return goLeftPipeGUID;
|
||||
case GO_RIGHT_PIPE:
|
||||
return goRightPipeGUID;
|
||||
case GO_KADDRAK:
|
||||
return goKaddrakGUID;
|
||||
case GO_MARNAK:
|
||||
return goMarnakGUID;
|
||||
case GO_ABEDNEUM:
|
||||
return goAbedneumGUID;
|
||||
|
||||
case NPC_SJONNIR: return SjonnirGUID;
|
||||
case NPC_BRANN: return BrannGUID;
|
||||
case NPC_SJONNIR:
|
||||
return SjonnirGUID;
|
||||
case NPC_BRANN:
|
||||
return BrannGUID;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -202,7 +213,7 @@ public:
|
||||
pF->SetGoState(GO_STATE_ACTIVE);
|
||||
|
||||
// Make sjonnir attackable
|
||||
if (Creature *cr = instance->GetCreature(SjonnirGUID))
|
||||
if (Creature* cr = instance->GetCreature(SjonnirGUID))
|
||||
cr->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
|
||||
}
|
||||
if (type == BOSS_TRIBUNAL_OF_AGES && data == NOT_STARTED)
|
||||
@@ -223,7 +234,7 @@ public:
|
||||
sjonnirAchievement = (bool)data;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (data == DONE)
|
||||
SaveToDB();
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -129,16 +129,16 @@ enum Misc
|
||||
|
||||
bool IsEncounterComplete(InstanceScript* pInstance, Creature* me)
|
||||
{
|
||||
if (!pInstance || !me)
|
||||
if (!pInstance || !me)
|
||||
return false;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
uint64 guid = pInstance->GetData64(DATA_STEELBREAKER+i);
|
||||
uint64 guid = pInstance->GetData64(DATA_STEELBREAKER + i);
|
||||
if (!guid)
|
||||
return false;
|
||||
|
||||
if (Creature *boss = (ObjectAccessor::GetCreature(*me, guid)))
|
||||
if (Creature* boss = (ObjectAccessor::GetCreature(*me, guid)))
|
||||
{
|
||||
if (boss->IsAlive())
|
||||
return false;
|
||||
@@ -157,18 +157,18 @@ void RespawnAssemblyOfIron(InstanceScript* pInstance, Creature* me)
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
{
|
||||
uint64 guid = pInstance->GetData64(DATA_STEELBREAKER+i);
|
||||
uint64 guid = pInstance->GetData64(DATA_STEELBREAKER + i);
|
||||
if (!guid)
|
||||
return;
|
||||
|
||||
if (Creature *boss = (ObjectAccessor::GetCreature((*me), guid)))
|
||||
if (Creature* boss = (ObjectAccessor::GetCreature((*me), guid)))
|
||||
if (!boss->IsAlive())
|
||||
boss->Respawn();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
void RestoreAssemblyHealth(uint64 guid1, uint64 guid2, Creature *me)
|
||||
void RestoreAssemblyHealth(uint64 guid1, uint64 guid2, Creature* me)
|
||||
{
|
||||
if(Creature* cr = ObjectAccessor::GetCreature(*me, guid1))
|
||||
if(cr->IsAlive())
|
||||
@@ -192,7 +192,7 @@ public:
|
||||
|
||||
struct boss_steelbreakerAI : public ScriptedAI
|
||||
{
|
||||
boss_steelbreakerAI(Creature *c) : ScriptedAI(c)
|
||||
boss_steelbreakerAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public:
|
||||
{
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_ASSEMBLY, IN_PROGRESS);
|
||||
|
||||
|
||||
me->setActive(true);
|
||||
me->SetInCombatWithZone();
|
||||
me->CastSpell(me, SPELL_HIGH_VOLTAGE, true);
|
||||
@@ -232,24 +232,24 @@ public:
|
||||
if (!pInstance)
|
||||
return;
|
||||
|
||||
if (Creature *boss = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER+urand(0,2))))
|
||||
if (Creature* boss = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER + urand(0, 2))))
|
||||
{
|
||||
switch (boss->GetEntry())
|
||||
{
|
||||
case NPC_STEELBREAKER:
|
||||
boss->AI()->Talk(SAY_STEELBREAKER_AGGRO);
|
||||
break;
|
||||
case NPC_MOLGEIM:
|
||||
boss->AI()->Talk(SAY_MOLGEIM_AGGRO);
|
||||
break;
|
||||
case NPC_BRUNDIR:
|
||||
boss->AI()->Talk(SAY_BRUNDIR_AGGRO);
|
||||
break;
|
||||
case NPC_STEELBREAKER:
|
||||
boss->AI()->Talk(SAY_STEELBREAKER_AGGRO);
|
||||
break;
|
||||
case NPC_MOLGEIM:
|
||||
boss->AI()->Talk(SAY_MOLGEIM_AGGRO);
|
||||
break;
|
||||
case NPC_BRUNDIR:
|
||||
boss->AI()->Talk(SAY_BRUNDIR_AGGRO);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
if (Creature *boss = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER+i)))
|
||||
if (Creature* boss = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER + i)))
|
||||
if (!boss->IsInCombat())
|
||||
boss->AI()->AttackStart(who);
|
||||
}
|
||||
@@ -331,13 +331,13 @@ public:
|
||||
{
|
||||
case EVENT_FUSION_PUNCH:
|
||||
me->CastSpell(me->GetVictim(), SPELL_FUSION_PUNCH, false);
|
||||
events.RepeatEvent(urand(15000,20000));
|
||||
events.RepeatEvent(urand(15000, 20000));
|
||||
break;
|
||||
case EVENT_STATIC_DISRUPTION:
|
||||
if (Unit *pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 0, true))
|
||||
if (Unit* pTarget = SelectTarget(SELECT_TARGET_FARTHEST, 0, 0, true))
|
||||
me->CastSpell(pTarget, SPELL_STATIC_DISRUPTION, false);
|
||||
|
||||
events.RepeatEvent(urand(20000,40000));
|
||||
events.RepeatEvent(urand(20000, 40000));
|
||||
break;
|
||||
case EVENT_OVERWHELMING_POWER:
|
||||
Talk(SAY_STEELBREAKER_POWER);
|
||||
@@ -358,18 +358,18 @@ public:
|
||||
|
||||
class CastRunesEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
CastRunesEvent(Creature& owner) : BasicEvent(), _owner(owner) { }
|
||||
public:
|
||||
CastRunesEvent(Creature& owner) : BasicEvent(), _owner(owner) { }
|
||||
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
|
||||
{
|
||||
if (!_owner.IsInCombat())
|
||||
_owner.CastSpell(&_owner, SPELL_RUNE_OF_POWER_OOC_CHANNEL, true);
|
||||
return true;
|
||||
}
|
||||
bool Execute(uint64 /*eventTime*/, uint32 /*diff*/) override
|
||||
{
|
||||
if (!_owner.IsInCombat())
|
||||
_owner.CastSpell(&_owner, SPELL_RUNE_OF_POWER_OOC_CHANNEL, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Creature& _owner;
|
||||
private:
|
||||
Creature& _owner;
|
||||
};
|
||||
|
||||
class boss_runemaster_molgeim : public CreatureScript
|
||||
@@ -384,7 +384,7 @@ public:
|
||||
|
||||
struct boss_runemaster_molgeimAI : public ScriptedAI
|
||||
{
|
||||
boss_runemaster_molgeimAI(Creature *c) : ScriptedAI(c), summons(me)
|
||||
boss_runemaster_molgeimAI(Creature* c) : ScriptedAI(c), summons(me)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
@@ -402,7 +402,7 @@ public:
|
||||
_phase = 0;
|
||||
events.Reset();
|
||||
summons.DespawnAll();
|
||||
|
||||
|
||||
if (pInstance)
|
||||
pInstance->SetData(TYPE_ASSEMBLY, NOT_STARTED);
|
||||
|
||||
@@ -427,7 +427,7 @@ public:
|
||||
return;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
if (Creature* boss = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER+i)))
|
||||
if (Creature* boss = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER + i)))
|
||||
if (!boss->IsInCombat())
|
||||
boss->AI()->AttackStart(who);
|
||||
}
|
||||
@@ -450,7 +450,7 @@ public:
|
||||
break;
|
||||
case 3:
|
||||
me->ResetLootMode();
|
||||
events.RescheduleEvent(EVENT_RUNE_OF_SUMMONING, urand(20000,30000));
|
||||
events.RescheduleEvent(EVENT_RUNE_OF_SUMMONING, urand(20000, 30000));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -500,31 +500,31 @@ public:
|
||||
switch(events.GetEvent())
|
||||
{
|
||||
case EVENT_RUNE_OF_POWER:
|
||||
{
|
||||
Unit* target = DoSelectLowestHpFriendly(60);
|
||||
if (!target || !target->IsAlive())
|
||||
target = me;
|
||||
{
|
||||
Unit* target = DoSelectLowestHpFriendly(60);
|
||||
if (!target || !target->IsAlive())
|
||||
target = me;
|
||||
|
||||
me->CastSpell(target, SPELL_RUNE_OF_POWER, true);
|
||||
events.RepeatEvent(60000);
|
||||
break;
|
||||
}
|
||||
me->CastSpell(target, SPELL_RUNE_OF_POWER, true);
|
||||
events.RepeatEvent(60000);
|
||||
break;
|
||||
}
|
||||
case EVENT_SHIELD_OF_RUNES:
|
||||
me->CastSpell(me, SPELL_SHIELD_OF_RUNES, false);
|
||||
events.RescheduleEvent(EVENT_SHIELD_OF_RUNES, urand(27000,34000));
|
||||
events.RescheduleEvent(EVENT_SHIELD_OF_RUNES, urand(27000, 34000));
|
||||
break;
|
||||
case EVENT_RUNE_OF_DEATH:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
me->CastSpell(target, SPELL_RUNE_OF_DEATH, true);
|
||||
|
||||
Talk(SAY_MOLGEIM_RUNE_DEATH);
|
||||
events.RepeatEvent(urand(30000,40000));
|
||||
events.RepeatEvent(urand(30000, 40000));
|
||||
break;
|
||||
case EVENT_RUNE_OF_SUMMONING:
|
||||
Talk(SAY_MOLGEIM_SUMMON);
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target,SPELL_RUNE_OF_SUMMONING);
|
||||
events.RepeatEvent(urand(30000,45000));
|
||||
me->CastSpell(target, SPELL_RUNE_OF_SUMMONING);
|
||||
events.RepeatEvent(urand(30000, 45000));
|
||||
break;
|
||||
case EVENT_ENRAGE:
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
@@ -550,7 +550,7 @@ public:
|
||||
|
||||
struct npc_assembly_lightningAI : public ScriptedAI
|
||||
{
|
||||
npc_assembly_lightningAI(Creature *c) : ScriptedAI(c)
|
||||
npc_assembly_lightningAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
_boomed = false;
|
||||
}
|
||||
@@ -595,7 +595,7 @@ public:
|
||||
|
||||
struct boss_stormcaller_brundirAI : public ScriptedAI
|
||||
{
|
||||
boss_stormcaller_brundirAI(Creature *c) : ScriptedAI(c)
|
||||
boss_stormcaller_brundirAI(Creature* c) : ScriptedAI(c)
|
||||
{
|
||||
pInstance = c->GetInstanceScript();
|
||||
}
|
||||
@@ -621,7 +621,7 @@ public:
|
||||
_stunnedAchievement = true;
|
||||
|
||||
events.Reset();
|
||||
|
||||
|
||||
me->SetDisableGravity(false);
|
||||
me->SetRegeneratingHealth(true);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
@@ -649,7 +649,7 @@ public:
|
||||
return;
|
||||
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
if (Creature *boss = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER+i)))
|
||||
if (Creature* boss = ObjectAccessor::GetCreature(*me, pInstance->GetData64(DATA_STEELBREAKER + i)))
|
||||
if (!boss->IsInCombat())
|
||||
boss->AI()->AttackStart(who);
|
||||
}
|
||||
@@ -664,16 +664,16 @@ public:
|
||||
switch (_phase)
|
||||
{
|
||||
case 1:
|
||||
events.RescheduleEvent(EVENT_CHAIN_LIGHTNING, urand(9000,17000));
|
||||
events.RescheduleEvent(EVENT_OVERLOAD, urand(25000,40000));
|
||||
events.RescheduleEvent(EVENT_CHAIN_LIGHTNING, urand(9000, 17000));
|
||||
events.RescheduleEvent(EVENT_OVERLOAD, urand(25000, 40000));
|
||||
break;
|
||||
case 2:
|
||||
events.RescheduleEvent(EVENT_LIGHTNING_WHIRL, urand(20000,40000));
|
||||
events.RescheduleEvent(EVENT_LIGHTNING_WHIRL, urand(20000, 40000));
|
||||
break;
|
||||
case 3:
|
||||
me->ResetLootMode();
|
||||
me->CastSpell(me, SPELL_STORMSHIELD, true);
|
||||
events.RescheduleEvent(EVENT_LIGHTNING_TENDRILS, urand(15000,16000));
|
||||
events.RescheduleEvent(EVENT_LIGHTNING_TENDRILS, urand(15000, 16000));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -699,7 +699,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if (who->GetTypeId() != TYPEID_PLAYER || urand(0,2))
|
||||
if (who->GetTypeId() != TYPEID_PLAYER || urand(0, 2))
|
||||
return;
|
||||
|
||||
Talk(SAY_BRUNDIR_SLAY);
|
||||
@@ -741,19 +741,19 @@ public:
|
||||
_channelTimer = 0;
|
||||
float o = urand(0, 5) * M_PI / 3.0f;
|
||||
me->InterruptNonMeleeSpells(false);
|
||||
me->GetMotionMaster()->MovePoint(POINT_CHANNEL_STEELBREAKER, 1587.18f + 10.0f*cos(o), 121.02f + 10.0f*sin(o), 427.3f);
|
||||
me->GetMotionMaster()->MovePoint(POINT_CHANNEL_STEELBREAKER, 1587.18f + 10.0f * cos(o), 121.02f + 10.0f * sin(o), 427.3f);
|
||||
}
|
||||
}
|
||||
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
|
||||
if (_flyPhase)
|
||||
{
|
||||
if (_flyTarget && me->GetDistance2d(_flyTarget) >= 6 )
|
||||
{
|
||||
//float speed = me->GetDistance(_flyTarget->GetPositionX(), _flyTarget->GetPositionY(), _flyTarget->GetPositionZ()+15) / (1500.0f * 0.001f);
|
||||
me->SendMonsterMove(_flyTarget->GetPositionX(), _flyTarget->GetPositionY(), _flyTarget->GetPositionZ()+15, 1500, SPLINEFLAG_FLYING);
|
||||
me->SendMonsterMove(_flyTarget->GetPositionX(), _flyTarget->GetPositionY(), _flyTarget->GetPositionZ() + 15, 1500, SPLINEFLAG_FLYING);
|
||||
me->SetPosition(_flyTarget->GetPositionX(), _flyTarget->GetPositionY(), _flyTarget->GetPositionZ(), _flyTarget->GetOrientation());
|
||||
}
|
||||
}
|
||||
@@ -768,7 +768,7 @@ public:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_CHAIN_LIGHTNING, false);
|
||||
|
||||
events.RepeatEvent(urand(9000,17000));
|
||||
events.RepeatEvent(urand(9000, 17000));
|
||||
break;
|
||||
case EVENT_IMMUNE:
|
||||
me->ApplySpellImmune(1, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
|
||||
@@ -778,49 +778,49 @@ public:
|
||||
me->ApplySpellImmune(1, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
|
||||
Talk(EMOTE_BRUNDIR_OVERLOAD);
|
||||
me->CastSpell(me, SPELL_OVERLOAD, true);
|
||||
events.RescheduleEvent(EVENT_OVERLOAD, urand(25000,40000));
|
||||
events.RescheduleEvent(EVENT_OVERLOAD, urand(25000, 40000));
|
||||
events.RescheduleEvent(EVENT_IMMUNE, 5999);
|
||||
break;
|
||||
case EVENT_LIGHTNING_WHIRL:
|
||||
Talk(SAY_BRUNDIR_SPECIAL);
|
||||
me->CastSpell(me, SPELL_LIGHTNING_WHIRL, true);
|
||||
events.RepeatEvent(urand(10000,25000));
|
||||
events.RepeatEvent(urand(10000, 25000));
|
||||
break;
|
||||
case EVENT_LIGHTNING_TENDRILS:
|
||||
{
|
||||
// Reschedule old
|
||||
events.RepeatEvent(35000);
|
||||
events.DelayEvents(18000);
|
||||
Talk(SAY_BRUNDIR_FLIGHT);
|
||||
|
||||
_flyPhase = true;
|
||||
_flyTarget = me->GetVictim();
|
||||
me->SetRegeneratingHealth(false);
|
||||
me->SetDisableGravity(true);
|
||||
{
|
||||
// Reschedule old
|
||||
events.RepeatEvent(35000);
|
||||
events.DelayEvents(18000);
|
||||
Talk(SAY_BRUNDIR_FLIGHT);
|
||||
|
||||
me->CombatStop();
|
||||
me->StopMoving();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
me->SendMonsterMove(_flyTarget->GetPositionX(), _flyTarget->GetPositionY(), _flyTarget->GetPositionZ()+15, 1500, SPLINEFLAG_FLYING);
|
||||
|
||||
me->CastSpell(me, SPELL_LIGHTNING_TENDRILS, true);
|
||||
me->CastSpell(me, 61883, true);
|
||||
events.ScheduleEvent(EVENT_LIGHTNING_LAND, 16000);
|
||||
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
|
||||
break;
|
||||
}
|
||||
_flyPhase = true;
|
||||
_flyTarget = me->GetVictim();
|
||||
me->SetRegeneratingHealth(false);
|
||||
me->SetDisableGravity(true);
|
||||
|
||||
me->CombatStop();
|
||||
me->StopMoving();
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, 0);
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED);
|
||||
me->SendMonsterMove(_flyTarget->GetPositionX(), _flyTarget->GetPositionY(), _flyTarget->GetPositionZ() + 15, 1500, SPLINEFLAG_FLYING);
|
||||
|
||||
me->CastSpell(me, SPELL_LIGHTNING_TENDRILS, true);
|
||||
me->CastSpell(me, 61883, true);
|
||||
events.ScheduleEvent(EVENT_LIGHTNING_LAND, 16000);
|
||||
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true);
|
||||
break;
|
||||
}
|
||||
case EVENT_LIGHTNING_LAND:
|
||||
{
|
||||
float speed = me->GetDistance(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()) / (1000.0f * 0.001f);
|
||||
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), speed);
|
||||
_flyPhase = false;
|
||||
events.ScheduleEvent(EVENT_LAND_LAND, 1000);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
{
|
||||
float speed = me->GetDistance(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()) / (1000.0f * 0.001f);
|
||||
me->MonsterMoveWithSpeed(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), speed);
|
||||
_flyPhase = false;
|
||||
events.ScheduleEvent(EVENT_LAND_LAND, 1000);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
case EVENT_LAND_LAND:
|
||||
me->SetCanFly(false);
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
@@ -851,129 +851,129 @@ public:
|
||||
|
||||
class spell_shield_of_runes : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_shield_of_runes() : SpellScriptLoader("spell_shield_of_runes") { }
|
||||
public:
|
||||
spell_shield_of_runes() : SpellScriptLoader("spell_shield_of_runes") { }
|
||||
|
||||
class spell_shield_of_runes_AuraScript : public AuraScript
|
||||
class spell_shield_of_runes_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_shield_of_runes_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_shield_of_runes_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Unit* owner = GetUnitOwner())
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && aurEff->GetAmount() <= 0)
|
||||
owner->CastSpell(owner, SPELL_SHIELD_OF_RUNES_BUFF, false);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_shield_of_runes_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_shield_of_runes_AuraScript();
|
||||
if (Unit* owner = GetUnitOwner())
|
||||
if (GetTargetApplication()->GetRemoveMode() == AURA_REMOVE_BY_ENEMY_SPELL && aurEff->GetAmount() <= 0)
|
||||
owner->CastSpell(owner, SPELL_SHIELD_OF_RUNES_BUFF, false);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_shield_of_runes_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_SCHOOL_ABSORB, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_shield_of_runes_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_assembly_meltdown : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_assembly_meltdown() : SpellScriptLoader("spell_assembly_meltdown") { }
|
||||
public:
|
||||
spell_assembly_meltdown() : SpellScriptLoader("spell_assembly_meltdown") { }
|
||||
|
||||
class spell_assembly_meltdown_SpellScript : public SpellScript
|
||||
class spell_assembly_meltdown_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_assembly_meltdown_SpellScript);
|
||||
|
||||
void HandleInstaKill(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_assembly_meltdown_SpellScript);
|
||||
|
||||
void HandleInstaKill(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(DATA_STEELBREAKER)))
|
||||
Steelbreaker->AI()->DoAction(ACTION_ADD_CHARGE);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_assembly_meltdown_SpellScript::HandleInstaKill, EFFECT_1, SPELL_EFFECT_INSTAKILL);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_assembly_meltdown_SpellScript();
|
||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||
if (Creature* Steelbreaker = ObjectAccessor::GetCreature(*GetCaster(), instance->GetData64(DATA_STEELBREAKER)))
|
||||
Steelbreaker->AI()->DoAction(ACTION_ADD_CHARGE);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_assembly_meltdown_SpellScript::HandleInstaKill, EFFECT_1, SPELL_EFFECT_INSTAKILL);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const override
|
||||
{
|
||||
return new spell_assembly_meltdown_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_assembly_rune_of_summoning : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_assembly_rune_of_summoning() : SpellScriptLoader("spell_assembly_rune_of_summoning") { }
|
||||
public:
|
||||
spell_assembly_rune_of_summoning() : SpellScriptLoader("spell_assembly_rune_of_summoning") { }
|
||||
|
||||
class spell_assembly_rune_of_summoning_AuraScript : public AuraScript
|
||||
class spell_assembly_rune_of_summoning_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_assembly_rune_of_summoning_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PrepareAuraScript(spell_assembly_rune_of_summoning_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (aurEff->GetTickNumber() % 2 == 0)
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_RUNE_OF_SUMMONING_SUMMON, true, nullptr, aurEff, GetTarget()->IsSummon() ? GetTarget()->ToTempSummon()->GetSummonerGUID() : 0);
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (TempSummon* summ = GetTarget()->ToTempSummon())
|
||||
summ->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_assembly_rune_of_summoning_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_assembly_rune_of_summoning_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_assembly_rune_of_summoning_AuraScript();
|
||||
PreventDefaultAction();
|
||||
if (aurEff->GetTickNumber() % 2 == 0)
|
||||
GetTarget()->CastSpell(GetTarget(), SPELL_RUNE_OF_SUMMONING_SUMMON, true, nullptr, aurEff, GetTarget()->IsSummon() ? GetTarget()->ToTempSummon()->GetSummonerGUID() : 0);
|
||||
}
|
||||
|
||||
void OnRemove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (TempSummon* summ = GetTarget()->ToTempSummon())
|
||||
summ->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_assembly_rune_of_summoning_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_assembly_rune_of_summoning_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const override
|
||||
{
|
||||
return new spell_assembly_rune_of_summoning_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_assembly_of_iron : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_assembly_of_iron(char const* name, uint32 entry) : AchievementCriteriaScript(name),
|
||||
_targetEntry(entry)
|
||||
{
|
||||
}
|
||||
public:
|
||||
achievement_assembly_of_iron(char const* name, uint32 entry) : AchievementCriteriaScript(name),
|
||||
_targetEntry(entry)
|
||||
{
|
||||
}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target) override
|
||||
{
|
||||
return target && target->GetAuraCount(SPELL_SUPERCHARGE) >= 2 && (!_targetEntry || target->GetEntry() == _targetEntry);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 const _targetEntry;
|
||||
bool OnCheck(Player* /*player*/, Unit* target) override
|
||||
{
|
||||
return target && target->GetAuraCount(SPELL_SUPERCHARGE) >= 2 && (!_targetEntry || target->GetEntry() == _targetEntry);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 const _targetEntry;
|
||||
};
|
||||
|
||||
class achievement_cant_do_that_while_stunned : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_cant_do_that_while_stunned() : AchievementCriteriaScript("achievement_cant_do_that_while_stunned") {}
|
||||
public:
|
||||
achievement_cant_do_that_while_stunned() : AchievementCriteriaScript("achievement_cant_do_that_while_stunned") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target) override
|
||||
{
|
||||
bool allow = target && target->GetAuraCount(SPELL_SUPERCHARGE) >= 2;
|
||||
if (!allow)
|
||||
return false;
|
||||
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(DATA_BRUNDIR)))
|
||||
return cr->AI()->GetData(DATA_BRUNDIR);
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target) override
|
||||
{
|
||||
bool allow = target && target->GetAuraCount(SPELL_SUPERCHARGE) >= 2;
|
||||
if (!allow)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(DATA_BRUNDIR)))
|
||||
return cr->AI()->GetData(DATA_BRUNDIR);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_assembly_of_iron()
|
||||
|
||||
@@ -125,9 +125,9 @@ public:
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(TYPE_AURIAYA, NOT_STARTED);
|
||||
|
||||
for (uint8 i = 0; i < RAID_MODE(2,4); ++i)
|
||||
me->SummonCreature(NPC_SANCTUM_SENTRY, me->GetPositionX()+urand(4,12), me->GetPositionY()+urand(4,12), me->GetPositionZ());
|
||||
|
||||
for (uint8 i = 0; i < RAID_MODE(2, 4); ++i)
|
||||
me->SummonCreature(NPC_SANCTUM_SENTRY, me->GetPositionX() + urand(4, 12), me->GetPositionY() + urand(4, 12), me->GetPositionZ());
|
||||
|
||||
me->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public:
|
||||
void JustSummoned(Creature* cr)
|
||||
{
|
||||
if (cr->GetEntry() == NPC_SANCTUM_SENTRY)
|
||||
cr->GetMotionMaster()->MoveFollow(me, 6, rand_norm()*2*3.14f);
|
||||
cr->GetMotionMaster()->MoveFollow(me, 6, rand_norm() * 2 * 3.14f);
|
||||
else
|
||||
cr->SetInCombatWithZone();
|
||||
|
||||
@@ -180,10 +180,10 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if (urand(0,2))
|
||||
if (urand(0, 2))
|
||||
return;
|
||||
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
{
|
||||
me->MonsterYell("The secret dies with you!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_SLAY1);
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
void JustDied(Unit* /*victim*/)
|
||||
{
|
||||
if (m_pInstance)
|
||||
m_pInstance->SetData(TYPE_AURIAYA, DONE);
|
||||
@@ -256,12 +256,12 @@ public:
|
||||
events.DelayEvents(5000, 0);
|
||||
break;
|
||||
case EVENT_RESPAWN_FERAL_DEFENDER:
|
||||
{
|
||||
EntryCheckPredicate pred(NPC_FERAL_DEFENDER);
|
||||
summons.DoAction(ACTION_FERAL_RESPAWN, pred);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
{
|
||||
EntryCheckPredicate pred(NPC_FERAL_DEFENDER);
|
||||
summons.DoAction(ACTION_FERAL_RESPAWN, pred);
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
case EVENT_ENRAGE:
|
||||
me->MonsterTextEmote("You waste my time!", 0);
|
||||
me->PlayDirectSound(SOUND_BERSERK);
|
||||
@@ -376,7 +376,7 @@ public:
|
||||
|
||||
if (_feralEssenceStack)
|
||||
{
|
||||
if (Creature *cr = me->SummonCreature(NPC_SEEPING_FERAL_ESSENCE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f))
|
||||
if (Creature* cr = me->SummonCreature(NPC_SEEPING_FERAL_ESSENCE, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0.0f))
|
||||
summons.Summon(cr);
|
||||
|
||||
--_feralEssenceStack;
|
||||
@@ -435,60 +435,60 @@ public:
|
||||
|
||||
class spell_auriaya_sentinel_blast : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_auriaya_sentinel_blast() : SpellScriptLoader("spell_auriaya_sentinel_blast") { }
|
||||
public:
|
||||
spell_auriaya_sentinel_blast() : SpellScriptLoader("spell_auriaya_sentinel_blast") { }
|
||||
|
||||
class spell_auriaya_sentinel_blast_SpellScript : public SpellScript
|
||||
class spell_auriaya_sentinel_blast_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_auriaya_sentinel_blast_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||
{
|
||||
PrepareSpellScript(spell_auriaya_sentinel_blast_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& unitList)
|
||||
{
|
||||
unitList.remove_if(PlayerOrPetCheck());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_auriaya_sentinel_blast_SpellScript();
|
||||
unitList.remove_if(PlayerOrPetCheck());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_auriaya_sentinel_blast_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_auriaya_sentinel_blast_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_auriaya_crazy_cat_lady : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_auriaya_crazy_cat_lady() : AchievementCriteriaScript("achievement_auriaya_crazy_cat_lady") {}
|
||||
public:
|
||||
achievement_auriaya_crazy_cat_lady() : AchievementCriteriaScript("achievement_auriaya_crazy_cat_lady") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_AURIAYA)))
|
||||
return cr->AI()->GetData(DATA_CRAZY_CAT);
|
||||
|
||||
return false;
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_AURIAYA)))
|
||||
return cr->AI()->GetData(DATA_CRAZY_CAT);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_auriaya_nine_lives : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_auriaya_nine_lives() : AchievementCriteriaScript("achievement_auriaya_nine_lives") {}
|
||||
public:
|
||||
achievement_auriaya_nine_lives() : AchievementCriteriaScript("achievement_auriaya_nine_lives") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_AURIAYA)))
|
||||
return cr->AI()->GetData(DATA_NINE_LIVES);
|
||||
|
||||
return false;
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_AURIAYA)))
|
||||
return cr->AI()->GetData(DATA_NINE_LIVES);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_auriaya()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -48,7 +48,7 @@ enum FreyaSpells
|
||||
SPELL_STONEBARK_ESSENCE = 62483,
|
||||
SPELL_IRONBRANCH_ESSENCE = 62484,
|
||||
SPELL_BRIGHTLEAF_ESSENCE = 62485,
|
||||
|
||||
|
||||
// BRIGHTLEAF
|
||||
SPELL_BRIGHTLEAF_FLUX = 62239,
|
||||
SPELL_SOLAR_FLARE_10 = 62240,
|
||||
@@ -57,7 +57,7 @@ enum FreyaSpells
|
||||
SPELL_PHOTOSYNTHESIS = 62209,
|
||||
SPELL_UNSTABLE_SUN_DAMAGE_10 = 62217,
|
||||
SPELL_UNSTABLE_SUN_DAMAGE_25 = 62922,
|
||||
|
||||
|
||||
// IRONBRANCH
|
||||
SPELL_IMPALE_10 = 62310,
|
||||
SPELL_IMPALE_25 = 62928,
|
||||
@@ -67,7 +67,7 @@ enum FreyaSpells
|
||||
SPELL_IRON_ROOTS_DAMAGE_25 = 62930,
|
||||
SPELL_THORN_SWARM_10 = 62285,
|
||||
SPELL_THORN_SWARM_25 = 62931,
|
||||
|
||||
|
||||
// STONEBARK
|
||||
SPELL_FISTS_OF_STONE = 62344,
|
||||
SPELL_GROUND_TREMOR_10 = 62325,
|
||||
@@ -177,7 +177,7 @@ enum FreyaSounds
|
||||
SOUND_STONEBARK_SLAY1 = 15501,
|
||||
SOUND_STONEBARK_SLAY2 = 15502,
|
||||
SOUND_STONEBARK_DEATH = 15503,
|
||||
|
||||
|
||||
// IRONBRANCH
|
||||
SOUND_IRONBRANCH_AGGRO = 15493,
|
||||
SOUND_IRONBRANCH_SLAY1 = 15494,
|
||||
@@ -192,7 +192,7 @@ enum FreyaSounds
|
||||
};
|
||||
|
||||
enum FreyaNPCs
|
||||
{
|
||||
{
|
||||
NPC_NATURE_BOMB = 34129,
|
||||
NPC_IRON_ROOT_TRIGGER = 33088,
|
||||
NPC_FREYA_UNSTABLE_SUN_BEAM = 33170,
|
||||
@@ -206,7 +206,7 @@ enum FreyaNPCs
|
||||
// SEC WAVE
|
||||
NPC_ANCIENT_CONSERVATOR = 33203,
|
||||
NPC_HEALTHY_SPORE = 33215,
|
||||
|
||||
|
||||
// THIRD WAVE
|
||||
NPC_DETONATING_LASHER = 32918,
|
||||
};
|
||||
@@ -274,7 +274,7 @@ public:
|
||||
bool _respawningTrio;
|
||||
bool _backToNature;
|
||||
uint8 _deforestation;
|
||||
|
||||
|
||||
uint64 _elderGUID[3];
|
||||
|
||||
void Reset()
|
||||
@@ -298,7 +298,7 @@ public:
|
||||
_lumberjacked = 0;
|
||||
_spawnedAmount = 0;
|
||||
_trioKilled = 0;
|
||||
_waveNumber = urand(1,3);
|
||||
_waveNumber = urand(1, 3);
|
||||
_respawningTrio = false;
|
||||
_backToNature = true;
|
||||
_deforestation = 0;
|
||||
@@ -306,10 +306,10 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() != TYPEID_PLAYER || urand(0,2))
|
||||
if (victim->GetTypeId() != TYPEID_PLAYER || urand(0, 2))
|
||||
return;
|
||||
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
{
|
||||
me->MonsterYell("Forgive me.", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_SLAY1);
|
||||
@@ -328,7 +328,7 @@ public:
|
||||
{
|
||||
me->MonsterYell("His hold on me dissipates. I can see clearly once more. Thank you, heroes.", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_DEATH);
|
||||
|
||||
|
||||
damage = 0;
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
|
||||
me->setFaction(35);
|
||||
@@ -353,7 +353,7 @@ public:
|
||||
}
|
||||
|
||||
uint32 chestId = RAID_MODE(GO_FREYA_CHEST, GO_FREYA_CHEST_HERO);
|
||||
chestId -= 2*_elderCount; // offset
|
||||
chestId -= 2 * _elderCount; // offset
|
||||
|
||||
me->DespawnOrUnsummon(5000);
|
||||
if (GameObject* go = me->SummonGameObject(chestId, 2345.61f, -71.20f, 425.104f, 3.0f, 0, 0, 0, 0, 0))
|
||||
@@ -375,23 +375,23 @@ public:
|
||||
|
||||
void SpawnWave()
|
||||
{
|
||||
_waveNumber = _waveNumber == 1 ? 3 : _waveNumber-1;
|
||||
_waveNumber = _waveNumber == 1 ? 3 : _waveNumber - 1;
|
||||
|
||||
// Wave of three
|
||||
if (_waveNumber == 1)
|
||||
{
|
||||
me->MonsterYell("Children, assist me!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_TRIO);
|
||||
me->SummonCreature(NPC_ANCIENT_WATER_SPIRIT, me->GetPositionX()+urand(5,15), me->GetPositionY()+urand(5,15), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT));
|
||||
me->SummonCreature(NPC_STORM_LASHER, me->GetPositionX()+urand(5,15), me->GetPositionY()+urand(5,15), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT));
|
||||
me->SummonCreature(NPC_SNAPLASHER, me->GetPositionX()+urand(5,15), me->GetPositionY()+urand(5,15), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT));
|
||||
me->SummonCreature(NPC_ANCIENT_WATER_SPIRIT, me->GetPositionX() + urand(5, 15), me->GetPositionY() + urand(5, 15), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT));
|
||||
me->SummonCreature(NPC_STORM_LASHER, me->GetPositionX() + urand(5, 15), me->GetPositionY() + urand(5, 15), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT));
|
||||
me->SummonCreature(NPC_SNAPLASHER, me->GetPositionX() + urand(5, 15), me->GetPositionY() + urand(5, 15), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT));
|
||||
}
|
||||
// Ancient Conservator
|
||||
else if (_waveNumber == 2)
|
||||
{
|
||||
me->MonsterYell("Eonar, your servant requires aid!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_CONSERVATOR);
|
||||
me->SummonCreature(NPC_ANCIENT_CONSERVATOR, me->GetPositionX()+urand(5,15), me->GetPositionY()+urand(5,15), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT), 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
me->SummonCreature(NPC_ANCIENT_CONSERVATOR, me->GetPositionX() + urand(5, 15), me->GetPositionY() + urand(5, 15), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT), 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
}
|
||||
// Detonating Lashers
|
||||
else if (_waveNumber == 3)
|
||||
@@ -399,7 +399,7 @@ public:
|
||||
me->MonsterYell("The swarm of the elements shall overtake you!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_DETONATING);
|
||||
for (uint8 i = 0; i < 10; ++i)
|
||||
me->SummonCreature(NPC_DETONATING_LASHER, me->GetPositionX()+urand(5,20), me->GetPositionY()+urand(5,20), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT), 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
me->SummonCreature(NPC_DETONATING_LASHER, me->GetPositionX() + urand(5, 20), me->GetPositionY() + urand(5, 20), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT), 0, TEMPSUMMON_CORPSE_DESPAWN);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,7 +446,7 @@ public:
|
||||
_backToNature = false;
|
||||
|
||||
if (aur->GetStackAmount() > param)
|
||||
aur->SetStackAmount(aur->GetStackAmount()-param);
|
||||
aur->SetStackAmount(aur->GetStackAmount() - param);
|
||||
else // Aura out of stack
|
||||
{
|
||||
events.ScheduleEvent(EVENT_FREYA_NATURE_BOMB, 5000);
|
||||
@@ -543,7 +543,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit *target, const SpellInfo *spell)
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* spell)
|
||||
{
|
||||
if (spell->Id == SPELL_NATURE_BOMB_FLIGHT)
|
||||
me->SummonCreature(NPC_NATURE_BOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ());
|
||||
@@ -560,92 +560,92 @@ public:
|
||||
|
||||
switch (events.GetEvent())
|
||||
{
|
||||
case EVENT_FREYA_ADDS_SPAM:
|
||||
if (_spawnedAmount < 6)
|
||||
SpawnWave();
|
||||
else if (me->GetAura(SPELL_ATTUNED_TO_NATURE))
|
||||
{
|
||||
me->RemoveAura(SPELL_ATTUNED_TO_NATURE);
|
||||
events.ScheduleEvent(EVENT_FREYA_NATURE_BOMB, 5000);
|
||||
events.SetPhase(EVENT_PHASE_FINAL);
|
||||
events.PopEvent();
|
||||
return;
|
||||
}
|
||||
_spawnedAmount++;
|
||||
events.RepeatEvent(60000);
|
||||
break;
|
||||
case EVENT_FREYA_LIFEBINDER:
|
||||
{
|
||||
events.RepeatEvent(45000);
|
||||
float x, y, z;
|
||||
for (uint8 i = 0; i < 10; ++i)
|
||||
{
|
||||
x = me->GetPositionX()+urand(7,25);
|
||||
y = me->GetPositionY()+urand(7,25);
|
||||
z = me->GetMap()->GetHeight(x, y, MAX_HEIGHT)+0.5f;
|
||||
if (me->IsWithinLOS(x, y, z))
|
||||
case EVENT_FREYA_ADDS_SPAM:
|
||||
if (_spawnedAmount < 6)
|
||||
SpawnWave();
|
||||
else if (me->GetAura(SPELL_ATTUNED_TO_NATURE))
|
||||
{
|
||||
me->CastSpell(x, y, z, SPELL_SUMMON_LIFEBINDER, true);
|
||||
me->RemoveAura(SPELL_ATTUNED_TO_NATURE);
|
||||
events.ScheduleEvent(EVENT_FREYA_NATURE_BOMB, 5000);
|
||||
events.SetPhase(EVENT_PHASE_FINAL);
|
||||
events.PopEvent();
|
||||
return;
|
||||
}
|
||||
}
|
||||
_spawnedAmount++;
|
||||
events.RepeatEvent(60000);
|
||||
break;
|
||||
case EVENT_FREYA_LIFEBINDER:
|
||||
{
|
||||
events.RepeatEvent(45000);
|
||||
float x, y, z;
|
||||
for (uint8 i = 0; i < 10; ++i)
|
||||
{
|
||||
x = me->GetPositionX() + urand(7, 25);
|
||||
y = me->GetPositionY() + urand(7, 25);
|
||||
z = me->GetMap()->GetHeight(x, y, MAX_HEIGHT) + 0.5f;
|
||||
if (me->IsWithinLOS(x, y, z))
|
||||
{
|
||||
me->CastSpell(x, y, z, SPELL_SUMMON_LIFEBINDER, true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
me->CastSpell(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), SPELL_SUMMON_LIFEBINDER, true);
|
||||
break;
|
||||
}
|
||||
case EVENT_FREYA_SUNBEAM:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
me->CastSpell(target, SPELL_SUNBEAM, false);
|
||||
events.RepeatEvent(15000+urand(0,5000));
|
||||
break;
|
||||
case EVENT_FREYA_RESPAWN_TRIO:
|
||||
events.PopEvent();
|
||||
_deforestation = 0;
|
||||
_respawningTrio = false;
|
||||
if (_trioKilled < 3)
|
||||
summons.DoAction(ACTION_RESPAWN_TRIO);
|
||||
|
||||
_trioKilled = 0;
|
||||
break;
|
||||
case EVENT_FREYA_NATURE_BOMB:
|
||||
{
|
||||
uint8 _minCount = me->GetMap()->Is25ManRaid() ? urand(7,10) : urand(3,4);
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
{
|
||||
if (me->GetDistance(itr->GetSource()) > 70 || !itr->GetSource()->IsAlive())
|
||||
continue;
|
||||
|
||||
me->CastSpell(itr->GetSource(), SPELL_NATURE_BOMB_FLIGHT, true);
|
||||
|
||||
if (!(--_minCount))
|
||||
me->CastSpell(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), SPELL_SUMMON_LIFEBINDER, true);
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(18000);
|
||||
break;
|
||||
}
|
||||
case EVENT_FREYA_BERSERK:
|
||||
me->MonsterYell("You have strayed too far, wasted too much time!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_BERSERK);
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_FREYA_GROUND_TREMOR:
|
||||
me->CastSpell(me, SPELL_GROUND_TREMOR_FREYA, false);
|
||||
events.RepeatEvent(25000+urand(0,10000));
|
||||
break;
|
||||
case EVENT_FREYA_IRON_ROOT:
|
||||
me->CastCustomSpell(SPELL_IRON_ROOTS_FREYA, SPELLVALUE_MAX_TARGETS, 1, me, false);
|
||||
events.RepeatEvent(45000+urand(0,10000));
|
||||
break;
|
||||
case EVENT_FREYA_UNSTABLE_SUN_BEAM:
|
||||
if (Creature* cr = me->SummonCreature(NPC_FREYA_UNSTABLE_SUN_BEAM, me->GetPositionX()+urand(7,25), me->GetPositionY()+urand(7,25), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT), 0, TEMPSUMMON_TIMED_DESPAWN, 10000))
|
||||
{
|
||||
cr->CastSpell(cr, SPELL_UNSTABLE_SUN_VISUAL, true);
|
||||
cr->CastSpell(cr, SPELL_UNSTABLE_SUN_FREYA_DAMAGE, true);
|
||||
}
|
||||
events.RepeatEvent(38000+urand(0,10000));
|
||||
break;
|
||||
}
|
||||
case EVENT_FREYA_SUNBEAM:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM))
|
||||
me->CastSpell(target, SPELL_SUNBEAM, false);
|
||||
events.RepeatEvent(15000 + urand(0, 5000));
|
||||
break;
|
||||
case EVENT_FREYA_RESPAWN_TRIO:
|
||||
events.PopEvent();
|
||||
_deforestation = 0;
|
||||
_respawningTrio = false;
|
||||
if (_trioKilled < 3)
|
||||
summons.DoAction(ACTION_RESPAWN_TRIO);
|
||||
|
||||
_trioKilled = 0;
|
||||
break;
|
||||
case EVENT_FREYA_NATURE_BOMB:
|
||||
{
|
||||
uint8 _minCount = me->GetMap()->Is25ManRaid() ? urand(7, 10) : urand(3, 4);
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
{
|
||||
if (me->GetDistance(itr->GetSource()) > 70 || !itr->GetSource()->IsAlive())
|
||||
continue;
|
||||
|
||||
me->CastSpell(itr->GetSource(), SPELL_NATURE_BOMB_FLIGHT, true);
|
||||
|
||||
if (!(--_minCount))
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(18000);
|
||||
break;
|
||||
}
|
||||
case EVENT_FREYA_BERSERK:
|
||||
me->MonsterYell("You have strayed too far, wasted too much time!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_BERSERK);
|
||||
me->CastSpell(me, SPELL_BERSERK, true);
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_FREYA_GROUND_TREMOR:
|
||||
me->CastSpell(me, SPELL_GROUND_TREMOR_FREYA, false);
|
||||
events.RepeatEvent(25000 + urand(0, 10000));
|
||||
break;
|
||||
case EVENT_FREYA_IRON_ROOT:
|
||||
me->CastCustomSpell(SPELL_IRON_ROOTS_FREYA, SPELLVALUE_MAX_TARGETS, 1, me, false);
|
||||
events.RepeatEvent(45000 + urand(0, 10000));
|
||||
break;
|
||||
case EVENT_FREYA_UNSTABLE_SUN_BEAM:
|
||||
if (Creature* cr = me->SummonCreature(NPC_FREYA_UNSTABLE_SUN_BEAM, me->GetPositionX() + urand(7, 25), me->GetPositionY() + urand(7, 25), me->GetMap()->GetHeight(me->GetPositionX(), me->GetPositionY(), MAX_HEIGHT), 0, TEMPSUMMON_TIMED_DESPAWN, 10000))
|
||||
{
|
||||
cr->CastSpell(cr, SPELL_UNSTABLE_SUN_VISUAL, true);
|
||||
cr->CastSpell(cr, SPELL_UNSTABLE_SUN_FREYA_DAMAGE, true);
|
||||
}
|
||||
events.RepeatEvent(38000 + urand(0, 10000));
|
||||
break;
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
@@ -686,10 +686,10 @@ public:
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
return;
|
||||
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
{
|
||||
me->MonsterTextEmote("Angry roar", 0);
|
||||
me->PlayDirectSound(SOUND_STONEBARK_SLAY1);
|
||||
@@ -792,10 +792,10 @@ public:
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
return;
|
||||
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
{
|
||||
me->MonsterYell("Fertilizer.", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_BRIGHTLEAF_SLAY1);
|
||||
@@ -843,7 +843,7 @@ public:
|
||||
{
|
||||
case EVENT_BRIGHTLEAF_FLUX:
|
||||
if (Aura* aur = me->AddAura(SPELL_BRIGHTLEAF_FLUX, me))
|
||||
aur->SetStackAmount(urand(1,10));
|
||||
aur->SetStackAmount(urand(1, 10));
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case EVENT_BRIGHTLEAF_SOLAR_FLARE:
|
||||
@@ -862,7 +862,7 @@ public:
|
||||
beam->CastSpell(beam, SPELL_PHOTOSYNTHESIS, true);
|
||||
summons.Summon(beam);
|
||||
}
|
||||
if (Creature* beam = me->SummonCreature(NPC_UNSTABLE_SUN_BRIGHTLEAF, me->GetPositionX()+8, me->GetPositionY()+8, me->GetPositionZ()))
|
||||
if (Creature* beam = me->SummonCreature(NPC_UNSTABLE_SUN_BRIGHTLEAF, me->GetPositionX() + 8, me->GetPositionY() + 8, me->GetPositionZ()))
|
||||
{
|
||||
beam->CastSpell(beam, SPELL_UNSTABLE_SUN_BEAM_AURA, true);
|
||||
beam->CastSpell(beam, SPELL_PHOTOSYNTHESIS, true);
|
||||
@@ -914,10 +914,10 @@ public:
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
return;
|
||||
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
{
|
||||
me->MonsterYell("I return you whence you came!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_IRONBRANCH_SLAY1);
|
||||
@@ -1288,33 +1288,33 @@ public:
|
||||
|
||||
class achievement_freya_getting_back_to_nature : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_freya_getting_back_to_nature() : AchievementCriteriaScript("achievement_freya_getting_back_to_nature") {}
|
||||
public:
|
||||
achievement_freya_getting_back_to_nature() : AchievementCriteriaScript("achievement_freya_getting_back_to_nature") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target /*Freya*/)
|
||||
{
|
||||
if (target)
|
||||
if (target->GetAI()->GetData(DATA_BACK_TO_NATURE))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target /*Freya*/)
|
||||
{
|
||||
if (target)
|
||||
if (target->GetAI()->GetData(DATA_BACK_TO_NATURE))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_freya_knock_on_wood : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_freya_knock_on_wood(char const* name, uint32 count) : AchievementCriteriaScript(name),
|
||||
_elderCount(count)
|
||||
{
|
||||
}
|
||||
public:
|
||||
achievement_freya_knock_on_wood(char const* name, uint32 count) : AchievementCriteriaScript(name),
|
||||
_elderCount(count)
|
||||
{
|
||||
}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target /*Freya*/)
|
||||
{
|
||||
return target && _elderCount <= target->GetAI()->GetData(DATA_GET_ELDER_COUNT);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 const _elderCount;
|
||||
bool OnCheck(Player* /*player*/, Unit* target /*Freya*/)
|
||||
{
|
||||
return target && _elderCount <= target->GetAI()->GetData(DATA_GET_ELDER_COUNT);
|
||||
}
|
||||
|
||||
private:
|
||||
uint32 const _elderCount;
|
||||
};
|
||||
|
||||
void AddSC_boss_freya()
|
||||
|
||||
@@ -107,7 +107,7 @@ public:
|
||||
|
||||
struct boss_vezaxAI : public ScriptedAI
|
||||
{
|
||||
boss_vezaxAI(Creature *pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
boss_vezaxAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceScript();
|
||||
}
|
||||
@@ -180,8 +180,10 @@ public:
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 1: return (me->GetLootMode() == 3 ? 1 : 0);
|
||||
case 2: return (bAchievShadowdodger == true ? 1 : 0);
|
||||
case 1:
|
||||
return (me->GetLootMode() == 3 ? 1 : 0);
|
||||
case 2:
|
||||
return (bAchievShadowdodger == true ? 1 : 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -231,7 +233,7 @@ public:
|
||||
if (!players.empty())
|
||||
{
|
||||
me->setAttackTimer(BASE_ATTACK, 2000);
|
||||
Player* target = players.at(urand(0, players.size()-1));
|
||||
Player* target = players.at(urand(0, players.size() - 1));
|
||||
me->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID());
|
||||
me->CastSpell(target, SPELL_VEZAX_SHADOW_CRASH, false);
|
||||
events.ScheduleEvent(EVENT_RESTORE_TARGET, 750);
|
||||
@@ -259,22 +261,22 @@ public:
|
||||
{
|
||||
std::vector<Player*> outside;
|
||||
std::vector<Player*> inside;
|
||||
Map::PlayerList const &pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* tmp = itr->GetSource() )
|
||||
if( tmp->IsAlive() )
|
||||
{
|
||||
if( tmp->GetDistance(me) > 15.0f )
|
||||
outside.push_back(tmp);
|
||||
else
|
||||
inside.push_back(tmp);
|
||||
}
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* tmp = itr->GetSource() )
|
||||
if( tmp->IsAlive() )
|
||||
{
|
||||
if( tmp->GetDistance(me) > 15.0f )
|
||||
outside.push_back(tmp);
|
||||
else
|
||||
inside.push_back(tmp);
|
||||
}
|
||||
|
||||
Player* t = nullptr;
|
||||
if( outside.size() >= uint8(me->GetMap()->Is25ManRaid() ? 9 : 4) )
|
||||
t = outside.at(urand(0, outside.size()-1));
|
||||
t = outside.at(urand(0, outside.size() - 1));
|
||||
else if( !inside.empty() )
|
||||
t = inside.at(urand(0, inside.size()-1));
|
||||
t = inside.at(urand(0, inside.size() - 1));
|
||||
|
||||
if (t)
|
||||
me->CastSpell(t, SPELL_MARK_OF_THE_FACELESS_AURA, false);
|
||||
@@ -367,7 +369,7 @@ public:
|
||||
{
|
||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
if( urand(0,1) )
|
||||
if( urand(0, 1) )
|
||||
{
|
||||
me->MonsterYell(TEXT_VEZAX_SLAIN_1, LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_VEZAX_SLAIN_1, 0);
|
||||
@@ -406,7 +408,7 @@ public:
|
||||
|
||||
struct npc_ulduar_saronite_vaporsAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_saronite_vaporsAI(Creature *pCreature) : NullCreatureAI(pCreature)
|
||||
npc_ulduar_saronite_vaporsAI(Creature* pCreature) : NullCreatureAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceScript();
|
||||
me->GetMotionMaster()->MoveRandom(4.0f);
|
||||
@@ -438,7 +440,7 @@ public:
|
||||
|
||||
struct npc_ulduar_saronite_animusAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_saronite_animusAI(Creature *pCreature) : ScriptedAI(pCreature)
|
||||
npc_ulduar_saronite_animusAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceScript();
|
||||
if( pInstance )
|
||||
@@ -496,7 +498,7 @@ public:
|
||||
target->CastSpell(target, SPELL_AURA_OF_DESPAIR_2, true);
|
||||
if( target->HasSpell(SPELL_SHAMANISTIC_RAGE) )
|
||||
caster->CastSpell(target, SPELL_CORRUPTED_RAGE, true);
|
||||
else if( target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1) || target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1+1) || target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1+2) )
|
||||
else if( target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1) || target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1 + 1) || target->HasSpell(SPELL_JUDGEMENTS_OF_THE_WISDOM_RANK_1 + 2) )
|
||||
caster->CastSpell(target, SPELL_CORRUPTED_WISDOM, true);
|
||||
}
|
||||
}
|
||||
@@ -518,7 +520,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_aura_of_despair_AuraScript();
|
||||
}
|
||||
@@ -533,7 +535,7 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_mark_of_the_faceless_periodic_AuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * /*aurEff*/)
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
if (Unit* target = GetTarget())
|
||||
@@ -550,7 +552,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mark_of_the_faceless_periodic_AuraScript();
|
||||
}
|
||||
@@ -578,7 +580,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript *GetSpellScript() const
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_mark_of_the_faceless_drainhealth_SpellScript();
|
||||
}
|
||||
@@ -597,7 +599,7 @@ public:
|
||||
{
|
||||
if (Unit* caster = GetCaster())
|
||||
{
|
||||
int32 damage = 100*pow(2.0f, (float)GetStackAmount());
|
||||
int32 damage = 100 * pow(2.0f, (float)GetStackAmount());
|
||||
caster->CastCustomSpell(GetTarget(), SPELL_SARONITE_VAPORS_DMG, &damage, nullptr, nullptr, true);
|
||||
}
|
||||
}
|
||||
@@ -608,7 +610,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_saronite_vapors_dummy_AuraScript();
|
||||
}
|
||||
@@ -628,7 +630,7 @@ public:
|
||||
if (Unit* caster = GetCaster())
|
||||
if (GetHitDamage() > 2)
|
||||
{
|
||||
int32 mana = GetHitDamage()/2;
|
||||
int32 mana = GetHitDamage() / 2;
|
||||
if (Unit* t = GetHitUnit())
|
||||
caster->CastCustomSpell(t, SPELL_SARONITE_VAPORS_ENERGIZE, &mana, nullptr, nullptr, true);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ enum HodirSpellData
|
||||
SPELL_FLASH_FREEZE_VISUAL = 62148,
|
||||
SPELL_SAFE_AREA = 65705,
|
||||
SPELL_SAFE_AREA_TRIGGERED = 62464,
|
||||
|
||||
|
||||
SPELL_ICICLE_BOSS_AURA = 62227,
|
||||
SPELL_ICICLE_TBBA = 63545,
|
||||
|
||||
@@ -153,35 +153,36 @@ enum HodirSounds
|
||||
struct HodirHelperData
|
||||
{
|
||||
uint32 id;
|
||||
float x,y;
|
||||
float x, y;
|
||||
};
|
||||
HodirHelperData hhd[4][4] = {
|
||||
// Alliance:
|
||||
HodirHelperData hhd[4][4] =
|
||||
{
|
||||
{NPC_PAN_FIELD_MEDIC_PENNY, 2020.46f, -236.74f},
|
||||
{NPC_DAN_ELLIE_NIGHTFEATHER, 2007.21f, -241.57f},
|
||||
{NPC_SAN_ELEMENTALIST_AVUUN, 1999.14f, -230.69f},
|
||||
{NPC_MAN_MISSY_FLAMECUFFS, 1984.38f, -242.57f}
|
||||
},
|
||||
{
|
||||
{NPC_PAH_FIELD_MEDIC_JESSI, 2012.29f, -233.70f},
|
||||
{NPC_DAH_EIVI_NIGHTFEATHER, 1995.75f, -241.32f},
|
||||
{NPC_SAH_ELEMENTALIST_MAHFUUN, 1989.31f, -234.26f},
|
||||
{NPC_MAH_SISSY_FLAMECUFFS, 1977.87f, -233.99f}
|
||||
},
|
||||
// Horde:
|
||||
{
|
||||
{NPC_PHN_BATTLEPRIEST_ELIZA, 2020.46f, -236.74f},
|
||||
{NPC_DHN_TOR_GREYCLOUD, 2007.21f, -241.57f},
|
||||
{NPC_SHN_SPIRITWALKER_YONA, 1999.14f, -230.69f},
|
||||
{NPC_MHN_VEESHA_BLAZEWEAVER, 1984.38f, -242.57f}
|
||||
},
|
||||
{
|
||||
{NPC_PHH_BATTLEPRIEST_GINA, 2012.29f, -233.70f},
|
||||
{NPC_DHH_KAR_GREYCLOUD, 1995.75f, -241.32f},
|
||||
{NPC_SHH_SPIRITWALKER_TARA, 1989.31f, -234.6f},
|
||||
{NPC_MHH_AMIRA_BLAZEWEAVER, 1977.87f, -233.99f}
|
||||
}
|
||||
// Alliance:
|
||||
{
|
||||
{NPC_PAN_FIELD_MEDIC_PENNY, 2020.46f, -236.74f},
|
||||
{NPC_DAN_ELLIE_NIGHTFEATHER, 2007.21f, -241.57f},
|
||||
{NPC_SAN_ELEMENTALIST_AVUUN, 1999.14f, -230.69f},
|
||||
{NPC_MAN_MISSY_FLAMECUFFS, 1984.38f, -242.57f}
|
||||
},
|
||||
{
|
||||
{NPC_PAH_FIELD_MEDIC_JESSI, 2012.29f, -233.70f},
|
||||
{NPC_DAH_EIVI_NIGHTFEATHER, 1995.75f, -241.32f},
|
||||
{NPC_SAH_ELEMENTALIST_MAHFUUN, 1989.31f, -234.26f},
|
||||
{NPC_MAH_SISSY_FLAMECUFFS, 1977.87f, -233.99f}
|
||||
},
|
||||
// Horde:
|
||||
{
|
||||
{NPC_PHN_BATTLEPRIEST_ELIZA, 2020.46f, -236.74f},
|
||||
{NPC_DHN_TOR_GREYCLOUD, 2007.21f, -241.57f},
|
||||
{NPC_SHN_SPIRITWALKER_YONA, 1999.14f, -230.69f},
|
||||
{NPC_MHN_VEESHA_BLAZEWEAVER, 1984.38f, -242.57f}
|
||||
},
|
||||
{
|
||||
{NPC_PHH_BATTLEPRIEST_GINA, 2012.29f, -233.70f},
|
||||
{NPC_DHH_KAR_GREYCLOUD, 1995.75f, -241.32f},
|
||||
{NPC_SHH_SPIRITWALKER_TARA, 1989.31f, -234.6f},
|
||||
{NPC_MHH_AMIRA_BLAZEWEAVER, 1977.87f, -233.99f}
|
||||
}
|
||||
};
|
||||
|
||||
class boss_hodir : public CreatureScript
|
||||
@@ -196,7 +197,7 @@ public:
|
||||
|
||||
struct boss_hodirAI : public ScriptedAI
|
||||
{
|
||||
boss_hodirAI(Creature *pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
boss_hodirAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
{
|
||||
pInstance = pCreature->GetInstanceScript();
|
||||
if (!me->IsAlive())
|
||||
@@ -295,7 +296,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth() || me->GetHealth() < 150000)
|
||||
{
|
||||
@@ -337,7 +338,7 @@ public:
|
||||
d->UseDoorOrButton(0, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (GameObject* go = me->FindNearestGameObject(GO_HODIR_FRONTDOOR, 300.0f))
|
||||
{
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
@@ -349,13 +350,13 @@ public:
|
||||
|
||||
// spawn appropriate chests
|
||||
uint32 chestId = me->GetMap()->Is25ManRaid() ? GO_HODIR_CHEST_NORMAL_HERO : GO_HODIR_CHEST_NORMAL;
|
||||
if( GameObject *go = me->SummonGameObject(chestId, 1969.115f, -212.94f, 432.687f, 3*M_PI/2, 0, 0, 0, 0, 0) )
|
||||
if( GameObject* go = me->SummonGameObject(chestId, 1969.115f, -212.94f, 432.687f, 3 * M_PI / 2, 0, 0, 0, 0, 0) )
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
|
||||
|
||||
|
||||
if( hardmode )
|
||||
{
|
||||
uint32 chestId2 = me->GetMap()->Is25ManRaid() ? GO_HODIR_CHEST_HARD_HERO : GO_HODIR_CHEST_HARD;
|
||||
if( GameObject *go = me->SummonGameObject(chestId2, 2031.207f, -213.236f, 432.687f, 3*M_PI/2, 0, 0, 0, 0, 0) )
|
||||
if( GameObject* go = me->SummonGameObject(chestId2, 2031.207f, -213.236f, 432.687f, 3 * M_PI / 2, 0, 0, 0, 0, 0) )
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
|
||||
}
|
||||
}
|
||||
@@ -394,7 +395,7 @@ public:
|
||||
|
||||
if( me->HasUnitState(UNIT_STATE_CASTING) )
|
||||
return;
|
||||
|
||||
|
||||
switch( events.GetEvent() )
|
||||
{
|
||||
case 0:
|
||||
@@ -437,7 +438,7 @@ public:
|
||||
me->MonsterYell(TEXT_HODIR_FLASH_FREEZE, LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_HODIR_FLASH_FREEZE, 0);
|
||||
SmallIcicles(false);
|
||||
events.RepeatEvent(55000 + urand(0,10000));
|
||||
events.RepeatEvent(55000 + urand(0, 10000));
|
||||
events.ScheduleEvent(EVENT_SMALL_ICICLES_ENABLE, Is25ManRaid() ? 12000 : 24000);
|
||||
events.ScheduleEvent(EVENT_FROZEN_BLOWS, 15000);
|
||||
events.RescheduleEvent(EVENT_FREEZE, 20000);
|
||||
@@ -480,7 +481,7 @@ public:
|
||||
char faction = 'A';
|
||||
if( hhd[0][0].id )
|
||||
{
|
||||
Map::PlayerList const &cl = me->GetMap()->GetPlayers();
|
||||
Map::PlayerList const& cl = me->GetMap()->GetPlayers();
|
||||
for (Map::PlayerList::const_iterator itr = cl.begin(); itr != cl.end(); ++itr)
|
||||
if (!itr->GetSource()->IsGameMaster())
|
||||
{
|
||||
@@ -491,18 +492,18 @@ public:
|
||||
|
||||
uint8 cnt = 0;
|
||||
if( faction )
|
||||
for( uint8 k=0; k<4; ++k )
|
||||
for( uint8 k = 0; k < 4; ++k )
|
||||
{
|
||||
if( (faction == 'A' && ( k>1 || (k==1 && RAID_MODE(1,0)) )) ||
|
||||
(faction == 'H' && ( k<2 || (k==3 && RAID_MODE(1,0)) )) )
|
||||
if( (faction == 'A' && ( k > 1 || (k == 1 && RAID_MODE(1, 0)) )) ||
|
||||
(faction == 'H' && ( k < 2 || (k == 3 && RAID_MODE(1, 0)) )) )
|
||||
continue;
|
||||
|
||||
for( uint8 i=0; i<4; ++i )
|
||||
for( uint8 i = 0; i < 4; ++i )
|
||||
{
|
||||
if( !hhd[k][i].id )
|
||||
continue;
|
||||
|
||||
if( Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].x, hhd[k][i].y, 432.69f, M_PI/2) )
|
||||
if( Creature* h_p = me->SummonCreature(hhd[k][i].id, hhd[k][i].x, hhd[k][i].y, 432.69f, M_PI / 2) )
|
||||
{
|
||||
h_p->setFaction(1665);
|
||||
if( cnt < 8 )
|
||||
@@ -522,7 +523,7 @@ public:
|
||||
{
|
||||
if( who->GetTypeId() == TYPEID_PLAYER )
|
||||
{
|
||||
if( urand(0,1) )
|
||||
if( urand(0, 1) )
|
||||
{
|
||||
me->MonsterYell(TEXT_HODIR_SLAIN_1, LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_HODIR_SLAIN_1, 0);
|
||||
@@ -560,9 +561,15 @@ public:
|
||||
if (value)
|
||||
switch (id)
|
||||
{
|
||||
case 1: bAchievCheese = false; break;
|
||||
case 2: bAchievGettingCold = false; break;
|
||||
case 4: bAchievCoolestFriends = false; break;
|
||||
case 1:
|
||||
bAchievCheese = false;
|
||||
break;
|
||||
case 2:
|
||||
bAchievGettingCold = false;
|
||||
break;
|
||||
case 4:
|
||||
bAchievCoolestFriends = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -570,10 +577,14 @@ public:
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 1: return (bAchievCheese ? 1 : 0);
|
||||
case 2: return (bAchievGettingCold ? 1 : 0);
|
||||
case 3: return (hardmode ? 1 : 0);
|
||||
case 4: return (bAchievCoolestFriends ? 1 : 0);
|
||||
case 1:
|
||||
return (bAchievCheese ? 1 : 0);
|
||||
case 2:
|
||||
return (bAchievGettingCold ? 1 : 0);
|
||||
case 3:
|
||||
return (hardmode ? 1 : 0);
|
||||
case 4:
|
||||
return (bAchievCoolestFriends ? 1 : 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -594,7 +605,7 @@ public:
|
||||
|
||||
struct npc_ulduar_icicleAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_icicleAI(Creature *pCreature) : NullCreatureAI(pCreature)
|
||||
npc_ulduar_icicleAI(Creature* pCreature) : NullCreatureAI(pCreature)
|
||||
{
|
||||
timer1 = 2000;
|
||||
timer2 = 5000;
|
||||
@@ -607,7 +618,7 @@ public:
|
||||
{
|
||||
if( timer1 <= diff )
|
||||
{
|
||||
me->CastSpell(me, (me->GetEntry()==33169 ? SPELL_ICICLE_FALL_EFFECT_UNPACKED : SPELL_ICICLE_FALL_EFFECT_PACKED), true);
|
||||
me->CastSpell(me, (me->GetEntry() == 33169 ? SPELL_ICICLE_FALL_EFFECT_UNPACKED : SPELL_ICICLE_FALL_EFFECT_PACKED), true);
|
||||
me->CastSpell(me, SPELL_ICICLE_VISUAL_FALLING, false);
|
||||
timer1 = 60000;
|
||||
}
|
||||
@@ -637,7 +648,7 @@ public:
|
||||
|
||||
struct npc_ulduar_flash_freezeAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_flash_freezeAI(Creature *pCreature) : NullCreatureAI(pCreature)
|
||||
npc_ulduar_flash_freezeAI(Creature* pCreature) : NullCreatureAI(pCreature)
|
||||
{
|
||||
timer = 2500;
|
||||
pInstance = me->GetInstanceScript();
|
||||
@@ -646,7 +657,7 @@ public:
|
||||
InstanceScript* pInstance;
|
||||
uint16 timer;
|
||||
|
||||
void DamageTaken(Unit* doneBy, uint32 & /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit* doneBy, uint32& /*damage*/, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (pInstance && doneBy)
|
||||
if (pInstance->GetData(TYPE_HODIR) == NOT_STARTED)
|
||||
@@ -659,7 +670,8 @@ public:
|
||||
if (timer <= diff)
|
||||
{
|
||||
timer = 2500;
|
||||
if (me->IsSummon()) {
|
||||
if (me->IsSummon())
|
||||
{
|
||||
if (Unit* s = me->ToTempSummon()->GetSummoner())
|
||||
{
|
||||
if ((s->GetTypeId() == TYPEID_PLAYER && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_PLAYER)) || (s->GetTypeId() == TYPEID_UNIT && !s->HasAura(SPELL_FLASH_FREEZE_TRAPPED_NPC)))
|
||||
@@ -696,7 +708,7 @@ public:
|
||||
|
||||
struct npc_ulduar_toasty_fireAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_toasty_fireAI(Creature *pCreature) : NullCreatureAI(pCreature)
|
||||
npc_ulduar_toasty_fireAI(Creature* pCreature) : NullCreatureAI(pCreature)
|
||||
{
|
||||
me->CastSpell(me, SPELL_MAGE_TOASTY_FIRE_AURA, true);
|
||||
}
|
||||
@@ -739,7 +751,7 @@ public:
|
||||
|
||||
struct npc_ulduar_hodir_priestAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_hodir_priestAI(Creature *pCreature) : ScriptedAI(pCreature)
|
||||
npc_ulduar_hodir_priestAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
events.Reset();
|
||||
@@ -757,7 +769,7 @@ public:
|
||||
void ScheduleAbilities()
|
||||
{
|
||||
events.ScheduleEvent(EVENT_PRIEST_DISPELL_MAGIC, 7000);
|
||||
events.ScheduleEvent(EVENT_PRIEST_GREAT_HEAL, urand(6000,7000));
|
||||
events.ScheduleEvent(EVENT_PRIEST_GREAT_HEAL, urand(6000, 7000));
|
||||
events.ScheduleEvent(EVENT_PRIEST_SMITE, 2100);
|
||||
}
|
||||
|
||||
@@ -802,7 +814,7 @@ public:
|
||||
break;
|
||||
case EVENT_PRIEST_GREAT_HEAL:
|
||||
me->CastSpell(me, SPELL_PRIEST_GREAT_HEAL, false);
|
||||
events.RepeatEvent(urand(6000,7000));
|
||||
events.RepeatEvent(urand(6000, 7000));
|
||||
break;
|
||||
case EVENT_PRIEST_SMITE:
|
||||
if (Unit* victim = me->GetVictim())
|
||||
@@ -837,7 +849,7 @@ public:
|
||||
|
||||
struct npc_ulduar_hodir_druidAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_hodir_druidAI(Creature *pCreature) : ScriptedAI(pCreature)
|
||||
npc_ulduar_hodir_druidAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
events.Reset();
|
||||
@@ -935,7 +947,7 @@ public:
|
||||
|
||||
struct npc_ulduar_hodir_shamanAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_hodir_shamanAI(Creature *pCreature) : ScriptedAI(pCreature)
|
||||
npc_ulduar_hodir_shamanAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
events.Reset();
|
||||
@@ -1036,7 +1048,7 @@ public:
|
||||
|
||||
struct npc_ulduar_hodir_mageAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_hodir_mageAI(Creature *pCreature) : ScriptedAI(pCreature)
|
||||
npc_ulduar_hodir_mageAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
events.Reset();
|
||||
@@ -1149,9 +1161,9 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_biting_cold_main_aura_AuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * aurEff)
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if ((aurEff->GetTickNumber()%4) == 0)
|
||||
if ((aurEff->GetTickNumber() % 4) == 0)
|
||||
if (Unit* target = GetTarget())
|
||||
if (target->GetTypeId() == TYPEID_PLAYER && !target->isMoving() && !target->HasAura(SPELL_BITING_COLD_PLAYER_AURA))
|
||||
target->CastSpell(target, SPELL_BITING_COLD_PLAYER_AURA, true);
|
||||
@@ -1163,7 +1175,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_hodir_biting_cold_main_aura_AuraScript();
|
||||
}
|
||||
@@ -1188,9 +1200,9 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * /*aurEff*/)
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
|
||||
|
||||
if (Unit* target = GetTarget())
|
||||
{
|
||||
if (target->GetMapId() == 603)
|
||||
@@ -1207,7 +1219,7 @@ public:
|
||||
else
|
||||
prev = true;
|
||||
|
||||
if (counter>=2)
|
||||
if (counter >= 2)
|
||||
counter -= 2;
|
||||
else if (counter)
|
||||
--counter;
|
||||
@@ -1227,7 +1239,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
const int32 dmg = 200*pow(2.0f, GetStackAmount());
|
||||
const int32 dmg = 200 * pow(2.0f, GetStackAmount());
|
||||
target->CastCustomSpell(target, SPELL_BITING_COLD_DAMAGE, &dmg, 0, 0, true);
|
||||
}
|
||||
}
|
||||
@@ -1238,7 +1250,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_hodir_biting_cold_player_aura_AuraScript();
|
||||
}
|
||||
@@ -1310,9 +1322,9 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_flash_freeze_AuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * aurEff)
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetTotalTicks() > 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks())-1)
|
||||
if (aurEff->GetTotalTicks() > 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks()) - 1)
|
||||
{
|
||||
Unit* target = GetTarget();
|
||||
Unit* caster = GetCaster();
|
||||
@@ -1330,7 +1342,7 @@ public:
|
||||
if (target->GetTypeId() == TYPEID_PLAYER)
|
||||
{
|
||||
caster->ToCreature()->AI()->SetData(1, 1);
|
||||
if( Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_PLR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5*60*1000) )
|
||||
if( Creature* c = target->SummonCreature(NPC_FLASH_FREEZE_PLR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 5 * 60 * 1000) )
|
||||
{
|
||||
c->CastSpell(target, SPELL_FLASH_FREEZE_TRAPPED_PLAYER, true);
|
||||
caster->ToCreature()->AI()->JustSummoned(c);
|
||||
@@ -1358,7 +1370,7 @@ public:
|
||||
return new spell_hodir_flash_freeze_SpellScript();
|
||||
}
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_hodir_flash_freeze_AuraScript();
|
||||
}
|
||||
@@ -1394,7 +1406,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_hodir_storm_power_AuraScript();
|
||||
}
|
||||
@@ -1409,7 +1421,7 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_hodir_storm_cloud_AuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * /*aurEff*/)
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* target = GetTarget())
|
||||
@@ -1422,7 +1434,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_hodir_storm_cloud_AuraScript();
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
|
||||
struct npc_ulduar_iron_constructAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_iron_constructAI(Creature *pCreature) : ScriptedAI(pCreature)
|
||||
npc_ulduar_iron_constructAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
me->CastSpell(me, 38757, true);
|
||||
}
|
||||
@@ -126,14 +126,14 @@ public:
|
||||
else if (spell->Id == SPELL_HEAT_BUFF)
|
||||
{
|
||||
if (Aura* a = me->GetAura(SPELL_HEAT_BUFF))
|
||||
if( a->GetStackAmount() >= RAID_MODE(10,20) )
|
||||
{
|
||||
if (RAID_MODE(1,0) && a->GetStackAmount() > 10) // prevent going over 10 on 10man version
|
||||
a->ModStackAmount(-1);
|
||||
if( a->GetStackAmount() >= RAID_MODE(10, 20) )
|
||||
{
|
||||
if (RAID_MODE(1, 0) && a->GetStackAmount() > 10) // prevent going over 10 on 10man version
|
||||
a->ModStackAmount(-1);
|
||||
|
||||
me->CastSpell(me, SPELL_MOLTEN, true);
|
||||
me->getThreatManager().resetAllAggro();
|
||||
}
|
||||
me->CastSpell(me, SPELL_MOLTEN, true);
|
||||
me->getThreatManager().resetAllAggro();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ public:
|
||||
|
||||
struct boss_ignisAI : public ScriptedAI
|
||||
{
|
||||
boss_ignisAI(Creature *pCreature) : ScriptedAI(pCreature) { }
|
||||
boss_ignisAI(Creature* pCreature) : ScriptedAI(pCreature) { }
|
||||
|
||||
EventMap events;
|
||||
uint8 counter;
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
bShattered = false;
|
||||
lastShatterMSTime = 0;
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_ACTIVATE_CONSTRUCT, RAID_MODE(40000,30000));
|
||||
events.ScheduleEvent(EVENT_ACTIVATE_CONSTRUCT, RAID_MODE(40000, 30000));
|
||||
events.ScheduleEvent(EVENT_SPELL_SCORCH, 10000);
|
||||
events.ScheduleEvent(EVENT_SPELL_FLAME_JETS, 32000);
|
||||
events.ScheduleEvent(EVENT_GRAB, 25000);
|
||||
@@ -282,7 +282,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit* /*victim*/)
|
||||
{
|
||||
if( rand()%2 )
|
||||
if( rand() % 2 )
|
||||
{
|
||||
me->MonsterYell(TEXT_SLAY_1, LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_SLAY_1);
|
||||
@@ -294,7 +294,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
void JustDied(Unit* /*victim*/)
|
||||
{
|
||||
me->MonsterYell(TEXT_DEATH, LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_DEATH);
|
||||
@@ -350,10 +350,10 @@ public:
|
||||
events.PopEvent();
|
||||
break;
|
||||
}
|
||||
events.RepeatEvent(RAID_MODE(40000,30000));
|
||||
events.RepeatEvent(RAID_MODE(40000, 30000));
|
||||
break;
|
||||
case EVENT_SPELL_SCORCH:
|
||||
if( rand()%2 )
|
||||
if( rand() % 2 )
|
||||
{
|
||||
me->MonsterYell(TEXT_SCORCH_1, LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_SCORCH_1);
|
||||
@@ -410,8 +410,8 @@ public:
|
||||
|
||||
if( !playerGUIDs.empty() )
|
||||
{
|
||||
int8 pos = urand(0, playerGUIDs.size()-1);
|
||||
if( Player* pTarget = ObjectAccessor::GetPlayer(*me,playerGUIDs.at(pos)) )
|
||||
int8 pos = urand(0, playerGUIDs.size() - 1);
|
||||
if( Player* pTarget = ObjectAccessor::GetPlayer(*me, playerGUIDs.at(pos)) )
|
||||
{
|
||||
me->MonsterYell(TEXT_SLAG_POT, LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_SLAG_POT);
|
||||
@@ -446,13 +446,13 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_ignis_scorch_AuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * aurEff)
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (aurEff->GetTotalTicks() >= 0 && aurEff->GetTickNumber() == uint32(aurEff->GetTotalTicks()))
|
||||
if (Unit* c = GetCaster())
|
||||
if (Creature* s = c->SummonCreature(NPC_SCORCHED_GROUND, c->GetPositionX()+20.0f*cos(c->GetOrientation()), c->GetPositionY()+20.0f*sin(c->GetOrientation()), 361.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 30000))
|
||||
if (Creature* s = c->SummonCreature(NPC_SCORCHED_GROUND, c->GetPositionX() + 20.0f * cos(c->GetOrientation()), c->GetPositionY() + 20.0f * sin(c->GetOrientation()), 361.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 30000))
|
||||
{
|
||||
if (!s->FindNearestCreature(NPC_WATER_TRIGGER, 25.0f,true)) // must be away from the water
|
||||
if (!s->FindNearestCreature(NPC_WATER_TRIGGER, 25.0f, true)) // must be away from the water
|
||||
s->CastSpell(s, (aurEff->GetId() == 62546 ? SPELL_SCORCHED_GROUND_10 : SPELL_SCORCHED_GROUND_25), true);
|
||||
}
|
||||
}
|
||||
@@ -463,7 +463,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_ignis_scorch_AuraScript();
|
||||
}
|
||||
@@ -505,7 +505,7 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_ignis_slag_pot_AuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * /*aurEff*/)
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* c = GetCaster())
|
||||
if (Unit* t = GetTarget())
|
||||
@@ -540,7 +540,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_ignis_slag_pot_AuraScript();
|
||||
}
|
||||
@@ -548,15 +548,15 @@ public:
|
||||
|
||||
class achievement_ignis_shattered : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_ignis_shattered() : AchievementCriteriaScript("achievement_ignis_shattered") {}
|
||||
public:
|
||||
achievement_ignis_shattered() : AchievementCriteriaScript("achievement_ignis_shattered") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (!target || target->GetTypeId() != TYPEID_UNIT)
|
||||
return false;
|
||||
return !!target->ToCreature()->AI()->GetData(1337);
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (!target || target->GetTypeId() != TYPEID_UNIT)
|
||||
return false;
|
||||
return !!target->ToCreature()->AI()->GetData(1337);
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_ignis()
|
||||
|
||||
@@ -289,7 +289,7 @@ public:
|
||||
bridge->SetGoState(GO_STATE_READY);
|
||||
|
||||
// Summon Chest
|
||||
if (GameObject* go = me->SummonGameObject(RAID_MODE(GO_KOLOGARN_CHEST, GO_KOLOGARN_CHEST_HERO), 1839.62f, -35.98f, 448.81f, 3.6f, 0, 0, 0, 0, 7*86400))
|
||||
if (GameObject* go = me->SummonGameObject(RAID_MODE(GO_KOLOGARN_CHEST, GO_KOLOGARN_CHEST_HERO), 1839.62f, -35.98f, 448.81f, 3.6f, 0, 0, 0, 0, 7 * 86400))
|
||||
{
|
||||
me->RemoveGameObject(go, false);
|
||||
go->SetSpellId(1); // hack to make it despawn
|
||||
@@ -303,7 +303,7 @@ public:
|
||||
|
||||
void KilledUnit(Unit*) override
|
||||
{
|
||||
if (!urand(0,2))
|
||||
if (!urand(0, 2))
|
||||
return;
|
||||
|
||||
Talk(SAY_SLAY);
|
||||
@@ -346,7 +346,7 @@ public:
|
||||
{
|
||||
if (who && who->GetEntry() == me->GetEntry() && me->GetHealth())
|
||||
{
|
||||
damage = std::min(damage, me->GetHealth()-1);
|
||||
damage = std::min(damage, me->GetHealth() - 1);
|
||||
me->LowerPlayerDamageReq(damage);
|
||||
}
|
||||
}
|
||||
@@ -362,7 +362,7 @@ public:
|
||||
events.ScheduleEvent(EVENT_FOCUSED_EYEBEAM, 25000);
|
||||
events.ScheduleEvent(EVENT_PREPARE_BREATH, 3000);
|
||||
//events.ScheduleEvent(EVENT_ENRAGE, x); no info
|
||||
|
||||
|
||||
Talk(SAY_AGGRO);
|
||||
me->setActive(true);
|
||||
|
||||
@@ -403,7 +403,7 @@ public:
|
||||
me->CastSpell(me->GetVictim(), SPELL_OVERHEAD_SMASH, false);
|
||||
else if (_left || _right)
|
||||
me->CastSpell(me->GetVictim(), SPELL_ONEARMED_OVERHEAD_SMASH, false);
|
||||
|
||||
|
||||
events.DelayEvents(1000);
|
||||
events.ScheduleEvent(EVENT_SMASH, 14000);
|
||||
return;
|
||||
@@ -413,7 +413,7 @@ public:
|
||||
if (Creature* cr = me->FindNearestCreature(NPC_SWEEP_TRIGGER, 300))
|
||||
cr->CastSpell(cr, SPELL_ARM_SWEEP, false);
|
||||
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
Talk(SAY_SHOCKWAVE);
|
||||
}
|
||||
|
||||
@@ -430,37 +430,37 @@ public:
|
||||
Talk(EMOTE_STONE_GRIP);
|
||||
return;
|
||||
case EVENT_FOCUSED_EYEBEAM:
|
||||
{
|
||||
events.ScheduleEvent(EVENT_FOCUSED_EYEBEAM, 13000+rand()%5000);
|
||||
Unit* target = nullptr;
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
for(auto itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
{
|
||||
if (itr->GetSource()->GetPositionZ() < 420)
|
||||
continue;
|
||||
events.ScheduleEvent(EVENT_FOCUSED_EYEBEAM, 13000 + rand() % 5000);
|
||||
Unit* target = nullptr;
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
for(auto itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
{
|
||||
if (itr->GetSource()->GetPositionZ() < 420)
|
||||
continue;
|
||||
|
||||
target = itr->GetSource();
|
||||
if (urand(0,3) == 3)
|
||||
target = itr->GetSource();
|
||||
if (urand(0, 3) == 3)
|
||||
break;
|
||||
}
|
||||
if (!target)
|
||||
break;
|
||||
}
|
||||
if (!target)
|
||||
break;
|
||||
|
||||
if (Creature* eye = me->SummonCreature(NPC_EYE_LEFT, target->GetPositionX(), target->GetPositionY()-6, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 12000))
|
||||
{
|
||||
eye->GetMotionMaster()->MoveFollow(target, 0.01f, M_PI*3/2, MOTION_SLOT_CONTROLLED);
|
||||
me->CastSpell(eye, SPELL_FOCUSED_EYEBEAM_LEFT, true);
|
||||
}
|
||||
if (Creature* eye2 = me->SummonCreature(NPC_EYE_RIGHT, target->GetPositionX(), target->GetPositionY()+6, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 12000))
|
||||
{
|
||||
eye2->GetMotionMaster()->MoveFollow(target, 0.01f, M_PI/2, MOTION_SLOT_CONTROLLED);
|
||||
eye2->CastSpell(me, SPELL_FOCUSED_EYEBEAM_RIGHT, true);
|
||||
}
|
||||
if (Creature* eye = me->SummonCreature(NPC_EYE_LEFT, target->GetPositionX(), target->GetPositionY() - 6, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 12000))
|
||||
{
|
||||
eye->GetMotionMaster()->MoveFollow(target, 0.01f, M_PI * 3 / 2, MOTION_SLOT_CONTROLLED);
|
||||
me->CastSpell(eye, SPELL_FOCUSED_EYEBEAM_LEFT, true);
|
||||
}
|
||||
if (Creature* eye2 = me->SummonCreature(NPC_EYE_RIGHT, target->GetPositionX(), target->GetPositionY() + 6, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 12000))
|
||||
{
|
||||
eye2->GetMotionMaster()->MoveFollow(target, 0.01f, M_PI / 2, MOTION_SLOT_CONTROLLED);
|
||||
eye2->CastSpell(me, SPELL_FOCUSED_EYEBEAM_RIGHT, true);
|
||||
}
|
||||
|
||||
Talk(EMOTE_EYES);
|
||||
events.DelayEvents(12000, 0);
|
||||
return;
|
||||
}
|
||||
Talk(EMOTE_EYES);
|
||||
events.DelayEvents(12000, 0);
|
||||
return;
|
||||
}
|
||||
case EVENT_RESTORE_ARM_LEFT:
|
||||
// shouldn't happen
|
||||
events.PopEvent();
|
||||
@@ -564,24 +564,28 @@ public:
|
||||
// left arm
|
||||
if( me->GetEntry() == NPC_LEFT_ARM )
|
||||
{
|
||||
x = 1776.97f; y = -44.8396f; z = 448.888f;
|
||||
x = 1776.97f;
|
||||
y = -44.8396f;
|
||||
z = 448.888f;
|
||||
}
|
||||
else
|
||||
{
|
||||
x = 1777.82f; y = -3.50803f; z = 448.888f;
|
||||
x = 1777.82f;
|
||||
y = -3.50803f;
|
||||
z = 448.888f;
|
||||
}
|
||||
|
||||
if (Creature *cr = me->SummonTrigger(x, y, z, 0, 5000))
|
||||
if (Creature* cr = me->SummonTrigger(x, y, z, 0, 5000))
|
||||
{
|
||||
cr->CastSpell(cr, SPELL_RUBBLE_FALL, true);
|
||||
|
||||
if (me->GetInstanceScript())
|
||||
if (Creature* kologarn = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetData64(TYPE_KOLOGARN)))
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
if (Creature* cr2 = kologarn->SummonCreature(NPC_RUBBLE_SUMMON, cr->GetPositionX()+irand(-5,5), cr->GetPositionY()+irand(-5,5), cr->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
|
||||
if (Creature* cr2 = kologarn->SummonCreature(NPC_RUBBLE_SUMMON, cr->GetPositionX() + irand(-5, 5), cr->GetPositionY() + irand(-5, 5), cr->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000))
|
||||
{
|
||||
cr2->SetInCombatWithZone();
|
||||
if (Unit *target = SelectTargetFromPlayerList(100))
|
||||
if (Unit* target = SelectTargetFromPlayerList(100))
|
||||
cr2->AI()->AttackStart(target);
|
||||
}
|
||||
}
|
||||
@@ -589,7 +593,7 @@ public:
|
||||
if (me->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*me, me->GetInstanceScript()->GetData64(TYPE_KOLOGARN)))
|
||||
cr->AI()->DoAction(DATA_KOLOGARN_RUBBLE_ACHIEV);
|
||||
|
||||
|
||||
me->ExitVehicle();
|
||||
}
|
||||
};
|
||||
@@ -607,7 +611,7 @@ public:
|
||||
|
||||
struct boss_kologarn_eyebeamAI : public NullCreatureAI
|
||||
{
|
||||
boss_kologarn_eyebeamAI(Creature *c) : NullCreatureAI(c), _timer(1), _damaged(false) {}
|
||||
boss_kologarn_eyebeamAI(Creature* c) : NullCreatureAI(c), _timer(1), _damaged(false) {}
|
||||
|
||||
uint32 _timer;
|
||||
bool _damaged;
|
||||
@@ -641,223 +645,223 @@ public:
|
||||
// predicate function to select non main tank target
|
||||
class StoneGripTargetSelector : public acore::unary_function<Unit*, bool>
|
||||
{
|
||||
public:
|
||||
StoneGripTargetSelector(Creature* me, Unit const* victim) : _me(me), _victim(victim) {}
|
||||
public:
|
||||
StoneGripTargetSelector(Creature* me, Unit const* victim) : _me(me), _victim(victim) {}
|
||||
|
||||
bool operator() (WorldObject* target) const
|
||||
{
|
||||
if (target == _victim && _me->getThreatManager().getThreatList().size() > 1)
|
||||
return true;
|
||||
bool operator() (WorldObject* target) const
|
||||
{
|
||||
if (target == _victim && _me->getThreatManager().getThreatList().size() > 1)
|
||||
return true;
|
||||
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
return true;
|
||||
if (target->GetTypeId() != TYPEID_PLAYER)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Creature* _me;
|
||||
Unit const* _victim;
|
||||
Creature* _me;
|
||||
Unit const* _victim;
|
||||
};
|
||||
|
||||
class spell_ulduar_stone_grip_cast_target : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_ulduar_stone_grip_cast_target() : SpellScriptLoader("spell_ulduar_stone_grip_cast_target") { }
|
||||
public:
|
||||
spell_ulduar_stone_grip_cast_target() : SpellScriptLoader("spell_ulduar_stone_grip_cast_target") { }
|
||||
|
||||
class spell_ulduar_stone_grip_cast_target_SpellScript : public SpellScript
|
||||
class spell_ulduar_stone_grip_cast_target_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_ulduar_stone_grip_cast_target_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
PrepareSpellScript(spell_ulduar_stone_grip_cast_target_SpellScript);
|
||||
|
||||
bool Load()
|
||||
{
|
||||
if (GetCaster()->GetTypeId() != TYPEID_UNIT)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void FilterTargetsInitial(std::list<WorldObject*>& targets)
|
||||
{
|
||||
// Remove "main tank" and non-player targets
|
||||
targets.remove_if (StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->GetVictim()));
|
||||
// Maximum affected targets per difficulty mode
|
||||
uint32 maxTargets = 1;
|
||||
if (GetSpellInfo()->Id == 63981)
|
||||
maxTargets = 3;
|
||||
|
||||
// Return a random amount of targets based on maxTargets
|
||||
while (maxTargets < targets.size())
|
||||
{
|
||||
std::list<WorldObject*>::iterator itr = targets.begin();
|
||||
advance(itr, urand(0, targets.size()-1));
|
||||
targets.erase(itr);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_ulduar_stone_grip_cast_target_SpellScript();
|
||||
if (GetCaster()->GetTypeId() != TYPEID_UNIT)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void FilterTargetsInitial(std::list<WorldObject*>& targets)
|
||||
{
|
||||
// Remove "main tank" and non-player targets
|
||||
targets.remove_if (StoneGripTargetSelector(GetCaster()->ToCreature(), GetCaster()->GetVictim()));
|
||||
// Maximum affected targets per difficulty mode
|
||||
uint32 maxTargets = 1;
|
||||
if (GetSpellInfo()->Id == 63981)
|
||||
maxTargets = 3;
|
||||
|
||||
// Return a random amount of targets based on maxTargets
|
||||
while (maxTargets < targets.size())
|
||||
{
|
||||
std::list<WorldObject*>::iterator itr = targets.begin();
|
||||
advance(itr, urand(0, targets.size() - 1));
|
||||
targets.erase(itr);
|
||||
}
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_ulduar_stone_grip_cast_target_SpellScript::FilterTargetsInitial, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_ulduar_stone_grip_cast_target_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_ulduar_stone_grip : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_ulduar_stone_grip() : SpellScriptLoader("spell_ulduar_stone_grip") { }
|
||||
public:
|
||||
spell_ulduar_stone_grip() : SpellScriptLoader("spell_ulduar_stone_grip") { }
|
||||
|
||||
class spell_ulduar_stone_grip_AuraScript : public AuraScript
|
||||
class spell_ulduar_stone_grip_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_ulduar_stone_grip_AuraScript);
|
||||
|
||||
void OnRemoveStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_ulduar_stone_grip_AuraScript);
|
||||
|
||||
void OnRemoveStun(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* owner = GetOwner()->ToPlayer())
|
||||
owner->RemoveAurasDueToSpell(aurEff->GetAmount());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_ulduar_stone_grip_AuraScript::OnRemoveStun, EFFECT_2, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_ulduar_stone_grip_AuraScript();
|
||||
if (Player* owner = GetOwner()->ToPlayer())
|
||||
owner->RemoveAurasDueToSpell(aurEff->GetAmount());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_ulduar_stone_grip_AuraScript::OnRemoveStun, EFFECT_2, SPELL_AURA_MOD_STUN, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_ulduar_stone_grip_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_ulduar_squeezed_lifeless : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_ulduar_squeezed_lifeless() : SpellScriptLoader("spell_ulduar_squeezed_lifeless") { }
|
||||
public:
|
||||
spell_ulduar_squeezed_lifeless() : SpellScriptLoader("spell_ulduar_squeezed_lifeless") { }
|
||||
|
||||
class spell_ulduar_squeezed_lifeless_SpellScript : public SpellScript
|
||||
class spell_ulduar_squeezed_lifeless_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_ulduar_squeezed_lifeless_SpellScript);
|
||||
|
||||
void HandleInstaKill(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
PrepareSpellScript(spell_ulduar_squeezed_lifeless_SpellScript);
|
||||
if (!GetHitPlayer() || !GetHitPlayer()->GetVehicle())
|
||||
return;
|
||||
|
||||
void HandleInstaKill(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
if (!GetHitPlayer() || !GetHitPlayer()->GetVehicle())
|
||||
return;
|
||||
|
||||
// Hack to set correct position is in _ExitVehicle()
|
||||
GetHitPlayer()->ExitVehicle();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_ulduar_squeezed_lifeless_SpellScript::HandleInstaKill, EFFECT_1, SPELL_EFFECT_INSTAKILL);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_ulduar_squeezed_lifeless_SpellScript();
|
||||
// Hack to set correct position is in _ExitVehicle()
|
||||
GetHitPlayer()->ExitVehicle();
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_ulduar_squeezed_lifeless_SpellScript::HandleInstaKill, EFFECT_1, SPELL_EFFECT_INSTAKILL);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_ulduar_squeezed_lifeless_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_kologarn_stone_shout : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_kologarn_stone_shout() : SpellScriptLoader("spell_kologarn_stone_shout") { }
|
||||
public:
|
||||
spell_kologarn_stone_shout() : SpellScriptLoader("spell_kologarn_stone_shout") { }
|
||||
|
||||
class spell_kologarn_stone_shout_AuraScript : public AuraScript
|
||||
class spell_kologarn_stone_shout_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_kologarn_stone_shout_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_kologarn_stone_shout_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
uint32 triggerSpellId = GetSpellInfo()->Effects[EFFECT_0].TriggerSpell;
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, triggerSpellId, false);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
if (m_scriptSpellId == SPELL_STONE_SHOUT_10 || m_scriptSpellId == SPELL_STONE_SHOUT_25)
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kologarn_stone_shout_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_kologarn_stone_shout_AuraScript();
|
||||
uint32 triggerSpellId = GetSpellInfo()->Effects[EFFECT_0].TriggerSpell;
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(caster, triggerSpellId, false);
|
||||
}
|
||||
|
||||
class spell_kologarn_stone_shout_SpellScript : public SpellScript
|
||||
void Register()
|
||||
{
|
||||
PrepareSpellScript(spell_kologarn_stone_shout_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if (PlayerOrPetCheck());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
if (m_scriptSpellId != SPELL_STONE_SHOUT_10 && m_scriptSpellId != SPELL_STONE_SHOUT_25)
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kologarn_stone_shout_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_kologarn_stone_shout_SpellScript();
|
||||
if (m_scriptSpellId == SPELL_STONE_SHOUT_10 || m_scriptSpellId == SPELL_STONE_SHOUT_25)
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_kologarn_stone_shout_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_kologarn_stone_shout_AuraScript();
|
||||
}
|
||||
|
||||
class spell_kologarn_stone_shout_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_kologarn_stone_shout_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if (PlayerOrPetCheck());
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
if (m_scriptSpellId != SPELL_STONE_SHOUT_10 && m_scriptSpellId != SPELL_STONE_SHOUT_25)
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_kologarn_stone_shout_SpellScript::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_kologarn_stone_shout_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_kologarn_looks_could_kill : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_kologarn_looks_could_kill() : AchievementCriteriaScript("achievement_kologarn_looks_could_kill") {}
|
||||
public:
|
||||
achievement_kologarn_looks_could_kill() : AchievementCriteriaScript("achievement_kologarn_looks_could_kill") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_KOLOGARN)))
|
||||
return cr->AI()->GetData(DATA_KOLOGARN_LOOKS_ACHIEV);
|
||||
|
||||
return false;
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_KOLOGARN)))
|
||||
return cr->AI()->GetData(DATA_KOLOGARN_LOOKS_ACHIEV);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_kologarn_rubble_and_roll : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_kologarn_rubble_and_roll() : AchievementCriteriaScript("achievement_kologarn_rubble_and_roll") {}
|
||||
public:
|
||||
achievement_kologarn_rubble_and_roll() : AchievementCriteriaScript("achievement_kologarn_rubble_and_roll") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_KOLOGARN)))
|
||||
return cr->AI()->GetData(DATA_KOLOGARN_RUBBLE_ACHIEV);
|
||||
|
||||
return false;
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_KOLOGARN)))
|
||||
return cr->AI()->GetData(DATA_KOLOGARN_RUBBLE_ACHIEV);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_kologarn_with_open_arms : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_kologarn_with_open_arms() : AchievementCriteriaScript("achievement_kologarn_with_open_arms") {}
|
||||
public:
|
||||
achievement_kologarn_with_open_arms() : AchievementCriteriaScript("achievement_kologarn_with_open_arms") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_KOLOGARN)))
|
||||
return cr->AI()->GetData(DATA_KOLOGARN_ARMS_ACHIEV);
|
||||
|
||||
return false;
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_KOLOGARN)))
|
||||
return cr->AI()->GetData(DATA_KOLOGARN_ARMS_ACHIEV);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_kologarn()
|
||||
|
||||
@@ -293,7 +293,7 @@ public:
|
||||
|
||||
struct boss_mimironAI : public ScriptedAI
|
||||
{
|
||||
boss_mimironAI(Creature *pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
boss_mimironAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
if (!me->IsAlive())
|
||||
@@ -384,14 +384,14 @@ public:
|
||||
else
|
||||
{
|
||||
events.ScheduleEvent(EVENT_MIMIRON_SAY_HARDMODE, 7000);
|
||||
events.ScheduleEvent(EVENT_BERSERK, Is25ManRaid() ? 10*MINUTE*IN_MILLISECONDS : 8*MINUTE*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_BERSERK, Is25ManRaid() ? 10 * MINUTE* IN_MILLISECONDS : 8 * MINUTE * IN_MILLISECONDS);
|
||||
|
||||
events.ScheduleEvent(EVENT_COMPUTER_SAY_INITIATED, 0);
|
||||
events.ScheduleEvent(EVENT_COMPUTER_SAY_MINUTES, 3000);
|
||||
minutesTalkNum = Is25ManRaid() ? TALK_COMPUTER_TEN : TALK_COMPUTER_EIGHT;
|
||||
for (uint32 i=0; i<uint32(TALK_COMPUTER_ZERO-minutesTalkNum-1); ++i)
|
||||
events.ScheduleEvent(EVENT_COMPUTER_SAY_MINUTES, (i+1)*MINUTE*IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_COMPUTER_SAY_MINUTES, (TALK_COMPUTER_ZERO-minutesTalkNum)*MINUTE*IN_MILLISECONDS + 6000);
|
||||
for (uint32 i = 0; i < uint32(TALK_COMPUTER_ZERO - minutesTalkNum - 1); ++i)
|
||||
events.ScheduleEvent(EVENT_COMPUTER_SAY_MINUTES, (i + 1)*MINUTE * IN_MILLISECONDS);
|
||||
events.ScheduleEvent(EVENT_COMPUTER_SAY_MINUTES, (TALK_COMPUTER_ZERO - minutesTalkNum)*MINUTE * IN_MILLISECONDS + 6000);
|
||||
}
|
||||
|
||||
// ensure LMK2 is at proper position
|
||||
@@ -456,23 +456,23 @@ public:
|
||||
allowedFlameSpreadTime = time(nullptr);
|
||||
|
||||
std::vector<Player*> pg;
|
||||
Map::PlayerList const &pl = me->GetMap()->GetPlayers();
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
if( plr->IsAlive() && plr->GetExactDist2d(me) < 150.0f && !plr->IsGameMaster() )
|
||||
pg.push_back(plr);
|
||||
|
||||
for( uint8 i=0; i<3; ++i )
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( !pg.empty() )
|
||||
{
|
||||
uint8 index = urand(0, pg.size()-1);
|
||||
uint8 index = urand(0, pg.size() - 1);
|
||||
Player* p = pg[index];
|
||||
float angle = rand_norm()*2*M_PI;
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
float z = 364.35f;
|
||||
if (!p->IsWithinLOS(p->GetPositionX()+cos(angle)*5.0f, p->GetPositionY()+sin(angle)*5.0f, z))
|
||||
if (!p->IsWithinLOS(p->GetPositionX() + cos(angle) * 5.0f, p->GetPositionY() + sin(angle) * 5.0f, z))
|
||||
angle = p->GetAngle(2744.65f, 2569.46f);
|
||||
me->CastSpell(p->GetPositionX()+cos(angle)*5.0f, p->GetPositionY()+sin(angle)*5.0f, z, SPELL_SUMMON_FLAMES_INITIAL, true);
|
||||
pg.erase(pg.begin()+index);
|
||||
me->CastSpell(p->GetPositionX() + cos(angle) * 5.0f, p->GetPositionY() + sin(angle) * 5.0f, z, SPELL_SUMMON_FLAMES_INITIAL, true);
|
||||
pg.erase(pg.begin() + index);
|
||||
}
|
||||
|
||||
events.RepeatEvent(30000);
|
||||
@@ -553,7 +553,7 @@ public:
|
||||
case EVENT_ELEVATOR_INTERVAL_1:
|
||||
if(me->SummonCreature(NPC_VX001, 2744.65f, 2569.46f, 364.40f, 3.14f, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
{
|
||||
if( GameObject *elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f) )
|
||||
if( GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 100.0f) )
|
||||
{
|
||||
elevator->SetLootState(GO_READY);
|
||||
elevator->UseDoorOrButton(0, true);
|
||||
@@ -809,12 +809,12 @@ public:
|
||||
summons.DespawnEntry(33576);
|
||||
|
||||
float angle = VX001->GetOrientation();
|
||||
float v_x = me->GetPositionX()+cos(angle)*10.0f;
|
||||
float v_y = me->GetPositionY()+sin(angle)*10.0f;
|
||||
float v_x = me->GetPositionX() + cos(angle) * 10.0f;
|
||||
float v_y = me->GetPositionY() + sin(angle) * 10.0f;
|
||||
me->GetMotionMaster()->MoveJump(v_x, v_y, 364.32f, 7.0f, 7.0f);
|
||||
|
||||
if( pInstance )
|
||||
for( uint16 i=0; i<3; ++i )
|
||||
for( uint16 i = 0; i < 3; ++i )
|
||||
if( uint64 guid = pInstance->GetData64(DATA_GO_MIMIRON_DOOR_1 + i) )
|
||||
if( GameObject* door = ObjectAccessor::GetGameObject(*me, guid) )
|
||||
if( door->GetGoState() != GO_STATE_ACTIVE )
|
||||
@@ -839,7 +839,7 @@ public:
|
||||
me->PlayDirectSound(SOUND_VOLTRON_DEATH);
|
||||
// spawn chest
|
||||
if( uint32 chestId = (hardmode ? RAID_MODE(GO_MIMIRON_CHEST_HARD, GO_MIMIRON_CHEST_HERO_HARD) : RAID_MODE(GO_MIMIRON_CHEST, GO_MIMIRON_CHEST_HERO)) )
|
||||
if( GameObject *go = me->SummonGameObject(chestId, 2744.65f, 2569.46f, 364.397f, 0, 0, 0, 0, 0, 0) )
|
||||
if( GameObject* go = me->SummonGameObject(chestId, 2744.65f, 2569.46f, 364.397f, 0, 0, 0, 0, 0, 0) )
|
||||
go->SetUInt32Value(GAMEOBJECT_FLAGS, 0);
|
||||
events.PopEvent();
|
||||
events.ScheduleEvent(EVENT_DISAPPEAR, 15000);
|
||||
@@ -899,7 +899,7 @@ public:
|
||||
void ResetGameObjects()
|
||||
{
|
||||
if( pInstance )
|
||||
for( uint16 i=0; i<3; ++i )
|
||||
for( uint16 i = 0; i < 3; ++i )
|
||||
if( uint64 guid = pInstance->GetData64(DATA_GO_MIMIRON_DOOR_1 + i) )
|
||||
if( GameObject* door = ObjectAccessor::GetGameObject(*me, guid) )
|
||||
if( door->GetGoState() != GO_STATE_ACTIVE )
|
||||
@@ -908,7 +908,7 @@ public:
|
||||
door->UseDoorOrButton(0, false);
|
||||
}
|
||||
|
||||
if( GameObject *elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 200.0f) )
|
||||
if( GameObject* elevator = me->FindNearestGameObject(GO_MIMIRON_ELEVATOR, 200.0f) )
|
||||
{
|
||||
if( elevator->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
@@ -918,7 +918,7 @@ public:
|
||||
elevator->EnableCollision(false);
|
||||
}
|
||||
|
||||
if( GameObject *button = me->FindNearestGameObject(GO_BUTTON, 200.0f) )
|
||||
if( GameObject* button = me->FindNearestGameObject(GO_BUTTON, 200.0f) )
|
||||
if( button->GetGoState() != GO_STATE_READY )
|
||||
{
|
||||
button->SetLootState(GO_READY);
|
||||
@@ -930,7 +930,7 @@ public:
|
||||
void CloseDoorAndButton()
|
||||
{
|
||||
if( pInstance )
|
||||
for( uint16 i=0; i<3; ++i )
|
||||
for( uint16 i = 0; i < 3; ++i )
|
||||
if( uint64 guid = pInstance->GetData64(DATA_GO_MIMIRON_DOOR_1 + i) )
|
||||
if( GameObject* door = ObjectAccessor::GetGameObject(*me, guid) )
|
||||
if( door->GetGoState() != GO_STATE_READY )
|
||||
@@ -939,7 +939,7 @@ public:
|
||||
door->UseDoorOrButton(0, false);
|
||||
}
|
||||
|
||||
if( GameObject *button = me->FindNearestGameObject(GO_BUTTON, 200.0f) )
|
||||
if( GameObject* button = me->FindNearestGameObject(GO_BUTTON, 200.0f) )
|
||||
if( button->GetGoState() != GO_STATE_ACTIVE )
|
||||
{
|
||||
button->SetLootState(GO_READY);
|
||||
@@ -999,12 +999,18 @@ public:
|
||||
{
|
||||
switch (id)
|
||||
{
|
||||
case 1: return (hardmode ? 1 : 0);
|
||||
case 2: return (berserk ? 1 : 0);
|
||||
case 10: return allowedFlameSpreadTime;
|
||||
case 11: return (bAchievProximityMine ? 1 : 0);
|
||||
case 12: return (bAchievBombBot ? 1 : 0);
|
||||
case 13: return (bAchievRocketStrike ? 1 : 0);
|
||||
case 1:
|
||||
return (hardmode ? 1 : 0);
|
||||
case 2:
|
||||
return (berserk ? 1 : 0);
|
||||
case 10:
|
||||
return allowedFlameSpreadTime;
|
||||
case 11:
|
||||
return (bAchievProximityMine ? 1 : 0);
|
||||
case 12:
|
||||
return (bAchievBombBot ? 1 : 0);
|
||||
case 13:
|
||||
return (bAchievRocketStrike ? 1 : 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1023,7 +1029,7 @@ public:
|
||||
|
||||
struct npc_ulduar_leviathan_mkiiAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_leviathan_mkiiAI(Creature *pCreature) : ScriptedAI(pCreature)
|
||||
npc_ulduar_leviathan_mkiiAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
bIsEvading = false;
|
||||
@@ -1091,7 +1097,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth() || me->GetHealth() < 15000)
|
||||
{
|
||||
@@ -1160,14 +1166,14 @@ public:
|
||||
{
|
||||
Player* pTarget = nullptr;
|
||||
std::vector<Player*> pList;
|
||||
Map::PlayerList const &pl = me->GetMap()->GetPlayers();
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if (Player* plr = itr->GetSource())
|
||||
if( plr->IsAlive() && plr->GetDistance2d(me) > 15.0f )
|
||||
pList.push_back(plr);
|
||||
|
||||
if (!pList.empty())
|
||||
pTarget = pList[urand(0, pList.size()-1)];
|
||||
pTarget = pList[urand(0, pList.size() - 1)];
|
||||
else
|
||||
pTarget = (Player*)SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true);
|
||||
|
||||
@@ -1192,17 +1198,17 @@ public:
|
||||
break;
|
||||
case EVENT_PROXIMITY_MINES_1:
|
||||
{
|
||||
float angle = rand_norm()*2*M_PI;
|
||||
float x,y,z;
|
||||
me->GetPosition(x,y,z);
|
||||
for( uint8 i=0; i<17; ++i )
|
||||
float angle = rand_norm() * 2 * M_PI;
|
||||
float x, y, z;
|
||||
me->GetPosition(x, y, z);
|
||||
for( uint8 i = 0; i < 17; ++i )
|
||||
{
|
||||
if( i == 7 )
|
||||
continue;
|
||||
|
||||
float v_xmin = 0.1f * cos( angle + i*M_PI/9 );
|
||||
float v_ymin = 0.1f * sin( angle + i*M_PI/9 );
|
||||
if( Creature* pmNPC = me->SummonCreature(NPC_PROXIMITY_MINE, x+v_xmin, y+v_ymin, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 40000) )
|
||||
float v_xmin = 0.1f * cos( angle + i * M_PI / 9 );
|
||||
float v_ymin = 0.1f * sin( angle + i * M_PI / 9 );
|
||||
if( Creature* pmNPC = me->SummonCreature(NPC_PROXIMITY_MINE, x + v_xmin, y + v_ymin, z, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 40000) )
|
||||
pmNPC->KnockbackFrom(x, y, 6.0f, 25.0f);
|
||||
}
|
||||
|
||||
@@ -1225,7 +1231,7 @@ public:
|
||||
{
|
||||
if( Phase == 1 )
|
||||
{
|
||||
if( rand()%2 )
|
||||
if( rand() % 2 )
|
||||
{
|
||||
c->MonsterYell(TEXT_LMK2_SLAIN_1, LANG_UNIVERSAL, 0);
|
||||
c->PlayDirectSound(SOUND_TANK_SLAY_1);
|
||||
@@ -1238,7 +1244,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
if( rand()%2 )
|
||||
if( rand() % 2 )
|
||||
{
|
||||
c->MonsterYell(TEXT_VOLTRON_SLAIN_1, LANG_UNIVERSAL, 0);
|
||||
c->PlayDirectSound(SOUND_VOLTRON_SLAY_1);
|
||||
@@ -1286,7 +1292,7 @@ public:
|
||||
return 0;
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo *spell)
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
|
||||
{
|
||||
if( spell->Id == SPELL_SELF_REPAIR )
|
||||
{
|
||||
@@ -1309,7 +1315,7 @@ public:
|
||||
|
||||
struct npc_ulduar_vx001AI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_vx001AI(Creature *pCreature) : ScriptedAI(pCreature)
|
||||
npc_ulduar_vx001AI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
bIsEvading = false;
|
||||
@@ -1392,13 +1398,13 @@ public:
|
||||
{
|
||||
if (action == 1337)
|
||||
if( Vehicle* vk = me->GetVehicleKit() )
|
||||
for (uint8 i=0; i<2; ++i)
|
||||
if (Unit* r = vk->GetPassenger(5+i))
|
||||
for (uint8 i = 0; i < 2; ++i)
|
||||
if (Unit* r = vk->GetPassenger(5 + i))
|
||||
if (r->GetTypeId() == TYPEID_UNIT)
|
||||
r->ToCreature()->DespawnOrUnsummon(1);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth() || me->GetHealth() < 15000)
|
||||
{
|
||||
@@ -1453,7 +1459,7 @@ public:
|
||||
{
|
||||
if (spinningUpTimer <= diff)
|
||||
{
|
||||
float angle = (spinningUpOrientation*2*M_PI)/100.0f;
|
||||
float angle = (spinningUpOrientation * 2 * M_PI) / 100.0f;
|
||||
me->SetOrientation(angle);
|
||||
me->SetFacingTo(angle);
|
||||
spinningUpTimer = 0;
|
||||
@@ -1476,9 +1482,9 @@ public:
|
||||
case EVENT_SPELL_ROCKET_STRIKE:
|
||||
if( Vehicle* vk = me->GetVehicleKit() )
|
||||
{
|
||||
for( int i=0; i<(Phase/2); ++i )
|
||||
for( int i = 0; i < (Phase / 2); ++i )
|
||||
{
|
||||
uint8 index = (Phase == 2 ? rand()%2 : i);
|
||||
uint8 index = (Phase == 2 ? rand() % 2 : i);
|
||||
if( Unit* r = vk->GetPassenger(5 + index) )
|
||||
if (Player* temp = SelectTargetFromPlayerList(100.0f))
|
||||
{
|
||||
@@ -1486,9 +1492,9 @@ public:
|
||||
trigger->CastSpell(trigger, SPELL_ROCKET_STRIKE_AURA, true);
|
||||
Position exitPos;
|
||||
r->GetPosition(&exitPos);
|
||||
exitPos.m_positionX += cos(me->GetOrientation())*2.35f;
|
||||
exitPos.m_positionY += sin(me->GetOrientation())*2.35f;
|
||||
exitPos.m_positionZ += 2.0f*Phase;
|
||||
exitPos.m_positionX += cos(me->GetOrientation()) * 2.35f;
|
||||
exitPos.m_positionY += sin(me->GetOrientation()) * 2.35f;
|
||||
exitPos.m_positionZ += 2.0f * Phase;
|
||||
r->_ExitVehicle(&exitPos);
|
||||
me->RemoveAurasByType(SPELL_AURA_CONTROL_VEHICLE, r->GetGUID());
|
||||
if (r->GetTypeId() == TYPEID_UNIT)
|
||||
@@ -1502,9 +1508,9 @@ public:
|
||||
case EVENT_REINSTALL_ROCKETS:
|
||||
if (Vehicle* vk = me->GetVehicleKit())
|
||||
{
|
||||
for (uint8 i=5; i<=6; ++i)
|
||||
for (uint8 i = 5; i <= 6; ++i)
|
||||
if (!vk->GetPassenger(i))
|
||||
if (TempSummon* accessory = me->SummonCreature(NPC_ROCKET_VISUAL, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+4.0f, me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN))
|
||||
if (TempSummon* accessory = me->SummonCreature(NPC_ROCKET_VISUAL, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 4.0f, me->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN))
|
||||
if (!me->HandleSpellClick(accessory, i))
|
||||
accessory->UnSummon();
|
||||
}
|
||||
@@ -1548,7 +1554,7 @@ public:
|
||||
if (Player* p = SelectTargetFromPlayerList(80.0f))
|
||||
{
|
||||
float angle = me->GetAngle(p);
|
||||
spinningUpOrientation = (uint32)((angle*100.0f)/(2*M_PI));
|
||||
spinningUpOrientation = (uint32)((angle * 100.0f) / (2 * M_PI));
|
||||
spinningUpTimer = 1500;
|
||||
me->SetOrientation(angle);
|
||||
me->SetFacingTo(angle);
|
||||
@@ -1576,7 +1582,7 @@ public:
|
||||
{
|
||||
if( Phase == 2 )
|
||||
{
|
||||
if( rand()%2 )
|
||||
if( rand() % 2 )
|
||||
{
|
||||
c->MonsterYell(TEXT_VX001_SLAIN_1, LANG_UNIVERSAL, 0);
|
||||
c->PlayDirectSound(SOUND_TORSO_SLAY_1);
|
||||
@@ -1589,7 +1595,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
if( rand()%2 )
|
||||
if( rand() % 2 )
|
||||
{
|
||||
c->MonsterYell(TEXT_VOLTRON_SLAIN_1, LANG_UNIVERSAL, 0);
|
||||
c->PlayDirectSound(SOUND_VOLTRON_SLAY_1);
|
||||
@@ -1625,7 +1631,7 @@ public:
|
||||
p->ToCreature()->DespawnOrUnsummon(8000);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo *spell)
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
|
||||
{
|
||||
if( spell->Id == SPELL_SELF_REPAIR )
|
||||
{
|
||||
@@ -1648,7 +1654,7 @@ public:
|
||||
|
||||
struct npc_ulduar_aerial_command_unitAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_aerial_command_unitAI(Creature *pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
npc_ulduar_aerial_command_unitAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
bIsEvading = false;
|
||||
@@ -1728,7 +1734,7 @@ public:
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (damage >= me->GetHealth() || me->GetHealth() < 15000)
|
||||
{
|
||||
@@ -1789,8 +1795,8 @@ public:
|
||||
{
|
||||
float angle = victim->GetAngle(me->GetPositionX(), me->GetPositionY());
|
||||
me->SetOrientation( me->GetAngle(victim->GetPositionX(), victim->GetPositionY()) );
|
||||
float x = victim->GetPositionX() + 15.0f*cos(angle);
|
||||
float y = victim->GetPositionY() + 15.0f*sin(angle);
|
||||
float x = victim->GetPositionX() + 15.0f * cos(angle);
|
||||
float y = victim->GetPositionY() + 15.0f * sin(angle);
|
||||
|
||||
// check if there's magnetic core in line of movement
|
||||
Creature* mc = nullptr;
|
||||
@@ -1865,7 +1871,7 @@ public:
|
||||
case EVENT_SUMMON_EMERGENCY_FIRE_BOTS:
|
||||
{
|
||||
uint32 ids[3] = {194740, 194743, 194748};
|
||||
for( uint8 i=0; i<3; ++i )
|
||||
for( uint8 i = 0; i < 3; ++i )
|
||||
if( GameObject* pad = me->FindNearestGameObject(ids[i], 200.0f) )
|
||||
if (Creature* trigger = me->SummonCreature(NPC_BOT_SUMMON_TRIGGER, *pad, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
trigger->AI()->DoAction(3);
|
||||
@@ -1903,7 +1909,7 @@ public:
|
||||
{
|
||||
if( Phase == 3 )
|
||||
{
|
||||
if( rand()%2 )
|
||||
if( rand() % 2 )
|
||||
{
|
||||
c->MonsterYell(TEXT_ACU_SLAIN_1, LANG_UNIVERSAL, 0);
|
||||
c->PlayDirectSound(SOUND_HEAD_SLAY_1);
|
||||
@@ -1916,7 +1922,7 @@ public:
|
||||
}
|
||||
else
|
||||
{
|
||||
if( rand()%2 )
|
||||
if( rand() % 2 )
|
||||
{
|
||||
c->MonsterYell(TEXT_VOLTRON_SLAIN_1, LANG_UNIVERSAL, 0);
|
||||
c->PlayDirectSound(SOUND_VOLTRON_SLAY_1);
|
||||
@@ -1958,7 +1964,7 @@ public:
|
||||
summons.Despawn(s);
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo *spell)
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
|
||||
{
|
||||
if( spell->Id == SPELL_SELF_REPAIR )
|
||||
{
|
||||
@@ -1981,7 +1987,7 @@ public:
|
||||
|
||||
struct npc_ulduar_proximity_mineAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_proximity_mineAI(Creature *pCreature) : ScriptedAI(pCreature)
|
||||
npc_ulduar_proximity_mineAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
exploded = false;
|
||||
timer = 2500;
|
||||
@@ -2046,7 +2052,7 @@ public:
|
||||
|
||||
struct npc_ulduar_mimiron_rocketAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_mimiron_rocketAI(Creature *pCreature) : NullCreatureAI(pCreature) {}
|
||||
npc_ulduar_mimiron_rocketAI(Creature* pCreature) : NullCreatureAI(pCreature) {}
|
||||
|
||||
void InitializeAI()
|
||||
{
|
||||
@@ -2063,14 +2069,14 @@ public:
|
||||
|
||||
void SetData(uint32 /*id*/, uint32 /*value*/)
|
||||
{
|
||||
me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+100.0f, false, true);
|
||||
me->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 100.0f, false, true);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 /*diff*/)
|
||||
{
|
||||
if (!me->GetVehicle())
|
||||
{
|
||||
me->SetSpeed(MOVE_RUN, me->GetSpeedRate(MOVE_RUN)+0.4f, false);
|
||||
me->SetSpeed(MOVE_RUN, me->GetSpeedRate(MOVE_RUN) + 0.4f, false);
|
||||
me->SetSpeed(MOVE_FLIGHT, me->GetSpeedRate(MOVE_RUN), false);
|
||||
}
|
||||
}
|
||||
@@ -2089,7 +2095,7 @@ public:
|
||||
|
||||
struct npc_ulduar_magnetic_coreAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_magnetic_coreAI(Creature *pCreature) : NullCreatureAI(pCreature)
|
||||
npc_ulduar_magnetic_coreAI(Creature* pCreature) : NullCreatureAI(pCreature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
if (Creature* c = GetACU())
|
||||
@@ -2138,7 +2144,7 @@ public:
|
||||
|
||||
struct npc_ulduar_bot_summon_triggerAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_bot_summon_triggerAI(Creature *pCreature) : NullCreatureAI(pCreature) { }
|
||||
npc_ulduar_bot_summon_triggerAI(Creature* pCreature) : NullCreatureAI(pCreature) { }
|
||||
|
||||
uint32 timer;
|
||||
uint8 option;
|
||||
@@ -2175,7 +2181,7 @@ public:
|
||||
uint32 option_npcid[3] = {NPC_JUNK_BOT, NPC_ASSAULT_BOT, NPC_EMERGENCY_FIRE_BOT};
|
||||
InstanceScript* pInstance = me->GetInstanceScript();
|
||||
if (Creature* ACU = GetACU()) // ACU summons for easy removing
|
||||
if( Creature* bot = ACU->SummonCreature( option_npcid[option-1], *me, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000 ) )
|
||||
if( Creature* bot = ACU->SummonCreature( option_npcid[option - 1], *me, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000 ) )
|
||||
{
|
||||
if( option < 3 )
|
||||
bot->SetInCombatWithZone();
|
||||
@@ -2202,11 +2208,11 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_mimiron_rapid_burst_AuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * aurEff)
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (Unit* c = GetCaster())
|
||||
{
|
||||
uint32 id = ( c->GetMap()->Is25ManRaid() ? ((aurEff->GetTickNumber()%2) ? SPELL_RAPID_BURST_DAMAGE_25_2 : SPELL_RAPID_BURST_DAMAGE_25_1) : ((aurEff->GetTickNumber()%2) ? SPELL_RAPID_BURST_DAMAGE_10_2 : SPELL_RAPID_BURST_DAMAGE_10_1) );
|
||||
uint32 id = ( c->GetMap()->Is25ManRaid() ? ((aurEff->GetTickNumber() % 2) ? SPELL_RAPID_BURST_DAMAGE_25_2 : SPELL_RAPID_BURST_DAMAGE_25_1) : ((aurEff->GetTickNumber() % 2) ? SPELL_RAPID_BURST_DAMAGE_10_2 : SPELL_RAPID_BURST_DAMAGE_10_1) );
|
||||
c->CastSpell((Unit*)NULL, id, true);
|
||||
}
|
||||
}
|
||||
@@ -2217,7 +2223,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mimiron_rapid_burst_AuraScript();
|
||||
}
|
||||
@@ -2242,7 +2248,7 @@ public:
|
||||
return true;
|
||||
}
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * /*aurEff*/)
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* c = GetCaster())
|
||||
{
|
||||
@@ -2251,10 +2257,10 @@ public:
|
||||
uint32 diff = getMSTimeDiff(lastMSTime, World::GetGameTimeMS());
|
||||
if (lastOrientation == -1.0f)
|
||||
{
|
||||
lastOrientation = (c->ToCreature()->AI()->GetData(0)*2*M_PI)/100.0f;
|
||||
lastOrientation = (c->ToCreature()->AI()->GetData(0) * 2 * M_PI) / 100.0f;
|
||||
diff = 0;
|
||||
}
|
||||
float new_o = Position::NormalizeOrientation(lastOrientation-(M_PI/60)*(diff/250.0f));
|
||||
float new_o = Position::NormalizeOrientation(lastOrientation - (M_PI / 60) * (diff / 250.0f));
|
||||
lastMSTime = World::GetGameTimeMS();
|
||||
lastOrientation = new_o;
|
||||
c->SetOrientation(new_o);
|
||||
@@ -2270,7 +2276,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_mimiron_p3wx2_laser_barrage_AuraScript();
|
||||
}
|
||||
@@ -2314,7 +2320,7 @@ public:
|
||||
|
||||
struct npc_ulduar_flames_initialAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_flames_initialAI(Creature *pCreature) : NullCreatureAI(pCreature)
|
||||
npc_ulduar_flames_initialAI(Creature* pCreature) : NullCreatureAI(pCreature)
|
||||
{
|
||||
CreateTime = time(nullptr);
|
||||
events.Reset();
|
||||
@@ -2399,7 +2405,7 @@ public:
|
||||
float prevdist = 100.0f;
|
||||
Player* target = nullptr;
|
||||
|
||||
Map::PlayerList const &pl = me->GetMap()->GetPlayers();
|
||||
Map::PlayerList const& pl = me->GetMap()->GetPlayers();
|
||||
for( Map::PlayerList::const_iterator itr = pl.begin(); itr != pl.end(); ++itr )
|
||||
if( Player* plr = itr->GetSource() )
|
||||
if( plr->IsAlive() && plr->GetExactDist2d(last) < prevdist && !plr->IsGameMaster() )
|
||||
@@ -2410,8 +2416,8 @@ public:
|
||||
|
||||
if (target && prevdist >= 4.0f) // no need to spread when player is standing in fire, check distance
|
||||
{
|
||||
float angle = last->GetAngle(target->GetPositionX(), target->GetPositionY()) -M_PI/8 + rand_norm()*2*M_PI/8;
|
||||
SpreadFlame(last->GetPositionX() + 7.0f*cos(angle), last->GetPositionY() + 7.0f*sin(angle));
|
||||
float angle = last->GetAngle(target->GetPositionX(), target->GetPositionY()) - M_PI / 8 + rand_norm() * 2 * M_PI / 8;
|
||||
SpreadFlame(last->GetPositionX() + 7.0f * cos(angle), last->GetPositionY() + 7.0f * sin(angle));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2435,7 +2441,7 @@ public:
|
||||
|
||||
struct npc_ulduar_flames_spreadAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_flames_spreadAI(Creature *pCreature) : NullCreatureAI(pCreature) {}
|
||||
npc_ulduar_flames_spreadAI(Creature* pCreature) : NullCreatureAI(pCreature) {}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, const SpellInfo* spell)
|
||||
{
|
||||
@@ -2477,7 +2483,7 @@ public:
|
||||
|
||||
struct npc_ulduar_emergency_fire_botAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_emergency_fire_botAI(Creature *pCreature) : ScriptedAI(pCreature)
|
||||
npc_ulduar_emergency_fire_botAI(Creature* pCreature) : ScriptedAI(pCreature)
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_EMERGENCY_BOT_CHECK, 1000);
|
||||
@@ -2510,7 +2516,7 @@ public:
|
||||
if (dist <= 5.0f)
|
||||
events.ScheduleEvent(EVENT_EMERGENCY_BOT_ATTACK, 0);
|
||||
else
|
||||
me->GetMotionMaster()->MovePoint(1, me->GetPositionX()+(dist-5.0f)*cos(me->GetOrientation()), me->GetPositionY()+(dist-5.0f)*sin(me->GetOrientation()), 364.32f);
|
||||
me->GetMotionMaster()->MovePoint(1, me->GetPositionX() + (dist - 5.0f)*cos(me->GetOrientation()), me->GetPositionY() + (dist - 5.0f)*sin(me->GetOrientation()), 364.32f);
|
||||
}
|
||||
break;
|
||||
case EVENT_EMERGENCY_BOT_ATTACK:
|
||||
@@ -2535,7 +2541,7 @@ public:
|
||||
|
||||
struct npc_ulduar_rocket_strike_triggerAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_rocket_strike_triggerAI(Creature *pCreature) : NullCreatureAI(pCreature) {}
|
||||
npc_ulduar_rocket_strike_triggerAI(Creature* pCreature) : NullCreatureAI(pCreature) {}
|
||||
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* spell)
|
||||
{
|
||||
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
|
||||
struct boss_razorscaleAI : public ScriptedAI
|
||||
{
|
||||
boss_razorscaleAI(Creature *pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
boss_razorscaleAI(Creature* pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
startPath = true;
|
||||
@@ -229,7 +229,7 @@ public:
|
||||
count++;
|
||||
if( me->HasAura(SPELL_CHAIN_3) )
|
||||
count++;
|
||||
if (RAID_MODE(0,1))
|
||||
if (RAID_MODE(0, 1))
|
||||
{
|
||||
if( me->HasAura(SPELL_CHAIN_2) )
|
||||
count++;
|
||||
@@ -258,7 +258,7 @@ public:
|
||||
{
|
||||
if (me->GetPositionZ() > 440.0f) // protection, razorscale is attackable (so harpoons can hit him, etc.), but should not receive dmg while in air
|
||||
damage = 0;
|
||||
else if (!bGroundPhase && ((me->GetHealth()*100)/me->GetMaxHealth() < 50) && me->HasAura(62794)) // already below 50%, but still in chains and stunned
|
||||
else if (!bGroundPhase && ((me->GetHealth() * 100) / me->GetMaxHealth() < 50) && me->HasAura(62794)) // already below 50%, but still in chains and stunned
|
||||
events.RescheduleEvent(EVENT_WARN_DEEP_BREATH, 0);
|
||||
}
|
||||
|
||||
@@ -281,8 +281,8 @@ public:
|
||||
{
|
||||
me->SetControlled(true, UNIT_STATE_ROOT);
|
||||
me->DisableRotate(true);
|
||||
me->SetOrientation((float)(M_PI+0.01)/2);
|
||||
me->SetFacingTo(M_PI/2);
|
||||
me->SetOrientation((float)(M_PI + 0.01) / 2);
|
||||
me->SetFacingTo(M_PI / 2);
|
||||
me->SetCanFly(false);
|
||||
me->SetDisableGravity(false);
|
||||
me->SetHover(false);
|
||||
@@ -338,7 +338,7 @@ public:
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_EE_SAY_MOVE_OUT:
|
||||
for (uint8 i=0; i<3; ++i)
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
if (Creature* c = ObjectAccessor::GetCreature(*me, ExpeditionEngineerGUIDs[i]))
|
||||
{
|
||||
if (!i)
|
||||
@@ -348,25 +348,25 @@ public:
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_SPELL_FIREBALL:
|
||||
if( Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true) )
|
||||
if( Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true) )
|
||||
me->CastSpell(pTarget, SPELL_FIREBALL, false);
|
||||
events.RepeatEvent(4000);
|
||||
break;
|
||||
case EVENT_SPELL_DEVOURING_FLAME:
|
||||
if( Unit *pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true) )
|
||||
if( Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true) )
|
||||
me->CastSpell(pTarget, SPELL_DEVOURINGFLAME, false);
|
||||
events.RepeatEvent(13000);
|
||||
break;
|
||||
case EVENT_SUMMON_MOLE_MACHINES:
|
||||
{
|
||||
memset(cords, '\0', sizeof(cords));
|
||||
uint8 num = RAID_MODE( urand(2,3), urand(2,4) );
|
||||
for( int i=0; i<num; ++i )
|
||||
uint8 num = RAID_MODE( urand(2, 3), urand(2, 4) );
|
||||
for( int i = 0; i < num; ++i )
|
||||
{
|
||||
// X: (550, 625) Y: (-185, -230)
|
||||
cords[i][0] = urand(550, 625);
|
||||
cords[i][1] = -230 + rand()%45;
|
||||
if( GameObject* drill = me->SummonGameObject(GO_DRILL, cords[i][0], cords[i][1], 391.1f, M_PI/4, 0.0f, 0.0f, 0.0f, 0.0f, 8) )
|
||||
cords[i][1] = -230 + rand() % 45;
|
||||
if( GameObject* drill = me->SummonGameObject(GO_DRILL, cords[i][0], cords[i][1], 391.1f, M_PI / 4, 0.0f, 0.0f, 0.0f, 0.0f, 8) )
|
||||
{
|
||||
//drill->SetGoAnimProgress(0);
|
||||
//drill->SetLootState(GO_READY);
|
||||
@@ -381,45 +381,57 @@ public:
|
||||
}
|
||||
break;
|
||||
case EVENT_SUMMON_ADDS:
|
||||
for( int i=0; i<4; ++i )
|
||||
for( int i = 0; i < 4; ++i )
|
||||
{
|
||||
if( !cords[i][0] )
|
||||
break;
|
||||
|
||||
uint8 opt;
|
||||
uint8 r = urand(1,100);
|
||||
uint8 r = urand(1, 100);
|
||||
if( r <= 30 ) opt = 1;
|
||||
else if( r <= 65 ) opt = 2;
|
||||
else opt = 3;
|
||||
|
||||
for( int j=0; j<4; ++j )
|
||||
for( int j = 0; j < 4; ++j )
|
||||
{
|
||||
float x = cords[i][0] + 4.0f*cos(j*M_PI/2);
|
||||
float y = cords[i][1] + 4.0f*sin(j*M_PI/2);
|
||||
float x = cords[i][0] + 4.0f * cos(j * M_PI / 2);
|
||||
float y = cords[i][1] + 4.0f * sin(j * M_PI / 2);
|
||||
|
||||
uint32 npc_entry = 0;
|
||||
switch( opt )
|
||||
{
|
||||
case 1: if( j == 1 ) npc_entry = NPC_DARK_RUNE_SENTINEL; break;
|
||||
case 1:
|
||||
if( j == 1 ) npc_entry = NPC_DARK_RUNE_SENTINEL;
|
||||
break;
|
||||
case 2:
|
||||
switch( j )
|
||||
{
|
||||
case 1: npc_entry = NPC_DARK_RUNE_WATCHER; break;
|
||||
case 2: npc_entry = NPC_DARK_RUNE_GUARDIAN; break;
|
||||
case 1:
|
||||
npc_entry = NPC_DARK_RUNE_WATCHER;
|
||||
break;
|
||||
case 2:
|
||||
npc_entry = NPC_DARK_RUNE_GUARDIAN;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default: // case 3:
|
||||
switch( j )
|
||||
{
|
||||
case 1: npc_entry = NPC_DARK_RUNE_WATCHER; break;
|
||||
case 2: npc_entry = NPC_DARK_RUNE_GUARDIAN; break;
|
||||
case 3: npc_entry = NPC_DARK_RUNE_GUARDIAN; break;
|
||||
case 1:
|
||||
npc_entry = NPC_DARK_RUNE_WATCHER;
|
||||
break;
|
||||
case 2:
|
||||
npc_entry = NPC_DARK_RUNE_GUARDIAN;
|
||||
break;
|
||||
case 3:
|
||||
npc_entry = NPC_DARK_RUNE_GUARDIAN;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if( npc_entry )
|
||||
if (Creature* c = me->SummonCreature(npc_entry, x, y, 391.1f, j*M_PI/2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
|
||||
if (Creature* c = me->SummonCreature(npc_entry, x, y, 391.1f, j * M_PI / 2, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000))
|
||||
DoZoneInCombat(c);
|
||||
|
||||
}
|
||||
@@ -440,7 +452,7 @@ public:
|
||||
case EVENT_FLY_UP:
|
||||
me->SetInCombatWithZone(); // just in case
|
||||
if (pInstance)
|
||||
for( int i=0; i<4; ++i )
|
||||
for( int i = 0; i < 4; ++i )
|
||||
if( uint64 guid = pInstance->GetData64(DATA_HARPOON_FIRE_STATE_1 + i) )
|
||||
if( Creature* hfs = ObjectAccessor::GetCreature(*me, guid) )
|
||||
{
|
||||
@@ -451,14 +463,14 @@ public:
|
||||
me->RemoveAura(SPELL_LAUNCH_CHAIN);
|
||||
me->RemoveAura(SPELL_CHAIN_1);
|
||||
me->RemoveAura(SPELL_CHAIN_3);
|
||||
if (RAID_MODE(0,1))
|
||||
if (RAID_MODE(0, 1))
|
||||
{
|
||||
me->RemoveAura(SPELL_CHAIN_2);
|
||||
me->RemoveAura(SPELL_CHAIN_4);
|
||||
}
|
||||
me->CastSpell(me, SPELL_WINGBUFFET, true);
|
||||
|
||||
if( (me->GetHealth()*100) / me->GetMaxHealth() < 50 ) // start phase 3
|
||||
if( (me->GetHealth() * 100) / me->GetMaxHealth() < 50 ) // start phase 3
|
||||
{
|
||||
me->SetControlled(false, UNIT_STATE_ROOT);
|
||||
me->DisableRotate(false);
|
||||
@@ -503,7 +515,7 @@ public:
|
||||
events.PopEvent();
|
||||
break;
|
||||
case EVENT_RESUME_FIXING:
|
||||
for (uint8 i=0; i<3; ++i)
|
||||
for (uint8 i = 0; i < 3; ++i)
|
||||
if (Creature* c = ObjectAccessor::GetCreature(*me, ExpeditionEngineerGUIDs[i]))
|
||||
{
|
||||
if (!i)
|
||||
@@ -580,92 +592,92 @@ public:
|
||||
|
||||
class npc_ulduar_expedition_commander : public CreatureScript
|
||||
{
|
||||
public:
|
||||
npc_ulduar_expedition_commander() : CreatureScript("npc_ulduar_expedition_commander") { }
|
||||
public:
|
||||
npc_ulduar_expedition_commander() : CreatureScript("npc_ulduar_expedition_commander") { }
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
if (!player || !creature)
|
||||
return true;
|
||||
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (!instance)
|
||||
return true;
|
||||
|
||||
if (instance->GetData(TYPE_RAZORSCALE) == DONE)
|
||||
return true;
|
||||
|
||||
Creature* razorscale = ObjectAccessor::GetCreature(*creature, instance->GetData64(TYPE_RAZORSCALE));
|
||||
if (!razorscale || razorscale->IsInCombat())
|
||||
return true;
|
||||
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, TEXT_GOSSIP_ACTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, 40100, creature);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) override
|
||||
{
|
||||
if (!player || !creature)
|
||||
return true;
|
||||
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF + 1)
|
||||
{
|
||||
if (!player || !creature)
|
||||
return true;
|
||||
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (!instance)
|
||||
return true;
|
||||
|
||||
if (instance->GetData(TYPE_RAZORSCALE) == DONE)
|
||||
if (!instance || instance->GetData(TYPE_RAZORSCALE) == DONE)
|
||||
return true;
|
||||
|
||||
Creature* razorscale = ObjectAccessor::GetCreature(*creature, instance->GetData64(TYPE_RAZORSCALE));
|
||||
if (!razorscale || razorscale->IsInCombat())
|
||||
return true;
|
||||
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, TEXT_GOSSIP_ACTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
SendGossipMenuFor(player, 40100, creature);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction) override
|
||||
{
|
||||
if (!player || !creature)
|
||||
return true;
|
||||
|
||||
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
|
||||
if (razorscale && !razorscale->IsInCombat())
|
||||
{
|
||||
InstanceScript* instance = creature->GetInstanceScript();
|
||||
if (!instance || instance->GetData(TYPE_RAZORSCALE) == DONE)
|
||||
return true;
|
||||
// reset npcs NPC_HARPOON_FIRE_STATE
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (Creature* hfs = ObjectAccessor::GetCreature(*creature, instance->GetData64(DATA_HARPOON_FIRE_STATE_1 + i)))
|
||||
hfs->AI()->SetData(1, 0);
|
||||
|
||||
Creature* razorscale = ObjectAccessor::GetCreature(*creature, instance->GetData64(TYPE_RAZORSCALE));
|
||||
if (razorscale && !razorscale->IsInCombat())
|
||||
if (razorscale->AI())
|
||||
{
|
||||
// reset npcs NPC_HARPOON_FIRE_STATE
|
||||
for (uint8 i = 0; i < 4; ++i)
|
||||
if (Creature* hfs = ObjectAccessor::GetCreature(*creature, instance->GetData64(DATA_HARPOON_FIRE_STATE_1 + i)))
|
||||
hfs->AI()->SetData(1, 0);
|
||||
|
||||
if (razorscale->AI())
|
||||
{
|
||||
razorscale->AI()->AttackStart(player);
|
||||
razorscale->GetMotionMaster()->MoveIdle();
|
||||
razorscale->GetMotionMaster()->MovePoint(POINT_RAZORSCALE_INIT, 588.0f, -178.0f, 490.0f, false, false);
|
||||
}
|
||||
razorscale->AI()->AttackStart(player);
|
||||
razorscale->GetMotionMaster()->MoveIdle();
|
||||
razorscale->GetMotionMaster()->MovePoint(POINT_RAZORSCALE_INIT, 588.0f, -178.0f, 490.0f, false, false);
|
||||
}
|
||||
}
|
||||
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
player->PlayerTalkClass->SendCloseGossip();
|
||||
return true;
|
||||
}
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetInstanceAI<npc_ulduar_expedition_commanderAI>(creature);
|
||||
}
|
||||
|
||||
struct npc_ulduar_expedition_commanderAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_expedition_commanderAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
return GetInstanceAI<npc_ulduar_expedition_commanderAI>(creature);
|
||||
_instance = creature->GetInstanceScript();
|
||||
_introSpoken = _instance->GetData(TYPE_RAZORSCALE) == DONE;
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
|
||||
struct npc_ulduar_expedition_commanderAI : public NullCreatureAI
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
npc_ulduar_expedition_commanderAI(Creature* creature) : NullCreatureAI(creature)
|
||||
{
|
||||
_instance = creature->GetInstanceScript();
|
||||
_introSpoken = _instance->GetData(TYPE_RAZORSCALE) == DONE;
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
}
|
||||
if (_introSpoken)
|
||||
return;
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
if (_introSpoken)
|
||||
return;
|
||||
if (who->GetTypeId() != TYPEID_PLAYER || me->GetExactDist2d(who) > 15.0f)
|
||||
return;
|
||||
|
||||
if (who->GetTypeId() != TYPEID_PLAYER || me->GetExactDist2d(who) > 15.0f)
|
||||
return;
|
||||
_introSpoken = true;
|
||||
Talk(SAY_COMMANDER_INTRO);
|
||||
}
|
||||
|
||||
_introSpoken = true;
|
||||
Talk(SAY_COMMANDER_INTRO);
|
||||
}
|
||||
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
bool _introSpoken;
|
||||
};
|
||||
private:
|
||||
InstanceScript* _instance;
|
||||
bool _introSpoken;
|
||||
};
|
||||
};
|
||||
|
||||
class npc_ulduar_harpoonfirestate : public CreatureScript
|
||||
@@ -680,7 +692,7 @@ public:
|
||||
|
||||
struct npc_ulduar_harpoonfirestateAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_harpoonfirestateAI(Creature *pCreature) : NullCreatureAI(pCreature)
|
||||
npc_ulduar_harpoonfirestateAI(Creature* pCreature) : NullCreatureAI(pCreature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
}
|
||||
@@ -735,7 +747,7 @@ public:
|
||||
{
|
||||
if( GameObject* bh = me->FindNearestGameObject(GO_BROKEN_HARPOON, 4.0f) )
|
||||
bh->SetPhaseMask(2, true);
|
||||
if( GameObject* wh = me->SummonGameObject(GetHarpoonGunIdForThisHFS(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 3*M_PI/2, 0.0f, 0.0f, 0.0f, 0.0f, 0) )
|
||||
if( GameObject* wh = me->SummonGameObject(GetHarpoonGunIdForThisHFS(), me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 3 * M_PI / 2, 0.0f, 0.0f, 0.0f, 0.0f, 0) )
|
||||
{
|
||||
me->RemoveGameObject(wh, false);
|
||||
me->MonsterTextEmote(TEXT_TURRET_READY, 0, true);
|
||||
@@ -780,7 +792,7 @@ public:
|
||||
|
||||
struct npc_ulduar_expedition_engineerAI : public NullCreatureAI
|
||||
{
|
||||
npc_ulduar_expedition_engineerAI(Creature *pCreature) : NullCreatureAI(pCreature)
|
||||
npc_ulduar_expedition_engineerAI(Creature* pCreature) : NullCreatureAI(pCreature)
|
||||
{
|
||||
pInstance = me->GetInstanceScript();
|
||||
}
|
||||
@@ -830,7 +842,7 @@ public:
|
||||
if( me->GetUInt32Value(UNIT_NPC_EMOTESTATE) != EMOTE_STATE_WORK )
|
||||
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_WORK);
|
||||
|
||||
if (fabs(me->GetOrientation()-me->GetAngle(c)) > M_PI/4)
|
||||
if (fabs(me->GetOrientation() - me->GetAngle(c)) > M_PI / 4)
|
||||
me->SetFacingToObject(c);
|
||||
|
||||
c->AI()->SetData(2, 0);
|
||||
@@ -852,16 +864,16 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
for( int i=0; i<4; ++i )
|
||||
for( int i = 0; i < 4; ++i )
|
||||
if( uint64 fs_GUID = pInstance->GetData64(DATA_HARPOON_FIRE_STATE_1 + i) )
|
||||
if( Creature* fs = ObjectAccessor::GetCreature(*me, fs_GUID) )
|
||||
if (!fs->AI()->GetData(2))
|
||||
{
|
||||
float a = rand_norm()*M_PI;
|
||||
me->GetMotionMaster()->MovePoint(0, fs->GetPositionX()+3.0f*cos(a), fs->GetPositionY()+3.0f*sin(a), fs->GetPositionZ());
|
||||
fixingGUID = fs->GetGUID();
|
||||
return;
|
||||
}
|
||||
{
|
||||
float a = rand_norm() * M_PI;
|
||||
me->GetMotionMaster()->MovePoint(0, fs->GetPositionX() + 3.0f * cos(a), fs->GetPositionY() + 3.0f * sin(a), fs->GetPositionZ());
|
||||
fixingGUID = fs->GetGUID();
|
||||
return;
|
||||
}
|
||||
|
||||
Reset(); // all harpoons repaired
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
@@ -944,7 +956,7 @@ public:
|
||||
|
||||
struct npc_ulduar_dark_rune_guardianAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_dark_rune_guardianAI(Creature *pCreature) : ScriptedAI(pCreature) { }
|
||||
npc_ulduar_dark_rune_guardianAI(Creature* pCreature) : ScriptedAI(pCreature) { }
|
||||
|
||||
uint32 timer2;
|
||||
|
||||
@@ -991,7 +1003,7 @@ public:
|
||||
|
||||
struct npc_ulduar_dark_rune_watcherAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_dark_rune_watcherAI(Creature *pCreature) : ScriptedAI(pCreature) { }
|
||||
npc_ulduar_dark_rune_watcherAI(Creature* pCreature) : ScriptedAI(pCreature) { }
|
||||
|
||||
uint32 timer1;
|
||||
uint32 timer2;
|
||||
@@ -1047,14 +1059,14 @@ public:
|
||||
|
||||
struct npc_ulduar_dark_rune_sentinelAI : public ScriptedAI
|
||||
{
|
||||
npc_ulduar_dark_rune_sentinelAI(Creature *pCreature) : ScriptedAI(pCreature) { }
|
||||
npc_ulduar_dark_rune_sentinelAI(Creature* pCreature) : ScriptedAI(pCreature) { }
|
||||
|
||||
uint32 timer1;
|
||||
uint32 timer2;
|
||||
|
||||
void Reset()
|
||||
{
|
||||
timer1 = urand(1000,2000);
|
||||
timer1 = urand(1000, 2000);
|
||||
timer2 = 6000;
|
||||
}
|
||||
|
||||
@@ -1091,24 +1103,24 @@ public:
|
||||
|
||||
class achievement_quick_shave : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_quick_shave() : AchievementCriteriaScript("achievement_quick_shave") {}
|
||||
public:
|
||||
achievement_quick_shave() : AchievementCriteriaScript("achievement_quick_shave") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
return target && target->GetTypeId() == TYPEID_UNIT && target->GetEntry() == NPC_RAZORSCALE && target->ToCreature()->AI()->GetData(1);
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
return target && target->GetTypeId() == TYPEID_UNIT && target->GetEntry() == NPC_RAZORSCALE && target->ToCreature()->AI()->GetData(1);
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_iron_dwarf_medium_rare : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_iron_dwarf_medium_rare() : AchievementCriteriaScript("achievement_iron_dwarf_medium_rare") {}
|
||||
public:
|
||||
achievement_iron_dwarf_medium_rare() : AchievementCriteriaScript("achievement_iron_dwarf_medium_rare") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
return target && target->GetEntry() == NPC_RAZORSCALE;
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
return target && target->GetEntry() == NPC_RAZORSCALE;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_razorscale()
|
||||
|
||||
@@ -297,7 +297,7 @@ enum Misc
|
||||
DATA_LOSE_YOUR_ILLUSION = 2,
|
||||
};
|
||||
|
||||
const Position Middle = {2134.68f, -263.13f, 419.44f, M_PI*1.5f};
|
||||
const Position Middle = {2134.68f, -263.13f, 419.44f, M_PI * 1.5f};
|
||||
|
||||
const uint32 RollTable[3] = { 32877, 32878, 32876 };
|
||||
|
||||
@@ -444,7 +444,7 @@ public:
|
||||
_isArenaEmpty = false;
|
||||
_hitByLightning = false;
|
||||
|
||||
if (Player *t = SelectTargetFromPlayerList(1000))
|
||||
if (Player* t = SelectTargetFromPlayerList(1000))
|
||||
if (t->GetTeamId() == TEAM_HORDE)
|
||||
_isAlly = false;
|
||||
|
||||
@@ -488,10 +488,10 @@ public:
|
||||
|
||||
void KilledUnit(Unit*)
|
||||
{
|
||||
if (urand(0,2))
|
||||
if (urand(0, 2))
|
||||
return;
|
||||
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
{
|
||||
me->MonsterYell("Can't you at least put up a fight!?", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_SLAY1);
|
||||
@@ -596,16 +596,16 @@ public:
|
||||
{
|
||||
Creature* cr;
|
||||
uint8 rnd;
|
||||
if (_spawnCommoners || urand(0,2))
|
||||
if (_spawnCommoners || urand(0, 2))
|
||||
_spawnCommoners = !_spawnCommoners;
|
||||
|
||||
for (uint8 i = 0; i < (_spawnCommoners ? 7 : 2); ++i)
|
||||
{
|
||||
rnd = urand(0, 13);
|
||||
if ((cr = me->SummonCreature((_spawnCommoners ? NPC_DARK_RUNE_COMMONER : RollTable[urand(0,2)]), ArenaNPCs[rnd], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)))
|
||||
if ((cr = me->SummonCreature((_spawnCommoners ? NPC_DARK_RUNE_COMMONER : RollTable[urand(0, 2)]), ArenaNPCs[rnd], TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000)))
|
||||
cr->GetMotionMaster()->MoveJump(
|
||||
Middle.GetPositionX()+urand(19,24)*cos(Middle.GetAngle(cr)),
|
||||
Middle.GetPositionY()+urand(19,24)*sin(Middle.GetAngle(cr)),
|
||||
Middle.GetPositionX() + urand(19, 24) * cos(Middle.GetAngle(cr)),
|
||||
Middle.GetPositionY() + urand(19, 24) * sin(Middle.GetAngle(cr)),
|
||||
Middle.GetPositionZ(), 20, 20);
|
||||
}
|
||||
}
|
||||
@@ -629,10 +629,10 @@ public:
|
||||
|
||||
void PlaySpecial()
|
||||
{
|
||||
if (urand(0,9))
|
||||
if (urand(0, 9))
|
||||
return;
|
||||
|
||||
switch (urand(0,2))
|
||||
switch (urand(0, 2))
|
||||
{
|
||||
case 0:
|
||||
me->MonsterYell("Behold the power of the storms and despair!", LANG_UNIVERSAL, 0);
|
||||
@@ -653,7 +653,7 @@ public:
|
||||
{
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
for(Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||
if (Player *p = itr->GetSource())
|
||||
if (Player* p = itr->GetSource())
|
||||
if (p->GetPositionX() > 2085 && p->GetPositionX() < 2185 && p->GetPositionY() < -214 && p->GetPositionY() > -305 && p->IsAlive() && p->GetPositionZ() < 425)
|
||||
return p;
|
||||
return nullptr;
|
||||
@@ -681,28 +681,28 @@ public:
|
||||
|
||||
break;
|
||||
case EVENT_THORIM_AGGRO2:
|
||||
{
|
||||
me->MonsterYell("I remember you... In the mountains... But you... what is this? Where am--", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_AGGRO2);
|
||||
events.PopEvent();
|
||||
{
|
||||
me->MonsterYell("I remember you... In the mountains... But you... what is this? Where am--", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_AGGRO2);
|
||||
events.PopEvent();
|
||||
|
||||
EntryCheckPredicate pred(NPC_SIF);
|
||||
summons.DoAction(ACTION_SIF_START_TALK, pred);
|
||||
break;
|
||||
}
|
||||
EntryCheckPredicate pred(NPC_SIF);
|
||||
summons.DoAction(ACTION_SIF_START_TALK, pred);
|
||||
break;
|
||||
}
|
||||
case EVENT_THORIM_START_PHASE1:
|
||||
{
|
||||
events.PopEvent();
|
||||
events.ScheduleEvent(EVENT_THORIM_STORMHAMMER, 8000, 0, EVENT_PHASE_START);
|
||||
events.ScheduleEvent(EVENT_THORIM_CHARGE_ORB, 14000, 0, EVENT_PHASE_START);
|
||||
events.ScheduleEvent(EVENT_THORIM_FILL_ARENA, 0, 0, EVENT_PHASE_START);
|
||||
events.ScheduleEvent(EVENT_THORIM_LIGHTNING_ORB, 5000, 0, EVENT_PHASE_START); // checked every 5 secs if there are players on arena
|
||||
events.ScheduleEvent(EVENT_THORIM_NOT_REACH_IN_TIME, 300000, 0, EVENT_PHASE_START);
|
||||
{
|
||||
events.PopEvent();
|
||||
events.ScheduleEvent(EVENT_THORIM_STORMHAMMER, 8000, 0, EVENT_PHASE_START);
|
||||
events.ScheduleEvent(EVENT_THORIM_CHARGE_ORB, 14000, 0, EVENT_PHASE_START);
|
||||
events.ScheduleEvent(EVENT_THORIM_FILL_ARENA, 0, 0, EVENT_PHASE_START);
|
||||
events.ScheduleEvent(EVENT_THORIM_LIGHTNING_ORB, 5000, 0, EVENT_PHASE_START); // checked every 5 secs if there are players on arena
|
||||
events.ScheduleEvent(EVENT_THORIM_NOT_REACH_IN_TIME, 300000, 0, EVENT_PHASE_START);
|
||||
|
||||
EntryCheckPredicate pred(NPC_SIF);
|
||||
summons.DoAction(ACTION_SIF_START_DOMINION, pred);
|
||||
break;
|
||||
}
|
||||
EntryCheckPredicate pred(NPC_SIF);
|
||||
summons.DoAction(ACTION_SIF_START_DOMINION, pred);
|
||||
break;
|
||||
}
|
||||
case EVENT_THORIM_STORMHAMMER:
|
||||
me->CastCustomSpell(SPELL_STORMHAMMER, SPELLVALUE_MAX_TARGETS, 1, me->GetVictim(), false);
|
||||
events.RepeatEvent(16000);
|
||||
@@ -714,24 +714,24 @@ public:
|
||||
PlaySpecial();
|
||||
break;
|
||||
case EVENT_THORIM_LIGHTNING_ORB:
|
||||
{
|
||||
if (GetArenaPlayer())
|
||||
{
|
||||
// Player found, repeat and return
|
||||
events.RepeatEvent(5000);
|
||||
return;
|
||||
if (GetArenaPlayer())
|
||||
{
|
||||
// Player found, repeat and return
|
||||
events.RepeatEvent(5000);
|
||||
return;
|
||||
}
|
||||
|
||||
// No players found
|
||||
me->MonsterYell("Failures! Weaklings!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_AWIPE);
|
||||
me->SummonCreature(NPC_LIGHTNING_ORB, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
|
||||
|
||||
_isArenaEmpty = true;
|
||||
events.PopEvent();
|
||||
events.CancelEvent(EVENT_THORIM_NOT_REACH_IN_TIME);
|
||||
break;
|
||||
}
|
||||
|
||||
// No players found
|
||||
me->MonsterYell("Failures! Weaklings!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(SOUND_AWIPE);
|
||||
me->SummonCreature(NPC_LIGHTNING_ORB, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ());
|
||||
|
||||
_isArenaEmpty = true;
|
||||
events.PopEvent();
|
||||
events.CancelEvent(EVENT_THORIM_NOT_REACH_IN_TIME);
|
||||
break;
|
||||
}
|
||||
case EVENT_THORIM_NOT_REACH_IN_TIME:
|
||||
_isArenaEmpty = true;
|
||||
events.PopEvent();
|
||||
@@ -913,7 +913,7 @@ public:
|
||||
events.RepeatEvent(30000);
|
||||
return;
|
||||
case EVENT_SIF_FROST_NOVA_START:
|
||||
me->NearTeleportTo(2108+urand(0, 42), -238-irand(0,46), 420.02f, me->GetAngle(&Middle));
|
||||
me->NearTeleportTo(2108 + urand(0, 42), -238 - irand(0, 46), 420.02f, me->GetAngle(&Middle));
|
||||
events.RepeatEvent(20000);
|
||||
events.DelayEvents(5001);
|
||||
events.ScheduleEvent(EVENT_SIF_FROST_NOVA_CAST, 2500);
|
||||
@@ -1043,9 +1043,9 @@ public:
|
||||
SetDespawnAtEnd(false);
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit * /*who*/) {}
|
||||
void EnterCombat(Unit * /*who*/) {}
|
||||
void AttackStart(Unit * /*who*/) {}
|
||||
void MoveInLineOfSight(Unit* /*who*/) {}
|
||||
void EnterCombat(Unit* /*who*/) {}
|
||||
void AttackStart(Unit* /*who*/) {}
|
||||
|
||||
void InitWaypoint()
|
||||
{
|
||||
@@ -1101,7 +1101,7 @@ public:
|
||||
me->CastSpell(me, SPELL_LIGHTNING_PILLAR_P1, true);
|
||||
else if (spellInfo->Id == SPELL_LIGHTNING_PILLAR_P2)
|
||||
{
|
||||
if (Creature *cr = me->FindNearestCreature(NPC_THUNDER_ORB, 100))
|
||||
if (Creature* cr = me->FindNearestCreature(NPC_THUNDER_ORB, 100))
|
||||
cr->CastSpell(cr, SPELL_LIGHTNING_ORB_VISUAL, true);
|
||||
}
|
||||
}
|
||||
@@ -1220,7 +1220,7 @@ public:
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case EVENT_DR_ACOLYTE_HS:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_HOLY_SMITE, false);
|
||||
events.RepeatEvent(1600);
|
||||
break;
|
||||
@@ -1263,7 +1263,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!_isCaster || (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA) < 10))
|
||||
if (!_isCaster || (me->GetPower(POWER_MANA) * 100 / me->GetMaxPower(POWER_MANA) < 10))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
@@ -1345,7 +1345,7 @@ public:
|
||||
events.RepeatEvent(10000);
|
||||
break;
|
||||
case EVENT_DR_ACOLYTE_HS:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0))
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0))
|
||||
me->CastSpell(target, SPELL_HOLY_SMITE, false);
|
||||
events.RepeatEvent(1600);
|
||||
break;
|
||||
@@ -1370,7 +1370,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!_isCaster || (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA) < 10))
|
||||
if (!_isCaster || (me->GetPower(POWER_MANA) * 100 / me->GetMaxPower(POWER_MANA) < 10))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
@@ -1419,7 +1419,7 @@ public:
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
if (me->GetInstanceScript())
|
||||
if (GameObject *go = ObjectAccessor::GetGameObject(*me, me->GetInstanceScript()->GetData64(DATA_THORIM_FIRST_DOORS)))
|
||||
if (GameObject* go = ObjectAccessor::GetGameObject(*me, me->GetInstanceScript()->GetData64(DATA_THORIM_FIRST_DOORS)))
|
||||
go->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
@@ -1482,7 +1482,7 @@ public:
|
||||
RunRunicSmash(true);
|
||||
break;
|
||||
case EVENT_RC_RUNIC_SMASH:
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
me->CastSpell(me, SPELL_RUNIC_SMASH_LEFT, false);
|
||||
else
|
||||
me->CastSpell(me, SPELL_RUNIC_SMASH_RIGHT, false);
|
||||
@@ -1585,7 +1585,7 @@ public:
|
||||
events.RepeatEvent(8000);
|
||||
break;
|
||||
case EVENT_ARG_SPAWN:
|
||||
if (Creature *cr = me->SummonCreature(NPC_IRON_HONOR_GUARD, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000))
|
||||
if (Creature* cr = me->SummonCreature(NPC_IRON_HONOR_GUARD, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000))
|
||||
if (Unit* target = SelectTargetFromPlayerList(150.0f))
|
||||
cr->AI()->AttackStart(target);
|
||||
events.RepeatEvent(10000);
|
||||
@@ -1656,7 +1656,7 @@ public:
|
||||
{
|
||||
Player* target = nullptr;
|
||||
Map::PlayerList const& pList = me->GetMap()->GetPlayers();
|
||||
uint8 num = urand(0, pList.getSize()-1);
|
||||
uint8 num = urand(0, pList.getSize() - 1);
|
||||
uint8 count = 0;
|
||||
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr, ++count)
|
||||
{
|
||||
@@ -1673,9 +1673,9 @@ public:
|
||||
{
|
||||
AttackStart(target);
|
||||
me->AddThreat(target, 500.0f);
|
||||
if (me->GetEntry() == NPC_DARK_RUNE_EVOKER && urand(0,1))
|
||||
if (me->GetEntry() == NPC_DARK_RUNE_EVOKER && urand(0, 1))
|
||||
me->CastSpell(me, SPELL_RUNIC_SHIELD, false);
|
||||
else if (me->GetEntry() == NPC_DARK_RUNE_CHAMPION && !urand(0,2))
|
||||
else if (me->GetEntry() == NPC_DARK_RUNE_CHAMPION && !urand(0, 2))
|
||||
me->CastSpell(target, SPELL_CHARGE, false);
|
||||
return true;
|
||||
}
|
||||
@@ -1737,7 +1737,7 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
if (!_isCaster || (me->GetPower(POWER_MANA)*100 / me->GetMaxPower(POWER_MANA) < 10))
|
||||
if (!_isCaster || (me->GetPower(POWER_MANA) * 100 / me->GetMaxPower(POWER_MANA) < 10))
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
@@ -1750,7 +1750,7 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* pPlayer, GameObject* go) override
|
||||
{
|
||||
if (GameObject *g = pPlayer->FindNearestGameObject(GO_ARENA_LEVER_GATE, 50))
|
||||
if (GameObject* g = pPlayer->FindNearestGameObject(GO_ARENA_LEVER_GATE, 50))
|
||||
g->UseDoorOrButton();
|
||||
|
||||
go->UseDoorOrButton();
|
||||
@@ -1760,88 +1760,88 @@ public:
|
||||
|
||||
class spell_thorim_lightning_pillar_P2 : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_thorim_lightning_pillar_P2() : SpellScriptLoader("spell_thorim_lightning_pillar_P2") { }
|
||||
public:
|
||||
spell_thorim_lightning_pillar_P2() : SpellScriptLoader("spell_thorim_lightning_pillar_P2") { }
|
||||
|
||||
class spell_thorim_lightning_pillar_P2_AuraScript : public AuraScript
|
||||
class spell_thorim_lightning_pillar_P2_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_thorim_lightning_pillar_P2_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PrepareAuraScript(spell_thorim_lightning_pillar_P2_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
GetUnitOwner()->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_thorim_lightning_pillar_P2_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_thorim_lightning_pillar_P2_AuraScript();
|
||||
PreventDefaultAction();
|
||||
if (Unit* caster = GetCaster())
|
||||
GetUnitOwner()->CastSpell(caster, GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell, true);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_thorim_lightning_pillar_P2_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_thorim_lightning_pillar_P2_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_thorim_trash_impale : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_thorim_trash_impale() : SpellScriptLoader("spell_thorim_trash_impale") { }
|
||||
public:
|
||||
spell_thorim_trash_impale() : SpellScriptLoader("spell_thorim_trash_impale") { }
|
||||
|
||||
class spell_thorim_trash_impale_AuraScript : public AuraScript
|
||||
class spell_thorim_trash_impale_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_thorim_trash_impale_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
PrepareAuraScript(spell_thorim_trash_impale_AuraScript);
|
||||
|
||||
void OnPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
// deals damage until target is healed above 90%
|
||||
if (GetUnitOwner()->HealthAbovePct(90))
|
||||
SetDuration(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_thorim_trash_impale_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_thorim_trash_impale_AuraScript();
|
||||
// deals damage until target is healed above 90%
|
||||
if (GetUnitOwner()->HealthAbovePct(90))
|
||||
SetDuration(0);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_thorim_trash_impale_AuraScript::OnPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_thorim_trash_impale_AuraScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_thorim_stand_in_the_lightning : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_thorim_stand_in_the_lightning() : AchievementCriteriaScript("achievement_thorim_stand_in_the_lightning") {}
|
||||
public:
|
||||
achievement_thorim_stand_in_the_lightning() : AchievementCriteriaScript("achievement_thorim_stand_in_the_lightning") {}
|
||||
|
||||
bool OnCheck(Player* player, Unit*)
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*player, instance->GetData64(TYPE_THORIM)))
|
||||
return cr->AI()->GetData(DATA_HIT_BY_LIGHTNING);
|
||||
bool OnCheck(Player* player, Unit*)
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*player, instance->GetData64(TYPE_THORIM)))
|
||||
return cr->AI()->GetData(DATA_HIT_BY_LIGHTNING);
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_thorim_lose_your_illusion : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_thorim_lose_your_illusion() : AchievementCriteriaScript("achievement_thorim_lose_your_illusion") {}
|
||||
public:
|
||||
achievement_thorim_lose_your_illusion() : AchievementCriteriaScript("achievement_thorim_lose_your_illusion") {}
|
||||
|
||||
bool OnCheck(Player* player, Unit*)
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*player, instance->GetData64(TYPE_THORIM)))
|
||||
return cr->AI()->GetData(DATA_LOSE_YOUR_ILLUSION);
|
||||
bool OnCheck(Player* player, Unit*)
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*player, instance->GetData64(TYPE_THORIM)))
|
||||
return cr->AI()->GetData(DATA_LOSE_YOUR_ILLUSION);
|
||||
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_thorim()
|
||||
|
||||
@@ -41,7 +41,7 @@ enum XT002Spells
|
||||
SPELL_VOID_ZONE_SUMMON_25 = 64235,
|
||||
//SPELL_VOID_ZONE_SUMMON = RAID_MODE(SPELL_VOID_ZONE_SUMMON_10, SPELL_VOID_ZONE_SUMMON_25, SPELL_VOID_ZONE_SUMMON_10, SPELL_VOID_ZONE_SUMMON_25),
|
||||
SPELL_VOID_ZONE_DAMAGE = 46262,
|
||||
|
||||
|
||||
// SPARK
|
||||
SPELL_SPARK_SUMMON = 64210,
|
||||
SPELL_SPARK_DAMAGE_10 = 64227,
|
||||
@@ -119,7 +119,7 @@ public:
|
||||
|
||||
struct boss_xt002AI : public ScriptedAI
|
||||
{
|
||||
boss_xt002AI(Creature *pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
boss_xt002AI(Creature* pCreature) : ScriptedAI(pCreature), summons(me)
|
||||
{
|
||||
m_pInstance = pCreature->GetInstanceScript();
|
||||
}
|
||||
@@ -162,7 +162,7 @@ public:
|
||||
{
|
||||
m_pInstance->DoStopTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEVEMENT_MUST_DECONSTRUCT_FASTER);
|
||||
m_pInstance->SetData(TYPE_XT002, NOT_STARTED);
|
||||
if (GameObject *pGo = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(GO_XT002_DOORS)))
|
||||
if (GameObject* pGo = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(GO_XT002_DOORS)))
|
||||
pGo->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ public:
|
||||
{
|
||||
m_pInstance->DoStartTimedAchievement(ACHIEVEMENT_TIMED_TYPE_EVENT, ACHIEVEMENT_MUST_DECONSTRUCT_FASTER);
|
||||
m_pInstance->SetData(TYPE_XT002, IN_PROGRESS);
|
||||
if (GameObject *pGo = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(GO_XT002_DOORS)))
|
||||
if (GameObject* pGo = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(GO_XT002_DOORS)))
|
||||
pGo->SetGoState(GO_STATE_READY);
|
||||
}
|
||||
|
||||
@@ -210,9 +210,9 @@ public:
|
||||
|
||||
void KilledUnit(Unit* victim)
|
||||
{
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && !urand(0,2))
|
||||
if (victim->GetTypeId() == TYPEID_PLAYER && !urand(0, 2))
|
||||
{
|
||||
if (urand(0,1))
|
||||
if (urand(0, 1))
|
||||
{
|
||||
me->MonsterYell("I... I think I broke it.", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(XT_SOUND_SLAY1);
|
||||
@@ -225,7 +225,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
void JustDied(Unit* /*victim*/)
|
||||
{
|
||||
me->MonsterYell("You are bad... Toys... Very... Baaaaad!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(XT_SOUND_DEATH);
|
||||
@@ -233,7 +233,7 @@ public:
|
||||
if (m_pInstance)
|
||||
{
|
||||
m_pInstance->SetData(TYPE_XT002, DONE);
|
||||
if (GameObject *pGo = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(GO_XT002_DOORS)))
|
||||
if (GameObject* pGo = ObjectAccessor::GetGameObject(*me, m_pInstance->GetData64(GO_XT002_DOORS)))
|
||||
pGo->SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
|
||||
@@ -253,7 +253,7 @@ public:
|
||||
_gravityAchievement = false;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!me->IsAlive() || _hardMode)
|
||||
return;
|
||||
|
||||
@@ -267,7 +267,7 @@ public:
|
||||
me->SetByteValue(UNIT_FIELD_BYTES_1, 0, UNIT_STAND_STATE_STAND); // emerge
|
||||
|
||||
me->CastSpell(me, SPELL_HEARTBREAK, true);
|
||||
|
||||
|
||||
me->MonsterTextEmote("XT-002 Deconstructor's heart is severed from his body.", 0, true);
|
||||
events.ScheduleEvent(EVENT_REMOVE_EMOTE, 4000);
|
||||
return;
|
||||
@@ -277,7 +277,7 @@ public:
|
||||
if (param > 0)
|
||||
{
|
||||
// avoid reducing health under 1
|
||||
int32 _final = std::min(param, int32(me->GetHealth()-1));
|
||||
int32 _final = std::min(param, int32(me->GetHealth() - 1));
|
||||
|
||||
me->ModifyHealth(-_final);
|
||||
me->LowerPlayerDamageReq(_final);
|
||||
@@ -315,7 +315,7 @@ public:
|
||||
|
||||
if (me->HealthBelowPct(_healthCheck))
|
||||
{
|
||||
_healthCheck -= 25;
|
||||
_healthCheck -= 25;
|
||||
me->SetControlled(true, UNIT_STATE_STUNNED);
|
||||
me->SetByteValue(UNIT_FIELD_BYTES_1, 0, UNIT_STAND_STATE_SUBMERGED); // submerge with animation
|
||||
|
||||
@@ -366,7 +366,7 @@ public:
|
||||
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE);
|
||||
if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : nullptr)
|
||||
heart->GetAI()->DoAction(ACTION_AWAKEN_HEART);
|
||||
|
||||
|
||||
events.ScheduleEvent(EVENT_RESTORE, 30000);
|
||||
events.PopEvent();
|
||||
return;
|
||||
@@ -380,7 +380,7 @@ public:
|
||||
|
||||
me->MonsterYell("I'm ready to play!", LANG_UNIVERSAL, 0);
|
||||
me->PlayDirectSound(XT_SOUND_HEART_CLOSED);
|
||||
|
||||
|
||||
me->SetByteValue(UNIT_FIELD_BYTES_1, 0, UNIT_STAND_STATE_STAND); // emerge
|
||||
// Hide heart
|
||||
if (Unit* heart = me->GetVehicleKit() ? me->GetVehicleKit()->GetPassenger(HEART_VEHICLE_SEAT) : nullptr)
|
||||
@@ -397,7 +397,7 @@ public:
|
||||
events.PopEvent();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Disabled by stunned state
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
@@ -425,7 +425,7 @@ public:
|
||||
SummonList summons;
|
||||
uint32 _damageDone;
|
||||
uint32 _timerSpawn;
|
||||
|
||||
|
||||
uint8 _spawnSelection;
|
||||
uint8 _pummelerCount;
|
||||
|
||||
@@ -438,7 +438,7 @@ public:
|
||||
if (owner->GetTypeId() == TYPEID_UNIT)
|
||||
owner->ToCreature()->AI()->JustSummoned(cr);
|
||||
}
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
_damageDone += damage;
|
||||
}
|
||||
@@ -482,7 +482,7 @@ public:
|
||||
void SendEnergyToCorner()
|
||||
{
|
||||
Unit* pile = nullptr;
|
||||
uint8 num = urand(1,4);
|
||||
uint8 num = urand(1, 4);
|
||||
for (SummonList::const_iterator itr = summons.begin(); itr != summons.end(); ++itr)
|
||||
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
|
||||
if (summon->GetEntry() == NPC_PILE_TRIGGER)
|
||||
@@ -496,7 +496,7 @@ public:
|
||||
me->CastSpell(pile, SPELL_ENERGY_ORB, true);
|
||||
}
|
||||
|
||||
void SpellHitTarget(Unit *target, const SpellInfo *spellInfo)
|
||||
void SpellHitTarget(Unit* target, const SpellInfo* spellInfo)
|
||||
{
|
||||
// spawn not-so-random robots
|
||||
if (spellInfo->Id == SPELL_ENERGY_ORB_TRIGGER && target->GetEntry() == NPC_PILE_TRIGGER)
|
||||
@@ -504,34 +504,34 @@ public:
|
||||
{
|
||||
case 0:
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
me->SummonCreature(NPC_XS013_SCRAPBOT, target->GetPositionX()+irand(-3, 3), target->GetPositionY()+irand(-3, 3), target->GetPositionZ()+2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000);
|
||||
me->SummonCreature(NPC_XS013_SCRAPBOT, target->GetPositionX() + irand(-3, 3), target->GetPositionY() + irand(-3, 3), target->GetPositionZ() + 2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000);
|
||||
_spawnSelection++;
|
||||
break;
|
||||
case 1:
|
||||
me->SummonCreature(NPC_XE321_BOOMBOT, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||
me->SummonCreature(NPC_XE321_BOOMBOT, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||
_spawnSelection++;
|
||||
break;
|
||||
case 2:
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
me->SummonCreature(NPC_XS013_SCRAPBOT, target->GetPositionX()+irand(-3, 3), target->GetPositionY()+irand(-3, 3), target->GetPositionZ()+2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000);
|
||||
me->SummonCreature(NPC_XS013_SCRAPBOT, target->GetPositionX() + irand(-3, 3), target->GetPositionY() + irand(-3, 3), target->GetPositionZ() + 2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000);
|
||||
_spawnSelection++;
|
||||
break;
|
||||
case 3:
|
||||
if(_pummelerCount < 2)
|
||||
me->SummonCreature(NPC_XM024_PUMMELLER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||
|
||||
me->SummonCreature(NPC_XM024_PUMMELLER, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ() + 2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000);
|
||||
|
||||
_pummelerCount++;
|
||||
_spawnSelection++;
|
||||
break;
|
||||
case 4:
|
||||
for (uint8 i = 0; i < 5; ++i)
|
||||
me->SummonCreature(NPC_XS013_SCRAPBOT, target->GetPositionX()+irand(-3, 3), target->GetPositionY()+irand(-3, 3), target->GetPositionZ()+2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000);
|
||||
me->SummonCreature(NPC_XS013_SCRAPBOT, target->GetPositionX() + irand(-3, 3), target->GetPositionY() + irand(-3, 3), target->GetPositionZ() + 2, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 1000);
|
||||
_spawnSelection = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void JustDied(Unit * /*victim*/)
|
||||
void JustDied(Unit* /*victim*/)
|
||||
{
|
||||
me->SetVisible(false);
|
||||
if (me->GetInstanceScript())
|
||||
@@ -616,9 +616,9 @@ public:
|
||||
pXT002->ModifyHealth(pXT002->GetMaxHealth() * 0.01f);
|
||||
}
|
||||
|
||||
if (!urand(0,2))
|
||||
if (!urand(0, 2))
|
||||
me->MonsterTextEmote("XT-002 Deconstructor consumes scrap bot to repair himself.", 0, true);
|
||||
|
||||
|
||||
me->DespawnOrUnsummon(1);
|
||||
}
|
||||
}
|
||||
@@ -662,7 +662,7 @@ public:
|
||||
_trampleTimer = 0;
|
||||
_uppercutTimer = 0;
|
||||
|
||||
if (Unit *target = SelectTargetFromPlayerList(200))
|
||||
if (Unit* target = SelectTargetFromPlayerList(200))
|
||||
AttackStart(target);
|
||||
else
|
||||
me->DespawnOrUnsummon(500);
|
||||
@@ -703,25 +703,25 @@ public:
|
||||
|
||||
class BoomEvent : public BasicEvent
|
||||
{
|
||||
public:
|
||||
BoomEvent(Creature* me) : _me(me)
|
||||
{
|
||||
}
|
||||
public:
|
||||
BoomEvent(Creature* me) : _me(me)
|
||||
{
|
||||
}
|
||||
|
||||
bool Execute(uint64 /*time*/, uint32 /*diff*/)
|
||||
{
|
||||
// This hack is here because we suspect our implementation of spell effect execution on targets
|
||||
// is done in the wrong order. We suspect that EFFECT_0 needs to be applied on all targets,
|
||||
// then EFFECT_1, etc - instead of applying each effect on target1, then target2, etc.
|
||||
// The above situation causes the visual for this spell to be bugged, so we remove the instakill
|
||||
// effect and implement a script hack for that.
|
||||
bool Execute(uint64 /*time*/, uint32 /*diff*/)
|
||||
{
|
||||
// This hack is here because we suspect our implementation of spell effect execution on targets
|
||||
// is done in the wrong order. We suspect that EFFECT_0 needs to be applied on all targets,
|
||||
// then EFFECT_1, etc - instead of applying each effect on target1, then target2, etc.
|
||||
// The above situation causes the visual for this spell to be bugged, so we remove the instakill
|
||||
// effect and implement a script hack for that.
|
||||
|
||||
_me->CastSpell(_me, SPELL_BOOM, false);
|
||||
return true;
|
||||
}
|
||||
_me->CastSpell(_me, SPELL_BOOM, false);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
Creature* _me;
|
||||
private:
|
||||
Creature* _me;
|
||||
};
|
||||
|
||||
class npc_xt002_boombot : public CreatureScript
|
||||
@@ -762,9 +762,9 @@ public:
|
||||
if (_boomed)
|
||||
return;
|
||||
|
||||
_boomed = true; // Prevent recursive calls
|
||||
_boomed = true; // Prevent recursive calls
|
||||
|
||||
WorldPacket data(SMSG_SPELLINSTAKILLLOG, 8+8+4);
|
||||
WorldPacket data(SMSG_SPELLINSTAKILLLOG, 8 + 8 + 4);
|
||||
data << uint64(me->GetGUID());
|
||||
data << uint64(me->GetGUID());
|
||||
data << uint32(SPELL_BOOM);
|
||||
@@ -777,15 +777,15 @@ public:
|
||||
// so that can't be the issue
|
||||
// See BoomEvent class
|
||||
// Schedule 1s delayed
|
||||
me->m_Events.AddEvent(new BoomEvent(me), me->m_Events.CalculateTime(1*IN_MILLISECONDS));
|
||||
me->m_Events.AddEvent(new BoomEvent(me), me->m_Events.CalculateTime(1 * IN_MILLISECONDS));
|
||||
}
|
||||
|
||||
void JustDied(Unit*)
|
||||
{
|
||||
me->m_Events.AddEvent(new BoomEvent(me), me->m_Events.CalculateTime(1*IN_MILLISECONDS));
|
||||
me->m_Events.AddEvent(new BoomEvent(me), me->m_Events.CalculateTime(1 * IN_MILLISECONDS));
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (_boomed)
|
||||
damage = 0;
|
||||
@@ -847,7 +847,7 @@ public:
|
||||
uint32 _attackTimer;
|
||||
void Reset()
|
||||
{
|
||||
if (Unit *target = SelectTargetFromPlayerList(200))
|
||||
if (Unit* target = SelectTargetFromPlayerList(200))
|
||||
AttackStart(target);
|
||||
else
|
||||
me->DespawnOrUnsummon();
|
||||
@@ -866,219 +866,219 @@ public:
|
||||
|
||||
class spell_xt002_tympanic_tantrum : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_xt002_tympanic_tantrum() : SpellScriptLoader("spell_xt002_tympanic_tantrum") { }
|
||||
public:
|
||||
spell_xt002_tympanic_tantrum() : SpellScriptLoader("spell_xt002_tympanic_tantrum") { }
|
||||
|
||||
class spell_xt002_tympanic_tantrum_SpellScript : public SpellScript
|
||||
class spell_xt002_tympanic_tantrum_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_xt002_tympanic_tantrum_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
PrepareSpellScript(spell_xt002_tympanic_tantrum_SpellScript);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
targets.remove_if(PlayerOrPetCheck());
|
||||
}
|
||||
|
||||
void RecalculateDamage()
|
||||
{
|
||||
if (GetHitUnit())
|
||||
SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(GetHitDamage()));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_xt002_tympanic_tantrum_SpellScript();
|
||||
targets.remove_if(PlayerOrPetCheck());
|
||||
}
|
||||
|
||||
void RecalculateDamage()
|
||||
{
|
||||
if (GetHitUnit())
|
||||
SetHitDamage(GetHitUnit()->CountPctFromMaxHealth(GetHitDamage()));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_tympanic_tantrum_SpellScript::FilterTargets, EFFECT_ALL, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
OnHit += SpellHitFn(spell_xt002_tympanic_tantrum_SpellScript::RecalculateDamage);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_xt002_tympanic_tantrum_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_xt002_gravity_bomb_aura : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_xt002_gravity_bomb_aura() : SpellScriptLoader("spell_xt002_gravity_bomb_aura") { }
|
||||
public:
|
||||
spell_xt002_gravity_bomb_aura() : SpellScriptLoader("spell_xt002_gravity_bomb_aura") { }
|
||||
|
||||
class spell_xt002_gravity_bomb_aura_AuraScript : public AuraScript
|
||||
class spell_xt002_gravity_bomb_aura_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_xt002_gravity_bomb_aura_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_xt002_gravity_bomb_aura_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* player = GetOwner()->ToPlayer())
|
||||
if (Unit* xt002 = GetCaster())
|
||||
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
|
||||
if (Creature* cr = xt002->SummonCreature(NPC_VOID_ZONE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
|
||||
{
|
||||
int32 damage = GetSpellInfo()->Id == 63025 ? 5000 : 7500;
|
||||
cr->CastCustomSpell(cr, SPELL_VOID_ZONE_DAMAGE, &damage, 0, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
Unit* xt002 = GetCaster();
|
||||
if (!xt002)
|
||||
return;
|
||||
|
||||
Unit* owner = GetOwner()->ToUnit();
|
||||
if (!owner)
|
||||
return;
|
||||
|
||||
if (aurEff->GetAmount() >= int32(owner->GetHealth()))
|
||||
if (xt002->GetAI())
|
||||
xt002->GetAI()->DoAction(DATA_XT002_GRAVITY_ACHIEV);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_xt002_gravity_bomb_aura_AuraScript::OnPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_xt002_gravity_bomb_aura_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_xt002_gravity_bomb_aura_AuraScript();
|
||||
if (Player* player = GetOwner()->ToPlayer())
|
||||
if (Unit* xt002 = GetCaster())
|
||||
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
|
||||
if (Creature* cr = xt002->SummonCreature(NPC_VOID_ZONE, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000))
|
||||
{
|
||||
int32 damage = GetSpellInfo()->Id == 63025 ? 5000 : 7500;
|
||||
cr->CastCustomSpell(cr, SPELL_VOID_ZONE_DAMAGE, &damage, 0, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
class spell_xt002_gravity_bomb_aura_SpellScript : public SpellScript
|
||||
void OnPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
PrepareSpellScript(spell_xt002_gravity_bomb_aura_SpellScript);
|
||||
Unit* xt002 = GetCaster();
|
||||
if (!xt002)
|
||||
return;
|
||||
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (Unit* victim = GetCaster()->GetVictim())
|
||||
targets.remove_if(acore::ObjectGUIDCheck(victim->GetGUID(), true));
|
||||
}
|
||||
Unit* owner = GetOwner()->ToUnit();
|
||||
if (!owner)
|
||||
return;
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_gravity_bomb_aura_SpellScript::SelectTarget, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_xt002_gravity_bomb_aura_SpellScript();
|
||||
if (aurEff->GetAmount() >= int32(owner->GetHealth()))
|
||||
if (xt002->GetAI())
|
||||
xt002->GetAI()->DoAction(DATA_XT002_GRAVITY_ACHIEV);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_xt002_gravity_bomb_aura_AuraScript::OnPeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DAMAGE);
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_xt002_gravity_bomb_aura_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_xt002_gravity_bomb_aura_AuraScript();
|
||||
}
|
||||
|
||||
class spell_xt002_gravity_bomb_aura_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_xt002_gravity_bomb_aura_SpellScript);
|
||||
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (Unit* victim = GetCaster()->GetVictim())
|
||||
targets.remove_if(acore::ObjectGUIDCheck(victim->GetGUID(), true));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_gravity_bomb_aura_SpellScript::SelectTarget, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_xt002_gravity_bomb_aura_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_xt002_gravity_bomb_damage : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_xt002_gravity_bomb_damage() : SpellScriptLoader("spell_xt002_gravity_bomb_damage") { }
|
||||
public:
|
||||
spell_xt002_gravity_bomb_damage() : SpellScriptLoader("spell_xt002_gravity_bomb_damage") { }
|
||||
|
||||
class spell_xt002_gravity_bomb_damage_SpellScript : public SpellScript
|
||||
class spell_xt002_gravity_bomb_damage_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_xt002_gravity_bomb_damage_SpellScript);
|
||||
|
||||
void HandleScript(SpellEffIndex /*eff*/)
|
||||
{
|
||||
PrepareSpellScript(spell_xt002_gravity_bomb_damage_SpellScript);
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
void HandleScript(SpellEffIndex /*eff*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
if (GetHitDamage() >= int32(GetHitUnit()->GetHealth()))
|
||||
if (caster->GetAI())
|
||||
caster->GetAI()->DoAction(DATA_XT002_GRAVITY_ACHIEV);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_xt002_gravity_bomb_damage_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_xt002_gravity_bomb_damage_SpellScript();
|
||||
if (GetHitDamage() >= int32(GetHitUnit()->GetHealth()))
|
||||
if (caster->GetAI())
|
||||
caster->GetAI()->DoAction(DATA_XT002_GRAVITY_ACHIEV);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_xt002_gravity_bomb_damage_SpellScript::HandleScript, EFFECT_0, SPELL_EFFECT_SCHOOL_DAMAGE);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_xt002_gravity_bomb_damage_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class spell_xt002_searing_light_spawn_life_spark : public SpellScriptLoader
|
||||
{
|
||||
public:
|
||||
spell_xt002_searing_light_spawn_life_spark() : SpellScriptLoader("spell_xt002_searing_light_spawn_life_spark") { }
|
||||
public:
|
||||
spell_xt002_searing_light_spawn_life_spark() : SpellScriptLoader("spell_xt002_searing_light_spawn_life_spark") { }
|
||||
|
||||
class spell_xt002_searing_light_spawn_life_spark_AuraScript : public AuraScript
|
||||
class spell_xt002_searing_light_spawn_life_spark_AuraScript : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_xt002_searing_light_spawn_life_spark_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
PrepareAuraScript(spell_xt002_searing_light_spawn_life_spark_AuraScript);
|
||||
|
||||
void OnRemove(AuraEffect const* aurEff, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
if (Player* player = GetOwner()->ToPlayer())
|
||||
if (Unit* xt002 = GetCaster())
|
||||
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
|
||||
xt002->SummonCreature(NPC_LIFE_SPARK, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_xt002_searing_light_spawn_life_spark_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_xt002_searing_light_spawn_life_spark_AuraScript();
|
||||
if (Player* player = GetOwner()->ToPlayer())
|
||||
if (Unit* xt002 = GetCaster())
|
||||
if (xt002->HasAura(aurEff->GetAmount())) // Heartbreak aura indicating hard mode
|
||||
xt002->SummonCreature(NPC_LIFE_SPARK, player->GetPositionX(), player->GetPositionY(), player->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 180000);
|
||||
}
|
||||
|
||||
class spell_xt002_searing_light_spawn_life_spark_SpellScript : public SpellScript
|
||||
void Register()
|
||||
{
|
||||
PrepareSpellScript(spell_xt002_searing_light_spawn_life_spark_SpellScript);
|
||||
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (Unit* victim = GetCaster()->GetVictim())
|
||||
targets.remove_if(acore::ObjectGUIDCheck(victim->GetGUID(), true));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_searing_light_spawn_life_spark_SpellScript::SelectTarget, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_xt002_searing_light_spawn_life_spark_SpellScript();
|
||||
OnEffectRemove += AuraEffectRemoveFn(spell_xt002_searing_light_spawn_life_spark_AuraScript::OnRemove, EFFECT_0, SPELL_AURA_PERIODIC_TRIGGER_SPELL, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_xt002_searing_light_spawn_life_spark_AuraScript();
|
||||
}
|
||||
|
||||
class spell_xt002_searing_light_spawn_life_spark_SpellScript : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_xt002_searing_light_spawn_life_spark_SpellScript);
|
||||
|
||||
void SelectTarget(std::list<WorldObject*>& targets)
|
||||
{
|
||||
if (Unit* victim = GetCaster()->GetVictim())
|
||||
targets.remove_if(acore::ObjectGUIDCheck(victim->GetGUID(), true));
|
||||
}
|
||||
|
||||
void Register()
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_xt002_searing_light_spawn_life_spark_SpellScript::SelectTarget, EFFECT_ALL, TARGET_UNIT_DEST_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
SpellScript* GetSpellScript() const
|
||||
{
|
||||
return new spell_xt002_searing_light_spawn_life_spark_SpellScript();
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_xt002_nerf_engineering : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_xt002_nerf_engineering() : AchievementCriteriaScript("achievement_xt002_nerf_engineering") {}
|
||||
public:
|
||||
achievement_xt002_nerf_engineering() : AchievementCriteriaScript("achievement_xt002_nerf_engineering") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_XT002)))
|
||||
return cr->AI()->GetData(DATA_XT002_NERF_ENGINEERING);
|
||||
|
||||
return false;
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_XT002)))
|
||||
return cr->AI()->GetData(DATA_XT002_NERF_ENGINEERING);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_xt002_nerf_gravity_bombs : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
achievement_xt002_nerf_gravity_bombs() : AchievementCriteriaScript("achievement_xt002_nerf_gravity_bombs") {}
|
||||
public:
|
||||
achievement_xt002_nerf_gravity_bombs() : AchievementCriteriaScript("achievement_xt002_nerf_gravity_bombs") {}
|
||||
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_XT002)))
|
||||
return cr->AI()->GetData(DATA_XT002_GRAVITY_ACHIEV);
|
||||
|
||||
return false;
|
||||
}
|
||||
bool OnCheck(Player* /*player*/, Unit* target)
|
||||
{
|
||||
if (target)
|
||||
if (InstanceScript* instance = target->GetInstanceScript())
|
||||
if (Creature* cr = ObjectAccessor::GetCreature(*target, instance->GetData64(TYPE_XT002)))
|
||||
return cr->AI()->GetData(DATA_XT002_GRAVITY_ACHIEV);
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_xt002()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -208,7 +208,7 @@ public:
|
||||
|
||||
bool IsEncounterInProgress() const
|
||||
{
|
||||
for (uint8 i = 0; i < (MAX_ENCOUNTER-1); ++i)
|
||||
for (uint8 i = 0; i < (MAX_ENCOUNTER - 1); ++i)
|
||||
{
|
||||
if (m_auiEncounter[i] == IN_PROGRESS)
|
||||
return true;
|
||||
@@ -311,25 +311,25 @@ public:
|
||||
m_MimironACUguid = creature->GetGUID();
|
||||
break;
|
||||
case NPC_FREYA_GOSSIP:
|
||||
m_keepersGossipGUID[TYPE_FREYA-TYPE_FREYA] = creature->GetGUID();
|
||||
m_keepersGossipGUID[TYPE_FREYA - TYPE_FREYA] = creature->GetGUID();
|
||||
ShowKeeperGossip(TYPE_FREYA, creature);
|
||||
break;
|
||||
case NPC_HODIR_GOSSIP:
|
||||
m_keepersGossipGUID[TYPE_HODIR-TYPE_FREYA] = creature->GetGUID();
|
||||
m_keepersGossipGUID[TYPE_HODIR - TYPE_FREYA] = creature->GetGUID();
|
||||
ShowKeeperGossip(TYPE_HODIR, creature);
|
||||
break;
|
||||
case NPC_THORIM_GOSSIP:
|
||||
m_keepersGossipGUID[TYPE_THORIM-TYPE_FREYA] = creature->GetGUID();
|
||||
m_keepersGossipGUID[TYPE_THORIM - TYPE_FREYA] = creature->GetGUID();
|
||||
ShowKeeperGossip(TYPE_THORIM, creature);
|
||||
break;
|
||||
case NPC_MIMIRON_GOSSIP:
|
||||
m_keepersGossipGUID[TYPE_MIMIRON-TYPE_FREYA] = creature->GetGUID();
|
||||
m_keepersGossipGUID[TYPE_MIMIRON - TYPE_FREYA] = creature->GetGUID();
|
||||
ShowKeeperGossip(TYPE_MIMIRON, creature);
|
||||
break;
|
||||
case NPC_ELDER_IRONBRANCH:
|
||||
case NPC_ELDER_STONEBARK:
|
||||
case NPC_ELDER_BRIGHTLEAF:
|
||||
m_FreyaElder[creature->GetEntry()-NPC_ELDER_IRONBRANCH] = creature->GetGUID();
|
||||
m_FreyaElder[creature->GetEntry() - NPC_ELDER_IRONBRANCH] = creature->GetGUID();
|
||||
break;
|
||||
case NPC_SARA:
|
||||
m_saraGUID = creature->GetGUID();
|
||||
@@ -364,13 +364,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void OpenIfDone(uint32 encounter, GameObject *go, GOState state)
|
||||
void OpenIfDone(uint32 encounter, GameObject* go, GOState state)
|
||||
{
|
||||
if (GetData(encounter) == DONE)
|
||||
go->SetGoState(state);
|
||||
}
|
||||
|
||||
void ShowKeeperGossip(uint8 type, Creature *cr, uint64 guid = 0)
|
||||
void ShowKeeperGossip(uint8 type, Creature* cr, uint64 guid = 0)
|
||||
{
|
||||
if (!cr)
|
||||
{
|
||||
@@ -379,7 +379,7 @@ public:
|
||||
return;
|
||||
}
|
||||
|
||||
bool on = (GetData(type) == DONE && !(GetData(TYPE_WATCHERS) & (1 << (type-TYPE_FREYA))));
|
||||
bool on = (GetData(type) == DONE && !(GetData(TYPE_WATCHERS) & (1 << (type - TYPE_FREYA))));
|
||||
cr->SetVisible(on);
|
||||
}
|
||||
|
||||
@@ -459,19 +459,19 @@ public:
|
||||
break;
|
||||
// Thorim
|
||||
case GO_ARENA_LEVER_GATE:
|
||||
m_thorimGameobjectsGUID[DATA_THORIM_LEVER_GATE-DATA_THORIM_LEVER_GATE] = gameObject->GetGUID();
|
||||
m_thorimGameobjectsGUID[DATA_THORIM_LEVER_GATE - DATA_THORIM_LEVER_GATE] = gameObject->GetGUID();
|
||||
break;
|
||||
case GO_ARENA_LEVER:
|
||||
m_thorimGameobjectsGUID[DATA_THORIM_LEVER-DATA_THORIM_LEVER_GATE] = gameObject->GetGUID();
|
||||
m_thorimGameobjectsGUID[DATA_THORIM_LEVER - DATA_THORIM_LEVER_GATE] = gameObject->GetGUID();
|
||||
break;
|
||||
case GO_ARENA_FENCE:
|
||||
m_thorimGameobjectsGUID[DATA_THORIM_FENCE-DATA_THORIM_LEVER_GATE] = gameObject->GetGUID();
|
||||
m_thorimGameobjectsGUID[DATA_THORIM_FENCE - DATA_THORIM_LEVER_GATE] = gameObject->GetGUID();
|
||||
break;
|
||||
case GO_FIRST_COLOSSUS_DOORS:
|
||||
m_thorimGameobjectsGUID[DATA_THORIM_FIRST_DOORS-DATA_THORIM_LEVER_GATE] = gameObject->GetGUID();
|
||||
m_thorimGameobjectsGUID[DATA_THORIM_FIRST_DOORS - DATA_THORIM_LEVER_GATE] = gameObject->GetGUID();
|
||||
break;
|
||||
case GO_SECOND_COLOSSUS_DOORS:
|
||||
m_thorimGameobjectsGUID[DATA_THORIM_SECOND_DOORS-DATA_THORIM_LEVER_GATE] = gameObject->GetGUID();
|
||||
m_thorimGameobjectsGUID[DATA_THORIM_SECOND_DOORS - DATA_THORIM_LEVER_GATE] = gameObject->GetGUID();
|
||||
break;
|
||||
// Yogg-Saron
|
||||
case GO_YOGG_SARON_DOORS:
|
||||
@@ -562,7 +562,7 @@ public:
|
||||
case 190170: // Talandra's Rose
|
||||
case 189973: // Goldclover
|
||||
if (GetData(TYPE_FREYA) == DONE)
|
||||
gameObject->SetRespawnTime(7*DAY);
|
||||
gameObject->SetRespawnTime(7 * DAY);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -603,7 +603,7 @@ public:
|
||||
case TYPE_THORIM:
|
||||
case TYPE_FREYA:
|
||||
m_auiEncounter[type] = data;
|
||||
ShowKeeperGossip(type, NULL, m_keepersGossipGUID[type-TYPE_FREYA]);
|
||||
ShowKeeperGossip(type, NULL, m_keepersGossipGUID[type - TYPE_FREYA]);
|
||||
if (GetData(TYPE_MIMIRON) == DONE && GetData(TYPE_FREYA) == DONE && GetData(TYPE_HODIR) == DONE && GetData(TYPE_THORIM) == DONE)
|
||||
{
|
||||
if (GameObject* go = instance->GetGameObject(m_keepersgateGUID))
|
||||
@@ -623,11 +623,11 @@ public:
|
||||
case EVENT_TOWER_OF_FLAMES_DESTROYED:
|
||||
{
|
||||
instance->LoadGrid(364.0f, -16.0f); //make sure leviathan is loaded
|
||||
m_leviathanTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED] = data;
|
||||
m_leviathanTowers[type - EVENT_TOWER_OF_LIFE_DESTROYED] = data;
|
||||
GameObject* gobj = nullptr;
|
||||
if ((gobj = instance->GetGameObject(m_leviathanVisualTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED][0])))
|
||||
if ((gobj = instance->GetGameObject(m_leviathanVisualTowers[type - EVENT_TOWER_OF_LIFE_DESTROYED][0])))
|
||||
gobj->SetGoState(GO_STATE_ACTIVE);
|
||||
if ((gobj = instance->GetGameObject(m_leviathanVisualTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED][1])))
|
||||
if ((gobj = instance->GetGameObject(m_leviathanVisualTowers[type - EVENT_TOWER_OF_LIFE_DESTROYED][1])))
|
||||
gobj->SetGoState(GO_STATE_ACTIVE);
|
||||
return;
|
||||
}
|
||||
@@ -712,7 +712,7 @@ public:
|
||||
freya->GetGameObjectListWithEntryInGrid(goList, 189973 /*Goldclover*/, 333.0f);
|
||||
|
||||
for (std::list<GameObject*>::const_iterator itr = goList.begin(); itr != goList.end(); ++itr)
|
||||
(*itr)->SetRespawnTime(7*DAY);
|
||||
(*itr)->SetRespawnTime(7 * DAY);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -783,7 +783,7 @@ public:
|
||||
case DATA_HARPOON_FIRE_STATE_2:
|
||||
case DATA_HARPOON_FIRE_STATE_3:
|
||||
case DATA_HARPOON_FIRE_STATE_4:
|
||||
return m_RazorscaleHarpoonFireStateGUID[data-200];
|
||||
return m_RazorscaleHarpoonFireStateGUID[data - 200];
|
||||
|
||||
// XT-002
|
||||
case GO_XT002_DOORS:
|
||||
@@ -797,14 +797,14 @@ public:
|
||||
case DATA_THORIM_FENCE:
|
||||
case DATA_THORIM_FIRST_DOORS:
|
||||
case DATA_THORIM_SECOND_DOORS:
|
||||
return m_thorimGameobjectsGUID[data-DATA_THORIM_LEVER_GATE];
|
||||
return m_thorimGameobjectsGUID[data - DATA_THORIM_LEVER_GATE];
|
||||
break;
|
||||
|
||||
// Freya Elders
|
||||
case NPC_ELDER_IRONBRANCH:
|
||||
case NPC_ELDER_STONEBARK:
|
||||
case NPC_ELDER_BRIGHTLEAF:
|
||||
return m_FreyaElder[data-NPC_ELDER_IRONBRANCH];
|
||||
return m_FreyaElder[data - NPC_ELDER_IRONBRANCH];
|
||||
|
||||
// Mimiron's first vehicle (spawned by default)
|
||||
case DATA_MIMIRON_LEVIATHAN_MKII:
|
||||
@@ -816,7 +816,7 @@ public:
|
||||
case DATA_GO_MIMIRON_DOOR_1:
|
||||
case DATA_GO_MIMIRON_DOOR_2:
|
||||
case DATA_GO_MIMIRON_DOOR_3:
|
||||
return m_MimironDoor[data-311];
|
||||
return m_MimironDoor[data - 311];
|
||||
|
||||
// Yogg-Saron
|
||||
case GO_YOGG_SARON_DOORS:
|
||||
@@ -873,7 +873,7 @@ public:
|
||||
case EVENT_TOWER_OF_STORM_DESTROYED:
|
||||
case EVENT_TOWER_OF_FROST_DESTROYED:
|
||||
case EVENT_TOWER_OF_FLAMES_DESTROYED:
|
||||
return m_leviathanTowers[type-EVENT_TOWER_OF_LIFE_DESTROYED];
|
||||
return m_leviathanTowers[type - EVENT_TOWER_OF_LIFE_DESTROYED];
|
||||
|
||||
case DATA_UNBROKEN_ACHIEVEMENT:
|
||||
return m_unbrokenAchievement;
|
||||
@@ -918,9 +918,9 @@ public:
|
||||
else
|
||||
go = (m_auiEncounter[i] == IN_PROGRESS);
|
||||
|
||||
if (go && (C_of_Ulduar_MASK & (1<<i)) == 0)
|
||||
if (go && (C_of_Ulduar_MASK & (1 << i)) == 0)
|
||||
{
|
||||
C_of_Ulduar_MASK |= (1<<i);
|
||||
C_of_Ulduar_MASK |= (1 << i);
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
@@ -1027,43 +1027,43 @@ public:
|
||||
{
|
||||
case 10042:
|
||||
case 10352:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_LEVIATHAN)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_LEVIATHAN)) == 0;
|
||||
case 10342:
|
||||
case 10355:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_IGNIS)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_IGNIS)) == 0;
|
||||
case 10340:
|
||||
case 10353:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_RAZORSCALE)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_RAZORSCALE)) == 0;
|
||||
case 10341:
|
||||
case 10354:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_XT002)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_XT002)) == 0;
|
||||
case 10598:
|
||||
case 10599:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_ASSEMBLY)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_ASSEMBLY)) == 0;
|
||||
case 10348:
|
||||
case 10357:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_KOLOGARN)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_KOLOGARN)) == 0;
|
||||
case 10351:
|
||||
case 10363:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_AURIAYA)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_AURIAYA)) == 0;
|
||||
case 10439:
|
||||
case 10719:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_HODIR)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_HODIR)) == 0;
|
||||
case 10403:
|
||||
case 10404:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_THORIM)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_THORIM)) == 0;
|
||||
case 10582:
|
||||
case 10583:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_FREYA)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_FREYA)) == 0;
|
||||
case 10347:
|
||||
case 10361:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_MIMIRON)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_MIMIRON)) == 0;
|
||||
case 10349:
|
||||
case 10362:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_VEZAX)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_VEZAX)) == 0;
|
||||
case 10350:
|
||||
case 10364:
|
||||
return (C_of_Ulduar_MASK & (1<<TYPE_YOGGSARON)) == 0;
|
||||
return (C_of_Ulduar_MASK & (1 << TYPE_YOGGSARON)) == 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1130,11 +1130,11 @@ void instance_ulduar::instance_ulduar_InstanceMapScript::SpawnLeviathanEncounter
|
||||
TempSummon* veh = nullptr;
|
||||
for (uint8 i = 0; i < (instance->Is25ManRaid() ? 5 : 2); ++i)
|
||||
{
|
||||
if ((veh = instance->SummonCreature(NPC_SALVAGED_SIEGE_ENGINE, vehiclePositions[15*mode+i])))
|
||||
if ((veh = instance->SummonCreature(NPC_SALVAGED_SIEGE_ENGINE, vehiclePositions[15 * mode + i])))
|
||||
_leviathanVehicles.push_back(veh->GetGUID());
|
||||
if ((veh = instance->SummonCreature(NPC_VEHICLE_CHOPPER, vehiclePositions[15*mode+i+5])))
|
||||
if ((veh = instance->SummonCreature(NPC_VEHICLE_CHOPPER, vehiclePositions[15 * mode + i + 5])))
|
||||
_leviathanVehicles.push_back(veh->GetGUID());
|
||||
if ((veh = instance->SummonCreature(NPC_SALVAGED_DEMOLISHER, vehiclePositions[15*mode+i+10])))
|
||||
if ((veh = instance->SummonCreature(NPC_SALVAGED_DEMOLISHER, vehiclePositions[15 * mode + i + 10])))
|
||||
_leviathanVehicles.push_back(veh->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,31 +71,40 @@ public:
|
||||
{
|
||||
case BASE_CAMP:
|
||||
player->TeleportTo(603, -706.122f, -92.6024f, 429.876f, 0);
|
||||
CloseGossipMenuFor(player); break;
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case GROUNDS:
|
||||
player->TeleportTo(603, 131.248f, -35.3802f, 409.804f, 0);
|
||||
CloseGossipMenuFor(player); break;
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case FORGE:
|
||||
player->TeleportTo(603, 553.233f, -12.3247f, 409.679f, 0);
|
||||
CloseGossipMenuFor(player); break;
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case SCRAPYARD:
|
||||
player->TeleportTo(603, 926.292f, -11.4635f, 418.595f, 0);
|
||||
CloseGossipMenuFor(player); break;
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case ANTECHAMBER:
|
||||
player->TeleportTo(603, 1498.09f, -24.246f, 420.967f, 0);
|
||||
CloseGossipMenuFor(player); break;
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case WALKWAY:
|
||||
player->TeleportTo(603, 1859.45f, -24.1f, 448.9f, 0);
|
||||
CloseGossipMenuFor(player); break;
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case CONSERVATORY:
|
||||
player->TeleportTo(603, 2086.27f, -24.3134f, 421.239f, 0);
|
||||
CloseGossipMenuFor(player); break;
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case MADNESS:
|
||||
player->TeleportTo(603, 1854.8f, -11.46f, 334.57f, 4.8f);
|
||||
CloseGossipMenuFor(player); break;
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
case SPARK:
|
||||
player->TeleportTo(603, 2517.9f, 2568.9f, 412.7f, 0);
|
||||
CloseGossipMenuFor(player); break;
|
||||
CloseGossipMenuFor(player);
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -109,7 +118,7 @@ public:
|
||||
|
||||
bool OnGossipHello(Player* player, Creature* creature) override
|
||||
{
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Lend us your aid, keeper. Together we shall defeat Yogg-Saron.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
|
||||
AddGossipItemFor(player, GOSSIP_ICON_CHAT, "Lend us your aid, keeper. Together we shall defeat Yogg-Saron.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
|
||||
SendGossipMenuFor(player, DEFAULT_GOSSIP_MESSAGE, creature->GetGUID());
|
||||
return true;
|
||||
}
|
||||
@@ -161,7 +170,7 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_ulduar_energy_sap_AuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * aurEff)
|
||||
void HandleEffectPeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (Unit* target = GetTarget())
|
||||
target->CastSpell(target, (aurEff->GetId() == 64740) ? 64747 : 64863, true);
|
||||
@@ -173,7 +182,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_ulduar_energy_sap_AuraScript();
|
||||
}
|
||||
@@ -202,7 +211,7 @@ public:
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!activated && who->GetTypeId() == TYPEID_PLAYER)
|
||||
if (me->GetExactDist2d(who) <= 25.0f && me->GetMap()->isInLineOfSight(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()+5.0f, who->GetPositionX(), who->GetPositionY(), who->GetPositionZ()+5.0f, 2, LINEOFSIGHT_ALL_CHECKS))
|
||||
if (me->GetExactDist2d(who) <= 25.0f && me->GetMap()->isInLineOfSight(me->GetPositionX(), me->GetPositionY(), me->GetPositionZ() + 5.0f, who->GetPositionX(), who->GetPositionY(), who->GetPositionZ() + 5.0f, 2, LINEOFSIGHT_ALL_CHECKS))
|
||||
{
|
||||
activated = true;
|
||||
me->RemoveAura(64615);
|
||||
@@ -212,10 +221,11 @@ public:
|
||||
if (me->GetEntry() == 34146) count = 4;
|
||||
else if (me->GetEntry() == 34150) count = 6;
|
||||
else count = 8;
|
||||
for (uint8 i=0; i<count; ++i)
|
||||
for (uint8 i = 0; i < count; ++i)
|
||||
{
|
||||
float a = rand_norm()*2*M_PI; float d = rand_norm()*4.0f;
|
||||
if (Creature* c = me->SummonCreature(34137, me->GetPositionX()+cos(a)*d, me->GetPositionY()+sin(a)*d, me->GetPositionZ()+1.0f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000))
|
||||
float a = rand_norm() * 2 * M_PI;
|
||||
float d = rand_norm() * 4.0f;
|
||||
if (Creature* c = me->SummonCreature(34137, me->GetPositionX() + cos(a) * d, me->GetPositionY() + sin(a) * d, me->GetPositionZ() + 1.0f, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000))
|
||||
c->AI()->AttackStart(who);
|
||||
}
|
||||
}
|
||||
@@ -254,7 +264,7 @@ public:
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(1, 2000); // checking Separation Anxiety, Charged Sphere
|
||||
events.ScheduleEvent(2, urand(5000,8000)); // Forked Lightning
|
||||
events.ScheduleEvent(2, urand(5000, 8000)); // Forked Lightning
|
||||
events.ScheduleEvent(3, (me->GetEntry() == 33722 ? 20000 : 50000)); // Summon Charged Sphere
|
||||
if (Creature* c = me->FindNearestCreature((me->GetEntry() == 33722 ? 33699 : 33722), 30.0f, true))
|
||||
otherGUID = c->GetGUID();
|
||||
@@ -300,7 +310,7 @@ public:
|
||||
break;
|
||||
case 2:
|
||||
me->CastSpell(me->GetVictim(), 63541, false);
|
||||
events.RepeatEvent(urand(10000,14000));
|
||||
events.RepeatEvent(urand(10000, 14000));
|
||||
break;
|
||||
case 3:
|
||||
if (!me->HasAura(63630))
|
||||
@@ -349,7 +359,7 @@ public:
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
}
|
||||
|
||||
void DamageTaken(Unit*, uint32 &damage, DamageEffectType, SpellSchoolMask)
|
||||
void DamageTaken(Unit*, uint32& damage, DamageEffectType, SpellSchoolMask)
|
||||
{
|
||||
if (!_spawnedMechanic && me->HealthBelowPctDamaged(20, damage))
|
||||
{
|
||||
@@ -384,7 +394,7 @@ public:
|
||||
{
|
||||
if (me->getFaction() != 16)
|
||||
{
|
||||
if (me->IsAlive() && (me->GetExactDist2dSq(2058.0f, 42.0f) < 25.0f*25.0f || me->GetExactDist2dSq(2203.0f, 292.0f) < 25.0f*25.0f || me->GetExactDist2dSq(2125.0f, 170.0f) > 160.0f*160.0f))
|
||||
if (me->IsAlive() && (me->GetExactDist2dSq(2058.0f, 42.0f) < 25.0f * 25.0f || me->GetExactDist2dSq(2203.0f, 292.0f) < 25.0f * 25.0f || me->GetExactDist2dSq(2125.0f, 170.0f) > 160.0f * 160.0f))
|
||||
Unit::Kill(me, me, false);
|
||||
}
|
||||
else
|
||||
@@ -438,7 +448,7 @@ public:
|
||||
{
|
||||
PrepareAuraScript(spell_ulduar_arachnopod_damaged_AuraScript)
|
||||
|
||||
void HandleEffectPeriodic(AuraEffect const * /*aurEff*/)
|
||||
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
|
||||
{
|
||||
if (Unit* c = GetCaster())
|
||||
Unit::Kill(c, c, false);
|
||||
@@ -450,7 +460,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
AuraScript *GetAuraScript() const
|
||||
AuraScript* GetAuraScript() const
|
||||
{
|
||||
return new spell_ulduar_arachnopod_damaged_AuraScript();
|
||||
}
|
||||
@@ -458,21 +468,21 @@ public:
|
||||
|
||||
class AreaTrigger_at_celestial_planetarium_enterance : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
public:
|
||||
|
||||
AreaTrigger_at_celestial_planetarium_enterance()
|
||||
: AreaTriggerScript("at_celestial_planetarium_enterance")
|
||||
{
|
||||
}
|
||||
AreaTrigger_at_celestial_planetarium_enterance()
|
||||
: AreaTriggerScript("at_celestial_planetarium_enterance")
|
||||
{
|
||||
}
|
||||
|
||||
bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/)
|
||||
{
|
||||
if (player->IsAlive())
|
||||
if (uint32 questId = (player->GetMap()->Is25ManRaid() ? 13816 : 13607 /*QUEST_CELESTIAL_PLANETARIUM*/))
|
||||
if (player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(questId);
|
||||
return false;
|
||||
}
|
||||
bool OnTrigger(Player* player, AreaTrigger const* /*trigger*/)
|
||||
{
|
||||
if (player->IsAlive())
|
||||
if (uint32 questId = (player->GetMap()->Is25ManRaid() ? 13816 : 13607 /*QUEST_CELESTIAL_PLANETARIUM*/))
|
||||
if (player->GetQuestStatus(questId) == QUEST_STATUS_INCOMPLETE)
|
||||
player->AreaExploredOrEventHappens(questId);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
class go_call_tram : public GameObjectScript
|
||||
|
||||
@@ -133,7 +133,7 @@ enum UlduarNPCs
|
||||
NPC_SALVAGED_DEMOLISHER = 33109,
|
||||
NPC_SALVAGED_DEMOLISHER_TURRET = 33167,
|
||||
|
||||
|
||||
|
||||
// Algalon the Observer
|
||||
NPC_BRANN_BRONZBEARD_ALG = 34064,
|
||||
NPC_AZEROTH = 34246,
|
||||
|
||||
Reference in New Issue
Block a user