Ir para conteúdo

Sun

Membro
  • Registro em

  • Última visita

Solutions

  1. Sun's post in Mostrar os segundos que faltam pro boss nascer was marked as the answer   
    local colorMsg = "orange" local tableBoss = { ["Amazon"] = {seconds = 10, newBoss = "Demon"} } local function timer(position, duration, color) for i = 0, (duration - 1) do addEvent(function() doSendAnimatedText(position, tostring(duration - i), color) end, i * 1000) end end function onKill(cid, target, damage, flags) if isPlayer(target) then return true end local boss = tableBoss[getCreatureName(target)] if not boss then return true end local position = getThingPos(target) doPlayerSendTextMessage(cid, MESSAGE_TYPES[colorMsg], "The boss will be born in " .. boss.seconds .. " seconds.") timer(position, boss.seconds, COLOR_RED) addEvent(doCreateMonster, boss.seconds * 1000, boss.newBoss, position) return true end
    creaturescript.xml
     
    <event type="kill" name="event nome" event="script" value="script name.lua"/> login.lua
    registerCreatureEvent(cid, "nome do evento")  
    @poko360 pelo que entendi foi isso, não entendi a necessidade de colocar verificação para não criar dois boss se você matou o anterior.
  2. Sun's post in [Tabela] Mensagem ao Matar Monstros was marked as the answer   
    local cfg = { ["mob"] = {storage = 1, msg = "You are gaye!", item = 123, quanti = 1}, ["mob2"] = {storage = 2, msg = "You are gaye!", item = 123, quanti = 1} } function onKill(cid, target) for monterName, infos in pairs(cfg) do if getCreatureName(target) == monterName then setPlayerStorageValue(cid, infos.storage, 1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, infos.msg) doPlayerAddItem(cid, infos.item, infos.quanti) break end end return true end testa ae pq eu não testei.
     
    @Garoto Prodigio
  3. Sun's post in (Resolvido)Ajuda com esse script efeito quando player logar [SCRIPT] was marked as the answer   
    local tabela_infos = { [0] = { Effect = 123, Storage = 259005, text = "Shinobi", color = COLOR_GREEN, efeito = 1}, -- ## [valor da storage] ## -- [1] = { Effect = 123, Storage = 259005, text = "Genin", color = COLOR_DARKBROWN, efeito = 2}, -- ## [valor da storage] ## -- [2] = { Effect = 123, Storage = 259005, text = "Chunin", color = COLOR_YELLOW, efeito = 2}, -- ## [valor da storage] ## -- [3] = { Effect = 123, Storage = 259005, text = "Jounin", color = COLOR_LIGHTGREEN, efeito = 2}, -- ## [valor da storage] ## -- [4] = { Effect = 123, Storage = 259005, text = "Akatsuki", color = COLOR_DARKRED, efeito = 2}, -- ## [valor da storage] ## -- [5] = { Effect = 123, Storage = 259005, text = "Captao A.", color = COLOR_WHITE, efeito = 2}, -- ## [valor da storage] ## -- [6] = { Effect = 123, Storage = 259005, text = "Anbu", color = COLOR_RED, efeito = 2} -- ## [valor da storage] ## -- } function onLogin(cid) for value, dados in pairs(tabela_infos) do if getPlayerStorageValue(cid, dados.Storage) == value then doSendMagicEffect(getPlayerPosition(cid), dados.efeito) doSendAnimatedText(getPlayerPosition(cid), dados.text, dados.color) end end return true end  
    agora em login.lua, cole isto acima do registerCreatureEvent
    if getPlayerStorageValue(cid, 259005) == -1 then setPlayerStorageValue(cid, 259005, 0) end  
    e agora junto com registerCreatureEvent cole isto.
    registerCreatureEvent(cid, "efeito")  
    e agora em creaturescript.xml
    <event type="login" name="efeito" event="script" value="efeito.lua"/>  
     
    Este gif é para lhe mostrar como ficou, eu já configurei tudo para você, não precisa alterar nada além de efeito e text.
    OBS: O ISTO É APENAS UMA ILUSTRAÇÃO, OU SEJA SE O PLAYER LOGAR NÃO IRA TROCAR O TEXTO SE ELE TIVER COM O VALOR DE SHINOBI.
                   
     
    @KR33
  4. Sun's post in Usar somente uma vez was marked as the answer   
    @Doidodepeda testa ae.
    se funcionar coloque como solução e repute para dar aquela moral!.
    qualquer problema envia que te ajudo.
  5. Sun's post in Preciso de uma script de jutsu target para narutibia alguem poderia me ajudar? was marked as the answer   
    local effect = 4 local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_HITCOLOR, COLOR_ORANGE) setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_PHYSICALDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, -2.0, -400, -2.0, -600) arr1 = { {0, 0, 0, 0, 0}, {0, 1, 1, 1, 0}, {0, 1, 3, 1, 0}, {0, 1, 1, 1, 0}, {0, 0, 0, 0, 0} } local area1 = createCombatArea(arr1) setCombatArea(combat, area1) local function onCastSpell1(cid, var) local pos = getCreaturePosition(cid) local position1 = {x=getThingPosition(getCreatureTarget(cid)).x, y=getThingPosition(getCreatureTarget(cid)).y, z=getThingPosition(getCreatureTarget(cid)).z} doSendMagicEffect(position1, effect) return doCombat(cid, combat, var) end function onCastSpell(cid, var) local parameters = { cid = cid, var = var} addEvent(onCastSpell1, 100, cid, var) return true end  
     
    em actions.xml coloque
     
    <instant name="Rasengan" words="rasengan" lvl="15" mana="3200" aggressive="0" exhaustion="350" needtarget="1" event="script" needlearn="0" value="nomearquivo.lua"> <vocation id="4"/> </instant>  
     
    se te ajudei rep+ e coloque como solução!
    agradeço.
  6. Sun's post in Level Minimo was marked as the answer   
    function onLogin(player) local exp = 900 if player:getLevel() <= 7 then player:addExperience(exp, false) end return true end testa dessa forma
     
    @Lost666
  7. Sun's post in Problema com aleatoriedade do script was marked as the answer   
    @leessandro então amigo, eu nunca usei math.randomseed enquanto programo para tibia, pelo simples fato do tempo!
    vou explicar melhor, quando não se tem algo gerando valores de tempo, não se usa math.randomseed, mas oque seria o tempo?
    vou tentar explicar de uma forma mais simples sem você se perder, o console em si, já é um math.randomseed, ele já irá gerar pra você novos valores sem precisar ter que ficar usando está função! então onde se usaria ela? num OTC, que ali os valores precisam ser gerados pelo gerador e como não tem nada para que gere isso para ele como o console que já faz este processo!
     
    vou te dar um exemplo de um catch que eu mesmo desenvolvi!
     
    local catch local srand = math.random(1, x.chance) if srand > Pokebals_chance["pokeball"] and srand <= Pokebals_chance["greatball"] then -- ## se o valor gerado for maior que a chance da pokebola, e que este valor seja menor que o da great ball catch = true else catch = false end if catch then doRemoveItem(itemEx.uid, 1) addEvent(doSendMagicEffect, 1, toPosition, bolaefeitoON) addEvent(function() doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, str) item = doCreateItemEx(12664, 1) doItemSetAttribute(item, "poke", name) doItemSetAttribute(item, "nome", i) doItemSetAttribute(item, "description", description) doPlayerAddItemEx(cid, item, true) end, 3000) else doRemoveItem(itemEx.uid, 1) addEvent(doSendMagicEffect, 1, toPosition, bolaefeitoOff) addEvent(doPlayerSendTextMessage, 3000, cid, MESSAGE_STATUS_CONSOLE_BLUE, "Escapou!.") end  
    espero que tenha entendido!
    e fica livre ai se outro tiver uma explicação melhor sobre!!!!.
    claro que não postei o catch completo, é apenas um exemplo!
  8. Sun's post in Voce ja esta sob efeito da potion(Exp Potion) was marked as the answer   
    @Orientalz
  9. Sun's post in Como diminuir o base speed dos players? was marked as the answer   
    já que não deu pra fazer isto já em c++, vamos por Lua xD.
    @Nother
     
    crie um arquivo em creaturescript chamado em advanceSpeed.lua e cole
    function onAdvance(cid, skill, oldLevel, newLevel) if newLevel then doChangeSpeed(cid, -getCreatureSpeed(cid)) doChangeSpeed(cid, VocationSpeed[getPlayerVocation(cid)].speed) end return true end e agora em creaturescript.xml cole isto
    <event type="advance" name="AdvanceSpeed" event="script" value="advanceSpeed.lua"/> agora em login.lua cole isto isto
    registerCreatureEvent(cid, "AdvanceSpeed")  
  10. Sun's post in pvp enforced por creaturescript was marked as the answer   
    function onDeath(cid, corpse, deathList) local position = getPlayerPosition(deathList[1]) local target = getCreatureTarget(deathList[1]) local mLevel = getPlayerLevel(cid) <= getPlayerLevel(target) and 500 or 5000 if getPlayerStorageValue(target, 2310) == -1 then return true end doSendAnimatedText(position, "+" .. tostring((getPlayerExperience(target) / mLevel) .. "exp", COLOR_RED) doCreatureAddHealth(deathList[1], 1000) doPlayerAddExperience(deathList[1], (getPlayerExperience(target) / mLevel)) return true end perdão a demora, está ai o script!
    não se esqueça de registrar no login.lua e colocar a tag no xml!
     
    <event type="death" name="PvpEnforced" event="script" value="death.lua"/> e em login.lua
    registerCreatureEvent(cid, "PvpEnforced")  
    lembrando!, não altere nada no script, você pode alterar apenas a storage
    tá ai o funcionamento!.

    @poko360
    lembrando se te ajudei rep+ e coloque como {Solução}
  11. Sun's post in Baú de donate was marked as the answer   
    Em talkactions/scripts crie uma arquivo chamado addpoints.lua e cole \/ function onSay(cid, words, param) local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local tid = getPlayerByNameWildcard(t[1]) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.") return true end if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sem valor adicional.") else setPlayerStorageValue(tid, 15555, getPlayerStorageValue(cid, 15555) + t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você adicionou " .. t[2] .. " points " .. "para " .. t[1].. ".") doPlayerSendTextMessage(tid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu " .. t[2] .. " points.") doSendAnimatedText(getPlayerPosition(tid), "+" .. t[2] .. " points.", COLOR_DARKYELLOW) end return true end -- /teste yeths, valor  
    em talkactions/scripts ainda, crie um arquivo chamado removepoints.lua e cole \/ function onSay(cid, words, param) local t = string.explode(param, ",") if(not t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end local tid = getPlayerByNameWildcard(t[1]) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. t[1] .. " not found.") return true end if not t[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sem valor adicional.") else if (getPlayerStorageValue(tid, 15555) - t[2]) < 0 then setPlayerStorageValue(tid, 15555, 0) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você removeu todos os points do jogador " .. t[1].. ".") return true end setPlayerStorageValue(tid, 15555, getPlayerStorageValue(tid, 15555) - t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você removeu " .. t[2] .. " points do jogador " .. t[1].. ".") end return true end -- /teste yeths, valor em talkactions/scripts ainda crie um arquivo chamado getpoints.lua e cole \/ function onSay(cid, words, param) local tid = getPlayerByNameWildcard(param) if(not tid or (isPlayerGhost(tid) and getPlayerGhostAccess(tid) > getPlayerGhostAccess(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.") return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este jogador possui " .. getPlayerStorageValue(tid, 15555) .. " points.") return true end -- /teste yeths, valor  
     
    agora em talkactions.xml coloque essas tags
    <!-- points --> <talkaction words="/addpoints" event="script" value="addpoints.lua"/> <talkaction words="/removepoints" event="script" value="removepoints.lua"/> <talkaction words="/obterpoints" event="script" value="getpoints.lua"/>  
    em actions/scripts crie um arquivo chamado bau_points.lua info_table = { id_points = 2260 } function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 15555) >= 1 then data = os.date("%d/%m/%y", os.time()) timer = os.date("%H:%M:%S", os.time()) local test = io.open("points.txt", "a+") local read = "" if test then read = test:read("*all") test:close() end read = read.."Dia: " .. data .. " hora:" .. timer .. " nome do jogador: "..getCreatureName(cid).. ", valor retirado: " ..getPlayerStorageValue(cid, 15555).." points.\n" local reopen = io.open("points.txt", "w") reopen:write(read) reopen:close() doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você recebeu +" .. getPlayerStorageValue(cid, 15555) .. " points.") doPlayerAddItem(cid, info_table.id_points, getPlayerStorageValue(cid, 15555)) setPlayerStorageValue(cid, 15555, 0) else return doPlayerSendCancel(cid, "Você não possui points.") end end  
    agora em actions.xml coloque essas tags
    <!-- points --> <action actionid="ACTIONSID" event="script" value="bau_points.lua"/>  
    ultimo passo, vai em creaturescript/scripts e procure por login.lua
     
    if getPlayerStorageValue(cid, 15555) == -1 then setPlayerStorageValue(cid, 15555, 0) end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce possui " .. getPlayerStorageValue(cid, 15555) .. " points.")  
     
    oque esse script irá fazer, ele te permite dar points para o jogador, te permite retirar os points do jogador, te permite olhar quantos pontos o jogador possui.
    além de coisas banais como, ao adicionar points no jogador, irá aparecer no player {+quantida adicionada} 
    isso também irá criar um arquivo no sua pastar do executavel do seu servidor, dizendo quem pegou e quanto tirou de lá!.
     
    exemplo:
     
    como usar?
    /addpoints nomedojogardor, quantia de points /removepoints nomedojogador, quantia a ser retirada /obterpoints nomedojogador  
    @Nother
    este script foi criado para um servidor de um amigo, então está 100%
    creditos totalmente meu!
    espero o seu feedback.
  12. Sun's post in [Movements] Movimentar Player ate x Local was marked as the answer   
    Tabela_infos = { Sqm = 6 } Direction = { [0] = 0, [1] = 1, [2] = 2, [3] = 3, [4] = 4, [5] = 5, [6] = 6, [7] = 7 } function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition) for i = 1, Tabela_infos.Sqm, 1 do doMoveCreature(cid, Direction[getCreatureLookDirection(cid)]) end return true end  
    <movevent type="StepIn" itemid="IDPISO" event="script" value="arquivo.lua"/> @JulianoZN

Informação Importante

Confirmação de Termo