[Quest API] Add Restore Methods for Health, Mana, and Endurance to Perl/Lua (#4179)

* [Quest API] Add Restore Methods for Health, Mana, and Endurance to Perl/Lua

- Add `$mob->RestoreEndurance()`.
- Add `$mob->RestoreHealth()`.
- Add `$mob->RestoreMana()`.

- Add `mob:RestoreEndurance()`.
- Add `mob:RestoreHealth()`.
- Add `mob:RestoreMana()`.

- Allows operators to easily restore a mob to full health, mana, or endurance.
- `RestoreHealth` is just a more verbosely named `Heal`.
- Convert spots in source to use these short hands instead of directly using `SetEndurance(GetMaxEndurance())`, `SetHP(GetMaxHP())`, or `SetMana(GetMaxMana())`.

* Update mob.h

* Update mob.h
This commit is contained in:
Alex King authored and GitHub committed 2024-03-22 23:53:35 -05:00
1 parent 5bfd8f5da2
commit 66cc947b2a
12 files changed
+72 -44

No files matched your search

+6 -6
View File
@@ -73,9 +73,9 @@ Merc::Merc(const NPCType* d, float x, float y, float z, float heading)
// Class should use npc constructor to set light properties
SetHP(GetMaxHP());
SetMana(GetMaxMana());
SetEndurance(GetMaxEndurance());
RestoreHealth();
RestoreMana();
RestoreEndurance();
AI_Start();
}
@@ -5289,9 +5289,9 @@ bool Merc::Unsuspend(bool setMaxStats) {
{
if(setMaxStats)
{
SetHP(GetMaxHP());
SetMana(GetMaxMana());
SetEndurance(GetMaxEndurance());
RestoreHealth();
RestoreMana();
RestoreEndurance();
}
//check for sufficient funds and remove them last