View Single Post
  #9  
Old 08-28-2018, 05:29 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,589
Default

Try this, currently $client->TakeMoneyFromPP() only checks if they have at least 1 Platinum, the value is number of Platinum times 1000 to convert it to Copper.
Just change the price to your discretion and this should work.
Untested, compiles fine using 'perl -c':

Code:
sub EVENT_SAY {
	my @zone_array = plugin::NonCustomZoneArray();
	my $count = 0;
	if ($text=~/hail/i) {
		plugin::Whisper("If there is a zone you would like to go to, just tell me the short name of it and I will see if I have a spell to send you there. I may " . quest::saylink("list", 1) . " them if you like. It will cost 1 Platinum to teleport.");
	} elsif($text=~/list/i) {
		plugin::Whisper("I may list them alphabetically, just say a letter from 'A' to 'Z'.");
	} elsif($text=~/[a-zA-Z]/ && length($text) == 1) {
		foreach $zone (@zone_array) {
			if(substr($zone, 0, 1)=~/$text/i) {
				$count++;
				plugin::Message("$count: " . quest::saylink($zone, 1, plugin::Zone("SN", "LN", $zone)));
			}
		}
		plugin::Message("There are $count zones that begin with $text!");
	} elsif($text!~/[a-zA-Z]/) {
		plugin::Whisper("You must search with alphabetic characters, try again.");
	} elsif($text!~/hail/i && $text!~/list/i && length($text) != 1) {
		foreach $zone (@zone_array) {
			if ($client->TakeMoneyFromPP(1000, 1)) {
				if($text eq $zone) {
					quest::zone($text);
				}
			} else {
				plugin::Whisper("You do not have enough Platinum to teleport.");
			}
		}
	}
}
Reply With Quote