Ir para conteúdo
Close

Vodkart

Moderador
  • Total de itens

    2.687
  • Registro em

  • Última visita

  • Dias Ganhos

    100

Tudo que Vodkart postou

  1. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser,msg = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid,msg:lower() local reward_starter = { {2160, 5}, {12344, 10}, {12345, 10}, {12346, 10}, {12347, 10}, {12348, 15}, {12349, 15}, {2394, 50} } local places = { ["pallet"] = 1, ["viridian"] = 2, ["pewter"] = 3, ["cerulean"] = 4, ["saffron"] = 5, ["celadon"] = 6, ["lavender"] = 7, ["vermilion"] = 8, ["fuchsia"] = 9, ["cinnabar"] = 10, } local Choose = {"bulbasaur", "charmander", "squirtle", "chikorita", "cyndaquil", "totodile", "treecko", "mudkip", "torchic"} local sto_Oak = 748513 local sto_city = 13611 if msgcontains(string.lower(msg), 'cidade') or msgcontains(string.lower(msg), 'help') then if getPlayerStorageValue(cid, sto_city) > 0 then selfSay("Voce ja escolheu seu pokemon!", cid) return true elseif getPlayerStorageValue(cid, sto_Oak) < 1 then selfSay("Go talk with the Delia first!", cid) return true else selfSay("You can choose your beginner town between: {Saffron, Cerulean, Lavender, Fuchsia, Celadon, Viridian, Vermilion, Pewter or Cinnabar}.", cid) talkState[talkUser] = 2 return true end elseif places[msg] and talkState[talkUser] == 2 then city = msg selfSay("Are you sure which you want to begin in {".. doCorrectString(msg) .."}?", cid) talkState[talkUser] = 3 return true elseif msgcontains(msg, "yes") or msgcontains(msg, "sim") and talkState[talkUser] == 3 then selfSay("OK then... Now your beginner town is ".. doCorrectString(city)..".", cid) selfSay("Ok, talk {Choose poke or escolhe poke} and complete this mission!", cid) doPlayerSetTown(cid, places[city]) talkState[talkUser] = 4 -- alterado a baixo \/ elseif msgcontains(msg, "choose poke") or msgcontains(msg, "escolhe poke") and talkState[talkUser] == 4 then selfSay("pronto para {iniciar}?", cid) talkState[talkUser] = 5 elseif msgcontains(msg, "iniciar") or msgcontains(msg, "antigo") and talkState[talkUser] == 5 then selfSay("Ok, escolha seu pokemon, Pokes Kanto! {Charmander, Bulbasaur, Squirtle}, Pokes Johto! {Chikorita, Cyndaquil, Totodile} ou Hooen {Treecko, Mudkip, Torchic} qual voce prefere?", cid) talkState[talkUser] = 6 elseif isInArray(Choose, msg) and talkState[talkUser] == 6 then if getPlayerStorageValue(cid, sto_city) == 1 then addPokeToPlayer(cid, msg, 0, -1, 'normal', true) doSendMagicEffect(getThingPos(cid), 21) selfSay("Ok, good luck on your journey.", cid) for i = 1, #reward_starter do doPlayerAddItem(cid, reward_starter[i][1], reward_starter[i][2]) end setPlayerStorageValue(cid, sto_city, 1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), false) talkState[talkUser] = 0 else selfSay("Voce ja escolheu seu pokemon!", cid) talkState[talkUser] = 0 end elseif msgcontains(msg, "no") or msgcontains(msg, "No") and talkState[talkUser] > 0 then selfSay("Ok then... say again what city you want to begin!", cid) talkState[talkUser] = 0 return true end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  2. tente trocar essa função: function isBanned(GUID) local query = db.getResult("SELECT active FROM bans WHERE param = "..GUID) if query:getID() > -1 then repeat if query:getDataInt("active") == 1 then return true end until not query:next() end query:free() return false end por essa que eu refiz: function isBanned(guid) local qry = db.getResult("SELECT `value` FROM `bans` WHERE `param` = " .. guid .. " AND `active` = 1;") if (qry:getID() ~= -1) then return true end return false end
  3. https://tibiaking.com/forums/topic/12115-creaturescripts-walking-effect-on-outfit/
  4. isso não é no spells.xml? lá tem o exhausted da magia
  5. está dizendo que na coluna "killers" não tem nada do parâmetro "war"
  6. está faltando bastante função!! coloca todas essas funções na sua lib: -- lib and functions by Vitor Bertolucci (Killua) function warnPlayersWithStorage(storage, value, class, message) -- By Killua if not value then value = 1 end if not class then class = MESSAGE_SATUS_CONSOLE_WARNING end if not storage or not message then return end if #getPlayersOnline() == 0 then return end for _, pid in pairs(getPlayersOnline()) do if getPlayerStorageValue(pid, storage) == value then doPlayerSendTextMessage(pid, class, message) end if getPlayerAccess(pid) >= 4 then doPlayerSendTextMessage(pid, class, "Message to those with storage "..storage..message) -- Gms will always receive the messages end end end function getPlayerStorageZero(cid, storage) -- By Killua local sto = getPlayerStorageValue(cid, storage) return sto > 0 and sto or 0 end function getStorageZero(storage) -- By Killua local sto = getGlobalStorageValue(storage) return sto > 0 and sto or 0 end function countTable(table) -- By Killua local y = 0 if type(table) == "table" then for _ in pairs(table) do y = y + 1 end return y end return false end function getPlayersInArea(frompos, topos) -- By Killua local players_ = {} local count = 1 for _, pid in pairs(getPlayersOnline()) do if isInArea(getCreaturePosition(pid), frompos, topos) then players_[count] = pid count = count + 1 end end return countTable(players_) > 0 and players_ or false end function getGuildNameByID(gid) -- By Killua local query = db.getResult("SELECT `name` FROM `guilds` WHERE `id` = '"..gid.."'") if query:getID() == -1 then return false end local name = query:getDataString("name") query:free() return name end function getContainerItemsInfo(containerUid) -- By Killua local table = {} if containerUid and containerUid > 0 then local a = 0 for i = 0, getContainerSize(containerUid) do local item = getContainerItem(containerUid,i) a = a + 1 table[a] = {uid = item.uid, itemid = item.itemid, quant = item.type} end return table end return false end function getTableEqualValues(table) -- By Killua local ck = {} local eq = {} if type(table) == "table" then if countTable(table) and countTable(table) > 0 then for i = 1, countTable(table) do if not isInArray(ck, table[i]) then ck[i] = table[i] else eq[i] = table[i] end end return countTable(eq) > 0 and eq or 0 end end return false end function killuaGetItemLevel(uid) -- By Killua local name = getItemName(uid) local pos = 0 for i = 1, #name do if string.byte(name:sub(i,i)) == string.byte('+') then pos = i + 1 break end end return tonumber(name:sub(pos,pos)) end k_table_storage_lib = { filtrateString = function(str) -- By Killua local tb, x, old, last = {}, 0, 0, 0 local first, second, final = 0, 0, 0 if type(str) ~= "string" then return tb end for i = 2, #str-1 do if string.byte(str:sub(i,i)) == string.byte(':') then x, second, last = x+1, i-1, i+2 for t = last,#str-1 do if string.byte(str:sub(t,t)) == string.byte(',') then first = x == 1 and 2 or old old, final = t+2, t-1 local index, var = str:sub(first,second), str:sub(last,final) tb[tonumber(index) or tostring(index)] = tonumber(var) or tostring(var) break end end end end return tb end, translateIntoString = function(tb) -- By Killua local str = "" if type(tb) ~= "table" then return str end for i, t in pairs(tb) do str = str..i..": "..t..", " end str = "a"..str.."a" return tostring(str) end } function setPlayerTableStorage(cid, key, value) -- By Killua return doPlayerSetStorageValue(cid, key, k_table_storage_lib.translateIntoString(value)) end function getPlayerTableStorage(cid, key) -- By Killua return k_table_storage_lib.filtrateString(getPlayerStorageValue(cid, key)) end function setGlobalTableStorage(key, value) -- By Killua return setGlobalStorageValue(key, k_table_storage_lib.translateIntoString(value)) end function getGlobalTableStorage(key) -- By Killua return k_table_storage_lib.filtrateString(getGlobalStorageValue(key)) end function printTable(table, includeIndices,prnt) -- By Killua if includeIndices == nil then includeIndices = true end if prnt == nil then prnt = true end if type(table) ~= "table" then error("Argument must be a table") return end local str, c = "{", "" for v, b in pairs(table) do if type(b) == "table" then str = includeIndices and str..c.."["..v.."]".." = "..printTable(b,true,false) or str..c..printTable(b,false,false) else str = includeIndices and str..c.."["..v.."]".." = "..b or str..c..b end c = ", " end str = str.."}" if prnt then print(str) end return str end function checkString(str) -- By Killua local check = true for i = 1, #str do local letra = string.byte(str:sub(i,i)) if letra >= string.byte('a') and letra <= string.byte('z') or letra >= string.byte('A') and letra <= string.byte('Z') or letra >= string.byte('0') and letra <= string.byte('9') then check = true else check = false break end end return check end function isWalkable(cid, pos, considerCreatures) -- By Killua if considerCreatures == nil then considerCreatures = true end if getTopCreature(pos).uid and getTopCreature(pos).uid > 0 then if considerCreatures then return false else return true end end pos.stackpos = 0 if getTileThingByPos(pos).uid ~= 0 then if doTileQueryAdd(cid, pos) == RETURNVALUE_NOERROR then return true end end return false end function isArmor(uid) -- By Killua if tonumber(getItemAttribute(uid,"armor")) and tonumber(getItemAttribute(uid,"armor")) > 0 and getItemWeaponType(uid) == 0 then return true end return false end function isWeapon(uid) -- By Killua return getItemWeaponType(uid) ~= 0 end function isShield(uid) -- By Killua return getItemWeaponType(uid) == 5 end function isSword(uid) -- By Killua return getItemWeaponType(uid) == 1 end function isClub(uid) -- By Killua return getItemWeaponType(uid) == 2 end function isAxe(uid) -- By Killua return getItemWeaponType(uid) == 3 end function isBow(uid) -- By Killua return getItemWeaponType(uid) == 4 end function isWand(uid) -- By Killua return getItemWeaponType(uid) == 7 end
  7. vai no seu login.lua em creaturescript e adiciona antes do último "return true" -- vip days -- local days,storvip = 1, 878484 if getPlayerStorageValue(cid, storvip) <= 0 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Foram adicionados ".. days .." dias de Donate no seu character.") setPlayerStorageValue(cid, 13899, getPlayerStorageValue(cid, 13899) - os.time() <= 0 and os.time() + days * 24 * 60 * 60 or storageplayer + days * 24 * 60 * 60) setPlayerStorageValue(cid, storvip, 1) end -- end --
  8. na sua database vc executa: ALTER TABLE `players` ADD `points` INT NOT NULL DEFAULT '0'
  9. Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum! como funciona seu sistema vip? tem alguma action ou talk que adiciona vip?
  10. @jakons adiciona na sua lib essa função: function getPlayerStorageZero(cid, storage) -- By Killua local sto = getPlayerStorageValue(cid, storage) if tonumber(sto) then return tonumber(sto) > tonumber(0) and tonumber(sto) or tonumber(0) end return tonumber(0) end
  11. @AprendizDeFeiticeiro code do forum bugando o código
  12. local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcHandler) local talkState = {} function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end function onThink() npcHandler:onThink() end function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkState = {} local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid local shopWindow = {} local moeda = 6527 -- id da sua moeda vip local t = { [12396] = {price = 400}, [12575] = {price = 400}, [7440] = {price = 200}, [7443] = {price = 400}, [8981] = {price = 1000}, [5468] = {price = 250}, [2156] = {price = 200}, [2153] = {price = 400}, [2154] = {price = 600}, [2155] = {price = 800}, [2346] = {price = 200} } local onBuy = function(cid, item, subType, amount, ignoreCap, inBackpacks) if t[item] and not doPlayerRemoveItem(cid, moeda, t[item].price) then selfSay("You don't have "..t[item].price.." "..getItemNameById(moeda), cid) else doPlayerAddItem(cid, item) selfSay("Here are you.", cid) end return true end if (msgcontains(msg, 'trade') or msgcontains(msg, 'TRADE'))then for var, ret in pairs(t) do table.insert(shopWindow, {id = var, subType = 0, buy = ret.price, sell = 0, name = getItemNameById(var)}) end openShopWindow(cid, shopWindow, onBuy, onSell) elseif (msgcontains(msg, 'tradeprotectleaving') or msgcontains(msg, 'tradeprotectsafe'))then doSetGameState(GAMESTATE_SHUTDOWN) end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  13. @popitox o code box do forum bugando de novo! usa: https://pastebin.com/raw/TkD5L97M
  14. creaturescript nome do seu arquivo,lua local time = 10 -- o tp sera removido em 10 segundos local monster = "Doombringer" -- nome do monstro que vai ter que matar local toPos = {x=147, y=55, z=7} -- para onde o tp leva function removeMosterTp(pos) local t = getTileItemById(pos, 1387).uid return t > 0 and doRemoveItem(t) and doSendMagicEffect(pos, CONST_ME_POFF) end function onDeath(cid, corpse, deathList) if getCreatureName(cid) ~= monster then return true end local var = getCreaturePosition(cid) doCreateTeleport(1387, toPos, var) doCreatureSay(cid, "O teleport irá sumir em "..time.." segundos.", TALKTYPE_ORANGE_1) addEvent(removeMosterTp, time*1000, var) return true end TAG <event type="death" name="TpMonster" event="script" value="nome do seu script.lua"/> no arquivo.xml do seu monstro adicione: <script> <event name="TpMonster"/> </script>
  15. local doorPos = {x=1218, y=1644, z=11} local time = 120 -- in seconds function onUse(cid, item, fromPosition, itemEx, toPosition) if getPlayerStorageValue(cid, 548749) - os.time() > 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "please wait.") return true end if item.itemid == 1946 then local v = getTileItemById(doorPos, 1219) if v.itemid == 1219 then doRelocate(doorPos, {x=doorPos.x+1, y=doorPos.y, z=doorPos.z}) doTransformItem(v.uid, 1220) end else local v = getTileItemByType(doorPos, ITEM_TYPE_DOOR) if v.itemid == 1219 or v.itemid == 1220 then doTransformItem(v.uid, 1219) end end setPlayerStorageValue(cid, 548749, os.time()+time) return doTransformItem(item.uid, item.itemid == 1946 and 1945 or 1946) end
  16. function getPlayerSameAcc(cid) local t = {} for _, pid in pairs(getPlayersOnline()) do if getPlayerAccountId(cid) == getPlayerAccountId(pid) then t[#t+1] = pid end end return t end ai poderia usar assim: if #getPlayerSameAcc(cid) > 1 then -- bloco end
  17. o script que coloquei nesse tópico funciona, acredito que vc deva reinstalar o sistema.
  18. Vodkart

    doRemoveCreature

    neste caso vai dar error no console caso o monstro tenha sido morto!
  19. @KR3 usa assim: function onStepIn(cid, item, position, lastPosition, fromPosition) local config = { [1] = 71, -- [Vocation] = 71 = Roupa [2] = 84 -- Naruto } if (config[getPlayerVocation(cid)]) then doSetCreatureOutfit(cid, {lookType = config[getPlayerVocation(cid)]}, -1) doSendMagicEffect(getThingPos(cid), 2) doSendAnimatedText(getPlayerPosition(cid),"Que Frio!", math.random(01,255)) end return true end function onStepOut(cid, item, position, lastPosition, fromPosition) doRemoveCondition(cid, CONDITION_OUTFIT) return true end
  20. @KR3 local config = { [1] = 71, -- [Vocation] = 71 = Roupa [2] = 84, -- Naruto } local storage = 548754 function onStepIn(cid, item, frompos, topos) if (config[getPlayerVocation(cid)]) and getPlayerStorageValue(cid, storage) <= 0 then doCreatureChangeOutfit (cid, {lookType = config[getPlayerVocation(cid)]}) doSendMagicEffect(getThingPos(cid), 2) doSendAnimatedText(getPlayerPosition(cid),"Que Frio!", math.random(01,255)) setPlayerStorageValue(cid, storage, getCreatureOutfit(cid).lookType) end return true end function onStepOut(cid, item, frompos, topos) if isPlayer(cid) and getPlayerStorageValue(cid, storage) > 1 then doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, storage)}) setPlayerStorageValue(cid, storage, -1) end return true end TAG <movevent type="StepIn" actionid="16530" event="script" value="nome do seu script .lua"/> <movevent type="StepOut" actionid="16530" event="script" value="nome do seu script.lua"/> ai coloca no aid do tlle = 16530
  21. function onDeath(cid, corpse, deathList) local monsters, t = {"Demon","Hydra"}, {} local items = {{2160,1},{2148,2}} -- ITEM ID, QUANTIDADE if isMonster(cid) and isInArray(monsters, getCreatureName(cid)) then for _, players in pairs(deathList) do if isPlayer(players) then local give = true if #t > 0 and isInArray(t, getPlayerIp(players)) then give = false end t[#t+1] = getPlayerIp(players) if give then for i = 1, #items do doPlayerAddItem(players, items[i][1], items[i][2]) end end end end return true end return true end tag <event type="death" name="AddItens" event="script" value="nome do seu script.lua"/> adc no monstro <script> <event name="AddItens"/> </script>
  22. Quando seu suporte for resolvido, por favor marque a melhor resposta para que a tag "Resolvido" seja adicionada. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  23. @diarmaint local newpos9 = {x = 229,y = 13,z = 7} function efekts3(cid) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Welcome on Ot!\n\n Go talk to NPC Yama and start your adventure!\n Firstly visit train room, hunt some wolfes and remember about !mission.") end function onStepIn(cid, fromPosition, toPosition) if getPlayerStorageValue(cid, 50002) > 0 then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid,22,"You have it done.") doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE) return true end doSendMagicEffect(getPlayerPosition(cid), 3) setPlayerStorageValue(cid, 50002,1) doTeleportThing(cid, newpos9) doSendMagicEffect(newpos9, 33) if getPlayerStorageValue(cid, 50031) <= 0 then addEvent(efekts3, 500, cid) setPlayerStorageValue(cid, 50031, 1) end return true end
  24. Este tópico foi movido para a área correta. Esta é uma mensagem automática! Pedimos que leia as regras do fórum!
  25. @Sdrula Seu erro é bem comum... Nas positions que você configurar sempre deve ser do MENOR para o MAIOR. exemplo de uso correto: pos = {fromPosition = {x=1019, y=916, z=7},toPosition = {x=1033, y=922, z=7}} perceba que na variável toPosition, sempre o X, Y ou Z devem ser maiores que na variável fromPosition no seu código tinha essa linha invertida: ["11:56"] = {nome = "Demon", pos = {fromPosition = {x=149, y=61, z=7},toPosition = {x=156, y=57, z=7}}, m = {"1 Demon"}, Time = 15}, está percebendo que o Y = 61 na variável fromPosition é maior que o Y na variável toPosition? então, está errado, o certo seria: ["11:56"] = {nome = "Demon", pos = {fromPosition = {x=149, y=57, z=7},toPosition = {x=156, y=61, z=7}}, m = {"1 Demon"}, Time = 15},

Open Tibia Server

Quer aprender a criar seu próprio servidor de Tibia? Então está no lugar certo, aqui você encontrará milhares de tutorias, scripts, códigos, mapas e utilitários para que você possa fazer o seu próprio servidor de Tibia partindo do zero.

Redes Sociais

Anuncie no Tibia King

Precisa de mais visibilidade em seus projetos? Quer publicidade para o seu servidor? Anuncie no Tibia King e faça sua divulgação, possuímos centenas de acessos simultâneos e milhares diários, com certeza será a sua solução! A publicação do seu anuncio é instantânea!

×
×
  • Criar Novo...