[Feature] Add LuaMod functions for CommonDamage and HealDamage (#4227)

* Add LuaMod functions for CommonDamage and HealDamage

* Remove extra bracket
This commit is contained in:
Xackery
2024-03-31 08:30:16 -07:00
committed by GitHub
parent 9e3bf91374
commit b638795f9b
5 changed files with 163 additions and 0 deletions
+19
View File
@@ -1579,6 +1579,25 @@ uint64 LuaParser::GetExperienceForKill(Client *self, Mob *against, bool &ignoreD
return retval;
}
int64 LuaParser::CommonDamage(Mob *self, Mob* attacker, int64 value, uint16 spell_id, int skill_used, bool avoidable, int8 buff_slot, bool buff_tic, int special, bool &ignore_default)
{
int64 retval = 0;
for (auto &mod : mods_) {
mod.CommonDamage(self, attacker, value, spell_id, skill_used, avoidable, buff_slot, buff_tic, special, retval, ignore_default);
}
return retval;
}
uint64 LuaParser::HealDamage(Mob *self, Mob* caster, uint64 value, uint16 spell_id, bool &ignore_default)
{
uint64 retval = 0;
for (auto &mod : mods_) {
mod.HealDamage(self, caster, value, spell_id, retval, ignore_default);
}
return retval;
}
int64 LuaParser::CalcSpellEffectValue_formula(Mob *self, uint32 formula, int64 base_value, int64 max_value, int caster_level, uint16 spell_id, int ticsremaining, bool &ignoreDefault)
{
int64 retval = 0;