1
0

have NPC's return their own level so they just use the base dmg

This commit is contained in:
Emagi 2025-01-09 13:50:07 -05:00
parent b1b9ab8ed9
commit ec2b564132

View File

@ -14475,12 +14475,17 @@ int EQ2Emu_lua_GetSpellRequiredLevel(lua_State* state) {
lua_interface->LogError("%s: LUA GetSpellRequiredLevel command error: you must use this function in a spellscript!", lua_interface->GetScriptName(state)); lua_interface->LogError("%s: LUA GetSpellRequiredLevel command error: you must use this function in a spellscript!", lua_interface->GetScriptName(state));
return 0; return 0;
} }
if(!spawn || !spawn->IsPlayer()) { if(!spawn) {
lua_interface->LogError("%s: LUA GetSpellRequiredLevel command error: spawn is not provided as first argument or is invalid (not player or null)!", lua_interface->GetScriptName(state)); lua_interface->LogError("%s: LUA GetSpellRequiredLevel command error: spawn is not provided as first argument or is invalid (not player or null)!", lua_interface->GetScriptName(state));
return 0; return 0;
} }
lua_interface->SetInt32Value(state, spell->spell->GetLevelRequired((Player*)spawn)); if(!spawn->IsPlayer()) {
lua_interface->SetInt32Value(state, spawn->GetLevel());
}
else {
lua_interface->SetInt32Value(state, spell->spell->GetLevelRequired((Player*)spawn));
}
return 1; return 1;
} }