View Single Post
  #2  
Old 03-13-2015, 03:48 PM
Kingly_Krab
Administrator
 
Join Date: May 2013
Location: United States
Posts: 1,603
Default

It's much easier to do it without GetCarriedMoney due to Perl not being able to use int64, as well as the fact this will only work if you have enough money to take directly, in one conditional.
Code:
sub EVENT_SAY { 
    my $Buff = quest::saylink("Buff");
    if ($text =~ /hail/i) {
        quest::say ("For 1 platinum piece per level I can cast a strong health [$Buff] on you.");    
    } elsif ($text =~ /buff/i) {
        if ($client->TakeMoneyFromPP(($ulevel * 1000), 1)) {
            if ($ulevel <= 10) {                
                quest::selfcast(244);
            } elsif ($ulevel > 10 && $ulevel <= 20) {    
                quest::selfcast(312);
            } elsif ($ulevel > 20 && $ulevel <= 30) {
                quest::selfcast(314);
            } elsif ($ulevel > 30 && $ulevel <= 40) {
                quest::selfcast(3692);
            } elsif ($ulevel > 40 && $ulevel <= 50) {
                quest::selfcast(3692);
            } elsif ($ulevel > 50) {
                quest::selfcast(1447);
            }
            $client->Message(2, "Here you go.  Thanks for the donation!");
            $client->Message(5, "$ulevel platinum has been removed from your inventory.");
        }
    }
}
Reply With Quote