Beispiel #1
0
 private void _processLogOnDeath(string deathMessage)
 {
     _logger.Info("_processLogOnDeath()");
     _logger.WriteToChat(deathMessage);
     _logger.WriteToWindow(deathMessage);
     WorldObjectService.Logout();
     return;
 }
Beispiel #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;
        }
Beispiel #3
0
 public static void CastHeal(int playerId)
 {
     if (WorldObjectService.IsSpellKnown(4310))
     {
         CastSpell(4310, playerId);
     }
     else
     {
         CastSpell(2072, playerId);
     }
 }
Beispiel #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;
            }
        }
Beispiel #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);
            }
        }
Beispiel #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));
                }
            }
        }
Beispiel #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);
                }
            }
        }