Register for your free account! | Forgot your password?

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

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

Advertisement



[HELP] Coding Mobspawns

Discussion on [HELP] Coding Mobspawns within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old 11/15/2011, 01:57   #16
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
#albetros

I got scolded for spelling my own source wrong

Yah I doubt I'll be releasing it fang. I keep considering it though just cause I have no use for it and I'm far too addicted to releasing stuff :P

@ OP: I've posted quite a lot of information on how to go about writing spawns (basics) into my source... I'd suggest digging through the FAQ thread I made for it some.

If you want to get them spawning, you can edit just like 5-10 lines of code (which I've posted most if not all of) and you'll have them all spawning properly.

You'll then still need to handle their movement/attacking/death/drops which is a bit trickier. Seeing as you're new with C#, I'd strongly suggest what I and others suggest to all new programmers...

Take a step back.

By this I mean don't focus so much on programming for CONQUER. Good programming habits are easy to learn... the first time around. Once you start copying poor code it gets in your head as how things should be done and at some point you'll need to go back and re-train yourself which is much more difficult.

There's plenty of programming tutorials all over the internet and I and others have posted some here on this site. I'd take a few weeks, read a book or two and start with some small programs so that you understand the basics of what C# is, what the basic syntax is, object oriented programming as well as the basics such as data types, conditional statements, loops, etc.

Knowing basic stuff like that will take you miles beyond what simply following guides on here or stumbling around blindly trying to add features will do for you.
pro4never is offline  
Old 11/15/2011, 03:38   #17
 
elite*gold: 0
Join Date: Nov 2011
Posts: 23
Received Thanks: 1
[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("Z"), r.ReadUInt16("Spread"), r.ReadUInt16("Map"));
Count += (uint)S.Members.Count;
}
Console.WriteLine(Program.Title + " Spawning " + Count + " monsters into the world");

}
public static void GetBaseMobs()
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
cmd.Select("Monsters");
MySqlReader r = new MySqlReader(cmd);
while (r.Read())
{
BaseMob M = new BaseMob();
M.Name = r.ReadString("Name");
M.MobID = r.ReadUInt32("UID");
M.Mesh = r.ReadUInt32("Mesh");
M.Level = r.ReadByte("Level");
M.MaxHp = r.ReadUInt32("Health");
M.AtkType = r.ReadUInt16("AttackType");
M.MinAtk = r.ReadUInt16("MinAtk");
M.MaxAtk = r.ReadUInt16("MaxAtk");
M.Pdef = r.ReadUInt16("Pdef");
M.Mdef = r.ReadUInt16("Mdef");
M.DropLvl = r.ReadByte("DropMaxLvl");
M.Range = r.ReadByte("AttackRange");
M.Dodge = r.ReadByte("Dodge");
M.Accuracy = r.ReadByte("Accuracy");
if (!Dictionary.BaseMobs.ContainsKey(M.MobID))
Dictionary.BaseMobs.Add(M.MobID, M);
}
Console.WriteLine(Program.Title + " Loaded " + Dictionary.BaseMobs.Count + " Base Monsters from database");
}[/code]

So I uncommented the database part.... I THINK. lol

But I'm using Visual C# Express, and I'm not used to the interface.... (I usually use NetBeans IDE 7.0.1) so i'm not sure how to find out which variables are wrong. and I'm watching TUTs on C# while I'm working on this =p I'm more of a hands on learner, and I'm not much of a book reader lol.
DaVinci1476 is offline  
Old 11/15/2011, 04:10   #18
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,191
I agree with Chris.. you need to step back and code smaller things - focus on the concepts, not the features in Conquer. I'm pretty sure I wrote a thread about that... not that it's very good. I'm just a notice and I'm sure there's better advice out there. Look into C# with a bit more detail.

Edit: Found it...
Spirited is offline  
Old 11/15/2011, 05:07   #19
 
elite*gold: 0
Join Date: Nov 2011
Posts: 23
Received Thanks: 1
I'm watching TUTs now =] Have you ever heard of TheNewBoston.com?
DaVinci1476 is offline  
Old 11/15/2011, 06:52   #20
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,283
Received Thanks: 4,191
Quote:
Originally Posted by DaVinci1476 View Post
I'm watching TUTs now =] Have you ever heard of TheNewBoston.com?
I've heard of it from a friend but I haven't actually been to their website yet. I've also heard that they don't offer C#.
Spirited is offline  
Old 11/15/2011, 11:00   #21
 
-Sensei-'s Avatar
 
elite*gold: 0
Join Date: Oct 2011
Posts: 267
Received Thanks: 59
Quote:
Originally Posted by Fаng View Post
I've heard of it from a friend but I haven't actually been to their website yet. I've also heard that they don't offer C#.
They are , but in windows Application.
-Sensei- is offline  
Old 11/15/2011, 17:05   #22
 
elite*gold: 0
Join Date: Nov 2011
Posts: 23
Received Thanks: 1
Yeah, they use Visual C#, which is good, because I don't like mac xD
DaVinci1476 is offline  
Reply


Similar Threads Similar Threads
Version 5375+ - Increasing Mobspawns.
09/04/2011 - CO2 Private Server - 2 Replies
Hello, does anyone know how to increase the ammount of mobspawns on a version 5375+? Regards, Nick..
[Request]MobSpawns
02/19/2010 - CO2 Private Server - 4 Replies
^^^^^^^
[Release] Fix MobSpawns (AnimeCO Source)
02/19/2010 - CO2 PServer Guides & Releases - 4 Replies
change the LoadMonterSpawns for this only: public static void LoadMonsterSpawns() { lock (DatabaseConnection.Connection) { MySqlCommand Cmd = new MySqlCommand("SELECT * FROM `mobspawns`", DatabaseConnection.Connection); MySqlDataReader DR = Cmd.ExecuteReader(); int TotalSpawns = 0;
[help]Dis City MobSpawns/Mobs
06/19/2009 - CO2 Private Server - 3 Replies
Well im about 95% done with dis city and all i have todo is add the mobspawns in but for dis city Part 2 & 3 can sombody please list the name of the monsters that spawn in there? Thanks, TheLeGend209 http://skynightco.com



All times are GMT +1. The time now is 09:46.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.