Code:
sub EVENT_SPAWN {
quest::settimer("portershout",90);
}
sub EVENT_TIMER {
if($timer eq "portershout") {
quest::stoptimer("portershout");
quest::shout("Porting to all druid locations! Hail me near tunnel to Qeynos Hills!");
quest::settimer("portershout", int(rand(100))+30);
}
}
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);
}
}
sub castdelay{
$delayOver = (time + $_[0]);
while (time < $delayOver){}
1;
}