A simple approach is using an item, which when handed in, grants AA as a reward.
sub EVENT_ITEM {
if (plugin::check_handin(\%itemcount, 148666 => 1)) # Grimoire of Profound Experience
{
$AA_points = 6;
$client->Message(315, "A most profound book!");
$client->AddAAPoints($AA_points);
$client->Message(15, "You have received $AA_points AA.");
}
#:: Return unused items
plugin::returnUnusedItems();
}
If you want to use custom currency in an NPC dialog, you can use GetAlternateCurrencyValue to check the amount the player has and SetAlternateCurrencyValue to set the new value after the purchase.
|