View Full Version : Depop Time
jotajota
02-08-2004, 10:05 AM
Is there any way to set up a depop time?
i need to create mobs, but these mobs only spawn at night and disappear in the morning.
Thanks
Lurker_005
02-08-2004, 05:16 PM
Short anwser: no, not that I am aware of.
Perhaps with some fancy scripting of quests in perl some workaround might be possible...
samandhi
02-08-2004, 10:42 PM
I might be talking out of my arse here (for lack of knowledge), but can you not look in the database for the kithicor mobs and see how they are set up to react? Dont they depop during the day?
sandy
02-09-2004, 04:56 AM
we need a script language and events to do this
=)
we could implement for example something like the script language for neverwinter nights
monsters had a onspawnevent() script
you put there a timer count and when the timer ends you call depop()
it could be very usefull =)
smogo
02-09-2004, 05:30 AM
brief :
a. when the mob spawns, it calls EVENT_SPAWN() sub.
b. in this sub, start a timer with quest::starttimer()
c. in the EVENT_TIMER, called when the time is reached, call quest::depop()
It should work, wont it ?
samandhi
02-09-2004, 06:12 AM
brief :
a. when the mob spawns, it calls EVENT_SPAWN() sub.
b. in this sub, start a timer with quest::starttimer()
c. in the EVENT_TIMER, called when the time is reached, call quest::depop() Again, probably not glowing at 100 watts, but at only 75, but since there is already code for the ids of the mobs in kith, why couldnt you just add the mobs in question to that routine? As opposed to haveing to add anything new and tell that sub WHICH mobs id's will be triggered? Let's just say he doesnt want the WHOLE zone to depop, for instance... Wouldnt that make taht routine actually harder? (not totally sure that is why Im asking).
smogo
02-09-2004, 06:34 AM
There is a quest file per mob, so just need to define a trigger for the mobs that you want depop.
Still, that makes several files, but you can symbolic link them to one using proper varaibles.
This behaviour could also be shared using the default file (used when no mob-specific file is found), where you would alter the EVEN_SPAWN() to setup a timer only for some npc ids, but this make a complex routine (even using global vars), as was pointed out
There is a problem, though : you can control depop time (you need to retriieve current time if possible), but not spawn time AFAIK (i.e. if the mob gets killed in the middle of the night, which happens sometimes :) ).
samandhi
02-09-2004, 06:52 AM
So, then would EVENT_SPAWN() overwrite the respawn_timer routine? Or is that the routine that calls that table in the database?
smogo
02-09-2004, 11:18 AM
First, let me state that i did not experiment any of these things, it's just the way i understand it works.
Mobs are spawned when their respawn timer ends up. When killed or depops, they are marked for respawn after respawn_time (as defined in the database).
the EVENT_SPAWN is a script routine that is called when a mob is spawned, as a side effect. It may or may not have any consequence, it doesn't change the above rule.
When using a script as described above, you simply force depop time at a given time (or after a given time). When you quest::depop() in the script, it just tells the server to depop. I think this starts the respawn_timer countdown.
Well, if anyone has experience about this matter, or time to trace the code, it would be 10000 times more valuable than the few above forecasts. It might just be that way.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.