Misc Script Fixes.

This commit is contained in:
hondacrx
2024-03-12 22:12:17 -04:00
parent 5f0608739d
commit 1b63a89b0a
8 changed files with 783 additions and 85 deletions
@@ -5,6 +5,7 @@ using Framework.Constants;
using Game.AI;
using Game.DataStorage;
using Game.Entities;
using Game.Maps;
using Game.Scripting;
using System;
@@ -136,6 +137,69 @@ namespace Scripts.EasternKingdoms.AlteracValley
}
}
[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
{