for (int n = 0; n < Convert.ToInt32(ThisSpawn[2]); n++)
{
uint UID = (uint)General.Rand.Next(400000, 500000);
short xMin = Convert.ToInt16(ThisSpawn[3]);
short xMax = Convert.ToInt16(ThisSpawn[5]);
if (xMin > xMax)
{
short temp = xMin;
xMin = xMax;
xMax = temp;
}
short spawn_x = (short)General.Rand.Next(xMin, xMax);
short yMin = Convert.ToInt16(ThisSpawn[4]);
short yMax = Convert.ToInt16(ThisSpawn[6]);
if (yMin > yMax)
{
short temp = yMin;
yMin = yMax;
yMax = temp;
}
short spawn_y = (short)General.Rand.Next(yMin, yMax);
while (AllMobs.Contains(UID))
{
UID = (uint)General.Rand.Next(400000, 500000);
}
SingleMob Mob = new SingleMob(spawn_x, spawn_y, Convert.ToInt16(ThisSpawn[7]), uint.Parse(ThisMob[3]), uint.Parse(ThisMob[3]), short.Parse(ThisMob[6]), short.Parse(ThisMob[7]), UID, ThisMob[2], int.Parse(ThisMob[1]), short.Parse(ThisMob[4]), (byte)General.Rand.Next(8), byte.Parse(ThisMob[5]));
AllMobs.Add(UID, Mob);
MobsSpawned++;
}
It's important to be able to read and understand the exceptions or errors that get thrown from methods. The issue in this case was that the contract for the System.Random.Next(Int32 minValue, Int32 maxValue) method is that the maxValue cannot be smaller than the minValue, and it was in your case. The code I've added checks to see if the minimum x range for the monster is not greater than the maximum x range, and the same for the y range, and if it is, then those ranges are switched. This should hopefully solve your problem. This was simple, and you should have be able to do it yourself. In the future, please take the time to make an attempt at fixing your problems, and if you're still having problems, show us what you've done to try and fix your issue, and we will help you from there. Don't expect someone to do the code for you every time.
The only problem he had is that one of his MinX was bigger than his MaxX point.. When he put in the mob spawn..
Yes, you've just reiterated what I've said with less detail. Instead of the OP searching through that list, the problem was solved using what they've provided. A rectangle is still a rectangle, even if its bounds are not ordered from least to greatest, therefore the fix was perfectly acceptable.
Can anyone help me with spawns 02/27/2009 - Conquer Online 2 - 1 Replies can anyone tell me where the is the locations 0f the spawns for some monsters or route for example :turtledoves or bandits draw a route thanks!
Lab 2 spawns 01/24/2009 - Conquer Online 2 - 4 Replies hey can anyone help me? im trying to find a really big spawn in lab 2. im a warrior so i only train with superman
other plvl spawns than main spawns 01/15/2009 - Conquer Online 2 - 3 Replies hi there,
im on epvp since 3 years now but this is my first thread so dont kill me for sharing only :)
well what i wanted to know is, since gms work alot by hunting down botters, if someone can give me spawns (in coords) or maybe in the map(s) of serps, alienserps and basi which are not the mains. so noone else would find me afk on bot for plvl :o
thnx for your replies :)
Need a new map for spawns in MZ 03/05/2006 - Conquer Online 2 - 5 Replies i need a new map for MZ. i cant find the old taks10.jpg and file its been replace w/ task10.pul..tnx.. :D