public override INpcAction Execute(NpcState NpcState) { INpcAction action = null; try { _scope.SetVariable("curTarget", NpcState.Target); _scope.SetVariable("map", NpcState.MapState); var result = _rubyEngine.Execute(this.Content, _scope); _scope.RemoveVariable("curTarget"); _scope.RemoveVariable("map"); action = (INpcAction)result; } catch { } finally { } return(action); }
public void PerformAction() { INpcAction nextAction = AI.Execute(this); nextAction.Perform(this); }