-
Toggle spawn
Hello~
I'm working on some event scripts, and am trying to figure out how I would make it so that spawns are toggled on and off. Basically, the map will have all mobs and their spawnpoints pre-configured in the wz, what I want to do, is make it so that the map is empty upon entrance, and mobs are then spawned, only one mob type at once, and can be changed as well as toggled on/off through NPCConversation methods. Does anyone have any knowledge of how I would construct these methods? Any advice is appreciated.
Regards, Cygnus
-
Re: Toggle spawn
Go to your maplemap.java and find the function that respawns your mobs. Add a check in there to only spawn mobs that match some variable you add to maplemap.java, for example the mob id. The default value should not let any mob spawn.
Then add a function to change your variable, and in your npcs, just do getMap().yourfunction(mobtype)
If you want your map empty upon entrance, it really depend on how spawns are handled in your source. In some a new event map should always be empty if no player is in there, in others you would have to kill all monsters in the map. (Many sources have a killallmonsters function)