Пример #1
0
 public static WoWPartyMember.GroupRole GetGroupRoleAssigned(WoWPlayer p)
 {
     WoWPartyMember.GroupRole role = WoWPartyMember.GroupRole.None;
     if (p != null && IsInGroup)
     {
         if (p.IsMe)
         {
             role = (WoWPartyMember.GroupRole)((int)Me.Role & ROLEMASK);
         }
         else
         {
             WoWPartyMember pm = GroupMemberInfos.FirstOrDefault(t => t.Guid == p.Guid);
             if (pm != null)
             {
                 role = GetGroupRoleAssigned(pm);
             }
         }
     }
     return(role);
 }
Пример #2
0
        private static Composite CreateFollowBehavior()
        {
            return(new PrioritySelector(

                       new Decorator(ret => !LazyRaiderSettings.Instance.FollowTank,
                                     new ActionAlwaysSucceed()),

                       new Decorator(ret => !IsInGroup,
                                     new ActionAlwaysSucceed()),

                       new Decorator(ret => RaFHelper.Leader == null,
                                     new ActionAlwaysSucceed()),

                       new Decorator(ret => Me.CurrentHealth <= 1, // if dead or ghost
                                     new ActionAlwaysSucceed()),

                       new Decorator(ret => RaFHelper.Leader.CurrentHealth <= 1, // if dead or ghost
                                     new ActionAlwaysSucceed()),

                       new Decorator(ret => NeedToMount(),
                                     new Action(delegate
            {
                WaitForMount();
            })),

                       new Decorator(ret => NeedToDismount(),
                                     new Action(delegate
            {
                WaitForDismount();
            })),

                       new Decorator(ret => !RaFHelper.Leader.InLineOfSightOCD ||
                                     RaFHelper.Leader.Distance > LazyRaiderSettings.Instance.FollowDistance,
                                     new Action(delegate
            {
                botMovement = true;

                WoWPoint pt = RaFHelper.Leader.Location;
                WoWPartyMember tankInfo = GroupMemberInfos.FirstOrDefault(t => t.Guid == RaFHelper.Leader.Guid);
                if (tankInfo != null && Me.Location.Distance(tankInfo.Location3D) > 100)
                {
                    pt = tankInfo.Location3D;
                }

                Navigator.MoveTo(RaFHelper.Leader.Location);
                return RunStatus.Success;
            })),

                       new Decorator(ret => Me.IsMoving && botMovement,
                                     new Action(delegate
            {
                botMovement = false;
                while (IsGameStable() && Me.IsMoving)
                {
                    WoWMovement.MoveStop();
                    if (Me.IsMoving)
                    {
                        System.Threading.Thread.Sleep(25);
                    }
                }

                return RunStatus.Success;
            }))

                       ));
        }