Exemple #1
0
        public bool HandleMounting(Vector3 target)
        {
            if (!_localPlayerCharacterView.IsMounted)
            {
                LocalPlayerCharacter localPlayer = _localPlayerCharacterView.LocalPlayerCharacter;
                if (localPlayer.GetIsMounting())
                {
                    return(false);
                }

                var mount = _client.GetEntities <MountObjectView>(m => m.IsInUseRange(localPlayer)).FirstOrDefault();
                if (mount != null)
                {
                    if (target != Vector3.zero && mount.IsInUseRange(localPlayer))
                    {
                        return(true);
                    }

                    if (mount.IsInUseRange(localPlayer))
                    {
                        _localPlayerCharacterView.Interact(mount);
                    }
                    else
                    {
                        _localPlayerCharacterView.MountOrDismount();
                    }
                }
                else
                {
                    //Not yet working. Meant to make character walk home if mount is broken.
                    //if (_localPlayerCharacterView.GetLocalPlayerCharacter().IsMountBroken())
                    //return false;

                    _localPlayerCharacterView.MountOrDismount();
                }

                return(false);
            }

            return(true);
        }
Exemple #2
0
        public bool HandleMounting(Vector3 target)
        {
            if (!_localPlayerCharacterView.IsMounted)
            {
                LocalPlayerCharacter localPlayer = _localPlayerCharacterView.LocalPlayerCharacter;
                if (localPlayer.GetIsMounting())
                {
                    return(false);
                }

                var mount = _client.GetEntities <MountObjectView>(m => m.IsInUseRange(localPlayer)).FirstOrDefault();
                if (mount != null)
                {
                    if (target != Vector3.zero && mount.IsInUseRange(localPlayer))
                    {
                        return(true);
                    }

                    if (mount.IsInUseRange(localPlayer))
                    {
                        _localPlayerCharacterView.Interact(mount);
                    }
                    else
                    {
                        _localPlayerCharacterView.MountOrDismount();
                    }
                }
                else
                {
                    _localPlayerCharacterView.MountOrDismount();
                }

                return(false);
            }

            return(true);
        }