Start adding missing scripts Part3

This commit is contained in:
hondacrx
2022-07-06 23:53:47 -04:00
parent 8cfd263fea
commit ba6c30add4
39 changed files with 5180 additions and 27 deletions
@@ -0,0 +1,81 @@
/*
* 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 Game.AI;
using Game.Entities;
using Game.Scripting;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.Drakkisath
{
struct SpellIds
{
public const uint Firenova = 23462;
public const uint Cleave = 20691;
public const uint Confliguration = 16805;
public const uint Thunderclap = 15548; //Not sure if right Id. 23931 would be a harder possibility.
}
[Script]
class boss_drakkisath : BossAI
{
public boss_drakkisath(Creature creature) : base(creature, DataTypes.GeneralDrakkisath) { }
public override void Reset()
{
_Reset();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(6), task =>
{
DoCastVictim(SpellIds.Firenova);
task.Repeat(TimeSpan.FromSeconds(10));
});
_scheduler.Schedule(TimeSpan.FromSeconds(8), task =>
{
DoCastVictim(SpellIds.Cleave);
task.Repeat(TimeSpan.FromSeconds(8));
});
_scheduler.Schedule(TimeSpan.FromSeconds(15), task =>
{
DoCastVictim(SpellIds.Confliguration);
task.Repeat(TimeSpan.FromSeconds(18));
});
_scheduler.Schedule(TimeSpan.FromSeconds(17), task =>
{
DoCastVictim(SpellIds.Thunderclap);
task.Repeat(TimeSpan.FromSeconds(20));
});
}
public override void JustDied(Unit killer)
{
_JustDied();
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,82 @@
/*
* 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 Game.AI;
using Game.Entities;
using Game.Scripting;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.GizrulTheSlavener
{
struct SpellIds
{
public const uint FatalBite = 16495;
public const uint InfectedBite = 16128;
public const uint Frenzy = 8269;
}
struct PathIds
{
public const uint Gizrul = 402450;
}
[Script]
class boss_gizrul_the_slavener : BossAI
{
public boss_gizrul_the_slavener(Creature creature) : base(creature, DataTypes.GizrulTheSlavener) { }
public override void Reset()
{
_Reset();
}
public override void IsSummonedBy(WorldObject summoner)
{
me.GetMotionMaster().MovePath(PathIds.Gizrul, false);
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(17), TimeSpan.FromSeconds(20), task =>
{
DoCastVictim(SpellIds.FatalBite);
task.Repeat(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(10));
});
_scheduler.Schedule(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(12), task =>
{
DoCast(me, SpellIds.InfectedBite);
task.Repeat(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(10));
});
}
public override void JustDied(Unit killer)
{
_JustDied();
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,139 @@
/*
* 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.BlackrockMountain.BlackrockSpire.Gyth
{
struct SpellIds
{
public const uint RendMounts = 16167; // Change model
public const uint CorrosiveAcid = 16359; // Combat (self cast)
public const uint Flamebreath = 16390; // Combat (Self cast)
public const uint Freeze = 16350; // Combat (Self cast)
public const uint KnockAway = 10101; // Combat
public const uint SummonRend = 16328; // Summons Rend near death
}
struct MiscConst
{
public const uint NefariusPath2 = 1379671;
public const uint NefariusPath3 = 1379672;
public const uint GythPath1 = 1379681;
}
[Script]
class boss_gyth : BossAI
{
bool SummonedRend;
public boss_gyth(Creature creature) : base(creature, DataTypes.Gyth)
{
Initialize();
}
void Initialize()
{
SummonedRend = false;
}
public override void Reset()
{
Initialize();
if (instance.GetBossState(DataTypes.Gyth) == EncounterState.InProgress)
{
instance.SetBossState(DataTypes.Gyth, EncounterState.Done);
me.DespawnOrUnsummon();
}
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.CancelAll();
_scheduler.Schedule(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(16), task =>
{
DoCast(me, SpellIds.CorrosiveAcid);
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(16));
});
_scheduler.Schedule(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(16), task =>
{
DoCast(me, SpellIds.Freeze);
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(16));
});
_scheduler.Schedule(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(16), task =>
{
DoCast(me, SpellIds.Flamebreath);
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(16));
});
_scheduler.Schedule(TimeSpan.FromSeconds(12), TimeSpan.FromSeconds(18), task =>
{
DoCastVictim(SpellIds.KnockAway);
task.Repeat(TimeSpan.FromSeconds(14), TimeSpan.FromSeconds(20));
});
}
public override void JustDied(Unit killer)
{
instance.SetBossState(DataTypes.Gyth, EncounterState.Done);
}
public override void SetData(uint type, uint data)
{
switch (data)
{
case 1:
_scheduler.Schedule(TimeSpan.FromSeconds(1), task =>
{
me.AddAura(SpellIds.RendMounts, me);
GameObject portcullis = me.FindNearestGameObject(GameObjectsIds.DrPortcullis, 40.0f);
if (portcullis)
portcullis.UseDoorOrButton();
Creature victor = me.FindNearestCreature(CreaturesIds.LordVictorNefarius, 75.0f, true);
if (victor)
victor.GetAI().SetData(1, 1);
task.Schedule(TimeSpan.FromSeconds(2), summonTask2 =>
{
me.GetMotionMaster().MovePath(MiscConst.GythPath1, false);
});
});
break;
default:
break;
}
}
public override void UpdateAI(uint diff)
{
if (!SummonedRend && HealthBelowPct(5))
{
DoCast(me, SpellIds.SummonRend);
me.RemoveAura(SpellIds.RendMounts);
SummonedRend = true;
}
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,93 @@
/*
* 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.BlackrockMountain.BlackrockSpire.Halycon
{
struct SpellIds
{
public const uint Rend = 13738;
public const uint Thrash = 3391;
}
struct TextIds
{
public const uint EmoteDeath = 0;
}
[Script]
class boss_halycon : BossAI
{
static Position SummonLocation = new Position(-167.9561f, -411.7844f, 76.23057f, 1.53589f);
bool Summoned;
public boss_halycon(Creature creature) : base(creature, DataTypes.Halycon)
{
Initialize();
}
void Initialize()
{
Summoned = false;
}
public override void Reset()
{
_Reset();
Initialize();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(17), TimeSpan.FromSeconds(20), task =>
{
DoCastVictim(SpellIds.Rend);
task.Repeat(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(10));
});
_scheduler.Schedule(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(12), task =>
{
DoCast(me, SpellIds.Thrash);
});
}
public override void JustDied(Unit killer)
{
me.SummonCreature(CreaturesIds.GizrulTheSlavener, SummonLocation, TempSummonType.TimedDespawn, TimeSpan.FromMinutes(5));
Talk(TextIds.EmoteDeath);
Summoned = true;
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,71 @@
/*
* 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 Game.AI;
using Game.Entities;
using Game.Scripting;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.HighlordOmokk
{
struct SpellIds
{
public const uint Frenzy = 8269;
public const uint KnockAway = 10101;
}
[Script]
class boss_highlord_omokk : BossAI
{
public boss_highlord_omokk(Creature creature) : base(creature, DataTypes.HighlordOmokk) { }
public override void Reset()
{
_Reset();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(20), task =>
{
DoCastVictim(SpellIds.Frenzy);
task.Repeat(TimeSpan.FromMinutes(1));
});
_scheduler.Schedule(TimeSpan.FromSeconds(18), task =>
{
DoCastVictim(SpellIds.KnockAway);
task.Repeat(TimeSpan.FromSeconds(12));
});
}
public override void JustDied(Unit killer)
{
_JustDied();
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,721 @@
/*
* 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.DataStorage;
using Game.Entities;
using Game.Maps;
using Game.Scripting;
using System;
using System.Collections.Generic;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire
{
struct DataTypes
{
public const uint HighlordOmokk = 0;
public const uint ShadowHunterVoshgajin = 1;
public const uint WarmasterVoone = 2;
public const uint MotherSmolderweb = 3;
public const uint UrokDoomhowl = 4;
public const uint QuartermasterZigris = 5;
public const uint GizrulTheSlavener = 6;
public const uint Halycon = 7;
public const uint OverlordWyrmthalak = 8;
public const uint PyrogaurdEmberseer = 9;
public const uint WarchiefRendBlackhand = 10;
public const uint Gyth = 11;
public const uint TheBeast = 12;
public const uint GeneralDrakkisath = 13;
public const uint LordValthalak = 14;
// Extra
public const uint DragonspireRoom = 15;
public const uint HallRune1 = 16;
public const uint HallRune2 = 17;
public const uint HallRune3 = 18;
public const uint HallRune4 = 19;
public const uint HallRune5 = 20;
public const uint HallRune6 = 21;
public const uint HallRune7 = 22;
public const uint ScarshieldInfiltrator = 23;
public const uint BlackhandIncarcerator = 24;
}
struct CreaturesIds
{
public const uint HighlordOmokk = 9196;
public const uint ShadowHunterVoshgajin = 9236;
public const uint WarmasterVoone = 9237;
public const uint MotherSmolderweb = 10596;
public const uint UrokDoomhowl = 10584;
public const uint QuartermasterZigris = 9736;
public const uint GizrulTheSlavener = 10268;
public const uint Halycon = 10220;
public const uint OverlordWyrmthalak = 9568;
public const uint PyrogaurdEmberseer = 9816;
public const uint WarchiefRendBlackhand = 10429;
public const uint Gyth = 10339;
public const uint TheBeast = 10430;
public const uint GeneralDrakkisath = 10363;
public const uint BlackhandDreadweaver = 9817;
public const uint BlackhandSummoner = 9818;
public const uint BlackhandVeteran = 9819;
public const uint BlackhandIncarcerator = 10316;
public const uint LordVictorNefarius = 10162;
public const uint ScarshieldInfiltrator = 10299;
}
struct GameObjectsIds
{
public const uint WhelpSpawner = 175622; // trap spawned by public const uint id 175124
// Doors
public const uint EmberseerIn = 175244; // First door to Pyroguard Emberseer
public const uint Doors = 175705; // Second door to Pyroguard Emberseer
public const uint EmberseerOut = 175153; // Door after Pyroguard Emberseer event
public const uint GythEntryDoor = 164726;
public const uint GythCombatDoor = 175185;
public const uint GythExitDoor = 175186;
public const uint DrakkisathDoor1 = 175946;
public const uint DrakkisathDoor2 = 175947;
// Runes in drapublic const uint nspire hall
public const uint HallRune1 = 175197;
public const uint HallRune2 = 175199;
public const uint HallRune3 = 175195;
public const uint HallRune4 = 175200;
public const uint HallRune5 = 175198;
public const uint HallRune6 = 175196;
public const uint HallRune7 = 175194;
// Runes in emberseers room
public const uint EmberseerRune1 = 175266;
public const uint EmberseerRune2 = 175267;
public const uint EmberseerRune3 = 175268;
public const uint EmberseerRune4 = 175269;
public const uint EmberseerRune5 = 175270;
public const uint EmberseerRune6 = 175271;
public const uint EmberseerRune7 = 175272;
// For Gyth event
public const uint DrPortcullis = 175185;
public const uint PortcullisActive = 164726;
public const uint PortcullisTobossrooms = 175186;
}
struct BRSMiscConst
{
public const uint SpellSummonRookeryWhelp = 15745;
public const uint EventUrokDoomhowl = 4845;
public const uint EventPyroguardEmberseer = 4884;
public const uint Areatrigger = 1;
public const uint AreatriggerDragonspireHall = 2046;
public const uint AreatriggerBlackrockStadium = 2026;
public const uint EncounterCount = 23;
//uint const DragonspireRunes[7] = { GoHallRune1, GoHallRune2, GoHallRune3, GoHallRune4, GoHallRune5, GoHallRune6, GoHallRune7 }
public static uint[] DragonspireMobs = { CreaturesIds.BlackhandDreadweaver, CreaturesIds.BlackhandSummoner, CreaturesIds.BlackhandVeteran };
public static DoorData[] doorData =
{
new DoorData(GameObjectsIds.Doors, DataTypes.PyrogaurdEmberseer, DoorType.Passage),
new DoorData(GameObjectsIds.EmberseerOut, DataTypes.PyrogaurdEmberseer, DoorType.Passage),
new DoorData(GameObjectsIds.DrakkisathDoor1, DataTypes.GeneralDrakkisath, DoorType.Passage),
new DoorData(GameObjectsIds.DrakkisathDoor2, DataTypes.GeneralDrakkisath, DoorType.Passage),
new DoorData(GameObjectsIds.PortcullisActive, DataTypes.WarchiefRendBlackhand, DoorType.Passage),
new DoorData(GameObjectsIds.PortcullisTobossrooms, DataTypes.WarchiefRendBlackhand, DoorType.Passage),
};
}
struct EventIds
{
public const uint DargonspireRoomStore = 1;
public const uint DargonspireRoomCheck = 2;
public const uint UrokDoomhowlSpawns1 = 3;
public const uint UrokDoomhowlSpawns2 = 4;
public const uint UrokDoomhowlSpawns3 = 5;
public const uint UrokDoomhowlSpawns4 = 6;
public const uint UrokDoomhowlSpawns5 = 7;
public const uint UrokDoomhowlSpawnIn = 8;
}
[Script]
class instance_blackrock_spire : InstanceMapScript
{
public instance_blackrock_spire() : base(nameof(instance_blackrock_spire), 229) { }
class instance_blackrock_spireMapScript : InstanceScript
{
public instance_blackrock_spireMapScript(InstanceMap map) : base(map)
{
SetHeaders("BRS");
SetBossNumber(BRSMiscConst.EncounterCount);
LoadDoorData(BRSMiscConst.doorData);
for (byte i = 0; i < 7; ++i)
runecreaturelist[i] = new();
}
public override void OnCreatureCreate(Creature creature)
{
switch (creature.GetEntry())
{
case CreaturesIds.HighlordOmokk:
HighlordOmokk = creature.GetGUID();
break;
case CreaturesIds.ShadowHunterVoshgajin:
ShadowHunterVoshgajin = creature.GetGUID();
break;
case CreaturesIds.WarmasterVoone:
WarMasterVoone = creature.GetGUID();
break;
case CreaturesIds.MotherSmolderweb:
MotherSmolderweb = creature.GetGUID();
break;
case CreaturesIds.UrokDoomhowl:
UrokDoomhowl = creature.GetGUID();
break;
case CreaturesIds.QuartermasterZigris:
QuartermasterZigris = creature.GetGUID();
break;
case CreaturesIds.GizrulTheSlavener:
GizrultheSlavener = creature.GetGUID();
break;
case CreaturesIds.Halycon:
Halycon = creature.GetGUID();
break;
case CreaturesIds.OverlordWyrmthalak:
OverlordWyrmthalak = creature.GetGUID();
break;
case CreaturesIds.PyrogaurdEmberseer:
PyroguardEmberseer = creature.GetGUID();
if (GetBossState(DataTypes.PyrogaurdEmberseer) == EncounterState.Done)
creature.DespawnOrUnsummon(TimeSpan.FromSeconds(0), TimeSpan.FromDays(7));
break;
case CreaturesIds.WarchiefRendBlackhand:
WarchiefRendBlackhand = creature.GetGUID();
if (GetBossState(DataTypes.Gyth) == EncounterState.Done)
creature.DespawnOrUnsummon(TimeSpan.FromSeconds(0), TimeSpan.FromDays(7));
break;
case CreaturesIds.Gyth:
Gyth = creature.GetGUID();
break;
case CreaturesIds.TheBeast:
TheBeast = creature.GetGUID();
break;
case CreaturesIds.GeneralDrakkisath:
GeneralDrakkisath = creature.GetGUID();
break;
case CreaturesIds.LordVictorNefarius:
LordVictorNefarius = creature.GetGUID();
if (GetBossState(DataTypes.Gyth) == EncounterState.Done)
creature.DespawnOrUnsummon(TimeSpan.FromSeconds(0), TimeSpan.FromDays(7));
break;
case CreaturesIds.ScarshieldInfiltrator:
ScarshieldInfiltrator = creature.GetGUID();
break;
case CreaturesIds.BlackhandIncarcerator:
_incarceratorList.Add(creature.GetGUID());
break;
}
}
public override void OnGameObjectCreate(GameObject go)
{
base.OnGameObjectCreate(go);
switch (go.GetEntry())
{
case GameObjectsIds.WhelpSpawner:
go.CastSpell(null, BRSMiscConst.SpellSummonRookeryWhelp);
break;
case GameObjectsIds.EmberseerIn:
go_emberseerin = go.GetGUID();
if (GetBossState(DataTypes.DragonspireRoom) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, true, go);
break;
case GameObjectsIds.Doors:
go_doors = go.GetGUID();
if (GetBossState(DataTypes.DragonspireRoom) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, true, go);
break;
case GameObjectsIds.EmberseerOut:
go_emberseerout = go.GetGUID();
if (GetBossState(DataTypes.PyrogaurdEmberseer) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, true, go);
break;
case GameObjectsIds.HallRune1:
go_roomrunes[0] = go.GetGUID();
if (GetBossState(DataTypes.HallRune1) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.HallRune2:
go_roomrunes[1] = go.GetGUID();
if (GetBossState(DataTypes.HallRune2) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.HallRune3:
go_roomrunes[2] = go.GetGUID();
if (GetBossState(DataTypes.HallRune3) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.HallRune4:
go_roomrunes[3] = go.GetGUID();
if (GetBossState(DataTypes.HallRune4) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.HallRune5:
go_roomrunes[4] = go.GetGUID();
if (GetBossState(DataTypes.HallRune5) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.HallRune6:
go_roomrunes[5] = go.GetGUID();
if (GetBossState(DataTypes.HallRune6) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.HallRune7:
go_roomrunes[6] = go.GetGUID();
if (GetBossState(DataTypes.HallRune7) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.EmberseerRune1:
go_emberseerrunes[0] = go.GetGUID();
if (GetBossState(DataTypes.PyrogaurdEmberseer) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.EmberseerRune2:
go_emberseerrunes[1] = go.GetGUID();
if (GetBossState(DataTypes.PyrogaurdEmberseer) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.EmberseerRune3:
go_emberseerrunes[2] = go.GetGUID();
if (GetBossState(DataTypes.PyrogaurdEmberseer) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.EmberseerRune4:
go_emberseerrunes[3] = go.GetGUID();
if (GetBossState(DataTypes.PyrogaurdEmberseer) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.EmberseerRune5:
go_emberseerrunes[4] = go.GetGUID();
if (GetBossState(DataTypes.PyrogaurdEmberseer) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.EmberseerRune6:
go_emberseerrunes[5] = go.GetGUID();
if (GetBossState(DataTypes.PyrogaurdEmberseer) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.EmberseerRune7:
go_emberseerrunes[6] = go.GetGUID();
if (GetBossState(DataTypes.PyrogaurdEmberseer) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, false, go);
break;
case GameObjectsIds.PortcullisActive:
go_portcullis_active = go.GetGUID();
if (GetBossState(DataTypes.Gyth) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, true, go);
break;
case GameObjectsIds.PortcullisTobossrooms:
go_portcullis_tobossrooms = go.GetGUID();
if (GetBossState(DataTypes.Gyth) == EncounterState.Done)
HandleGameObject(ObjectGuid.Empty, true, go);
break;
default:
break;
}
}
public override bool SetBossState(uint type, EncounterState state)
{
if (!base.SetBossState(type, state))
return false;
switch (type)
{
case DataTypes.HighlordOmokk:
case DataTypes.ShadowHunterVoshgajin:
case DataTypes.WarmasterVoone:
case DataTypes.MotherSmolderweb:
case DataTypes.UrokDoomhowl:
case DataTypes.QuartermasterZigris:
case DataTypes.GizrulTheSlavener:
case DataTypes.Halycon:
case DataTypes.OverlordWyrmthalak:
case DataTypes.PyrogaurdEmberseer:
case DataTypes.WarchiefRendBlackhand:
case DataTypes.Gyth:
case DataTypes.TheBeast:
case DataTypes.GeneralDrakkisath:
case DataTypes.DragonspireRoom:
break;
default:
break;
}
return true;
}
public override void ProcessEvent(WorldObject obj, uint eventId, WorldObject invoker)
{
switch (eventId)
{
case BRSMiscConst.EventPyroguardEmberseer:
if (GetBossState(DataTypes.PyrogaurdEmberseer) == EncounterState.NotStarted)
{
Creature Emberseer = instance.GetCreature(PyroguardEmberseer);
if (Emberseer)
Emberseer.GetAI().SetData(1, 1);
}
break;
case BRSMiscConst.EventUrokDoomhowl:
if (GetBossState(CreaturesIds.UrokDoomhowl) == EncounterState.NotStarted)
{
}
break;
default:
break;
}
}
public override void SetData(uint type, uint data)
{
switch (type)
{
case BRSMiscConst.Areatrigger:
if (data == BRSMiscConst.AreatriggerDragonspireHall)
{
if (GetBossState(DataTypes.DragonspireRoom) != EncounterState.Done)
_events.ScheduleEvent(EventIds.DargonspireRoomStore, TimeSpan.FromSeconds(1));
}
break;
case DataTypes.BlackhandIncarcerator:
foreach (var itr in _incarceratorList)
{
Creature creature = instance.GetCreature(itr);
if (creature)
creature.Respawn();
}
break;
default:
break;
}
}
public override ObjectGuid GetGuidData(uint type)
{
switch (type)
{
case DataTypes.HighlordOmokk:
return HighlordOmokk;
case DataTypes.ShadowHunterVoshgajin:
return ShadowHunterVoshgajin;
case DataTypes.WarmasterVoone:
return WarMasterVoone;
case DataTypes.MotherSmolderweb:
return MotherSmolderweb;
case DataTypes.UrokDoomhowl:
return UrokDoomhowl;
case DataTypes.QuartermasterZigris:
return QuartermasterZigris;
case DataTypes.GizrulTheSlavener:
return GizrultheSlavener;
case DataTypes.Halycon:
return Halycon;
case DataTypes.OverlordWyrmthalak:
return OverlordWyrmthalak;
case DataTypes.PyrogaurdEmberseer:
return PyroguardEmberseer;
case DataTypes.WarchiefRendBlackhand:
return WarchiefRendBlackhand;
case DataTypes.Gyth:
return Gyth;
case DataTypes.TheBeast:
return TheBeast;
case DataTypes.GeneralDrakkisath:
return GeneralDrakkisath;
case DataTypes.ScarshieldInfiltrator:
return ScarshieldInfiltrator;
case GameObjectsIds.EmberseerIn:
return go_emberseerin;
case GameObjectsIds.Doors:
return go_doors;
case GameObjectsIds.EmberseerOut:
return go_emberseerout;
case GameObjectsIds.HallRune1:
return go_roomrunes[0];
case GameObjectsIds.HallRune2:
return go_roomrunes[1];
case GameObjectsIds.HallRune3:
return go_roomrunes[2];
case GameObjectsIds.HallRune4:
return go_roomrunes[3];
case GameObjectsIds.HallRune5:
return go_roomrunes[4];
case GameObjectsIds.HallRune6:
return go_roomrunes[5];
case GameObjectsIds.HallRune7:
return go_roomrunes[6];
case GameObjectsIds.EmberseerRune1:
return go_emberseerrunes[0];
case GameObjectsIds.EmberseerRune2:
return go_emberseerrunes[1];
case GameObjectsIds.EmberseerRune3:
return go_emberseerrunes[2];
case GameObjectsIds.EmberseerRune4:
return go_emberseerrunes[3];
case GameObjectsIds.EmberseerRune5:
return go_emberseerrunes[4];
case GameObjectsIds.EmberseerRune6:
return go_emberseerrunes[5];
case GameObjectsIds.EmberseerRune7:
return go_emberseerrunes[6];
case GameObjectsIds.PortcullisActive:
return go_portcullis_active;
case GameObjectsIds.PortcullisTobossrooms:
return go_portcullis_tobossrooms;
default:
break;
}
return ObjectGuid.Empty;
}
public override void Update(uint diff)
{
_events.Update(diff);
_events.ExecuteEvents(eventId =>
{
switch (eventId)
{
case EventIds.DargonspireRoomStore:
Dragonspireroomstore();
_events.ScheduleEvent(EventIds.DargonspireRoomCheck, TimeSpan.FromSeconds(3));
break;
case EventIds.DargonspireRoomCheck:
Dragonspireroomcheck();
if (GetBossState(DataTypes.DragonspireRoom) != EncounterState.Done)
_events.ScheduleEvent(EventIds.DargonspireRoomCheck, TimeSpan.FromSeconds(3));
break;
default:
break;
}
});
}
void Dragonspireroomstore()
{
for (byte i = 0; i < 7; ++i)
{
// Refresh the creature list
runecreaturelist[i].Clear();
GameObject rune = instance.GetGameObject(go_roomrunes[i]);
if (rune)
{
for (byte j = 0; j < 3; ++j)
{
List<Creature> creatureList = rune.GetCreatureListWithEntryInGrid(BRSMiscConst.DragonspireMobs[j], 15.0f);
foreach (var creature in creatureList)
if (creature)
runecreaturelist[i].Add(creature.GetGUID());
}
}
}
}
void Dragonspireroomcheck()
{
Creature mob = null;
GameObject rune = null;
for (byte i = 0; i < 7; ++i)
{
bool _mobAlive = false;
rune = instance.GetGameObject(go_roomrunes[i]);
if (!rune)
continue;
if (rune.GetGoState() == GameObjectState.Active)
{
foreach (ObjectGuid guid in runecreaturelist[i])
{
mob = instance.GetCreature(guid);
if (mob && mob.IsAlive())
_mobAlive = true;
}
}
if (!_mobAlive && rune.GetGoState() == GameObjectState.Active)
{
HandleGameObject(ObjectGuid.Empty, false, rune);
switch (rune.GetEntry())
{
case GameObjectsIds.HallRune1:
SetBossState(DataTypes.HallRune1, EncounterState.Done);
break;
case GameObjectsIds.HallRune2:
SetBossState(DataTypes.HallRune2, EncounterState.Done);
break;
case GameObjectsIds.HallRune3:
SetBossState(DataTypes.HallRune3, EncounterState.Done);
break;
case GameObjectsIds.HallRune4:
SetBossState(DataTypes.HallRune4, EncounterState.Done);
break;
case GameObjectsIds.HallRune5:
SetBossState(DataTypes.HallRune5, EncounterState.Done);
break;
case GameObjectsIds.HallRune6:
SetBossState(DataTypes.HallRune6, EncounterState.Done);
break;
case GameObjectsIds.HallRune7:
SetBossState(DataTypes.HallRune7, EncounterState.Done);
break;
default:
break;
}
}
}
if (GetBossState(DataTypes.HallRune1) == EncounterState.Done && GetBossState(DataTypes.HallRune2) == EncounterState.Done && GetBossState(DataTypes.HallRune3) == EncounterState.Done &&
GetBossState(DataTypes.HallRune4) == EncounterState.Done && GetBossState(DataTypes.HallRune5) == EncounterState.Done && GetBossState(DataTypes.HallRune6) == EncounterState.Done &&
GetBossState(DataTypes.HallRune7) == EncounterState.Done)
{
SetBossState(DataTypes.DragonspireRoom, EncounterState.Done);
GameObject door1 = instance.GetGameObject(go_emberseerin);
if (door1)
HandleGameObject(ObjectGuid.Empty, true, door1);
GameObject door2 = instance.GetGameObject(go_doors);
if (door2)
HandleGameObject(ObjectGuid.Empty, true, door2);
}
}
ObjectGuid HighlordOmokk;
ObjectGuid ShadowHunterVoshgajin;
ObjectGuid WarMasterVoone;
ObjectGuid MotherSmolderweb;
ObjectGuid UrokDoomhowl;
ObjectGuid QuartermasterZigris;
ObjectGuid GizrultheSlavener;
ObjectGuid Halycon;
ObjectGuid OverlordWyrmthalak;
ObjectGuid PyroguardEmberseer;
ObjectGuid WarchiefRendBlackhand;
ObjectGuid Gyth;
ObjectGuid LordVictorNefarius;
ObjectGuid TheBeast;
ObjectGuid GeneralDrakkisath;
ObjectGuid ScarshieldInfiltrator;
ObjectGuid go_emberseerin;
ObjectGuid go_doors;
ObjectGuid go_emberseerout;
ObjectGuid go_blackrockaltar;
ObjectGuid[] go_roomrunes = new ObjectGuid[7];
ObjectGuid[] go_emberseerrunes = new ObjectGuid[7];
List<ObjectGuid>[] runecreaturelist = new List<ObjectGuid>[7];
ObjectGuid go_portcullis_active;
ObjectGuid go_portcullis_tobossrooms;
List<ObjectGuid> _incarceratorList = new();
}
public override InstanceScript GetInstanceScript(InstanceMap map)
{
return new instance_blackrock_spireMapScript(map);
}
}
[Script]
class at_dragonspire_hall : AreaTriggerScript
{
public at_dragonspire_hall() : base("at_dragonspire_hall") { }
public override bool OnTrigger(Player player, AreaTriggerRecord areaTrigger)
{
if (player && player.IsAlive())
{
InstanceScript instance = player.GetInstanceScript();
if (instance != null)
{
instance.SetData(BRSMiscConst.Areatrigger, BRSMiscConst.AreatriggerDragonspireHall);
return true;
}
}
return false;
}
}
[Script]
class at_blackrock_stadium : AreaTriggerScript
{
public at_blackrock_stadium() : base("at_blackrock_stadium") { }
public override bool OnTrigger(Player player, AreaTriggerRecord areaTrigger)
{
if (player && player.IsAlive())
{
InstanceScript instance = player.GetInstanceScript();
if (instance == null)
return false;
Creature rend = player.FindNearestCreature(CreaturesIds.WarchiefRendBlackhand, 50.0f);
if (rend)
{
rend.GetAI().SetData(BRSMiscConst.Areatrigger, BRSMiscConst.AreatriggerBlackrockStadium);
return true;
}
}
return false;
}
}
[Script]
class at_nearby_scarshield_infiltrator : AreaTriggerScript
{
public at_nearby_scarshield_infiltrator() : base("at_nearby_scarshield_infiltrator") { }
public override bool OnTrigger(Player player, AreaTriggerRecord at)
{
if (player.IsAlive())
{
InstanceScript instance = player.GetInstanceScript();
if (instance != null)
{
Creature infiltrator = ObjectAccessor.GetCreature(player, instance.GetGuidData(DataTypes.ScarshieldInfiltrator));
if (infiltrator)
{
if (player.GetLevel() >= 57)
infiltrator.GetAI().SetData(1, 1);
else if (infiltrator.GetEntry() == CreaturesIds.ScarshieldInfiltrator)
infiltrator.GetAI().Talk(0, player);
return true;
}
}
}
return false;
}
}
}
@@ -0,0 +1,116 @@
/*
* 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.BlackrockMountain.BlackrockSpire
{
struct SpellIds
{
public const uint Frenzy = 8269;
public const uint SummonSpectralAssassin = 27249;
public const uint ShadowBoltVolley = 27382;
public const uint ShadowWrath = 27286;
}
[Script]
class boss_lord_valthalak : BossAI
{
bool frenzy40;
bool frenzy15;
public boss_lord_valthalak(Creature creature) : base(creature, DataTypes.LordValthalak)
{
Initialize();
}
void Initialize()
{
frenzy40 = false;
frenzy15 = false;
}
public override void Reset()
{
_Reset();
Initialize();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(6), TimeSpan.FromSeconds(8), 1, task =>
{
DoCast(me, SpellIds.SummonSpectralAssassin);
task.Repeat(TimeSpan.FromSeconds(30), TimeSpan.FromSeconds(35));
});
_scheduler.Schedule(TimeSpan.FromSeconds(9), TimeSpan.FromSeconds(18), task =>
{
DoCastVictim(SpellIds.ShadowWrath);
task.Repeat(TimeSpan.FromSeconds(19), TimeSpan.FromSeconds(24));
});
}
public override void JustDied(Unit killer)
{
instance.SetBossState(DataTypes.LordValthalak, EncounterState.Done);
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff);
if (me.HasUnitState(UnitState.Casting))
return;
if (!frenzy40)
{
if (HealthBelowPct(40))
{
DoCast(me, SpellIds.Frenzy);
_scheduler.CancelGroup(1);
frenzy40 = true;
}
}
if (!frenzy15)
{
if (HealthBelowPct(15))
{
DoCast(me, SpellIds.Frenzy);
_scheduler.Schedule(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(14), task =>
{
DoCastVictim(SpellIds.ShadowBoltVolley);
task.Repeat(TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(6));
});
frenzy15 = true;
}
}
DoMeleeAttackIfReady();
}
}
}
@@ -0,0 +1,79 @@
/*
* 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;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.MotherSmolderweb
{
struct SpellIds
{
public const uint Crystalize = 16104;
public const uint Mothersmilk = 16468;
public const uint SummonSpireSpiderling = 16103;
}
[Script]
class boss_mother_smolderweb : BossAI
{
public boss_mother_smolderweb(Creature creature) : base(creature, DataTypes.MotherSmolderweb) { }
public override void Reset()
{
_Reset();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(20), task =>
{
DoCast(me, SpellIds.Crystalize);
task.Repeat(TimeSpan.FromSeconds(15));
});
_scheduler.Schedule(TimeSpan.FromSeconds(10), task =>
{
DoCast(me, SpellIds.Mothersmilk);
task.Repeat(TimeSpan.FromSeconds(5), TimeSpan.FromMilliseconds(12500));
});
}
public override void JustDied(Unit killer)
{
_JustDied();
}
public override void DamageTaken(Unit done_by, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
{
if (me.GetHealth() <= damage)
DoCast(me, SpellIds.SummonSpireSpiderling, new CastSpellExtraArgs(true));
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,119 @@
/*
* 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.BlackrockMountain.BlackrockSpire.OverlordWyrmthalak
{
struct SpellIds
{
public const uint Blastwave = 11130;
public const uint Shout = 23511;
public const uint Cleave = 20691;
public const uint Knockaway = 20686;
}
struct MiscConst
{
public const uint NpcSpirestoneWarlord = 9216;
public const uint NpcSmolderthornBerserker = 9268;
public static Position SummonLocation1 = new Position(-39.355f, -513.456f, 88.472f, 4.679f);
public static Position SummonLocation2 = new Position(-49.875f, -511.896f, 88.195f, 4.613f);
}
[Script]
class boss_overlord_wyrmthalak : BossAI
{
bool Summoned;
public boss_overlord_wyrmthalak(Creature creature) : base(creature, DataTypes.OverlordWyrmthalak)
{
Initialize();
}
void Initialize()
{
Summoned = false;
}
public override void Reset()
{
_Reset();
Initialize();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(20), task =>
{
DoCastVictim(SpellIds.Blastwave);
task.Repeat(TimeSpan.FromSeconds(20));
});
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
{
DoCastVictim(SpellIds.Shout);
task.Repeat(TimeSpan.FromSeconds(10));
});
_scheduler.Schedule(TimeSpan.FromSeconds(6), task =>
{
DoCastVictim(SpellIds.Cleave);
task.Repeat(TimeSpan.FromSeconds(7));
});
_scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
{
DoCastVictim(SpellIds.Knockaway);
task.Repeat(TimeSpan.FromSeconds(14));
});
}
public override void JustDied(Unit killer)
{
_JustDied();
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
if (!Summoned && HealthBelowPct(51))
{
Unit target = SelectTarget(SelectTargetMethod.Random, 0, 100, true);
if (target)
{
Creature warlord = me.SummonCreature(MiscConst.NpcSpirestoneWarlord, MiscConst.SummonLocation1, TempSummonType.TimedDespawn, TimeSpan.FromMinutes(5));
if (warlord)
warlord.GetAI().AttackStart(target);
Creature berserker = me.SummonCreature(MiscConst.NpcSmolderthornBerserker, MiscConst.SummonLocation2, TempSummonType.TimedDespawn, TimeSpan.FromMinutes(5));
if (berserker)
berserker.GetAI().AttackStart(target);
Summoned = true;
}
}
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,282 @@
/*
* 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.BlackrockMountain.BlackrockSpire.PyroguardEmberseer
{
struct SpellIds
{
public const uint EncagedEmberseer = 15282; // Self on spawn
public const uint FireShieldTrigger = 13377; // Self on spawn missing from 335 dbc triggers public const uint FireShield every 3 sec
public const uint FireShield = 13376; // Triggered by public const uint FireShieldTrigger
public const uint FreezeAnim = 16245; // Self on event start
public const uint EmberseerGrowing = 16048; // Self on event start
public const uint EmberseerGrowingTrigger = 16049; // Triggered by public const uint EmberseerGrowing
public const uint EmberseerFullStrength = 16047; // Emberseer Full Strength
public const uint Firenova = 23462; // Combat
public const uint Flamebuffet = 23341; // Combat
public const uint Pyroblast = 17274; // Combat
// Blackhand Incarcerator public const uint s
public const uint EncageEmberseer = 15281; // Emberseer on spawn
public const uint Strike = 15580; // Combat
public const uint Encage = 16045; // Combat
// Cast on player by altar
public const uint EmberseerObjectVisual = 16532;
}
struct TextIds
{
public const uint EmoteOneStack = 0;
public const uint EmoteTenStack = 1;
public const uint EmoteFreeOfBonds = 2;
public const uint YellFreeOfBonds = 3;
}
[Script]
class boss_pyroguard_emberseer : BossAI
{
public boss_pyroguard_emberseer(Creature creature) : base(creature, DataTypes.PyrogaurdEmberseer) { }
public override void Reset()
{
me.SetUnitFlag(UnitFlags.Uninteractible);
me.SetImmuneToPC(true);
_scheduler.CancelAll();
// Apply auras on spawn and reset
// DoCast(me, SpellFireShieldTrigger); // Need to find this in old Dbc if possible
me.RemoveAura(SpellIds.EmberseerFullStrength);
me.RemoveAura(SpellIds.EmberseerGrowing);
me.RemoveAura(SpellIds.EmberseerGrowingTrigger);
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
{
instance.SetData(DataTypes.BlackhandIncarcerator, 1);
instance.SetBossState(DataTypes.PyrogaurdEmberseer, EncounterState.NotStarted);
});
// Hack for missing trigger spell
_scheduler.Schedule(TimeSpan.FromSeconds(3), task =>
{
// #### Spell isn't doing any damage ??? ####
DoCast(me, SpellIds.FireShield);
task.Repeat(TimeSpan.FromSeconds(3));
});
}
public override void SetData(uint type, uint data)
{
switch (data)
{
case 1:
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
{
// As of Patch 3.0.8 only one person needs to channel the altar
bool _hasAura = false;
var players = me.GetMap().GetPlayers();
foreach (var player in players)
{
if (player != null && player.HasAura(SpellIds.EmberseerObjectVisual))
{
_hasAura = true;
break;
}
}
if (_hasAura)
{
task.Schedule(TimeSpan.FromSeconds(1), preFlightTask1 =>
{
// Set data on all Blackhand Incarcerators
List<Creature> creatureList = me.GetCreatureListWithEntryInGrid(CreaturesIds.BlackhandIncarcerator, 35.0f);
foreach (var creature in creatureList)
{
if (creature)
{
creature.SetImmuneToAll(false);
creature.InterruptSpell(CurrentSpellTypes.Channeled);
DoZoneInCombat(creature);
}
}
me.RemoveAura(SpellIds.EncagedEmberseer);
preFlightTask1.Schedule(TimeSpan.FromSeconds(32), preFlightTask2 =>
{
me.CastSpell(me, SpellIds.FreezeAnim);
me.CastSpell(me, SpellIds.EmberseerGrowing);
Talk(TextIds.EmoteOneStack);
});
});
instance.SetBossState(DataTypes.PyrogaurdEmberseer, EncounterState.InProgress);
}
});
break;
default:
break;
}
}
public override void JustEngagedWith(Unit who)
{
// ### Todo Check combat timing ###
_scheduler.Schedule(TimeSpan.FromSeconds(6), task =>
{
DoCast(me, SpellIds.Firenova);
task.Repeat(TimeSpan.FromSeconds(6));
});
_scheduler.Schedule(TimeSpan.FromSeconds(3), task =>
{
DoCast(me, SpellIds.Flamebuffet);
task.Repeat(TimeSpan.FromSeconds(14));
});
_scheduler.Schedule(TimeSpan.FromSeconds(14), task =>
{
Unit target = SelectTarget(SelectTargetMethod.Random, 0, 100, true);
if (target)
DoCast(target, SpellIds.Pyroblast);
task.Repeat(TimeSpan.FromSeconds(15));
});
}
public override void JustDied(Unit killer)
{
// Activate all the runes
UpdateRunes(GameObjectState.Ready);
// Complete encounter
instance.SetBossState(DataTypes.PyrogaurdEmberseer, EncounterState.Done);
}
public override void SpellHit(WorldObject caster, SpellInfo spellInfo)
{
if (spellInfo.Id == SpellIds.EncageEmberseer)
{
if (me.GetAuraCount(SpellIds.EncagedEmberseer) == 0)
{
me.CastSpell(me, SpellIds.EncagedEmberseer);
Reset();
}
}
if (spellInfo.Id == SpellIds.EmberseerGrowingTrigger)
{
if (me.GetAuraCount(SpellIds.EmberseerGrowingTrigger) == 10)
Talk(TextIds.EmoteTenStack);
if (me.GetAuraCount(SpellIds.EmberseerGrowingTrigger) == 20)
{
me.RemoveAura(SpellIds.FreezeAnim);
me.CastSpell(me, SpellIds.EmberseerFullStrength);
Talk(TextIds.EmoteFreeOfBonds);
Talk(TextIds.YellFreeOfBonds);
me.RemoveUnitFlag(UnitFlags.Uninteractible);
me.SetImmuneToPC(false);
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
{
AttackStart(me.SelectNearestPlayer(30.0f));
});
}
}
}
void UpdateRunes(GameObjectState state)
{
// update all runes
GameObject rune1 = ObjectAccessor.GetGameObject(me, instance.GetGuidData(GameObjectsIds.EmberseerRune1));
if (rune1)
rune1.SetGoState(state);
GameObject rune2 = ObjectAccessor.GetGameObject(me, instance.GetGuidData(GameObjectsIds.EmberseerRune2));
if (rune2)
rune2.SetGoState(state);
GameObject rune3 = ObjectAccessor.GetGameObject(me, instance.GetGuidData(GameObjectsIds.EmberseerRune3));
if (rune3)
rune3.SetGoState(state);
GameObject rune4 = ObjectAccessor.GetGameObject(me, instance.GetGuidData(GameObjectsIds.EmberseerRune4));
if (rune4)
rune4.SetGoState(state);
GameObject rune5 = ObjectAccessor.GetGameObject(me, instance.GetGuidData(GameObjectsIds.EmberseerRune5));
if (rune5)
rune5.SetGoState(state);
GameObject rune6 = ObjectAccessor.GetGameObject(me, instance.GetGuidData(GameObjectsIds.EmberseerRune6));
if (rune6)
rune6.SetGoState(state);
GameObject rune7 = ObjectAccessor.GetGameObject(me, instance.GetGuidData(GameObjectsIds.EmberseerRune7));
if (rune7)
rune7.SetGoState(state);
}
public override void UpdateAI(uint diff)
{
_scheduler.Update(diff);
if (!UpdateVictim())
return;
DoMeleeAttackIfReady();
}
}
[Script]
class npc_blackhand_incarcerator : ScriptedAI
{
public npc_blackhand_incarcerator(Creature creature) : base(creature) { }
public override void JustAppeared()
{
DoCast(SpellIds.EncageEmberseer);
}
public override void JustEngagedWith(Unit who)
{
// Had to do this because CallForHelp will ignore any npcs without Los
List<Creature> creatureList = me.GetCreatureListWithEntryInGrid(CreaturesIds.BlackhandIncarcerator, 60.0f);
foreach (var creature in creatureList)
if (creature)
DoZoneInCombat(creature); // GetAI().AttackStart(me.GetVictim());
_scheduler.Schedule(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(16), task =>
{
DoCastVictim(SpellIds.Strike, new CastSpellExtraArgs(true));
task.Repeat(TimeSpan.FromSeconds(14), TimeSpan.FromSeconds(23));
});
_scheduler.Schedule(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20), task =>
{
DoCast(SelectTarget(SelectTargetMethod.Random, 0, 100, true), SpellIds.Encage, new CastSpellExtraArgs(true));
task.Repeat(TimeSpan.FromSeconds(6), TimeSpan.FromSeconds(12));
});
}
public override void JustReachedHome()
{
DoCast(SpellIds.EncageEmberseer);
me.SetImmuneToAll(true);
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,72 @@
/*
* 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 Game.AI;
using Game.Entities;
using Game.Scripting;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.QuartermasterZigris
{
struct SpellIds
{
public const uint Shoot = 16496;
public const uint Stunbomb = 16497;
public const uint HealingPotion = 15504;
public const uint Hookednet = 15609;
}
[Script]
class quartermaster_zigris : BossAI
{
public quartermaster_zigris(Creature creature) : base(creature, DataTypes.QuartermasterZigris) { }
public override void Reset()
{
_Reset();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(1), task =>
{
DoCastVictim(SpellIds.Shoot);
task.Repeat(TimeSpan.FromMilliseconds(500));
});
_scheduler.Schedule(TimeSpan.FromSeconds(16), task =>
{
DoCastVictim(SpellIds.Stunbomb);
task.Repeat(TimeSpan.FromSeconds(14));
});
}
public override void JustDied(Unit killer)
{
_JustDied();
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,523 @@
/*
* 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.BlackrockMountain.BlackrockSpire.RendBlackhand
{
struct SpellIds
{
public const uint Whirlwind = 13736; // sniffed
public const uint Cleave = 15284;
public const uint MortalStrike = 16856;
public const uint Frenzy = 8269;
public const uint Knockdown = 13360; // On spawn during Gyth fight
}
struct TextIds
{
// Rend Blackhand
public const uint SayBlackhand1 = 0;
public const uint SayBlackhand2 = 1;
public const uint EmoteBlackhandDismount = 2;
// Victor Nefarius
public const uint SayNefarius0 = 0;
public const uint SayNefarius1 = 1;
public const uint SayNefarius2 = 2;
public const uint SayNefarius3 = 3;
public const uint SayNefarius4 = 4;
public const uint SayNefarius5 = 5;
public const uint SayNefarius6 = 6;
public const uint SayNefarius7 = 7;
public const uint SayNefarius8 = 8;
public const uint SayNefarius9 = 9;
}
struct AddIds
{
public const uint ChromaticWhelp = 10442;
public const uint ChromaticDragonspawn = 10447;
public const uint BlackhandDragonHandler = 10742;
}
struct MiscConst
{
public const uint NefariusPath1 = 1379670;
public const uint NefariusPath2 = 1379671;
public const uint NefariusPath3 = 1379672;
public const uint RendPath1 = 1379680;
public const uint RendPath2 = 1379681;
public static Wave[] Wave2 = // 22 sec
{
new Wave(10447, 209.8637f, -428.2729f, 110.9877f, 0.6632251f),
new Wave(10442, 209.3122f, -430.8724f, 110.9814f, 2.9147f),
new Wave(10442, 211.3309f, -425.9111f, 111.0006f, 1.727876f)
};
public static Wave[] Wave3 = // 60 sec
{
new Wave(10742, 208.6493f, -424.5787f, 110.9872f, 5.8294f),
new Wave(10447, 203.9482f, -428.9446f, 110.982f, 4.677482f),
new Wave(10442, 203.3441f, -426.8668f, 110.9772f, 4.712389f),
new Wave(10442, 206.3079f, -424.7509f, 110.9943f, 4.08407f)
};
public static Wave[] Wave4 = // 49 sec
{
new Wave(10742, 212.3541f, -412.6826f, 111.0352f, 5.88176f),
new Wave(10447, 212.5754f, -410.2841f, 111.0296f, 2.740167f),
new Wave(10442, 212.3449f, -414.8659f, 111.0348f, 2.356194f),
new Wave(10442, 210.6568f, -412.1552f, 111.0124f, 0.9773844f)
};
public static Wave[] Wave5 = // 60 sec
{
new Wave(10742, 210.2188f, -410.6686f, 111.0211f, 5.8294f),
new Wave(10447, 209.4078f, -414.13f, 111.0264f, 4.677482f),
new Wave(10442, 208.0858f, -409.3145f, 111.0118f, 4.642576f),
new Wave(10442, 207.9811f, -413.0728f, 111.0098f, 5.288348f),
new Wave(10442, 208.0854f, -412.1505f, 111.0057f, 4.08407f)
};
public static Wave[] Wave6 = // 27 sec
{
new Wave(10742, 213.9138f, -426.512f, 111.0013f, 3.316126f),
new Wave(10447, 213.7121f, -429.8102f, 110.9888f, 1.413717f),
new Wave(10447, 213.7157f, -424.4268f, 111.009f, 3.001966f),
new Wave(10442, 210.8935f, -423.913f, 111.0125f, 5.969026f),
new Wave(10442, 212.2642f, -430.7648f, 110.9807f, 5.934119f)
};
public static Position GythLoc = new Position(211.762f, -397.5885f, 111.1817f, 4.747295f);
public static Position Teleport1Loc = new Position(194.2993f, -474.0814f, 121.4505f, -0.01225555f);
public static Position Teleport2Loc = new Position(216.485f, -434.93f, 110.888f, -0.01225555f);
}
class Wave
{
public uint entry;
public float x_pos;
public float y_pos;
public float z_pos;
public float o_pos;
public Wave(uint _entry, float x, float y, float z, float o)
{
entry = _entry;
x_pos = x;
y_pos = y;
z_pos = z;
o_pos = o;
}
}
struct EventIds
{
public const uint Start1 = 1;
public const uint Start2 = 2;
public const uint Start3 = 3;
public const uint Start4 = 4;
public const uint TurnToRend = 5;
public const uint TurnToPlayer = 6;
public const uint TurnToFacing1 = 7;
public const uint TurnToFacing2 = 8;
public const uint TurnToFacing3 = 9;
public const uint Wave1 = 10;
public const uint Wave2 = 11;
public const uint Wave3 = 12;
public const uint Wave4 = 13;
public const uint Wave5 = 14;
public const uint Wave6 = 15;
public const uint WavesText1 = 16;
public const uint WavesText2 = 17;
public const uint WavesText3 = 18;
public const uint WavesText4 = 19;
public const uint WavesText5 = 20;
public const uint WavesCompleteText1 = 21;
public const uint WavesCompleteText2 = 22;
public const uint WavesCompleteText3 = 23;
public const uint WavesEmote1 = 24;
public const uint WavesEmote2 = 25;
public const uint PathRend = 26;
public const uint PathNefarius = 27;
public const uint Teleport1 = 28;
public const uint Teleport2 = 29;
public const uint Whirlwind = 30;
public const uint Cleave = 31;
public const uint MortalStrike = 32;
}
[Script]
class boss_rend_blackhand : BossAI
{
bool gythEvent;
ObjectGuid victorGUID;
ObjectGuid portcullisGUID;
public boss_rend_blackhand(Creature creature) : base(creature, DataTypes.WarchiefRendBlackhand) { }
public override void Reset()
{
_Reset();
gythEvent = false;
victorGUID.Clear();
portcullisGUID.Clear();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_events.ScheduleEvent(EventIds.Whirlwind, TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(15));
_events.ScheduleEvent(EventIds.Cleave, TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(17));
_events.ScheduleEvent(EventIds.MortalStrike, TimeSpan.FromSeconds(17), TimeSpan.FromSeconds(19));
}
public override void IsSummonedBy(WorldObject summoner)
{
me.SetImmuneToPC(false);
DoZoneInCombat();
}
public override void JustDied(Unit killer)
{
_JustDied();
Creature victor = me.FindNearestCreature(CreaturesIds.LordVictorNefarius, 75.0f, true);
if (victor != null)
victor.GetAI().SetData(1, 2);
}
public override void SetData(uint type, uint data)
{
if (type == BRSMiscConst.Areatrigger && data == BRSMiscConst.AreatriggerBlackrockStadium)
{
if (!gythEvent)
{
gythEvent = true;
Creature victor = me.FindNearestCreature(CreaturesIds.LordVictorNefarius, 5.0f, true);
if (victor != null)
victorGUID = victor.GetGUID();
GameObject portcullis = me.FindNearestGameObject(GameObjectsIds.DrPortcullis, 50.0f);
if (portcullis != null)
portcullisGUID = portcullis.GetGUID();
_events.ScheduleEvent(EventIds.TurnToPlayer, TimeSpan.FromSeconds(0));
_events.ScheduleEvent(EventIds.Start1, TimeSpan.FromSeconds(1));
}
}
}
public override void MovementInform(MovementGeneratorType type, uint id)
{
if (type == MovementGeneratorType.Waypoint)
{
switch (id)
{
case 5:
_events.ScheduleEvent(EventIds.Teleport1, TimeSpan.FromSeconds(2));
break;
case 11:
Creature gyth = me.FindNearestCreature(CreaturesIds.Gyth, 10.0f, true);
if (gyth)
gyth.GetAI().SetData(1, 1);
me.DespawnOrUnsummon(TimeSpan.FromSeconds(1), TimeSpan.FromDays(7));
break;
}
}
}
public override void UpdateAI(uint diff)
{
if (gythEvent)
{
_events.Update(diff);
_events.ExecuteEvents(eventId =>
{
switch (eventId)
{
case EventIds.Start1:
{
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.GetAI().Talk(TextIds.SayNefarius0);
_events.ScheduleEvent(EventIds.Start2, TimeSpan.FromSeconds(4));
break;
}
case EventIds.Start2:
{
_events.ScheduleEvent(EventIds.TurnToPlayer, TimeSpan.FromSeconds(0));
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.HandleEmoteCommand(Emote.OneshotPoint);
_events.ScheduleEvent(EventIds.Start3, TimeSpan.FromSeconds(4));
break;
}
case EventIds.Start3:
{
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.GetAI().Talk(TextIds.SayNefarius1);
_events.ScheduleEvent(EventIds.Wave1, TimeSpan.FromSeconds(2));
_events.ScheduleEvent(EventIds.TurnToRend, TimeSpan.FromSeconds(4));
_events.ScheduleEvent(EventIds.WavesText1, TimeSpan.FromSeconds(20));
break;
}
case EventIds.TurnToRend:
{
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
{
victor.SetFacingToObject(me);
victor.HandleEmoteCommand(Emote.OneshotTalk);
}
break;
}
case EventIds.TurnToPlayer:
{
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
{
Unit player = victor.SelectNearestPlayer(60.0f);
if (player != null)
victor.SetFacingToObject(player);
}
break;
}
case EventIds.TurnToFacing1:
{
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.SetFacingTo(1.518436f);
break;
}
case EventIds.TurnToFacing2:
me.SetFacingTo(1.658063f);
break;
case EventIds.TurnToFacing3:
me.SetFacingTo(1.500983f);
break;
case EventIds.WavesEmote1:
{
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.HandleEmoteCommand(Emote.OneshotQuestion);
break;
}
case EventIds.WavesEmote2:
me.HandleEmoteCommand(Emote.OneshotRoar);
break;
case EventIds.WavesText1:
{
_events.ScheduleEvent(EventIds.TurnToPlayer, TimeSpan.FromSeconds(0));
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.GetAI().Talk(TextIds.SayNefarius2);
me.HandleEmoteCommand(Emote.OneshotTalk);
_events.ScheduleEvent(EventIds.TurnToFacing1, TimeSpan.FromSeconds(4));
_events.ScheduleEvent(EventIds.WavesEmote1, TimeSpan.FromSeconds(5));
_events.ScheduleEvent(EventIds.Wave2, TimeSpan.FromSeconds(2));
_events.ScheduleEvent(EventIds.WavesText2, TimeSpan.FromSeconds(20));
break;
}
case EventIds.WavesText2:
{
_events.ScheduleEvent(EventIds.TurnToPlayer, TimeSpan.FromSeconds(0));
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.GetAI().Talk(TextIds.SayNefarius3);
_events.ScheduleEvent(EventIds.TurnToFacing1, TimeSpan.FromSeconds(4));
_events.ScheduleEvent(EventIds.Wave3, TimeSpan.FromSeconds(2));
_events.ScheduleEvent(EventIds.WavesText3, TimeSpan.FromSeconds(20));
break;
}
case EventIds.WavesText3:
{
_events.ScheduleEvent(EventIds.TurnToPlayer, TimeSpan.FromSeconds(0));
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.GetAI().Talk(TextIds.SayNefarius4);
_events.ScheduleEvent(EventIds.TurnToFacing1, TimeSpan.FromSeconds(4));
_events.ScheduleEvent(EventIds.Wave4, TimeSpan.FromSeconds(2));
_events.ScheduleEvent(EventIds.WavesText4, TimeSpan.FromSeconds(20));
break;
}
case EventIds.WavesText4:
Talk(TextIds.SayBlackhand1);
_events.ScheduleEvent(EventIds.WavesEmote2, TimeSpan.FromSeconds(4));
_events.ScheduleEvent(EventIds.TurnToFacing3, TimeSpan.FromSeconds(8));
_events.ScheduleEvent(EventIds.Wave5, TimeSpan.FromSeconds(2));
_events.ScheduleEvent(EventIds.WavesText5, TimeSpan.FromSeconds(20));
break;
case EventIds.WavesText5:
{
_events.ScheduleEvent(EventIds.TurnToPlayer, TimeSpan.FromSeconds(0));
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.GetAI().Talk(TextIds.SayNefarius5);
_events.ScheduleEvent(EventIds.TurnToFacing1, TimeSpan.FromSeconds(4));
_events.ScheduleEvent(EventIds.Wave6, TimeSpan.FromSeconds(2));
_events.ScheduleEvent(EventIds.WavesCompleteText1, TimeSpan.FromSeconds(20));
break;
}
case EventIds.WavesCompleteText1:
{
_events.ScheduleEvent(EventIds.TurnToPlayer, TimeSpan.FromSeconds(0));
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.GetAI().Talk(TextIds.SayNefarius6);
_events.ScheduleEvent(EventIds.TurnToFacing1, TimeSpan.FromSeconds(4));
_events.ScheduleEvent(EventIds.WavesCompleteText2, TimeSpan.FromSeconds(13));
break;
}
case EventIds.WavesCompleteText2:
{
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.GetAI().Talk(TextIds.SayNefarius7);
Talk(TextIds.SayBlackhand2);
_events.ScheduleEvent(EventIds.PathRend, TimeSpan.FromSeconds(1));
_events.ScheduleEvent(EventIds.WavesCompleteText3, TimeSpan.FromSeconds(4));
break;
}
case EventIds.WavesCompleteText3:
{
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.GetAI().Talk(TextIds.SayNefarius8);
_events.ScheduleEvent(EventIds.PathNefarius, TimeSpan.FromSeconds(1));
_events.ScheduleEvent(EventIds.PathRend, TimeSpan.FromSeconds(1));
break;
}
case EventIds.PathNefarius:
{
Creature victor = ObjectAccessor.GetCreature(me, victorGUID);
if (victor != null)
victor.GetMotionMaster().MovePath(MiscConst.NefariusPath1, true);
break;
}
case EventIds.PathRend:
me.GetMotionMaster().MovePath(MiscConst.RendPath1, false);
break;
case EventIds.Teleport1:
me.NearTeleportTo(194.2993f, -474.0814f, 121.4505f, -0.01225555f);
_events.ScheduleEvent(EventIds.Teleport2, TimeSpan.FromSeconds(50));
break;
case EventIds.Teleport2:
me.NearTeleportTo(216.485f, -434.93f, 110.888f, -0.01225555f);
me.SummonCreature(CreaturesIds.Gyth, 211.762f, -397.5885f, 111.1817f, 4.747295f);
break;
case EventIds.Wave1:
{
GameObject portcullis = ObjectAccessor.GetGameObject(me, portcullisGUID);
if (portcullis != null)
portcullis.UseDoorOrButton();
// move wave
break;
}
case EventIds.Wave2:
{
// spawn wave
GameObject portcullis = ObjectAccessor.GetGameObject(me, portcullisGUID);
if (portcullis != null)
portcullis.UseDoorOrButton();
// move wave
break;
}
case EventIds.Wave3:
{
// spawn wave
GameObject portcullis = ObjectAccessor.GetGameObject(me, portcullisGUID);
if (portcullis != null)
portcullis.UseDoorOrButton();
// move wave
break;
}
case EventIds.Wave4:
{
// spawn wave
GameObject portcullis = ObjectAccessor.GetGameObject(me, portcullisGUID);
if (portcullis != null)
portcullis.UseDoorOrButton();
// move wave
break;
}
case EventIds.Wave5:
{
// spawn wave
GameObject portcullis = ObjectAccessor.GetGameObject(me, portcullisGUID);
if (portcullis != null)
portcullis.UseDoorOrButton();
// move wave
break;
}
case EventIds.Wave6:
{
// spawn wave
GameObject portcullis = ObjectAccessor.GetGameObject(me, portcullisGUID);
if (portcullis != null)
portcullis.UseDoorOrButton();
// move wave
break;
}
default:
break;
}
});
}
if (!UpdateVictim())
return;
_events.Update(diff);
if (me.HasUnitState(UnitState.Casting))
return;
_events.ExecuteEvents(eventId =>
{
switch (eventId)
{
case EventIds.Whirlwind:
DoCast(SpellIds.Whirlwind);
_events.ScheduleEvent(EventIds.Whirlwind, TimeSpan.FromSeconds(13), TimeSpan.FromSeconds(18));
break;
case EventIds.Cleave:
DoCastVictim(SpellIds.Cleave);
_events.ScheduleEvent(EventIds.Cleave, TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(14));
break;
case EventIds.MortalStrike:
DoCastVictim(SpellIds.MortalStrike);
_events.ScheduleEvent(EventIds.MortalStrike, TimeSpan.FromSeconds(14), TimeSpan.FromSeconds(16));
break;
}
if (me.HasUnitState(UnitState.Casting))
return;
});
DoMeleeAttackIfReady();
}
}
}
@@ -0,0 +1,80 @@
/*
* 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 Game.AI;
using Game.Entities;
using Game.Scripting;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.ShadowHunterVoshgajin
{
struct SpellIds
{
public const uint Curseofblood = 24673;
public const uint Hex = 16708;
public const uint Cleave = 20691;
}
[Script]
class boss_shadow_hunter_voshgajin : BossAI
{
public boss_shadow_hunter_voshgajin(Creature creature) : base(creature, DataTypes.ShadowHunterVoshgajin) { }
public override void Reset()
{
_Reset();
//DoCast(me, SpellIcearmor, true);
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
{
DoCastVictim(SpellIds.Curseofblood);
task.Repeat(TimeSpan.FromSeconds(45));
});
_scheduler.Schedule(TimeSpan.FromSeconds(8), task =>
{
Unit target = SelectTarget(SelectTargetMethod.Random, 0, 100, true);
if (target)
DoCast(target, SpellIds.Hex);
task.Repeat(TimeSpan.FromSeconds(15));
});
_scheduler.Schedule(TimeSpan.FromSeconds(14), task =>
{
DoCastVictim(SpellIds.Cleave);
task.Repeat(TimeSpan.FromSeconds(7));
});
}
public override void JustDied(Unit killer)
{
_JustDied();
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,79 @@
/*
* 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 Game.AI;
using Game.Entities;
using Game.Scripting;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.Thebeast
{
struct SpellIds
{
public const uint Flamebreak = 16785;
public const uint Immolate = 20294;
public const uint Terrifyingroar = 14100;
}
[Script]
class boss_thebeast : BossAI
{
public boss_thebeast(Creature creature) : base(creature, DataTypes.TheBeast) { }
public override void Reset()
{
_Reset();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
{
DoCastVictim(SpellIds.Flamebreak);
task.Repeat(TimeSpan.FromSeconds(10));
});
_scheduler.Schedule(TimeSpan.FromSeconds(3), task =>
{
Unit target = SelectTarget(SelectTargetMethod.Random, 0, 100, true);
if (target)
DoCast(target, SpellIds.Immolate);
task.Repeat(TimeSpan.FromSeconds(8));
});
_scheduler.Schedule(TimeSpan.FromSeconds(23), task =>
{
DoCastVictim(SpellIds.Terrifyingroar);
task.Repeat(TimeSpan.FromSeconds(20));
});
}
public override void JustDied(Unit killer)
{
_JustDied();
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,79 @@
/*
* 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 Game.AI;
using Game.Entities;
using Game.Scripting;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.UrokDoomhowl
{
struct SpellIds
{
public const uint Rend = 16509;
public const uint Strike = 15580;
public const uint IntimidatingRoar = 16508;
}
struct TextIds
{
public const uint SaySummon = 0;
public const uint SayAggro = 1;
}
[Script]
class boss_urok_doomhowl : BossAI
{
public boss_urok_doomhowl(Creature creature) : base(creature, DataTypes.UrokDoomhowl) { }
public override void Reset()
{
_Reset();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(17), TimeSpan.FromSeconds(20), task =>
{
DoCastVictim(SpellIds.Rend);
task.Repeat(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(10));
});
_scheduler.Schedule(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(12), task =>
{
DoCastVictim(SpellIds.Strike);
task.Repeat(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(10));
});
Talk(TextIds.SayAggro);
}
public override void JustDied(Unit killer)
{
_JustDied();
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}
@@ -0,0 +1,95 @@
/*
* 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 Game.AI;
using Game.Entities;
using Game.Scripting;
using System;
namespace Scripts.EasternKingdoms.BlackrockMountain.BlackrockSpire.WarmasterVoone
{
struct SpellIds
{
public const uint Snapkick = 15618;
public const uint Cleave = 15284;
public const uint Uppercut = 10966;
public const uint Mortalstrike = 16856;
public const uint Pummel = 15615;
public const uint Throwaxe = 16075;
}
[Script]
class boss_warmaster_voone : BossAI
{
public boss_warmaster_voone(Creature creature) : base(creature, DataTypes.WarmasterVoone) { }
public override void Reset()
{
_Reset();
}
public override void JustEngagedWith(Unit who)
{
base.JustEngagedWith(who);
_scheduler.Schedule(TimeSpan.FromSeconds(8), task =>
{
DoCastVictim(SpellIds.Snapkick);
task.Repeat(TimeSpan.FromSeconds(6));
});
_scheduler.Schedule(TimeSpan.FromSeconds(14), task =>
{
DoCastVictim(SpellIds.Cleave);
task.Repeat(TimeSpan.FromSeconds(12));
});
_scheduler.Schedule(TimeSpan.FromSeconds(20), task =>
{
DoCastVictim(SpellIds.Uppercut);
task.Repeat(TimeSpan.FromSeconds(14));
});
_scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
{
DoCastVictim(SpellIds.Mortalstrike);
task.Repeat(TimeSpan.FromSeconds(10));
});
_scheduler.Schedule(TimeSpan.FromSeconds(32), task =>
{
DoCastVictim(SpellIds.Pummel);
task.Repeat(TimeSpan.FromSeconds(16));
});
_scheduler.Schedule(TimeSpan.FromSeconds(1), task =>
{
DoCastVictim(SpellIds.Throwaxe);
task.Repeat(TimeSpan.FromSeconds(8));
});
}
public override void JustDied(Unit killer)
{
_JustDied();
}
public override void UpdateAI(uint diff)
{
if (!UpdateVictim())
return;
_scheduler.Update(diff, () => DoMeleeAttackIfReady());
}
}
}