Go Back   EQEmulator Home > EQEmulator Forums > Archives > Archive::Development > Archive::Quests

Archive::Quests Archive area for Quests's posts that were moved here after an inactivity period of 90 days.

Reply
 
Thread Tools Display Modes
  #1  
Old 03-12-2004, 01:38 AM
Saethan
Fire Beetle
 
Join Date: Jan 2003
Posts: 24
Default Spawning an NPC from inside a timer....

I tried to spawn NPC's inside a timer(with the perl quest system), and it crashed the zone.exe file when attempting to do so... this is the perl script I was using that crashed zone.exe:

Code:
sub EVENT_DEATH
{
quest::echo("TimerEnds");
quest::say("Impossible!  How... aarrgh.");
quest::stoptimer(1);
}

sub EVENT_ATTACK
{
quest::echo("TimerStarts");
quest::settimer(1,15);
}

sub EVENT_TIMER
{
quest::echo("TimerGoesOff");
quest::spawn(170454,0,0,-793,-883,67);
}
zone.exe would tell me 'TimerGoesOff' and then crash with a message about some kind of error with CastToClient()... soo I made this code change in zone.cpp:

Around line 708 is the code
Code:
parse->Event(EVENT_TIMER,p->mob->GetNPCTypeID(),p->name.c_str(),p->mob,0);
And I changed it to

Code:
parse->Event(EVENT_TIMER,p->mob->GetNPCTypeID(),p->name.c_str(),p->mob,p->mob->CastToMob());
And suddenly I'm able to spawn NPC's from inside a timer, now enstead of crashing zone.exe my script spawns an npc every 15 seconds until the trigger mob dies.

Now, I'm a novice coder(in C++ anyways), and I have no idea if I screwed something else up by doing this. Does this look like a decent fix?

[edit] Hmm already ran into a couple problems. It's only spawning one mob, first of all, no matter how many I put in there... and quest::me still isn't working inside the timer(didn't work before the fix either, though).
Reply With Quote
  #2  
Old 04-02-2004, 04:08 PM
Shadow-Wolf
Dragon
 
Join Date: Oct 2003
Posts: 511
Default

hmm did you ever get it fixed?
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 09:36 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 - 2025, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3