View Single Post
  #8  
Old 01-20-2013, 10:02 AM
NatedogEZ's Avatar
NatedogEZ
Developer
 
Join Date: Dec 2012
Posts: 515
Default

Here is a quick example of a quest to buy items with AA

Code:
sub EVENT_SAY
{

my $total = $client->GetAAPoints();
my $itemone = quest::saylink("Sword of Bad Guy Slaying",1);

  if($text=~/Hail/i)
    {
      plugin::Whisper("Hi there $name do you want to browse my items?");
	  $client->Message(15, "Buy $itemone for 5 AA points");
	  }
  if($text=~/Sword of Bad Guy Slaying/i)
      {
	  if($total >= 5)
		{
			$total = int($total-5);
			$client->SetAAPoints($total);
			plugin::Whisper("You made a wise choice.");
			quest::summonitem(6714,1);
			$client->Message(15, "You now have $total AA points to spend.");
		}
		else 
		{
		plugin::Whisper("You need more AA points for that item.");
		}
      }

}
Reply With Quote