• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Spell [8.60][TFS 0.4] Tibia-stats spells pack

Dnomyar

Active Member
Joined
May 20, 2009
Messages
57
Solutions
2
Reaction score
27
Location
Brazil
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".

In luascript.cpp you'll have to find (CTRL + F) this function (line 4154):
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:
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:
for rev 3777 i've found
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)

so i changed if(skillId <= SKILL_LAST)
to
if(player && skillId <= SKILL_LAST)

compiled no errors, but didnt work, exori con damage in game is the same with or without utito tempo san !
 
Last edited:
Back
Top