예제 #1
0
        public override void OnTick()
        {
            HateUnit hu = new HateUnit(null, 0);

            for (int i = 0; From.HateList.Count > i; i++)
            {
                if (From.HateList.Count > 0)
                {
                    hu = (HateUnit)From.HateList[i];
                    if (hu.Hate <3 | this.From.Distance(hu.HatedMobile)> Area)                    //if mob too far, remove from list
                    {
                        this.From.HateList.Remove(hu);
                        i--;
                        continue;
                    }
//                  else
//					{
//						hu.Hate = hu.Hate - 0.5f;//decrease a hate, may be need change or delete this string.
//						bc.HateList[i] =  hu;
//					}
                }
                if (!From.InCombat)
                {
                    From.AttackTarget = ChooseAttackTarget(Area, HateLimit);
                    if (From.AttackTarget != null)
                    {
                        From.BeginCombatWith(From.AttackTarget);
                    }
                    return;
                }
            }
            ChooseAction();
            UpdateTargetHateList(5f, Area);
        }