View Single Post
  #9  
Old 08-16-2017, 08:58 PM
ghanja's Avatar
ghanja
Dragon
 
Join Date: Aug 2012
Location: Hershey, PA
Posts: 499
Default

Code:
sub EVENT_ENTERZONE {
	my @noncombatzones = ("freportn", "runnyeye", "nexus");  ## type the zonesn of the non-combat zones (thus cancombat = 0)
	if ($zonesn ~~ @noncombatzones) {
		## this will happen if the zone they are in is one of the noncombatzones listed in the above array
	} else {
		## this will happen if the zone they are in is NOT one of the noncombatzones listed in the above array
		$client->Message(15, "You are being moved now");
		quest::movepc(152,0,0,-31);
	}
}
I had an extra E, the zonesn should be freportn not freeportn, there should be no issues with using the smart matching (i.e. ~~)

Yeah, Perl will throw a fit if you are doing a Perl -c script.pl on it, but, its syntax is fine.

I'm under the assumption you're putting this code in your /quests/global/global_player.pl so ensure to target your test toon, issue a #reloadquest and then zone somewhere other than the test zones (which will be every zone not listed in the @noncombatzones array).

That said, I would just use the plugin method, if you have the DBI ppm installed.
Reply With Quote