new command #advnpcspawn and related functions
first, appending ZoneDatabase::NPCSpawnDB(int8 command, const char* zone, Client *c, NPC* spawn, int32 extra)
two additional cases for the main switch Code:
case 5: { // add a spawn from spawngroup - Ailia adding a catch to load missing spawngroups to allow worldbuilding without rebooting zone Code:
//grab our spawn group Code:
bool ZoneDatabase::LoadSpawnGroupsByID(int spawngroupid, SpawnGroupList* spawn_group_list) { Code:
if(sg->roamdist && sg->roambox[0] && sg->roambox[1] && sg->roambox[2] && sg->roambox[3] && sg->delay) Code:
SpawnGroup::SpawnGroup( uint32 in_id, char* name, int in_group_spawn_limit, float dist, float maxx, float minx, float maxy, float miny, int delay_in ) { Code:
bool ZoneDatabase::LoadSpawnGroups(const char* zone_name, SpawnGroupList* spawn_group_list) { Code:
float roambox[4]; |
finally, the actual command to be added to command.cpp
Code:
void command_advnpcspawn(Client *c, const Seperator *sep) Code currently being used on the server EDGE as our primary worldbuilding tool due to not creating redundant spawngroups and spawnentries allowing much faster queries and less redundancy in the database. |
before i forget, you need to add the following to the spawngroup table
dist, max_x, min_x, max_y, min_y, delay delay is an integer, rest are floats default all to 0 Cripp edit:: Here is the SQL syntax for adding the fields.. Code:
ALTER TABLE `spawngroup` ADD `dist` FLOAT NOT NULL DEFAULT '0.0', |
Find -- if (!CalculateNewPosition2(roambox_movingto_x, roambox_movingto_y, GetZ(), walksp, true))
Code:
{ |
I'll get to this and hopefully the remaining submissions I haven't gotten to within the next couple days I hope I hope.
|
added a addspawn2 option for #advnpcspawn.. so you can manually add spawn2 entrys.
edit:: apparently "theres no point" in my spawn2 entry addition.. thanks ailia |
did this ever make into source? if not could it be put on the list again? =) thanks in advance KLS keep up the good work.
|
It did not. It's a shame, good code, I use it still.
Especially roamboxes, they work wonders if you know how to use them. Can replace grids in open areas. |
This is why I say, if it looks good, put it in and let everyone try and decide ASAP. You can always take it out again.
This guy got his code ignored, when he probably would have been a great help to the project. Now hes gone :( |
could someone elaborate WHAt does advnpcspawn actual does?
and how to use it? |
Code:
Format: #advnpdspawn makegroup <name> [spawn limit] [dist] [max x] [min x] [max y] [min y] [delay] |
hmm so you teling me if i want to make a randomly roaming npc, this thing will essentialy substitute the need of making a grid for random area roamers?
wouldn't this require a whole new table in DB? and it should also store a zone id somewhere no? |
Quote:
2) No, it doesn't require a new table in the DB. The spawngroup is loaded on a repop or zone bootup with this code, and because of this, the zone ID is stored in spawn2 rather than spawngroup. Also, roamboxes are stored in spawngroup so a random NPC can spawn each time. If no roambox is specified, the NPC finds a grid. If no grid is specifed, the NPC stays static and does nothing. Pretty easy system. |
This code is in the SVN for anybody who wishes to fiddle with it. It worked pretty well in my limited testing.
|
wondering....need to remove a spawn group. client side how do i do that with this set of cmd's?
didnt see an argument to remove a spawngroup id so need to know how to do this remotely from the server |
All times are GMT -4. The time now is 12:08 AM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.