Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 06:23

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Somehow there is a limit?

Discussion on Somehow there is a limit? within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2020
Posts: 64
Received Thanks: 7
Somehow there is a limit?

Hello everyone, i have tried every angle i can think of, It seems that the MobSpawns.txt has a limit on how many lines can be added, Here's the code that handle's it, Any suggestions?

Code:
 public static void LoadMobs(bool Reload = false)
            {
            string[] FMobs;
            if (!World.LowRatedServer)
                FMobs = File.ReadAllLines(@"C:\" + Program.DBPath + @"\MobInfos.txt");
            else FMobs = File.ReadAllLines(@"C:\" + Program.DBPath + @"\MobInfosLowRates.txt");
            var Mobs = new Hashtable(FMobs.Length);
            for (var i = 0; i < FMobs.Length; i++)
                if (FMobs[i][0] != '*')
                {
                    var M = new Mob(FMobs[i]);
                    Mobs.Add(M.MobID, M);
                }

            var MobsCount = 0;
            if (Reload)
            {
                foreach (Hashtable H in World.H_Mobs.Values)
                    H.Clear();
                World.H_Mobs.Clear();
            }

            string[] FSpawns = File.ReadAllLines(@"C:\" + Program.DBPath + @"\MobSpawns.txt");
            foreach (string Spawn in FSpawns)
            {
                if (Spawn[0] == '*') return;
                string[] SpawnInfo = Spawn.Split(' ');
                int MobID = int.Parse(SpawnInfo[0]);
                int Count = int.Parse(SpawnInfo[1]);
                uint Map = uint.Parse(SpawnInfo[2]); //ushort //is this map id? yes
                ushort XFrom = ushort.Parse(SpawnInfo[3]);
                ushort YFrom = ushort.Parse(SpawnInfo[4]);
                ushort XTo = ushort.Parse(SpawnInfo[5]);
                ushort YTo = ushort.Parse(SpawnInfo[6]);
                if (!World.H_Mobs.Contains(Map))
                {
                    World.H_Mobs.Add(Map, new Hashtable());
                    if (!Reload) //(!Game.World.PlayersInMap.ContainsKey(Map))  //Valis fix for reloading mob spawns
                        World.PlayersInMap.Add(Map, new ThreadSafeDictionary<uint, Character>(400));
                }

                var MapMobs = (Hashtable) World.H_Mobs[Map];
                var D = (DMap) DMaps.H_DMaps[Map];

                for (var i = 0; i < Count; i++)
                {
                    var _Mob = new Mob((Mob) Mobs[MobID]);
                    _Mob.Loc = new Location();
                    _Mob.Loc.Map = Map;
                    _Mob.Loc.X = (ushort) Program.Rnd.Next(Math.Min(XFrom, XTo), Math.Max(XFrom, XTo));
                    _Mob.Loc.Y = (ushort) Program.Rnd.Next(Math.Min(YFrom, YTo), Math.Max(YFrom, YTo));

                    try
                    {
                        while (D != null && D.GetCell(_Mob.Loc.X, _Mob.Loc.Y).NoAccess)
                        {
                            _Mob.Loc.X = (ushort) Program.Rnd.Next(Math.Min(XFrom, XTo), Math.Max(XFrom, XTo));
                            _Mob.Loc.Y = (ushort) Program.Rnd.Next(Math.Min(YFrom, YTo), Math.Max(YFrom, YTo));
                        }
                    }
                    catch
                    {
                        World.ExcAdd += "Mobid: " + _Mob.MobID + " Mob.X: " + _Mob.Loc.X + " Mob.Y: " + _Mob.Loc.Y +
                                        " Mob.map: " + _Mob.Loc.Map + " MOBERROR! \r\n";
                    }

                   // _Mob.StartLoc = _Mob.Loc;
                    _Mob.StartLoc.XFrom = XFrom;
                    _Mob.StartLoc.XTo = XTo;
                    _Mob.StartLoc.YFrom = YFrom;
                    _Mob.StartLoc.Yto = YTo;
                    _Mob.StartLoc.Map = Map;
                    _Mob.EntityID = IdentityGenerator.Monster.GetNextIdentity;
                    //_Mob.EntityID = (uint) Program.Rnd.Next(400000, 500000);
                    //while (MapMobs.Contains(_Mob.EntityID))
                        //_Mob.EntityID = (uint) Program.Rnd.Next(400000, 500000);
                    MapMobs.Add(_Mob.EntityID, _Mob);
                    MobsCount++;
                    _Mob.LastTarget = DateTime.Now;
                    if (_Mob.MobID == 701 || _Mob.MobID == 700 || _Mob.MobID == 150 || _Mob.MobID == 500 ||
                        _Mob.MobID == 4000 || _Mob.MobID == 4008 || _Mob.MobID == 409 || _Mob.MobID == 266 ||
                        _Mob.MobID == 4152 || _Mob.MobID == 4171 || _Mob.MobID == 4172 || _Mob.MobID == 4170 ||
                        _Mob.MobID == 3823 || _Mob.MobID == 3822 || _Mob.MobID == 3821 || _Mob.MobID == 8423 ||
                        _Mob.MobID == 4010 || _Mob.MobID == 4011 || _Mob.MobID == 4012 || _Mob.MobID == 4013 ||
                        _Mob.MobID == 4014) // ultimatepluto, expmob, *dbdevil*, waterdevilking, teratodragon
                    {
                        _Mob.Alive = false;
                        _Mob.CurrentHP = 0;
                    }
                }
            }

            if (Reload)
                World.SendMsgToAll("SYSTEM", "Monsters reloaded!", 2011, 0);
            World.DebugAdd += "Monsters loaded " + MobsCount + "\r\n";
        }
TheFadedOne is offline  
Old 12/10/2022, 21:07   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,192
... How many lines do you have? Is it a 32-bit application?
Spirited is offline  
Old 12/15/2022, 00:07   #3
 
elite*gold: 0
Join Date: Nov 2020
Posts: 64
Received Thanks: 7
seeems i cant go past 1035 lines and Yeah debugged in x86
TheFadedOne is offline  
Old 12/15/2022, 01:59   #4
 
pintinho12's Avatar
 
elite*gold: 0
Join Date: Jul 2009
Posts: 943
Received Thanks: 408
Quote:
Originally Posted by TheFadedOne View Post
seeems i cant go past 1035 lines and Yeah debugged in x86
Make sure you're returning the Identities of the monsters when they're removed from the map. The IdentityGenerator does have 100k limit
pintinho12 is offline  
Old 12/19/2022, 02:03   #5
 
elite*gold: 0
Join Date: Nov 2020
Posts: 64
Received Thanks: 7
I checked it, its not being limited by the generator and i checked its 1086 lines i cant go past
TheFadedOne is offline  
Reply


Similar Threads Similar Threads
can i sort somehow Co Clients?
06/24/2007 - Conquer Online 2 - 2 Replies
Well i wanted to ask how to make some co client dissapear and other no,like active chars would be seeable,and tgers/seller hide somehow? is there are any software like this? :?
i think the crack still works.. somehow.
04/23/2006 - Silkroad Online - 4 Replies
i know it's weird, but the day before yesterday i logged in after installing easyphp nd such still with the same problem being d/ced.. then the next morning i came home and put it on again and the bot played for like 4/5 hours and then my pc froze because i plugged an usb device while running sro. so i restart my pc and i get the 15 minute d/c again. now yesterday i had the same but then the bot ran for 2 hours. is this just plain luck or something or is there a way to work around the...



All times are GMT +1. The time now is 06:24.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.