Ported .Net Core commits:
hondacrx: - Initial commit: Switch to .Net Core 2.0 - Fix build and removed not needed files Fabi: - Updated solution platforms. - Changed folder structure. - Change library target framework to netstandard2.0. - Updated solution platforms again... - Removed windows specific kernel32 function usage (Ctrl-C handler).
This commit is contained in:
@@ -0,0 +1,133 @@
|
||||
using System;
|
||||
using Game.Entities;
|
||||
using Game.AI;
|
||||
using Game.Scripting;
|
||||
using Framework.Constants;
|
||||
|
||||
namespace Scripts.EasternKingdoms.TheStockade
|
||||
{
|
||||
struct TextIds
|
||||
{
|
||||
public const uint SayPull = 0; // Forest Just Setback!
|
||||
public const uint SayEnrage = 1; // Areatriggermessage: Hogger Enrages!
|
||||
public const uint SayDeath = 2; // Yiipe!
|
||||
|
||||
public const uint SayWarden1 = 0; // Yell - This Ends Here; Hogger!
|
||||
public const uint SayWarden2 = 1; // Say - He'S...He'S Dead?
|
||||
public const uint SayWarden3 = 2; // Say - It'S Simply Too Good To Be True. You Couldn'T Have Killed Him So Easily!
|
||||
}
|
||||
|
||||
struct SpellIds
|
||||
{
|
||||
public const uint ViciousSlice = 86604;
|
||||
public const uint MaddeningCall = 86620;
|
||||
public const uint Enrage = 86736;
|
||||
}
|
||||
|
||||
struct Events
|
||||
{
|
||||
public const uint SayWarden1 = 1;
|
||||
public const uint SayWarden2 = 2;
|
||||
public const uint SayWarden3 = 3;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class boss_hogger : BossAI
|
||||
{
|
||||
public boss_hogger(Creature creature) : base(creature, DataTypes.Hogger) { }
|
||||
|
||||
public override void EnterCombat(Unit who)
|
||||
{
|
||||
_EnterCombat();
|
||||
Talk(TextIds.SayPull);
|
||||
|
||||
_scheduler.SetValidator(() => !me.HasUnitState(UnitState.Casting));
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(3), TimeSpan.FromSeconds(4), task =>
|
||||
{
|
||||
DoCastVictim(SpellIds.ViciousSlice);
|
||||
task.Repeat(TimeSpan.FromSeconds(10), TimeSpan.FromSeconds(14));
|
||||
});
|
||||
|
||||
_scheduler.Schedule(TimeSpan.FromSeconds(1), TimeSpan.FromSeconds(2), task =>
|
||||
{
|
||||
DoCast(SpellIds.MaddeningCall);
|
||||
task.Repeat(TimeSpan.FromSeconds(15), TimeSpan.FromSeconds(20));
|
||||
});
|
||||
}
|
||||
|
||||
public override void JustDied(Unit killer)
|
||||
{
|
||||
Talk(TextIds.SayDeath);
|
||||
_JustDied();
|
||||
me.SummonCreature(CreatureIds.WardenThelwater, Misc.WardenThelwaterPos);
|
||||
}
|
||||
|
||||
public override void JustSummoned(Creature summon)
|
||||
{
|
||||
base.JustSummoned(summon);
|
||||
if (summon.GetEntry() == CreatureIds.WardenThelwater)
|
||||
summon.GetMotionMaster().MovePoint(0, Misc.WardenThelwaterMovePos);
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
if (!UpdateVictim())
|
||||
return;
|
||||
|
||||
_scheduler.Update(diff);
|
||||
|
||||
if (me.HasUnitState(UnitState.Casting))
|
||||
return;
|
||||
|
||||
DoMeleeAttackIfReady();
|
||||
}
|
||||
|
||||
public override void DamageTaken(Unit attacker, ref uint damage)
|
||||
{
|
||||
if (me.HealthBelowPctDamaged(30, damage) && !_hasEnraged)
|
||||
{
|
||||
_hasEnraged = true;
|
||||
Talk(TextIds.SayEnrage);
|
||||
DoCastSelf(SpellIds.Enrage);
|
||||
}
|
||||
}
|
||||
|
||||
bool _hasEnraged;
|
||||
}
|
||||
|
||||
[Script]
|
||||
class npc_warden_thelwater : ScriptedAI
|
||||
{
|
||||
public npc_warden_thelwater(Creature creature) : base(creature) { }
|
||||
|
||||
public override void MovementInform(MovementGeneratorType type, uint id)
|
||||
{
|
||||
if (type == MovementGeneratorType.Point && id == 0)
|
||||
_events.ScheduleEvent(Events.SayWarden1, TimeSpan.FromSeconds(1));
|
||||
}
|
||||
|
||||
public override void UpdateAI(uint diff)
|
||||
{
|
||||
_events.Update(diff);
|
||||
|
||||
_events.ExecuteEvents(eventId =>
|
||||
{
|
||||
switch (eventId)
|
||||
{
|
||||
case Events.SayWarden1:
|
||||
Talk(TextIds.SayWarden1);
|
||||
_events.ScheduleEvent(Events.SayWarden2, TimeSpan.FromSeconds(4));
|
||||
break;
|
||||
case Events.SayWarden2:
|
||||
Talk(TextIds.SayWarden2);
|
||||
_events.ScheduleEvent(Events.SayWarden3, TimeSpan.FromSeconds(3));
|
||||
break;
|
||||
case Events.SayWarden3:
|
||||
Talk(TextIds.SayWarden3);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
using Game.Maps;
|
||||
using Game.Scripting;
|
||||
using Game.Entities;
|
||||
|
||||
namespace Scripts.EasternKingdoms.TheStockade
|
||||
{
|
||||
struct Misc
|
||||
{
|
||||
public static Position WardenThelwaterMovePos = new Position(152.019f, 106.198f, -35.1896f, 1.082104f);
|
||||
public static Position WardenThelwaterPos = new Position(138.369f, 78.2932f, -33.85627f, 1.082104f);
|
||||
}
|
||||
|
||||
struct DataTypes
|
||||
{
|
||||
public const uint RandolphMoloch = 0;
|
||||
public const uint LordOverheat = 1;
|
||||
public const uint Hogger = 2;
|
||||
}
|
||||
|
||||
struct CreatureIds
|
||||
{
|
||||
public const uint RandolphMoloch = 46383;
|
||||
public const uint LordOverheat = 46264;
|
||||
public const uint Hogger = 46254;
|
||||
public const uint WardenThelwater = 46409;
|
||||
public const uint MortimerMoloch = 46482;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[Script]
|
||||
class instance_the_stockade : InstanceMapScript
|
||||
{
|
||||
public instance_the_stockade() : base("instance_the_stockade", 34) { }
|
||||
|
||||
class instance_the_stockade_InstanceMapScript : InstanceScript
|
||||
{
|
||||
public instance_the_stockade_InstanceMapScript(Map map) : base(map)
|
||||
{
|
||||
SetHeaders("SS");
|
||||
SetBossNumber(3);
|
||||
}
|
||||
}
|
||||
|
||||
public override InstanceScript GetInstanceScript(InstanceMap map)
|
||||
{
|
||||
return new instance_the_stockade_InstanceMapScript(map);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user