Exemple #1
0
 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
 }
Exemple #2
0
        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");
            }
        }
Exemple #3
0
 public static FindTarget GetState()
 {
     return(_findTarget ?? (_findTarget = new FindTarget()));
 }
Exemple #4
0
 public static FindTarget GetState()
 {
     return _findTarget ?? (_findTarget = new FindTarget());
 }