[Lua] Add IsImmuneToSpell Lua Mod (#4278)

* Add IsImmuneToSpell lua mod

* Add lua_parser.h include in spells.cpp
This commit is contained in:
Xackery
2024-04-28 05:20:34 -07:00
committed by GitHub
parent e268ab18f5
commit 39bb7e1723
5 changed files with 76 additions and 0 deletions
+11
View File
@@ -84,6 +84,7 @@ Copyright (C) 2001-2002 EQEMu Development Team (http://eqemu.org)
#include "string_ids.h"
#include "worldserver.h"
#include "fastmath.h"
#include "lua_parser.h"
#include <assert.h>
#include <algorithm>
@@ -4958,6 +4959,16 @@ bool Mob::IsImmuneToSpell(uint16 spell_id, Mob *caster)
LogSpells("Checking to see if we are immune to spell [{}] cast by [{}]", spell_id, caster->GetName());
#ifdef LUA_EQEMU
bool is_immune = false;
bool ignore_default = false;
is_immune = LuaParser::Instance()->IsImmuneToSpell(this, caster, spell_id, ignore_default);
if (ignore_default) {
return is_immune;
}
#endif
if(!IsValidSpell(spell_id))
return true;