EQEmulator Forums

EQEmulator Forums (https://www.eqemulator.org/forums/index.php)
-   Quests::Q&A (https://www.eqemulator.org/forums/forumdisplay.php?f=599)
-   -   Giving AA Exp instead of Regular Exp if AA is turned on? (https://www.eqemulator.org/forums/showthread.php?t=40440)

Mortow 03-05-2016 01:17 AM

Giving AA Exp instead of Regular Exp if AA is turned on?
 
This is a tradeskill exp perl script that was shared from Sanctuary (I believe)


Code:

$client->SetEXP($client->GetEXP() + $client->CalcEXP(18), 0);
What I would like to figure out is, how do you award AA experience instead of regular experience if a player has AA experience turned on. As it is now, a player can have 100% experience going to AAs and it still gives regular experience. I am not sure how to give it a qualifier to check for AA experience being turned on. Any help would be appreciated.

Thanks,
Mortow

Shin Noir 03-10-2016 03:49 AM

Did anyone address this?
There's a method Client::SetEXP(THIS, set_exp, set_aaxp, resexp=false)
inside zone/perl_client.cpp, meaning if you tweak your code to
Code:

$client->SetEXP(0, $client->GetAAEXP() + 12345);
It will give AA exp.

The problem is that SetEXP is likely not what you're after, since you want it to be given based on the percent of AA exp the player is set on their AA window, and distribute a pool of EXP to normal/AA accordingly, right?

To do that you likely want to tap into Client::AddEXP(THIS, add_exp, conlevel= 0xFF, resexp= false)
Code:

$client->AddExp(1234); //give raw 1234 exp.
$client->AddExp(1234, 2); //Give EXP based on con level system, which tldr is green = 2, lightblue = 18, blue = 4, white = 20, yellow = 15, red = 13

This call will respect the AA exp value percentage (since it calls Client::AddExp and it will determine EXP distribution based on extended player profile property perAA), the same way normal EXP is rewarded from kills.

If you use the conlevel system, you'll want to peek at the rule values Character::<CON>Modifier, replacing <CON> with the color e.g. Red, inside your rule_values for your EXP mods for difficulty of kills. These default to it seems:

Lightblue = 40
Blue = 90
White = 100
yellow = 125
red = 150

If you wanted to give EXP scaled based on the player's level, you can use your
Code:

$client->CalcExp(18)
system to get the pool size and change 1234 to a more dynamic level-based value.

Mortow 03-10-2016 10:12 PM

Thank you very much, Shin. You are correct in that I want to award experience based off level. And thank you for explaining the "(18)". I was wondering what that referenced. I think I want the experience awarded to be a very small amount such as green exp. I applaud Zerjz for implementing this on his server. I always thought tradeskills should give at least a little experience.


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

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