12.01.2014, 04:00
Looks pretty funny but I don't approve of your update loop, you should have a loop for each NPC and there is a few reasons.
1.) Prevent all NPC updates from being in sync (looks more natural)
2.) Allows you to more easily organize your NPC's actions
3.) Allows you to create several NPC classes
Some suggestions.
1.) Implement NPC states this is very very useful because you can sequence multiple states in the update loop
2.) Use ZCMD I don't care if you have 1 command just do it
3.) Your update time is probably too fast
4.) You shouldn't need an update rate of 30 it's a waste of bandwidth
Other problems
This will be prone to being attacked with fake OnPayerGiveDamage() messages so in it's current state really isn't reliable for anything more than shits and giggles on a home server.
1.) Prevent all NPC updates from being in sync (looks more natural)
2.) Allows you to more easily organize your NPC's actions
3.) Allows you to create several NPC classes
Some suggestions.
1.) Implement NPC states this is very very useful because you can sequence multiple states in the update loop
2.) Use ZCMD I don't care if you have 1 command just do it
3.) Your update time is probably too fast
4.) You shouldn't need an update rate of 30 it's a waste of bandwidth
Other problems
This will be prone to being attacked with fake OnPayerGiveDamage() messages so in it's current state really isn't reliable for anything more than shits and giggles on a home server.