mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
[Rule] Add ManaOnDeath and EndurOnDeath (#2661)
* [Rule] Add ManaOnDeath and EndurOnDeath This rule allows death to fully fill Mana or Endurance. * Updates rules to live-like * Adjust rule names to be more descriptive of their intent, remove else cases Co-authored-by: Akkadius <akkadius1@gmail.com>
This commit is contained in:
+14
-8
@@ -645,16 +645,22 @@ bool Client::Save(uint8 iCommitNow) {
|
||||
|
||||
m_pp.guildrank = guildrank;
|
||||
|
||||
/* Mana and HP */
|
||||
if (GetHP() <= 0) {
|
||||
if (dead && GetHP() <= 0) {
|
||||
m_pp.cur_hp = GetMaxHP();
|
||||
}
|
||||
else {
|
||||
m_pp.cur_hp = GetHP();
|
||||
}
|
||||
m_pp.mana = current_mana;
|
||||
if (RuleB(Character, FullManaOnDeath)) {
|
||||
m_pp.mana = GetMaxMana();
|
||||
}
|
||||
|
||||
m_pp.mana = current_mana;
|
||||
m_pp.endurance = current_endurance;
|
||||
m_pp.endurance = current_endurance;
|
||||
if (RuleB(Character, FullEndurOnDeath)) {
|
||||
m_pp.endurance = GetMaxEndurance();
|
||||
}
|
||||
} else { // Otherwise, no changes.
|
||||
m_pp.cur_hp = GetHP();
|
||||
m_pp.mana = current_mana;
|
||||
m_pp.endurance = current_endurance;
|
||||
}
|
||||
|
||||
/* Save Character Currency */
|
||||
database.SaveCharacterCurrency(CharacterID(), &m_pp);
|
||||
|
||||
Reference in New Issue
Block a user