This spellpack is entirely based on Tibia-stats Spell Damage Calculator.
This spellpack also includes "potions.lua" revised with Tibia's exact healing values.
To make this spellpack work seeminglessly (that is, for the spell "ethereal spear" to work as expected) you must make a minor change to source file "luascript.cpp" (so that every skill increase is applied to the base distance skill), otherwise it will deal the same damage with or without spells (such as the Sharpshooter)/items that increases distance skill.
Check this thread: https://otland.net/threads/ethernal...level-cid-skill_distance.240668/#post-2327673
You'll have to make a change in a function called "luaGetPlayerSkillLevel" in "luascript.cpp".
Download Link (mediafire): https://www.mediafire.com/?n78mkd4ca768i7c
This spellpack also includes "potions.lua" revised with Tibia's exact healing values.
To make this spellpack work seeminglessly (that is, for the spell "ethereal spear" to work as expected) you must make a minor change to source file "luascript.cpp" (so that every skill increase is applied to the base distance skill), otherwise it will deal the same damage with or without spells (such as the Sharpshooter)/items that increases distance skill.
Check this thread: https://otland.net/threads/ethernal...level-cid-skill_distance.240668/#post-2327673
You'll have to make a change in a function called "luaGetPlayerSkillLevel" in "luascript.cpp".
In luascript.cpp you'll have to find (CTRL + F) this function (line 4154):
Then in line 4166 you'll find this:
Change to:
Code:
int32_t LuaInterface::luaGetPlayerSkillLevel(lua_State* L)
Then in line 4166 you'll find this:
Code:
if(skill <= SKILL_LAST)
Change to:
Code:
if(player && skill <= SKILL_LAST)
Just replace this whole code:
With this one:
Code:
int32_t LuaInterface::luaGetPlayerSkillLevel(lua_State* L)
{
//getPlayerSkillLevel(cid, skillid)
uint32_t skillId = popNumber(L);
ScriptEnviroment* env = getEnv();
if(const Player* player = env->getPlayerByUID(popNumber(L)))
{
if(skillId <= SKILL_LAST)
lua_pushnumber(L, player->skills[skillId][SKILL_LEVEL]);
else
lua_pushboolean(L, false);
}
else
{
errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}
With this one:
Code:
int32_t LuaInterface::luaGetPlayerSkillLevel(lua_State* L)
{
//getPlayerSkillLevel(cid, skill[, ignoreModifiers = false])
bool ignoreModifiers = false;
if(lua_gettop(L) > 2)
ignoreModifiers = popNumber(L);
uint32_t skill = popNumber(L);
ScriptEnviroment* env = getEnv();
if(const Player* player = env->getPlayerByUID(popNumber(L)))
{
if(player && skill <= SKILL_LAST)
lua_pushnumber(L, ignoreModifiers ? player->skills[skill][SKILL_LEVEL] :
player->skills[skill][SKILL_LEVEL] + player->getVarSkill((skills_t)skill));
else
lua_pushboolean(L, false);
}
else
{
errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
lua_pushboolean(L, false);
}
return 1;
}
Download Link (mediafire): https://www.mediafire.com/?n78mkd4ca768i7c
Last edited: