EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Custom (https://www.eqemulator.org/forums/forumdisplay.php?f=671)
-   -   Few scripts (https://www.eqemulator.org/forums/showthread.php?t=35380)

Maze_EQ 06-04-2012 09:56 AM

Few scripts
 
Use them any way you wish. for the community.

Code:

#####################################
#Maze-6/2/2012 9:52a                #
#Multi-Task npc                    #
#Guildhall                          #
#"Orlisk=NPC                                                #       
#####################################
sub EVENT_SAY
{
my $convoy = quest::saylink ("convoy",1);
my $get_started = quest::saylink ("get started",1);
my $progress = quest::saylink ("progress",1);
my $token = quest::saylink ("insignia",1);
my $tokenz = quest::has_zone_flag(104);
#all variables to certain functions
#
if ($text=~/hail/i)
{
quest::say ("Greetings, $name. I can't say I've seen you around these parts, so I'm guessing you're part of the [$convoy] that came through?I can give you some platinum to [$get_started], or show you what is needed to [$progress], and if you seem to have misplaced your [$token] I can help.");
}
#General quest say using variables that correspond to things in further notation
if ($text=~/convoy/i)
{
quest::say ("What's wrong with you $race! Did you bump your head? Maybe you're not part of them, who knows. If you need assistance, talk to the people around the hall, surely they can help.");
}
#example of text+variable working side by side for a true/false if statement
if($text =~/insignia/i && $tokenz == 1)
{
quest::summonitem(1079,1);
}
if($text =~/insignia/i && $tokenz == 0)
{
quest::say ("You have not acquired this flag");
}
#False if statement provided they have the flag needed, it will assign the task.
if ($text=~/progress/i && $tokenz == 0)
{
quest::assigntask(141);
}
#As a true, if flag is seen, task will not be handled and return a "You blahblahblah"
if ($text=~/progress/i && $tokenz == 1)
{
$client->Message(4,"You cannot complete this again");
}
#Shoddy work with qglobals, but I guess it works.
if ($text=~/get started/i && $platinum == 0)
{
$platinum = undef;
$client->Message(5,"Enjoy your stay");
quest::givecash(0,0,0,50);
quest::setglobal("platinum",1,5,"F");
}
#
if ($text=~/get started/i && $platinum == 1)
{
$client->Message(4,"You have already received this reward, $name.");
}
#
}
sub EVENT_ITEM
{
#Item handin section to recieve flags based on which token you handed in
if(plugin::check_handin(\%itemcount, 1079 => 1,))
{
quest::summonitem(1079,1)
}
#The actual flagging portion of the handin.
{
$client->Message(4,"You are now flagged for Kunark!");
quest::set_zone_flag(87);#1 burning woods
quest::set_zone_flag(103);#2 chardok
quest::set_zone_flag(90);#3 City of mist
quest::set_zone_flag(104);#4 dalnir
quest::set_zone_flag(86);#5 dreadlands
quest::set_zone_flag(106);#6 cabeast
quest::set_zone_flag(82);#7 cabwest
quest::set_zone_flag(94);#8 emeraldjungle
quest::set_zone_flag(78);#9 fieldofbone
quest::set_zone_flag(84);#10 firiona
quest::set_zone_flag(92);#11 frontiermtns
quest::set_zone_flag(105);#12 charasis
quest::set_zone_flag(88);#13 kaesora
quest::set_zone_flag(102);#14 karnor
quest::set_zone_flag(97);#15 Kurn
quest::set_zone_flag(85);#16 lakeofillomen
quest::set_zone_flag(107);#17 nurga
quest::set_zone_flag(89);#18 sebilis
quest::set_zone_flag(91);#19 skyfire
quest::set_zone_flag(83);#20 swampofnohope
quest::set_zone_flag(96);#21 timorous
quest::set_zone_flag(95);#22 trakanon
quest::set_zone_flag(108);#23 veeshan
quest::set_zone_flag(79);#24 warsliks
quest::set_zone_flag(81);#25 droga
quest::set_zone_flag(93);#26 overthere
}
#
}
}


Maze_EQ 06-06-2012 12:30 PM

Raid Teleporter w/ check level
Code:

sub EVENT_SAY{

my $Plane_of_Hate = quest::saylink ("Plane of Hate",1);
my $Plane_of_Fear = quest::saylink ("Plane of Fear", 1);
my $Plane_of_Sky = quest::saylink ("Plane of Sky", 1);
my $Alter_Planes = quest::saylink ("Alter Planes", 1);

if ($text =~/Hail/i && $client->GetLevel()>45)

{
quest::say (" I can assist you in traveling to the [$Alter_Planes].");
}
if ($text =~/Hail/i && $client->GetLevel()<45)
{
quest::say ( "I cannot channel my magic through someone as weak as you, come back when you're stronger..");
}
if ($text =~/Alter Planes/i && $client->GetLevel()>45)

{
$client->Message(8, " [$Plane_of_Fear],[$Plane_of_Hate], or [$Plane_of_Sky].");
}

if ($text eq "Plane of Sky" && $client->GetLevel()>45)

{
$client->Message(4,"You feel a rush of air through your hair.");
quest::zone (airplane);
}

if ($text eq "Plane of Sky" && $client->GetLevel()<45)
{
$client->Message(13, "You are not strong enough to handle this kind of magic.");
}

if ($text eq "Plane of Hate" && $client->GetLevel()>45)
{
$client->Message(4,"You feel your heart shift into hatred.");
quest::zone (hateplane);
}
if ($text eq "Plane of Hate" && $client->GetLevel()<45)
{
$client->Message(13, "You are not strong enough to handle this kind of magic.");
}

if ($text eq "Plane of Fear" && $client->GetLevel()>45)
{
$client->Message(4,"A feeling of uncontrollable fear enters your mind.");
quest::zone (fearplane);
}

if ($text eq "Plane of Fear" && $client->GetLevel()<45)
{
$client->Message(13, "You are not strong enough to handle this kind of magic.");
}

}

Feel free to use and abuse, and offer criticism.

Maze_EQ 06-06-2012 12:36 PM

Zone teleporter w/ optional "flagged" zones

Code:

sub EVENT_SAY{

my $qeynos = quest::saylink ("Qeynos",1);
my $east_freeport = quest::saylink ("East Freeport", 1);
my $west_freeport = quest::saylink ("West Freeport", 1);
my $halas = quest::saylink ("Halas", 1);
my $erudin = quest::saylink ("Erudin", 1);
my $surefall = quest::saylink ("Surefall Glade", 1);
my $rivervale = quest::saylink ("Rivervale", 1);
my $akanon = quest::saylink ("Akanon", 1);
my $felwithe = quest::saylink ("Felwithe", 1);
my $kaladim = quest::saylink ("Kaladim", 1);
my $kelethin = quest::saylink ("Kelethin", 1);
my $oggok = quest::saylink ("Oggok", 1);
my $grobb = quest::saylink ("Grobb", 1);
my $neriak = quest::saylink ("Neriak", 1);
my $nektulos = quest::saylink ("Nektulos Forest", 1);
my $lavastorm = quest::saylink ("Lavastorm Mountains", 1);
my $hub = quest::saylink ("Hub", 1);
my $zone = quest::saylink ("zones", 1);
my $skyfire = quest::saylink ("Skyfire Mountains", 1);
my $firiona = quest::saylink ("Firiona Vie", 1);
my $dreadlands = quest::saylink ("Dreadlands", 1);
my $lake = quest::saylink ("Lake of Ill Omens", 1);
my $overthere = quest::saylink ("Overthere", 1);
my $tokenz = quest::has_zone_flag(104);

if ($text =~/Hail/i)
{
$client->Message(13," Greetings, $name. I could send you to. [$qeynos], [$east_freeport], [$west_freeport], [$halas], [$erudin],[$surefall], [$rivervale], [$akanon], [$felwithe],[$kaladim],[$kelethin],[$oggok], [$grobb], [$neriak], [$lavastorm], [$nektulos], or [$hub]?");
}
if($text =~/Hail/i)
{
$client->Message(13,"You need your progression token to access unlocked zones");
}

if ($text =~/Kaladim/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone(kaladima);
}

if ($text =~/Kelethin/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (gfaydark);
}

if ($text =~/Hub/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (guildhall);
}

if ($text =~/Akanon/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (steamfont);
}

if ($text =~/Nektulos/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (nektulos);
}

if ($text =~/Grobb/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (innothule);
}

if ($text =~/Oggok/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (feerrott);
}

if ($text =~/Felwithe/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (felwithea);
}

if ($text =~/East Freeport/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (freporte);
}

if ($text =~/West Freeport/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (freportw);
}

if ($text =~/Qeynos/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (qeynos2);
}

if ($text =~/Neriak/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (neriakb);
}

if ($text =~/Halas/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (everfrost);
}
if ($text =~/Rivervale/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (misty);
}

if ($text =~/Surefall Glade/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (qrg);
}

if ($text =~/Lavastorm/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (lavastorm);
}

if ($text =~/Erudin/i)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (tox);
}


if($text =~/hail/i && $tokenz == 1)
{
$client->Message(13,"I can also send you to your unlocked [$zone]");
}
if($text =~/zones/i && $tokenz == 1)
{
$client->Message(13, "You have access to [$dreadlands], [$firiona], [$lake], [$skyfire], or [$overthere].");
}
if($text =~/Dreadlands/i && $tokenz == 1)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (dreadlands);
}
if($text =~/firiona vie/i && $tokenz == 1)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (firiona);
}
if($text =~/lake of ill omen/i && $tokenz == 1)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (lakeofillomen);
}
if(text =~/Skyfire Mountains/i && $tokenz == 1)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (skyfire);
}
if(text =~/overthere/i && $tokenz == 1)
{
quest::emote ("opens a portal and kicks you through it.");
quest::zone (overthere);
}


}

Could also add statements if the character is not flagged for that particular set of zones. that just requires a

Code:

if(text =~/overthere/i && $tokenz == 0)
{
client->Message(13, "You do not have the flag to use this teleporter);
}

That would be added to all your "Flagged" zones to check if the character doesn't have the flag, and if it doesn't the script will notify them.

Maze_EQ 06-06-2012 12:39 PM

This is your basic "Learn the link usage" and npc respond quest.

Code:


sub EVENT_SAY
{
my $all = quest::saylink ("all",1);
my $tenth = quest::saylink ("tenth",1);
my $twentieth = quest::saylink ("twentieth",1);
my $thirtieth = quest::saylink ("thirtieth",1);
my $fourtieth = quest::saylink ("fourtieth",1);

if ($text=~/hail/i)

{
quest::say ("If you were wondering, I know [$all] the best places to hunt!");
quest::emote ("purrs.");
}

if ($text=~/all/i)

{
quest::say ("Well, of what season are you? [$tenth],[$twentieth],[$thirtieth],[$fourtieth].");
quest::emote ("hisses.");
}

if ($text=~/tenth/i)

{
quest::say ("I always hunted them orcs, over in Crushbone, in the Faydarks, but becareful if you follow evil gods, them elvies don't like that sorta thing..");
}

if ($text=~/twentieth/i)

{
quest::say ("The good old days eh? Well, I trecked through the ButcherBlock mountains, into Dagnor's Cauldron, and right into the bowels of the Estate of Unrest! Careful of the ghoulies and ghosties!");
}

if ($text=~/thirtieth/i)

{
quest::emote ("licks his lips.");
quest::say ("OmNomNomNom, them froggies tasted good, I'd say hunt that place the trolls call Guk, them make good lunches.");
}

if ($text=~/fourtieth/i)

{
quest::say ("Big ol' dragon, towering giants, wimpy kobolds, yeah, yeah, the lair of the dragon under Lavastorm! Bestest place to catch many rats!");
}

}


Sorry for the multi-post, had a brain fart, could've put it all in one post.

Maze_EQ 07-26-2012 03:13 PM

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);
  }
 
}


Caryatis 07-27-2012 09:24 AM

If you use GetNPCByNPCTypeID you won't have to cast to NPC(second example).

Maze_EQ 07-27-2012 09:39 AM

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.


All times are GMT -4. The time now is 07:31 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.