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
  #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
 


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