View Full Version : Return to spawn location
realityincarnate
04-16-2009, 08:40 PM
I feel like I must be missing something, but I can't seem to find the appropriate quest command and was wondering if there is one that I overlooked. I'm trying to get an npc to disappear and immediately return to its spawn location after a certain amount of time has elapsed. Using quest::respawn seemed like an obvious choice, but that seems to just destroy the current npc (I assume it respawns after the timer elapses, but I haven't waited around that long). I also thought about using gmmove, but it would just be cleaner if there was something that basically did a one npc repop.
Any suggestions?
joligario
04-16-2009, 09:25 PM
Does it have to be done without respawning him? Certain variable set or something?
trevius
04-16-2009, 10:24 PM
It all depends on exactly what you are wanting to do. The easiest way would be to make a second NPC to manage the one you are trying to set to respawn. Then just have them do
quest::depop(ncp_id);
quest::spawn2(npc_id, 0, 0, x, y, z, h);
And have that second NPC keep a timer of when do "repop" him. Otherwise, you could just have the NPC itself do:
quest::depop();
On itself and then set the respawn timer on him to like 1 second.
There are plenty of other ways to accomplish what you are wanting to do, but it depends on how complex you want to be :P
realityincarnate
04-16-2009, 11:35 PM
For a little bit more background: I've been trying to get the controllable boats to work for a little while now, and I think I finally got it (I'll post the code after a little bit more testing). I know in Live, at least back in the day (most of my play time was pre-Kunark), the boats would reset to their original spawn position if no one used them for about an hour.
I was hoping to come up with a generic quest that could be used for all the boats in different zones to do this, without worrying about the specifics of each boat (spawn2 ids, respawn times, anything like that). At the moment, it looks like the options are to a.) modify quest::gmmove to allow a heading parameter as well, and use that to just move the boat; b.) spawn another copy and depop the original, like suggested; or c.) just have them respawn and not worry about the respawn times.
Option c.) might actually be the most Live like, since I remember a lot of times wandering the river banks in Tox forest looking for the boat, only to have it reappear about 30 seconds after I gave up and swam to Kerra Ridge.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.