コード例 #1
0
        // Constructor
        public TeleportablesManager(Account account, InteractivesManager interactives, MapGame map)
        {
            _account = account;

            _teleportable = Teleportables.NONE;
            _account.Network.RegisterMessage <ZaapListMessage>(HandleZaapListMessage);
            _account.Network.RegisterMessage <TeleportDestinationsListMessage>(HandleTeleportDestinationsListMessage);
            map.MapChanged           += Map_MapChanged;
            interactives.UseFinished += Interactives_UseFinished;
        }
コード例 #2
0
        public bool UseZaapi(uint destinationMapId)
        {
            if (_account.IsBusy)
            {
                _account.Logger.LogWarning("TeleportablesManager", "Account is busy.");
                return(false);
            }

            if (_account.Game.Map.Zaapi == null)
            {
                _account.Logger.LogWarning("TeleportablesManager", LanguageManager.Translate("538"));
                return(false);
            }

            if (!_account.Game.Managers.Interactives.MoveToUseInteractive(_account.Game.Map.Zaapi.Element, _account.Game.Map.Zaapi.CellId, -1))
            {
                return(false);
            }

            _teleportable     = Teleportables.ZAAPI;
            _destinationMapId = destinationMapId;
            return(true);
        }
コード例 #3
0
 // Constructor
 public UseTeleportableAction(Teleportables type, uint destinationMapId)
 {
     Type             = type;
     DestinationMapId = destinationMapId;
 }
コード例 #4
0
 public void Cancel()
 {
     _teleportable     = Teleportables.NONE;
     _destinationMapId = 0;
 }