EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Feature Requests (https://www.eqemulator.org/forums/forumdisplay.php?f=612)
-   -   add functinoality to quest::depop() (https://www.eqemulator.org/forums/showthread.php?t=33616)

sorvani 05-23-2011 10:04 AM

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);
quest::depop();
#update spawn timer after depop or mob will repop when zone resets
#quest::updatespawntimer(spawn2.id,(int(rand(DB_Variance))+DB_Respawn-(DB_Variance/2))*1000); #variance setting
quest::updatespawntimer(42135,(int(rand(25920))+129600-(25920/2))*1000); #respawn with variance

Could we get 2 optional parameters added to quest::depop?

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.

Kayen 05-23-2011 11:22 AM

Just use.

$npc->Depop(StartSpawnTimer= true)

sorvani 05-23-2011 11:57 AM

This shows how poor my c++ skills are I didn't see that in the code when I was trying to figure it out.

sorvani 06-18-2011 10:30 AM

Ok I tested this out last night and using $npc->Depop(StartSpawnTimer= true) causes the quest file to fail.

joligario 06-18-2011 10:47 AM

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.

joligario 06-18-2011 11:59 AM

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.

sorvani 06-18-2011 03:42 PM

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.

joligario 06-18-2011 04:07 PM

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.

Robregen 11-12-2011 11:45 PM

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.