Thread: Porters
View Single Post
  #2  
Old 04-17-2015, 12:24 AM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

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;
}
Reply With Quote