Core/Battlegrounds: Move to scripts And a lot of misc commits i couldn't recover.
Port From (https://github.com/TrinityCore/TrinityCore/commit/d0d5d309bb5877dc2fcb27f6cb123707a31ec1e8)
This commit is contained in:
@@ -0,0 +1,250 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Game;
|
||||
using Game.AI;
|
||||
using Game.DataStorage;
|
||||
using Game.Entities;
|
||||
using Game.Maps;
|
||||
using Game.Scripting;
|
||||
using System;
|
||||
|
||||
namespace Scripts.Battlegrounds.AlteracValley
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint Charge = 22911;
|
||||
public const uint Cleave = 40504;
|
||||
public const uint DemoralizingShout = 23511;
|
||||
public const uint Enrage = 8599;
|
||||
public const uint Whirlwind = 13736;
|
||||
|
||||
public const uint NorthMarshal = 45828;
|
||||
public const uint SouthMarshal = 45829;
|
||||
public const uint StonehearthMarshal = 45830;
|
||||
public const uint IcewingMarshal = 45831;
|
||||
public const uint IcebloodWarmaster = 45822;
|
||||
public const uint TowerPointWarmaster = 45823;
|
||||
public const uint WestFrostwolfWarmaster = 45824;
|
||||
public const uint EastFrostwolfWarmaster = 45826;
|
||||
}
|
||||
|
||||
enum CreatureIds
|
||||
{
|
||||
NorthMarshal = 14762,
|
||||
SouthMarshal = 14763,
|
||||
IcewingMarshal = 14764,
|
||||
StonehearthMarshal = 14765,
|
||||
EastFrostwolfWarmaster = 14772,
|
||||
IcebloodWarmaster = 14773,
|
||||
TowerPointWarmaster = 14776,
|
||||
WestFrostwolfWarmaster = 14777,
|
||||
|
||||
Vanndar = 11948,
|
||||
Drekthar = 11946,
|
||||
Balinda = 11949,
|
||||
Galvangar = 11947,
|
||||
Morloch = 11657,
|
||||
UmiThorson = 13078,
|
||||
Keetar = 13079,
|
||||
TaskmasterSnivvle = 11677,
|
||||
AgiRumblestomp = 13086,
|
||||
MashaSwiftcut = 13088,
|
||||
Herald = 14848,
|
||||
|
||||
StormpikeDefender = 12050,
|
||||
FrostwolfGuardian = 12053,
|
||||
SeasonedDefender = 13326,
|
||||
SeasonedGuardian = 13328,
|
||||
VeteranDefender = 13331,
|
||||
VeteranGuardian = 13332,
|
||||
ChampionDefender = 13422,
|
||||
ChampionGuardian = 13421
|
||||
}
|
||||
|
||||
enum SharedActions
|
||||
{
|
||||
BuffYell = -30001,
|
||||
InteractCapturableObject = 1,
|
||||
CaptureCapturableObject = 2,
|
||||
|
||||
TurnInScraps = 3,
|
||||
TurnInCommander1 = 4,
|
||||
TurnInCommander2 = 5,
|
||||
TurnInCommander3 = 6,
|
||||
TurnInBoss1,
|
||||
TurnInBoss2,
|
||||
TurnInNearMine,
|
||||
TurnInOtherMine,
|
||||
TurnInRiderHide,
|
||||
TurnInRiderTame
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_av_marshal_or_warmaster : ScriptedAI
|
||||
{
|
||||
public npc_av_marshal_or_warmaster(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
_scheduler.CancelAll();
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(12), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Charge);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(11), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Cleave);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(16));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(2), task =>
|
||||
{
|
||||
DoCast(me, SpellIds.DemoralizingShout);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(15));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(20), task =>
|
||||
{
|
||||
DoCast(me, SpellIds.Whirlwind);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(20), task =>
|
||||
{
|
||||
DoCast(me, SpellIds.Enrage);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(30));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
|
||||
{
|
||||
Position _homePosition = me.GetHomePosition();
|
||||
if (me.GetDistance2d(_homePosition.GetPositionX(), _homePosition.GetPositionY()) > 50.0f)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
return;
|
||||
}
|
||||
task.Repeat(TimeSpan.FromSeconds(5));
|
||||
});
|
||||
}
|
||||
|
||||
public override void JustAppeared()
|
||||
{
|
||||
Reset();
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class go_av_capturable_object : GameObjectAI
|
||||
{
|
||||
public go_av_capturable_object(GameObject go) : base(go) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
me.SetActive(true);
|
||||
}
|
||||
|
||||
public override bool OnGossipHello(Player player)
|
||||
{
|
||||
if (me.GetGoState() != GameObjectState.Ready)
|
||||
return true;
|
||||
|
||||
ZoneScript zonescript = me.GetZoneScript();
|
||||
if (zonescript != null)
|
||||
{
|
||||
zonescript.DoAction(1, player, me);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class go_av_contested_object : GameObjectAI
|
||||
{
|
||||
public go_av_contested_object(GameObject go) : base(go) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
me.SetActive(true);
|
||||
_scheduler.Schedule(TimeSpan.FromMinutes(4), _ =>
|
||||
{
|
||||
ZoneScript zonescript = me.GetZoneScript();
|
||||
if (zonescript != null)
|
||||
zonescript.DoAction(2, me, me);
|
||||
});
|
||||
}
|
||||
|
||||
public override bool OnGossipHello(Player player)
|
||||
{
|
||||
if (me.GetGoState() != GameObjectState.Ready)
|
||||
return true;
|
||||
|
||||
ZoneScript zonescript = me.GetZoneScript();
|
||||
if (zonescript != null)
|
||||
{
|
||||
zonescript.DoAction(1, player, me);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
|
||||
[Script]
|
||||
class at_av_exploit : AreaTriggerScript
|
||||
{
|
||||
public at_av_exploit() : base("at_av_exploit") { }
|
||||
|
||||
public override bool OnTrigger(Player player, AreaTriggerRecord trigger)
|
||||
{
|
||||
var battleground = player.GetBattleground();
|
||||
if (battleground != null && battleground.GetStatus() == BattlegroundStatus.WaitJoin)
|
||||
battleground.TeleportPlayerToExploitLocation(player);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
[Script("quest_alterac_valley_armor_scraps", SharedActions.TurnInScraps)]
|
||||
[Script("quest_alterac_valley_call_of_air_slidore_guse", SharedActions.TurnInCommander1)]
|
||||
[Script("quest_alterac_valley_call_of_air_vipore_jeztor", SharedActions.TurnInCommander2)]
|
||||
[Script("quest_alterac_valley_call_of_air_ichman_mulverick", SharedActions.TurnInCommander3)]
|
||||
[Script("quest_alterac_valley_boss_5", SharedActions.TurnInBoss1)]
|
||||
[Script("quest_alterac_valley_boss_1", SharedActions.TurnInBoss2)]
|
||||
[Script("quest_alterac_valley_near_mine", SharedActions.TurnInNearMine)]
|
||||
[Script("quest_alterac_valley_other_mine", SharedActions.TurnInOtherMine)]
|
||||
[Script("quest_alterac_valley_ram_harnesses", SharedActions.TurnInRiderHide)]
|
||||
[Script("quest_alterac_valley_empty_stables", SharedActions.TurnInRiderTame)]
|
||||
class quest_alterac_valley : QuestScript
|
||||
{
|
||||
uint _actionId;
|
||||
|
||||
public quest_alterac_valley(string scriptName, SharedActions actionId) : base(scriptName)
|
||||
{
|
||||
_actionId = (uint)actionId;
|
||||
}
|
||||
|
||||
public override void OnQuestStatusChange(Player player, Quest quest, QuestStatus oldStatus, QuestStatus newStatus)
|
||||
{
|
||||
if (newStatus != QuestStatus.Rewarded)
|
||||
return;
|
||||
|
||||
ZoneScript zoneScript = player.FindZoneScript();
|
||||
if (zoneScript != null)
|
||||
zoneScript.DoAction(_actionId, player, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,147 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Framework.Constants;
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using Game.Spells;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Scripts.Battlegrounds.AlteracValley.Balinda
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint ArcaneExplosion = 46608;
|
||||
public const uint ConeOfCold = 38384;
|
||||
public const uint Fireball = 46988;
|
||||
public const uint Frostbolt = 46987;
|
||||
public const uint SummonWaterElemental = 45067;
|
||||
public const uint Iceblock = 46604;
|
||||
}
|
||||
|
||||
struct TextIds
|
||||
{
|
||||
public const uint SayAggro = 0;
|
||||
public const uint SayEvade = 1;
|
||||
public const uint SaySalvation = 2;
|
||||
}
|
||||
|
||||
struct ActionIds
|
||||
{
|
||||
public const int BuffYell = -30001; // shared from Battleground
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_balinda : ScriptedAI
|
||||
{
|
||||
SummonList summons;
|
||||
ObjectGuid WaterElementalGUID;
|
||||
bool HasCastIceblock;
|
||||
|
||||
public boss_balinda(Creature creature) : base(creature)
|
||||
{
|
||||
summons = new(me);
|
||||
Initialize();
|
||||
}
|
||||
|
||||
void Initialize()
|
||||
{
|
||||
WaterElementalGUID.Clear();
|
||||
HasCastIceblock = false;
|
||||
}
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
Initialize();
|
||||
_scheduler.CancelAll();
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
public override void JustEngagedWith(Unit who)
|
||||
{
|
||||
Talk(TextIds.SayAggro);
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(15), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.ArcaneExplosion);
|
||||
task.Repeat();
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(8), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.ConeOfCold);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(20));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(1), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Fireball);
|
||||
task.Repeat(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(9));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(4), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Frostbolt);
|
||||
task.Repeat(TimeSpan.FromSeconds(4), TimeSpan.FromSeconds(12));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(3), task =>
|
||||
{
|
||||
if (summons.Empty())
|
||||
DoCast(SpellIds.SummonWaterElemental);
|
||||
task.Repeat(TimeSpan.FromSeconds(50));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
|
||||
{
|
||||
if (me.GetDistance2d(me.GetHomePosition().GetPositionX(), me.GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
Talk(TextIds.SayEvade);
|
||||
}
|
||||
Creature elemental = ObjectAccessor.GetCreature(me, WaterElementalGUID);
|
||||
if (elemental != null)
|
||||
if (elemental.GetDistance2d(me.GetHomePosition().GetPositionX(), me.GetHomePosition().GetPositionY()) > 50)
|
||||
elemental.GetAI().EnterEvadeMode();
|
||||
task.Repeat();
|
||||
});
|
||||
}
|
||||
|
||||
public override void JustSummoned(Creature summoned)
|
||||
{
|
||||
summoned.GetAI().AttackStart(SelectTarget(SelectTargetMethod.Random, 0, 50, true));
|
||||
summoned.SetFaction(me.GetFaction());
|
||||
WaterElementalGUID = summoned.GetGUID();
|
||||
summons.Summon(summoned);
|
||||
}
|
||||
|
||||
public override void SummonedCreatureDespawn(Creature summoned)
|
||||
{
|
||||
summons.Despawn(summoned);
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
summons.DespawnAll();
|
||||
}
|
||||
|
||||
public override void DoAction(int actionId)
|
||||
{
|
||||
if (actionId == ActionIds.BuffYell)
|
||||
Talk(TextIds.SayAggro);
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage, DamageEffectType damageType, SpellInfo spellInfo = null)
|
||||
{
|
||||
if (me.HealthBelowPctDamaged(40, damage) && !HasCastIceblock)
|
||||
{
|
||||
DoCast(SpellIds.Iceblock);
|
||||
HasCastIceblock = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,97 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using System;
|
||||
|
||||
namespace Scripts.Battlegrounds.AlteracValley.Drekthar
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint Whirlwind = 15589;
|
||||
public const uint Whirlwind2 = 13736;
|
||||
public const uint Knockdown = 19128;
|
||||
public const uint Frenzy = 8269;
|
||||
public const uint SweepingStrikes = 18765; // not sure
|
||||
public const uint Cleave = 20677; // not sure
|
||||
public const uint Windfury = 35886; // not sure
|
||||
public const uint Stormpike = 51876; // not sure
|
||||
}
|
||||
|
||||
struct TextIds
|
||||
{
|
||||
public const uint SayAggro = 0;
|
||||
public const uint SayEvade = 1;
|
||||
public const uint SayRespawn = 2;
|
||||
public const uint SayRandom = 3;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_drekthar : ScriptedAI
|
||||
{
|
||||
public boss_drekthar(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
_scheduler.CancelAll();
|
||||
}
|
||||
|
||||
public override void JustEngagedWith(Unit who)
|
||||
{
|
||||
Talk(TextIds.SayAggro);
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(20), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Whirlwind);
|
||||
task.Repeat(TimeSpan.FromSeconds(8), TimeSpan.FromSeconds(18));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(20), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Whirlwind2);
|
||||
task.Repeat(TimeSpan.FromSeconds(7), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(12), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Knockdown);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(15));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(6), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Frenzy);
|
||||
task.Repeat(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(30));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(30), task =>
|
||||
{
|
||||
Talk(TextIds.SayRandom);
|
||||
task.Repeat();
|
||||
});
|
||||
}
|
||||
|
||||
public override void JustAppeared()
|
||||
{
|
||||
Reset();
|
||||
Talk(TextIds.SayRespawn);
|
||||
}
|
||||
|
||||
public override bool CheckInRoom()
|
||||
{
|
||||
if (me.GetDistance2d(me.GetHomePosition().GetPositionX(), me.GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
Talk(TextIds.SayEvade);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using System;
|
||||
|
||||
namespace Scripts.Battlegrounds.AlteracValley.Galvangar
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint Cleave = 15284;
|
||||
public const uint FrighteningShout = 19134;
|
||||
public const uint Whirlwind1 = 15589;
|
||||
public const uint Whirlwind2 = 13736;
|
||||
public const uint MortalStrike = 16856;
|
||||
}
|
||||
|
||||
struct TextIds
|
||||
{
|
||||
public const uint SayAggro = 0;
|
||||
public const uint SayEvade = 1;
|
||||
public const uint SayBuff = 2;
|
||||
}
|
||||
|
||||
struct ActionIds
|
||||
{
|
||||
public const int BuffYell = -30001; // shared from Battleground
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_galvangar : ScriptedAI
|
||||
{
|
||||
public boss_galvangar(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
_scheduler.CancelAll();
|
||||
}
|
||||
|
||||
public override void JustEngagedWith(Unit who)
|
||||
{
|
||||
Talk(TextIds.SayAggro);
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(9), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Cleave);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(16));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(2), TimeSpan.FromSeconds(19), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.FrighteningShout);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(15));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(13), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Whirlwind1);
|
||||
task.Repeat(TimeSpan.FromSeconds(6), TimeSpan.FromSeconds(10));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(20), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Whirlwind2);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(20), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.MortalStrike);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(30));
|
||||
});
|
||||
}
|
||||
|
||||
public override void DoAction(int actionId)
|
||||
{
|
||||
if (actionId == ActionIds.BuffYell)
|
||||
Talk(TextIds.SayBuff);
|
||||
}
|
||||
|
||||
public override bool CheckInRoom()
|
||||
{
|
||||
if (me.GetDistance2d(me.GetHomePosition().GetPositionX(), me.GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
Talk(TextIds.SayEvade);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim() || !CheckInRoom())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
// Copyright (c) CypherCore <http://github.com/CypherCore> All rights reserved.
|
||||
// Licensed under the GNU GENERAL PUBLIC LICENSE. See LICENSE file in the project root for full license information.
|
||||
|
||||
using Game.AI;
|
||||
using Game.Entities;
|
||||
using Game.Scripting;
|
||||
using System;
|
||||
|
||||
namespace Scripts.Battlegrounds.AlteracValley.Vanndar
|
||||
{
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint Avatar = 19135;
|
||||
public const uint Thunderclap = 15588;
|
||||
public const uint Stormbolt = 20685; // not sure
|
||||
}
|
||||
|
||||
struct TextIds
|
||||
{
|
||||
public const uint YellAggro = 0;
|
||||
public const uint YellEvade = 1;
|
||||
//public const uint YellRespawn1 = -1810010; // Missing in database
|
||||
//public const uint YellRespawn2 = -1810011; // Missing in database
|
||||
public const uint YellRandom = 2;
|
||||
public const uint YellSpell = 3;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_vanndar : ScriptedAI
|
||||
{
|
||||
public boss_vanndar(Creature creature) : base(creature) { }
|
||||
|
||||
public override void Reset()
|
||||
{
|
||||
_scheduler.CancelAll();
|
||||
}
|
||||
|
||||
public override void JustEngagedWith(Unit who)
|
||||
{
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(3), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Avatar);
|
||||
task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(20));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(4), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Thunderclap);
|
||||
task.Repeat(TimeSpan.FromSeconds(5), TimeSpan.FromSeconds(15));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(6), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.Stormbolt);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(25));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(30), task =>
|
||||
{
|
||||
Talk(TextIds.YellRandom);
|
||||
task.Repeat(TimeSpan.FromSeconds(20), TimeSpan.FromSeconds(30));
|
||||
});
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(5), task =>
|
||||
{
|
||||
if (me.GetDistance2d(me.GetHomePosition().GetPositionX(), me.GetHomePosition().GetPositionY()) > 50)
|
||||
{
|
||||
EnterEvadeMode();
|
||||
Talk(TextIds.YellEvade);
|
||||
}
|
||||
task.Repeat();
|
||||
});
|
||||
|
||||
Talk(TextIds.YellAggro);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user