Postado Fevereiro 26, 2012 13 anos Olá amigos. queria saber se alguém possui esse sistema em mãos, que posa compartilhar. experience por hit http://www.serversoft.com.br/painel/aff.php?aff=016
Postado Fevereiro 26, 2012 13 anos Segue abaixo o Script: Instalação Primeiramente abra a pasta de seu ot, e procure pelo arquivo config.lua e procure por essas 2 linhas : experienceStages = false rateExperience = 50 Se o experienceStages tiver ativado mude para false, pois o sistema ainda não tem suporte á Stages. e é muito importante o rateExperience tiver como 0, pois ela sera configurada, em outro local agora. exemplo: experienceStages = false rateExperience = 0 Agora entre na pasta creaturescripts/scripts e crie um arquivo lua, chamado exphit.lua e cole o seguinte código: rateExp = 50 -- agora vc configura o rate de exp do server. ------------------------------ 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) then local expg = CalculeExp(getCreatureMaxHealth(cid), getMonsterInfo(getCreatureName(cid)).experience * rateExp, value) doPlayerSendTextMessage(sid, 23, "You gain "..expg.." exp.") doPlayerAddExp(sid, expg) end 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 registerCreatureEvent(target, "ExpGain") end return true end Na mesma pasta procure pelo arquivo login.lua, e em cima de return true, adc a seguinte linha: registerCreatureEvent(cid, "ExpHit") Volte na pasta anterior creaturescripts, e procure pelo arquivo creaturescritps.xml e cole as 2 tags: <event type="statschange" name="ExpGain" event="script" value="exphit.lua"/> <event type="combat" name="ExpHit" event="script" value="exphit.lua"/> Para configurar a exp, que era configurada no config.lua está no começo do arquivo exphit.lua , segue abaixo o exemplo: rateExp = 50 -- agora vc configura o rate de exp do server. Créditos: xOtServx Testado: TFS 0.3.6 ( 8.54 ) Espero que funcione, aqui eu uso' Abraços' Editado Fevereiro 26, 2012 13 anos por Adriano SwaTT (veja o histórico de edições) Gosta do meu trabalho? Curta e siga a página do meu projeto de 2016 e 2017 (Lab Z Games) que trará vários servidores OTServs. Atenciosamente,Adriano Swatt' Para ver meus tutoriais acesse meu perfil.
Postado Fevereiro 26, 2012 13 anos Autor Não funciona, eu acho que vc pegou de outro fórum e posto aqui. http://www.serversoft.com.br/painel/aff.php?aff=016
Postado Fevereiro 26, 2012 13 anos Autor rateExp = 50 -- 0 a 20 rateExp1 = 20 -- 21 a 50 rateExp2 = 15 -- 51 a 100 rateExp3 = 10 -- 101 a 200 rateExp4 = 5 -- 201 a 300 rateExp5 = 4 -- 301 a 350 rateExp6 = 3 -- 351 em diante bonus = 1 -- Bonus por estar com exp ring expringid = 1000 -- Id do exp ring ------------------------------ 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) <= 20 then local expg = CalculeExp(getCreatureMaxHealth(cid), getMonsterExperience(getCreatureName(cid)) * rateExp, value) doPlayerSendTextMessage(sid, 23, "You gain "..expg.." exp.") doPlayerAddExp(sid, expg) elseif isPlayer(sid) and getPlayerLevel(sid) > 21 and getPlayerLevel(sid) <= 50 then local expg1 = CalculeExp(getCreatureMaxHealth(cid), getMonsterExperience(getCreatureName(cid)) * rateExp1, value) doPlayerSendTextMessage(sid, 23, "You gain "..expg1.." exp.") doPlayerAddExp(sid, expg1) elseif isPlayer(sid) and getPlayerLevel(sid) > 51 and getPlayerLevel(sid) <= 100 then local expg2 = CalculeExp(getCreatureMaxHealth(cid), getMonsterExperience(getCreatureName(cid)) * rateExp2, value) doPlayerSendTextMessage(sid, 23, "You gain "..expg2.." exp.") doPlayerAddExp(sid, expg2) elseif isPlayer(sid) and getPlayerLevel(sid) > 101 and getPlayerLevel(sid) <= 200 then local expg3 = CalculeExp(getCreatureMaxHealth(cid), getMonsterExperience(getCreatureName(cid)) * rateExp3, value) doPlayerSendTextMessage(sid, 23, "You gain "..expg3.." exp.") doPlayerAddExp(sid, expg3) elseif isPlayer(sid) and getPlayerLevel(sid) > 201 and getPlayerLevel(sid) <= 300 then local expg4 = CalculeExp(getCreatureMaxHealth(cid), getMonsterExperience(getCreatureName(cid)) * rateExp4, value) doPlayerSendTextMessage(sid, 23, "You gain "..expg4.." exp.") doPlayerAddExp(sid, expg4) elseif isPlayer(sid) and getPlayerLevel(sid) > 301 and getPlayerLevel(sid) <= 350 then local expg5 = CalculeExp(getCreatureMaxHealth(cid), getMonsterExperience(getCreatureName(cid)) * rateExp5, value) doPlayerSendTextMessage(sid, 23, "You gain "..expg5.." exp.") doPlayerAddExp(sid, expg5) elseif isPlayer(sid) and getPlayerLevel(sid) > 351 then local expg6 = CalculeExp(getCreatureMaxHealth(cid), getMonsterExperience(getCreatureName(cid)) * rateExp6, value) doPlayerSendTextMessage(sid, 23, "You gain "..expg6.." exp.") doPlayerAddExp(sid, expg6) elseif isPlayer(sid) and item.itemid == expringid then local expbonus = CalculeExp(getCreatureMaxHealth(cid), getMonsterExperience(getCreatureName(cid)) * bonus, value) doPlayerSendTextMessage(sid, 23, "You gain "..expbonus.." bonus exp.") doPlayerAddExp(sid, expbonus) end 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 registerCreatureEvent(target, "ExpGain") end return true end Editado Fevereiro 26, 2012 13 anos por porxmex (veja o histórico de edições) http://www.serversoft.com.br/painel/aff.php?aff=016
Postado Fevereiro 26, 2012 13 anos Não funciona, eu acho que vc pegou de outro fórum e posto aqui. Como eu deixei especificado com os créditos, é que claramente eu não criei o Script... E sim, foi pego de outro forum, e digo mais... o Script funciona sim, pois eu o uso' Posso abrir meu server agora e testá-lo, que estará normal' Pode ser que você fez algo errado' Abraços, boa sorte. Gosta do meu trabalho? Curta e siga a página do meu projeto de 2016 e 2017 (Lab Z Games) que trará vários servidores OTServs. Atenciosamente,Adriano Swatt' Para ver meus tutoriais acesse meu perfil.
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.