Scripts/BrC: implement Ascendant Lord Obsidius encounter
This commit is contained in:
1 parent
f12e733024
commit
3ce40c75ee
6 files changed
+527
-93
No files matched your search
+53
-19
@@ -525,7 +525,8 @@ private:
|
||||
enum RazTheCrazed
|
||||
{
|
||||
// Texts
|
||||
SAY_SMASH = 0,
|
||||
SAY_SMASH = 0,
|
||||
SAY_TIRED = 1,
|
||||
|
||||
// Spells
|
||||
SPELL_AGGRO_NEARBY_TARGETS = 80189,
|
||||
@@ -538,15 +539,18 @@ enum RazTheCrazed
|
||||
SPELL_FURIOUS_SWIPE = 80206,
|
||||
SPELL_FURIOUS_SWIPE_DUMMY = 80340,
|
||||
SPELL_FURIOUS_RAGE = 80218,
|
||||
SPELL_STOP_HEART = 82393,
|
||||
SPELL_INSTAKILL_SELF = 29878,
|
||||
|
||||
EVENT_DISABLE_GRAVITY_AND_HOVER = 1,
|
||||
EVENT_SAY_SMASH,
|
||||
EVENT_SAY_SMASH = 1,
|
||||
EVENT_START_ESCORT_PATH,
|
||||
EVENT_FACE_TO_THE_SIDE,
|
||||
EVENT_LEAP_FROM_BRIDGE,
|
||||
EVENT_LEAP_FROM_LEDGE,
|
||||
EVENT_LEAP_OVER_BORER_PACKS,
|
||||
EVENT_RESUME_ESCORT
|
||||
EVENT_RESUME_ESCORT,
|
||||
EVENT_LEAP_AT_OBSIDIUS,
|
||||
EVENT_KILL_RAZ
|
||||
};
|
||||
|
||||
Position const RazPathRomogg[] =
|
||||
@@ -573,19 +577,12 @@ Position const RazPathCorla[] =
|
||||
|
||||
struct npc_raz_the_crazed : public EscortAI
|
||||
{
|
||||
npc_raz_the_crazed(Creature* creature) : EscortAI(creature), _instance(creature->GetInstanceScript())
|
||||
{
|
||||
SetCombatMovement(false);
|
||||
}
|
||||
npc_raz_the_crazed(Creature* creature) : EscortAI(creature), _instance(creature->GetInstanceScript()) { }
|
||||
|
||||
void EnterEvadeMode(EvadeReason why) override
|
||||
{
|
||||
EscortAI::EnterEvadeMode(why);
|
||||
DoCastSelf(SPELL_AGGRO_NEARBY_TARGETS, true);
|
||||
if (_instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_ROMOGG)
|
||||
BuildRomoggPath();
|
||||
else if (_instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_CORLA)
|
||||
BuildCorlaPath();
|
||||
}
|
||||
|
||||
void JustAppeared() override
|
||||
@@ -602,22 +599,38 @@ struct npc_raz_the_crazed : public EscortAI
|
||||
_events.ScheduleEvent(EVENT_LEAP_FROM_LEDGE, 2s);
|
||||
BuildCorlaPath();
|
||||
}
|
||||
else if (_instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_OBSIDIUS)
|
||||
_events.ScheduleEvent(EVENT_LEAP_AT_OBSIDIUS, 2s);
|
||||
|
||||
SetDespawnAtEnd(false);
|
||||
DoCastSelf(SPELL_AGGRO_NEARBY_TARGETS, true);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
Talk(SAY_TIRED);
|
||||
me->DespawnOrUnsummon(9s);
|
||||
}
|
||||
|
||||
void DoAction(int32 action) override
|
||||
{
|
||||
if (action == ACTION_BREAK_OUT_OF_PRISON)
|
||||
{
|
||||
me->RemoveAurasDueToSpell(SPELL_HIGH_SECURITY_SHADOW_PRISON);
|
||||
me->SetDisableGravity(false);
|
||||
me->SetHover(false);
|
||||
DoCastSelf(SPELL_LEAP_FROM_CAGE);
|
||||
_events.ScheduleEvent(EVENT_DISABLE_GRAVITY_AND_HOVER, 2s + 500ms);
|
||||
_events.ScheduleEvent(EVENT_START_ESCORT_PATH, 4s);
|
||||
_events.ScheduleEvent(EVENT_SAY_SMASH, 4s);
|
||||
}
|
||||
}
|
||||
|
||||
void SpellHit(Unit* /*caster*/, SpellInfo const* spell) override
|
||||
{
|
||||
if (spell->Id == SPELL_STOP_HEART)
|
||||
_events.ScheduleEvent(EVENT_KILL_RAZ, 4s);
|
||||
}
|
||||
|
||||
void BuildRomoggPath()
|
||||
{
|
||||
for (uint8 i = 0; i < 12; i++)
|
||||
@@ -649,7 +662,7 @@ struct npc_raz_the_crazed : public EscortAI
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
if (!target->IsInCombatWith(me))
|
||||
if (!target->IsInCombat())
|
||||
return;
|
||||
|
||||
if (spell->Id == SPELL_FURIOUS_SWIPE_DUMMY)
|
||||
@@ -669,16 +682,12 @@ struct npc_raz_the_crazed : public EscortAI
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_DISABLE_GRAVITY_AND_HOVER:
|
||||
me->SetDisableGravity(false);
|
||||
me->SetHover(false);
|
||||
break;
|
||||
case EVENT_SAY_SMASH:
|
||||
Talk(SAY_SMASH);
|
||||
break;
|
||||
case EVENT_START_ESCORT_PATH:
|
||||
me->SetHomePosition(me->GetPosition());
|
||||
Start(false, false);
|
||||
Start(true, true);
|
||||
break;
|
||||
case EVENT_FACE_TO_THE_SIDE:
|
||||
me->SetFacingTo(5.061455f);
|
||||
@@ -698,6 +707,13 @@ struct npc_raz_the_crazed : public EscortAI
|
||||
DoCastSelf(SPELL_LEAP_OVER_BORER_PACKS);
|
||||
me->DespawnOrUnsummon(2s);
|
||||
break;
|
||||
case EVENT_LEAP_AT_OBSIDIUS:
|
||||
Talk(SAY_SMASH);
|
||||
DoCastSelf(SPELL_LEAP_AT_OBSIDIUS);
|
||||
break;
|
||||
case EVENT_KILL_RAZ:
|
||||
DoCastSelf(SPELL_INSTAKILL_SELF);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -726,6 +742,23 @@ class at_raz_corla_event : public AreaTriggerScript
|
||||
}
|
||||
};
|
||||
|
||||
class at_raz_obsidius_event : public AreaTriggerScript
|
||||
{
|
||||
public:
|
||||
at_raz_obsidius_event() : AreaTriggerScript("at_raz_obsidius_event") { }
|
||||
|
||||
bool OnTrigger(Player* player, AreaTriggerEntry const* /*areaTrigger*/)
|
||||
{
|
||||
if (InstanceScript* instance = player->GetInstanceScript())
|
||||
if (instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_CORLA
|
||||
&& instance->GetBossState(DATA_KARSH_STEELBENDER) == DONE)
|
||||
instance->SetData(DATA_RAZ_LAST_AREA_INDEX, RAZ_AREA_INDEX_OBSIDIUS);
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_blackrock_caverns()
|
||||
{
|
||||
RegisterBlackrockCavernsCreatureAI(npc_fire_cyclone);
|
||||
@@ -736,4 +769,5 @@ void AddSC_blackrock_caverns()
|
||||
RegisterBlackrockCavernsCreatureAI(npc_crazed_mage);
|
||||
RegisterBlackrockCavernsCreatureAI(npc_raz_the_crazed);
|
||||
new at_raz_corla_event();
|
||||
new at_raz_obsidius_event();
|
||||
}
|
||||
+10
-5
@@ -48,6 +48,7 @@ enum BRCCreatureIds
|
||||
BOSS_CORLA_HERALD_OF_TWILIGHT = 39679,
|
||||
BOSS_KARSH_STEELBENDER = 39698,
|
||||
BOSS_BEAUTY = 39700,
|
||||
BOSS_ASCENDANT_LORD_OBSIDIUS = 39705,
|
||||
|
||||
// Encounter Related
|
||||
/*Rom'ogg Bonecrusher*/
|
||||
@@ -59,16 +60,19 @@ enum BRCCreatureIds
|
||||
NPC_TWILIGHT_ZEALOT = 50284,
|
||||
NPC_EVOLVED_TWILIGHT_ZEALOT = 39987,
|
||||
|
||||
NPC_TWILIGHT_FLAME_CALLER = 39708,
|
||||
NPC_RAZ_THE_CRAZED = 39670,
|
||||
|
||||
/*Karsh Steelbender*/
|
||||
NPC_INVISIBLE_STALKER = 39842,
|
||||
NPC_BOUND_FLAMES = 50417,
|
||||
|
||||
/*Beauty*/
|
||||
NPC_LUCKY = 40008,
|
||||
NPC_SPOT = 40011
|
||||
NPC_SPOT = 40011,
|
||||
|
||||
/*Ascendant Lord Obsidius*/
|
||||
NPC_SHADOW_OF_OBSIDIUS = 40817,
|
||||
|
||||
NPC_TWILIGHT_FLAME_CALLER = 39708,
|
||||
NPC_RAZ_THE_CRAZED = 39670,
|
||||
};
|
||||
|
||||
enum BRCActions
|
||||
@@ -86,7 +90,8 @@ enum BRCRazAreaIndex
|
||||
Position const RazTheCrazedSummonPositions[] =
|
||||
{
|
||||
{ 249.2639f, 949.1614f, 191.7866f, 3.141593f },
|
||||
{ 406.1927f, 906.0121f, 163.4926f, 4.310963f }
|
||||
{ 406.1927f, 906.0121f, 163.4926f, 4.310963f },
|
||||
{ 308.9653f, 635.8195f, 64.79769f, 4.555309f }
|
||||
};
|
||||
|
||||
template <class AI, class T>
|
||||
|
||||
+330
-67
@@ -18,95 +18,358 @@
|
||||
#include "ScriptMgr.h"
|
||||
#include "blackrock_caverns.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "SpellAuraEffects.h"
|
||||
#include "SpellMgr.h"
|
||||
|
||||
enum Text
|
||||
{
|
||||
YELL_AGGRO = 0,
|
||||
YELL_KILL = 1,
|
||||
YELL_SWITCHING_SHADOWS = 2,
|
||||
YELL_DEATH = 3,
|
||||
EMOTE_SWITCHING_SHADOWS = 4
|
||||
// Ascendant Lord Obsidius
|
||||
SAY_AGGRO = 0,
|
||||
SAY_SLAY = 1,
|
||||
SAY_TRANSFORMATION = 2,
|
||||
SAY_DEATH = 3,
|
||||
SAY_ANNOUNCE_TRANSFORMATION = 4
|
||||
};
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_MANA_TAP = 36021,
|
||||
SPELL_ARCANE_TORRENT = 36022,
|
||||
SPELL_DOMINATION = 35280,
|
||||
// Ascendant Lord Obsidius
|
||||
SPELL_STOP_HEART = 82393,
|
||||
SPELL_STONE_BLOW = 76185,
|
||||
SPELL_THUNDERCLAP = 76186,
|
||||
SPELL_TRANSFORMATION = 76196,
|
||||
|
||||
// Shadow of Obsidius
|
||||
SPELL_SHADOWY_CORRUPTION = 75054,
|
||||
};
|
||||
|
||||
#define SPELL_TWILIGHT_CORRUPTION RAID_MODE<int32>(76188, 93613)
|
||||
|
||||
enum SpellVisualKits
|
||||
{
|
||||
SPELL_VISUAL_SPOTTED = 14893
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
EVENT_MANA_TAP = 1,
|
||||
EVENT_ARCANE_TORRENT = 2,
|
||||
EVENT_DOMINATION = 3
|
||||
// Ascendant Lord Obsidius
|
||||
EVENT_FINISH_RAZ_INTRO = 1,
|
||||
EVENT_STONE_BLOW ,
|
||||
EVENT_TWILIGHT_CORRUPTION,
|
||||
EVENT_THUNDERCLAP,
|
||||
};
|
||||
|
||||
class boss_ascendant_lord_obsidius : public CreatureScript
|
||||
enum Data
|
||||
{
|
||||
DATA_DEAD_ELEMENTAL_WARDEN = 0,
|
||||
DATA_ASCENDANT_DESCENDING
|
||||
};
|
||||
|
||||
Position const ShadowOfObsidiusPositions[] =
|
||||
{
|
||||
{ 331.6267f, 563.5573f, 66.08982f, 3.141593f },
|
||||
{ 332.2361f, 544.75f, 66.08982f, 3.141593f },
|
||||
{ 324.6545f, 554.1979f, 66.10867f, 3.141593f }
|
||||
};
|
||||
|
||||
struct boss_ascendant_lord_obsidius : public BossAI
|
||||
{
|
||||
boss_ascendant_lord_obsidius(Creature* creature) : BossAI(creature, DATA_ASCENDANT_LORD_OBSIDIUS) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
_transformationCount = 0;
|
||||
_deadElementalWardenCount = 0;
|
||||
_achievementEnligible = true;
|
||||
|
||||
if (instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_OBSIDIUS)
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_STUNNED);
|
||||
|
||||
for (uint8 i = 0; i < (IsHeroic() ? 3 : 2); i++)
|
||||
{
|
||||
if (Creature* shadow = DoSummon(NPC_SHADOW_OF_OBSIDIUS, ShadowOfObsidiusPositions[i], 0, TEMPSUMMON_MANUAL_DESPAWN))
|
||||
{
|
||||
if (instance->GetData(DATA_RAZ_LAST_AREA_INDEX) == RAZ_AREA_INDEX_OBSIDIUS)
|
||||
{
|
||||
shadow->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
shadow->RemoveAurasDueToSpell(SPELL_SHADOWY_CORRUPTION);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_ENGAGE, me);
|
||||
Talk(SAY_AGGRO);
|
||||
events.ScheduleEvent(EVENT_STONE_BLOW, 8s);
|
||||
events.ScheduleEvent(EVENT_TWILIGHT_CORRUPTION, 12s);
|
||||
|
||||
if (IsHeroic())
|
||||
events.ScheduleEvent(EVENT_THUNDERCLAP, 15s + 600ms);
|
||||
|
||||
for (ObjectGuid guid : summons)
|
||||
if (Creature* shadow = ObjectAccessor::GetCreature(*me, guid))
|
||||
shadow->AI()->DoZoneInCombat();
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(SAY_SLAY);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TWILIGHT_CORRUPTION);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
Talk(SAY_DEATH);
|
||||
}
|
||||
|
||||
void EnterEvadeMode(EvadeReason /*why*/) override
|
||||
{
|
||||
_EnterEvadeMode();
|
||||
instance->DoRemoveAurasDueToSpellOnPlayers(SPELL_TWILIGHT_CORRUPTION);
|
||||
instance->SendEncounterUnit(ENCOUNTER_FRAME_DISENGAGE, me);
|
||||
summons.DespawnAll();
|
||||
_DespawnAtEvade();
|
||||
}
|
||||
|
||||
void DamageTaken(Unit* /*attacker*/, uint32& damage) override
|
||||
{
|
||||
if ((me->HealthBelowPctDamaged(69, damage) && _transformationCount == 0)
|
||||
|| (me->HealthBelowPctDamaged(34, damage) && _transformationCount == 1))
|
||||
{
|
||||
Talk(SAY_TRANSFORMATION);
|
||||
Talk(SAY_ANNOUNCE_TRANSFORMATION);
|
||||
DoCastAOE(SPELL_TRANSFORMATION, true);
|
||||
_transformationCount++;
|
||||
}
|
||||
}
|
||||
|
||||
void SetData(uint32 type, uint32 data) override
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DATA_DEAD_ELEMENTAL_WARDEN:
|
||||
_deadElementalWardenCount++;
|
||||
if (_deadElementalWardenCount == 7)
|
||||
{
|
||||
me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC | UNIT_FLAG_STUNNED);
|
||||
|
||||
for (ObjectGuid guid : summons)
|
||||
{
|
||||
if (Creature* shadow = ObjectAccessor::GetCreature(*me, guid))
|
||||
{
|
||||
shadow->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
|
||||
shadow->RemoveAurasDueToSpell(SPELL_SHADOWY_CORRUPTION);
|
||||
}
|
||||
}
|
||||
DoCastAOE(SPELL_STOP_HEART);
|
||||
}
|
||||
break;
|
||||
case DATA_ASCENDANT_DESCENDING:
|
||||
_achievementEnligible = false;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32 GetData(uint32 data) const override
|
||||
{
|
||||
if (data == DATA_ASCENDANT_DESCENDING)
|
||||
return _achievementEnligible;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_STONE_BLOW:
|
||||
DoCastVictim(SPELL_STONE_BLOW);
|
||||
events.Repeat(12s);
|
||||
break;
|
||||
case EVENT_TWILIGHT_CORRUPTION:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100.0f, true, -SPELL_TWILIGHT_CORRUPTION))
|
||||
DoCast(target, SPELL_TWILIGHT_CORRUPTION);
|
||||
events.Repeat(12s);
|
||||
break;
|
||||
case EVENT_THUNDERCLAP:
|
||||
DoCastAOE(SPELL_THUNDERCLAP);
|
||||
events.Repeat(23s);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
private:
|
||||
uint8 _transformationCount;
|
||||
uint8 _deadElementalWardenCount;
|
||||
bool _achievementEnligible;
|
||||
};
|
||||
|
||||
class spell_obsidius_twitchy : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_obsidius_twitchy);
|
||||
|
||||
void HandleProc(AuraEffect const* /*aurEff*/, ProcEventInfo& eventInfo)
|
||||
{
|
||||
PreventDefaultAction();
|
||||
|
||||
Unit* target = GetTarget();
|
||||
if (DamageInfo* damage = eventInfo.GetDamageInfo())
|
||||
{
|
||||
if (Unit* attacker = damage->GetAttacker())
|
||||
{
|
||||
target->SendPlaySpellVisualKit(SPELL_VISUAL_SPOTTED, 0, 0);
|
||||
target->getThreatManager().resetAllAggro();
|
||||
target->AddThreat(attacker, 100000000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectProc += AuraEffectProcFn(spell_obsidius_twitchy::HandleProc, EFFECT_0, SPELL_AURA_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_obsidius_transformation : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_obsidius_transformation);
|
||||
|
||||
void HandleEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; i++)
|
||||
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetSpellInfo()->Effects[i].BasePoints))
|
||||
if (Unit* caster = GetCaster())
|
||||
caster->CastSpell(GetHitUnit(), spell->Id, true);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_obsidius_transformation::HandleEffect, EFFECT_0, SPELL_EFFECT_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_obsidius_transformation_not_selectable : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_obsidius_transformation_not_selectable);
|
||||
|
||||
void AfterRemmove(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
|
||||
{
|
||||
Unit* caster = GetCaster();
|
||||
if (!caster)
|
||||
return;
|
||||
|
||||
Unit* target = GetTarget();
|
||||
if (caster == target)
|
||||
return;
|
||||
|
||||
Position pos1 = target->GetPosition();
|
||||
Position pos2 = caster->GetPosition();
|
||||
caster->NearTeleportTo(pos1);
|
||||
target->NearTeleportTo(pos2);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectRemove += AuraEffectRemoveFn(spell_obsidius_transformation_not_selectable::AfterRemmove, EFFECT_0, SPELL_AURA_MOD_UNATTACKABLE, AURA_EFFECT_HANDLE_REAL);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_obsidius_transformation_scale : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_obsidius_transformation_scale);
|
||||
|
||||
void HandlePeriodic(AuraEffect const* aurEff)
|
||||
{
|
||||
if (SpellInfo const* spell = sSpellMgr->GetSpellInfo(GetSpellInfo()->Effects[aurEff->GetEffIndex()].BasePoints))
|
||||
GetTarget()->CastSpell(GetTarget(), spell->Id, true);
|
||||
|
||||
Remove();
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectPeriodic += AuraEffectPeriodicFn(spell_obsidius_transformation_scale::HandlePeriodic, EFFECT_2, SPELL_AURA_PERIODIC_DUMMY);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_obsidius_crepuscular_veil : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_obsidius_crepuscular_veil);
|
||||
|
||||
void HandleAchievement()
|
||||
{
|
||||
Unit* target = GetHitUnit();
|
||||
if (!target)
|
||||
return;
|
||||
|
||||
Aura* aura = target->GetAura(GetSpellInfo()->Id);
|
||||
if (!aura)
|
||||
return;
|
||||
|
||||
if (aura->GetStackAmount() == GetSpellInfo()->StackAmount)
|
||||
{
|
||||
InstanceScript* instance = target->GetInstanceScript();
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (Creature* obsidius = instance->GetCreature(DATA_ASCENDANT_LORD_OBSIDIUS))
|
||||
obsidius->AI()->SetData(DATA_ASCENDANT_DESCENDING, FAIL);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterHit += SpellHitFn(spell_obsidius_crepuscular_veil::HandleAchievement);
|
||||
}
|
||||
};
|
||||
|
||||
class achievement_ascendant_descending : public AchievementCriteriaScript
|
||||
{
|
||||
public:
|
||||
boss_ascendant_lord_obsidius(): CreatureScript("boss_ascendant_lord_obsidius") { }
|
||||
achievement_ascendant_descending() : AchievementCriteriaScript("achievement_ascendant_descending") { }
|
||||
|
||||
struct boss_ascendant_lord_obsidiusAI : public BossAI
|
||||
bool OnCheck(Player* /*source*/, Unit* target) override
|
||||
{
|
||||
boss_ascendant_lord_obsidiusAI(Creature* creature) : BossAI(creature, DATA_ASCENDANT_LORD_OBSIDIUS) { }
|
||||
if (!target)
|
||||
return false;
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
_Reset();
|
||||
}
|
||||
if (target->IsAIEnabled)
|
||||
return target->GetAI()->GetData(DATA_ASCENDANT_DESCENDING);
|
||||
|
||||
void JustEngagedWith(Unit* /*who*/) override
|
||||
{
|
||||
_JustEngagedWith();
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, 30000);
|
||||
Talk(YELL_AGGRO);
|
||||
}
|
||||
|
||||
void KilledUnit(Unit* who) override
|
||||
{
|
||||
if (who->GetTypeId() == TYPEID_PLAYER)
|
||||
Talk(YELL_KILL);
|
||||
}
|
||||
|
||||
void JustDied(Unit* /*killer*/) override
|
||||
{
|
||||
_JustDied();
|
||||
Talk(YELL_DEATH);
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
if (me->HasUnitState(UNIT_STATE_CASTING))
|
||||
return;
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_MANA_TAP:
|
||||
DoCastVictim(SPELL_MANA_TAP, true);
|
||||
events.ScheduleEvent(EVENT_MANA_TAP, urand(14000, 22000));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
};
|
||||
|
||||
CreatureAI* GetAI(Creature* creature) const override
|
||||
{
|
||||
return GetBlackrockCavernsAI<boss_ascendant_lord_obsidiusAI>(creature);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
void AddSC_boss_ascendant_lord_obsidius()
|
||||
{
|
||||
new boss_ascendant_lord_obsidius();
|
||||
RegisterBlackrockCavernsCreatureAI(boss_ascendant_lord_obsidius);
|
||||
RegisterAuraScript(spell_obsidius_twitchy);
|
||||
RegisterSpellScript(spell_obsidius_transformation);
|
||||
RegisterAuraScript(spell_obsidius_transformation_not_selectable);
|
||||
RegisterAuraScript(spell_obsidius_transformation_scale);
|
||||
RegisterSpellScript(spell_obsidius_crepuscular_veil);
|
||||
new achievement_ascendant_descending();
|
||||
}
|
||||
+6
-2
@@ -25,6 +25,7 @@ ObjectData const creatureData[] =
|
||||
{ BOSS_CORLA_HERALD_OF_TWILIGHT, DATA_CORLA_HERALD_OF_TWILIGHT },
|
||||
{ BOSS_KARSH_STEELBENDER, DATA_KARSH_STEELBENDER },
|
||||
{ BOSS_BEAUTY, DATA_BEAUTY },
|
||||
{ BOSS_ASCENDANT_LORD_OBSIDIUS, DATA_ASCENDANT_LORD_OBSIDIUS },
|
||||
{ NPC_RAZ_THE_CRAZED, DATA_RAZ_THE_CRAZED },
|
||||
{ NPC_LUCKY, DATA_LUCKY },
|
||||
{ NPC_SPOT, DATA_SPOT },
|
||||
@@ -111,15 +112,18 @@ class instance_blackrock_caverns : public InstanceMapScript
|
||||
switch (data)
|
||||
{
|
||||
case RAZ_AREA_INDEX_ROMOGG:
|
||||
if (!GetCreature(DATA_RAZ_THE_CRAZED))
|
||||
instance->SummonCreature(NPC_RAZ_THE_CRAZED, RazTheCrazedSummonPositions[RAZ_AREA_INDEX_ROMOGG]);
|
||||
instance->SummonCreature(NPC_RAZ_THE_CRAZED, RazTheCrazedSummonPositions[RAZ_AREA_INDEX_ROMOGG]);
|
||||
break;
|
||||
case RAZ_AREA_INDEX_CORLA:
|
||||
instance->SummonCreature(NPC_RAZ_THE_CRAZED, RazTheCrazedSummonPositions[RAZ_AREA_INDEX_CORLA]);
|
||||
break;
|
||||
case RAZ_AREA_INDEX_OBSIDIUS:
|
||||
instance->SummonCreature(NPC_RAZ_THE_CRAZED, RazTheCrazedSummonPositions[RAZ_AREA_INDEX_OBSIDIUS]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
SaveToDB();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user