Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Q&A

Quests::Q&A This is the quest support section

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 08-01-2008, 03:47 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default Adding Hate to Spawned Adds is not Working

I can't seem to figure out how to get this quest working properly. It seems pretty simple, since basically all it is supposed to do is spawn some adds and then add hate to the new spawns. The quest works fine accept for the section I highlighted in RED. The adds spawn, but they never agro. And, when the script runs, it breaks at the point where they are supposed to agro and doesn't even continue to cycle through and repeat the timers as it should. I don't get the "Testing Rat Agro Section!" message that I added to check if it was making that far.

This same section works just fine in another encounter I have, but on that encounter, the adds that come aren't spawned by the quest, they are just normal zone spawns. I suspect that "$entity_list->GetMobByNpcTypeID();" is what causes the problem. I think that since these are spawned adds and not static spawns in the zone, it can't find them in the entity list.

Does anyone know a way to get it working for spawned adds?

Code:
#Nightwhisker Fight

sub EVENT_ATTACK {


  quest::stoptimer("rat_adds");
  quest::shout("Rats of Dreadsire, I call upon you! Come to my aid!");
  quest::settimer("rat_adds",10);

}

sub EVENT_TIMER {

  if ($timer eq "rat_adds") {
    quest::stoptimer("rat_adds");

    quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 17.7, 3209.0, 0.8,12);
    quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 33.4, 3208.6, 1.8,6);
    quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 29.9, 3223.7, 5.5,7);
    quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 41.6, 3238.8, 10.3,253);
    quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 24.9, 3245.3, 12.4,5);
    
    quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 55.4, 3450.6, 24.1,61);
    quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 67.4, 3440.7, 24.1,64);
    quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 80.4, 3456.6, 24.1,61);
    quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 101.3, 3439.0, 24.1,64);
    quest::spawn2(quest::ChooseRandom(2700659,2700660,2700661),0,0, 107.9, 3454.8, 24.1,66);

    quest::say("Come! Come! Rid these halls of the humaniods!");
    quest::settimer("rat_agro",2); }

  if ($timer eq "rat_agro") {

my $tiny_rats = $entity_list->GetMobByNpcTypeID(2700659);
my $albino_rats = $entity_list->GetMobByNpcTypeID(2700660);
my $black_rats = $entity_list->GetMobByNpcTypeID(2700661);

    if ($tiny_rats) {
my $hate_tiny_rats = $tiny_rats->CastToNPC();
$hate_tiny_rats->AddToHateList($client, 1); }

    if ($albino_rats) {
my $hate_albino_rats = $albino_rats->CastToNPC();
$hate_albino_rats->AddToHateList($client, 1); }

    if ($black_rats) {
my $hate_black_rats = $black_rats->CastToNPC();
$hate_black_rats->AddToHateList($client, 1); }

    quest::stoptimer("rat_agro");
    quest::say("Testing Rat Agro Section!");
    quest::settimer("rat_adds",10); }
    
}

sub EVENT_COMBAT {

  if ($combat_state == 0) {
    quest::depopall(2700659);
    quest::depopall(2700660);
    quest::depopall(2700661);
    quest::stoptimer("rat_adds");
    quest::stoptimer("rat_agro");
  }

}

sub EVENT_DEATH {

$timestamp = localtime(time);

  quest::depopall(2700659);
  quest::depopall(2700660);
  quest::depopall(2700661);
  quest::stoptimer("rat_adds");
  quest::stoptimer("rat_agro");
  quest::shout2("SQUEEEEEEEK!");
  quest::write("bossdeaths.txt","[$timestamp]:Nightwhisker was killed by $name the $class.");

}
My Perl knowledge sucks heh.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
 


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:55 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