Ir para conteúdo
Banner com Efeitos

victorgg

Membro
  • Registro em

  • Última visita

Tudo que victorgg postou

  1. local a = {24, 29, 23, 25} print(a[math.random(#a)]) local look = {lookType = a } doSetCreatureOutfit(cid, look, -1) setPlayerStorageValue(cid, 15210, 1) Seria assim entao?
  2. Obrigado Zipter. Era disso mesmo que eu precisava. Zipter, to encontrAndo um problema. Esse print, ta dando resultado no executavel. Mas no script nao. Entao esta dando debug. Estou usando assim: local a = {24, 29, 23, 25} local look = {lookType = print(a[math.random(#a)])} doSetCreatureOutfit(cid, look, -1) setPlayerStorageValue(cid, 15210, 1)
  3. Exemplo: math.random(0, 132) vai gerar um numero de 0 a 132. Eu queria um desse tipo: math.random(0, 132, 145 , 78 , 109) e que ele escolheria aletoriamente um desses numeros. Como faço isso?
  4. HAHA, perai vou exemplificar. O item_valor_1 mando para o pag seguro o valor mesmo. Por exemplo, se o cara selecionar ali 20, vai mandar para o pag seguro que o valor da compra é de 20 reais ou interpretado pelo sistema (2000). O problema é a quantidade do item, que no caso deveria ser equivalente ao valor. Porque o player nao pode escolher a quantidade e o valor neh? Senao ele escolha 100 pontos por 10 reais haha. Por isso queria um comando de php que "puxasse" o valor do item_valor_1 para o item_quant_1 entenderam? Valeu pela ajuda.
  5. Olá, estou acertando o script do pag seguro. Aquele que envia os dados diretamento do site para o pag seguro. Mas olhem a minha duvida. Aqui você escolhe quantos pontos voce quer comprar: <select name="item_valor_1"> <option value="500">5</option> <option value="1000">10</option> <option value="1500">15</option> <option value="2000">20</option> <option value="2500">25</option> <option value="3000">30</option> <option value="3500">35</option> <option value="4000">40</option> <option value="4500">45</option> <option value="5000">50</option> <option value="5500">55</option> <option value="6000">60</option> </select> E aqui é a quantidade do item. No caso que gostaria que ela fosse igual ao da opcao "item_valor_1'. <input type="hidden" name="item_quant_1" value="0"> Eu ja tentei fazer de tudo para que ele "Puxe o valor do item_valor_1. Que linha de codigo devo usar para o php pegar aquele dado? e assim enviar para o pag seguro a mesma quantidade do valor, tambem da quantidade?
  6. victorgg postou uma resposta no tópico em Suporte Tibia OTServer
    Posta esse script <event type="preparedeath" name="onPrepareDeath" event="script" value="blessdeath.lua"/> blessdeath.lua
  7. Substitui essa linha no seu config.lua sqlFile = "forgottenserver.s3db" por essa sqlFile = "Alissow.s3db" E testa. Se nao der certo usa essa: sqlFile = "schemas/Alissow.s3db"
  8. Não sei onde é. Mas para complementar o comentário acima... Sim é nas sources. E não precisa editar cliente. Usava tsf mais antigo pra 8.6 e não tinha. Depois atualizei e já funcionava stac pra player low lvl ou staff.
  9. Quando você desce ele fica "estacado" na escada e não consegue se mexer?
  10. Tenta colocar o ip pra 127.0.0.1 Tenta ver se o caminho pro arquivo forgottenserver.s3db ta certo. Esse arquivo tem que estar dentro da pasta SCHEMAS Desativa o firewall. Posta aqui se funcionar algo. Se não, eu baixo o servidor e vejo.
  11. Cara, isso é muito especifico. Fica complicado fazer assim sem saber nada sobre o seu ot. Isso é uma coisa muito ligada as actions. Precisa de varias. Storage de missao completa, storage de missão em andamento, storage de missao entregue etc etc etc. Entende? é muito ligado ao seu ot.
  12. victorgg postou uma resposta no tópico em Suporte Tibia OTServer
    Posta o playerdeath.lua e o login.lua que esta na pasta creaturescripts. Ah posta tb o creaturescripts.xml pra ver se chama algum script de terceiro pra bless.
  13. victorgg postou uma resposta no tópico em Suporte Tibia OTServer
    Posta o firstitems.lua Sempre post junto do erro o script para poder te ajudar.
  14. Sim realmente era esse o erro. Aqui o script final. Espero que ajudem alguem Resolvido. @Nextbr Sim, tem a função quando dar logout e quando morrer dar baixa. function onLogin(cid) if getGlobalStorageValue(15100) == 1 then setGlobalStorageValue(15101, getGlobalStorageValue(15101) + 1) setPlayerStorageValue(cid, 15099, 1) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = math.random(0, 132) outfit.lookBody = math.random(0, 132) outfit.lookLegs = math.random(0, 132) outfit.lookFeet = math.random(0, 132) doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(math.random(15201, 15204)) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(math.random(15201, 15204))), true) return true end if getGlobalStorageValue(15100) == 2 then if getGlobalStorageValue(15101) >= getGlobalStorageValue(15102) then -- COLOCAR O JOGADOR NO TIME BRANCO -- 15002 setGlobalStorageValue(15102, getGlobalStorageValue(15102) + 1) setPlayerStorageValue(cid, 15099, 2) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 0 outfit.lookBody = 114 outfit.lookLegs = 114 outfit.lookFeet = 114 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15202) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15202)), true) else -- COLOCAR O JOGADOR NO TIME PRETO -- 15101 setGlobalStorageValue(15101, getGlobalStorageValue(15101) + 1) setPlayerStorageValue(cid, 15099, 1) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 114 outfit.lookBody = 0 outfit.lookLegs = 0 outfit.lookFeet = 0 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15201) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15201)), true) end return true end if getGlobalStorageValue(15100) == 3 then local times = { [1] = 15101, [2] = 15102, [3] = 15103 } local minor = getGlobalStorageValue(times[1]) -- seta um valor inicial for _, v in pairs (times) do if getGlobalStorageValue(v) <= minor then minor = getGlobalStorageValue(v) index = v end end if index == 15101 then setGlobalStorageValue(index, getGlobalStorageValue(index) + 1) setPlayerStorageValue(cid, 15099, 1) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 114 outfit.lookBody = 0 outfit.lookLegs = 0 outfit.lookFeet = 0 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15201) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15201)), true) elseif index == 15102 then setGlobalStorageValue(index, getGlobalStorageValue(index) + 1) setPlayerStorageValue(cid, 15099, 2) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 0 outfit.lookBody = 114 outfit.lookLegs = 114 outfit.lookFeet = 114 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15202) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15202)), true) elseif index == 15103 then setGlobalStorageValue(index, getGlobalStorageValue(index) + 1) setPlayerStorageValue(cid, 15099, 3) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 114 outfit.lookBody = 88 outfit.lookLegs = 88 outfit.lookFeet = 88 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15203) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15203)), true) end return true end if getGlobalStorageValue(15100) == 4 then local times = { [1] = 15101, [2] = 15102, [3] = 15103, [4] = 15104 } local minor = getGlobalStorageValue(times[1]) -- seta um valor inicial for _, v in pairs (times) do if getGlobalStorageValue(v) <= minor then minor = getGlobalStorageValue(v) index = v end end if index == 15101 then setGlobalStorageValue(index, getGlobalStorageValue(index) + 1) setPlayerStorageValue(cid, 15099, 1) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 114 outfit.lookBody = 0 outfit.lookLegs = 0 outfit.lookFeet = 0 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15201) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15201)), true) elseif index == 15102 then setGlobalStorageValue(index, getGlobalStorageValue(index) + 1) setPlayerStorageValue(cid, 15099, 2) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 0 outfit.lookBody = 114 outfit.lookLegs = 114 outfit.lookFeet = 114 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15202) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15202)), true) elseif index == 15103 then setGlobalStorageValue(index, getGlobalStorageValue(index) + 1) setPlayerStorageValue(cid, 15099, 3) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 114 outfit.lookBody = 88 outfit.lookLegs = 88 outfit.lookFeet = 88 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15203) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15203)), true) elseif index == 15104 then setGlobalStorageValue(index, getGlobalStorageValue(index) + 1) setPlayerStorageValue(cid, 15099, 4) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 0 outfit.lookBody = 81 outfit.lookLegs = 81 outfit.lookFeet = 81 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15204) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15204)), true) end return true end return true end
  15. Ok. Vou postar o script inteiro do sistema, porfavor ignore o resto. Nao terminei o script Seguinte, o for nao ta salvando nada na variavel. Tentei com a index e a for. Quem sabe estou usando no lugar errado. Tentei colocar local tb, e nao deu certo. Erro: [7/11/2014 12:13:10] [Error - CreatureScript Interface] [7/11/2014 12:13:10] data/creaturescripts/scripts/definirtime.lua:onLogin [7/11/2014 12:13:10] Description: [7/11/2014 12:13:10] data/creaturescripts/scripts/definirtime.lua:88: attempt to concatenate global 'index' (a nil value) [7/11/2014 12:13:10] stack traceback: [7/11/2014 12:13:10] data/creaturescripts/scripts/definirtime.lua:88: in function <data/creaturescripts/scripts/definirtime.lua:1> Uma curiosidade, o codigo que tu postou primeiro, a colchetes na linha "​[4] = globalStorage do time4" dava erro. Ai substitui o colchetes e foi normal. Coisas de propgramação O_o Porfavor se puder nao entregue o codigo pronto, só me diga oque tem de errado. Obrigado Wolf, consegui arrumar. Não sei explicar oq era. Só sei que esta funcionando perfeitamente. Fiz varios testes e esta tudo ok. Vou postar o script final que pode servir de base de conhecimento para algo do genero. Muito bom! O script nao esta terminado, mas o balanceamento esta perfeito. function onLogin(cid) if getGlobalStorageValue(15100) == 1 then return true end if getGlobalStorageValue(15100) == 2 then if getGlobalStorageValue(15101) >= getGlobalStorageValue(15102) then -- COLOCAR O JOGADOR NO TIME BRANCO -- 15002 setGlobalStorageValue(15102, getGlobalStorageValue(15102) + 1) setPlayerStorageValue(cid, 15099, 2) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 0 outfit.lookBody = 114 outfit.lookLegs = 114 outfit.lookFeet = 114 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15202) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15202)), true) else -- COLOCAR O JOGADOR NO TIME PRETO -- 15101 setGlobalStorageValue(15101, getGlobalStorageValue(15101) + 1) setPlayerStorageValue(cid, 15099, 1) -- OUTFIT local outfit = getCreatureOutfit(cid) outfit.lookHead = 114 outfit.lookBody = 0 outfit.lookLegs = 0 outfit.lookFeet = 0 doCreatureChangeOutfit(cid, outfit) -- TOWN doPlayerSetTown(cid, getGlobalStorageValue(15201) ) doTeleportThing(cid, getTownTemplePosition(getGlobalStorageValue(15201)), true) end return true end if getGlobalStorageValue(15100) == 3 then return true end if getGlobalStorageValue(15100) == 4 then local times = { [1] = 15101, [2] = 15102, [3] = 15103, [4] = 15104 } local minor = getGlobalStorageValue(times[1]) -- seta um valor inicial for _, v in pairs (times) do if getGlobalStorageValue(v) <= minor then minor = getGlobalStorageValue(v) index = v end end setGlobalStorageValue(index, getGlobalStorageValue(index) + 1) return true end return true end Obrigado a todos.
  16. Só pra entender na variavel V vai ficar salva o numero da menor storage?
  17. Oi, to fazendo um ot de war. mas ai pra balancear dois times, usei: if time1 >= time 2 colocar o player no time 2 if time2>= time1 colocar o player no time 1 mas e com 3 ou 4 times? como faço para balancear?
  18. Olá. Observem essa linha do config.lua : world = "Hardcore PvP" Você abre o ot. E se você usar o comando /mode ele vai alterar essa opção durante o ot aberto. Ou seja, não precisa reinicia-lo. Gostaria de saber como faço para poder alterar a linha: noDamageToSameLookfeet = true durante o ot estando aberto. Dei uma olhada no script da talkaction /mode , que se asemelha ao meu pedido e achei essa linha: local world = getWorldType() param = param:lower() if(table.isStrIn(param, config.optional)) then setWorldType(WORLDTYPE_OPTIONAL) world = "Optional PvP" elseif(table.isStrIn(param, config.open)) then setWorldType(WORLDTYPE_OPEN) world = "Open PvP" elseif(table.isStrIn(param, config.hardcore)) then setWorldType(WORLDTYPE_HARDCORE) world = "Hardcore PvP" else doPlayerSendCancel(cid, "Bad gameworld type.") return true end Não quero um script pronto, Só quero que me expliquem ou ensinem como fazer Obrigado
  19. victorgg postou uma resposta no tópico em Suporte Tibia OTServer
    Windows 7 64bits. OTX 2.51 Error: [21/2/2014 3:56:39] [Error - Action Interface] [21/2/2014 3:56:39] data/actions/scripts/other/enchantements/enchant-armor.lua:onUse [21/2/2014 3:56:39] Description: [21/2/2014 3:56:39] ...ctions/scripts/other/enchantements/enchant-armor.lua:27: attempt to call field 'get' (a nil value) [21/2/2014 3:56:39] stack traceback: [21/2/2014 3:56:39] ...ctions/scripts/other/enchantements/enchant-armor.lua:27: in function <...ctions/scripts/other/enchantements/enchant-armor.lua:18> Script: local messagetype = MESSAGE_EVENT_ORANGE local fetishs = { [7800] = {chance = 100, amount = 1, set = setItemArmor, get = getItemArmor, name = "armor"}, [7801] = {chance = 80, amount = 2, set = setItemArmor, get = getItemArmor, name = "armor"}, [7802] = {chance = 60, amount = 3, set = setItemArmor, get = getItemArmor, name = "armor"}, [7803] = {chance = 40, amount = 4, set = setItemArmor, get = getItemArmor, name = "armor", destroy = TRUE}, [7804] = {chance = 20, amount = 5, set = setItemArmor, get = getItemArmor, name = "armor", destroy = TRUE}, [7850] = {chance = 100, amount = 5, set = setItemArmor, get = getItemArmor, name = "armor"}, -- only given when access >= 5 } local minmax = { min1 = 7800, -- minimum of the random fetishs for access < 5 max1 = 7804, -- maximum of the random fetishs for access < 5 min2 = 7850, -- minimum of the random fetishs for access >= 5 max2 = 7850, -- maximum of the random fetishs for access >= 5 } -- WARNING: look further down and your eyes will burn. -- function onUse(cid, item, fromPosition, itemEx, toPosition) if item.actionid == 0 then local new = getPlayerAccess(cid) >= 5 and math.random(minmax.min2, minmax.max2) or math.random(minmax.min1, minmax.max1) local text = "You remove the dust and revealed that it is a "..fetishs[new].chance.."% fetish for "..fetishs[new].name.." +"..fetishs[new].amount.."."..(fetishs[new].destroy ~= nil and " It has a slight chance of breaking your item." or "") doPlayerSendTextMessage(cid, messagetype, text) doSetItemActionId(item.uid, new) doSetItemSpecialDescription(item.uid, text) --setItemName(item.uid, fetishs[new].chance.."% fetish for "..fetishs[new].name.." +"..fetishs[new].amount) elseif fetishs[item.actionid] ~= nil then if fetishs[item.actionid].get(itemEx.uid) > 0 then if itemEx.actionid < 105 then local amount = math.max(0, itemEx.actionid - 100) local chance = math.random(0, 100) local text = fetishs[item.actionid].name.." enchant on "..getItemNameById(itemEx.itemid).." failed." if chance <= fetishs[item.actionid].chance then fetishs[item.actionid].set(itemEx.uid, (fetishs[item.actionid].get(itemEx.uid)+fetishs[item.actionid].amount)) text = getItemNameById(itemEx.itemid).." "..fetishs[item.actionid].name.." +"..fetishs[item.actionid].amount.."." elseif fetishs[item.actionid].destroy ~= nil or fetishs[item.actionid].destroy == TRUE then if math.random(0, 1) == 1 then doRemoveItem(itemEx.uid) text = getItemNameById(itemEx.itemid).." has been destroyed." end end doPlayerSendTextMessage(cid, messagetype, text) doSetItemActionId(itemEx.uid, 100+(amount+1)) setItemName(itemEx.uid, getItemNameById(itemEx.itemid).." (Level "..(amount+1)..")") doSendMagicEffect(toPosition, (chance <= fetishs[item.actionid].chance and 13 or 2)) doSendAnimatedText(toPosition, (chance <= fetishs[item.actionid].chance and "Success!" or "Failed!"),(chance <= fetishs[item.actionid].chance and TEXTCOLOR_WHITE or TEXTCOLOR_RED)) doRemoveItem(item.uid) else doPlayerSendCancel(cid, "This weapon has already been enchanted 5 times.") end else doPlayerSendCancel(cid, "This item may not be enchanted.") end else doPlayerSendCancel(cid, "Sorry, not possible.") end return TRUE end

Informação Importante

Confirmação de Termo