View Full Version : Refund AA quest
GurkhaPanzers
09-07-2013, 07:27 AM
I am making an npc to change a characters class and race. I want to be able to refund a character AA. Is there a way to do this. I don't see it on the list of quest.
rencro
09-07-2013, 12:22 PM
Not sure if this still works, but found this:
https://eqemulator.org/forums/showthread.php?p=174841
GurkhaPanzers
09-07-2013, 01:55 PM
Thanks friend. That appears to be for leadership AA. I didn't specify but I mean regular AA. Basically I have some guilds based on alignments. So if an SK joins a Good guild I want him to have option to switch to new class and start over. It is enough of an impact to start over so I don't want them to also lose AA. So thought was refund the AA then when 50+ again they could spend as they decide. There is a GM ability to do this but I don't see a quest version. Thanks for your effort in replying friend.
Kingly_Krab
09-07-2013, 02:09 PM
You can't exactly do that I don't believe, you could try $client->RefundAA() and then $client->Kick(). I believe the Refund doesn't happen until you're kicked, thus the need to kick them.
rencro
09-07-2013, 03:02 PM
Its all in the thread I linked, might want to read from the beginning next time:
sub EVENT_SAY {
my $client = plugin::val('$client');
my $spent = $client->GetSpentAA();
if ($text=~/hail/i){
quest::say("Where is Mr. Head?? You have $spent AA spent");
$client->ResetAA();
$client->AddAAPoints($spent);
}
}
BTW, you dont need to kick the client, just zone them out. So you cold have a "fake" zone that just watches for clients, then immediately sends them back to where they came from, instead of kicking the client and forcing them to relog back in...
ps, you may want to make sure you dont have a limit on max unspent aa....
Kingly_Krab
09-07-2013, 03:25 PM
This is simplier and makes more sense, it's bad you didn't even read the thread you posted. I tested $client->RefundAA(), it doesn't do anything until you're booted, but it doesn't boot you, thus the $client->Kick()
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.
Also, there's no need to define $client in a sub EVENT_SAY, only in a plugin, nor is there a necessity to define any variables.
sub EVENT_SAY
{
if($text=~/Hail/i)
{
plugin::Whisper("Would you like to " . quest::saylink("reset", 1) . " your AA points?");
}
if($text=~/Reset/i)
{
plugin::Whisper("Off you go!");
$client->RefundAA();
$client->Kick();
}
}
rencro
09-07-2013, 03:49 PM
-1 reading comprehension..
Where in my code am I calling RefundAA?
If you would rather have a client get kicked, more power to you, seems silly to me when what I linked works if you just add a movepc to it as was suggested... not sure why you are being so hostile....
I will cease trying to assist in the future, "friends"
Kingly_Krab
09-07-2013, 03:55 PM
Booting the client is the same as zoning them out, although more efficient, less work for the coder. I know you didn't call it, thus why I did, mine is more efficient. I wasn't attempting to be hostile, my apologies.
rencro
09-07-2013, 05:04 PM
Booting the client is the same as zoning them out, although more efficient, less work for the coder.
Its not the same, unless you consider possible corruption of the client textures ect, as ok, forcing said user to shut eq all the way down. More efficient you say? I cant believe you truly think that. But you are right about it being less work for the coder!!!
Ps.. RefundAA != ResetAA
Kingly_Krab
09-07-2013, 05:08 PM
It kicks to character select, thus not doing that, although you wouldn't know, as you didn't test it.
P.S. I tested ResetAA, it breaks your character, haha. And yeah, I know they're not the same...
rencro
09-07-2013, 05:32 PM
Ok, you win...You are definitely more efficient....You must be proud, you are good at this.. I marvel at your post editing skills too...
I guess I'll go play with my "broken" character, and leave all this "smart" stuff to you...
lerxst2112
09-07-2013, 05:39 PM
This is why we can't have nice things.
Uleat
09-07-2013, 06:10 PM
Just ask this man (http://www.bing.com/videos/search?q=video+new+mustang+garage&FORM=VIRE7#view=detail&mid=C82BBA4808F1EFE931C2C82BBA4808F1EFE931C2)...
Kingly_Krab
09-07-2013, 06:13 PM
Just ask this man (http://www.bing.com/videos/search?q=video+new+mustang+garage&FORM=VIRE7#view=detail&mid=C82BBA4808F1EFE931C2C82BBA4808F1EFE931C2)...
That's great.
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.