Ir para conteúdo

maleskinho

Membro
  • Registro em

  • Última visita

  1. Olá pessoal estou tendo problemas que quando cria a guild o sistema não adiciona o rank_id no personagem assim não registrando a guild no personagem. No Geisor carrega normal tudo no site, só não está indo o ran_id na database personagem. Se precisar de mais algum arquivo só me informar. Base otx2, vi que tem o membership e na distro não tem esa função pode ser isso? Guild.php
  2. Marlonnn reagiu a uma resposta no tópico: Erro Ao Criar Guild No Site Com Player ON
  3. Queria adicionar serial nos items do shop, vi que tem uns aqui mas nenhum com outfits o script é totalmente diferente. Meu script shop.lua global events local SHOP_MSG_TYPE = MESSAGE_EVENT_ORANGE local SQL_interval = 30 --- ### Outfits List ### local femaleOutfits = { ["citizen"]={136}, ["hunter"]={137}, ["mage"]={138}, ["knight"]={139}, ["noblewoman"]={140}, ["summoner"]={141}, ["warrior"]={142}, ["barbarian"]={147}, ["druid"]={148}, ["wizard"]={149}, ["oriental"]={150}, ["pirate"]={155}, ["assassin"]={156}, ["beggar"]={157}, ["shaman"]={158}, ["norsewoman"]={252}, ["nightmare"]={269}, ["jester"]={270}, ["brotherhood"]={279}, ["demonhunter"]={288}, ["yalaharian"]={324}, ["warmaster"]={336}, ["wayfarer"]={366}, ["afflicted"]={431}, ["elementalist"]={433}, ["deepling"]={464}, ["insectoid"]={466}, ["red baron"]={471}, ["crystal warlord"]={513}, ["soil guardian"]={514}, ["demon"]={542} } local maleOutfits = { ["citizen"]={128}, ["hunter"]={129}, ["mage"]={130}, ["knight"]={131}, ["noblewoman"]={132}, ["summoner"]={133}, ["warrior"]={134}, ["barbarian"]={143}, ["druid"]={144}, ["wizard"]={145}, ["oriental"]={146}, ["pirate"]={151}, ["assassin"]={152}, ["beggar"]={153}, ["shaman"]={154}, ["norsewoman"]={251}, ["nightmare"]={268}, ["jester"]={273}, ["brotherhood"]={278}, ["demonhunter"]={289}, ["yalaharian"]={325}, ["warmaster"]={335}, ["wayfarer"]={367}, ["afflicted"]={430}, ["elementalist"]={432}, ["deepling"]={463}, ["insectoid"]={465}, ["red baron"]={472}, ["crystal warlord"]={512}, ["soil guardian"]={516}, ["demon"]={541} } function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) local action = tostring(result_plr:getDataString("action")) local delete = tonumber(result_plr:getDataInt("delete_it")) local cid = getPlayerByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local outfit_name = string.lower(tostring(result_plr:getDataString("param3"))) local itemvip = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local points = tonumber(result_plr:getDataInt("param7")) local received_item = 0 local full_weight = 0 if(action == 'give_item') then full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if(add_item_type == 'itemcontainer') then full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = full_weight + getItemWeightById(itemtogive_id, 1) else full_weight = full_weight + getItemWeightById(outfit_name, itemvip) end end if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end local free_cap = getPlayerFreeCap(cid) local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) if(add_item_type == 'itemcontainer') then doAddContainerItem(new_item, outfit_name,itemvip) end if full_weight <= free_cap then received_item = doPlayerAddItemEx(cid, new_item) if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << RELOGUE PARA SALVAR URGENTE.') db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.query("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if(action == 'give_outfit') then if outfit_name ~= "" and maleOutfits[outfit_name] and femaleOutfits[outfit_name] then local add_outfit = getPlayerSex(cid) == 0 and femaleOutfits[outfit_name][1] or maleOutfits[outfit_name][1] if not canPlayerWearOutfit(cid, add_outfit, 3) then db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) doPlayerAddOutfit(cid, add_outfit, 3) doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, "You received the outfit " .. add_item_name .. " of our Shop Online.") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, "You already have this outfit. Your points were returned, thank you.") db.query("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.query("UPDATE `accounts` SET `premium_points` = `premium_points` + " .. points .. " WHERE `id` = " .. getPlayerAccountId(cid) .. ";") end end end end if not(result_plr:next()) then break end end result_plr:free() end return true end
  4. Qual das linhas eu altero pra mudar o dano da UE? setAttackFormula sei que é nessa linha só queria saber a ordem, no meu servidor os attack estão altos. local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_TYPE, COMBAT_FIREDAMAGE) setCombatParam(combat, COMBAT_PARAM_EFFECT, CONST_ME_FIREAREA) setAttackFormula(combat, COMBAT_FORMULA_LEVELMAGIC, 5, 5, 7, 14) local area = createCombatArea(AREA_CROSS5X5) setCombatArea(combat, area) function onCastSpell(cid, var) if(getPlayerStorageValue(cid, 18775) == 1 or getPlayerStorageValue(cid, 18775) == 2) then doPlayerSendCancel(cid, "You are in a war zone that does not allow this spell.") return false end return doCombat(cid, combat, var) end
  5. É possível fazer um script se o player do mesmo ip tiver x storage não ter acesso para passa na porta? Por que usei um script anti-mc por ip, mas os cara exit e consegue passa com outro MC.. local questArea = {from = {x = 31556, y = 32643, z = 8}, to = {x =32248, y = 31868, z = 8}} -- area do evento... local levelAccess = 180 local function isMC(uid) for _, pid in ipairs(getPlayersOnline()) do if uid ~= pid and getPlayerIp(uid) == getPlayerIp(pid) and getPlayerStorageValue(pid, 484950) > 0 then return true end end return false end function onUse(cid, item, fromPosition, itemEx, toPosition) local cidPosition = getCreaturePosition(cid) if getPlayerLevel(cid) >= levelAccess then if isMC(cid) then doPlayerSendCancel(cid, "É proibido a entrada de MCs nesta Quest.") else if cidPosition.x < toPosition.x then doTeleportThing(cid, {x=toPosition.x+1,y=toPosition.y,z=toPosition.z}, TRUE) else doTeleportThing(cid, {x=toPosition.x-1,y=toPosition.y,z=toPosition.z}, TRUE) setPlayerStorageValue(cid, 484950, 0) doCreatureSay(cid, "Welcome to Quest!!", TALKTYPE_ORANGE_1) setPlayerStorageValue(cid, 484950, 1) end end return true else doPlayerSendCancel(cid, "Seu level é menor que " .. levelAccess .. ".") end return true end
  6. maleskinho postou uma resposta no tópico em Suporte Tibia OTServer
    Quando clico na porta diz " Não é permitido a entrada de chars com o level menor de 180 neste evento!" mas o player fica no meio da porta e assim mesmo consegue acesso a quest. Como eu faço pra não ficar no meio da porta? local eventArea = {from = {x = 402, y = 3, z = 7}, to = {x = 493, y = 121, z = 7}} -- area do evento... local levelAccess = 180 function onUse(cid, item, fromPosition, itemEx, toPosition) for _, pid in pairs(getPlayersOnline()) do if getPlayerLevel(cid) >= levelAccess then if(cid ~= pid and getPlayerIp(cid) == getPlayerIp(pid) and isInRange(getThingPos(pid), eventArea.from, eventArea.to)) then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, 25, "[ANTI-MC] \n \n Não é permitido a entrada de 2 chars com o mesmo IP neste evento!") return true end else doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, 25, "Não é permitido a entrada de chars com o level menor de " .. levelAccess .. " neste evento!") return true end end return true end
  7. Obrigado já salvou, reputado.
  8. Preciso de um script para porta lvl 180 sem acesso a MC, é possível? Seria para uma quest.
  9. Quando os 4 players estão no sqm e o primeiro puxa alavanca, joga os players no evento mas não inicia e da o seguinte erro a baixo. Você tem o código disponível? Se tiver publique-o aqui: local aids = { [61520] = 1, [61521] = 2, [61522] = 3, [61523] = 4, [61524] = 5, [61525] = 6, [61526] = 7, [61527] = 8 } local function getPlayersInArea(fromPos, toPos) local players = {} for _, pid in ipairs(getPlayersOnline()) do if isInRange(getPlayerPosition(pid), fromPos, toPos) then table.insert(players, pid) end end return players end function onUse(cid, item, fromPosition, itemEx, toPosition) if tonumber(os.date("%H")) ~= 16 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O horário de bomberman já terminou.") doTeleportThing(cid, getTownTemplePosition(1)) return true end local arenaNumber = aids[item.actionid] if arenaNumber then if bomberman.isArenaFree(arenaNumber) then local arena = bomberman.arenas[arenaNumber] local players = getPlayersInArea(arena.fromPosLeaver, arena.toPosLeaver) if players then if #players == 4 then local corner, ips = 1, {} for _, pid in next, players do local ip = getPlayerIp(pid) if bomberman.ips[ip] then if bomberman.ips[ip] >= os.time() then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "O IP de "..getCreatureName(pid).." já foi usado para jogar nos últimos 5 minutos. Ele deve aguardar "..timeString(bomberman.ips[ip] - os.time()).." para jogar novamente.") doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_ORANGE, "Seu IP já foi usado para jogar nos últimos 5 minutos. Você deve esperar "..timeString(bomberman.ips[ip] - os.time()).." para jogar novamente.") return; end end if isInArray(ips, ip) then return doPlayerSendCancel(cid, "jogadores com o mesmo IP não podem participar juntos.") end table.insert(ips, ip) end for _, pid in next, players do local ip = getPlayerIp(pid) bomberman.ips[ip] = (os.time() + (5*60)) if corner == 1 then doTeleportThing(pid, arena.fromPos) elseif corner == 2 then doTeleportThing(pid, arena.rightTopCorner) elseif corner == 3 then doTeleportThing(pid, arena.toPos) elseif corner == 4 then doTeleportThing(pid, arena.leftBottomCorner) end doCreatureSetStorage(pid, bomberman.oldSpeedStorage, getCreatureSpeed(pid)) doCreatureSetStorage(pid, bomberman.bombLimitStorage, 1) doCreatureSetStorage(pid, bomberman.bombStorage, 1000) doCreatureSetStorage(pid, bomberman.radiusStorage, 1) doCreatureSetStorage(pid, bomberman.inGameStorage, arenaNumber) doRemoveCondition(pid, CONDITION_HASTE) Events:enter(pid, false) doChangeSpeed(pid, 220 - getCreatureSpeed(pid)) doPlayerSendTextMessage(pid, MESSAGE_STATUS_CONSOLE_BLUE, "Você entrou no bomberman, use !bomb para colocar bombas e boa sorte!") corner = corner + 1 end setGlobalStorageValue(arena.storage, 1) -- Adicionar as pedras explodíveis local currentPosition local create = true local unavailables = {{x = arena.fromPos.x, y = arena.fromPos.y}, {x = arena.rightTopCorner.x, y = arena.rightTopCorner.y}, {x = arena.leftBottomCorner.x, y = arena.leftBottomCorner.y}, {x = arena.toPos.x, y = arena.toPos.y}, {x = arena.fromPos.x + 1, y = arena.fromPos.y}, {x = arena.fromPos.x, y = arena.fromPos.y + 1}, {x = arena.rightTopCorner.x - 1, y = arena.rightTopCorner.y}, {x = arena.rightTopCorner.x, y = arena.rightTopCorner.y + 1}, {x = arena.toPos.x - 1, y = arena.toPos.y}, {x = arena.toPos.x, y = arena.toPos.y - 1}, {x = arena.leftBottomCorner.x + 1, y = arena.leftBottomCorner.y}, {x = arena.leftBottomCorner.x, y = arena.leftBottomCorner.y - 1}} for xx = arena.fromPos.x, arena.toPos.x do for yy = arena.fromPos.y, arena.toPos.y do create = true currentPosition = {x = xx, y = yy, z = arena.fromPos.z} for _, pair in next, unavailables do if pair.x == xx and pair.y == yy then create = false break; end end if create then local block = getTileItemById(currentPosition, bomberman.blockId) if block and block.uid and block.uid > 0 then create = false end if create then local stone = getTileItemById(currentPosition, bomberman.stoneId) if stone and stone.uid and stone.uid > 0 then create = false end if create then if math.random(100) < 70 then doCreateItem(bomberman.stoneId, 1, currentPosition) end end end end end end -- Pedras adicionadas else doPlayerSendCancel(cid, "São necessários 4 jogadores para iniciar o bomberman.") end else doPlayerSendCancel(cid, "São necessários 4 jogadores para iniciar o bomberman.") end else doPlayerSendCancel(cid, "Esta arena de bomberman já está ocupada. Aguarde até que o jogo termine.") end end return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.
  10. maleskinho postou uma resposta no tópico em Suporte Tibia OTServer
    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 local shopModule = ShopModule:new() npcHandler:addModule(shopModule) shopModule:addBuyableItem({'spellbook'}, 2175, 150, 1, 'spellbook') shopModule:addBuyableItem({'magic lightwand'}, 2163, 400, 1, 'magic lightwand') shopModule:addBuyableItem({'small health'}, 8704, 20, 1, 'small health potion') shopModule:addBuyableItem({'health potion'}, 7618, 45, 1, 'health potion') shopModule:addBuyableItem({'mana potion'}, 7620, 50, 1, 'mana potion') shopModule:addBuyableItem({'strong health'}, 7588, 100, 1, 'strong health potion') shopModule:addBuyableItem({'strong mana'}, 7589, 80, 1, 'strong mana potion') shopModule:addBuyableItem({'great health'}, 7591, 190, 1, 'great health potion') shopModule:addBuyableItem({'great mana'}, 7590, 80, 1, 'great mana potion') shopModule:addBuyableItem({'great spirit'}, 8472, 190, 1, 'great spirit potion') shopModule:addBuyableItem({'ultimate health'}, 8473, 310, 1, 'ultimate health potion') shopModule:addSellableItem({'normal potion flask', 'normal flask'}, 7636, 5, 'empty small potion flask') shopModule:addSellableItem({'strong potion flask', 'strong flask'}, 7634, 10, 'empty strong potion flask') shopModule:addSellableItem({'great potion flask', 'great flask'}, 7635, 15, 'empty great potion flask') shopModule:addBuyableItem({'fire bomb'}, 2305, 55, 1, 'fire bomb') shopModule:addBuyableItem({'destroy field'}, 2261, 5, 1, 'destroy field rune') shopModule:addBuyableItem({'light magic missile'}, 2287, 1, 1, 'light magic missile rune') shopModule:addBuyableItem({'heavy magic missile'}, 2311, 2, 1, 'heavy magic missile rune') shopModule:addBuyableItem({'great fireball'}, 2304, 10, 1, 'great fireball rune') shopModule:addBuyableItem({'explosion'}, 2313, 5, 1, 'explosion rune') shopModule:addBuyableItem({'sudden death'}, 2268, 60, 1, 'sudden death rune') shopModule:addBuyableItem({'convince creature'}, 2290, 80, 1, 'convince creature rune') shopModule:addBuyableItem({'holy judgment'}, 2300, 120, 1, 'holy judgment rune') shopModule:addBuyableItem({'chameleon'}, 2291, 210, 1, 'chameleon rune') shopModule:addBuyableItem({'desintegrate'}, 2310, 30, 1, 'desintegreate rune') shopModule:addBuyableItem({'fire field'}, 2301, 10, 1, 'fire field rune') shopModule:addBuyableItem({'energy field'}, 2277, 10, 1, 'energy field rune') shopModule:addBuyableItem({'avalanche rune'}, 2274, 12, 1, 'avalanche rune') shopModule:addBuyableItem({'antidote rune'}, 2266, 65, 1, 'antidote rune') shopModule:addBuyableItem({'energy wall'}, 2279, 32, 1, 'energy wall rune') shopModule:addBuyableItem({'icicle'}, 2271, 8, 1, 'icicle rune') shopModule:addBuyableItem({'poison field'}, 2285, 7, 1, 'poison field rune') shopModule:addBuyableItem({'poison wall'}, 2289, 12, 1, 'poison wall rune') shopModule:addBuyableItem({'blank'}, 2260, 10, 1, 'blank rune') shopModule:addBuyableItem({'fire ball'}, 2302, 5, 1, 'fire ball rune') shopModule:addBuyableItem({'thunderstorm rune'}, 2315, 55, 1, 'thunderstorm rune') shopModule:addBuyableItem({'stone shower rune'}, 2288, 55, 1, 'stone shower rune') shopModule:addBuyableItem({'magic wall'}, 2293, 200, 1, 'magic wall rune') shopModule:addBuyableItem({'paralyze'}, 2278, 400, 1, 'paralyze rune') shopModule:addBuyableItem({'animate dead'}, 2316, 375, 1, 'animate dead rune') shopModule:addBuyableItem({'ultimate healing'}, 2273, 60, 1, 'ultimate healing rune') shopModule:addBuyableItem({'chameleon'}, 2291, 210, 1, 'chameleon rune') shopModule:addBuyableItem({'wild growth'}, 2269, 350, 1, 'wild growth rune') shopModule:addBuyableItem({'wand of vortex', 'vortex'}, 2190, 500, 'wand of vortex') shopModule:addBuyableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 1000, 'wand of dragonbreath') shopModule:addBuyableItem({'wand of decay', 'decay'}, 2188, 5000, 'wand of decay') shopModule:addBuyableItem({'wand of draconia', 'draconia'}, 8921, 7500, 'wand of draconia') shopModule:addBuyableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 10000, 'wand of cosmic energy') shopModule:addBuyableItem({'wand of inferno', 'inferno'}, 2187, 15000, 'wand of inferno') shopModule:addBuyableItem({'wand of starstorm', 'starstorm'}, 8920, 18000, 'wand of starstorm') shopModule:addBuyableItem({'wand of voodoo', 'voodoo'}, 8922, 22000, 'wand of voodoo') shopModule:addBuyableItem({'snakebite rod', 'snakebite'}, 2182, 500, 'snakebite rod') shopModule:addBuyableItem({'moonlight rod', 'moonlight'}, 2186, 1000, 'moonlight rod') shopModule:addBuyableItem({'necrotic rod', 'necrotic'}, 2185, 5000, 'necrotic rod') shopModule:addBuyableItem({'northwind rod', 'northwind'}, 8911, 7500, 'northwind rod') shopModule:addBuyableItem({'terra rod', 'terra'}, 2181, 10000, 'terra rod') shopModule:addBuyableItem({'hailstorm rod', 'hailstorm'}, 2183, 15000, 'hailstorm rod') shopModule:addBuyableItem({'springsprout rod', 'springsprout'}, 8912, 18000, 'springsprout rod') shopModule:addBuyableItem({'underworld rod', 'underworld'}, 8910, 22000, 'underworld rod') shopModule:addSellableItem({'wand of vortex', 'vortex'}, 2190, 100, 'wand of vortex') shopModule:addSellableItem({'wand of dragonbreath', 'dragonbreath'}, 2191, 200, 'wand of dragonbreath') shopModule:addSellableItem({'wand of decay', 'decay'}, 2188, 1000, 'wand of decay') shopModule:addSellableItem({'wand of draconia', 'draconia'}, 8921, 1500, 'wand of draconia') shopModule:addSellableItem({'wand of cosmic energy', 'cosmic energy'}, 2189, 2000, 'wand of cosmic energy') shopModule:addSellableItem({'wand of inferno', 'inferno'}, 2187, 3000, 'wand of inferno') shopModule:addSellableItem({'wand of starstorm', 'starstorm'}, 8920, 3600, 'wand of starstorm') shopModule:addSellableItem({'wand of voodoo', 'voodoo'}, 8922, 4400, 'wand of voodoo') shopModule:addSellableItem({'snakebite rod', 'snakebite'}, 2182, 100, 'snakebite rod') shopModule:addSellableItem({'moonlight rod', 'moonlight'}, 2186, 200, 'moonlight rod') shopModule:addSellableItem({'necrotic rod', 'necrotic'}, 2185, 1000, 'necrotic rod') shopModule:addSellableItem({'northwind rod', 'northwind'}, 8911, 1500, 'northwind rod') shopModule:addSellableItem({'terra rod', 'terra'}, 2181, 2000, 'terra rod') shopModule:addSellableItem({'hailstorm rod', 'hailstorm'}, 2183, 3000, 'hailstorm rod') shopModule:addSellableItem({'springsprout rod', 'springsprout'}, 8912, 3600, 'springsprout rod') shopModule:addSellableItem({'underworld rod', 'underworld'}, 8910, 4400, 'underworld rod') function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid local items = {[1] = 2190, [2] = 2182, [5] = 2190, [6] = 2182} if(msgcontains(msg, 'first rod') or msgcontains(msg, 'first wand')) then if(isSorcerer(cid) or isDruid(cid)) then if(getPlayerStorageValue(cid, 30002) == -1) then selfSay('So you ask me for a {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '} to begin your advanture?', cid) talkState[talkUser] = 1 else selfSay('What? I have already gave you one {' .. getItemNameById(items[getPlayerVocation(cid)]) .. '}!', cid) end else selfSay('Sorry, you aren\'t a druid either a sorcerer.', cid) end elseif(msgcontains(msg, 'yes')) then if(talkState[talkUser] == 1) then doPlayerAddItem(cid, items[getPlayerVocation(cid)], 1) selfSay('Here you are young adept, take care yourself.', cid) setPlayerStorageValue(cid, 30002, 1) end talkState[talkUser] = 0 elseif(msgcontains(msg, 'no') and isInArray({1}, talkState[talkUser]) == TRUE) then selfSay('Ok then.', cid) talkState[talkUser] = 0 end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
  11. maleskinho postou uma resposta no tópico em Suporte Tibia OTServer
    Estou com um pequeno problema, quando o player compra items no npc de potions ele joga o dinheiro no chão, como eu faço pra resolver isso?
  12. Está bugado desse jeito ai todos ganham quem está online.
  13. Queria adicionar nova linha para uma outra moeda alem da Crystal coins, tentei aqui mas estava enviado para todos online. Script abaixo está normal tirei oque mexi.. só quero adicionar Special Coin ID 12672 uma unidade. w local config = { lottery_hour = "2 hours", -- Tempo ate a proxima loteria (Esse tempo vai aparecer somente como broadcast message) rewards_id = {2494, 2472, 2514, 2160}, -- ID dos Itens Sorteados na Loteria crystal_counts = 10, -- Usado somente se a rewards_id for crystal coin (ID: 2160). website = "yes", -- Only if you have php scripts and table `lottery` in your database! days = { "Monday-08:00", "Monday-13:00", "Monday-19:30", "Tuesday-08:00", "Tuesday-13:00", "Tuesday-19:30", "Wednesday-08:00", "Wednesday-13:00", "Wednesday-19:30", "Thursday-08:00", "Thursday-13:00", "Thursday-19:30", "Friday-01:22", "Friday-13:00", "Friday-19:30", "Saturday-21:27", "Saturday-21:28", "Saturday-21:29", "Sunday-08:00", "Sunday-13:00", "Sunday-19:30" } } local function getPlayerWorldId(cid) if not(isPlayer(cid)) then return false end local pid = getPlayerGUID(cid) local worldPlayer = 0 local result_plr = db.getResult("SELECT * FROM `players` WHERE `id` = "..pid..";") if(result_plr:getID() ~= -1) then worldPlayer = tonumber(result_plr:getDataInt("world_id")) result_plr:free() return worldPlayer end return false end local function getOnlineParticipants() local players = {} for _, pid in pairs(getPlayersOnline()) do if getPlayerAccess(pid) <= 2 and getPlayerStorageValue(pid, 281821) <= os.time() then table.insert(players, pid) end end if #players > 0 then return players end return false end function onThink(cid, interval) if table.find(config.days, os.date("%A-%H:%M")) then if(getWorldCreatures(o) <= 0)then return true end local query = db.query or db.executeQuery local random_item = config.rewards_id[math.random(1, #config.rewards_id)] local item_name = getItemNameById(random_item) local data = os.date("%d/%m/%Y - %H:%M:%S") local online = getOnlineParticipants() if online then local winner = online[math.random(1, #online)] local world = tonumber(getPlayerWorldId(winner)) if(random_item == 2160) then doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24) doPlayerAddItem(winner, random_item, config.crystal_counts) doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " .. config.crystal_counts .." " .. getItemNameById(random_item) .. "s! Congratulations! (Next lottery in " .. config.lottery_hour .. ")") else doPlayerSetStorageValue(winner, 281821, os.time() + 3600 * 24) doBroadcastMessage("[LOTTERY SYSTEM] Winner: " .. getCreatureName(winner) .. ", Reward: " ..getItemNameById(random_item) .. "! Congratulations! (Next lottery in " .. config.lottery_hour .. ")") doPlayerAddItem(winner, random_item, 1) end if(config.website == "yes") then query("INSERT INTO `lottery` (`name`, `item`, `world_id`, `item_name`, `date`) VALUES ('".. getCreatureName(winner).."', '".. random_item .."', '".. world .."', '".. item_name .."', '".. data .."');") end else print("Ninguem OnLine pra ganhar na loteria") end end return true end Você tem alguma imagem que possa auxiliar no problema? Se sim, coloque-a aqui.

Informação Importante

Confirmação de Termo