Thread: Porters
View Single Post
  #5  
Old 04-15-2015, 04:54 PM
markusdabrave's Avatar
markusdabrave
Sarnak
 
Join Date: Jan 2012
Location: Plano, TX
Posts: 70
Default

Thanks for the advice, I'll give the movepc thing a try. You're exactly right on what my goal is. I'd like to make the porter cast 2-3 seconds of spell effects, then the player get teleported out. The problem I've run into is that everything happens sequentially. Timer -> Spell Effect -> Port rather than Timer & Spell Effect -> Port.

Right now this is what my code is. Functionally, it works fine. I'd like like it feel a little less botty and more pc-ish

Also, if there's a way to make this script not use so many if statements, I'm all ears. I'm new to perl but not programming so I suspect there has to be a way to combine those if statements into fewer lines of code.

Code:
sub EVENT_SAY {
	if ($text=~/Hail/i) {
	plugin::Whisper("Hail! Where would you like to go? [Butcherblock] Mountains, The [Feerrott], North [Karana], [Lavastorm] Mountains, [Misty] Thicket, [South Ro], [Steamfont] Mountains, West [Commonlands] or [Toxxulia] Forest?");
	}
#	if ($text=~/Surefall/i) {
#	quest::selfcast(34);
#	quest::say("Off to Surefall Glade!");
#	quest::selfcast(2021);
#	}
	if ($text=~/Commonlands/i) {
	quest::say("Off to West Commonlands!");
	quest::selfcast(34);
	quest::selfcast(531);
	}
	if ($text=~/Butcherblock/i) {
	quest::say("Off to Butcherblock Mountains!");
	quest::selfcast(34);
	quest::selfcast(532);
	}
	if ($text=~/Feerrott/i) {
	quest::say("Off to The Feerrott!");
	quest::selfcast(34);
	quest::selfcast(536);
	}
	if ($text=~/Karana/i) {
	quest::say("Off to North Karana!");
	quest::selfcast(34);
	quest::selfcast(530);
	}
	if ($text=~/Lavastorm/i) {
	quest::say("Off to Lavastorm Mountains!");
	quest::selfcast(34);	
	quest::selfcast(534);
	}
	if ($text=~/Misty/i) {
	quest::say("Off to Misty Thicket!");
	quest::selfcast(34);
	quest::selfcast(538);
	}
	if ($text=~/South Ro/i) {
	quest::say("Off to South Ro!");
	quest::selfcast(34);
	quest::selfcast(535);
	}
	if ($text=~/Steamfont/i) {
	quest::say("Off to Steafont Mountains!");	
	quest::selfcast(34);
	quest::selfcast(537);
	}
	if ($text=~/Toxxulia/i) {
	quest::say("Off you Toxxulia Forest!");
	quest::selfcast(34);
	quest::selfcast(533);
	}
}
Reply With Quote