Code:
sub EVENT_SAY {
my %porthash = (
"butcher" => "Butcherblock Mountains",
"feerrott" => "The Feerrott",
"northkarana" => "North Karana",
"lavastorm" => "Lavastorm Mountains",
"misty" => "Misty Thicket",
"sro" => "South Ro",
"steamfont" => "Steamfont Mountains",
"commons" => "West Commonlands",
"toxxulia" => "Toxxulia Forest"
);
if ($text=~/Hail/i) {
plugin::Whisper("Hail! Where would you like to go? ");
foreach my $key (keys %porthash) {
$client->Message(315, "[".quest::saylink($key, 1, $porthash{$key})."]");
}
}
elsif (defined $porthash{$text}) {
plugin::Whisper("Off to ".$porthash{$text}." you go!");
quest::doanim(43);
$client->SpellEffect(43,10);
castdelay(5);
quest::selfcast(34);
quest::zone($text);
}
}
Ok this will take me a month to figure out own my own what all's going on here. It works though. So instead of typing a location, you've opted for clickable links. Very clever. It's a little over my head right now but I'll keep staring at it until it sinks in. It sort of does. Is there a way to make the zone list "<zone>, <zone>, <zone>" instead of a list?
About to try KKs. This one's definitely over my head. I've read about globals and entitys but haven't messed with them yet.
Also, side question brought up by the plugin thing:
Could I turn this into a plugin by saving it in the plugins folder?
Code:
sub castdelay{
$delayOver = (time + $_[0]);
while (time < $delayOver){}
1;
}