EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Support::Windows Servers (https://www.eqemulator.org/forums/forumdisplay.php?f=587)
-   -   Purchasing AA points (https://www.eqemulator.org/forums/showthread.php?t=38497)

LogansRun 07-16-2014 11:45 PM

Purchasing AA points
 
I want to allow players on my server to talk to an NPC and buy AA points from them. This will be a simple exchange of plat for experience. However, I want to put some sort of scale factor on the cost. Right now my idea is to increase the cost based on how many AAs the player has.

Could someone suggest how one might write a script to do this?

Coenxai 07-30-2014 11:25 PM

Code:

sub EVENT_SAY {

        my $AA = $client->GetAAPoints();
        my $cost = $AA * 10;

        if($text=~/hail/i) {
                quest::say("It will cost you $cost platinum for a chunk of experience.");
        }
}

sub EVENT_ITEM {

        my $AA = $client->GetAAPoints();
        my $cost = $AA * 10;
       
        if($platinum == $cost) {
                quest::exp(10000000);
        }
        else {
                $client->AddMoneyToPP(0, 0, 0, $platinum, updateclient);
                quest::say("That's not what I asked for!");
        }
}

Not sure if you still need a script, it's been a while. Here's a quick and sloppy one to give you an idea of a way you could do it.


All times are GMT -4. The time now is 12:00 PM.

Powered by vBulletin®, Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.