Hi everyone, good afternoon,
I am working on a pokémon server and I found a problem in which, it prevents the pokémons from giving "damage", Yes no no pokémon gives or receives damage and this has made me very sad, since it is a server in which I love to move, but I ended up finding this obstacle =/
This is the:
This is line:
This is funcion:
I am working on a pokémon server and I found a problem in which, it prevents the pokémons from giving "damage", Yes no no pokémon gives or receives damage and this has made me very sad, since it is a server in which I love to move, but I ended up finding this obstacle =/
This is the:
Lua:
[08/10/2018 14:19:47] [Error - CreatureScript Interface]
[08/10/2018 14:19:47] data/creaturescripts/scripts/system/stats.lua: onStatsChange
[08/10/2018 14:19:47] Description:
[08/10/2018 14:19:47] data/creaturescripts/scripts/system/stats.lua:116: attempt to perform arithmetic on a boolean value
[08/10/2018 14:19:47] stack traceback:
[08/10/2018 14:19:47] data/creaturescripts/scripts/system/stats.lua:116: in function <data/creaturescripts/scripts/system/stats.lua:1>
Lua:
line 116: local modifier = getMultiplier(COMBAT_NAMES[combat], cid)
local def = 1 - (getPokemonDefense(getCreatureName(cid))/255)
hit = math.ceil((value * def) * modifier)
if getPokemonStatus(cid, "harden") then
hit = math.ceil(hit * 0.75)
end
This is funcion:
Lua:
function getMultiplier(typeatk, pokemon)
if not isCreature(pokemon) then return true end
if not typeatk then return true end
local pokename = getPokeName(pokemon)
local type1atked = getPokemonType1(pokename)
local type2atked = getPokemonType2(pokename)
local multiplier = 1
if not typeTable[typeatk] then print("Erro! O tipo: " .. typeatk .. ", não foi encontrada na tabela typeTable.") return multiplier end
if typeTable[typeatk].super then
for a = 1, #typeTable[typeatk].super do
if string.find(typeTable[typeatk].super[a], type1atked) or (type2atked and string.find(typeTable[typeatk].super[a], type2atked)) then
multiplier = 2
end
end
end
if typeTable[typeatk].weak then
for b = 1, #typeTable[typeatk].weak do
if string.find(typeTable[typeatk].weak[B], type1atked) or (type2atked and string.find(typeTable[typeatk].weak[B], type2atked)) then
multiplier = 0.5
end
end
end
if typeTable[typeatk].non then
for c = 1, #typeTable[typeatk].non do
if string.find(typeTable[typeatk].non[c], type1atked) or (type2atked and string.find(typeTable[typeatk].non[c], type2atked)) then
multiplier = 0
end
end
end
return multiplier
end
Last edited: