Make a new server thread and then perform some simple AI calculations on your spawn.
For example...
while(running)
{
foreach(Spawn spawn in Dictionary.Spawns.Values);//make sure you are adding to this db when loading a new spawn from db or command
{
//optional check to see if the map the spawn is on has active players (if not do not perform ai checks... no players to see it!
foreach(Mob monster in spawn.Members.Values);//select each mob inside the spawn!)
{
//check if mob is alive: If so perform these other things, if not check if valid time for re spawn, if so re spawn it somewhere inside the spawn (pull new random coords, etc)
//Check for players near monster
//Check distance to player: if < attack range && last attack was at least attack speed ago, try attack (you need to code a monster>player attack calculation as well)
//Else, calculate direction monster needs to walk to move towards player (if last walk > walk speed ago)
//Walk in that direction (send walk packet, update the map so mob moves in the map objects)
}
}
}
That would be a POOR system to use but it gives you some general concept of how you'd go about it.
Personally I'd do a foreach player in server, then check for spawns within say... 2 screens of them and then perform AI checks only on those spawns (saves you cpu time because you only operate on spawns with players near'ish to them)
I'd also add in all sorts of other helper methods and checks to make sure say a monster doesn't wander too far away from the spawn and such... but you get the idea.
jesus christ... you people REALLY need to learn to read.
The twin city stuff works because the map is already initialized (there are players/npcs/etc loaded onto it so the map has been created)
They don't move because this is ONLY RELATED TO SPAWNING.
You have to code monster AI, movement, attacking, death, re spawning still.
I'm sorry but if you guys can't figure this out from the 50+ posts I've made on the subject then you have no reason using a computer let alone trying to code a source.
jesus christ... you people REALLY need to learn to read.
The twin city stuff works because the map is already initialized (there are players/npcs/etc loaded onto it so the map has been created)
They don't move because this is ONLY RELATED TO SPAWNING.
You have to code monster AI, movement, attacking, death, re spawning still.
I'm sorry but if you guys can't figure this out from the 50+ posts I've made on the subject then you have no reason using a computer let alone trying to code a source.
It's all up to you. You could always just flag it as dead and when spawning just ensure that what is being pulled is alive.
Saves adding/removing all the time but again... it's all up to you (you're going to be adding/removing with this system anyways due to the way the location info works... which sucks but w/e)
[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.