PDA

View Full Version : Help with script to purchase AA points from vendor.


tnsquid
12-10-2022, 09:44 PM
I am looking to see if anyone has a script that will allow me to buy AA points from an NPC using tokens that I have already created. I have played on servers that have this and I want to set it up on my own server. I am new to scripting so any help that I can get I would be grateful.

Akkadius
12-12-2022, 02:48 AM
You may find the best help is available on Discord these days

Join us @ https://discord.gg/785p886eCw

#support-quest-scripts channel

ragetli
12-06-2024, 03:15 AM
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.

ragetli
12-06-2024, 03:16 AM
oh lol, just realized this post is 2 years old :-)