56 lines
1.4 KiB
C#
56 lines
1.4 KiB
C#
using System.Xml.Linq;
|
|
|
|
// <triggered_effect trigger = "onSelfBuffUpdate" action="TimerNavSDX, RebirthUtils" />
|
|
public class MinEventActionTimerNavSDX : MinEventActionTargetedBase
|
|
{
|
|
private string NavObjectName = "";
|
|
private int TimerLength = 0;
|
|
|
|
|
|
public override void Execute(MinEventParams _params)
|
|
{
|
|
|
|
var entity = _params.Self as EntityAlive;
|
|
if (entity == null)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (NavObjectName != "")
|
|
{
|
|
if (entity.NavObject == null)
|
|
{
|
|
NavObjectClass navObjectClass = NavObjectClass.GetNavObjectClass(NavObjectName);
|
|
entity.NavObject.AddNavObjectClass(navObjectClass);
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
public override bool ParseXmlAttribute(XAttribute _attribute)
|
|
{
|
|
var flag = base.ParseXmlAttribute(_attribute);
|
|
if (flag) return true;
|
|
var name = _attribute.Name;
|
|
|
|
if (name == null)
|
|
{
|
|
return flag;
|
|
}
|
|
else if (name == "NavObjectName")
|
|
{
|
|
NavObjectName = _attribute.Value;
|
|
return true;
|
|
}
|
|
else if (name == "TimerLength")
|
|
{
|
|
TimerLength = (int)StringParsers.ParseFloat(_attribute.Value);
|
|
return true;
|
|
}
|
|
else
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
} |