Ir para conteúdo

joaohd

Visconde
  • Total de itens

    361
  • Registro em

  • Última visita

  • Dias Ganhos

    10

Tudo que joaohd postou

  1. Tente assim: local FOODS = { [2362] = {8, "Crunch."}, [2666] = {15, "Munch."}, [2667] = {12, "Munch."}, [2668] = {10, "Mmmm."}, [2669] = {17, "Munch."}, [2670] = {4, "Gulp."}, [2671] = {30, "Chomp."}, [2672] = {60, "Chomp."}, [2673] = {5, "Yum."}, [2674] = {6, "Yum."}, [2675] = {13, "Yum."}, [2676] = {8, "Yum."}, [2677] = {1, "Yum."}, [2678] = {18, "Slurp."}, [2679] = {1, "Yum."}, [2680] = {2, "Yum."}, [2681] = {9, "Yum."}, [2682] = {20, "Yum."}, [2683] = {17, "Munch."}, [2684] = {8, "Crunch."}, [2685] = {6, "Munch."}, [2686] = {9, "Crunch."}, [2687] = {2, "Crunch."}, [2688] = {9, "Munch."}, [2689] = {10, "Crunch."}, [2690] = {3, "Crunch."}, [2691] = {8, "Crunch."}, [2792] = {6, "Munch."}, [2793] = {9, "Munch."}, [2695] = {6, "Gulp."}, [2696] = {9, "Smack."}, [2787] = {9, "Munch."}, [2788] = {4, "Munch."}, [2789] = {22, "Munch."}, [2790] = {30, "Munch."}, [2791] = {30, "Munch."}, [2792] = {6, "Munch."}, [2794] = {3, "Munch."}, [2795] = {36, "Munch."}, [2796] = {5, "Munch."}, [2793] = {9, "Munch."}, [5097] = {4, "Yum."}, [6125] = {8, "Gulp."}, [6278] = {10, "Mmmm."}, [6279] = {15, "Mmmm."}, [6393] = {12, "Mmmm."}, [6394] = {15, "Mmmm."}, [6501] = {20, "Mmmm."}, [6541] = {6, "Gulp."}, [6542] = {6, "Gulp."}, [6543] = {6, "Gulp."}, [6544] = {6, "Gulp."}, [6545] = {6, "Gulp."}, [6569] = {1, "Mmmm."}, [6574] = {4, "Mmmm."}, [7158] = {15, "Munch."}, [7159] = {13, "Munch."}, [7372] = {7, "Yum."}, [7373] = {7, "Yum."}, [7374] = {7, "Yum."}, [7375] = {7, "Yum."}, [7376] = {7, "Yum."}, [7377] = {7, "Yum."}, [7909] = {4, "Crunch."}, [8838] = {7, "Gulp."}, [8839] = {5, "Yum."}, [8840] = {2, "Yum."}, [8841] = {3, "Urgh."}, [8842] = {3, "Munch."}, [8843] = {3, "Crunch."}, [8844] = {3, "Gulp."}, [8845] = {2, "Munch."}, [8847] = {11, "Yum."} } function onUse(cid, item, fromPosition, itemEx, toPosition local food = FOODS[item.itemid] if(not food) then return false end if((getPlayerFood(cid) + food[1]) >= 100) then doPlayerSendCancel(cid, "You are full.") return true end doPlayerFeed(cid, food[1] * 1) doCreatureAddHealth(cid, 50) doCreatureAddMana(cid, 50) doPlayerSendTextMessage(cid, 25, "Seu feed está " .. getPlayerFood(cid) .. " de 100.") doCreatureSay(cid, food[2], TALKTYPE_ORANGE_1) doRemoveItem(item.uid, 1) return true end flw
  2. Para ficar mais completo: function onStepIn(cid, item, pos) local Cidades = { [50000] = {CityId = 1, To = {x = 10, y = 10, z = 7}}, [50001] = {CityId = 2, To = {x = 11, y = 11, z = 7}} } if isPlayer(cid) then doPlayerSetTown(cid, Cidades[item.uid].CityId) doTeleportThing(cid, Cidades[item.uid].To) doPlayerSendTextMessage(cid, 25, "You are now citizen of " .. getTownName(Cidades[item.uid].CityId)) end return true end Edite a seu gosto. flw
  3. Primeiramente, tente colocar o código entre as tags [.code] e [./code]. Segundo, qual o problema com o script? local female = {lookType = 269, lookHead = 79, lookBody = 91, lookLegs = 91, lookFeet = 91, lookTypeEx = 0, lookAddons = 3} local male = {lookType = 268, lookHead = 86, lookBody = 86, lookLegs = 86, lookFeet = 86, lookTypeEx = 0, lookAddons = 3} function onStepIn(cid, item, pos) if isPlayer(cid) then doCreatureChangeOutfit(cid, getPlayerSex(cid) == 0 and female or male) doSendMagicEffect(pos, 29) doSendAnimatedText(pos,"Fight!", math.random(01,255)) end return TRUE end flw
  4. O código em si está bom. Só recomendo que aprenda a identar o código pois fica muito mais fácil de entender e localizar algum erro caso exista. flw
  5. joaohd

    Talkaction

    Falha minha. Correção: function onSay(cid, words, param, channel) local w = { item = 9971, count = 10 } local pid = getPlayerGUID(cid) local id = { ["club"] = {vocation = {1}, id = 1}, ["sword"]= {vocation = {2}, id = 2}, ["axe"] = {vocation = {2}, id = 3}, ["distance"] = {vocation = {3}, id = 4}, ["shield"] = {vocation = {1, 2, 3}, id = 5} } if (param == '') then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Como usar: !comprar club.") return true end if(id[param:lower()]) then if(getPlayerSkill(cid, id[param:lower()]) < 350) then if(isInArray(id[param:lower()].vocation(getPlayerVocation(cid))) then if doPlayerRemoveItem(cid,w.item,w.count) then doRemoveCreature(cid, true) db.executeQuery("UPDATE `player_skills` SET `value` = `value` + ".. w.count .." WHERE `player_id` = ".. pid .. " and `skillid` = ".. id[param:lower()].id ..";") else doPlayerSendCancel(cid, "You do not have the required item.") end else doPlayerSendCancel(cid, "Voce não pode comprar este skill.") end else doPlayerSendCancel(cid, "Skill's limit reached.") end else doPlayerSendCancel(cid, "Unknown skill.") end return true end flw
  6. Sem créditos. 24 horas para anexá-lo ao tópico. flw
  7. joaohd

    Talkaction

    Tente assim: function onSay(cid, words, param, channel) local w = { item = 9971, count = 10 } local pid = getPlayerGUID(cid) local id = { ["club"] = {vocation = {1}, id = 1}, ["sword"]= {vocation = {2}, id = 2}, ["axe"] = {vocation = {vocation = {2}, id = 3}, ["distance"] = {vocation = {3}, id = 4}, ["shield"] = {vocation = {1, 2, 3} id = 5} } if (param == '') then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Como usar: !comprar club.") return true end if(id[param:lower()]) then if(getPlayerSkill(cid, id[param:lower()]) < 350) then if(isInArray(id[param:lower()].vocation(getPlayerVocation(cid))) then if doPlayerRemoveItem(cid,w.item,w.count) then doRemoveCreature(cid, true) db.executeQuery("UPDATE `player_skills` SET `value` = `value` + ".. w.count .." WHERE `player_id` = ".. pid .. " and `skillid` = ".. id[param:lower()].id ..";") else doPlayerSendCancel(cid, "You do not have the required item.") end else doPlayerSendCancel(cid, "Voce não pode comprar este skill.") end else doPlayerSendCancel(cid, "Skill's limit reached.") end else doPlayerSendCancel(cid, "Unknown skill.") end return true end flw
  8. Não tem erro algum, mas mude os parâmetros e veja se a po: function onUse(cid, item, fromPosition, itemEx, toPosition) portafechada = 5123 -- coloque aqui o ID da porta fechada portaaberta = 6258 -- coloque aqui o ID da porta aberta uidporta = 1010 -- coloque aqui o UID da porta idkey = 2090 -- coloque aqui o id da key if(item.itemid == idkey) and (itemEx.itemid == portafechada) and (itemEx.uid == uidporta) then doTransformItem(itemEx.uid,portaaberta) doRemoveItem(item.uid) addEvent(function(itemEx) return doTransformItem(getThingfromPos(itemEx.uid).uid, 5123) end, 15*1000, itemEx) end return TRUE end flw
  9. Ao que parece, seu servidor não possui as funções de db. Tente trocar db.executeQuery para somente executeQuery. Não tenho certeza se funcionará. flw
  10. Tente assim: function onDeath(cid, corpse, killer) local Ppos = {x = 1004, y = 831, z = 7} -- posicao para onde ele vai ir local monstName = "Rat" local Storage = 11543 if isMonster(cid) then if string.lower(getCreatureName(cid)) == string.lower(monstName) then doTeleportThing(killer[1], Ppos) if isSummon(killer[1]) then doTeleportThing(getCreatureMaster(killer[1]), Ppos) end end end return TRUE end flw
  11. joaohd

    100Hd Virar 1 Thousand

    É uma action: function onUse(cid, item) local config = { HundredId = 2148, ThousandId = 2150 } if item.itemid == config.HundredId then if item.type == 100 then doRemoveItem(item.uid) doPlayerAddItem(cid, config.ThousandId, 1) end elseif item.itemid == config.ThousandId then doRemoveItem(item.uid, 1) doPlayerAddItem(cid, config.HundredId, 100) end return true end Acho que funciona. flw
  12. Aqui estão : function onStepIn(cid, item, fromPosition, toPosition) local config = { ItemId = 2150 MsgDeny = "You cannot pass." } if getPlayerItemCount(cid, config.ItemId) <= 0 then doTeleportThing(cid, fromPosition) doPlayerSendCancel(cid, config.MsgDeny) end return true end function onSay(cid, words) local config = { ItemId = 2150, ItemCount = 1, } return doPlayerAddItem(cid, config.ItemId, config.ItemCount) end flw
  13. Se não tem no items.xml, simplesmente adicione. Pegue como modelo uma outra armor. Mude o id, name e attributes. flw
  14. joaohd

    Crystal Arrow

    Você cometeu double post. Por ser a primeira vez, não o punirei. Peço para que explique melhor o que precisa para que possamos atendê-lo. flw
  15. joaohd

    Lua Demo

    Eu também uso o scite em casa e sem dúvida ele é muito melhor e mais completo. Mas como passo a maior parte do dia fora de casa (faculdade + serviço), preciso de um debugger que eu possa acessar de qualquer lugar sem instalar. Eu escrevia os códigos e não testava. Como descobri o debugger online, agora posso testar mesmo fora de casa. flw
  16. joaohd

    Lua Demo

    Querendo fazer um script mas não tem um debugger? Seus problemas acabaram! Lua demo é um debugger lua online que roda diretamente do browser. Agora você pode testar seus scripts lua de qualquer computador. Basta acessar este link e escrever seu código. Seu uso é bem simples e consta de 3 botões e 1 campo de texto. Simplesmente digite seu código no campo de texto e para executá-lo, clique em "Run". Caso queira apagar tudo, clique em clear. Simples. Por enquanto é só. flw
  17. Muitos conhecem a linguagem lua apenas dentro de otserver e não imaginam a infinidade de coisas que pode ser feita através dela. Sabia que pode ser criado um software reprodutor de audio apenas com lua? Pois é! Aqui venho mostrar um link que mostra as mais diversas bibliotecas lua que podem ser usadas para os variados fins, destacando algumas de interesse: ProteaAudio : Biblioteca para a execução de arquivos de áudio. Link LuaSocket : Biblioteca para conexões entre aplicativos via internet. Link LuaCurl : Biblioteca para transferência de arquivos via internet. Link Para ver as demais, Clique aqui flw
  18. Avançou muito enquanto estive afastado hein. Bom script. Teve um pouco de dificuldade mas depois você aprende. flw
  19. Em creaturescripts/scripts, crie o arquivo AdvancePromote.lua e coloque o conteúdo abaixo: function onAdvance(cid, skill, oldLevel, newLevel) local c = { [1] = {NewVocation = 5, Level = 20}, [2] = {NewVocation = 6, Level = 20} } if (skill == 8) then if (c[getPlayerVocation(cid)]) then if (c[getPlayerVocation(cid)].Level == newLevel) then doPlayerSetVocation(cid, c[getPlayerVocation(cid)].NewVocation) end end end return true end Feito isso, vá em creaturescripts.xml e adicione: <event type="advance" name="AdvancePromote" event="script" value="AdvancePromote.lua"/> Agora, vá em creaturescripts/scripts/login.lua e adicione: registerCreatureEvent(cid, "AdvancePromote") Pronto. flw
  20. Veja se funciona: function onAdvance(cid, skill, oldLevel, newLevel) local c = { [1] = {NewVocation = 5, Level = 20}, [2] = {NewVocation = 6, Level = 20} } if (skill == 8) then if (c[getPlayerVocation(cid)]) then if (c[getPlayerVocation(cid)].Level == newLevel) then doPlayerSetVocation(cid, c[getPlayerVocation(cid)].NewVocation) end end end return true end flw
  21. Tente dar uma conferida no seu .dat e .spr se existe mesmo este sprite e se o mesmo consta também em seu .otb. Movido. flw
  22. Tentem assim: function onSay(cid, words) local config = { ["!food"] = {effect = 10, event = function() return doPlayerAddItem(cid, ID DA FOOD, 1) end}, ["!mana"] = {effect = 11, event = function() return doCreatureAddMana(cid, 100) end} } if config[words:lower()] then doSendMagicEffect(getCreaturePosition(cid), config[words:lower()].effect) config[words:lower()].event() end return true end flw
  23. Plain é sem criptografia. Normalmente usa-se o sha1 por ser mais seguro que o md5. flw
  24. Sim. O último exemplo é o cálculo recursivo do fatorial de um número inteiro positivo. flw
  25. joaohd

    Comer Chamas

    Resolvido via pm. Script abaixo: function onUse(cid, item) local config = { [1492] = 1493, [1493] = 10494, [1494] = 0 } if getPlayerVocation(cid) == 4 then doTransformItem(item.uid, config[item.itemid]) doCreatureAddHealth(cid, 100) else doPlayerSendCancel(cid, "Sorry, not possible.") end return true end Movido para a seção correta. flw
  • Quem Está Navegando   0 membros estão online

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