public string GetKillOtherPlayerMessage(PlayerCharacterObject player, NebulaObject enemy)
        {
            MmoWorld       world          = player.nebulaObject.mmoWorld();
            RaceableObject playerRaceable = player.GetComponent <RaceableObject>();

            PlayerCharacterObject enemyCharacter = enemy.GetComponent <PlayerCharacterObject>();
            RaceableObject        enemyRaceable  = enemy.GetComponent <RaceableObject>();

            string systemName     = world.Resource().Zones.GetZoneName(world.Name);
            string playerName     = player.characterName;
            string playerRaceName = world.Resource().Zones.GetRaceName(playerRaceable.getRace());

            string sourceCoalitionName = player.guildName;

            if (sourceCoalitionName == null)
            {
                sourceCoalitionName = string.Empty;
            }

            string enemyName     = enemyCharacter.characterName;
            string enemyRaceName = world.Resource().Zones.GetRaceName(enemyRaceable.getRace());

            string enemyCoalitionName = enemyCharacter.guildName;

            if (enemyCoalitionName == null)
            {
                enemyCoalitionName = string.Empty;
            }

            return(string.Format("scm11:zone={0};chname={1};chrace={2};chcoal={3};enname={4};enrace={5};encoal={6}",
                                 world.Name, playerName, playerRaceable.race, sourceCoalitionName,
                                 enemyName, enemyRaceable.race, enemyCoalitionName));
        }
Esempio n. 2
0
        public void Update(float deltaTime)
        {
            var zoneAsteroidList = mWorld.Zone.Asteroids;

            if (zoneAsteroidList == null)
            {
                log.ErrorFormat("zone asteroid list is null at world {0}", mWorld.Name);
            }

            var existingAsteroidList = mWorld.ItemCache.GetItems((byte)ItemType.Asteroid)
                                       .Where(p => p.Value.GetComponent <AsteroidComponent>().zoneAsteroidInfo != null)
                                       .ToDictionary(p => p.Key, p => p.Value);


            foreach (var asteroidZoneInfo in zoneAsteroidList)
            {
                Item item = existingAsteroidList
                            .Values
                            .Where(it => it.GetComponent <AsteroidComponent>() && it.GetComponent <AsteroidComponent>().zoneAsteroidInfo.Index == asteroidZoneInfo.Index)
                            .FirstOrDefault();
                if (item)
                {
                    continue;
                }

                float destructionTime = DestructionTime(asteroidZoneInfo.Index);
                float interval        = Time.curtime() - destructionTime;
                if (interval > asteroidZoneInfo.Respawn)
                {
                    bool dropSuccess = asteroidDropper.DropOccured(mWorld.Zone.Level,
                                                                   mWorld.Resource().Asteroids.Data(asteroidZoneInfo.DataId),
                                                                   asteroidZoneInfo.ForceCreate);
                    if (!dropSuccess)
                    {
                        SetDestructionTime(asteroidZoneInfo.Index, Time.curtime());
                        continue;
                    }

                    var        data        = mWorld.Resource().Asteroids.Data(asteroidZoneInfo.DataId);
                    GameObject asteroidObj = ObjectCreate.Asteroid(mWorld, asteroidZoneInfo, data);
                    asteroidObj.AddToWorld(asteroidZoneInfo.Position, asteroidZoneInfo.Rotation);


                    //spawn asteroid
                }
            }
        }
        public string GetKillStandardNPCMessage(PlayerCharacterObject player, NebulaObject enemy)
        {
            MmoWorld        world          = player.nebulaObject.mmoWorld();
            RaceableObject  playerRaceable = player.GetComponent <RaceableObject>();
            CharacterObject enemyCharacter = enemy.GetComponent <CharacterObject>();
            BotObject       enemyBot       = enemy.GetComponent <BotObject>();

            string systemName     = world.Resource().Zones.GetZoneName(world.Name);
            string playerName     = player.characterName;
            string playerRaceName = world.Resource().Zones.GetRaceName(playerRaceable.getRace());
            string npcName        = GenerateStandardNpcName(systemName, enemy.Id);
            int    npcLevel       = enemyCharacter.level;

            string coalitionName = player.guildName;

            if (coalitionName == null)
            {
                coalitionName = string.Empty;
            }


            switch (enemyBot.getSubType())
            {
            case BotItemSubType.StandardCombatNpc:
                return(string.Format("scm7:zone={0};chname={1};chrace={2};chcoal={3};enname={4};enlvl={5}",
                                     world.Name, playerName, playerRaceable.race, coalitionName, npcName, npcLevel));

            case BotItemSubType.Drill:
                return(string.Format("scm8:zone={0};chname={1};chrace={2};chcoal={3};enname={4};enlvl={5}",
                                     world.Name, playerName, playerRaceable.race, coalitionName, npcName, npcLevel));

            case BotItemSubType.Outpost:
                return(string.Format("scm9:zone={0};chname={1};chrace={2};chcoal={3};enname={4};enlvl={5}",
                                     world.Name, playerName, playerRaceable.race, coalitionName, npcName, npcLevel));

            case BotItemSubType.MainOutpost:
                return(string.Format("scm10:zone={0};chname={1};chrace={2};chcoal={3};enname={4};enlvl={5}",
                                     world.Name, playerName, playerRaceable.race, coalitionName, npcName, npcLevel));

            default:
                return(string.Empty);
            }
        }
        public string GetSetOutpostMessage(PlayerCharacterObject player)
        {
            MmoWorld       world          = player.nebulaObject.mmoWorld();
            RaceableObject playerRaceable = player.GetComponent <RaceableObject>();
            string         systemName     = world.Resource().Zones.GetZoneName(world.Name);
            string         playerName     = player.characterName;
            string         playerRaceName = world.Resource().Zones.GetRaceName(playerRaceable.getRace());
            string         coalitionName  = player.guildName;

            if (coalitionName == null)
            {
                coalitionName = string.Empty;
            }


            return(string.Format("scm3:zone={0};chname={1};chrace={2};chcoal={3}",
                                 systemName,
                                 playerName,
                                 playerRaceable.race,
                                 coalitionName
                                 ));
        }