mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-31 04:56:20 +00:00
[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:
+4
-1
@@ -546,7 +546,6 @@ public:
|
||||
bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false, eSpecialAttacks special = eSpecialAttacks::None) = 0;
|
||||
void SetHP(int64 hp);
|
||||
inline void SetOOCRegen(int64 new_ooc_regen) { ooc_regen = new_ooc_regen; }
|
||||
virtual void Heal();
|
||||
virtual void HealDamage(uint64 ammount, Mob* caster = nullptr, uint16 spell_id = SPELL_UNKNOWN);
|
||||
virtual void SetMaxHP() { current_hp = max_hp; }
|
||||
virtual inline uint16 GetBaseRace() const { return base_race; }
|
||||
@@ -1336,6 +1335,10 @@ public:
|
||||
inline virtual bool IsBlockedBuff(int32 SpellID) { return false; }
|
||||
inline virtual bool IsBlockedPetBuff(int32 SpellID) { return false; }
|
||||
|
||||
inline void RestoreEndurance() { SetEndurance(GetMaxEndurance()); }
|
||||
inline void RestoreHealth() { SetMaxHP(); SendHPUpdate(); }
|
||||
inline void RestoreMana() { SetMana(GetMaxMana()); }
|
||||
|
||||
std::string GetGlobal(const char *varname);
|
||||
void SetGlobal(const char *varname, const char *newvalue, int options, const char *duration, Mob *other = nullptr);
|
||||
void TarGlobal(const char *varname, const char *value, const char *duration, int npcid, int charid, int zoneid);
|
||||
|
||||
Reference in New Issue
Block a user