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 inSpawn.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?
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
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.
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
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
[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
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.