Esempio n. 1
0
 private void _processLogOnDeath(string deathMessage)
 {
     _logger.Info("_processLogOnDeath()");
     _logger.WriteToChat(deathMessage);
     _logger.WriteToWindow(deathMessage);
     WorldObjectService.Logout();
     return;
 }
Esempio n. 2
0
        private void _processDeathSettingsUnknown()
        {
            _logger.Info("_processDeathSettingsUnknown()");
            string message = "Settings not loaded before death occured, logging out";

            _logger.WriteToChat(message);
            _logger.WriteToWindow(message);
            WorldObjectService.Logout();
            return;
        }
Esempio n. 3
0
 public static void CastHeal(int playerId)
 {
     if (WorldObjectService.IsSpellKnown(4310))
     {
         CastSpell(4310, playerId);
     }
     else
     {
         CastSpell(2072, playerId);
     }
 }
Esempio n. 4
0
        private void _processLogOnVit()
        {
            _logger.Info("_processLogOnVit()");
            Settings settings = _settingsManager.Settings;

            if (settings.LogOnVitae && WorldObjectService.GetVitae() >= settings.VitaeLimit)
            {
                string message = $"Logging off, due to vitae limit of {settings.VitaeLimit.ToString()} being reached";
                _logger.WriteToChat(message);
                _logger.WriteToWindow(message);
                WorldObjectService.Logout();
                return;
            }
        }
Esempio n. 5
0
        public void ProcessPkDeath(int killerId, int killedId, string deathMessage)
        {
            _logger.Info("ProcessPkDeath()");
            int self = WorldObjectService.GetSelf().Id;

            if (killerId == self)
            {
                _logger.Info($"You killed: {WorldObjectService.GetWorldObject(killedId).Name}");
                _logger.Info(deathMessage);
            }

            if (killedId == self)
            {
                _processDeath(deathMessage);
            }
        }
Esempio n. 6
0
        private void _processGhostObjects()
        {
            int currentId = WorldObjectService.GetSelf().Id;

            if (_players.Count == 0)
            {
                _ghostObjectTimer.Stop();
            }

            foreach (KeyValuePair <int, Player> player in _players)
            {
                int playerId = player.Value.Id;
                if (
                    !WorldObjectService.IsValidObject(playerId) ||
                    WorldObjectService.GetDistanceFromPlayer(currentId, playerId) > 1000)
                {
                    _logger.Info($"Player: {player.Value.Name} is not a valid object");
                    Remove(playerId, Get(playerId));
                }
            }
        }
Esempio n. 7
0
        public void Add(Player player)
        {
            LoginSession session  = _loginSessionManager.Session;
            Settings     settings = _settingsManager.Settings;
            string       soundPath;

            if (Get(player.Id) != null)
            {
                return;
            }

            _players.Add(player.Id, player);
            OnPlayerAdded(player);

            if (session == null)
            {
                return;
            }

            WorldObjectService.RequestId(player.Id);
            if (player.Enemy)
            {
                _logger.WriteToChat($"Enemy Added: {player.Name}");
                soundPath = "Commander.Assets.Audio.enemy.wav";
                if (settings.EnemySounds)
                {
                    PlaySoundFromResource(soundPath);
                }
            }
            else
            {
                _logger.WriteToChat($"Friendly Added: {player.Name}");
                soundPath = "Commander.Assets.Audio.friendly.wav";
                if (settings.FriendlySounds)
                {
                    PlaySoundFromResource(soundPath);
                }
            }
        }