Go Back   EQEmulator Home > EQEmulator Forums > Development > Development::Development

Development::Development Forum for development topics and for those interested in EQEMu development. (Not a support forum)

Reply
 
Thread Tools Display Modes
  #1  
Old 07-18-2014, 12:33 AM
rlie_0
Sarnak
 
Join Date: May 2011
Location: usa
Posts: 94
Default The missing spawn?

Hey there guys, Ive been working on this quest and got the insta spawn version to this working as intended. Just a problem with the delay aspect, and id like to ask some help! So here is the code ive worked for this spawn event.

sub EVENT_DEATH_COMPLETE {
quest::settimer("summit",10);
quest::say("I will return!");
}

sub EVENT_TIMER {
if ($timer eq "summit") {
quest::stoptimer("summit");
quest::spawn(1169,0,0,-553,-77,19.63);
}
}


Now my goal is this. Upon mobs death (as you can see) I want to start a timer, then some time later, when timer (next event) is up the mob spawns at a set location within the zone, the instal spawn version works fllawlessly, here is that below

sub EVENT_DEATH_COMPLETE {
quest::shout ("I shall return!");
quest::spawn(1169,0,0,-553,-77,19.63);
}

Anyone know what is missing from the upper quest and why the mob is failing to spawn after the timer is up?
Reply With Quote
  #2  
Old 07-18-2014, 12:57 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,590
Default

This would likely be easier using signals to an invisible mob.

Mob that dies:
Code:
sub EVENT_DEATH_COMPLETE {
    quest::signalwith(NPC ID, Signal ID);
}
Invisible mob (Race: 127, Body Type: 11, Name: _):
Code:
sub EVENT_SIGNAL {
    if ($signal == Signal ID) {
        quest::settimer("Spawn", 10);
    }
}

sub EVENT_TIMER {
    if ($timer eq "Spawn") {
        quest::spawn(1169, 0, 0, -553, -77, 19.63);
        quest::stoptimer("Spawn");
    }
}
Reply With Quote
  #3  
Old 07-18-2014, 12:59 AM
Zaela_S
Hill Giant
 
Join Date: Jun 2012
Posts: 216
Default

Timers are tied to Mobs. Starting a timer for a mob when it is dying is pointless: if the mob no longer exists when the timer is up, there won't be anything to receive the EVENT_TIMER event.

You could:

a) Spawn an invisible, untargetable NPC when the first NPC dies, which exists purely to run your timer and spawn the next NPC (and despawn itself).

b) Attach the timer to the Client that deals the killing blow and hope they don't die/leave before the timer goes off. Not sure how to do this in the Perl system myself (signal?) but I imagine there's a way.
Reply With Quote
  #4  
Old 07-18-2014, 11:14 PM
rlie_0
Sarnak
 
Join Date: May 2011
Location: usa
Posts: 94
Default

Quote:
Originally Posted by Kingly_Krab View Post
This would likely be easier using signals to an invisible mob.

Mob that dies:
Code:
sub EVENT_DEATH_COMPLETE {
    quest::signalwith(NPC ID, Signal ID);
}
Invisible mob (Race: 127, Body Type: 11, Name: _):
Code:
sub EVENT_SIGNAL {
    if ($signal == Signal ID) {
        quest::settimer("Spawn", 10);
    }
}

sub EVENT_TIMER {
    if ($timer eq "Spawn") {
        quest::spawn(1169, 0, 0, -553, -77, 19.63);
        quest::stoptimer("Spawn");
    }
}


With these suggestions it worked like a charm. I got it working like it woulda worked back on live, VS Has to be killed in order for VSR to make an appearance. My zones dont stay up perma like P99 or live can do but a delayed spawn can be made.

Thanks for the suggestions, just made an invis un-targetable mob spawn to echo the spawn timer upon VS death. Then when VSR spawns, the un-targetable mob depops. Thanks! It was annoying seeing VSR and VS both up when that never happened even on live.
Reply With Quote
  #5  
Old 07-19-2014, 05:05 AM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,590
Default

You're welcome.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 10:51 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3