Postado Fevereiro 17, 2015 10 anos Olá, estou com dificuldades em fazer o script exphit funcionar corretamente já que a nova versão do tfs não possui a função onStatsChange. Gostaria de saber se tem alguma maneira de adaptar sem tem que colocar a função na source, já que por lib não obtive sucesso. Agradeço desde já a atenção! Segue o script abaixo! (Removi algumas partes para simplificar) rateExp = 20 -- 0 a 20 function CalculeExp(monsterhp, exptotal, hit) local x = hit <= monsterhp and math.ceil(exptotal * hit / monsterhp) or 0 local x2 = x - 20 + math.random(20) return x2 > 0 and x2 or 0 end function isSummon(uid) return uid ~= getCreatureMaster(uid) or false end function onStatsChange(cid, attacker, type, combat, value) if type == STATSCHANGE_HEALTHLOSS then if isMonster(cid) then if isCreature(attacker) then local sid = isSummon(attacker) == true and getCreatureMaster(attacker) or attacker if isPlayer(sid) and getPlayerLevel(sid) <= 1000 then local expg = CalculeExp(getCreatureMaxHealth(cid), getMonsterExperience(getCreatureName(cid)) * rateExp, value) doPlayerAddExp(sid, expg) end end elseif type == STATSCHANGE_HEALTHGAIN then return false end return true end function onCombat(cid, target) if isMonster(target) and not isSummon(target) and not isPlayer(target) then end return true end
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.