From ec2b564132b2cc88f98f9ae878d75fbf6e1074cb Mon Sep 17 00:00:00 2001 From: Emagi Date: Thu, 9 Jan 2025 13:50:07 -0500 Subject: [PATCH] have NPC's return their own level so they just use the base dmg --- source/WorldServer/LuaFunctions.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/WorldServer/LuaFunctions.cpp b/source/WorldServer/LuaFunctions.cpp index c72969a..91911ed 100644 --- a/source/WorldServer/LuaFunctions.cpp +++ b/source/WorldServer/LuaFunctions.cpp @@ -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)); 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)); 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; } \ No newline at end of file