Tudo que L3K0T postou
-
(Resolvido)Exausted em todas talkactions
-- Sistema de auto loot criado por V�tor Bertolucci - Killua function ExistItemByName(name) -- by vodka local items = io.open("data/items/items.xml", "r"):read("*all") local get = items:match('name="' .. name ..'"') if get == nil or get == "" then return false end return true end local function getPlayerList(cid) local tab = {} if getPlayerStorageValue(cid, 04420021) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420021)) end if getPlayerStorageValue(cid, 04420031) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420031)) end if getPlayerStorageValue(cid, 04420041) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420041)) end if getPlayerStorageValue(cid, 04420051) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420051)) end if #tab > 0 then return tab end return false end local function addToList(cid, name) local itemid = getItemIdByName(name) if getPlayerList(cid) and isInArray(getPlayerList(cid), itemid) then return false end if getPlayerStorageValue(cid, 04420021) == -1 then return doPlayerSetStorageValue(cid, 04420021, itemid) elseif getPlayerStorageValue(cid, 04420031) == -1 then return doPlayerSetStorageValue(cid, 04420031, itemid) elseif getPlayerStorageValue(cid, 04420041) == -1 then return doPlayerSetStorageValue(cid, 04420041, itemid) elseif getPlayerStorageValue(cid, 04420051) == -1 then return doPlayerSetStorageValue(cid, 04420051, itemid) end end local function removeFromList(cid, name) local itemid = getItemIdByName(name) if getPlayerStorageValue(cid, 04420021) == itemid then return doPlayerSetStorageValue(cid, 04420021, -1) elseif getPlayerStorageValue(cid, 04420031) == itemid then return doPlayerSetStorageValue(cid, 04420031, -1) elseif getPlayerStorageValue(cid, 04420041) == itemid then return doPlayerSetStorageValue(cid, 04420041, -1) elseif getPlayerStorageValue(cid, 04420051) == itemid then return doPlayerSetStorageValue(cid, 04420051, -1) end return false end local config = { storage = 22566, exhaust = 5 } function onSay(cid, words, param) if getCreatureStorage(cid, config.storage) > os.time() then doPlayerSendCancel(cid, "Aguarde " .. (config.exhaust) .. " segundos.") return true end if param == "" then local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420021)) or "" local se = getPlayerStorageValue(cid, 04420031) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420031)) or "" local th = getPlayerStorageValue(cid, 04420041) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420041)) or "" local fo = getPlayerStorageValue(cid, 04420051) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420051)) or "" local stt = getPlayerStorageValue(cid, 04421011) == 1 and "sim" or "nao" local str = getPlayerStorageValue(cid, 04421001) == 1 and "sim" or "nao" doPlayerPopupFYI(cid, "<--- Informacoes Do Auto Loot --->\n\n--Configurando o AutoLoot--\n\n1- Coletar Dinheiro: !autoloot gold\n2- Ligar coleta de items: !autoloot power\n3- Para adicionar um novo item no autoloot, digite: !autoloot add, nome do item\n4- Para retirar um item do autoloot, digite: !autoloot remove, nome do item\n5- Para limpar todos os slots, digite: !autoloot clear\n6- Para informacoes de quanto voce ja fez utilizando a coleta de dinheiro, use: !autoloot goldinfo\n7- Se seu autoloot bugar use !autoloot desbug\n\n\n[Coletar dinheiro] --- Ligado? ("..stt..").\n[Coletar itens] --- Ligado? ("..str..").\n\n----- Configuracao Dos Slots -----\n[AUTO-LOOT] ---Slot 1: "..fi.."\n[AUTO-LOOT] ---Slot 2: "..se.."\n[AUTO-LOOT] ---Slot 3: "..th.."\n[AUTO-LOOT] ---Slot 4: "..fo.."\n\n\n\n\nWars-Baiak\nwww.war-baiak.com") return true end local t = string.explode(param, ",") if t[1] == "power" then local check = getPlayerStorageValue(cid, 04421001) == -1 and "ligou" or "desligou" doPlayerSetStorageValue(cid, 04421001, getPlayerStorageValue(cid, 04421001) == -1 and 1 or -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce "..check.." o auto loot.") elseif t[1] == "gold" then local check = getPlayerStorageValue(cid, 04421011) == -1 and "ligou" or "desligou" doPlayerSetStorageValue(cid, 04421011, getPlayerStorageValue(cid, 04421011) == -1 and 1 or -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce "..check.." a coleta de dinheiro.") doPlayerSetStorageValue(cid, 04421021, 0) elseif t[1] == "goldinfo" then local str = getPlayerStorageValue(cid, 04421011) == -1 and "O sistema de coleta de dinheiro esta desligado" or "O sistema ja coletou "..getPlayerStorageZero(cid, 04421021).." gold coins" doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str) elseif t[1] == "add" then if ExistItemByName(t[2]) then local item = getItemIdByName(t[2]) if isInArray({2160, 2148, 2152}, item) then return doPlayerSendCancel(cid, "Voce nao pode adicionar moedas no autoloot. Para coletar dinheiro use !autoloot gold") end if isPremium(cid) then if getPlayerStorageValue(cid, 04420011) < 3 then if addToList(cid, t[2]) then doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado a sua lista do auto loot! Para ver sua lista diga !autoloot list") else doPlayerSendCancel(cid, t[2].." ja esta em sua lista!") end else doPlayerSendCancel(cid, "Sua lista ja tem 4 itens! Voce deve remover algum antes de adicionar outro.") end else if getPlayerStorageValue(cid, 04420011) < 1 then if addToList(cid, t[2]) then doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado a sua lista do auto loot! Para ver sua lista diga !autoloot") else doPlayerSendCancel(cid, t[2].." ja esta em sua lista!") end else doPlayerSendCancel(cid, "Voce ja tem um item adicionado no auto loot! Para adicionar outro, voce deve remover o item atual.") end end else doPlayerSendCancel(cid, "Este item nao existe!") end elseif t[1] == "remove" then if ExistItemByName(t[2]) then if removeFromList(cid, t[2]) then doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) - 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." removido da sua lista do auto loot!") else doPlayerSendCancel(cid, "Este item nao esta na sua lista!") end else doPlayerSendCancel(cid, "Este item nao existe!") end elseif t[1] == "clear" then if getPlayerStorageValue(cid, 04420011) > -1 then doPlayerSetStorageValue(cid, 04420011, -1) doPlayerSetStorageValue(cid, 04420021, -1) doPlayerSetStorageValue(cid, 04420031, -1) doPlayerSetStorageValue(cid, 04420041, -1) doPlayerSetStorageValue(cid, 04420051, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Lista limpa!") else doPlayerSendCancel(cid, "Sua lista ja esta limpa!") end elseif t[1] == "desbug" or t[1] == "desbugar" then doPlayerSetStorageValue(cid, 04420011, -1) doPlayerSetStorageValue(cid, 04420021, -1) doPlayerSetStorageValue(cid, 04420031, -1) doPlayerSetStorageValue(cid, 04420041, -1) doPlayerSetStorageValue(cid, 04420051, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Desbugado!") elseif t[1] == "list" then local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420021)).."\n" or "" local se = getPlayerStorageValue(cid, 04420031) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420031)).."\n" or "" local th = getPlayerStorageValue(cid, 04420041) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420041)).."\n" or "" local fo = getPlayerStorageValue(cid, 04420051) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420051)).."\n" or "" doPlayerPopupFYI(cid, "O sistema auto loot esta coletando:\n "..fi..""..se..""..th..""..fo) end doPlayerSetStorageValue(cid, config.storage, os.time() + config.exhaust) return true end
-
(Resolvido)Exausted em todas talkactions
-- Sistema de auto loot criado por V�tor Bertolucci - Killua function ExistItemByName(name) -- by vodka local items = io.open("data/items/items.xml", "r"):read("*all") local get = items:match('name="' .. name ..'"') if get == nil or get == "" then return false end return true end local function getPlayerList(cid) local tab = {} if getPlayerStorageValue(cid, 04420021) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420021)) end if getPlayerStorageValue(cid, 04420031) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420031)) end if getPlayerStorageValue(cid, 04420041) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420041)) end if getPlayerStorageValue(cid, 04420051) ~= -1 then table.insert(tab, getPlayerStorageValue(cid, 04420051)) end if #tab > 0 then return tab end return false end local function addToList(cid, name) local itemid = getItemIdByName(name) if getPlayerList(cid) and isInArray(getPlayerList(cid), itemid) then return false end if getPlayerStorageValue(cid, 04420021) == -1 then return doPlayerSetStorageValue(cid, 04420021, itemid) elseif getPlayerStorageValue(cid, 04420031) == -1 then return doPlayerSetStorageValue(cid, 04420031, itemid) elseif getPlayerStorageValue(cid, 04420041) == -1 then return doPlayerSetStorageValue(cid, 04420041, itemid) elseif getPlayerStorageValue(cid, 04420051) == -1 then return doPlayerSetStorageValue(cid, 04420051, itemid) end end local function removeFromList(cid, name) local itemid = getItemIdByName(name) if getPlayerStorageValue(cid, 04420021) == itemid then return doPlayerSetStorageValue(cid, 04420021, -1) elseif getPlayerStorageValue(cid, 04420031) == itemid then return doPlayerSetStorageValue(cid, 04420031, -1) elseif getPlayerStorageValue(cid, 04420041) == itemid then return doPlayerSetStorageValue(cid, 04420041, -1) elseif getPlayerStorageValue(cid, 04420051) == itemid then return doPlayerSetStorageValue(cid, 04420051, -1) end return false end local config = { storage = 22566, exhaust = 2*60 } function onSay(cid, words, param) if getCreatureStorage(cid, config.storage) > os.time() then doPlayerSendCancel(cid, "Aguarde " .. (config.exhaust / 60) .. " minutos.") return true end if param == "" then local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420021)) or "" local se = getPlayerStorageValue(cid, 04420031) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420031)) or "" local th = getPlayerStorageValue(cid, 04420041) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420041)) or "" local fo = getPlayerStorageValue(cid, 04420051) ~= -1 and getItemNameById(getPlayerStorageValue(cid, 04420051)) or "" local stt = getPlayerStorageValue(cid, 04421011) == 1 and "sim" or "nao" local str = getPlayerStorageValue(cid, 04421001) == 1 and "sim" or "nao" doPlayerPopupFYI(cid, "<--- Informacoes Do Auto Loot --->\n\n--Configurando o AutoLoot--\n\n1- Coletar Dinheiro: !autoloot gold\n2- Ligar coleta de items: !autoloot power\n3- Para adicionar um novo item no autoloot, digite: !autoloot add, nome do item\n4- Para retirar um item do autoloot, digite: !autoloot remove, nome do item\n5- Para limpar todos os slots, digite: !autoloot clear\n6- Para informacoes de quanto voce ja fez utilizando a coleta de dinheiro, use: !autoloot goldinfo\n7- Se seu autoloot bugar use !autoloot desbug\n\n\n[Coletar dinheiro] --- Ligado? ("..stt..").\n[Coletar itens] --- Ligado? ("..str..").\n\n----- Configuracao Dos Slots -----\n[AUTO-LOOT] ---Slot 1: "..fi.."\n[AUTO-LOOT] ---Slot 2: "..se.."\n[AUTO-LOOT] ---Slot 3: "..th.."\n[AUTO-LOOT] ---Slot 4: "..fo.."\n\n\n\n\nWars-Baiak\nwww.war-baiak.com") return true end local t = string.explode(param, ",") if t[1] == "power" then local check = getPlayerStorageValue(cid, 04421001) == -1 and "ligou" or "desligou" doPlayerSetStorageValue(cid, 04421001, getPlayerStorageValue(cid, 04421001) == -1 and 1 or -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce "..check.." o auto loot.") elseif t[1] == "gold" then local check = getPlayerStorageValue(cid, 04421011) == -1 and "ligou" or "desligou" doPlayerSetStorageValue(cid, 04421011, getPlayerStorageValue(cid, 04421011) == -1 and 1 or -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Voce "..check.." a coleta de dinheiro.") doPlayerSetStorageValue(cid, 04421021, 0) elseif t[1] == "goldinfo" then local str = getPlayerStorageValue(cid, 04421011) == -1 and "O sistema de coleta de dinheiro esta desligado" or "O sistema ja coletou "..getPlayerStorageZero(cid, 04421021).." gold coins" doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str) elseif t[1] == "add" then if ExistItemByName(t[2]) then local item = getItemIdByName(t[2]) if isInArray({2160, 2148, 2152}, item) then return doPlayerSendCancel(cid, "Voce nao pode adicionar moedas no autoloot. Para coletar dinheiro use !autoloot gold") end if isPremium(cid) then if getPlayerStorageValue(cid, 04420011) < 3 then if addToList(cid, t[2]) then doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado a sua lista do auto loot! Para ver sua lista diga !autoloot list") else doPlayerSendCancel(cid, t[2].." ja esta em sua lista!") end else doPlayerSendCancel(cid, "Sua lista ja tem 4 itens! Voce deve remover algum antes de adicionar outro.") end else if getPlayerStorageValue(cid, 04420011) < 1 then if addToList(cid, t[2]) then doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) + 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." adicionado a sua lista do auto loot! Para ver sua lista diga !autoloot") else doPlayerSendCancel(cid, t[2].." ja esta em sua lista!") end else doPlayerSendCancel(cid, "Voce ja tem um item adicionado no auto loot! Para adicionar outro, voce deve remover o item atual.") end end else doPlayerSendCancel(cid, "Este item nao existe!") end elseif t[1] == "remove" then if ExistItemByName(t[2]) then if removeFromList(cid, t[2]) then doPlayerSetStorageValue(cid, 04420011, getPlayerStorageValue(cid, 04420011) - 1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, t[2].." removido da sua lista do auto loot!") else doPlayerSendCancel(cid, "Este item nao esta na sua lista!") end else doPlayerSendCancel(cid, "Este item nao existe!") end elseif t[1] == "clear" then if getPlayerStorageValue(cid, 04420011) > -1 then doPlayerSetStorageValue(cid, 04420011, -1) doPlayerSetStorageValue(cid, 04420021, -1) doPlayerSetStorageValue(cid, 04420031, -1) doPlayerSetStorageValue(cid, 04420041, -1) doPlayerSetStorageValue(cid, 04420051, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Lista limpa!") else doPlayerSendCancel(cid, "Sua lista ja esta limpa!") end elseif t[1] == "desbug" or t[1] == "desbugar" then doPlayerSetStorageValue(cid, 04420011, -1) doPlayerSetStorageValue(cid, 04420021, -1) doPlayerSetStorageValue(cid, 04420031, -1) doPlayerSetStorageValue(cid, 04420041, -1) doPlayerSetStorageValue(cid, 04420051, -1) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Desbugado!") elseif t[1] == "list" then local fi = getPlayerStorageValue(cid, 04420021) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420021)).."\n" or "" local se = getPlayerStorageValue(cid, 04420031) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420031)).."\n" or "" local th = getPlayerStorageValue(cid, 04420041) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420041)).."\n" or "" local fo = getPlayerStorageValue(cid, 04420051) ~= -1 and ""..getItemNameById(getPlayerStorageValue(cid, 04420051)).."\n" or "" doPlayerPopupFYI(cid, "O sistema auto loot esta coletando:\n "..fi..""..se..""..th..""..fo) end doPlayerSetStorageValue(cid, config.storage, os.time() + config.exhaust) return true end NÃO TESTEI!
-
UPDATE 3: Moveitem + Antipush + Anti-Crash Elf Bot - Bug Fixes - TFS 0.4 11/04/2024
tem alguma coisa no código que já existe em seu game.cpp, é só remover.
-
Projeto Poketibia ( GBA )
Parabéns cara! Gostei e boa sorte
- Fiz esse site de DBO pra um amigo meu
-
Mysql - Comandos uteis pra seu OTServ
Olá galera, hoje vim trazer para vocês alguns comandos uteis, pra serem executados no seu banco de dados "Mysql" lá aonde guarda todas as informações do jogo. *"execute o comando, mais antes faça o backup da sua Data Base e lembrando faça isso com o servidor desligado" 1° UPDATE `accounts` SET premdays = 0, lastday = 0; - Remove todos os dias VIP ou P.A de todos os players. . UPDATE `accounts` SET premdays = 0, lastday = 0; 2° UPDATE `accounts` SET `premdays` = `premdays` + 7; - Adiciona +7 dias de VIP ou P.A para todos os players. UPDATE `accounts` SET `premdays` = `premdays` + 7; 3° UPDATE `players` SET `posx` = 111, `posy` = 222, `posz` = 7; - Manda todos mundo para certa posição do mapa. UPDATE `players` SET `posx` = 111, `posy` = 222, `posz` = 7; 4° UPDATE `players` SET `blessings` = 0; - Limpa todas as bless de todos os players e se no lugar do 0 você por 31 você adiciona todas as bless; UPDATE `players` SET `blessings` = 0; 5° DELETE FROM `player_deaths`, `killers`, `player_killers`, `environment_killers`; - Limpa todo o histórico de morte dos players. DELETE FROM `player_deaths`, `killers`, `player_killers`, `environment_killers`; 6° DELETE FROM `players` WHERE `level` < 50 AND `lastlogin` < UNIX_TIMESTAMP() - 20 * 24 * 60 * 60 - Deleta players que não loga em 20 dias e que são levels -50 DELETE FROM `players` WHERE `level` < 50 AND `lastlogin` < UNIX_TIMESTAMP() - 20 * 24 * 60 * 60 7° UPDATE `players` SET `world_id` = 0; - altera o mundo de todos os players, que é configurado no config.lua do seu servidor, pode 1, 2, 3 etc.. UPDATE `players` SET `world_id` = 0; 8° UPDATE `players` SET `promotion` = 1; - da promotion da vocação para todos os players quando VIP. UPDATE `players` SET `promotion` = 1; 9° UPDATE `accounts` SET `premiun_points` = `premium_points` +30; - adiciona 30 Premium Points para todos os players. UPDATE `accounts` SET `premiun_points` = `premium_points` +30; é isso galera, durante os meses eu irei atualizar esse tópico, um multissímo obrigado.
-
[AJUDA] DEPOT NÃO FUNCIONA
Alterações pela source do seu servidor em const.h procure ITEM_DEPOT = 2594, ITEM_LOCKER = 2589, os numeros é o ID dos itens, depois só salvar e compilar, espero ter ajudado.
-
[PEDIDO BASE OTP SOURCE & POKEBAR
Este tópico foi movido para a seção de Suporte Otserv Alternativo
-
(Resolvido)Servidor travando sempre que upa level ou skill
pode ser algum save ao upar o level
-
(Resolvido)Shop não entrega itens
tente SHOP_MSG_TYPE = 18 SQL_interval = 30 function onThink(interval, lastExecution) local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication") if(result_plr ~= false) then repeat local id = tonumber(result.getDataInt(result_plr, "id")) local action = tostring(result.getDataString(result_plr, "action")) local delete = tonumber(result.getDataInt(result_plr, "delete_it")) local cid = getPlayerByName(tostring(result.getDataString(result_plr, "name"))) if(cid) then local itemtogive_id = tonumber(result.getDataInt(result_plr, "param1")) local itemtogive_count = tonumber(result.getDataInt(result_plr, "param2")) local container_id = tonumber(result.getDataInt(result_plr, "param3")) local container_count = tonumber(result.getDataInt(result_plr, "param4")) local add_item_type = tostring(result.getDataString(result_plr, "param5")) local add_item_name = tostring(result.getDataString(result_plr, "param6")) local received_item = 0 local full_weight = 0 -- Script para addons e montaria full pelo Gesior -- if(add_item_type == 'mounts') then local player = Player(cid) if (getPlayerStorageValue(cid,itemtogive_id) == -1) then doPlayerAddMount(cid, itemtogive_id) setPlayerStorageValue(cid,itemtogive_id,1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE) doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received '.. add_item_name ..' from the Shop.') db.query("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,25,"You Already have this Mount.") end return TRUE end -- fim do script -- -- Script para addons e montaria full pelo Gesior -- if(add_item_type == 'addons') then local player = Player(cid) if (getPlayerStorageValue(cid,itemtogive_id) == -1) then doPlayerAddOutfit(cid, itemtogive_id, 3) doPlayerAddOutfit(cid, container_id, 3) setPlayerStorageValue(cid,itemtogive_id,1) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYDAMAGE) doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received '.. add_item_name ..' from the Shop.') db.query("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,25,"You Already have this Outfit.") end return TRUE end -- fim do script -- if(add_item_type == 'container') then container_weight = getItemWeight(container_id, 1) if(isItemRune(itemtogive_id)) then items_weight = container_count * getItemWeight(itemtogive_id, 1) else items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeight(itemtogive_id, itemtogive_count) if(isItemRune(itemtogive_id)) then full_weight = getItemWeight(itemtogive_id, 1) else full_weight = getItemWeight(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if(full_weight <= free_cap) then if(add_item_type == 'container') then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while(iter ~= container_count) do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) received_item = doPlayerAddItemEx(cid, new_item) end if(type(received_item) == "number" and received_item == RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received '.. add_item_name ..' from the Shop.') db.query("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 the 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 ..' The 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 until not result.next(result_plr) result.free(result_plr) end return true end
-
(Resolvido)Shop não entrega itens
--[[ Gesior Shop System v2.0 Originally written by Gesior, modified by slawkens for MyAAC. Converted to Revscriptsys by Majesty. change interval 30000 to 30 if other values in this file are low ]]-- local messageType = MESSAGE_EVENT_ORANGE local displayExecutionTime = true -- how time script took in console (true/false) -- don't edit anything below this line if(displayExecutionTime) then function doSecondsFormat(i) local str, found = string.gsub(i, "(%d)(%d%d%d)$", "%1.%2", 1), 0 repeat str, found = string.gsub(str, "(%d)(%d%d%d),", "%1.%2,", 1) until found == 0 return str end end if(not messageType) then messageType = MESSAGE_STATUS_CONSOLE_ORANGE if(not messageType) then messageType = MESSAGE_INFO_DESCR end end if(not getPlayerByName) then function getPlayerByName(name) local p = Player(name) return p ~= nil and p:getId() or false end end if(not isPlayer) then function isPlayer(cid) return Player(cid) ~= nil end end if(not doPlayerSave) then function doPlayerSave(cid) if(Player and type(Player) == "table" and Player.save and type(Player.save) == "function") then local player = Player(cid) if(player) then player:save() end end return true end end function getResults() if(db.storeQuery ~= nil and result.free ~= nil) then -- TFS 1.0+ local resultId = db.storeQuery("SELECT * FROM z_ots_comunication;") if(resultId == false) then return false end local results = {} repeat local tmp = {} tmp.name = result.getDataString(resultId, "name") -- better performance when no player found tmp.exist = false tmp.cid = getPlayerByName(tmp.name) if(tmp.cid and isPlayer(tmp.cid)) then tmp.exist = true tmp.id = result.getDataInt(resultId, "id") tmp.action = result.getDataString(resultId, "action") tmp.delete_it = result.getDataInt(resultId, "delete_it") tmp.param1 = result.getDataInt(resultId, "param1") tmp.param2 = result.getDataInt(resultId, "param2") tmp.param3 = result.getDataInt(resultId, "param3") tmp.param4 = result.getDataInt(resultId, "param4") tmp.param5 = result.getDataString(resultId, "param5") tmp.param6 = result.getDataString(resultId, "param6") end table.insert(results, tmp) until not result.next(resultId) result.free(resultId) return results else -- TFS 0.3 if(db.getResult ~= nil) then local result_plr = db.getResult("SELECT * FROM z_ots_comunication;") if(result_plr:getID() == -1) then return false end local results = {} repeat local tmp = {} tmp.name = tostring(result_plr:getDataString("name")) -- better performance when no player found tmp.exist = false tmp.cid = getPlayerByName(tmp.name) if(tmp.cid and isPlayer(tmp.cid)) then tmp.exist = true tmp.id = tonumber(result_plr:getDataInt("id")) tmp.action = tostring(result_plr:getDataString("action")) tmp.delete_it = tonumber(result_plr:getDataInt("delete_it")) tmp.param1 = tonumber(result_plr:getDataInt("param1")) tmp.param2 = tonumber(result_plr:getDataInt("param2")) tmp.param3 = tonumber(result_plr:getDataInt("param3")) tmp.param4 = tonumber(result_plr:getDataInt("param4")) tmp.param5 = tostring(result_plr:getDataString("param5")) tmp.param6 = tostring(result_plr:getDataString("param6")) end table.insert(results, tmp) until not(result_plr:next()) result_plr:free() return results else print('[ERROR - gesior-shop-system.lua] Your distribution is not supported') end end return false end function doQuery(query) if(db.asyncQuery ~= nil) then db.asyncQuery(query) elseif(db.query ~= nil) then db.query(query) elseif(db.executeQuery ~= nil) then db.executeQuery(query) else return false end return true end if(not getItemWeightById) then getItemWeightById = getItemWeight end if(not doCreateItemEx) then function doCreateItemEx(itemid, count) if(Game and type(Game) == "table" and Game.createItem and type(Game.createItem) == "function") then local item = Game.createItem(itemid, count) if item then return item:getUniqueId() end return false else print("[ERROR - gesior-shop-system] Error code: 1. Please contact slawkens at www.otland.net") end end end local gesiorShopSystem = GlobalEvent("GesiorShopSystem") function gesiorShopSystem.onThink(interval) if(interval > 1000) then interval = interval / 1000 end local started = os.mtime and os.mtime() or os.time() local addedItems, waitingItems = 0, 0 local added = false local results = getResults() if(not results) then return true end for i, v in ipairs(results) do added = false local id = v.id local action = v.action local delete = v.delete_it if(v.exist) then local cid = v.cid local param1, param2, param3, param4 = v.param1, v.param2, v.param3, v.param4 local add_item_type = v.param5 local add_item_name = v.param6 local received_item, full_weight, items_weight, item_weigth = 0, 0, 0, 0 local item_doesnt_exist = false if(add_item_type == 'container' or add_item_type == 'item') then local item_weigth = getItemWeightById(param1, 1) if(type(item_weigth) == 'boolean') then -- item doesn't exist print("[ERROR - gesior-shop-system] Invalid item id: " .. param1 .. ". Change/Fix `itemid1` in `z_shop_offers` then delete it from `z_ots_comunication`") item_doesnt_exist = true else if(add_item_type == 'container') then container_weight = getItemWeightById(param3, 1) if(type(container_weight) == 'boolean') then -- container item doesn't exist print("[ERROR - gesior-shop-system] Invalid container id: " .. param3 .. ". Change/Fix `itemid2` in `z_shop_offers` then delete it from `z_ots_comunication`") item_doesnt_exist = true else if(isItemRune(param1)) then items_weight = param4 * item_weigth else items_weight = param4 * getItemWeightById(param1, param2) end full_weight = items_weight + container_weight end elseif(add_item_type == 'item') then full_weight = getItemWeightById(param1, param2) if(isItemRune(param1)) then full_weight = getItemWeightById(param1, 1) end end end if(not item_doesnt_exist) then local free_cap = getPlayerFreeCap(cid) if(full_weight <= free_cap) then if(add_item_type == 'container') then local new_container = doCreateItemEx(param3, 1) for x = 1, param4 do doAddContainerItem(new_container, param1, param2) end received_item = addItemEx(cid, new_container) else local new_item = doCreateItemEx(param1, param2) received_item = addItemEx(cid, new_item) end if(received_item == RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, messageType, "You received >> ".. add_item_name .." << from OTS shop.") doQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") doQuery("UPDATE `z_shop_history` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE comunication_id = " .. id .. ";") doPlayerSave(cid) added = true else doPlayerSendTextMessage(cid, messageType, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, messageType, '>> '.. 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 '.. interval ..' seconds to get it.') end end elseif(add_item_type == 'addon') then doPlayerSendTextMessage(cid, messageType, "You received >> ".. add_item_name .." << from OTS shop.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) doPlayerAddOutfit(cid, param1, param3) doPlayerAddOutfit(cid, param2, param4) doQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") doQuery("UPDATE `z_shop_history` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE comunication_id = " .. id .. ";") doPlayerSave(cid) added = true elseif(add_item_type == 'mount') then if(not doPlayerAddMount) then print("[ERROR - gesior-shop-system] Your server doesn't support mounts. Remove all items in database from your `z_shop_offers` table where `offer_type` = mount and also in `z_ots_comunication` where `param5` = mount.") else doPlayerAddMount(cid, param1) doPlayerSendTextMessage(cid, messageType, "You received >> ".. add_item_name .." << from OTS shop.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) doQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") doQuery("UPDATE `z_shop_history` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE comunication_id = " .. id .. ";") doPlayerSave(cid) added = true end end end if(added) then addedItems = addedItems + 1 else waitingItems = waitingItems + 1 end end local message = ">> Shopsystem, added " .. addedItems .. " items. Still waiting with " .. waitingItems .. " items." if(displayExecutionTime) then local done, str = os.time() - started, "" if(os.mtime) then done = os.mtime() - started if(done < 100) then str = "0.0" .. done elseif(done < 1000) then str = "0." .. done else str = doSecondsFormat(done) if(str:len() == 0) then str = "0.0" end end end message = message .. " Done in: " .. str .. "s." end print(message) return true end gesiorShopSystem:interval(30000) gesiorShopSystem:register()
-
(Resolvido)Shop não entrega itens
algum erro no terminal do server?
-
(Resolvido)Shop não entrega itens
volta o script que estava caindo o crystal coin e teste
-
(Resolvido)Shop não entrega itens
importe isso pro seu mysql "banco de dados" DROP TABLE IF EXISTS `z_shop_history_item`; CREATE TABLE IF NOT EXISTS `z_shop_history_item` ( `id` int(11) NOT NULL AUTO_INCREMENT, `to_name` varchar(255) NOT NULL DEFAULT '0', `to_account` int(11) NOT NULL DEFAULT '0', `from_nick` varchar(255) NOT NULL, `from_account` int(11) NOT NULL DEFAULT '0', `price` int(11) NOT NULL DEFAULT '0', `offer_id` varchar(255) NOT NULL DEFAULT '', `trans_state` varchar(255) NOT NULL, `trans_start` int(11) NOT NULL DEFAULT '0', `trans_real` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
-
(Resolvido)Shop não entrega itens
-- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 18 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.storeQuery("SELECT * FROM z_ots_comunication") if(result_plr ~= false) then repeat local id = tonumber(result.getDataInt(result_plr, "id")) local action = tostring(result.getDataString(result_plr, "action")) local delete = tonumber(result.getDataInt(result_plr, "delete_it")) local cid = getPlayerByName(tostring(result.getDataString(result_plr, "name"))) if(cid) then local itemtogive_id = tonumber(result.getDataInt(result_plr, "param1")) local itemtogive_count = tonumber(result.getDataInt(result_plr, "param2")) local container_id = tonumber(result.getDataInt(result_plr, "param3")) local container_count = tonumber(result.getDataInt(result_plr, "param4")) local add_item_type = tostring(result.getDataString(result_plr, "param5")) local add_item_name = tostring(result.getDataString(result_plr, "param6")) local received_item = 0 local full_weight = 0 if(add_item_type == 'container') then container_weight = getItemWeight(container_id, 1) if(isItemRune(itemtogive_id)) then items_weight = container_count * getItemWeight(itemtogive_id, 1) else items_weight = container_count * getItemWeight(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeight(itemtogive_id, itemtogive_count) if(isItemRune(itemtogive_id)) then full_weight = getItemWeight(itemtogive_id, 1) else full_weight = getItemWeight(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if(full_weight <= free_cap) then if(add_item_type == 'container') then local new_container = doCreateItemEx(container_id, 1) local iter = 0 while(iter ~= container_count) do doAddContainerItem(new_container, itemtogive_id, itemtogive_count) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) received_item = doPlayerAddItemEx(cid, new_item) end if(type(received_item) == "number" and received_item == RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.') db.query("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 until not result.next(result_plr) result.free(result_plr) end return true end <globalevent name="Shop" interval="600" script="shop.lua" />
-
NPC que teleporta pra lugares "aleatórios"
Certo
-
NPC de teletransporte aleatórios
NPC DE TELETRANSPORTE Nada mais diz, é um NPC que faz para teletransportar jogadores para lugares aleatórios e deixando o jogo mais interessante. INSTALANDO: 1 - vá em data/npc/scripts copie um arquivo .lua, renomeia a gosto, apague o que esta dentro e adicione o código abaixo: 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 l3k0tpos = { {x = 1002, y = 1000, z = 7}, --trocar posisão 1 {x = 1003, y = 1000, z = 7}, --trocar posisão 2 {x = 1004, y = 1000, z = 7}, --trocar posisão 3 {x = 1004, y = 1000, z = 7} --trocar posisão 4 } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'teleporte')) and talkState[talkUser] ~= 2 then selfSay('Gostaria de ir para um lugar aletorio? {yes} ou {no}.', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes')) and talkState[talkUser] == 1 then local l3k0t = l3k0tpos[math.random(#l3k0tpos)] doTeleportThing(cid, l3k0t) doSendMagicEffect(l3k0t, CONST_ME_TELEPORT) selfSay('Pronto! Boa jornada.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and talkState[talkUser] ~= 1 then talkState[talkUser] = 0 selfSay('Ok, até logo!', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new()) 2 - agora em data/npc/ copie um arquivo .xml, renomeia a gosto e coloque o colodigo abaixo: <npc name="Teleporte" script="data/npc/scripts/npctelerandom.lua" floorchange="0" walkinterval="2000" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="128" head="79" body="95" legs="57" feet="106" addons="2"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME| posso te levar para um ilugar especial, deseja ir? é só dizer {teleporte}" /> </parameters> </npc> Créditos: @L3K0T agora é só por o npc no mapa e usar
-
NPC que teleporta pra lugares "aleatórios"
FIZ ESSE ESPERO QUE AJUDE <npc name="Tele" script="data/npc/scripts/npctelerandom.lua" floorchange="0" walkinterval="2000" access="5" level="1" maglevel="1"> <health now="150" max="150"/> <look type="128" head="79" body="95" legs="57" feet="106" addons="2"/> <parameters> <parameter key="message_greet" value="Hello |PLAYERNAME| posso te levar para um ilugar especial, deseja ir? é só dizer {teleporte}" /> </parameters> </npc> 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 t = { {x = 1002, y = 1000, z = 7}, --troca posisão 1 {x = 1003, y = 1000, z = 7}, --troca posisão 2 {x = 1004, y = 1000, z = 7}, --troca posisão 3 {x = 1005, y = 1000, z = 7} --troca posisão 4 } function creatureSayCallback(cid, type, msg) if(not npcHandler:isFocused(cid)) then return false end local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid if(msgcontains(msg, 'teleporte')) and talkState[talkUser] ~= 2 then selfSay('Gostaria de ir para um lugar aletorio? {yes} ou {no}.', cid) talkState[talkUser] = 1 elseif(msgcontains(msg, 'yes')) and talkState[talkUser] == 1 then local v = t[math.random(#t)] doTeleportThing(cid, v) doSendMagicEffect(v, CONST_ME_TELEPORT) selfSay('Pronto! Boa jornada.', cid) talkState[talkUser] = 0 elseif(msgcontains(msg, 'no')) and talkState[talkUser] ~= 1 then talkState[talkUser] = 0 selfSay('Ok, até logo!', cid) end return true end npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback) npcHandler:addModule(FocusModule:new())
-
(Resolvido)Error while saving player
exclua o Guild Invites e importe pro mysql novamente CREATE TABLE `guild_invites` ( `player_id` INT NOT NULL DEFAULT 0, `guild_id` INT NOT NULL DEFAULT 0, UNIQUE (`player_id`, `guild_id`), FOREIGN KEY (`player_id`) REFERENCES `players`(`id`) ON DELETE CASCADE, FOREIGN KEY (`guild_id`) REFERENCES `guilds`(`id`) ON DELETE CASCADE ) ENGINE = InnoDB;
-
ERRO ITEM EDITOR POKETIBIA
complie o cliente me outra versão deve ajudar e cria um novo item.otb
-
(Resolvido)Actions
só mudar for i = 1, #l3k0t.itemganhar do pra for i = 100, #l3k0t.itemganhar do então ficando local l3k0t = { colors = {16, 161, 149, 251, 211, 200}, itemganhar = { {2160, 30, 50}, {2160, 20, 30}, {2160, 10, 20} } } function onUse(cid, item, fromPosition, itemEx, toPosition) doRemoveItem(item.uid, 1) local rand = math.random(100) for i = 100, #l3k0t.itemganhar do if rand > l3k0t.itemganhar[i][3] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "ah que pena, não foi desta vez! ;(") doSendAnimatedText(getCreaturePosition(cid), "Bad!", l3k0t.colors[math.random(1, #l3k0t.colors)]) doSendMagicEffect(fromPosition, 2) return true end end local recompensal3k0t = l3k0t.itemganhar rand = math.random(#recompensal3k0t) doPlayerAddItem(cid, recompensal3k0t[rand][1], recompensal3k0t[rand][2], true) doSendAnimatedText(getCreaturePosition(cid), "Win!", l3k0t.colors[math.random(1, #l3k0t.colors)]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "PARABÉNS: Você ganhou: " .. recompensal3k0t[rand][2] .. " crystal coins!") doSendMagicEffect(fromPosition, 27) return true end ai se quiser que falhe é só reveter assim não perdendo parte do script
-
(Resolvido)Shop não entrega itens
local messageType = MESSAGE_EVENT_ORANGE local displayExecutionTime = true if(displayExecutionTime) then function doSecondsFormat(i) local str, found = string.gsub(i, "(%d)(%d%d%d)$", "%1.%2", 1), 0 repeat str, found = string.gsub(str, "(%d)(%d%d%d),", "%1.%2,", 1) until found == 0 return str end end if(not messageType) then messageType = MESSAGE_STATUS_CONSOLE_ORANGE if(not messageType) then messageType = MESSAGE_INFO_DESCR end end if(not getPlayerByName) then function getPlayerByName(name) local p = Player(name) return p ~= nil and p:getId() or false end end if(not isPlayer) then function isPlayer(cid) return Player(cid) ~= nil end end if(not doPlayerSave) then function doPlayerSave(cid) if(Player and type(Player) == "table" and Player.save and type(Player.save) == "function") then local player = Player(cid) if(player) then player:save() end end return true end end function getResults() if(db.storeQuery ~= nil and result.free ~= nil) then -- TFS 1.0+ local resultId = db.storeQuery("SELECT * FROM z_ots_comunication;") if(resultId == false) then return false end local results = {} repeat local tmp = {} tmp.name = result.getDataString(resultId, "name") tmp.exist = false tmp.cid = getPlayerByName(tmp.name) if(tmp.cid and isPlayer(tmp.cid)) then tmp.exist = true tmp.id = result.getDataInt(resultId, "id") tmp.action = result.getDataString(resultId, "action") tmp.delete_it = result.getDataInt(resultId, "delete_it") tmp.param1 = result.getDataInt(resultId, "param1") tmp.param2 = result.getDataInt(resultId, "param2") tmp.param3 = result.getDataInt(resultId, "param3") tmp.param4 = result.getDataInt(resultId, "param4") tmp.param5 = result.getDataString(resultId, "param5") tmp.param6 = result.getDataString(resultId, "param6") end table.insert(results, tmp) until not result.next(resultId) result.free(resultId) return results else if(db.getResult ~= nil) then local result_plr = db.getResult("SELECT * FROM z_ots_comunication;") if(result_plr:getID() == -1) then return false end local results = {} repeat local tmp = {} tmp.name = tostring(result_plr:getDataString("name")) tmp.exist = false tmp.cid = getPlayerByName(tmp.name) if(tmp.cid and isPlayer(tmp.cid)) then tmp.exist = true tmp.id = tonumber(result_plr:getDataInt("id")) tmp.action = tostring(result_plr:getDataString("action")) tmp.delete_it = tonumber(result_plr:getDataInt("delete_it")) tmp.param1 = tonumber(result_plr:getDataInt("param1")) tmp.param2 = tonumber(result_plr:getDataInt("param2")) tmp.param3 = tonumber(result_plr:getDataInt("param3")) tmp.param4 = tonumber(result_plr:getDataInt("param4")) tmp.param5 = tostring(result_plr:getDataString("param5")) tmp.param6 = tostring(result_plr:getDataString("param6")) end table.insert(results, tmp) until not(result_plr:next()) result_plr:free() return results else print('[ERROR - gesior-shop-system.lua] Your distribution is not supported') end end return false end function doQuery(query) if(db.asyncQuery ~= nil) then db.asyncQuery(query) elseif(db.query ~= nil) then db.query(query) elseif(db.executeQuery ~= nil) then db.executeQuery(query) else return false end return true end if(not getItemWeightById) then getItemWeightById = getItemWeight end if(not doCreateItemEx) then function doCreateItemEx(itemid, count) if(Game and type(Game) == "table" and Game.createItem and type(Game.createItem) == "function") then local item = Game.createItem(itemid, count) if item then return item:getUniqueId() end return false else print("[ERROR - gesior-shop-system] Error code: 1. Please contact slawkens at www.otland.net") end end end local gesiorShopSystem = GlobalEvent("GesiorShopSystem") function gesiorShopSystem.onThink(interval) if(interval > 100) then interval = interval / 100 end local started = os.mtime and os.mtime() or os.time() local addedItems, waitingItems = 0, 0 local added = false local results = getResults() if(not results) then return true end for i, v in ipairs(results) do added = false local id = v.id local action = v.action local delete = v.delete_it if(v.exist) then local cid = v.cid local param1, param2, param3, param4 = v.param1, v.param2, v.param3, v.param4 local add_item_type = v.param5 local add_item_name = v.param6 local received_item, full_weight, items_weight, item_weigth = 0, 0, 0, 0 local item_doesnt_exist = false if(add_item_type == 'container' or add_item_type == 'item') then local item_weigth = getItemWeightById(param1, 1) if(type(item_weigth) == 'boolean') then -- item doesn't exist print("[ERROR - gesior-shop-system] Invalid item id: " .. param1 .. ". Change/Fix `itemid1` in `z_shop_offers` then delete it from `z_ots_comunication`") item_doesnt_exist = true else if(add_item_type == 'container') then container_weight = getItemWeightById(param3, 1) if(type(container_weight) == 'boolean') then -- container item doesn't exist print("[ERROR - gesior-shop-system] Invalid container id: " .. param3 .. ". Change/Fix `itemid2` in `z_shop_offers` then delete it from `z_ots_comunication`") item_doesnt_exist = true else if(isItemRune(param1)) then items_weight = param4 * item_weigth else items_weight = param4 * getItemWeightById(param1, param2) end full_weight = items_weight + container_weight end elseif(add_item_type == 'item') then full_weight = getItemWeightById(param1, param2) if(isItemRune(param1)) then full_weight = getItemWeightById(param1, 1) end end end if(not item_doesnt_exist) then local free_cap = getPlayerFreeCap(cid) if(full_weight <= free_cap) then if(add_item_type == 'container') then local new_container = doCreateItemEx(param3, 1) for x = 1, param4 do doAddContainerItem(new_container, param1, param2) end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(param1, param2) received_item = doPlayerAddItemEx(cid, new_item) end if(received_item == RETURNVALUE_NOERROR) then doPlayerSendTextMessage(cid, messageType, "You received >> ".. add_item_name .." << from OTS shop.") doQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") doQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") doPlayerSave(cid) added = true else doPlayerSendTextMessage(cid, messageType, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, messageType, '>> '.. 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 '.. interval ..' seconds to get it.') end end elseif(add_item_type == 'addon') then doPlayerSendTextMessage(cid, messageType, "You received >> ".. add_item_name .." << from OTS shop.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) doPlayerAddOutfit(cid, param1, param3) doPlayerAddOutfit(cid, param2, param4) doQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") doQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") doPlayerSave(cid) added = true elseif(add_item_type == 'mount') then if(not doPlayerAddMount) then print("[ERROR - gesior-shop-system] Your server doesn't support mounts. Remove all items in database from your `z_shop_offers` table where `offer_type` = mount and also in `z_ots_comunication` where `param5` = mount.") else doPlayerAddMount(cid, param1) doPlayerSendTextMessage(cid, messageType, "You received >> ".. add_item_name .." << from OTS shop.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS) doQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") doQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") doPlayerSave(cid) added = true end end end if(added) then addedItems = addedItems + 1 else waitingItems = waitingItems + 1 end end local message = ">> Shopsystem, added " .. addedItems .. " items. Still waiting with " .. waitingItems .. " items." if(displayExecutionTime) then local done, str = os.time() - started, "" if(os.mtime) then done = os.mtime() - started if(done < 100) then str = "0.0" .. done elseif(done < 1000) then str = "0." .. done else str = doSecondsFormat(done) if(str:len() == 0) then str = "0.0" end end end message = message .. " Done in: " .. str .. "s." end print(message) return true end gesiorShopSystem:interval(3000) gesiorShopSystem:register()
- Colocando Limite no CTRL- ZOOM MAPA
-
Como Alterar Itens que Caem no chão ao Atacar Monstro & Players
tendo a souce do server é só você ir em game.cpp procure por isso: case RACE_BLOOD:textColor = TEXTCOLOR_RED; magicEffect = MAGIC_EFFECT_DRAW_BLOOD; splash = Item::CreateItem(ITEM_SMALLSPLASH, FLUID_BLOOD); break; e remova isso splash = Item::CreateItem(ITEM_SMALLSPLASH, FLUID_BLOOD); ao monstro morrer não cai mais nada em baixo. ----AGORA---- E para alterar isso é nos ITEM_SMALLSPLASH está em const.h na source procure por e altere o ID ITEM_SMALLSPLASH = 2019,
-
Como Alterar Itens que Caem no chão ao Atacar Monstro & Players
está com id de sprite errada, vc precisa troca no cliente ou usar um item editor.