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

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

Reply
 
Thread Tools Display Modes
  #1  
Old 07-29-2009, 04:23 AM
eqwarrior
Sarnak
 
Join Date: Jul 2009
Location: United States
Posts: 40
Question undef

How important is undef?

Just from other peoples examples, I've used

$variable = undef;

but now I'm seeing

undef $variable;

Is either ok? Which is the proper way? Do I use it for just qglobals or any my $variables? Is it important, such as freeing up memory? Sorry for the noob questions lol. Trying to optimize my quest files.

And would this be a possible cause of a zone taking up more RAM the longer zone is up?

-Thanks
Reply With Quote
  #2  
Old 07-29-2009, 04:36 AM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Unless you were using a TON of variables, I don't think that would effect memory at all. You should really only need to undef them if you need to clear them out for some reason so they don't get used later on. Like, if you have an NPC do something and set a variable and you use that variable for an event or something for a particular player, you might not want that variable to be set the next time that event starts or the next time another player interacts with that NPC. You shouldn't really need to use undef on qglobals as long as you are using $qglobals{qglobalname} in your scripts and not just pulling qglobal information with variables named the same as your qglobal. You can check if a qglobal is not defined by doing a (!defined(qglobals{qglobalname})), and so on.

I am certainly no perl expert, so, I might be wrong, but that is my understanding of the answers to your questions.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #3  
Old 07-29-2009, 08:20 AM
eqwarrior
Sarnak
 
Join Date: Jul 2009
Location: United States
Posts: 40
Default

Maybe I'm doing globals wrong, with setglobal then my $variable = globalname; I'm trying to figure out why sometimes Anguish uses 1 gig ram after 12 hours of raiding etc. Been google searching for answers too.
Reply With Quote
  #4  
Old 07-29-2009, 08:41 AM
eqwarrior
Sarnak
 
Join Date: Jul 2009
Location: United States
Posts: 40
Question

Here is example of quest in Anguish, maybe memory leak for not enough undef? Every one of the 17 Bosses have a similar script:

For Overlord_Mata_Muram:

Code:
#####################################################################

### NPC ID :  2700489

### NPC NAME: Overlord_Mata_Muram

### Anguish Boss: Level 17

#####################################################################



sub EVENT_SPAWN

{

  $BaseNumber = 3;                                 ### Minimin number of times to pop NPCs waves

  $Additional = 0;                                 ### and additional number for max pop NPCs waves

  $wavenum = int (rand($Additional)) + $BaseNumber + 1;  ###(3 to 3)                          

  $gap = 100;

  $gap /= int $wavenum;                            ### percentage of gap between spawns  

  $gap = int $gap;                                 ### Remove Decimal Point

  $percent = int (rand($gap));                     ### Random number in that percentage  

  $nextwave = ($gap * $wavenum) - $percent;        ### percentage - (random percentage)

  quest::setnexthpevent("$nextwave");              ### set next wave                     

} # end EVENT_SPAWN


sub EVENT_HP  

{ 

   if($hpevent == "$nextwave") {                      ### when the current HP == setnexthpevent

      if($wavenum > 0) {                              ### If waves left > 0

         $wavenum -= 1;                               ### deincrement number (-1) of waves 

         $percent = int (rand($gap));                 ### Random number in that percentage     

         $nextwave = ($gap * $wavenum) - $percent;    ### percentage - (random percentage)

         quest::say("Help!");
         my $a = 2700505;                     ### ID of Add to spawn 2 (an_ikaav_Mastermind) 2.0 Trash

         my $x = $npc->GetX();                ### Get Trash mob X

         my $y = $npc->GetY();                ### Get Trash mob Y

         my $z = $npc->GetZ();                ### Get Trash mob Z

         my $h = $npc->GetHeading();          ### Get Trash mob H

         quest::spawn2($a,0,0,$x,$y,$z,$h);   ### Spawn Add
         quest::spawn2($a,0,0,$x,$y,$z,$h);   ### Spawn Add
         quest::spawn2($a,0,0,$x,$y,$z,$h);   ### Spawn Add
         quest::spawn2($a,0,0,$x,$y,$z,$h);   ### Spawn Add
         $npc->WipeHateList();
         if($nextwave >= 0) {  

            quest::setnexthpevent("$nextwave");

            } # end $nextwave >= 0

         else {                                       ### Last wave will have a negative number

            quest::setnexthpevent(0);

            } # end else

         } # end $wavenum > 0

      } # end $hpevent == $nextwave

   } # end EVENT_HP


sub EVENT_ATTACK 
{
  my $anguish_boss_one = $entity_list->GetMobByNpcTypeID(2700469); # 1
  my $anguish_boss_two = $entity_list->GetMobByNpcTypeID(2700471); # 2
  my $anguish_boss_three = $entity_list->GetMobByNpcTypeID(2700468); # 3
  my $anguish_boss_four = $entity_list->GetMobByNpcTypeID(2700467); # 4
  my $anguish_boss_five = $entity_list->GetMobByNpcTypeID(2700464); # 5
  my $anguish_boss_six = $entity_list->GetMobByNpcTypeID(2700474); # 6
  my $anguish_boss_seven = $entity_list->GetMobByNpcTypeID(2700472); # 7
  my $anguish_boss_eight = $entity_list->GetMobByNpcTypeID(2700473); # 8
  my $anguish_boss_nine = $entity_list->GetMobByNpcTypeID(2700470); # 9
  my $anguish_boss_ten = $entity_list->GetMobByNpcTypeID(2700463); # 10
  my $anguish_boss_eleven = $entity_list->GetMobByNpcTypeID(2700466); # 11
  my $anguish_boss_twelve = $entity_list->GetMobByNpcTypeID(2700465); # 12
  my $anguish_boss_thirteen = $entity_list->GetMobByNpcTypeID(2700462); # 13
  my $anguish_boss_fourteen = $entity_list->GetMobByNpcTypeID(2700461); # 14
  my $anguish_boss_fifteen = $entity_list->GetMobByNpcTypeID(2700460); # 15
  my $anguish_boss_sixteen = $entity_list->GetMobByNpcTypeID(2700488); # 16


  if ($anguish_boss_one) { # 1
    my $hate_anguish_boss_one = $anguish_boss_one->CastToNPC();
    $hate_anguish_boss_one->AddToHateList($client, 1); }

  if ($anguish_boss_two) { # 2
    my $hate_anguish_boss_two = $anguish_boss_two->CastToNPC();
    $hate_anguish_boss_two->AddToHateList($client, 1); }

  if ($anguish_boss_three) { # 3
    my $hate_anguish_boss_three = $anguish_boss_three->CastToNPC();
    $hate_anguish_boss_three->AddToHateList($client, 1); }

  if ($anguish_boss_four) { # 4
    my $hate_anguish_boss_four = $anguish_boss_four->CastToNPC();
    $hate_anguish_boss_four->AddToHateList($client, 1); }

  if ($anguish_boss_five) { # 5
    my $hate_anguish_boss_five = $anguish_boss_five->CastToNPC();
    $hate_anguish_boss_five->AddToHateList($client, 1); }

  if ($anguish_boss_six) { # 6
    my $hate_anguish_boss_six = $anguish_boss_six->CastToNPC();
    $hate_anguish_boss_six->AddToHateList($client, 1); }
    
  if ($anguish_boss_seven) { # 7
    my $hate_anguish_boss_seven = $anguish_boss_seven->CastToNPC();
    $hate_anguish_boss_seven->AddToHateList($client, 1); }

  if ($anguish_boss_eight) { # 8
    my $hate_anguish_boss_eight = $anguish_boss_eight->CastToNPC();
    $hate_anguish_boss_eight->AddToHateList($client, 1); }

  if ($anguish_boss_nine) { # 9 
    my $hate_anguish_boss_nine = $anguish_boss_nine->CastToNPC();
    $hate_anguish_boss_nine->AddToHateList($client, 1); }

  if ($anguish_boss_ten) { # 10
    my $hate_anguish_boss_ten = $anguish_boss_ten->CastToNPC();
    $hate_anguish_boss_ten->AddToHateList($client, 1); }

  if ($anguish_boss_eleven) { # 11
    my $hate_anguish_boss_eleven = $anguish_boss_eleven->CastToNPC();
    $hate_anguish_boss_eleven->AddToHateList($client, 1); }

  if ($anguish_boss_twelve) { # 12
    my $hate_anguish_boss_twelve = $anguish_boss_twelve->CastToNPC();
    $hate_anguish_boss_twelve->AddToHateList($client, 1); }

  if ($anguish_boss_thirteen) { # 13
    my $hate_anguish_boss_thirteen = $anguish_boss_thirteen->CastToNPC();
    $hate_anguish_boss_thirteen->AddToHateList($client, 1); }

  if ($anguish_boss_fourteen) { # 14
    my $hate_anguish_boss_fourteen = $anguish_boss_fourteen->CastToNPC();
    $hate_anguish_boss_fourteen->AddToHateList($client, 1); }

  if ($anguish_boss_fifteen) { # 15
    my $hate_anguish_boss_fifteen = $anguish_boss_fifteen->CastToNPC();
    $hate_anguish_boss_fifteen->AddToHateList($client, 1); }

  if ($anguish_boss_sixteen) { # 16
    my $hate_anguish_boss_sixteen = $anguish_boss_sixteen->CastToNPC();
    $hate_anguish_boss_sixteen->AddToHateList($client, 1); }

} # End EVENT_ATTACK


sub EVENT_DEATH {

   quest::spawn2(2700493,0,0,504,4921,296,0);   ### Spawn Chest
   quest::spawn2(2700520,0,0,512,5012,297,0);   ### Spawn Chest
   quest::spawn2(2700521,0,0,543,4967,298,0);   ### Spawn Chest
   quest::spawn2(2700522,0,0,468,4971,299,0);   ### Spawn Chest
   quest::spawn2(2700523,0,0,505,4972,300,0);   ### Spawn Chest

   my $npc_name = $npc->GetCleanName();
   $datetime = localtime();

   quest::write("Anguish_Boss_Kills.txt","$datetime -- $name killed Level 17 $npc_name.");
   quest::setglobal("killed_overlord_mata_muram","$datetime","7","F");

   $datetime=undef;
   $killed_overlord_mata_muram=undef;



} # End EVENT_DEATH
And here is one from a Trash Mob:


Code:
#####################################################################

### NPC ID :  

### NPC NAME: 

### Anguish Trash 1.0

#####################################################################



sub EVENT_SPAWN {

}

sub EVENT_AGGRO {

my $Phrase1 = "For Mata Muram! Now you die!";

my $Phrase2 = "I shall rid Anguish of another infamous villain.";

my $Phrase3 = "Your foul deeds have earned my contempt.";

my $Phrase4 = "${class}s like you are better left dead than alive.";

my $Phrase5 = "It's ${races}s like you who have ruined your own lands, You'll not Anguish!";

my $Phrase6 = "Heathen! Unbeliever! Anguish must be cleansed!";

my $Phrase7 = "Your beliefs are an insult to us all!";

my $Phrase8 = "Your actions force me to kill you.";

my $Phrase9 = "Your intolerable reputation insults all in Anguish.";

my $Phrase10 = "It's time for you to take your blasphemy into the next realm.";

my $Phrase11 = "${race}s like you are better left dead than alive.";
my $Phrase12 = "No loots for you! Go away!";

my $Phrase = quest::ChooseRandom($Phrase1,$Phrase2,$Phrase3,$Phrase4,$Phrase5,$Phrase6,$Phrase7,$Phrase8,$Phrase9,$Phrase10,$Phrase11,$Phrase12);

quest::say("$Phrase");

}

sub EVENT_ATTACK {
}



sub EVENT_HP {

} 



sub EVENT_DEATH {

$random_one = int (rand(100));                ### random_one 100 for a 3% chance
if($random_one > 96) {                         ### 3% chance spawn on death
   my $x = $npc->GetX();

   my $y = $npc->GetY();

   my $z = $npc->GetZ();

   $random_two = int (rand(100));             ### random_two 100 for 1%, 33%, and 66% chances
   if($random_two > 33) {                     ### 66% chance spawn Chest 2700496

      quest::spawn2(2700496,0,0,$x,$y,$z,0);  ### Spawn Chest 2700496
      quest::say("Don't touch my treasures!");
      } # end if random_two
   elsif ($random_two < 1) {                  ### 1% chance spawn Rare Chest 2700491
      quest::spawn2(2700491,0,0,$x,$y,$z,0);  ### Spawn Rare Chest 2700491
      quest::say("You found my rare loot! Don't steal it!");
      } # end elsif random_two
   else {                                     ### else 33% chance spawn Named
      my $namednpc = quest::ChooseRandom(2700507,  # Shalvo
                                         2700508,  # Ofanso
                                         2700509,  # Novara
                                         2700510,  # Jansio
                                         2700511,  # Arisisi
                                         2700512,  # Laveng
                                         2700513,  # Vonaasha
                                         2700514,  # Yhinra
                                         2700515); # Uchti
      quest::spawn2($namednpc,0,0,$x,$y,$z+5,0);  ### Spawn named npc (5 higher Z)
      quest::say("My friend will avenge my death!");
      } # end else random_two
   } # end if random_one
} # End EVENT_DEATH

Let me know if you see anything wrong. Thanks.
Reply With Quote
  #5  
Old 07-29-2009, 06:54 PM
AndMetal
Developer
 
Join Date: Mar 2007
Location: Ohio
Posts: 648
Default

Unless you need other scripts to be able to access your variables, you should consider using my for all of your defined variables. This will cause them to be erased from memory once the script is done running (read: mob is dead).

You may actually need to declare them out of the subs so that you can access them throughout the script, but it doesn't bleed over into other scripts (potentially leaking memory). Example:

Code:
#####################################################################

### NPC ID :  2700489

### NPC NAME: Overlord_Mata_Muram

### Anguish Boss: Level 17

#####################################################################

my($BaseNumber, $Additional, $wavenum, $gap, $percent, $nextwave); #from EVENT_SPAWN

sub EVENT_SPAWN

{

  $BaseNumber = 3;                                 ### Minimin number of times to pop NPCs waves

  $Additional = 0;                                 ### and additional number for max pop NPCs waves

  $wavenum = int (rand($Additional)) + $BaseNumber + 1;  ###(3 to 3)                          

  $gap = 100;

  $gap /= int $wavenum;                            ### percentage of gap between spawns  

  $gap = int $gap;                                 ### Remove Decimal Point

  $percent = int (rand($gap));                     ### Random number in that percentage  

  $nextwave = ($gap * $wavenum) - $percent;        ### percentage - (random percentage)

  quest::setnexthpevent("$nextwave");              ### set next wave                     

} # end EVENT_SPAWN


sub EVENT_HP  

{ 

   if($hpevent == "$nextwave") {                      ### when the current HP == setnexthpevent

      if($wavenum > 0) {                              ### If waves left > 0

         $wavenum -= 1;                               ### deincrement number (-1) of waves 

         $percent = int (rand($gap));                 ### Random number in that percentage     

         $nextwave = ($gap * $wavenum) - $percent;    ### percentage - (random percentage)

         quest::say("Help!");
         my $a = 2700505;                     ### ID of Add to spawn 2 (an_ikaav_Mastermind) 2.0 Trash

         my $x = $npc->GetX();                ### Get Trash mob X

         my $y = $npc->GetY();                ### Get Trash mob Y

         my $z = $npc->GetZ();                ### Get Trash mob Z

         my $h = $npc->GetHeading();          ### Get Trash mob H

         quest::spawn2($a,0,0,$x,$y,$z,$h);   ### Spawn Add
         quest::spawn2($a,0,0,$x,$y,$z,$h);   ### Spawn Add
         quest::spawn2($a,0,0,$x,$y,$z,$h);   ### Spawn Add
         quest::spawn2($a,0,0,$x,$y,$z,$h);   ### Spawn Add
         $npc->WipeHateList();
         if($nextwave >= 0) {  

            quest::setnexthpevent("$nextwave");

            } # end $nextwave >= 0

         else {                                       ### Last wave will have a negative number

            quest::setnexthpevent(0);

            } # end else

         } # end $wavenum > 0

      } # end $hpevent == $nextwave

   } # end EVENT_HP


sub EVENT_ATTACK 
{
  my $anguish_boss_one = $entity_list->GetMobByNpcTypeID(2700469); # 1
  my $anguish_boss_two = $entity_list->GetMobByNpcTypeID(2700471); # 2
  my $anguish_boss_three = $entity_list->GetMobByNpcTypeID(2700468); # 3
  my $anguish_boss_four = $entity_list->GetMobByNpcTypeID(2700467); # 4
  my $anguish_boss_five = $entity_list->GetMobByNpcTypeID(2700464); # 5
  my $anguish_boss_six = $entity_list->GetMobByNpcTypeID(2700474); # 6
  my $anguish_boss_seven = $entity_list->GetMobByNpcTypeID(2700472); # 7
  my $anguish_boss_eight = $entity_list->GetMobByNpcTypeID(2700473); # 8
  my $anguish_boss_nine = $entity_list->GetMobByNpcTypeID(2700470); # 9
  my $anguish_boss_ten = $entity_list->GetMobByNpcTypeID(2700463); # 10
  my $anguish_boss_eleven = $entity_list->GetMobByNpcTypeID(2700466); # 11
  my $anguish_boss_twelve = $entity_list->GetMobByNpcTypeID(2700465); # 12
  my $anguish_boss_thirteen = $entity_list->GetMobByNpcTypeID(2700462); # 13
  my $anguish_boss_fourteen = $entity_list->GetMobByNpcTypeID(2700461); # 14
  my $anguish_boss_fifteen = $entity_list->GetMobByNpcTypeID(2700460); # 15
  my $anguish_boss_sixteen = $entity_list->GetMobByNpcTypeID(2700488); # 16


  if ($anguish_boss_one) { # 1
    my $hate_anguish_boss_one = $anguish_boss_one->CastToNPC();
    $hate_anguish_boss_one->AddToHateList($client, 1); }

  if ($anguish_boss_two) { # 2
    my $hate_anguish_boss_two = $anguish_boss_two->CastToNPC();
    $hate_anguish_boss_two->AddToHateList($client, 1); }

  if ($anguish_boss_three) { # 3
    my $hate_anguish_boss_three = $anguish_boss_three->CastToNPC();
    $hate_anguish_boss_three->AddToHateList($client, 1); }

  if ($anguish_boss_four) { # 4
    my $hate_anguish_boss_four = $anguish_boss_four->CastToNPC();
    $hate_anguish_boss_four->AddToHateList($client, 1); }

  if ($anguish_boss_five) { # 5
    my $hate_anguish_boss_five = $anguish_boss_five->CastToNPC();
    $hate_anguish_boss_five->AddToHateList($client, 1); }

  if ($anguish_boss_six) { # 6
    my $hate_anguish_boss_six = $anguish_boss_six->CastToNPC();
    $hate_anguish_boss_six->AddToHateList($client, 1); }
    
  if ($anguish_boss_seven) { # 7
    my $hate_anguish_boss_seven = $anguish_boss_seven->CastToNPC();
    $hate_anguish_boss_seven->AddToHateList($client, 1); }

  if ($anguish_boss_eight) { # 8
    my $hate_anguish_boss_eight = $anguish_boss_eight->CastToNPC();
    $hate_anguish_boss_eight->AddToHateList($client, 1); }

  if ($anguish_boss_nine) { # 9 
    my $hate_anguish_boss_nine = $anguish_boss_nine->CastToNPC();
    $hate_anguish_boss_nine->AddToHateList($client, 1); }

  if ($anguish_boss_ten) { # 10
    my $hate_anguish_boss_ten = $anguish_boss_ten->CastToNPC();
    $hate_anguish_boss_ten->AddToHateList($client, 1); }

  if ($anguish_boss_eleven) { # 11
    my $hate_anguish_boss_eleven = $anguish_boss_eleven->CastToNPC();
    $hate_anguish_boss_eleven->AddToHateList($client, 1); }

  if ($anguish_boss_twelve) { # 12
    my $hate_anguish_boss_twelve = $anguish_boss_twelve->CastToNPC();
    $hate_anguish_boss_twelve->AddToHateList($client, 1); }

  if ($anguish_boss_thirteen) { # 13
    my $hate_anguish_boss_thirteen = $anguish_boss_thirteen->CastToNPC();
    $hate_anguish_boss_thirteen->AddToHateList($client, 1); }

  if ($anguish_boss_fourteen) { # 14
    my $hate_anguish_boss_fourteen = $anguish_boss_fourteen->CastToNPC();
    $hate_anguish_boss_fourteen->AddToHateList($client, 1); }

  if ($anguish_boss_fifteen) { # 15
    my $hate_anguish_boss_fifteen = $anguish_boss_fifteen->CastToNPC();
    $hate_anguish_boss_fifteen->AddToHateList($client, 1); }

  if ($anguish_boss_sixteen) { # 16
    my $hate_anguish_boss_sixteen = $anguish_boss_sixteen->CastToNPC();
    $hate_anguish_boss_sixteen->AddToHateList($client, 1); }

} # End EVENT_ATTACK


sub EVENT_DEATH {

   quest::spawn2(2700493,0,0,504,4921,296,0);   ### Spawn Chest
   quest::spawn2(2700520,0,0,512,5012,297,0);   ### Spawn Chest
   quest::spawn2(2700521,0,0,543,4967,298,0);   ### Spawn Chest
   quest::spawn2(2700522,0,0,468,4971,299,0);   ### Spawn Chest
   quest::spawn2(2700523,0,0,505,4972,300,0);   ### Spawn Chest

   my $npc_name = $npc->GetCleanName();
   my $datetime = localtime();

   quest::write("Anguish_Boss_Kills.txt","$datetime -- $name killed Level 17 $npc_name.");
   quest::setglobal("killed_overlord_mata_muram","$datetime","7","F");

   #$datetime=undef; #we don't need this
   #$killed_overlord_mata_muram=undef; #we don't need this either since we don't call $killed_overlord_mata_muram anywhere



} # End EVENT_DEATH
Code:
#####################################################################

### NPC ID :  

### NPC NAME: 

### Anguish Trash 1.0

#####################################################################



sub EVENT_SPAWN {

}

sub EVENT_AGGRO {

my $Phrase1 = "For Mata Muram! Now you die!";

my $Phrase2 = "I shall rid Anguish of another infamous villain.";

my $Phrase3 = "Your foul deeds have earned my contempt.";

my $Phrase4 = "${class}s like you are better left dead than alive.";

my $Phrase5 = "It's ${races}s like you who have ruined your own lands, You'll not Anguish!";

my $Phrase6 = "Heathen! Unbeliever! Anguish must be cleansed!";

my $Phrase7 = "Your beliefs are an insult to us all!";

my $Phrase8 = "Your actions force me to kill you.";

my $Phrase9 = "Your intolerable reputation insults all in Anguish.";

my $Phrase10 = "It's time for you to take your blasphemy into the next realm.";

my $Phrase11 = "${race}s like you are better left dead than alive.";
my $Phrase12 = "No loots for you! Go away!";

my $Phrase = quest::ChooseRandom($Phrase1,$Phrase2,$Phrase3,$Phrase4,$Phrase5,$Phrase6,$Phrase7,$Phrase8,$Phrase9,$Phrase10,$Phrase11,$Phrase12);

quest::say("$Phrase");

}

sub EVENT_ATTACK {
}



sub EVENT_HP {

} 



sub EVENT_DEATH {

my $random_one = int (rand(100));                ### random_one 100 for a 3% chance
if($random_one > 96) {                         ### 3% chance spawn on death
   my $x = $npc->GetX();

   my $y = $npc->GetY();

   my $z = $npc->GetZ();

   my $random_two = int (rand(100));             ### random_two 100 for 1%, 33%, and 66% chances
   if($random_two > 33) {                     ### 66% chance spawn Chest 2700496

      quest::spawn2(2700496,0,0,$x,$y,$z,0);  ### Spawn Chest 2700496
      quest::say("Don't touch my treasures!");
      } # end if random_two
   elsif ($random_two < 1) {                  ### 1% chance spawn Rare Chest 2700491
      quest::spawn2(2700491,0,0,$x,$y,$z,0);  ### Spawn Rare Chest 2700491
      quest::say("You found my rare loot! Don't steal it!");
      } # end elsif random_two
   else {                                     ### else 33% chance spawn Named
      my $namednpc = quest::ChooseRandom(2700507,  # Shalvo
                                         2700508,  # Ofanso
                                         2700509,  # Novara
                                         2700510,  # Jansio
                                         2700511,  # Arisisi
                                         2700512,  # Laveng
                                         2700513,  # Vonaasha
                                         2700514,  # Yhinra
                                         2700515); # Uchti
      quest::spawn2($namednpc,0,0,$x,$y,$z+5,0);  ### Spawn named npc (5 higher Z)
      quest::say("My friend will avenge my death!");
      } # end else random_two
   } # end if random_one
} # End EVENT_DEATH
Try that out and see if it helps.

On a somewhat unrelated note, you may want to consider changing the sub EVENT_ATTACK section for the Overlord to use arrays & for loops to make it simpler since you're doing the same thing for each of them (like maybe 8 lines total for n number of mobs?)
__________________
GM-Impossible of 'A work in progress'
A non-legit PEQ DB server
How to create your own non-legit server

My Contributions to the Wiki
Reply With Quote
  #6  
Old 07-29-2009, 07:50 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Yeah, other than the one qglobal you are setting, I don't see anywhere that you are pulling qglobal information in those scripts, just a bunch of variables. If you do ever need to pull qglobal values, just make sure to use the $qglobals{killed_overlord_mata_muram} way to do it instead of $killed_overlord_mata_muram. For example:

This is the correct way:

Code:
if (defined($qglobals{killed_overlord_mata_muram})) {
  if ($qglobals{killed_overlord_mata_muram} == 1) {
    #Do what you want here
  }
}
This is the incorrect way to pull a qglobal value:

Code:
if ($killed_overlord_mata_muram == 1) {
    #Do what you want here
}
Though the second way may work most of the time, it will definitely cause major issues in many different scenarios. The defined check I did for the correct way is not required, but I added that in there as an extra example.

Also, if you think the memory problem might be quest related, try enabling quest logging in your log.ini file and then check out your quest logs. If the quest log is getting flooded by errors, that could definitely cause some issues.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
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:39 AM.


 

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