Postado Junho 12, 2022 2 anos Solução Pessoal, boa noite. Instalei um Exp hit no meu servidor, porém ao atacar o treiner ele mostra esse erro na distro. Acredito que o exp hit não reconheça o monstro chamado Treiner Tibia, e por esse motivo retorna esse erro. Alguém conseguiria me ajudar com alguma função para que esse erro não surgisse na distro ao atacar o treiner ou qualquer outro tipo de monstro que tenha um nome diferente dos comuns? Agradeço. Qual servidor ou website você utiliza como base? TFS 0.4 Qual o motivo deste tópico? DUVIDA COM SCRIPT Está surgindo algum erro? Se sim coloque-o aqui. Citar [20:46:32.016] [Error - CreatureScript Interface] [20:46:32.017] data/creaturescripts/scripts/exphit.lua:onStatsChange [20:46:32.018] Description: [20:46:32.018] (luaGetMonsterInfo) Monster not found [20:46:32.019] [Error - CreatureScript Interface] [20:46:32.019] data/creaturescripts/scripts/exphit.lua:onStatsChange [20:46:32.019] Description: [20:46:32.020] data/creaturescripts/scripts/exphit.lua:56: attempt to index a boolean value [20:46:32.020] stack traceback: [20:46:32.020] data/creaturescripts/scripts/exphit.lua:56: in function <data/creaturescripts/scripts/exphit.lua:53> Você tem o código disponível? Se tiver publique-o aqui: -- CONFIGURAÇÕES DE EXPERIENCIA -- useStages = true -- Usar sistema de Stages , true/false premiumMultipliqueExp = 1 -- Players Premiums terão exp multiplicada, caso não querer deixe 1. rateExp = 50 -- Exp caso não for usar stages. local stages = { -- ["DELEVEL-ATELEVEL"] = EXP, (OBS: NUNCA REPETIR O MSM NUMERO, SEMPRE COLOCAR UM A MAIS.) ["1-50"] = 150, ["51-80"] = 100, ["81-100"] = 80, ["101-150"] = 70, ["151-180"] = 60, ["181-200"] = 50, ["201-230"] = 45, ["231-250"] = 40, ["251-280"] = 35, ["281-300"] = 30, ["301-320"] = 25, ["321-350"] = 20, ["351-400"] = 15, } ultimateExp = 10 -- exp que vai usar caso o level do player não tiver mais na tabela . -- CONFIGURAÇÕES DA PARTY partyPorcent = 40 -- Quantos Porcento da exp vai para os membros da party levelBlockParty = 1000 -- Diferença Maxima de Level permitida para membro da party ganhar exp. expShareRadiusX = 30 -- Distancia maxima permitida no eixo X para membro da party ganhar exp. expShareRadiusY = 30 -- Distancia maxima permitida no eixo Y para membro da party ganhar exp. expShareRadiusZ = 1 -- Distancia maxima permitida no eixo Z para membro da party ganhar exp. -- CONFIGURAÇÕES DE RINGS -- local rings = { -- [ID DO ANEL] = EXP MULTIPLICADA POR X EXP. [3048] = 2, [3049] = 4, [3050] = 6, } -- FIM DAS CONFIGURAÇÕES -- function CalculeExp(monsterhp, exptotal, hit) hit = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 return hit < 0 and 0 or hit end function isSummon(cid) return getCreatureMaster(cid) end function onStatsChange(cid, attacker, type, combat, value) if isPlayer(attacker) and isMonster(cid) then if getCreatureStorage(cid, 50001) ~= 1 then doCreatureSetStorage(cid, 50002, getMonsterInfo(getCreatureName(cid)).experience * rateExp) doCreatureSetStorage(cid, 50001, 1) end end if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isCreature(attacker) then local _cid = isSummon(attacker) and getCreatureMaster(attacker) or attacker if isPlayer(_cid) then if useStages then for strstage, experience in pairs(stages) do tabstage = string.explode(strstage, "-") if getPlayerLevel(_cid) >= tonumber(tabstage[1]) and getPlayerLevel(_cid) <= tonumber(tabstage[2]) then ultimateExp = experience end end experienceRate = ultimateExp else experienceRate = rateExp end local expgain = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * experienceRate, value) if getCreatureStorage(cid, 50002) > 0 then if getCreatureStorage(cid, 50002) - expgain < 0 then expgain = getCreatureStorage(cid, 50002) end doCreatureSetStorage(cid, 50002, getCreatureStorage(cid, 50002) - expgain) local ringexp = 1 for idring, expring in pairs(rings) do if getPlayerSlotItem(_cid, 9).itemid == idring then ringexp = expring break end end local premiumMultipliqueExp = isPremium(_cid) and premiumMultipliqueExp or 1 expgain = expgain * ringexp * premiumMultipliqueExp local party = false if isInParty(_cid) then local partyMembers, expParty = getPartyMembers(getPartyLeader(_cid)), expgain / 100 * partyPorcent for indice, partyMember in pairs(partyMembers) do attackerLevel, partyLevel = getPlayerLevel(_cid), getPlayerLevel(partyMember) attackerPos, partyPos = getThingPos(_cid), getThingPos(partyMember) x = false if math.abs(attackerLevel - partyLevel) > levelBlockParty then x = true elseif math.abs(attackerPos.x - partyPos.x) > expShareRadiusX then x = true elseif math.abs(attackerPos.y - partyPos.y) > expShareRadiusY then x = true elseif attackerPos.z ~= partyPos.z then x = true elseif _cid == partyMember then x = true end if x then partyMembers[indice] = nil end end if #partyMembers ~= 0 then expParty = math.ceil(expgain / 100 * partyPorcent) expmember = math.ceil(expParty / #partyMembers) for _, member in pairs(partyMembers) do if member ~= _cid then doPlayerSendTextMessage(member, 12, "You received "..expmember.." party exp.") doSendAnimatedText(getCreaturePosition(member), expmember, 215) doPlayerAddExp(member, expmember) end end doPlayerSendTextMessage(_cid, 12, "You gain "..expgain.." exp. (" ..partyPorcent.."% send to party)") doSendAnimatedText(_cid, expgain - expParty, 215) doPlayerAddExp(_cid, expgain - expParty) party = true else party = false end end if not party then doPlayerAddExp(_cid, expgain) doSendAnimatedText(getThingPos(_cid), expgain, 215) end end end end end end return true end function onCombat(cid, target) if isMonster(target) and not isSummon(target) and not isPlayer(target) then registerCreatureEvent(target, "ExpGain") end return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui. RESOLVIDO Vou deixar a solução abaixo caso alguém futuramente tenha o mesmo problema. Eu havia feito uma atualização no meu training monk, dessa forma, acusava o erro "(luaGetMonsterInfo) Monster not found". Simplesmente o que eu fiz foi editar o meu training monk.xml e adicionar ele no monster.xml com o nome de training monk. Vou deixar abaixo os dois arquivos. Citar TRAINING MONK.XML <?xml version="1.0" encoding="UTF-8"?> <monster name="Training Monk" nameDescription="a training monk" race="blood" experience="0" speed="210" manacost="0"> <health now="240000" max="240000"/> <look type="268" head="19" body="95" legs="19" feet="19" addons="3" corpse="6080"/> <targetchange interval="60000" chance="0"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag staticattack="50"/> <flag lightlevel="0"/> <flag lightcolor="0"/> <flag targetdistance="1"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="1500" min="-0" max="-1"/> </attacks> <defenses armor="0" defense="0"> <defense name="mass healing" interval="10000" chance="100" min="24000" max="24000"/> </defenses> <immunities> <immunity physical="0"/> <immunity energy="0"/> <immunity fire="0"/> <immunity poison="0"/> <immunity lifedrain="0"/> <immunity paralyze="0"/> <immunity outfit="0"/> <immunity drunk="0"/> <immunity invisible="1"/> </immunities> <loot> <item id="2148" countmax="20" chance1="100000" chancemax="0"/> <item id="1949" chance="10000"/> <item id="2467" chance="10000"/> <item id="2642" chance="6666"/> <item id="1987" chance="100000"> <inside> <item id="2044" chance="6666"/> <item id="2689" countmax="3" chance1="20000" chancemax="0"/> <item id="2401" chance="3333"/> <item id="2166" chance="1428"/> </inside> </item> </loot> </monster> Citar TAG DO TRAINING MONK.XML <monster name="Training Monk" file="Monks/Training Monk.xml"/>
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.