mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-11 20:08:37 +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:
+20
-1
@@ -738,7 +738,7 @@ bool Client::Save(uint8 iCommitNow) {
|
||||
}
|
||||
}
|
||||
|
||||
database.SaveCharacterData(CharacterID(), AccountID(), &m_pp, &m_epp); /* Save Character Data */
|
||||
database.SaveCharacterData(this, &m_pp, &m_epp); /* Save Character Data */
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -9136,6 +9136,25 @@ void Client::SetDevToolsEnabled(bool in_dev_tools_enabled)
|
||||
Client::dev_tools_enabled = in_dev_tools_enabled;
|
||||
}
|
||||
|
||||
bool Client::IsEXPEnabled() const {
|
||||
return m_exp_enabled;
|
||||
}
|
||||
|
||||
void Client::SetEXPEnabled(bool is_exp_enabled)
|
||||
{
|
||||
auto c = CharacterDataRepository::FindOne(database, CharacterID());
|
||||
|
||||
c.exp_enabled = is_exp_enabled;
|
||||
|
||||
auto updated = CharacterDataRepository::UpdateOne(database, c);
|
||||
|
||||
if (!updated) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_exp_enabled = is_exp_enabled;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param model_id
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user