Removed all instance scripts so we can have script project back and spells will work again.
This commit is contained in:
@@ -1,204 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
namespace Scripts.EasternKingdoms.Deadmines
|
||||
{
|
||||
/*class instance_deadmines : InstanceMapScript
|
||||
{
|
||||
public instance_deadmines() : base("instance_deadmines", 36)
|
||||
{
|
||||
}
|
||||
|
||||
class instance_deadmines_InstanceMapScript : InstanceScript
|
||||
{
|
||||
public instance_deadmines_InstanceMapScript(Map map) : base(map)
|
||||
{
|
||||
SetHeaders(DataHeader);
|
||||
|
||||
State = CANNON_NOT_USED;
|
||||
CannonBlast_Timer = 0;
|
||||
PiratesDelay_Timer = 0;
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Update(uint diff)
|
||||
{
|
||||
if (IronCladDoorGUID.IsEmpty() || DefiasCannonGUID.IsEmpty() || DoorLeverGUID.IsEmpty())
|
||||
return;
|
||||
|
||||
GameObject pIronCladDoor = instance.GetGameObject(IronCladDoorGUID);
|
||||
if (!pIronCladDoor)
|
||||
return;
|
||||
|
||||
switch (State)
|
||||
{
|
||||
case CANNON_GUNPOWDER_USED:
|
||||
CannonBlast_Timer = DATA_CANNON_BLAST_TIMER;
|
||||
// it's a hack - Mr. Smite should do that but his too far away
|
||||
//pIronCladDoor.SetName("Mr. Smite");
|
||||
//pIronCladDoor.MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, NULL);
|
||||
pIronCladDoor.PlayDirectSound(SOUND_MR_SMITE_ALARM1);
|
||||
State = CANNON_BLAST_INITIATED;
|
||||
break;
|
||||
case CANNON_BLAST_INITIATED:
|
||||
PiratesDelay_Timer = DATA_PIRATES_DELAY_TIMER;
|
||||
if (CannonBlast_Timer <= diff)
|
||||
{
|
||||
SummonCreatures();
|
||||
GameObject pDefiasCannon = instance.GetGameObject(DefiasCannonGUID);
|
||||
if (pDefiasCannon)
|
||||
{
|
||||
pDefiasCannon.SetGoState(GO_STATE_ACTIVE);
|
||||
pDefiasCannon.PlayDirectSound(SOUND_CANNONFIRE);
|
||||
}
|
||||
pIronCladDoor.SetGoState(GO_STATE_ACTIVE_ALTERNATIVE);
|
||||
pIronCladDoor.PlayDirectSound(SOUND_DESTROYDOOR);
|
||||
GameObject pDoorLever = instance.GetGameObject(DoorLeverGUID);
|
||||
if (pDoorLever)
|
||||
pDoorLever.SetUInt32Value(GAMEOBJECT_FLAGS, 4);
|
||||
//pIronCladDoor.MonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, NULL);
|
||||
pIronCladDoor.PlayDirectSound(SOUND_MR_SMITE_ALARM2);
|
||||
State = PIRATES_ATTACK;
|
||||
}
|
||||
else CannonBlast_Timer -= diff;
|
||||
break;
|
||||
case PIRATES_ATTACK:
|
||||
if (PiratesDelay_Timer <= diff)
|
||||
{
|
||||
MoveCreaturesInside();
|
||||
State = EVENT_DONE;
|
||||
}
|
||||
else PiratesDelay_Timer -= diff;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void SummonCreatures()
|
||||
{
|
||||
GameObject pIronCladDoor = instance.GetGameObject(IronCladDoorGUID);
|
||||
if (pIronCladDoor)
|
||||
{
|
||||
Creature DefiasPirate1 = pIronCladDoor.SummonCreature(657, pIronCladDoor.GetPositionX() - 2, pIronCladDoor.GetPositionY() - 7, pIronCladDoor.GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
|
||||
Creature DefiasPirate2 = pIronCladDoor.SummonCreature(657, pIronCladDoor.GetPositionX() + 3, pIronCladDoor.GetPositionY() - 6, pIronCladDoor.GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
|
||||
Creature DefiasCompanion = pIronCladDoor.SummonCreature(3450, pIronCladDoor.GetPositionX() + 2, pIronCladDoor.GetPositionY() - 6, pIronCladDoor.GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000);
|
||||
|
||||
DefiasPirate1GUID = DefiasPirate1.GetGUID();
|
||||
DefiasPirate2GUID = DefiasPirate2.GetGUID();
|
||||
DefiasCompanionGUID = DefiasCompanion.GetGUID();
|
||||
}
|
||||
}
|
||||
|
||||
void MoveCreaturesInside()
|
||||
{
|
||||
if (DefiasPirate1GUID.IsEmpty() || DefiasPirate2GUID.IsEmpty() || DefiasCompanionGUID.IsEmpty())
|
||||
return;
|
||||
|
||||
Creature pDefiasPirate1 = instance.GetCreature(DefiasPirate1GUID);
|
||||
Creature pDefiasPirate2 = instance.GetCreature(DefiasPirate2GUID);
|
||||
Creature pDefiasCompanion = instance.GetCreature(DefiasCompanionGUID);
|
||||
if (!pDefiasPirate1 || !pDefiasPirate2 || !pDefiasCompanion)
|
||||
return;
|
||||
|
||||
MoveCreatureInside(pDefiasPirate1);
|
||||
MoveCreatureInside(pDefiasPirate2);
|
||||
MoveCreatureInside(pDefiasCompanion);
|
||||
}
|
||||
|
||||
void MoveCreatureInside(Creature creature)
|
||||
{
|
||||
creature.SetWalk(false);
|
||||
creature.GetMotionMaster().MovePoint(0, -102.7f, -655.9f, creature.GetPositionZ());
|
||||
}
|
||||
|
||||
public override void OnGameObjectCreate(GameObject go)
|
||||
{
|
||||
switch (go.GetEntry())
|
||||
{
|
||||
case GO_FACTORY_DOOR: FactoryDoorGUID = go.GetGUID(); break;
|
||||
case GO_IRONCLAD_DOOR: IronCladDoorGUID = go.GetGUID(); break;
|
||||
case GO_DEFIAS_CANNON: DefiasCannonGUID = go.GetGUID(); break;
|
||||
case GO_DOOR_LEVER: DoorLeverGUID = go.GetGUID(); break;
|
||||
case GO_MR_SMITE_CHEST: uiSmiteChestGUID = go.GetGUID(); break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetData(uint type, uint data)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case EVENT_STATE:
|
||||
if (!DefiasCannonGUID.IsEmpty() && !IronCladDoorGUID.IsEmpty())
|
||||
State = data;
|
||||
break;
|
||||
case EVENT_RHAHKZOR:
|
||||
if (data == DONE)
|
||||
{
|
||||
GameObject go = instance.GetGameObject(FactoryDoorGUID);
|
||||
if (go)
|
||||
go.SetGoState(GO_STATE_ACTIVE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override uint GetData(uint type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case EVENT_STATE:
|
||||
return State;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override ObjectGuid GetGuidData(uint data)
|
||||
{
|
||||
switch (data)
|
||||
{
|
||||
case DATA_SMITE_CHEST:
|
||||
return uiSmiteChestGUID;
|
||||
}
|
||||
|
||||
return ObjectGuid::Empty;
|
||||
}
|
||||
|
||||
ObjectGuid FactoryDoorGUID;
|
||||
ObjectGuid IronCladDoorGUID;
|
||||
ObjectGuid DefiasCannonGUID;
|
||||
ObjectGuid DoorLeverGUID;
|
||||
ObjectGuid DefiasPirate1GUID;
|
||||
ObjectGuid DefiasPirate2GUID;
|
||||
ObjectGuid DefiasCompanionGUID;
|
||||
|
||||
uint State;
|
||||
uint CannonBlast_Timer;
|
||||
uint PiratesDelay_Timer;
|
||||
ObjectGuid uiSmiteChestGUID;
|
||||
}
|
||||
|
||||
public override InstanceScript GetInstanceScript(InstanceMap map)
|
||||
{
|
||||
return new instance_deadmines_InstanceMapScript(map);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
@@ -1,373 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.EasternKingdoms.Karazhan.Midnight
|
||||
{
|
||||
struct Misc
|
||||
{
|
||||
public const uint MountedDisplayid = 16040;
|
||||
|
||||
//Attumen (@Todo Use The Summoning Spell Instead Of Creature Id. It Works; But Is Not Convenient For Us)
|
||||
public const uint SummonAttumen = 15550;
|
||||
}
|
||||
|
||||
struct TextIds
|
||||
{
|
||||
public const uint SayKill = 0;
|
||||
public const uint SayRandom = 1;
|
||||
public const uint SayDisarmed = 2;
|
||||
public const uint SayMidnightKill = 3;
|
||||
public const uint SayAppear = 4;
|
||||
public const uint SayMount = 5;
|
||||
|
||||
public const uint SayDeath = 3;
|
||||
|
||||
// Midnight
|
||||
public const uint EmoteCallAttumen = 0;
|
||||
public const uint EmoteMountUp = 1;
|
||||
}
|
||||
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint Shadowcleave = 29832;
|
||||
public const uint IntangiblePresence = 29833;
|
||||
public const uint SpawnSmoke = 10389;
|
||||
public const uint Charge = 29847;
|
||||
|
||||
// Midnight
|
||||
public const uint Knockdown = 29711;
|
||||
public const uint SummonAttumen = 29714;
|
||||
public const uint Mount = 29770;
|
||||
public const uint SummonAttumenMounted = 29799;
|
||||
}
|
||||
|
||||
enum Phases
|
||||
{
|
||||
None,
|
||||
AttumenEngages,
|
||||
Mounted
|
||||
}
|
||||
|
||||
[Script]
|
||||
public class boss_attumen : BossAI
|
||||
{
|
||||
public boss_attumen(Creature creature) : base(creature, DataTypes.Attumen)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_midnightGUID.Clear();
|
||||
_phase = Phases.None;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
base.Reset();
|
||||
}
|
||||
|
||||
public override void EnterEvadeMode(EvadeReason why)
|
||||
{
|
||||
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
|
||||
if (midnight != null)
|
||||
_DespawnAtEvade(10, midnight);
|
||||
|
||||
me.DespawnOrUnsummon();
|
||||
}
|
||||
|
||||
public override void ScheduleTasks()
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Shadowcleave);
|
||||
task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(45), task =>
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0);
|
||||
if (target != null)
|
||||
DoCast(target, SpellIds.IntangiblePresence);
|
||||
|
||||
task.Repeat(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(45));
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(60), task =>
|
||||
{
|
||||
Talk(TextIds.SayRandom);
|
||||
task.Repeat(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(60));
|
||||
});
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
// Attumen does not die until he mounts Midnight, let health fall to 1 and prevent further damage.
|
||||
if (damage >= me.GetHealth() && _phase != Phases.Mounted)
|
||||
damage = (uint)(me.GetHealth() - 1);
|
||||
|
||||
if (_phase == Phases.AttumenEngages && me.HealthBelowPctDamaged(25, damage))
|
||||
{
|
||||
_phase = Phases.None;
|
||||
|
||||
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
|
||||
if (midnight != null)
|
||||
midnight.GetAI().DoCastAOE(SpellIds.Mount, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
Talk(TextIds.SayKill);
|
||||
}
|
||||
|
||||
public override void JustSummoned(Creature summon)
|
||||
{
|
||||
if (summon.GetEntry() == CreatureIds.AttumenMounted)
|
||||
{
|
||||
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
|
||||
if (midnight != null)
|
||||
{
|
||||
if (midnight.GetHealth() > me.GetHealth())
|
||||
summon.SetHealth(midnight.GetHealth());
|
||||
else
|
||||
summon.SetHealth(me.GetHealth());
|
||||
|
||||
summon.GetAI().DoZoneInCombat();
|
||||
summon.GetAI().SetGUID(_midnightGUID, (int)CreatureIds.Midnight);
|
||||
}
|
||||
}
|
||||
|
||||
base.JustSummoned(summon);
|
||||
}
|
||||
|
||||
public override void IsSummonedBy(Unit summoner)
|
||||
{
|
||||
if (summoner.GetEntry() == CreatureIds.Midnight)
|
||||
_phase = Phases.AttumenEngages;
|
||||
|
||||
if (summoner.GetEntry() == CreatureIds.AttumenUnmounted)
|
||||
{
|
||||
_phase = Phases.Mounted;
|
||||
DoCastSelf(SpellIds.SpawnSmoke);
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25), task =>
|
||||
{
|
||||
Unit target = null;
|
||||
var t_list = me.GetThreatManager().GetThreatList();
|
||||
List<Unit> target_list = new List<Unit>();
|
||||
|
||||
foreach (var itr in t_list)
|
||||
{
|
||||
target = Global.ObjAccessor.GetUnit(me, itr.GetUnitGuid());
|
||||
if (target && !target.IsWithinDist(me, 8.00f, false) && target.IsWithinDist(me, 25.0f, false))
|
||||
target_list.Add(target);
|
||||
|
||||
target = null;
|
||||
}
|
||||
|
||||
if (!target_list.Empty())
|
||||
target = target_list.SelectRandom();
|
||||
|
||||
DoCast(target, SpellIds.Charge);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(35), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Knockdown);
|
||||
task.Repeat(TimeSpan.FromSeconds(25), TimeSpan.FromSeconds(35));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(TextIds.SayDeath);
|
||||
Unit midnight = Global.ObjAccessor.GetUnit(me, _midnightGUID);
|
||||
if (midnight)
|
||||
midnight.KillSelf();
|
||||
|
||||
base.JustDied(killer);
|
||||
}
|
||||
|
||||
public override void SetGUID(ObjectGuid guid, int id = 0)
|
||||
{
|
||||
if (id == CreatureIds.Midnight)
|
||||
_midnightGUID = guid;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim() && _phase != Phases.None)
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
}
|
||||
|
||||
public override void SpellHit(Unit source, SpellInfo spell)
|
||||
{
|
||||
if (spell.Mechanic == Mechanics.Disarm)
|
||||
Talk(TextIds.SayDisarmed);
|
||||
|
||||
if (spell.Id == SpellIds.Mount)
|
||||
{
|
||||
Creature midnight = ObjectAccessor.GetCreature(me, _midnightGUID);
|
||||
if (midnight != null)
|
||||
{
|
||||
_phase = Phases.None;
|
||||
_scheduler.CancelAll();
|
||||
|
||||
midnight.AttackStop();
|
||||
midnight.RemoveAllAttackers();
|
||||
midnight.SetReactState(ReactStates.Passive);
|
||||
midnight.GetMotionMaster().MoveChase(me);
|
||||
midnight.GetAI().Talk(TextIds.EmoteMountUp);
|
||||
|
||||
me.AttackStop();
|
||||
me.RemoveAllAttackers();
|
||||
me.SetReactState(ReactStates.Passive);
|
||||
me.GetMotionMaster().MoveChase(midnight);
|
||||
Talk(TextIds.SayMount);
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(3), task =>
|
||||
{
|
||||
Creature midnight1 = ObjectAccessor.GetCreature(me, _midnightGUID);
|
||||
if (midnight1 != null)
|
||||
{
|
||||
if (me.IsWithinMeleeRange(midnight1))
|
||||
{
|
||||
DoCastAOE(SpellIds.SummonAttumenMounted);
|
||||
me.SetVisible(false);
|
||||
midnight1.SetVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
midnight1.GetMotionMaster().MoveChase(me);
|
||||
me.GetMotionMaster().MoveChase(midnight1);
|
||||
task.Repeat(TimeSpan.FromSeconds(3));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ObjectGuid _midnightGUID;
|
||||
Phases _phase;
|
||||
}
|
||||
|
||||
[Script]
|
||||
public class boss_midnight : BossAI
|
||||
{
|
||||
public boss_midnight(Creature creature) : base(creature, DataTypes.Attumen)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
_phase = Phases.None;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
base.Reset();
|
||||
me.SetVisible(true);
|
||||
me.SetReactState(ReactStates.Defensive);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
// Midnight never dies, let health fall to 1 and prevent further damage.
|
||||
if (damage >= me.GetHealth())
|
||||
damage = (uint)(me.GetHealth() - 1);
|
||||
|
||||
if (_phase == Phases.None && me.HealthBelowPctDamaged(95, damage))
|
||||
{
|
||||
_phase = Phases.AttumenEngages;
|
||||
Talk(TextIds.EmoteCallAttumen);
|
||||
DoCastAOE(SpellIds.SummonAttumen);
|
||||
}
|
||||
else if (_phase == Phases.AttumenEngages && me.HealthBelowPctDamaged(25, damage))
|
||||
{
|
||||
_phase = Phases.Mounted;
|
||||
DoCastAOE(SpellIds.Mount, true);
|
||||
}
|
||||
}
|
||||
|
||||
public override void JustSummoned(Creature summon)
|
||||
{
|
||||
if (summon.GetEntry() == CreatureIds.AttumenUnmounted)
|
||||
{
|
||||
_attumenGUID = summon.GetGUID();
|
||||
summon.GetAI().SetGUID(me.GetGUID(), (int)CreatureIds.Midnight);
|
||||
summon.GetAI().AttackStart(me.GetVictim());
|
||||
summon.GetAI().Talk(TextIds.SayAppear);
|
||||
}
|
||||
|
||||
base.JustSummoned(summon);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
base.EnterCombat(who);
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Knockdown);
|
||||
task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
}
|
||||
|
||||
public override void EnterEvadeMode(EvadeReason why = EvadeReason.Other)
|
||||
{
|
||||
base._DespawnAtEvade(10);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
if (_phase == Phases.AttumenEngages)
|
||||
{
|
||||
Unit unit = Global.ObjAccessor.GetUnit(me, _attumenGUID);
|
||||
if (unit != null)
|
||||
Talk(TextIds.SayMidnightKill, unit);
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim() || _phase == Phases.Mounted)
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff, DoMeleeAttackIfReady);
|
||||
}
|
||||
|
||||
ObjectGuid _attumenGUID;
|
||||
Phases _phase;
|
||||
}
|
||||
}
|
||||
@@ -1,169 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using System;
|
||||
|
||||
namespace Scripts.EasternKingdoms.Karazhan.Curator
|
||||
{
|
||||
struct TextIds
|
||||
{
|
||||
public const uint SayAggro = 0;
|
||||
public const uint SaySummon = 1;
|
||||
public const uint SayEvocate = 2;
|
||||
public const uint SayEnrage = 3;
|
||||
public const uint SayKill = 4;
|
||||
public const uint SayDeath = 5;
|
||||
}
|
||||
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint HatefulBolt = 30383;
|
||||
public const uint Evocation = 30254;
|
||||
public const uint ArcaneInfusion = 30403;
|
||||
public const uint Berserk = 26662;
|
||||
public const uint SummonAstralFlareNE = 30236;
|
||||
public const uint SummonAstralFlareNW = 30239;
|
||||
public const uint SummonAstralFlareSE = 30240;
|
||||
public const uint SummonAstralFlareSW = 30241;
|
||||
}
|
||||
|
||||
struct EventIds
|
||||
{
|
||||
public const uint HatefulBolt = 1;
|
||||
public const uint SummonAstralFlare = 2;
|
||||
public const uint ArcaneInfusion = 3;
|
||||
public const uint Berserk = 4;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_curator : BossAI
|
||||
{
|
||||
public boss_curator(Creature creature) : base(creature, DataTypes.Curator) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
_Reset();
|
||||
_infused = false;
|
||||
me.ApplySpellImmune(0, SpellImmunity.Damage, SpellSchoolMask.Arcane, true);
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
if (victim.GetTypeId() == TypeId.Player)
|
||||
Talk(TextIds.SayKill);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
_JustDied();
|
||||
Talk(TextIds.SayDeath);
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit victim)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(TextIds.SayAggro);
|
||||
|
||||
_events.ScheduleEvent(EventIds.HatefulBolt, TimeSpan.FromSeconds(12));
|
||||
_events.ScheduleEvent(EventIds.SummonAstralFlare, TimeSpan.FromSeconds(10));
|
||||
_events.ScheduleEvent(EventIds.Berserk, TimeSpan.FromMinutes(12));
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (!HealthAbovePct(15) && !_infused)
|
||||
{
|
||||
_infused = true;
|
||||
_events.ScheduleEvent(EventIds.ArcaneInfusion, TimeSpan.FromMilliseconds(1));
|
||||
_events.CancelEvent(EventIds.SummonAstralFlare);
|
||||
}
|
||||
}
|
||||
|
||||
public override void ExecuteEvent(uint eventId)
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case EventIds.HatefulBolt:
|
||||
Unit target = SelectTarget(SelectAggroTarget.MaxThreat, 1);
|
||||
if (target != null)
|
||||
DoCast(target, SpellIds.HatefulBolt);
|
||||
_events.Repeat(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(15));
|
||||
break;
|
||||
case EventIds.ArcaneInfusion:
|
||||
DoCastSelf(SpellIds.ArcaneInfusion, true);
|
||||
break;
|
||||
case EventIds.SummonAstralFlare:
|
||||
if (RandomHelper.randChance(50))
|
||||
Talk(TextIds.SaySummon);
|
||||
|
||||
|
||||
DoCastSelf(RandomHelper.RAND(SpellIds.SummonAstralFlareNE, SpellIds.SummonAstralFlareNW, SpellIds.SummonAstralFlareSE, SpellIds.SummonAstralFlareSW), true);
|
||||
|
||||
int mana = me.GetMaxPower(PowerType.Mana) / 10;
|
||||
if (mana != 0)
|
||||
{
|
||||
me.ModifyPower(PowerType.Mana, -mana);
|
||||
|
||||
if (me.GetPower(PowerType.Mana) * 100 / me.GetMaxPower(PowerType.Mana) < 10)
|
||||
{
|
||||
Talk(TextIds.SayEvocate);
|
||||
me.InterruptNonMeleeSpells(false);
|
||||
DoCastSelf(SpellIds.Evocation);
|
||||
}
|
||||
}
|
||||
_events.Repeat(TimeSpan.FromSeconds(10));
|
||||
break;
|
||||
case EventIds.Berserk:
|
||||
Talk(TextIds.SayEnrage);
|
||||
DoCastSelf(SpellIds.Berserk, true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bool _infused;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_curator_astral_flareAI : ScriptedAI
|
||||
{
|
||||
public npc_curator_astral_flareAI(Creature creature) : base(creature)
|
||||
{
|
||||
me.SetReactState(ReactStates.Passive);
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
|
||||
{
|
||||
me.SetReactState(ReactStates.Aggressive);
|
||||
me.RemoveUnitFlag(UnitFlags.NotSelectable);
|
||||
DoZoneInCombat();
|
||||
});
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,477 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Scripting;
|
||||
|
||||
namespace Scripts.EasternKingdoms.Karazhan
|
||||
{
|
||||
struct karazhanConst
|
||||
{
|
||||
public const uint MaxEncounter = 12;
|
||||
|
||||
public static Dialogue[] OzDialogue =
|
||||
{
|
||||
new Dialogue(0, 6000),
|
||||
new Dialogue(1, 18000),
|
||||
new Dialogue(2, 9000),
|
||||
new Dialogue(3, 15000)
|
||||
};
|
||||
|
||||
public static Dialogue[] HoodDialogue =
|
||||
{
|
||||
new Dialogue(4, 6000),
|
||||
new Dialogue(5, 10000),
|
||||
new Dialogue(6, 14000),
|
||||
new Dialogue(7, 15000)
|
||||
};
|
||||
|
||||
public static Dialogue[] RAJDialogue =
|
||||
{
|
||||
new Dialogue(8, 5000),
|
||||
new Dialogue(9, 7000),
|
||||
new Dialogue(10, 14000),
|
||||
new Dialogue(11, 14000)
|
||||
};
|
||||
|
||||
// Entries and spawn locations for creatures in Oz event
|
||||
public static float[][] Spawns =
|
||||
{
|
||||
new float[] { 17535, -10896}, // Dorothee
|
||||
new float[] { 17546, -10891}, // Roar
|
||||
new float[] { 17547, -10884}, // Tinhead
|
||||
new float[] { 17543, -10902}, // Strawman
|
||||
new float[] { 17603, -10892}, // Grandmother
|
||||
new float[] { 17534, -10900}, // Julianne
|
||||
};
|
||||
|
||||
public static float SPAWN_Z = 90.5f;
|
||||
public static float SPAWN_Y = -1758f;
|
||||
public static float SPAWN_O = 4.738f;
|
||||
|
||||
public static string SAY_READY = "Splendid, I'm going to get the audience ready. Break a leg!";
|
||||
public static string SAY_OZ_INTRO1 = "Finally, everything is in place. Are you ready for your big stage debut?";
|
||||
public static string OZ_GOSSIP1 = "I'm not an actor.";
|
||||
public static string SAY_OZ_INTRO2 = "Don't worry, you'll be fine. You look like a natural!";
|
||||
public static string OZ_GOSSIP2 = "Ok, I'll give it a try, then.";
|
||||
|
||||
public static string SAY_RAJ_INTRO1 = "The romantic plays are really tough, but you'll do better this time. You have TALENT. Ready?";
|
||||
public static string RAJ_GOSSIP1 = "I've never been more ready.";
|
||||
|
||||
public static string OZ_GM_GOSSIP1 = "[GM] Change event to EVENT_OZ";
|
||||
public static string OZ_GM_GOSSIP2 = "[GM] Change event to EVENT_HOOD";
|
||||
public static string OZ_GM_GOSSIP3 = "[GM] Change event to EVENT_RAJ";
|
||||
|
||||
// Barnes
|
||||
public const uint SpellSpotlight = 25824;
|
||||
public const uint SpellTuxedo = 32616;
|
||||
|
||||
// Berthold
|
||||
public const uint SpellTeleport = 39567;
|
||||
|
||||
// Image of Medivh
|
||||
public const uint SpellFireBall = 30967;
|
||||
public const uint SpellUberFireball = 30971;
|
||||
public const uint SpellConflagrationBlast = 30977;
|
||||
public const uint SpellManaShield = 31635;
|
||||
|
||||
public const uint NpcArcanagos = 17652;
|
||||
public const uint NpcSpotlight = 19525;
|
||||
|
||||
public static Position[] OptionalSpawn =
|
||||
{
|
||||
new Position(-10960.981445f, -1940.138428f, 46.178097f, 4.12f), // Hyakiss the Lurker
|
||||
new Position(-10945.769531f, -2040.153320f, 49.474438f, 0.077f), // Shadikith the Glider
|
||||
new Position(-10899.903320f, -2085.573730f, 49.474449f, 1.38f) // Rokad the Ravager
|
||||
};
|
||||
|
||||
public const uint OptionalBossRequiredDeathCount = 50;
|
||||
}
|
||||
|
||||
struct Dialogue
|
||||
{
|
||||
public Dialogue(int textid, uint timer)
|
||||
{
|
||||
TextId = textid;
|
||||
Timer = timer;
|
||||
}
|
||||
|
||||
public int TextId;
|
||||
public uint Timer;
|
||||
}
|
||||
|
||||
struct DataTypes
|
||||
{
|
||||
public const uint Attumen = 1;
|
||||
public const uint Moroes = 2;
|
||||
public const uint MaidenOfVirtue = 3;
|
||||
public const uint OptionalBoss = 4;
|
||||
public const uint OperaPerformance = 5;
|
||||
public const uint Curator = 6;
|
||||
public const uint Aran = 7;
|
||||
public const uint Terestian = 8;
|
||||
public const uint Netherspite = 9;
|
||||
public const uint Chess = 10;
|
||||
public const uint Malchezzar = 11;
|
||||
public const uint Nightbane = 12;
|
||||
|
||||
public const uint OperaOzDeathcount = 14;
|
||||
|
||||
public const uint Kilrek = 15;
|
||||
public const uint GoCurtains = 18;
|
||||
public const uint GoStagedoorleft = 19;
|
||||
public const uint GoStagedoorright = 20;
|
||||
public const uint GoLibraryDoor = 21;
|
||||
public const uint GoMassiveDoor = 22;
|
||||
public const uint GoNetherDoor = 23;
|
||||
public const uint GoGameDoor = 24;
|
||||
public const uint GoGameExitDoor = 25;
|
||||
|
||||
public const uint ImageOfMedivh = 26;
|
||||
public const uint MastersTerraceDoor1 = 27;
|
||||
public const uint MastersTerraceDoor2 = 28;
|
||||
public const uint GoSideEntranceDoor = 29;
|
||||
public const uint GoBlackenedUrn = 30;
|
||||
}
|
||||
|
||||
struct OperaEvents
|
||||
{
|
||||
public const uint Oz = 1;
|
||||
public const uint Hood = 2;
|
||||
public const uint RAJ = 3;
|
||||
}
|
||||
|
||||
struct CreatureIds
|
||||
{
|
||||
public const uint HyakissTheLurker = 16179;
|
||||
public const uint RokadTheRavager = 16181;
|
||||
public const uint ShadikithTheGlider = 16180;
|
||||
public const uint TerestianIllhoof = 15688;
|
||||
public const uint Moroes = 15687;
|
||||
public const uint Nightbane = 17225;
|
||||
public const uint AttumenUnmounted = 15550;
|
||||
public const uint AttumenMounted = 16152;
|
||||
public const uint Midnight = 16151;
|
||||
|
||||
// Trash
|
||||
public const uint ColdmistWidow = 16171;
|
||||
public const uint ColdmistStalker = 16170;
|
||||
public const uint Shadowbat = 16173;
|
||||
public const uint VampiricShadowbat = 16175;
|
||||
public const uint GreaterShadowbat = 16174;
|
||||
public const uint PhaseHound = 16178;
|
||||
public const uint Dreadbeast = 16177;
|
||||
public const uint Shadowbeast = 16176;
|
||||
public const uint Kilrek = 17229;
|
||||
}
|
||||
|
||||
struct GameObjectIds
|
||||
{
|
||||
public const uint StageCurtain = 183932;
|
||||
public const uint StageDoorLeft = 184278;
|
||||
public const uint StageDoorRight = 184279;
|
||||
public const uint PrivateLibraryDoor = 184517;
|
||||
public const uint MassiveDoor = 185521;
|
||||
public const uint GamesmanHallDoor = 184276;
|
||||
public const uint GamesmanHallExitDoor = 184277;
|
||||
public const uint NetherspaceDoor = 185134;
|
||||
public const uint MastersTerraceDoor = 184274;
|
||||
public const uint MastersTerraceDoor2 = 184280;
|
||||
public const uint SideEntranceDoor = 184275;
|
||||
public const uint DustCoveredChest = 185119;
|
||||
public const uint BlackenedUrn = 194092;
|
||||
}
|
||||
|
||||
[Script]
|
||||
public class instance_karazhan : InstanceMapScript
|
||||
{
|
||||
public instance_karazhan() : base("instance_karazhan", 532) { }
|
||||
|
||||
public class instance_karazhan_InstanceMapScript : InstanceScript
|
||||
{
|
||||
public instance_karazhan_InstanceMapScript(InstanceMap map) : base(map)
|
||||
{
|
||||
SetHeaders("KZ");
|
||||
SetBossNumber(karazhanConst.MaxEncounter);
|
||||
|
||||
// 1 - OZ, 2 - HOOD, 3 - RAJ, this never gets altered.
|
||||
OperaEvent = RandomHelper.URand(1, 3);
|
||||
OzDeathCount = 0;
|
||||
OptionalBossCount = 0;
|
||||
}
|
||||
|
||||
public override void OnCreatureCreate(Creature creature)
|
||||
{
|
||||
switch (creature.GetEntry())
|
||||
{
|
||||
case CreatureIds.Kilrek:
|
||||
KilrekGUID = creature.GetGUID();
|
||||
break;
|
||||
case CreatureIds.TerestianIllhoof:
|
||||
TerestianGUID = creature.GetGUID();
|
||||
break;
|
||||
case CreatureIds.Moroes:
|
||||
MoroesGUID = creature.GetGUID();
|
||||
break;
|
||||
case CreatureIds.Nightbane:
|
||||
NightbaneGUID = creature.GetGUID();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnUnitDeath(Unit unit)
|
||||
{
|
||||
Creature creature = unit.ToCreature();
|
||||
if (creature == null)
|
||||
return;
|
||||
|
||||
switch (creature.GetEntry())
|
||||
{
|
||||
case CreatureIds.ColdmistWidow:
|
||||
case CreatureIds.ColdmistStalker:
|
||||
case CreatureIds.Shadowbat:
|
||||
case CreatureIds.VampiricShadowbat:
|
||||
case CreatureIds.GreaterShadowbat:
|
||||
case CreatureIds.PhaseHound:
|
||||
case CreatureIds.Dreadbeast:
|
||||
case CreatureIds.Shadowbeast:
|
||||
if (GetBossState(DataTypes.OptionalBoss) == EncounterState.ToBeDecided)
|
||||
{
|
||||
++OptionalBossCount;
|
||||
if (OptionalBossCount == karazhanConst.OptionalBossRequiredDeathCount)
|
||||
{
|
||||
switch (RandomHelper.URand(CreatureIds.HyakissTheLurker, CreatureIds.RokadTheRavager))
|
||||
{
|
||||
case CreatureIds.HyakissTheLurker:
|
||||
instance.SummonCreature(CreatureIds.HyakissTheLurker, karazhanConst.OptionalSpawn[0]);
|
||||
break;
|
||||
case CreatureIds.ShadikithTheGlider:
|
||||
instance.SummonCreature(CreatureIds.ShadikithTheGlider, karazhanConst.OptionalSpawn[1]);
|
||||
break;
|
||||
case CreatureIds.RokadTheRavager:
|
||||
instance.SummonCreature(CreatureIds.RokadTheRavager, karazhanConst.OptionalSpawn[2]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override void SetData(uint type, uint uiData)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case DataTypes.OperaOzDeathcount:
|
||||
if (uiData == (uint)EncounterState.Special)
|
||||
++OzDeathCount;
|
||||
else if (uiData == (uint)EncounterState.InProgress)
|
||||
OzDeathCount = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool SetBossState(uint id, EncounterState state)
|
||||
{
|
||||
if (!base.SetBossState(id, state))
|
||||
return false;
|
||||
|
||||
switch (id)
|
||||
{
|
||||
case DataTypes.OperaPerformance:
|
||||
if (state == EncounterState.Done)
|
||||
{
|
||||
HandleGameObject(StageDoorLeftGUID, true);
|
||||
HandleGameObject(StageDoorRightGUID, true);
|
||||
GameObject sideEntrance = instance.GetGameObject(SideEntranceDoor);
|
||||
if (sideEntrance != null)
|
||||
sideEntrance.RemoveFlag(GameObjectFlags.Locked);
|
||||
UpdateEncounterStateForKilledCreature(16812, null);
|
||||
}
|
||||
break;
|
||||
case DataTypes.Chess:
|
||||
if (state == EncounterState.Done)
|
||||
DoRespawnGameObject(DustCoveredChest, Time.Day);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void SetGuidData(uint identifier, ObjectGuid data)
|
||||
{
|
||||
if (identifier == DataTypes.ImageOfMedivh)
|
||||
ImageGUID = data;
|
||||
}
|
||||
|
||||
public override void OnGameObjectCreate(GameObject go)
|
||||
{
|
||||
switch (go.GetEntry())
|
||||
{
|
||||
case GameObjectIds.StageCurtain:
|
||||
CurtainGUID = go.GetGUID();
|
||||
break;
|
||||
case GameObjectIds.StageDoorLeft:
|
||||
StageDoorLeftGUID = go.GetGUID();
|
||||
if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
|
||||
go.SetGoState(GameObjectState.Active);
|
||||
break;
|
||||
case GameObjectIds.StageDoorRight:
|
||||
StageDoorRightGUID = go.GetGUID();
|
||||
if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
|
||||
go.SetGoState(GameObjectState.Active);
|
||||
break;
|
||||
case GameObjectIds.PrivateLibraryDoor:
|
||||
LibraryDoor = go.GetGUID();
|
||||
break;
|
||||
case GameObjectIds.MassiveDoor:
|
||||
MassiveDoor = go.GetGUID();
|
||||
break;
|
||||
case GameObjectIds.GamesmanHallDoor:
|
||||
GamesmansDoor = go.GetGUID();
|
||||
break;
|
||||
case GameObjectIds.GamesmanHallExitDoor:
|
||||
GamesmansExitDoor = go.GetGUID();
|
||||
break;
|
||||
case GameObjectIds.NetherspaceDoor:
|
||||
NetherspaceDoor = go.GetGUID();
|
||||
break;
|
||||
case GameObjectIds.MastersTerraceDoor:
|
||||
MastersTerraceDoor[0] = go.GetGUID();
|
||||
break;
|
||||
case GameObjectIds.MastersTerraceDoor2:
|
||||
MastersTerraceDoor[1] = go.GetGUID();
|
||||
break;
|
||||
case GameObjectIds.SideEntranceDoor:
|
||||
SideEntranceDoor = go.GetGUID();
|
||||
if (GetBossState(DataTypes.OperaPerformance) == EncounterState.Done)
|
||||
go.AddFlag(GameObjectFlags.Locked);
|
||||
else
|
||||
go.RemoveFlag(GameObjectFlags.Locked);
|
||||
break;
|
||||
case GameObjectIds.DustCoveredChest:
|
||||
DustCoveredChest = go.GetGUID();
|
||||
break;
|
||||
case GameObjectIds.BlackenedUrn:
|
||||
BlackenedUrnGUID = go.GetGUID();
|
||||
break;
|
||||
}
|
||||
|
||||
switch (OperaEvent)
|
||||
{
|
||||
// @todo Set Object visibilities for Opera based on performance
|
||||
case OperaEvents.Oz:
|
||||
break;
|
||||
|
||||
case OperaEvents.Hood:
|
||||
break;
|
||||
|
||||
case OperaEvents.RAJ:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public override uint GetData(uint uiData)
|
||||
{
|
||||
switch (uiData)
|
||||
{
|
||||
case DataTypes.OperaPerformance:
|
||||
return OperaEvent;
|
||||
case DataTypes.OperaOzDeathcount:
|
||||
return OzDeathCount;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override ObjectGuid GetGuidData(uint uiData)
|
||||
{
|
||||
switch (uiData)
|
||||
{
|
||||
case DataTypes.Kilrek:
|
||||
return KilrekGUID;
|
||||
case DataTypes.Terestian:
|
||||
return TerestianGUID;
|
||||
case DataTypes.Moroes:
|
||||
return MoroesGUID;
|
||||
case DataTypes.Nightbane:
|
||||
return NightbaneGUID;
|
||||
case DataTypes.GoStagedoorleft:
|
||||
return StageDoorLeftGUID;
|
||||
case DataTypes.GoStagedoorright:
|
||||
return StageDoorRightGUID;
|
||||
case DataTypes.GoCurtains:
|
||||
return CurtainGUID;
|
||||
case DataTypes.GoLibraryDoor:
|
||||
return LibraryDoor;
|
||||
case DataTypes.GoMassiveDoor:
|
||||
return MassiveDoor;
|
||||
case DataTypes.GoSideEntranceDoor:
|
||||
return SideEntranceDoor;
|
||||
case DataTypes.GoGameDoor:
|
||||
return GamesmansDoor;
|
||||
case DataTypes.GoGameExitDoor:
|
||||
return GamesmansExitDoor;
|
||||
case DataTypes.GoNetherDoor:
|
||||
return NetherspaceDoor;
|
||||
case DataTypes.MastersTerraceDoor1:
|
||||
return MastersTerraceDoor[0];
|
||||
case DataTypes.MastersTerraceDoor2:
|
||||
return MastersTerraceDoor[1];
|
||||
case DataTypes.ImageOfMedivh:
|
||||
return ImageGUID;
|
||||
case DataTypes.GoBlackenedUrn:
|
||||
return BlackenedUrnGUID;
|
||||
}
|
||||
|
||||
return ObjectGuid.Empty;
|
||||
}
|
||||
|
||||
uint OperaEvent;
|
||||
uint OzDeathCount;
|
||||
uint OptionalBossCount;
|
||||
ObjectGuid CurtainGUID;
|
||||
ObjectGuid StageDoorLeftGUID;
|
||||
ObjectGuid StageDoorRightGUID;
|
||||
ObjectGuid KilrekGUID;
|
||||
ObjectGuid TerestianGUID;
|
||||
ObjectGuid MoroesGUID;
|
||||
ObjectGuid NightbaneGUID;
|
||||
ObjectGuid LibraryDoor; // Door at Shade of Aran
|
||||
ObjectGuid MassiveDoor; // Door at Netherspite
|
||||
ObjectGuid SideEntranceDoor; // Side Entrance
|
||||
ObjectGuid GamesmansDoor; // Door before Chess
|
||||
ObjectGuid GamesmansExitDoor; // Door after Chess
|
||||
ObjectGuid NetherspaceDoor; // Door at Malchezaar
|
||||
ObjectGuid[] MastersTerraceDoor = new ObjectGuid[2];
|
||||
ObjectGuid ImageGUID;
|
||||
ObjectGuid DustCoveredChest;
|
||||
ObjectGuid BlackenedUrnGUID;
|
||||
}
|
||||
|
||||
public override InstanceScript GetInstanceScript(InstanceMap map)
|
||||
{
|
||||
return new instance_karazhan_InstanceMapScript(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,725 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2012-2020 CypherCore <http://github.com/CypherCore>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Scripting;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.EasternKingdoms.Karazhan.Moroes
|
||||
{
|
||||
struct Misc
|
||||
{
|
||||
public static Position[] Locations =
|
||||
{
|
||||
new Position(-10991.0f, -1884.33f, 81.73f, 0.614315f),
|
||||
new Position(-10989.4f, -1885.88f, 81.73f, 0.904913f),
|
||||
new Position(-10978.1f, -1887.07f, 81.73f, 2.035550f),
|
||||
new Position(-10975.9f, -1885.81f, 81.73f, 2.253890f),
|
||||
};
|
||||
|
||||
public static uint[] Adds =
|
||||
{
|
||||
17007,
|
||||
19872,
|
||||
19873,
|
||||
19874,
|
||||
19875,
|
||||
19876,
|
||||
};
|
||||
}
|
||||
|
||||
struct TextIds
|
||||
{
|
||||
public const uint Aggro = 0;
|
||||
public const uint Special = 1;
|
||||
public const uint Kill = 2;
|
||||
public const uint Death = 3;
|
||||
}
|
||||
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint Vanish = 29448;
|
||||
public const uint Garrote = 37066;
|
||||
public const uint Blind = 34694;
|
||||
public const uint Gouge = 29425;
|
||||
public const uint Frenzy = 37023;
|
||||
|
||||
// Adds
|
||||
public const uint Manaburn = 29405;
|
||||
public const uint Mindfly = 29570;
|
||||
public const uint Swpain = 34441;
|
||||
public const uint Shadowform = 29406;
|
||||
|
||||
public const uint Hammerofjustice = 13005;
|
||||
public const uint Judgementofcommand = 29386;
|
||||
public const uint Sealofcommand = 29385;
|
||||
|
||||
public const uint Dispelmagic = 15090;
|
||||
public const uint Greaterheal = 29564;
|
||||
public const uint Holyfire = 29563;
|
||||
public const uint Pwshield = 29408;
|
||||
|
||||
public const uint Cleanse = 29380;
|
||||
public const uint Greaterblessofmight = 29381;
|
||||
public const uint Holylight = 29562;
|
||||
public const uint Divineshield = 41367;
|
||||
|
||||
public const uint Hamstring = 9080;
|
||||
public const uint Mortalstrike = 29572;
|
||||
public const uint Whirlwind = 29573;
|
||||
|
||||
public const uint Disarm = 8379;
|
||||
public const uint Heroicstrike = 29567;
|
||||
public const uint Shieldbash = 11972;
|
||||
public const uint Shieldwall = 29390;
|
||||
}
|
||||
|
||||
[Script]
|
||||
public class boss_moroes : ScriptedAI
|
||||
{
|
||||
public boss_moroes(Creature creature) : base(creature)
|
||||
{
|
||||
instance = creature.GetInstanceScript();
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Vanish_Timer = 30000;
|
||||
Blind_Timer = 35000;
|
||||
Gouge_Timer = 23000;
|
||||
Wait_Timer = 0;
|
||||
CheckAdds_Timer = 5000;
|
||||
|
||||
Enrage = false;
|
||||
InVanish = false;
|
||||
if (me.IsAlive())
|
||||
SpawnAdds();
|
||||
|
||||
instance.SetBossState(DataTypes.Moroes, EncounterState.NotStarted);
|
||||
}
|
||||
|
||||
void StartEvent()
|
||||
{
|
||||
instance.SetBossState(DataTypes.Moroes, EncounterState.InProgress);
|
||||
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
StartEvent();
|
||||
|
||||
Talk(TextIds.Aggro);
|
||||
AddsAttack();
|
||||
DoZoneInCombat();
|
||||
}
|
||||
|
||||
public override void KilledUnit(Unit victim)
|
||||
{
|
||||
Talk(TextIds.Kill);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(TextIds.Death);
|
||||
|
||||
instance.SetBossState(DataTypes.Moroes, EncounterState.Done);
|
||||
|
||||
DeSpawnAdds();
|
||||
|
||||
//remove aura from spell Garrote when Moroes dies
|
||||
instance.DoRemoveAurasDueToSpellOnPlayers(SpellIds.Garrote);
|
||||
}
|
||||
|
||||
void SpawnAdds()
|
||||
{
|
||||
DeSpawnAdds();
|
||||
|
||||
if (isAddlistEmpty())
|
||||
{
|
||||
List<uint> AddList = new List<uint>();
|
||||
|
||||
for (byte i = 0; i < 6; ++i)
|
||||
AddList.Add(Misc.Adds[i]);
|
||||
|
||||
AddList.RandomResize(4);
|
||||
|
||||
byte c = 0;
|
||||
for (var i = 0; i != AddList.Count && c < 4; ++i, ++c)
|
||||
{
|
||||
uint entry = AddList[i];
|
||||
Creature creature = me.SummonCreature(entry, Misc.Locations[c], TempSummonType.CorpseTimedDespawn, 10000);
|
||||
if (creature)
|
||||
{
|
||||
AddGUID[c] = creature.GetGUID();
|
||||
AddId[c] = entry;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for (byte i = 0; i < 4; ++i)
|
||||
{
|
||||
Creature creature = me.SummonCreature(AddId[i], Misc.Locations[i], TempSummonType.CorpseTimedDespawn, 10000);
|
||||
if (creature)
|
||||
AddGUID[i] = creature.GetGUID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool isAddlistEmpty()
|
||||
{
|
||||
for (byte i = 0; i < 4; ++i)
|
||||
if (AddId[i] == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void DeSpawnAdds()
|
||||
{
|
||||
for (byte i = 0; i < 4; ++i)
|
||||
{
|
||||
if (!AddGUID[i].IsEmpty())
|
||||
{
|
||||
Creature temp = ObjectAccessor.GetCreature(me, AddGUID[i]);
|
||||
if (temp)
|
||||
temp.DespawnOrUnsummon();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AddsAttack()
|
||||
{
|
||||
for (byte i = 0; i < 4; ++i)
|
||||
{
|
||||
if (!AddGUID[i].IsEmpty())
|
||||
{
|
||||
Creature temp = ObjectAccessor.GetCreature((me), AddGUID[i]);
|
||||
if (temp && temp.IsAlive())
|
||||
{
|
||||
temp.GetAI().AttackStart(me.GetVictim());
|
||||
DoZoneInCombat(temp);
|
||||
}
|
||||
else
|
||||
EnterEvadeMode();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
if (instance.GetData(DataTypes.Moroes) == 0)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!Enrage && HealthBelowPct(30))
|
||||
{
|
||||
DoCast(me, SpellIds.Frenzy);
|
||||
Enrage = true;
|
||||
}
|
||||
|
||||
if (CheckAdds_Timer <= diff)
|
||||
{
|
||||
for (byte i = 0; i < 4; ++i)
|
||||
{
|
||||
if (!AddGUID[i].IsEmpty())
|
||||
{
|
||||
Creature temp = ObjectAccessor.GetCreature((me), AddGUID[i]);
|
||||
if (temp && temp.IsAlive())
|
||||
if (!temp.GetVictim())
|
||||
temp.GetAI().AttackStart(me.GetVictim());
|
||||
}
|
||||
}
|
||||
CheckAdds_Timer = 5000;
|
||||
}
|
||||
else CheckAdds_Timer -= diff;
|
||||
|
||||
if (!Enrage)
|
||||
{
|
||||
//Cast Vanish, then Garrote random victim
|
||||
if (Vanish_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SpellIds.Vanish);
|
||||
InVanish = true;
|
||||
Vanish_Timer = 30000;
|
||||
Wait_Timer = 5000;
|
||||
}
|
||||
else Vanish_Timer -= diff;
|
||||
|
||||
if (Gouge_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Gouge);
|
||||
Gouge_Timer = 40000;
|
||||
}
|
||||
else Gouge_Timer -= diff;
|
||||
|
||||
if (Blind_Timer <= diff)
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.MinDistance, 0, 0.0f, true, false);
|
||||
if (target != null)
|
||||
DoCast(target, SpellIds.Blind);
|
||||
Blind_Timer = 40000;
|
||||
}
|
||||
else
|
||||
Blind_Timer -= diff;
|
||||
}
|
||||
|
||||
if (InVanish)
|
||||
{
|
||||
if (Wait_Timer <= diff)
|
||||
{
|
||||
Talk(TextIds.Special);
|
||||
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100, true);
|
||||
if (target)
|
||||
target.CastSpell(target, SpellIds.Garrote, true);
|
||||
|
||||
InVanish = false;
|
||||
}
|
||||
else
|
||||
Wait_Timer -= diff;
|
||||
}
|
||||
|
||||
if (!InVanish)
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
|
||||
public ObjectGuid[] AddGUID = new ObjectGuid[4];
|
||||
|
||||
uint Vanish_Timer;
|
||||
uint Blind_Timer;
|
||||
uint Gouge_Timer;
|
||||
uint Wait_Timer;
|
||||
uint CheckAdds_Timer;
|
||||
uint[] AddId = new uint[4];
|
||||
|
||||
bool InVanish;
|
||||
bool Enrage;
|
||||
}
|
||||
|
||||
class boss_moroes_guestAI : ScriptedAI
|
||||
{
|
||||
public boss_moroes_guestAI(Creature creature) : base(creature)
|
||||
{
|
||||
instance = creature.GetInstanceScript();
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
instance.SetBossState(DataTypes.Moroes, EncounterState.NotStarted);
|
||||
}
|
||||
|
||||
public void AcquireGUID()
|
||||
{
|
||||
Creature Moroes = ObjectAccessor.GetCreature(me, instance.GetGuidData(DataTypes.Moroes));
|
||||
if (Moroes)
|
||||
{
|
||||
for (byte i = 0; i < 4; ++i)
|
||||
{
|
||||
ObjectGuid GUID = ((boss_moroes)Moroes.GetAI()).AddGUID[i];
|
||||
if (!GUID.IsEmpty())
|
||||
GuestGUID[i] = GUID;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public Unit SelectGuestTarget()
|
||||
{
|
||||
ObjectGuid TempGUID = GuestGUID[RandomHelper.Rand32() % 4];
|
||||
if (!TempGUID.IsEmpty())
|
||||
{
|
||||
Unit unit = Global.ObjAccessor.GetUnit(me, TempGUID);
|
||||
if (unit && unit.IsAlive())
|
||||
return unit;
|
||||
}
|
||||
|
||||
return me;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (instance.GetData(DataTypes.Moroes) == 0)
|
||||
EnterEvadeMode();
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
InstanceScript instance;
|
||||
|
||||
ObjectGuid[] GuestGUID = new ObjectGuid[4];
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_baroness_dorothea_millstipe : boss_moroes_guestAI
|
||||
{
|
||||
//Shadow Priest
|
||||
public boss_baroness_dorothea_millstipe(Creature creature) : base(creature) { }
|
||||
|
||||
uint ManaBurn_Timer;
|
||||
uint MindFlay_Timer;
|
||||
uint ShadowWordPain_Timer;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
ManaBurn_Timer = 7000;
|
||||
MindFlay_Timer = 1000;
|
||||
ShadowWordPain_Timer = 6000;
|
||||
|
||||
DoCast(me, SpellIds.Shadowform, true);
|
||||
|
||||
base.Reset();
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
if (MindFlay_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Mindfly);
|
||||
MindFlay_Timer = 12000; // 3 sec channeled
|
||||
}
|
||||
else MindFlay_Timer -= diff;
|
||||
|
||||
if (ManaBurn_Timer <= diff)
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100, true);
|
||||
if (target)
|
||||
if (target.GetPowerType() == PowerType.Mana)
|
||||
DoCast(target, SpellIds.Manaburn);
|
||||
ManaBurn_Timer = 5000; // 3 sec cast
|
||||
}
|
||||
else ManaBurn_Timer -= diff;
|
||||
|
||||
if (ShadowWordPain_Timer <= diff)
|
||||
{
|
||||
Unit target = SelectTarget(SelectAggroTarget.Random, 0, 100, true);
|
||||
if (target)
|
||||
{
|
||||
DoCast(target, SpellIds.Swpain);
|
||||
ShadowWordPain_Timer = 7000;
|
||||
}
|
||||
}
|
||||
else ShadowWordPain_Timer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_baron_rafe_dreuger : boss_moroes_guestAI
|
||||
{
|
||||
//Retr Pally
|
||||
public boss_baron_rafe_dreuger(Creature creature) : base(creature) { }
|
||||
|
||||
uint HammerOfJustice_Timer;
|
||||
uint SealOfCommand_Timer;
|
||||
uint JudgementOfCommand_Timer;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
HammerOfJustice_Timer = 1000;
|
||||
SealOfCommand_Timer = 7000;
|
||||
JudgementOfCommand_Timer = SealOfCommand_Timer + 29000;
|
||||
|
||||
base.Reset();
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
if (SealOfCommand_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SpellIds.Sealofcommand);
|
||||
SealOfCommand_Timer = 32000;
|
||||
JudgementOfCommand_Timer = 29000;
|
||||
}
|
||||
else SealOfCommand_Timer -= diff;
|
||||
|
||||
if (JudgementOfCommand_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Judgementofcommand);
|
||||
JudgementOfCommand_Timer = SealOfCommand_Timer + 29000;
|
||||
}
|
||||
else JudgementOfCommand_Timer -= diff;
|
||||
|
||||
if (HammerOfJustice_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Hammerofjustice);
|
||||
HammerOfJustice_Timer = 12000;
|
||||
}
|
||||
else HammerOfJustice_Timer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_lady_catriona_von_indi : boss_moroes_guestAI
|
||||
{
|
||||
//Holy Priest
|
||||
public boss_lady_catriona_von_indi(Creature creature) : base(creature) { }
|
||||
|
||||
uint DispelMagic_Timer;
|
||||
uint GreaterHeal_Timer;
|
||||
uint HolyFire_Timer;
|
||||
uint PowerWordShield_Timer;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
DispelMagic_Timer = 11000;
|
||||
GreaterHeal_Timer = 1500;
|
||||
HolyFire_Timer = 5000;
|
||||
PowerWordShield_Timer = 1000;
|
||||
|
||||
AcquireGUID();
|
||||
|
||||
base.Reset();
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
if (PowerWordShield_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SpellIds.Pwshield);
|
||||
PowerWordShield_Timer = 15000;
|
||||
}
|
||||
else PowerWordShield_Timer -= diff;
|
||||
|
||||
if (GreaterHeal_Timer <= diff)
|
||||
{
|
||||
Unit target = SelectGuestTarget();
|
||||
|
||||
DoCast(target, SpellIds.Greaterheal);
|
||||
GreaterHeal_Timer = 17000;
|
||||
}
|
||||
else GreaterHeal_Timer -= diff;
|
||||
|
||||
if (HolyFire_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Holyfire);
|
||||
HolyFire_Timer = 22000;
|
||||
}
|
||||
else HolyFire_Timer -= diff;
|
||||
|
||||
if (DispelMagic_Timer <= diff)
|
||||
{
|
||||
Unit target = RandomHelper.RAND(SelectGuestTarget(), SelectTarget(SelectAggroTarget.Random, 0, 100, true));
|
||||
if (target)
|
||||
DoCast(target, SpellIds.Dispelmagic);
|
||||
|
||||
DispelMagic_Timer = 25000;
|
||||
}
|
||||
else DispelMagic_Timer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_lady_keira_berrybuck : boss_moroes_guestAI
|
||||
{
|
||||
//Holy Pally
|
||||
public boss_lady_keira_berrybuck(Creature creature) : base(creature) { }
|
||||
|
||||
uint Cleanse_Timer;
|
||||
uint GreaterBless_Timer;
|
||||
uint HolyLight_Timer;
|
||||
uint DivineShield_Timer;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Cleanse_Timer = 13000;
|
||||
GreaterBless_Timer = 1000;
|
||||
HolyLight_Timer = 7000;
|
||||
DivineShield_Timer = 31000;
|
||||
|
||||
AcquireGUID();
|
||||
|
||||
base.Reset();
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
if (DivineShield_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SpellIds.Divineshield);
|
||||
DivineShield_Timer = 31000;
|
||||
}
|
||||
else DivineShield_Timer -= diff;
|
||||
|
||||
if (HolyLight_Timer <= diff)
|
||||
{
|
||||
Unit target = SelectGuestTarget();
|
||||
|
||||
DoCast(target, SpellIds.Holylight);
|
||||
HolyLight_Timer = 10000;
|
||||
}
|
||||
else HolyLight_Timer -= diff;
|
||||
|
||||
if (GreaterBless_Timer <= diff)
|
||||
{
|
||||
Unit target = SelectGuestTarget();
|
||||
|
||||
DoCast(target, SpellIds.Greaterblessofmight);
|
||||
|
||||
GreaterBless_Timer = 50000;
|
||||
}
|
||||
else GreaterBless_Timer -= diff;
|
||||
|
||||
if (Cleanse_Timer <= diff)
|
||||
{
|
||||
Unit target = SelectGuestTarget();
|
||||
|
||||
DoCast(target, SpellIds.Cleanse);
|
||||
|
||||
Cleanse_Timer = 10000;
|
||||
}
|
||||
else Cleanse_Timer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_lord_robin_daris : boss_moroes_guestAI
|
||||
{
|
||||
//Arms Warr
|
||||
public boss_lord_robin_daris(Creature creature) : base(creature) { }
|
||||
|
||||
uint Hamstring_Timer;
|
||||
uint MortalStrike_Timer;
|
||||
uint WhirlWind_Timer;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Hamstring_Timer = 7000;
|
||||
MortalStrike_Timer = 10000;
|
||||
WhirlWind_Timer = 21000;
|
||||
|
||||
base.Reset();
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
if (Hamstring_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Hamstring);
|
||||
Hamstring_Timer = 12000;
|
||||
}
|
||||
else Hamstring_Timer -= diff;
|
||||
|
||||
if (MortalStrike_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Mortalstrike);
|
||||
MortalStrike_Timer = 18000;
|
||||
}
|
||||
else MortalStrike_Timer -= diff;
|
||||
|
||||
if (WhirlWind_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SpellIds.Whirlwind);
|
||||
WhirlWind_Timer = 21000;
|
||||
}
|
||||
else WhirlWind_Timer -= diff;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_lord_crispin_ference : boss_moroes_guestAI
|
||||
{
|
||||
//Arms Warr
|
||||
public boss_lord_crispin_ference(Creature creature) : base(creature) { }
|
||||
|
||||
uint Disarm_Timer;
|
||||
uint HeroicStrike_Timer;
|
||||
uint ShieldBash_Timer;
|
||||
uint ShieldWall_Timer;
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Disarm_Timer = 6000;
|
||||
HeroicStrike_Timer = 10000;
|
||||
ShieldBash_Timer = 8000;
|
||||
ShieldWall_Timer = 4000;
|
||||
|
||||
base.Reset();
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
base.UpdateAI(diff);
|
||||
|
||||
if (Disarm_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Disarm);
|
||||
Disarm_Timer = 12000;
|
||||
}
|
||||
else Disarm_Timer -= diff;
|
||||
|
||||
if (HeroicStrike_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Heroicstrike);
|
||||
HeroicStrike_Timer = 10000;
|
||||
}
|
||||
else HeroicStrike_Timer -= diff;
|
||||
|
||||
if (ShieldBash_Timer <= diff)
|
||||
{
|
||||
DoCastVictim(SpellIds.Shieldbash);
|
||||
ShieldBash_Timer = 13000;
|
||||
}
|
||||
else ShieldBash_Timer -= diff;
|
||||
|
||||
if (ShieldWall_Timer <= diff)
|
||||
{
|
||||
DoCast(me, SpellIds.Shieldwall);
|
||||
ShieldWall_Timer = 21000;
|
||||
}
|
||||
else ShieldWall_Timer -= diff;
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,133 +0,0 @@
|
||||
using System;
|
||||
using Game.Entities;
|
||||
using Game.AI;
|
||||
using Game.Scripting;
|
||||
using Framework.Constants;
|
||||
|
||||
namespace Scripts.EasternKingdoms.TheStockade
|
||||
{
|
||||
struct TextIds
|
||||
{
|
||||
public const uint SayPull = 0; // Forest Just Setback!
|
||||
public const uint SayEnrage = 1; // Areatriggermessage: Hogger Enrages!
|
||||
public const uint SayDeath = 2; // Yiipe!
|
||||
|
||||
public const uint SayWarden1 = 0; // Yell - This Ends Here; Hogger!
|
||||
public const uint SayWarden2 = 1; // Say - He'S...He'S Dead?
|
||||
public const uint SayWarden3 = 2; // Say - It'S Simply Too Good To Be True. You Couldn'T Have Killed Him So Easily!
|
||||
}
|
||||
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint ViciousSlice = 86604;
|
||||
public const uint MaddeningCall = 86620;
|
||||
public const uint Enrage = 86736;
|
||||
}
|
||||
|
||||
struct Events
|
||||
{
|
||||
public const uint SayWarden1 = 1;
|
||||
public const uint SayWarden2 = 2;
|
||||
public const uint SayWarden3 = 3;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_hogger : BossAI
|
||||
{
|
||||
public boss_hogger(Creature creature) : base(creature, DataTypes.Hogger) { }
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(TextIds.SayPull);
|
||||
|
||||
_scheduler.SetValidator(() => !me.HasUnitState(UnitState.Casting));
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(4), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.ViciousSlice);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(14));
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2), task =>
|
||||
{
|
||||
DoCast(SpellIds.MaddeningCall);
|
||||
task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(20));
|
||||
});
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(TextIds.SayDeath);
|
||||
_JustDied();
|
||||
me.SummonCreature(CreatureIds.WardenThelwater, Misc.WardenThelwaterPos);
|
||||
}
|
||||
|
||||
public override void JustSummoned(Creature summon)
|
||||
{
|
||||
base.JustSummoned(summon);
|
||||
if (summon.GetEntry() == CreatureIds.WardenThelwater)
|
||||
summon.GetMotionMaster().MovePoint(0, Misc.WardenThelwaterMovePos);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (me.HealthBelowPctDamaged(30, damage) && !_hasEnraged)
|
||||
{
|
||||
_hasEnraged = true;
|
||||
Talk(TextIds.SayEnrage);
|
||||
DoCastSelf(SpellIds.Enrage);
|
||||
}
|
||||
}
|
||||
|
||||
bool _hasEnraged;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_warden_thelwater : ScriptedAI
|
||||
{
|
||||
public npc_warden_thelwater(Creature creature) : base(creature) { }
|
||||
|
||||
public override void MovementInform(MovementGeneratorType type, uint id)
|
||||
{
|
||||
if (type == MovementGeneratorType.Point && id == 0)
|
||||
_events.ScheduleEvent(Events.SayWarden1, TimeSpan.FromSeconds(1));
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
_events.ExecuteEvents(eventId =>
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case Events.SayWarden1:
|
||||
Talk(TextIds.SayWarden1);
|
||||
_events.ScheduleEvent(Events.SayWarden2, TimeSpan.FromSeconds(4));
|
||||
break;
|
||||
case Events.SayWarden2:
|
||||
Talk(TextIds.SayWarden2);
|
||||
_events.ScheduleEvent(Events.SayWarden3, TimeSpan.FromSeconds(3));
|
||||
break;
|
||||
case Events.SayWarden3:
|
||||
Talk(TextIds.SayWarden3);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
using Game.Maps;
|
||||
using Game.Scripting;
|
||||
using Game.Entities;
|
||||
|
||||
namespace Scripts.EasternKingdoms.TheStockade
|
||||
{
|
||||
struct Misc
|
||||
{
|
||||
public static Position WardenThelwaterMovePos = new Position(152.019f, 106.198f, -35.1896f, 1.082104f);
|
||||
public static Position WardenThelwaterPos = new Position(138.369f, 78.2932f, -33.85627f, 1.082104f);
|
||||
}
|
||||
|
||||
struct DataTypes
|
||||
{
|
||||
public const uint RandolphMoloch = 0;
|
||||
public const uint LordOverheat = 1;
|
||||
public const uint Hogger = 2;
|
||||
}
|
||||
|
||||
struct CreatureIds
|
||||
{
|
||||
public const uint RandolphMoloch = 46383;
|
||||
public const uint LordOverheat = 46264;
|
||||
public const uint Hogger = 46254;
|
||||
public const uint WardenThelwater = 46409;
|
||||
public const uint MortimerMoloch = 46482;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Script]
|
||||
class instance_the_stockade : InstanceMapScript
|
||||
{
|
||||
public instance_the_stockade() : base("instance_the_stockade", 34) { }
|
||||
|
||||
class instance_the_stockade_InstanceMapScript : InstanceScript
|
||||
{
|
||||
public instance_the_stockade_InstanceMapScript(InstanceMap map) : base(map)
|
||||
{
|
||||
SetHeaders("SS");
|
||||
SetBossNumber(3);
|
||||
}
|
||||
}
|
||||
|
||||
public override InstanceScript GetInstanceScript(InstanceMap map)
|
||||
{
|
||||
return new instance_the_stockade_InstanceMapScript(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user