EQEmulator Forums

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

GurkhaPanzers 09-07-2013 07:27 AM

Refund AA quest
 
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:

Code:

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()
Quote:

Originally Posted by realityincarnate (Post 170970)
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.
Code:

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

Quote:

Originally Posted by Kingly_Krab (Post 224099)
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...

Kingly_Krab 09-07-2013 06:13 PM

Quote:

Originally Posted by Uleat (Post 224105)
Just ask this man...

That's great.


All times are GMT -4. The time now is 01:45 AM.

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