Vodkart 1515 Postado Julho 31, 2010 Share Postado Julho 31, 2010 (editado) versão testada: 8.54+ Comandos: /addmana nome,quantidade /delmana nome,quantidade /addhp nome,quantidade /delhp nome,quantidade talkactions/script addhpmana.lua --[[ Script by 10% Vodkart and 90% Devilmoon ]]-- --[[ para o Xtibia.com ]]-- function onSay(cid, words, param) if(words == "/addmana") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) mana = getCreatureMana(player)+quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxMana(player, mana) doCreatureAddMana(player, getCreatureMaxMana(player)) doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de mana ao jogador " .. t[1] .. " ") elseif(words == "/delmana") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) mana = getCreatureMana(player)-quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxMana(player, mana) doCreatureAddMana(player, getCreatureMaxMana(player)) doPlayerSendTextMessage(player, 19, "Foram removidos "..quanty.." de mana do seu character agora você tem " .. getCreatureMana(cid) .. "/" .. getCreatureMaxMana(cid) .. " de Mana.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de mana do jogador " .. t[1] .. " ") elseif(words == "/addhp") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) health = getCreatureMaxHealth(player)+quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxHealth(player, health) doCreatureAddHealth(player, getCreatureMaxHealth(player)) doPlayerSendTextMessage(player, 19, "Foram adicionados "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você adicionou "..quanty.." de health do jogador " .. t[1] .. " ") elseif(words == "/delhp") then local t = string.explode(param, ",") if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return end local player = getPlayerByName(t[1]) local quanty = t[2] local pid = getPlayerByNameWildcard(t[1]) health = getCreatureHealth(player)-quanty if(not pid or (isPlayerGhost(pid) and getPlayerGhostAccess(pid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player with this name doesn\'t exist or is offline.") return TRUE end setCreatureMaxHealth(player, health) doCreatureAddHealth(player, getCreatureMaxHealth(player)) doPlayerSendTextMessage(player, 19, "Foram Removidos "..quanty.." de hp do seu character agora você tem " .. getCreatureHealth(cid) .. "/" .. getCreatureMaxHealth(cid) .. " de HP.") doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você Removeu "..quanty.." de health do jogador " .. t[1] .. " ") end return TRUE end talkactions.xml <talkaction log="yes" words="/addmana;/delmana;/addhp;/delhp" access="5" event="script" value="addhpmana.lua"/> Editado Março 6, 2011 por Vodkart Link para o comentário https://xtibia.com/forum/topic/138555-talk-adc-e-remover-manahp/ Compartilhar em outros sites More sharing options...
DevilMoon 125 Postado Julho 31, 2010 Share Postado Julho 31, 2010 Hmm Muinto bom , Testei 8.50 Tambem Edit!! Vodkart - Otimo Professor! Kydrai tbm Qualquer Bug , Comentem!!!!! Obrigado vodkart por postar o script!! Abraços! Link para o comentário https://xtibia.com/forum/topic/138555-talk-adc-e-remover-manahp/#findComment-915266 Compartilhar em outros sites More sharing options...
IgorROX2010 1 Postado Agosto 1, 2010 Share Postado Agosto 1, 2010 Parabéns Vodkart, eh DevilMon ótimo script, não colokei no meu OTserver mais dá pra ver que é um otimo script, mais para OTservers de War Parabén pelo script :thumbsupsmiley: Link para o comentário https://xtibia.com/forum/topic/138555-talk-adc-e-remover-manahp/#findComment-915410 Compartilhar em outros sites More sharing options...
DevilMoon 125 Postado Agosto 7, 2010 Share Postado Agosto 7, 2010 Muinto Obrigado pelo Elogio , e o Script Serve , tabem para voce nao precisar ir la no sql editor , achar o nome do player , almenta ou remover ! Vlw Pelos elogios , Espero que Goste! Link para o comentário https://xtibia.com/forum/topic/138555-talk-adc-e-remover-manahp/#findComment-917855 Compartilhar em outros sites More sharing options...
Kydrai 146 Postado Agosto 7, 2010 Share Postado Agosto 7, 2010 Boa, mas da pra melhorar. Se você reparar vai ver que existe uma sequência de comandos se repete varias vezes. Muita coisa ai poderia ser colocada antes do if. E faltou um return depois do "doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")". Link para o comentário https://xtibia.com/forum/topic/138555-talk-adc-e-remover-manahp/#findComment-917865 Compartilhar em outros sites More sharing options...
hique86 15 Postado Setembro 8, 2011 Share Postado Setembro 8, 2011 Não foi minha intenção reviver o topico, mas é que estou precisando desse script mas esta com um probleminha. Quando vou adicionar hp, não importa a quantidade, sempre adiciona 20000. ss: isso só acontece quando vou adicionar hp. quando vou adicionar mana, está perfeito. ss: Da uma ajuda ae, quem souber, por favor!! valew. obs: minha versão é 8.6 Link para o comentário https://xtibia.com/forum/topic/138555-talk-adc-e-remover-manahp/#findComment-1099793 Compartilhar em outros sites More sharing options...
osbrot 0 Postado Setembro 8, 2011 Share Postado Setembro 8, 2011 Script legal, testei e funcionou corretamente! Link para o comentário https://xtibia.com/forum/topic/138555-talk-adc-e-remover-manahp/#findComment-1099809 Compartilhar em outros sites More sharing options...
hique86 15 Postado Setembro 8, 2011 Share Postado Setembro 8, 2011 Script legal, testei e funcionou corretamente! Em qual versão você testou?!? adicionar hp também está funcionando normal ai?!? Link para o comentário https://xtibia.com/forum/topic/138555-talk-adc-e-remover-manahp/#findComment-1099859 Compartilhar em outros sites More sharing options...
hique86 15 Postado Setembro 15, 2011 Share Postado Setembro 15, 2011 Up ajuda ai pessoal, ainda não consegui concertar isso... hp adiciona sempre 20k, não importa o quanto eu coloco pra adicionar!! Link para o comentário https://xtibia.com/forum/topic/138555-talk-adc-e-remover-manahp/#findComment-1102864 Compartilhar em outros sites More sharing options...
Posts Recomendados