Ir para conteúdo

brun123

Conde
  • Total de itens

    512
  • Registro em

  • Última visita

  • Dias Ganhos

    16

Histórico de Reputação

  1. Upvote
    brun123 recebeu reputação de Roksas em Script Ganhando xp por tempo online   
    Abra o creaturescripts.xml e coloque essas tags:
     

    <event type="login" name="ExpPorHoraLogin" event="script" value="expporhora.lua"/> <event type="logout" name="ExpPorHoraLogout" event="script" value="expporhora.lua"/>
     
    agora crie um arquivo chamado expporhora.lua em data/creaturescripts/scripts e cole isso dentro:
     

    expTable = {} -- não modifique interval = 60 * 60 * 1000 expGain = 10000 function execLogin(cid, lastLogin) registerCreatureEvent(cid, "ExpPorHoraLogout") if not expTable[getPlayerGUID(cid)] then expTable[getPlayerGUID(cid)] = {timeOnline = 0} end expTable[getPlayerGUID(cid)].lastLogin = os.clock() expTable[getPlayerGUID(cid)].event = addEvent(addExp, interval - 1000 * expTable[getPlayerGUID(cid)].timeOnline, cid) end function addExp(cid) if not isCreature(cid) then return end expTable[getPlayerGUID(cid)].timeOnline = 0 doPlayerAddExperience(cid, expGain) doSendAnimatedText(getThingPos(cid), expGain, 215) doPlayerSendTextMessage(cid, 27, "Você recebeu "..expGain.." xp por ficar 1 hora online!") execLogin(cid, os.clock()) end function onLogout(cid) if not expTable[getPlayerGUID(cid)] then return true end expTable[getPlayerGUID(cid)].timeOnline = expTable[getPlayerGUID(cid)].timeOnline + os.clock() - expTable[getPlayerGUID(cid)].lastLogin stopEvent(expTable[getPlayerGUID(cid)].event) return true end function onLogin(cid) if getCreatureName(cid) == "Account Manager" then return true end execLogin(cid) return true end
     
    o tempo salva, significa que se o player fica 30 min online e fizer logout, quando ele entrar de novo só vai precisar esperar mais 30 min pra ganhar o xp. o tempo só é resetado se o servidor fechar
  2. Upvote
    brun123 recebeu reputação de Cell18 em Script Ganhando xp por tempo online   
    sim, se o cara tiver o nome de Account Manager ele não iria ganhar, ta aqui sem salvar tempo:
     

    local interval = 60 * 60 * 1000 local expGain = 10000 local function addExp(cid) if not isCreature(cid) then return end doPlayerAddExperience(cid, expGain) doSendAnimatedText(getThingPos(cid), expGain, 215) doPlayerSendTextMessage(cid, 27, "Você recebeu "..expGain.." xp por ficar 1 hora online!") addEvent(addExp, interval, cid) end function onLogin(cid) addEvent(addExp, interval, cid) return true end
  3. Upvote
    brun123 recebeu reputação de Zieghart em (RESOLVIDO) Talkaction que abre um TP, e após 5 players entrar nele, ele some.   
    function onSay(cid) local PORTAL_POS = {x = 1000, y = 1000, z = 7} -- pos onde irá aparecer o portal local DESTINO = {x = 400, y = 300, z = 7} -- pos para onde o portal irá levar local BROADCAST = "O portal fechou." local MAX_PLAYERS = 5 local PORTAL_ITEMID = 1387 local I = getTileItemById(PORTAL_POS, PORTAL_ITEMID) if I.uid > 1 then return doPlayerSendCancel(cid, "Já existe um portal!") end local function func(players) local cid = getTopCreature(PORTAL_POS).uid if isPlayer(cid) then doTeleportThing(cid, DESTINO, false) doSendMagicEffect(DESTINO, CONST_ME_TELEPORT) players = players - 1 if players <= 0 then doBroadcastMessage(BROADCAST) local I = getTileItemById(PORTAL_POS, PORTAL_ITEMID).uid if I > 1 then doRemoveItem(I) end return end end addEvent(func, 150, players) end func(MAX_PLAYERS) doCreateItem(PORTAL_ITEMID, PORTAL_POS) return true end
  4. Upvote
    brun123 recebeu reputação de Alexclusive em Script Ganhando xp por tempo online   
    Abra o creaturescripts.xml e coloque essas tags:
     

    <event type="login" name="ExpPorHoraLogin" event="script" value="expporhora.lua"/> <event type="logout" name="ExpPorHoraLogout" event="script" value="expporhora.lua"/>
     
    agora crie um arquivo chamado expporhora.lua em data/creaturescripts/scripts e cole isso dentro:
     

    expTable = {} -- não modifique interval = 60 * 60 * 1000 expGain = 10000 function execLogin(cid, lastLogin) registerCreatureEvent(cid, "ExpPorHoraLogout") if not expTable[getPlayerGUID(cid)] then expTable[getPlayerGUID(cid)] = {timeOnline = 0} end expTable[getPlayerGUID(cid)].lastLogin = os.clock() expTable[getPlayerGUID(cid)].event = addEvent(addExp, interval - 1000 * expTable[getPlayerGUID(cid)].timeOnline, cid) end function addExp(cid) if not isCreature(cid) then return end expTable[getPlayerGUID(cid)].timeOnline = 0 doPlayerAddExperience(cid, expGain) doSendAnimatedText(getThingPos(cid), expGain, 215) doPlayerSendTextMessage(cid, 27, "Você recebeu "..expGain.." xp por ficar 1 hora online!") execLogin(cid, os.clock()) end function onLogout(cid) if not expTable[getPlayerGUID(cid)] then return true end expTable[getPlayerGUID(cid)].timeOnline = expTable[getPlayerGUID(cid)].timeOnline + os.clock() - expTable[getPlayerGUID(cid)].lastLogin stopEvent(expTable[getPlayerGUID(cid)].event) return true end function onLogin(cid) if getCreatureName(cid) == "Account Manager" then return true end execLogin(cid) return true end
     
    o tempo salva, significa que se o player fica 30 min online e fizer logout, quando ele entrar de novo só vai precisar esperar mais 30 min pra ganhar o xp. o tempo só é resetado se o servidor fechar
  5. Upvote
    brun123 recebeu reputação de trollfox em [Encerrado] Ajuda Error Evolu..   
    na tabela bem no início do código, você tem linhas assim:
     

    [heart] = {Nome dos pokemons que evoluem com heart stone}, [fire] = {...},
     
    esse heart/fire etc são variáveis declaradas no configuration.lua e tem o valor do ID das stones, você provavelmente deletou algumas stones (por exemplo, metal, king etc) do configuration.lua o que fez com que essas variáveis assumissem o valor "nil", e não se pode ter index de tabela (valor entre colchetes) como nil...
     
    ou você tira essas partes da tabela do nome dos pokemons que evoluem com uma stone que você tirou, ou então coloca alguns valores quaisquer, tipo 1, depois 2, depois 3 no lugar dessas variáveis que não existem no configuration.lua que não vai atrapalhar em nada seu script
  6. Upvote
    brun123 recebeu reputação de greed01 em tem como fazer isso na mana?   
    local block = {} function onEquip(cid, item, slot) if os.time() - getPlayerLastLogin(cid) <= 1 then return true end if block[cid] then block[cid] = nil return true else block[cid] = 1 end setCreatureMaxMana(cid, getCreatureMaxMana(cid) + 100) doCreatureAddMana(cid, 100) return true end function onDeEquip(cid, item, slot) setCreatureMaxMana(cid, getCreatureMaxMana(cid) - 100) doCreatureAddMana(cid, -100) return true end
     
    E no xml:
     
    <movevent type="Equip" itemid="????" slot="ammo" event="script" value="???.lua"/>
    <movevent type="DeEquip" itemid="????" slot="ammo" event="script" value="???.lua"/>
  7. Upvote
    brun123 recebeu reputação de marciks em Player Usa Magia e o ot Cai   
    dá erro no distro, porque a função setMagic remove o player, e logo após você executa uma função que o player precisa estar online pra funcionar...
    basta trocar a ordem das funções do meio.
     
    sobre o ot cair, se for isso mesmo que o usuário acima postou, teste deixar o ml como 50 e vê se continua dando crash
  8. Upvote
    brun123 recebeu reputação de Hikigaya em [Encerrado] Duvida PDA   
    É porque a nome do evento estava errado, eu não tinha visto como estava na tag...
    De toda forma, é só mudar essa linha:
     

    registerCreatureEvent(cid, "MaxSqms")
     
    por essa:
     

    registerCreatureEvent(cid, "MaxDistance")
  9. Upvote
    brun123 recebeu reputação de Hamsterbob em [Pedido] Ajuda Em Um Script!   
    Testa assim:
     
     
     
     
  10. Upvote
    brun123 recebeu reputação de Hamsterbob em Script Snow Bugado   
    o do caotic dá erro, porque ele usa o uid de um item num addevent, unique ids de itens não são estáticos.
     
    o luck faz com que o item se transforma em outro completamente diferente usando essa linha:
     

    doTransformItem(item.uid, item.itemid + 15)
     
    o certo seria + 4
     
    Editei o script original, vê se funciona:
     

    TILE_SNOW = 670 TILE_FOOTPRINT_I = 6594 TILE_FOOTPRINT_II = 6598 function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition, actor) if(isPlayerGhost(cid)) then return true end if(item.itemid == TILE_SNOW) then doTransformItem(item.uid, TILE_FOOTPRINT_I) elseif(item.itemid == TILE_FOOTPRINT_I) then doTransformItem(item.uid, TILE_FOOTPRINT_II) else doTransformItem(item.uid, TILE_FOOTPRINT_I) end doDecayItem(item.uid) return true end
  11. Upvote
    brun123 recebeu reputação de Hamsterbob em Script Para Evento Ajuda   
  12. Upvote
    brun123 recebeu reputação de Hamsterbob em Remover Summon Do Inimigo   
    Spell que remove os summons que tem o mesmo nome do mestre (precisa estar atacando algum summon dele ou o verdadeiro):
     

    function onCastSpell(cid, var) local target = getCreatureTarget(cid) if not isCreature(target) then doPlayerSendCancel(cid, "You need a target.") return false end local master = getCreatureMaster(target) if not isPlayer(master) then doPlayerSendCancel(cid, "This spell works only against players.") return false end if #getCreatureSummons(master) > 0 then local function doRemoveSummon(creature) if isCreature(creature) then doSendMagicEffect(getThingPos(creature), CONST_ME_POFF) doRemoveCreature(creature) end end local success = false for _, sid in pairs (getCreatureSummons(master)) do if getCreatureName(sid) == getCreatureName(master) then addEvent(doRemoveSummon, _ * 95, sid) success = true end end end return success end
     
    Spell que indica a posição do verdadeiro:
     

    function onCastSpell(cid, var) local target = getCreatureTarget(cid) if not isCreature(target) then doPlayerSendCancel(cid, "You need a target.") return false end local master = getCreatureMaster(target) if not isPlayer(master) then doPlayerSendCancel(cid, "This spell works only against players.") return false end local function revelar(cid, target, times) if not isCreature(cid) or not isCreature(target) or times <= 0 then return end doSendMagicEffect(getThingPos(target), CONST_ME_TUTORIALSQUARE, cid) doSendMagicEffect(getThingPos(target), CONST_ME_TUTORIALARROW, cid) addEvent(revelar, 450, cid, target, times - 1) end revelar(cid, master, 10) return true end
  13. Upvote
    brun123 recebeu reputação de juliok80 em pq acontece isso   
    escreva local antes de function onDash, pois do jeito que você está fazendo, a função é de escopo global e escreve por cima das outras funções na hora de carregar as spells, ficando:
     

    local function onDash
  14. Upvote
    brun123 recebeu reputação de Hamsterbob em pq acontece isso   
    escreva local antes de function onDash, pois do jeito que você está fazendo, a função é de escopo global e escreve por cima das outras funções na hora de carregar as spells, ficando:
     

    local function onDash
  15. Upvote
    brun123 recebeu reputação de Hamsterbob em Sistema de TV Em Lua   
    tirando que quem está assistindo pode empurrar, dar rotate, use, atacar e fazer diversas outras ações, dá pra usar
    mas isso aí está completamente passível de abuso, já que se você adicionar o hideHealth, os players não poderão ser atacados por outros players, mas poderão atacar... roubar itens em depot, caçar em um lugar e quando quiser sair da hunt, basta desligar o channel e já volta pro lugar antigo...
    e o intervalo de acompanhar o dono do channel é grande, aí fica feio... um cara com muito speed que estiver andando continuadamente vai deixando o pessoal que tá assistindo pra trás, enfim... é complicado fazer esse sistema sem alterações no código fonte
  16. Upvote
    brun123 recebeu reputação de juliok80 em Sistema de TV Em Lua   
    tirando que quem está assistindo pode empurrar, dar rotate, use, atacar e fazer diversas outras ações, dá pra usar
    mas isso aí está completamente passível de abuso, já que se você adicionar o hideHealth, os players não poderão ser atacados por outros players, mas poderão atacar... roubar itens em depot, caçar em um lugar e quando quiser sair da hunt, basta desligar o channel e já volta pro lugar antigo...
    e o intervalo de acompanhar o dono do channel é grande, aí fica feio... um cara com muito speed que estiver andando continuadamente vai deixando o pessoal que tá assistindo pra trás, enfim... é complicado fazer esse sistema sem alterações no código fonte
  17. Upvote
    brun123 recebeu reputação de caotic em Sistema de TV Em Lua   
    tirando que quem está assistindo pode empurrar, dar rotate, use, atacar e fazer diversas outras ações, dá pra usar
    mas isso aí está completamente passível de abuso, já que se você adicionar o hideHealth, os players não poderão ser atacados por outros players, mas poderão atacar... roubar itens em depot, caçar em um lugar e quando quiser sair da hunt, basta desligar o channel e já volta pro lugar antigo...
    e o intervalo de acompanhar o dono do channel é grande, aí fica feio... um cara com muito speed que estiver andando continuadamente vai deixando o pessoal que tá assistindo pra trás, enfim... é complicado fazer esse sistema sem alterações no código fonte
  18. Upvote
    brun123 recebeu reputação de Hamsterbob em spell usadar perto de tal lugar n gasta mana   
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -35, 0, -55) local area = createCombatArea({ {0, 0, 0}, {1, 1, 1}, {1, 2, 1}, {1, 1, 1}, {0, 0, 0} }) setCombatArea(combat, area) local WATER_TILES = {1370,1371,1372,1773,9466,1378, 4718, 6628, 6630, 4664, 5739, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825} function onCastSpell(cid, var) local pos = getPlayerPosition(cid) doSendMagicEffect({x = pos.x+1, y = pos.y+1, z = pos.z}, 87) local position, match = getCreaturePosition(cid), false for x = (position.x - 3), (position.x + 3) do for y = (position.y - 3), (position.y + 3) do local tmp = {x = x, y = y, z = position.z} if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then match = true break end end end if match then addEvent(doCreatureAddMana, 1, cid, getInstantSpellInfo("Water Circle").mana) else doPlayerSendCancel(cid, "Alguma mensagem de erro!") return FALSE end return doCombat(cid, combat, var) end
  19. Upvote
    brun123 recebeu reputação de juliok80 em spell usadar perto de tal lugar n gasta mana   
    experimenta no lugar de:
     

    doCreatureAddMana(cid, getInstantSpellInfo("Water Spin").mana)
     
    usar addEvent, assim:
     

    addEvent(doCreatureAddMana, 1, cid, getInstantSpellInfo("Water Spin").mana)
     
    porque a mana só é gasta depois do return true, então se você testar com mana full, vai gastar mana
     
    pra não permitir que use a magia caso não esteja perto dos itens, é só fazer:
     

    if not match then return false end
     
    resumindo, troca essa parte:
     

    if match then doCreatureAddMana(cid, getInstantSpellInfo("Water Spin").mana) end
     
    por essa:
     

    if match then addEvent(doCreatureAddMana, 1, cid, getInstantSpellInfo("Water Spin").mana) else doPlayerSendCancel(cid, "Alguma mensagem de erro!") return false end
  20. Upvote
    brun123 recebeu reputação de rohfagundes em spell usadar perto de tal lugar n gasta mana   
    local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_ICEDAMAGE) setCombatFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 0, -35, 0, -55) local area = createCombatArea({ {0, 0, 0}, {1, 1, 1}, {1, 2, 1}, {1, 1, 1}, {0, 0, 0} }) setCombatArea(combat, area) local WATER_TILES = {1370,1371,1372,1773,9466,1378, 4718, 6628, 6630, 4664, 5739, 4614, 4615, 4616, 4617, 4618, 4619, 4608, 4609, 4610, 4611, 4612, 4613, 7236, 4614, 4615, 4616, 4617, 4618, 4619, 4620, 4621, 4622, 4623, 4624, 4625, 4665, 4666, 4820, 4821, 4822, 4823, 4824, 4825} function onCastSpell(cid, var) local pos = getPlayerPosition(cid) doSendMagicEffect({x = pos.x+1, y = pos.y+1, z = pos.z}, 87) local position, match = getCreaturePosition(cid), false for x = (position.x - 3), (position.x + 3) do for y = (position.y - 3), (position.y + 3) do local tmp = {x = x, y = y, z = position.z} if isInArray(WATER_TILES, getThingFromPos(tmp).itemid) then match = true break end end end if match then addEvent(doCreatureAddMana, 1, cid, getInstantSpellInfo("Water Circle").mana) else doPlayerSendCancel(cid, "Alguma mensagem de erro!") return FALSE end return doCombat(cid, combat, var) end
  21. Upvote
    brun123 recebeu reputação de Hamsterbob em creaturescripts/spell erro.   
    <event type="statschange" name="firehit" event="script" value="fire_hit.lua"/>
     
    tem que mudar essa linha ai pra isso:
     

    <event type="statschange" name="fireHit" event="script" value="fire_hit.lua"/>
     
    o h tem que ser maiúsculo pra diferenciar os 2 eventos
  22. Upvote
    brun123 recebeu reputação de juliok80 em Movement que muda outfit e não deixe o player alterar o outfit   
    use a função:
     

    doSetCreatureOutfit(cid, outfit, time)
  23. Upvote
    brun123 recebeu reputação de othereality em creaturescripts/spell erro.   
    <event type="statschange" name="firehit" event="script" value="fire_hit.lua"/>
     
    tem que mudar essa linha ai pra isso:
     

    <event type="statschange" name="fireHit" event="script" value="fire_hit.lua"/>
     
    o h tem que ser maiúsculo pra diferenciar os 2 eventos
  24. Upvote
    brun123 recebeu reputação de othereality em onEquip/login erro   
    acabei de testar aqui, o onEquip é lançado antes de atualizar a última data que o player fez login, então a função getPlayerLastLogin retorna a última vez que o player fez login (antes do login que está sendo feito no momento), então tá aqui a solução do teu problema:
     

    function onEquip(cid, item, slot) if getPlayerSlotItem(cid, slot).uid == item.uid then return true end local forc = getPlayerStorageValue(cid, 23222) setPlayerStorageValue(cid, 23222, forc + 2) return true end function onDeEquip(cid, item, slot) local forc = getPlayerStorageValue(cid, 23222) setPlayerStorageValue(cid, 23222, forc - 2) return true end
     
    dessa forma o onEquip vai ser executado apenas uma vez, então já coloquei pra aumentar o storage em 2
  25. Upvote
    brun123 recebeu reputação de Hamsterbob em Summon Nascer Dentro   
    function onCastSpell(cid, var) local maxSummons = 8 for n = 1, maxSummons do if #getCreatureSummons(cid) >= maxSummons then break end local clone = doCreateMonster("clone sanin", getThingPos(cid), false) if isCreature(clone) then doTeleportThing(clone, getThingPos(cid), false) doConvinceCreature(cid, clone) setCreatureMaxHealth(clone, getCreatureMaxHealth(cid)) doCreatureAddHealth(clone, getCreatureHealth(cid)) doSetCreatureOutfit(clone, getCreatureOutfit(cid), -1) doSendMagicEffect(getThingPos(cid), 111) end end return true end
  • Quem Está Navegando   0 membros estão online

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