Thread: Few scripts
View Single Post
  #3  
Old 06-06-2012, 12:36 PM
Maze_EQ
Demi-God
 
Join Date: Mar 2012
Posts: 1,103
Default

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.
Reply With Quote