mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 03:08:26 +00:00
[Feature] Add Experience Gain Toggle. (#2676)
* [Feature] Add Experience Gain Toggle. # Perl - Add `$client->IsEXPEnabled()`. - Add `$client->SetEXPEnabled(is_exp_enabled)`. # Lua - Add `client:IsEXPEnabled()`. - Add `client:SetEXPEnabled(is_exp_enabled)`. # Commands - Add `#exptoggle [Toggle] - Toggle your or your target's experience gain.`. # Notes - Allows operators to turn on/off a player's experience gain individually without changing their rule values. - The command allows operators to give players access to the command to disable their own experience gain.
This commit is contained in:
+4
-1
@@ -496,7 +496,7 @@ void Client::CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp,
|
||||
}
|
||||
|
||||
add_exp = GetEXP() + add_exp;
|
||||
|
||||
|
||||
//Enforce Percent XP Cap per kill, if rule is enabled
|
||||
int kill_percent_xp_cap = RuleI(Character, ExperiencePercentCapPerKill);
|
||||
if (kill_percent_xp_cap >= 0) {
|
||||
@@ -509,6 +509,9 @@ void Client::CalculateExp(uint32 in_add_exp, uint32 &add_exp, uint32 &add_aaxp,
|
||||
}
|
||||
|
||||
void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
|
||||
if (!IsEXPEnabled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
EVENT_ITEM_ScriptStopReturn();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user