Upload from upload_mods.ps1
This commit is contained in:
56
Scripts/MinEvents/MinEventActionTimerNavSDX.cs
Normal file
56
Scripts/MinEvents/MinEventActionTimerNavSDX.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user