public void Execute(Character.NPC actor, ITrigger trigger = null) { Wander.GetState().Execute(actor); //let's go to another room actor.NextAiAction = DateTime.Now.AddSeconds(-2).ToUniversalTime(); //set next action back so we will immediately start searching for a target FindTarget.GetState().Execute(actor); //let's look for a target actor.NextAiAction = DateTime.Now.AddSeconds(Extensions.RandomNumber.GetRandomNumber().NextNumber(10, 31)).ToUniversalTime(); //we are actively looking so the wait time is not long to linger about }
public void Execute(Character.NPC actor, ITrigger trigger = null) { //no target then switch to finding a target first if (actor.CurrentTarget == null) { actor.Fsm.ChangeState(FindTarget.GetState(), actor); } else //ok we have someone we can kill, let's do that //if this type of NPC may alert other NPC of the same type in the room to also join in on the fun /* * if (actor.AlertOthers){ * NPCUtils.AlertOtherMobs(actor.Location, actor.MobType, actor.CurrentTarget); * }*/ { Commands.CommandParser.ExecuteCommand(actor, "KILL", "target"); } }
public static FindTarget GetState() { return(_findTarget ?? (_findTarget = new FindTarget())); }
public static FindTarget GetState() { return _findTarget ?? (_findTarget = new FindTarget()); }