Go Back   EQEmulator Home > EQEmulator Forums > Quests > Quests::Custom

Quests::Custom Custom Quests here

Reply
 
Thread Tools Display Modes
  #1  
Old 07-26-2012, 03:13 PM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

Here is another few scripts to help teach the newer server Admins some PERL in a neat, understandable, environment.

I am not a PERL master, I just figured I'd share a few things.


Code:
################
#Maze 7/26/2012#
################


#perl learning script v1
#description to teach basics.

sub EVENT_SPAWN #Shout to know when event is active
{
  quest::shout("Active");
  quest::setnexthpevent(98);
}

sub EVENT_HP #HPEvents quest::spawn2(NPCID,0,0,$+/-xaxist,$+/-yaxis,$+/-zaxis,$heading) xyz axis corresponds to the axis of the original npc
{
   if ($hpevent == 98) 
   {
      quest::spawn2(950764,0,0,$x,$y,$z,$h);
      quest::spawn2(950764,0,0,$x-40,$y,$z,$h);#will spawn selected NPCID at given axis
      quest::setnexthpevent(95); #sets for an event to happen at the given HP percentage.
   }
   elsif ($hpevent == 95)
   {
      quest::shout("Insertstringhere.");   #NPC will shout at the percentage listed. Can also incorporate other quest::XXX functions.  
      quest::setnexthpevent(90);
   }
   elsif ($hpevent == 90) 
   {
      quest::spawn2(950764,0,0,$x,$y+20,$z,$h);
      quest::setnexthpevent(87);
   }
   elsif ($hpevent == 87) 
   {
      quest::shout("insertstringhere");
      quest::spawn2(950768,0,0,$x-40,$y+30,$z,$h); 
      quest::spawn2(950768,0,0,$x-40,$y-30,$z,$h); 
      quest::spawn2(950768,0,0,$x-40,$y+10,$z,$h); 
      quest::spawn2(950768,0,0,$x-40,$y-10,$z,$h); 
      quest::setnexthpevent(80);
   }
   elsif ($hpevent == 80) 
   {
      quest::spawn2(950764,0,0,$x-40,$y+20,$z,$h); 
      quest::setnexthpevent(75);
   }
   elsif ($hpevent == 75) 
   {
      quest::shout("insertstringhere.");
      quest::setnexthpevent(70);
   }
 
   elsif ($hpevent == 70) 
   {
      quest::spawn2(950764,0,0,$x-60,$y-40,$z,$h);
      quest::setnexthpevent(68);
   }

   elsif ($hpevent == 68) 
   {
      quest::shout("insertstringhere");
      quest::spawn2(950765,0,0,$x-200,$y+30,$z,$h);
      quest::spawn2(950765,0,0,$x-200,$y-30,$z,$h); 
      quest::spawn2(950765,0,0,$x-100,$y+30,$z,$h); 
      quest::spawn2(950765,0,0,$x-100,$y-30,$z,$h);
      quest::spawn2(950765,0,0,$x-40,$y+10,$z,$h);
      quest::spawn2(950765,0,0,$x-40,$y-10,$z,$h);
      quest::setnexthpevent(60);
   }
 
   elsif ($hpevent == 60) 
   {
      quest::spawn2(950764,0,0,$x+10,$y+20,$z,$h); 
      quest::setnexthpevent(50); 
   }

   elsif ($hpevent == 50) 
   {
      quest::shout("insertstringhere");
      quest::setnexthpevent(49);
   }
   elsif ($hpevent == 49) 
   {
      quest::spawn2(950764,0,0,$x+60,$y-70,$z,$h);
      quest::setnexthpevent(44);
   }

   elsif ($hpevent == 44) 
   {
      quest::shout("insertstringhere");
      quest::spawn2(950766,0,0,$x-70,$y+15,$z,$h); 
      quest::spawn2(950766,0,0,$x-70,$y,$z,$h); 
      quest::spawn2(950766,0,0,$x-70,$y-15,$z,$h); 
      quest::setnexthpevent(40);
   }
   elsif ($hpevent == 40) 
   {
      quest::spawn2(950764,0,0,$x+10,$y+10,$z,$h);
      quest::setnexthpevent(35);
   }
   elsif ($hpevent == 35) 
   {
      quest::spawn2(950764,0,0,$x-40,$y+20,$z,$h);
      quest::setnexthpevent(33);
   }
   elsif ($hpevent == 33)
   {
      quest::shout("insertstringhere");
      quest::spawn2(950767,0,0,$x+60,$y+75,$z,$h); 
      quest::spawn2(950767,0,0,$x+60,$y-75,$z,$h); 
      quest::setnexthpevent(30);
   }
   elsif ($hpevent == 30) 
   {
      quest::spawn2(950764,0,0,$x,$y-40,$z,$h); 
      quest::setnexthpevent(25);
   }

   elsif ($hpevent == 25) 
   {
      quest::shout("insertstringhere");
      quest::setnexthpevent(20);
   }
 
   elsif ($hpevent == 20) 
   {
      quest::spawn2(950764,0,0,$x,$y+40,$z,$h);
      quest::setnexthpevent(17);
   }
   elsif ($hpevent == 17) 
   {
      quest::spawn2(950764,0,0,$x+10,$y+10,$z,$h);
      quest::setnexthpevent(15);
   }
   elsif ($hpevent == 15)
   {
      quest::shout("insertstringhere");
      quest::spawn2(950769,0,0,$x+10,$y+75,$z,$h); 
      quest::spawn2(950769,0,0,$x+30,$y-15,$z,$h);
      quest::spawn2(950769,0,0,$x+60,$y+25,$z,$h); 
      quest::spawn2(950769,0,0,$x+22,$y-63,$z,$h); 
      quest::spawn2(950769,0,0,$x-44,$y+15,$z,$h); 
      quest::spawn2(950769,0,0,$x-80,$y-85,$z,$h); 
      quest::spawn2(950769,0,0,$x-20,$y+25,$z,$h); 
      quest::spawn2(950769,0,0,$x-15,$y-15,$z,$h);  
      quest::setnexthpevent(10);
   }
   elsif ($hpevent == 10) 
   {
      quest::spawn2(950764,0,0,$x,$y,$z,$h); 
      quest::setnexthpevent(7);
   }
   elsif ($hpevent == 7)
   {
      quest::shout("insertstringhere");
   }
}

sub EVENT_DEATH
{
      quest::shout("insertstringhere");
      quest::spawn2(950761,0,0,233,-1115,-2,190);
}
And

Code:
#Maze 7/26/12
#Example PERL
#Based off of Cazic thule.

sub EVENT_AGGRO {
#These are the variables that declare how to get the npcid
  my $Zombie_One = $entity_list->GetMobByNpcTypeID(1196); 
  my $Zombie_Two = $entity_list->GetMobByNpcTypeID(1203);
  my $Zombie_Three = $entity_list->GetMobByNpcTypeID(1204);
  my $Zombie_Four = $entity_list->GetMobByNpcTypeID(1205);
  my $Zombie_Five = $entity_list->GetMobByNpcTypeID(1206);
  my $Zombie_Six = $entity_list->GetMobByNpcTypeID(1213);
  my $Zombie_Seven = $entity_list->GetMobByNpcTypeID(1214);
  my $Zombie_Eight = $entity_list->GetMobByNpcTypeID(34002);
  #end
  if ($Zombie_One) {
    my $Zombie_One1 = $Zombie_One->CastToNPC();
    $Zombie_One1->AddToHateList($client, 1);
  }
  if ($Zombie_Two) {
    my $Zombie_Two2 = $Zombie_Two->CastToNPC();
    $Zombie_Two2->AddToHateList($client, 1);
  }
  if ($Zombie_Three) {
    my $Zombie_Three3 = $Zombie_Three->CastToNPC();
    $Zombie_Three3->AddToHateList($client, 1); #Works like cazic thule, pulls certain mobs onto the player.
	
  if ($Zombie_Four4) {
    my $Zombie_Four4 = $Zombie_Four->CastToNPC();
    $Zombie_Four4->AddToHateList($client, 1);
  }
  if ($Zombie_Five) {
    my $Zombie_Give5 = $Zombie_Five->CastToNPC();
    $Zombie_Five5->AddToHateList($client, 1);
  }
  if ($Zombie_Six) {
    my $Zombie_Six6 = $Zombie_Six->CastToNPC();
    $Zombie_Six6->AddToHateList($client, 1);
  }
  
  if ($Zombie_Seven) {
    my $Zombie_Seven7 = $Zombie_Seven->CastToNPC();
    $Zombie_Seven7->AddToHateList($client, 1);
  }
  if ($Zombie_Eight) {
    my $Zombie_Eight8 = $Zombie_Eight->CastToNPC();
    $Zombie_Eight8->AddToHateList($client, 1);
  }
 
}
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
Reply With Quote
  #2  
Old 07-27-2012, 09:24 AM
Caryatis
Dragon
 
Join Date: May 2009
Location: Milky Way
Posts: 539
Default

If you use GetNPCByNPCTypeID you won't have to cast to NPC(second example).
Reply With Quote
  #3  
Old 07-27-2012, 09:39 AM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

Oh, did not know that, Thank you. I generalized off of the Cazic Thule script, seeing as I did not know the syntax.

Appreciate the tip.
__________________
"No, thanks, man. I don't want you fucking up my life, too."

Skype:
Comerian1
Reply With Quote
Reply

Thread Tools
Display Modes

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 05:09 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