Ir para conteúdo

Entus

Campones
  • Total de itens

    23
  • Registro em

  • Última visita

Histórico de Reputação

  1. Upvote
    Entus recebeu reputação de TaaG em Hunger System - Sistema de fome   
    Falaê galera.

    Hoje vou trazer um script do Wise que achei bem interessante e não achei aqui.


    O que isso faz?
    Faz com que o player necessite se alimentar para parar de perder vida, caso não se alimente, sua vida irá descer até 0. Caso o player morra, quando entrar, ele vai continuar perdendo a porcentagem de HP, até que enfim se alimente. Acredito que seja bom para servidores sérios.
     
    Versões testadas: TFS 0.3.6, mas pelas funções, acho que execute de boa também com TFS 1.0 e com o TFS 0.4.
     
    Bora lá.

    Vá em data\creaturescripts\scripts, crie um .lua chamado checkhunger e adicione isso:
    -- Developed by Wise local t = { hp = 2, -- % maxTime = 25 * 60, -- minutes * 60 lossInterval = 5, -- seconds hstor = 98765 -- hunger storage } function checkHunger(cid) local h = getPlayerStorageValue(cid, t.hstor) local loss = t.lossInterval > 1 and t.lossInterval or 2 if getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBEATTACKED) then return true elseif getPlayerFood(cid) < 1 then if h <= t.maxTime then if h < 0 then setPlayerStorageValue(cid, t.hstor, 0) end setPlayerStorageValue(cid, t.hstor, getPlayerStorageValue(cid, t.hstor) + 1) else addEvent(function() if isPlayer(cid) then doCreatureAddHealth(cid, -(t.hp * (getCreatureMaxHealth(cid) / 100))) end end, (loss - 1) * 1000) end else if h > 0 then setPlayerStorageValue(cid, t.hstor, 0) end end addEvent(function() if isPlayer(cid) then checkHunger(cid) end end, 1000) return true end function onLogin(cid) return checkHunger(cid) and true end Agora vá em data\creaturescripts e abra o creaturescripts.xml, adicione a seguinte tag:
    <event type="login" name="checkHunger" event="script" value="checkhunger.lua"/> Configuração:
    local t = { hp = 2, -- porcentagem de HP que o player perderá maxTime = 25 * 60, -- tempo máximo para ficar sem se alimentar em minutos * 60 (no caso, seriam 25 minutos, ou seja, 1500 segundos) lossInterval = 5, -- tempo do intervalo de perda da porcentagem do HP, em segundos (no caso, perderia a porcentagem estipulada a cada 5 segundos) hstor = 98765 -- storage que faz a contagem do tempo máximo } Créditos: Wise


    Enjoy it!
     
  2. Upvote
    Entus recebeu reputação de TaaG em Jail/Prision System - Sistema de prisão   
    Falaê, vi esse script em outro fórum porém tava meio bugado e fiz algumas alterações, pequenas mas que ajudaram no funcionamento.

    Quando prende o player ele não fica mais em um local fixo, você pode configurar para coloca-lo em outras celas. O tempo pode ou não ser fixo, é só você digitar /jail (nome do player) para um tempo fixo ou /jail (nome do player), (tempo) para coloca-lo com um tempo especifico.

    OBS: O tempo é posto em segundos. (120 segundos = 2 minutos)


    TAG, talkaction.xml:
    <talkaction log="yes" words="/jail;!jail;/prender;!prender;/unjail;!unjail;/desprender;!desprender" access="3" event="script" value="prision.lua"/> Script, data/talkaction/prision.lua:
    grouprequired = 3 jailedstoragevalue_time = 1338 jailedstoragevalue_bool = 1339 local jailpos = { [1] = {x = 59, y = 52, z =6}, [2] = {x = 59, y = 52, z =5}, [3] = {x = 55, y = 47, z =6}, [4] = {x = 55, y = 47, z =5}, [5] = {x = 55, y = 52, z =6}, [6] = {x = 55, y = 52, z =5}, [7] = {x = 59, y = 47, z =5}, [8] = {x = 63, y = 52, z =5} } local unjailpos = { x = 63, y = 54, z =6 } jail_list = {} jail_list_work = 0 function checkJailList(param) addEvent(checkJailList, 1000, {}) for targetID,player in ipairs(jail_list) do if isPlayer(player) == TRUE then if getPlayerStorageValue(player, jailedstoragevalue_time) < os.time() then doTeleportThing(player, unjailpos, TRUE) setPlayerStorageValue(player, jailedstoragevalue_time, 0) setPlayerStorageValue(player, jailedstoragevalue_bool, 0) table.remove(jail_list,targetID) doPlayerSendTextMessage(player, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você saiu da cadeia, tente não fazer coisas malvadas da próxima vez para não ser preso novamente. Cuide-se amigo.') end else table.remove(jail_list,targetID) end end end function onSay(cid, words, param, channel) if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.") return true end local t = string.explode(param, ",") if jail_list_work == 0 then jail_list_work = addEvent(checkJailList, 1000, {}) end local jail_time = -1 for word in string.gmatch(tostring(t[1]), "(%w+)") do if tostring(tonumber(word)) == word then jail_time = tonumber(word) end end local isplayer = getPlayerByName(t[1]) if isPlayer(isplayer) ~= TRUE then isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+1)) if isPlayer(isplayer) ~= TRUE then isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+2)) if isPlayer(isplayer) ~= TRUE then isplayer = getPlayerByName(string.sub(t[1], string.len("jail_time")+3)) end end end local default_jail = 30 if(t[2]) then default_jail = t[2] end if jail_time ~= -1 then jail_time = jail_time * 60 else jail_time = default_jail end if (words == '!prender' or words == '/prender') then if getPlayerGroupId(cid) >= grouprequired then if isPlayer(isplayer) == TRUE then doTeleportThing(isplayer, jailpos[math.random(#jailpos)], TRUE) setPlayerStorageValue(isplayer, jailedstoragevalue_time, os.time()+jail_time) setPlayerStorageValue(isplayer, jailedstoragevalue_bool, 1) table.insert(jail_list,isplayer) doPlayerSendTextMessage (cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você prendeu o player: '.. getCreatureName(isplayer) ..' ate ' .. os.date("%H:%M:%S", getPlayerStorageValue(isplayer, jailedstoragevalue_time)) .. ' (agora é: ' .. os.date("%H:%M:%S", os.time()) .. ').') doPlayerSendTextMessage (isplayer, MESSAGE_STATUS_CONSOLE_ORANGE, 'Voce foi preso por '.. getCreatureName(cid) ..' ate ' .. os.date("%H:%M:%S", getPlayerStorageValue(isplayer, jailedstoragevalue_time)) .. ' (agora é: ' .. os.date("%H:%M:%S", os.time()) .. ').') else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Este jogador não existe ou esta offline.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem permissão para prender players.") end elseif (words == '!desprender' or words == '/desprender') then if getPlayerGroupId(cid) >= grouprequired then if isPlayer(isplayer) == TRUE then if getPlayerStorageValue(isplayer, jailedstoragevalue_bool) == 1 then doTeleportThing(isplayer, unjailpos, TRUE) setPlayerStorageValue(isplayer, jailedstoragevalue_time, 0) setPlayerStorageValue(isplayer, jailedstoragevalue_bool, 0) table.remove(jail_list,targetID) doPlayerSendTextMessage(isplayer, MESSAGE_STATUS_CONSOLE_ORANGE, 'O player '.. getCreatureName(cid) ..' te tirou da prisão. Te vejo em breve!!!') doPlayerSendTextMessage (cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Você tirou da prisão o player: '.. getCreatureName(isplayer) ..'.') else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Este jogador não está preso.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Este jogador não existe ou esta offline.") end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você não tem permissão para prender players.") end end return true end Configuração:
    local jailpos = { -- Local das selas onde o player vai aparecer. local unjailpos = { x = 63, y = 54, z =6 } -- Local onde ele irá sair. local default_jail = 30 -- Tempo padrão. Créditos: Comedinha, por postar pela primeira vez.
    Eu, por arrumar alguns bugs.


    Enjoy it!
  3. Upvote
    Entus deu reputação a Caronte em alguns scripts   
    Script 1:  
    adiciona em talkactions/scripts/giveitem.lua
    function onSay(cid, words, param) local param = param.explode(param, ',') local item = param[2] if isPlayer(getPlayerByName(param[1])) and tonumber(param[2]) and tonumber(param[3]) then doPlayerSendTextMessage(getCreatureByName(param[1]), 22, "Você acabou de receber "..param[3].." "..getItemNameById(item).." do Staff "..getCreatureName(cid).."!") doPlayerAddItem(getCreatureByName(param[1]), param[2], param[3]) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have to use /giveitem Name,Itemid,Count.") end return TRUE end Tag em talkactions.xml
    <talkaction log="yes" access="5" words="/giveitem" event="script" value="giveitem.lua"/> Só falar /giveitem Caronte,2159,10
     
     
     
    Agora o outro:
     
     

    Script 2:  
     
    em talkactions/scripts/deposit.lua
    function onSay(cid, words, param, channel) local param = string.explode(param, ",") local coin = 2159 if getCreatureStorage(cid, "deposit") == -1 then doCreatureSetStorage(cid, "deposit", 0) end if words == "!saldo" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce tem: "..getCreatureStorage(cid, "deposit").." de saldo") end if words == "!depositar" then if not param[1] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "coloque o valor para depositar.") end if getPlayerItemCount(cid, coin) >= tonumber(param[1]) then doPlayerRemoveItem(cid, coin, tonumber(param[1])) doCreatureSetStorage(cid, "deposit", getCreatureStorage(cid, "deposit") + tonumber(param[1])) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce depositou: "..param[1].." seu saldo aumentou para: "..getCreatureStorage(cid, "deposit")..".") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem: "..param[1].." para depositar.") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end end if words == "!sacar" then if not param[1] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "coloque o valor para sacar.") end if getCreatureStorage(cid, "deposit") >= tonumber(param[1]) then doCreatureSetStorage(cid, "deposit", getCreatureStorage(cid, "deposit") - tonumber(param[1])) doPlayerAddItem(cid, coin, tonumber(param[1])) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce sacou: "..param[1].." da sua conta, seu saldo ficou: "..getCreatureStorage(cid, "deposit")..".") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem: "..param[1].." coins, seu saldo é: "..getCreatureStorage(cid, "deposit")..".") doSendMagicEffect(getThingPos(cid), CONST_ME_POFF) end end return true end Em talkactions.xml
    <talkaction words="!saldo;!depositar;!sacar" event="script" value="deposit.lua"/>
  4. Upvote
    Entus deu reputação a Night Wolf em Como fazer uma spell que paraliza?   
    apenas adicione isso na script acima da linha que adiciona o dano:

    local tempo = 5 -- tempo em segundos que fica sem se mexer. doCreatureSetNoMove(variantToNumber(var), true) addEvent(function() if isPlayer(variantToNumber(var)) then doCreatureSetNoMove(variantToNumber(var), false) end end, tempo * 1000) Note que pra isso vc vai precisar ter um needtarget = "1" na tag do xml. Se for uma magia em área e vc quiser paralizar quem tiver na área tem uma outra forma de fazer mas daí vou precisar que vc poste o script.
  5. Upvote
    Entus deu reputação a zipter98 em Como colocar Exhausted em uma spell?   
    local toPos = {x = 1596, y = 738, z = 7} --pos para onde o player vai ser teleportado
    local tempo = 3 --tempo q ele vai ficar la... em segs
    local cooldown = xxx --Tempo, em segundos, de exhaust.
     
    local function teleport(cid, pos)
    if isCreature(cid) then
    doSendMagicEffect(pos, 20)
    doTeleportThing(cid, pos, false)
    end
    end
     
    function onCastSpell(cid, var)
     
    if getPlayerStorageValue(cid, 2938) > os.time() then
    return doPlayerSendCancel(cid, "Wait "..getPlayerStorageValue(cid, 2938) - os.time().." second(s) to use this spell again.")
    end
     
    local pos = getPlayerPosition(cid)
     
    doTeleportThing(cid, toPos, false)
    setPlayerStorageValue(cid, 2938, os.time() + exhaust)
    doSendMagicEffect(pos, 20)
    addEvent(teleport, tempo*1000, cid, pos)
    return true
    end

     
  6. Upvote
    Entus deu reputação a alanmtd em Como criar um Scroll pra transformar o Player em outra Vocation?   
    Crie um arquivo chamado scrollvoc.lua em data/actions/scripts e coloque isso:
     
     
    function onUse(cid, item, fromPosition, toPosition)
     
    local voc = {1} --id da vocação
    local scroll = {} --id do item
    local efeito = {} -- efeito
     
    if item.uid == scroll then
    doPlayerSetVocation(cid, voc)
    doSendMagicEffect(cid, efeito)
    end
    return true
    end
     
    Agora em actions.xml adicione essa
    Tag:
     
    <action actionid="id da scroll" script="scrollvoc.lua"/>
     
    Fiz pelo celular, nada garantido.
    Mais pode fazer de vários modos. Até pra ter lvl para usar a scroll.
  • Quem Está Navegando   0 membros estão online

    • Nenhum usuário registrado visualizando esta página.
×
×
  • Criar Novo...