[Quest API] Add IsAttackAllowed() to Perl/Lua. (#2672)

# Perl
- Add `$mob->IsAttackAllowed(target)`.
- Add `$mob->IsAttackAllowed(target, is_spell_attack)`.

# Lua
- Add `mob:IsAttackAllowed(target)`.

# Notes
- Lua had `mob:IsAttackAllowed(target, is_spell_attack)` but not the other overload.
- Perl had neither.
This commit is contained in:
Alex King
2022-12-25 16:17:46 -05:00
committed by GitHub
parent 860b545fe3
commit d1430f6834
3 changed files with 26 additions and 7 deletions
+2 -1
View File
@@ -456,7 +456,6 @@ public:
Lua_StatBonuses GetAABonuses();
int16 GetMeleeDamageMod_SE(uint16 skill);
int16 GetMeleeMinDamageMod_SE(uint16 skill);
bool IsAttackAllowed(Lua_Mob target, bool isSpellAttack);
bool IsCasting();
int AttackAnimation(int Hand, Lua_ItemInst weapon);
int GetWeaponDamage(Lua_Mob against, Lua_ItemInst weapon);
@@ -520,6 +519,8 @@ public:
void DamageHateListNPCsPercentage(int64 damage);
void DamageHateListNPCsPercentage(int64 damage, uint32 distance);
void CopyHateList(Lua_Mob to);
bool IsAttackAllowed(Lua_Mob target);
bool IsAttackAllowed(Lua_Mob target, bool is_spell_attack);
};
#endif