add functinoality to quest::depop()
quest::depop does not cause the respawn timer for a NPC with a respawn timer to kick in.
Here is an example from Manaetic_Behemoth.pl Code:
quest::spawn2(206074,0,0,$x,$y,$z,0); 1: BOOL FALSE = Default. Just depop. Current functionality. TRUE = Use Respawn time and variance in DB if parameter 2 is not present or = 0 2: INT A respawn timer passed by quest script, only used when optional parameter 1 is present and = TRUE. This is useful for various PoP bosses who have shortened respawn tiemrs on event failure. |
Just use.
$npc->Depop(StartSpawnTimer= true) |
This shows how poor my c++ skills are I didn't see that in the code when I was trying to figure it out.
|
Ok I tested this out last night and using $npc->Depop(StartSpawnTimer= true) causes the quest file to fail.
|
What exact syntax did you use? It is of type Mob, but NPC should inherit from Mob. I will test this out in a minute.
|
It looks like you would use $npc->Depop(0) or $npc->Depop(1). It defaults to true, so you don't need any arguments. If that isn't working, then there is something else wrong.
|
It definitely does not default to 1. The whole reason I made this post was because NPCs that are quest::depop always repop when you #repop after their quest depops them. The way it read to me was that quest::depop was calling ->Depop.
I'm not home now, but I'll look in to it again tonight. |
Ok, I think I fixed it then; running some final tests before committing. Depop with true was resetting the timer, but not writing it to the database. So if you did #repop, waited for the normal respawn time, or the zone was reset, the NPC would respawn. I changed it so that setting it true will restart the clock. Default is changed to false. Here are the methods:
quest::depop(id) - NPC id optional. Depops the NPC and does not reset the timer. As long as zone is up or until #repop is done, NPC stays depopped. $npc->Depop() - Reset is optional and defaulted to false. This acts just like the quest::depop() method. $npc->Depop(1) - Depops the NPC as if it were killed. NPC will repop based upon normal spawntimer value. There is also still the quest::dis(en)able_spawn2 which I didn't change. |
I tried using this quest::disable_spawn2 with quest::enable_spawn2.
It looks like quest::disable_spawn2 acts like a quest::depop(). it won't respawn with quest::enable_spawn2 unless the zone is reset or I use #repop command. It would be a nice feature to use since I can have it respawn at a proper time than to have to spawn too early. EDIT: Looks like it works if I throw in $npc->Depop(1) function. then use quest::disable_spawn2 after it or on another script. |
All times are GMT -4. The time now is 02:55 PM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.