Thread: Porters
View Single Post
  #37  
Old 04-20-2015, 10:08 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Not sure if you made changes yet, but for anyone following the thread:

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 = (
				"surefall" => ["Surefall Glade", 3, -391, -209, 4.75, 0,],
				"butcher" => ["Butcherblock Mountains",68, 1984, -2135, 0,],
				"feerrott" => ["The Feerrott",47, -1885, 367, 13.57, 0,],
				"northkarana" => ["North Karana",13, -1494, -2706, -7.5, 0,],
				"lavastorm" => ["Lavastorm Mountains",27, 460, 460, -84.88, 0,],
				"misty" => ["Misty Thicket",33, -1896, -490, 120.34, 0,],
				"sro" => ["South Ro",35, 317, -2034, -22.64, 0,],
				"steamfont" => ["Steamfont Mountains",56, 1668, -1779, -108.07, 0,],
				"commons" => ["West Commonlands", 21, 1427, 479, -51, 0,],
				"toxxulia" => ["Toxxulia Forest", 56, -357, 1099, -57.93, 0,],
				);
	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}[0])."]");
		}
	}
	elsif (defined $porthash{$text}) {
		plugin::Whisper("Off to ".$porthash{$text}[0]." you go!");
		quest::doanim(43);
		$client->SpellEffect(43,10);
		castdelay(5);
		quest::selfcast(34);
		quest::movepc($porthash{$text}[1],$porthash{$text}[2],$porthash{$text}[3],$porthash{$text}[4],$porthash{$text}[5]);
	}
}

sub castdelay{
	$delayOver = (time + $_[0]);
	while (time < $delayOver){}
	1;
}
Reply With Quote