Postado Abril 29, 2012 13 anos Este é um post popular. Créditos Skyforever e VodkartComo funciona? É um script que manda uma mensagem animada dependendo do hit do playerScript Primeiramente vá em /data/creaturescripts/scripts login.lua adicione essa linha la registerCreatureEvent(cid, "Hitmsg") em creaturescripts.xml adicione essas 2 linhas: <event type="statschange" name="HitMessage" event="script" value="hitmsg.lua"/> <event type="combat" name="Hitmsg" event="script" value="hitmsg.lua"/> depois na mesma pasta crie um arquivo chamado hitmsg e adicione isso dentro: function onStatsChange(cid, attacker, type, combat, value) local tabble = { [1] = {max = 15,msg = "Lower"}, [16] = {max= 50,msg = "Good"}, [51] = {max= 100,msg = "Mega"}, [101] = {max= 250,msg = "Epic"}, [251] = {max= 300,msg = "Perfect"}, [301] = {max= 600,msg = "Supreme"}, [601] = {max= 2000,msg = "Divine"}, [2001] = {max= 100000,msg = "Hs"} } if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) then if value == 0 then doSendAnimatedText(getCreaturePosition(attacker), "MISS", math.random(1,255)) else for min, hit in pairs(tabble) do if value >= min and value <= hit.max then local color = math.random(1,255) doSendAnimatedText(getCreaturePosition(attacker), hit.msg, color) local pos2 = {x=getCreaturePosition(attacker).x+1,y=getCreaturePosition(attacker).y,z=getCreaturePosition(attacker).z} doSendAnimatedText(pos2, "HIT", color) end end end elseif type == STATSCHANGE_HEALTHGAIN then return false end return true end function onCombat(cid, target) registerCreatureEvent(target, "HitMessage") return true end Versão com chance: function onStatsChange(cid, attacker, type, combat, value) local chance = 25 -- aqui e chance esta em 25% de funcionar local tabble = { [1] = {max = 15,msg = "Lower"}, [16] = {max= 50,msg = "Good"}, [51] = {max= 100,msg = "Mega"}, [101] = {max= 250,msg = "Epic"}, [251] = {max= 300,msg = "Perfect"}, [301] = {max= 600,msg = "Supreme"}, [601] = {max= 2000,msg = "Divine"}, [2001] = {max= 100000,msg = "Hs"} } if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) then if (chance > math.random(1, 100)) then if value == 0 then doSendAnimatedText(getCreaturePosition(attacker), "MISS", math.random(1,255)) else for min, hit in pairs(tabble) do if value >= min and value <= hit.max then local color = math.random(1,255) doSendAnimatedText(getCreaturePosition(attacker), hit.msg, color) local pos2 = {x=getCreaturePosition(attacker).x+1,y=getCreaturePosition(attacker).y,z=getCreaturePosition(attacker).z} doSendAnimatedText(pos2, "HIT", color) end end end end elseif type == STATSCHANGE_HEALTHGAIN then return false end return true end function onCombat(cid, target) registerCreatureEvent(target, "HitMessage") return true end Versão com recompensa function onStatsChange(cid, attacker, type, combat, value) local chance = 25 -- aqui e chance esta em 25% de funcionar local tabble = { --- min hit,maxhit,mensagem,recompensa,quantidade,storage nao mecha,quantos hits desses ele tera que acertar para ganhar o premio [1] = {max = 15,msg = "Lower", itemid = 2159 , quantidade = 5, storage = 187260, storqua = 1000}, [16] = {max= 50,msg = "Good", itemid = 2159 , quantidade = 10, storage = 187262, storqua = 750}, [51] = {max= 100,msg = "Mega", itemid = 2159 , quantidade = 15, storage = 187263, storqua = 500}, [101] = {max= 250,msg = "Epic", itemid = 2159 , quantidade = 50, storage = 187264, storqua = 250}, [251] = {max= 300,msg = "Perfect", itemid = 2159 , quantidade = 75, storage = 187265, storqua = 150}, [301] = {max= 600,msg = "Supreme", itemid = 2160 , quantidade = 1, storage = 187266, storqua = 100}, [601] = {max= 2000,msg = "Divine", itemid = 2160 , quantidade = 5, storage = 187267, storqua = 50}, [2001] = {max= 100000,msg = "Hs", itemid = 2160 , quantidade = 100, storage = 187268, storqua = 5} } if type == STATSCHANGE_HEALTHLOSS and isPlayer(attacker) then if (chance > math.random(1, 100)) then if value == 0 then doSendAnimatedText(getCreaturePosition(attacker), "MISS", math.random(1,255)) else for min, hit in pairs(tabble) do if value >= min and value <= hit.max then local contagem = getPlayerStorageValue(attacker, hit.storage) if contagem == -1 then setPlayerStorageValue(attacker, hit.storage, 0) end local color = math.random(1,255) doSendAnimatedText(getCreaturePosition(attacker), hit.msg, color) local pos2 = {x=getCreaturePosition(attacker).x+1,y=getCreaturePosition(attacker).y,z=getCreaturePosition(attacker).z} doSendAnimatedText(pos2, "HIT", color) setPlayerStorageValue(attacker, hit.storage, contagem+1) if contagem == hit.storqua then doPlayerAddItem(attacker, hit.itemid, hit.quantidade) setPlayerStorageValue(attacker, hit.storage, 0) end end end end end elseif type == STATSCHANGE_HEALTHGAIN then return false end return true end function onCombat(cid, target) registerCreatureEvent(target, "HitMessage") return true end Explicando o versão com recompensa: em item id e o id do item que ele vai receber ,em quantidade e a quantidade de item,em storage não mecha,em storqua e quantos hits ele precisara dar para ganhar a recompensa Explicando outras versões:em colchetes e o hit minimo em max o hit maximo em msg e a mensagem que mandara em se a sua versão for a com chance em local chance e a porcentagem de chance de sair a mensagem Imagen: se gostaram REP+ Editado Maio 1, 2012 13 anos por Skyforever Explicação, arrumar um erro de português, colocar versão com chance, arrumar spoiler (veja o histórico de edições) Retirado. Skype: joaoxtibia85.
Postado Abril 29, 2012 13 anos achei que ficou legalzinho xd rep+ [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Abril 30, 2012 13 anos kkkk desde ontem o Skyforever tava se matando ¬¬ Olha o erro de concordância João, Crédito: Skyforever é Vodkart está errado porque não se diz é mais sim e, falando é com assento agudo significa que você é a pessoa o (Vodkart) Então o correto seria Créditos: Skyforever e Vodkart +REP pelo Script
Postado Abril 30, 2012 13 anos Legal, ele envia essas mensagens a cada ataque? poderia modificar isso.. fica feio, poderia colocar uma pausa ou sei la, só sei que fica aparecendo essas mensagen toda hora é estranho, se funciona assim. ELFBOT: Dúvidas sobre hotkeys, cavebot, shortkeys e icons?? Estou com uma página para ajudar a todos com essa maravilhosa ferramenta, capaz de fazer qualquer coisa que você imaginar. Basta curtir e pedir! facebook.com/ciroscript Att Vilden~
Postado Abril 30, 2012 13 anos Legal, ele envia essas mensagens a cada ataque? poderia modificar isso.. fica feio, poderia colocar uma pausa ou sei la, só sei que fica aparecendo essas mensagen toda hora é estranho, se funciona assim. tbm acho melhor colocar uma chance de mostrar o hit, por exemplo 40% de chance de dar a msg '-' [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
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.