Register for your free account! | Forgot your password?

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

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

Advertisement



[Help] Hellmouth Mob Spawn

Discussion on [Help] Hellmouth Mob Spawn within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
F i n c h i's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
Red face [Help] Hellmouth Mob Spawn

Alright,I added the following code in Database.cs

Database.cs
Code:
public static void GetSpawns()
        {
            //I've changed mob spawn code like 5 times.. this should still work though so w/e.
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
            cmd.Select("MobSpawns");
            uint Count = 0;
            MySqlReader r = new MySqlReader(cmd);
            while (r.Read())
            {
                MobSpawn S = new MobSpawn(r.ReadUInt16("Amount"), Dictionary.BaseMobs[r.ReadUInt16("SpawnMob")], r.ReadUInt16("X"), r.ReadUInt16("Y"), r.ReadUInt16("Spread"), r.ReadUInt16("Map"));
                Count += (uint)S.Members.Count;
            }
            Console.WriteLine(Program.Title + " Spawning " + Count + " monsters into the world");
        
        }
After this I added the following code in Spawn.cs

Spawn.cs
Code:
public class MobSpawn
    {
        public Mob MobCoords(Mob M)
        {
            M.X = (ushort)Program.Rand.Next(X - Spread, X + Spread);
            M.Y = (ushort)Program.Rand.Next(Y - Spread, Y + Spread);
            return M;
        }
        public MobSpawn(uint Amount, BaseMob Type, ushort BindX, ushort BindY,ushort Dist, ushort BindMap)
        {
                MobType = Type;
                TotalSpawn = Amount;
                X = BindX;
                Y = BindY;
                Spread = Dist;
                if (!Dictionary.Maps.ContainsKey(BindMap))
                {
                    Map = new Map(Enum.PkType.None);
                    Dictionary.Maps.ThreadSafeAdd(BindMap, Map);
                }
                else
                    Map = Dictionary.Maps[BindMap];
                for (uint I = 0; I < Amount; I++)
                {
                    Mob M = new Mob();
                    M.Map = BindMap;
                    M.Name = Type.Name;
                    M.Instance = 0;
                    M.Mesh = Type.Mesh;
                    M.MobHP = (ushort)Type.MaxHp;
                    M.MobLevel = Type.Level;
                    M.Dir = (byte)new Random().Next(1, 8);
                    M = MobCoords(M);
                    int Tries = 10;
                    while (Tries > 0 && !Calculations.FreeCoord(M.X, M.Y, M.Map, M.Instance))
                    { M = MobCoords(M); Tries--; }
                    M.UID = this.Map.MobCounter + I;
                    Map _map = Handler.PullMap(M.Map);
                    this.Members.Add(M.UID, M);
                    _map.AddMonster(M, _map.MakeCoord(M.X, M.Y, M.Instance));
                }
                Map.MobCounter += Amount;
                      
        }
        public Dictionary<uint, Mob> Members = new Dictionary<uint, Mob>();
        BaseMob MobType;
        public uint TotalSpawn;
        public uint TotalDead
        {
            get
            {
                uint Count = 0;
                foreach (Mob M in Members.Values)
                    if (!M.Alive)
                        Count++;
                return Count;
            }
        }
        public ushort X, Y, Spread;
        public Map Map;
       
    }
But monsters / guards still doesn't spawn =\
Any help?
F i n c h i is offline  
Old 04/10/2011, 03:01   #2
 
chickmagnet's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 372
Received Thanks: 53
the problem is in the spawn cs coz the database part is fine coz i actrully fixed it at 1 point but it spawned 0 monsters
chickmagnet is offline  
Old 04/10/2011, 03:22   #3
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,377
Are their any entries in your mobSpawns database? ^^

The actual spawn database was never completed because the mob system was not in use.

Hell my own copy of it only has like 10 spawn entries.
pro4never is offline  
Old 04/10/2011, 04:16   #4
 
chickmagnet's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 372
Received Thanks: 53
Quote:
Originally Posted by pro4never View Post
Are their any entries in your mobSpawns database? ^^

The actual spawn database was never completed because the mob system was not in use.

Hell my own copy of it only has like 10 spawn entries.
ye it does coz at first when i used the spawn fix it spawn than the spawn cs started givin weird errors check the hellmouth rel thread and u'll see a pic of my errors
chickmagnet is offline  
Old 04/10/2011, 04:19   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,377
The error you posted was that it was trying to load a base monster that doesn't exist... Keep in mind that when adding spawns to database it uses the basemob id, not mesh.

(check the mobs database for all of them)
pro4never is offline  
Thanks
1 User
Old 04/10/2011, 04:49   #6
 
chickmagnet's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 372
Received Thanks: 53
Quote:
Originally Posted by pro4never View Post
The error you posted was that it was trying to load a base monster that doesn't exist... Keep in mind that when adding spawns to database it uses the basemob id, not mesh.

(check the mobs database for all of them)
hehe thx imma mess wit that more 2marrow thx very much for the respond and im pretty sure that op has same error i had
chickmagnet is offline  
Old 04/10/2011, 09:07   #7
 
F i n c h i's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
Talking

So,what should I do to get it work?

Like you can see,I don't have any error in console.

F i n c h i is offline  
Old 04/10/2011, 15:57   #8
 
chickmagnet's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 372
Received Thanks: 53
Quote:
Originally Posted by alexalx View Post
So,what should I do to get it work?

Like you can see,I don't have any error in console.

try this

Code:
public static void GetSpawns()
        {
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
            cmd.Select("MobSpawns");
            uint Count = 0;
            MySqlReader r = new MySqlReader(cmd);
            while (r.Read())
            {
                MobSpawn S = new MobSpawn(r.ReadUInt16("Amount"), Dictionary.BaseMobs[r.ReadUInt16("SpawnMob")], r.ReadUInt16("X"), r.ReadUInt16("Y"), r.ReadUInt16("Spread"), r.ReadUInt16("Map"));
                Count += (uint)S.Members.Count;
            }
            Console.WriteLine(Program.Title + " Spawning " + Count + " monsters into the world");
        
        }
chickmagnet is offline  
Old 04/10/2011, 16:57   #9
 
F i n c h i's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
Alright,I will try it now.
Thanks.
F i n c h i is offline  
Old 04/10/2011, 17:03   #10
 
F i n c h i's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
Actually,thats what I'm using :S
And its not working,It was suppose to say on console:

"Spawning (the amount of monsters) monsters into the world"

But its not saying that anymore...


Can you team view me?
F i n c h i is offline  
Old 04/10/2011, 17:34   #11
 
chickmagnet's Avatar
 
elite*gold: 0
Join Date: Jun 2009
Posts: 372
Received Thanks: 53
sure get on msn
chickmagnet is offline  
Old 04/10/2011, 17:48   #12
 
F i n c h i's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
Wink

Quote:
Originally Posted by chickmagnet View Post
sure get on msn
Added you.

Are you online on msn?
F i n c h i is offline  
Old 04/10/2011, 18:07   #13
 
elite*gold: 0
Join Date: Aug 2004
Posts: 26
Received Thanks: 4
its a problem with the mob uid. if you do a console writeline tin the try and catch u will see u get an error where it cant add the uid. put breakpoints in your code and go through it line by line using f10 to pinpoint the problem. the reason its not showing error is because your not printing the errors.

on another note my mobs move and attacker me but i cant seem to update there location in the objects list so aoe skills are not working correctly annoying me now lol
Yaksha is offline  
Old 04/10/2011, 18:13   #14
 
F i n c h i's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 785
Received Thanks: 421
In Spawn.cs? should I put the breakpoints?
F i n c h i is offline  
Old 04/10/2011, 18:15   #15
 
elite*gold: 0
Join Date: Aug 2004
Posts: 26
Received Thanks: 4
Quote:
Originally Posted by alexalx View Post
In Monster.cs? should I put the breakpoints?
oh dear lol

In the Spawn.cs debug the whole MobSpawn function
Yaksha is offline  
Reply


Similar Threads Similar Threads
[Dev] Hellmouth Revival
03/16/2011 - CO2 Private Server - 235 Replies
<Cleaned for personal use> NOTE: This is not related to the old hellmouth server. This is a private project which will most likely never see the light of day but I wanted a simple place for me to put my notes and document a few things.... Goals See how much the conquer client can be streamlined and turned into something that I feel is worthwhile playing. This will consist of the following steps...
[How to add monsters in Hellmouth]
03/11/2011 - CO2 Private Server - 12 Replies
Hey guys, I dont know what Im doing wrong I added a MySqlReader for the MobSpawns but there are no spawns at all.. so I looked in Spawn.cs
New Npc for HellMouth source
03/08/2011 - CO2 PServer Guides & Releases - 3 Replies
Closed #
Question About Hellmouth
03/07/2011 - CO2 Private Server - 6 Replies
Well Maybe this is not the right section, But I'm going to post it here. This is a Personal question to pro4never (Chris) Why You Did THIS?? First, It's unfair to the minority who managed to update to 5365. I had to keep Trying and to Learn to do this, Now every leecher, Every guy who doesn't know a shit about programming can have 5365 Source. This is going to destroy the whole pserver community. It will be Just Like NewestCOServer. 412344543534 NPC Releases and 93243562652345 Requests....
HellMouth Client
02/18/2011 - CO2 Weapon, Armor, Effects & Interface edits - 17 Replies
Basically I've done the client for HellMouth and would like some feedback and some input to what can be done to improve it. The logo is already going to be removed since its blurry. Thanks. http://i47.tinypic.com/2i1h0km.png ## Updated -Removed Logo -Added new background to top and bottom I'm happy with what it has turned out as.



All times are GMT +2. The time now is 13:29.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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