Scripts: dropped unused scripts from Halls of Origination and fixed remaining startup errors
This commit is contained in:
1 parent
5cb84cc9c1
commit
ee41e6260d
3 files changed
+45
-262
No files matched your search
@@ -29,32 +29,6 @@
|
||||
#include "Transport.h"
|
||||
#include "halls_of_origination.h"
|
||||
|
||||
enum Spells
|
||||
{
|
||||
SPELL_SUBMERGE = 76084,
|
||||
|
||||
// Isiset trash and adds
|
||||
SPELL_ARCANE_ENERGY = 74881,
|
||||
SPELL_ARCANE_BURST = 74888, // On retail not working! Should probably be cast at full energy.
|
||||
SPELL_SPAWN_ENERGY_FLUX_TRASH = 82382, // Makes random player cast Summon Energy Flux (82385)
|
||||
SPELL_SPAWN_ENERGY_FLUX_ISISET = 90735, // Makes random player cast Summon Energy Flux (90739)
|
||||
SPELL_ENERGY_FLUX_PERIODIC = 74044,
|
||||
SPELL_ENERGY_FLUX_BEAM_TRASH = 82377, // Makes nearby Spatial Flux cast visual beam
|
||||
SPELL_ENERGY_FLUX_BEAM_ISISET = 90741, // Makes nearby Spatial Flux cast visual beam
|
||||
|
||||
SPELL_DUMMY_NUKE = 68991
|
||||
};
|
||||
|
||||
enum Events
|
||||
{
|
||||
// Spatial Flux
|
||||
EVENT_SPAWN_ENERGY_FLUX = 1,
|
||||
EVENT_DUMMY_NUKE,
|
||||
|
||||
// Energy Flux
|
||||
EVENT_FOLLOW_SUMMONER,
|
||||
};
|
||||
|
||||
// The Maker's Lift
|
||||
enum ElevatorMisc
|
||||
{
|
||||
@@ -116,234 +90,6 @@ struct go_hoo_the_makers_lift_controller : public GameObjectAI
|
||||
}
|
||||
};
|
||||
|
||||
// 40790 Aggro Stalker
|
||||
struct npc_hoo_aggro_stalker : public PassiveAI
|
||||
{
|
||||
npc_hoo_aggro_stalker(Creature* creature) : PassiveAI(creature)
|
||||
{
|
||||
me->SearchFormation();
|
||||
}
|
||||
|
||||
void MoveInLineOfSight(Unit* who) override
|
||||
{
|
||||
if (who && who->GetTypeId() == TYPEID_PLAYER && me->IsWithinDistInMap(who, 30.f))
|
||||
if (CreatureGroup* formation = me->GetFormation())
|
||||
formation->MemberAttackStart(me, who);
|
||||
|
||||
me->CombatStop();
|
||||
}
|
||||
};
|
||||
|
||||
// 39612 - Spatial Flux (trash)
|
||||
// 48707 - Spatial Flux (Isiset)
|
||||
struct npc_hoo_spatial_flux : public ScriptedAI
|
||||
{
|
||||
npc_hoo_spatial_flux(Creature* creature) : ScriptedAI(creature) { }
|
||||
|
||||
void Reset() override
|
||||
{
|
||||
events.Reset();
|
||||
events.ScheduleEvent(EVENT_DUMMY_NUKE, Seconds(0));
|
||||
events.ScheduleEvent(EVENT_SPAWN_ENERGY_FLUX, Seconds(3));
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* summoner) override
|
||||
{
|
||||
if (summoner->GetEntry() == BOSS_ISISET)
|
||||
me->SetInCombatWithZone();
|
||||
}
|
||||
|
||||
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_SPAWN_ENERGY_FLUX:
|
||||
DoCastSelf(me->GetEntry() == NPC_SPATIAL_FLUX_TRASH ? SPELL_SPAWN_ENERGY_FLUX_TRASH : SPELL_SPAWN_ENERGY_FLUX_ISISET);
|
||||
events.Repeat(Seconds(12));
|
||||
break;
|
||||
case EVENT_DUMMY_NUKE:
|
||||
if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200.0f, true))
|
||||
DoCast(target, SPELL_DUMMY_NUKE);
|
||||
events.Repeat(Seconds(1));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
// 44015 - Energy flux (trash)
|
||||
// 48709 - Energy flux (Isiset)
|
||||
struct npc_hoo_energy_flux : public ScriptedAI
|
||||
{
|
||||
npc_hoo_energy_flux(Creature* creature) : ScriptedAI(creature)
|
||||
{
|
||||
me->SetReactState(REACT_PASSIVE);
|
||||
DoCastSelf(SPELL_ENERGY_FLUX_PERIODIC);
|
||||
DoCastSelf(me->GetEntry() == NPC_ENERGY_FLUX_TRASH ? SPELL_ENERGY_FLUX_BEAM_TRASH : SPELL_ENERGY_FLUX_BEAM_ISISET);
|
||||
}
|
||||
|
||||
void IsSummonedBy(Unit* /*summoner*/) override
|
||||
{
|
||||
me->SetWalk(true);
|
||||
events.ScheduleEvent(EVENT_FOLLOW_SUMMONER, Seconds(1));
|
||||
me->DespawnOrUnsummon(Seconds(6));
|
||||
}
|
||||
|
||||
void UpdateAI(uint32 diff) override
|
||||
{
|
||||
if (events.Empty())
|
||||
return;
|
||||
|
||||
events.Update(diff);
|
||||
|
||||
while (uint32 eventId = events.ExecuteEvent())
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EVENT_FOLLOW_SUMMONER:
|
||||
if (Unit* target = ObjectAccessor::GetUnit(*me, me->GetCreatorGUID()))
|
||||
me->GetMotionMaster()->MovePoint(0, target->GetPosition(), true);
|
||||
events.Repeat(Seconds(1));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
EventMap events;
|
||||
};
|
||||
|
||||
// 75764 - Emerge
|
||||
class spell_hoo_emerge : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hoo_emerge);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo({ SPELL_SUBMERGE });
|
||||
}
|
||||
|
||||
void RemoveSubmergeAura(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetHitUnit()->RemoveAurasDueToSpell(SPELL_SUBMERGE);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_hoo_emerge::RemoveSubmergeAura, EFFECT_0, SPELL_EFFECT_APPLY_AURA);
|
||||
}
|
||||
};
|
||||
|
||||
// 82382 - Energy Flux (cast by trash Spatial Flux)
|
||||
// 90735 - Energy Flux (cast by Isiset's Spatial Flux)
|
||||
class spell_hoo_energy_flux_target_selector : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hoo_energy_flux_target_selector);
|
||||
|
||||
void FilterTargets(std::list<WorldObject*>& targets)
|
||||
{
|
||||
// Remove tank
|
||||
if (InstanceScript* instance = GetCaster()->GetInstanceScript())
|
||||
if (Creature* Isiset = instance->GetCreature(DATA_ISISET))
|
||||
if (WorldObject* tank = Isiset->AI()->SelectTarget(SELECT_TARGET_TOPAGGRO))
|
||||
targets.remove(tank);
|
||||
|
||||
targets.remove_if(Trinity::ObjectTypeIdCheck(TYPEID_PLAYER, false));
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
WorldObject* target = Trinity::Containers::SelectRandomContainerElement(targets);
|
||||
targets.clear();
|
||||
targets.push_back(target);
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnObjectAreaTargetSelect += SpellObjectAreaTargetSelectFn(spell_hoo_energy_flux_target_selector::FilterTargets, EFFECT_0, TARGET_UNIT_SRC_AREA_ENEMY);
|
||||
}
|
||||
};
|
||||
|
||||
// 74880 - Arcane Energy
|
||||
class spell_hoo_arcane_energy_check : public AuraScript
|
||||
{
|
||||
PrepareAuraScript(spell_hoo_arcane_energy_check);
|
||||
|
||||
bool Validate(SpellInfo const* /*spellInfo*/) override
|
||||
{
|
||||
return ValidateSpellInfo(
|
||||
{
|
||||
SPELL_ARCANE_BURST,
|
||||
SPELL_ARCANE_ENERGY
|
||||
});
|
||||
}
|
||||
|
||||
void AfterProc(AuraEffect const* /*aurEff*/, ProcEventInfo& /*eventInfo*/)
|
||||
{
|
||||
if (GetTarget()->GetPower(POWER_ENERGY) == 100)
|
||||
{
|
||||
GetTarget()->CastSpell((Unit*)nullptr, SPELL_ARCANE_BURST);
|
||||
|
||||
// Stacks should probably be consumed, right? (note: this ability doesn't work on retail)
|
||||
GetTarget()->RemoveAurasDueToSpell(SPELL_ARCANE_ENERGY);
|
||||
GetTarget()->SetPower(POWER_ENERGY, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
AfterEffectProc += AuraEffectProcFn(spell_hoo_arcane_energy_check::AfterProc, EFFECT_0, SPELL_AURA_PROC_TRIGGER_SPELL);
|
||||
}
|
||||
};
|
||||
|
||||
// 73686 Fixate
|
||||
class spell_hoo_fixate : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hoo_fixate);
|
||||
|
||||
bool Validate(SpellInfo const* spellInfo) override
|
||||
{
|
||||
return ValidateSpellInfo({ uint32(spellInfo->Effects[EFFECT_0].BasePoints) });
|
||||
}
|
||||
|
||||
void HandleScriptEffect(SpellEffIndex /*effIndex*/)
|
||||
{
|
||||
GetHitUnit()->CastSpell(GetCaster(), uint32(GetEffectValue()));
|
||||
}
|
||||
|
||||
void Register() override
|
||||
{
|
||||
OnEffectHitTarget += SpellEffectFn(spell_hoo_fixate::HandleScriptEffect, EFFECT_0, SPELL_EFFECT_SCRIPT_EFFECT);
|
||||
}
|
||||
};
|
||||
|
||||
class SunTouchedServantCheck
|
||||
{
|
||||
public:
|
||||
SunTouchedServantCheck() { }
|
||||
|
||||
bool operator()(WorldObject* object)
|
||||
{
|
||||
return (object->GetEntry() != NPC_SUN_TOUCHED_SERVANT);
|
||||
}
|
||||
};
|
||||
|
||||
class spell_hoo_flame_ring_visual : public SpellScript
|
||||
{
|
||||
PrepareSpellScript(spell_hoo_flame_ring_visual);
|
||||
@@ -353,7 +99,11 @@ class spell_hoo_flame_ring_visual : public SpellScript
|
||||
if (targets.empty())
|
||||
return;
|
||||
|
||||
targets.remove_if(SunTouchedServantCheck());
|
||||
targets.remove_if([](WorldObject const* target)->bool
|
||||
{
|
||||
Unit const* unit = target->ToUnit();
|
||||
return !unit || unit->GetEntry() != NPC_SUN_TOUCHED_SERVANT;
|
||||
});
|
||||
|
||||
if (targets.empty())
|
||||
return;
|
||||
@@ -377,12 +127,5 @@ class spell_hoo_flame_ring_visual : public SpellScript
|
||||
void AddSC_halls_of_origination()
|
||||
{
|
||||
RegisterGameObjectAI(go_hoo_the_makers_lift_controller);
|
||||
RegisterHallsOfOriginationCreatureAI(npc_hoo_aggro_stalker);
|
||||
RegisterHallsOfOriginationCreatureAI(npc_hoo_spatial_flux);
|
||||
RegisterHallsOfOriginationCreatureAI(npc_hoo_energy_flux);
|
||||
RegisterSpellScript(spell_hoo_emerge);
|
||||
RegisterSpellScript(spell_hoo_energy_flux_target_selector);
|
||||
RegisterAuraScript(spell_hoo_arcane_energy_check);
|
||||
RegisterSpellScript(spell_hoo_fixate);
|
||||
RegisterSpellScript(spell_hoo_flame_ring_visual);
|
||||
}
|
||||
Reference in new issue
Block a user