EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Development::Development (https://www.eqemulator.org/forums/forumdisplay.php?f=590)
-   -   Quest AA functions (https://www.eqemulator.org/forums/showthread.php?t=28394)

realityincarnate 05-31-2009 12:05 PM

Quest AA functions
 
Inspired by a tangent in another thread, I added two quest functions to the $client object for giving AAs via perl. They are:

$client->GetAAPoints() - returns the number of AA the character currently has
$client->SetAAPoints(value) - sets the character's AA count to 'value' and sends an update to the client

Randymarsh9 05-31-2009 03:11 PM

so it would be $client->setaapoints(AA+5) if you wanted to add 5 AAs? or would it just be (5)?

Shendare 05-31-2009 03:12 PM

If it's a regular get/set, you'd probably have to do:

Code:

$client->SetAAPoints($client->GetAAPoints() + 5);
- Shendare

ChaosSlayerZ 05-31-2009 03:58 PM

if you about to implement this as quest comand consider what else could be usefull while at it so you don't have to return to it later and recode from the scratch =)

1) give AAs
2) refund AAs
3) remove all AAs

realityincarnate 05-31-2009 04:18 PM

The get and set commands are already in (as of revision 604), and Shendare's code is exactly correct, but I can certainly add a command to just increase the AA points by a certain number.

There was already an object to reset AA's ($client->ResetAA(), removes all abilities and points), and I was unsure about putting in a refund command. The #refundAA gm command kicks the client when it's done, and the code has a note about the kick being necessary, so I was hesitant to put that functionality in a quest function. But again, if it's necessary I'll add it as well.

ChaosSlayerZ 05-31-2009 04:33 PM

Quote:

Originally Posted by realityincarnate (Post 170952)
The get and set commands are already in (as of revision 604), and Shendare's code is exactly correct, but I can certainly add a command to just increase the AA points by a certain number.

There was already an object to reset AA's ($client->ResetAA(), removes all abilities and points), and I was unsure about putting in a refund command. The #refundAA gm command kicks the client when it's done, and the code has a note about the kick being necessary, so I was hesitant to put that functionality in a quest function. But again, if it's necessary I'll add it as well.

yes that giving X number of AAs to a player is imperative. tehcnicly its no diffirent from "set aa". But to do set you must analyze what AAs player allready has, what are unspent so you don't run into situation when player has 10 spent AAs and 0 Saved AAs and you set his AA to like 5 - then game needs to soem how figure out that ist not supose to substract from aas allready spent but rather add to the unspent - so GIVE AAs esentily same thing.

As far as kick to reset- yes its a nessesary function - we allready have simular function like to chnage race, class and deity - the char HAS to be reset otherwise it won't work - so there is no evil about it =)
+ reset coudl be a valuable option to Admin when AA coding gets changed and player's AA get screwed up then reseting him and giving him a new pool of AAs becomes a valid option

And btw - ability to retrive total curent number of AAs player has spent and unspent separatly- for whatever reason quest may needed it.

So I am just trying to make sure that we have ALL posible function coded it at once :cool:

realityincarnate 05-31-2009 06:17 PM

Ok, ask and you shall receive. Three more new functions:

$client->AddAAPoints(number) - adds 'number' to the character's unspent AA points
$client->GetSpentAA() - returns the number of AA the client has spent
$client->RefundAA() - wipes all purchased AA abilities, refunds the spent points, and boots the client to ensure a relog.

ChaosSlayerZ 05-31-2009 06:33 PM

Magnificent :cool:
this will open up a whole new level for special quest rewards and an alternative handling of AAs, such as allowing players to reset their AA (perhaps for a price) - a thing which has always been missing

This was on my list of most needed features for Emu for a long time =)
Thank you! =)

cubber 07-20-2009 03:51 PM

This system is great! I am using it in one of my quests. One thing that would make it even better is the ability to give Group Leadership AA and Raid Leadership AA's as well. Instead of just regular AA's. I know this can be done with GM commands.

Maybe use:
Code:

$client->AddAAGroupPoints(number)
$client->GetSpentAAGroup()
$client->RefundAAGroup()

and:
Code:

$client->AddAARaidPoints(number)
$client->GetSpentAARaid()
$client->RefundAARaid()



All times are GMT -4. The time now is 11:18 PM.

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