Ir para conteúdo

Pesquisar na Comunidade

Mostrando resultados para as tags ''sistema''.

  • Pesquisar por Tags

    Digite tags separadas por vírgulas
  • Pesquisar por Autor

Tipo de Conteúdo


Fóruns

  • xTibia - Notícias e Suporte
    • Regras
    • Noticias
    • Soluções
    • Projetos Patrocinados
    • Tutoriais para Iniciantes
    • Imprensa
  • OTServ
    • Notícias e Debates
    • OTServlist
    • Downloads
    • Recursos
    • Suporte
    • Pedidos
    • Show-Off
    • Tutoriais
  • OFF-Topic
    • Barzinho do Éks
    • Design
    • Informática

Encontrar resultados em...

Encontrar resultados que contenham...


Data de Criação

  • Início

    FIM


Data de Atualização

  • Início

    FIM


Filtrar pelo número de...

Data de Registro

  • Início

    FIM


Grupo


Sou

  1. eu uso o centurion 4.0 so que percebi que nele nao contem system control mind se alguem poder disponibilizar esse sistema aqui dou REP+
  2. Este é o conhecido Zombie Event, varios sites fazem comercio dele então resolvi postar o link onde você pode encontrar este sistema completo e atualizado. Creio que a maioria saiba o que acontece neste evento, mas vou resumir: Em uma determinada hora, abrirá um teleport no lugar que o evento foi configurado, onde os jogadores entrarão e irão até uma arena. Assim que o Evento começar os jogadores não podem ser tocados pelos zombies, quem for tocado está eliminado do evento, o último que resistir o ataque dos zombies será premiado automaticamente. O mapa é editado e o evento está 100% livre de bug's. Segue abaixo imagem do mapa que contém dentro da pasta para download. Download: http://www.4shared.com/rar/UlpGM-z4/ZOMBIE_EVENT_FL-SERVERScom.html Scan: https://www.virustotal.com/file/5cc28970f1d40cc287c970734f00c466a902eeff32b3b0c9de2a809b6880cd08/analysis/1359700874/ Créditos: Autor do Event e FL-SERVERS PELA CUSTOMIZAÇÃO, EDIÇÃO, VERIFICAÇÃO E DOWNLAOD!
  3. Este sistema baseia-se em evitar que a diferença de level dos players do seu servidor seja muito grande, reconhecendo, automaticamente, os players com os maiores leveis do servidor e então enviando uma mensagem aos players anunciando uma recompensa em GP, que será fornecida a quem matar o referido Top Level. Após a morte do mesmo, o player que ganhou o frag recebe, instantaneamente, o prêmio correspondente. COMO INSTALAR: Execute os comando em seu PhpMyAdmin: CREATE TABLE IF NOT EXISTS `bounty_hunters` ( `id` int(11) NOT NULL auto_increment, `fp_id` int(11) NOT NULL, `sp_id` int(11) NOT NULL, `k_id` int(11) NOT NULL, `added` int(15) NOT NULL, `prize` bigint(20) NOT NULL, `killed` int(11) NOT NULL, `kill_time` int(15) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; (SCRIPT NECESSÁRIO PARA FUNCIONALIDADE DO SCRIPT COM O SEU BANCO DE DADOS) COLOQUE O ARQUIVOS bounty.lua na pasta data/creaturescripts/scripts, depois abra o arquivo creaturescripts.xml e cole a tag: <event type="kill" name="Bounty" event="script" value="bounty.lua"/> Agora abra o arquivo data/creaturescripts/scripts/login.lua e antes do último "return true" cole as tags: registerCreatureEvent(cid, "Bounty") Agora cole o arquivo "tbounty.lua" em data/talkactions/scripts e em talkactions.xml cole a tag: <talkaction words="/bounty;!bounty;!hunt;/hunt" script="tbounty.lua" /> PÁGINA DO GESIOR DISPONÍVEL DENTRO DA PASTA DO SCRIPT. Download: http://www.gg4.com.b...auto_hunted.rar Scan: https://www.virustot...sis/1359699997/ CRÉTIDOS: OTLAND / FL-SERVERS
  4. Ola galera xtibiaaana!. Então meus amigos resolvi fazer um TV system aquele famoso sistema que o player cria uma channel(canal) e outros players poderão ver ele batalhando. Estou retirando o máximo de bugs possíveis se você viu um bug não deixe de falar. Vamos as explicações: Primeiro o player cria uma channel usando o comando /tv(nome da channel) depois outro player ve sua channel na lista usando o comando /channel(list) logo ele quer entrar em sua channel então ele fala /channel(nome da channel). Logo apos ele falar ele entra e começa a assistir mais depois ele quer sair então ele "desloga" e ele volta ao tempo. Vamos a instalação. Execute este comandos na sua database: CREATE TABLE "tv" ( "name" Text NOT NULL, "player" INT NOT NULL, "conec" INT NOT NULL ) Vá em lib e crie um arquivo lua chamado de tv e coloque isto: function createTv(cid, name) db.executeQuery("INSERT INTO `tv` (`name`, `player`, `conec`, `watch`) VALUES ('" .. name .. "', " .. getPlayerGUID(cid) .. ", 1, 0);") setPlayerStorageValue(cid, 23423, 1) doPlayerSave(cid) end function isTv(name) local tv = db.getResult("SELECT * FROM `tv` WHERE `name` = '".. name .."';") return tv:getID() ~= -1 and true or false end function getChannelPlayer(cid) return getPlayerStorageValue(cid, 23423) == 1 and true or getPlayerStorageValue(cid, 23423) == -1 and false end function getWatchingNameChannel(cid) return getPlayerStorageValue(cid, 44670) end local combat = createCombatObject() setCombatParam(combat, COMBAT_PARAM_AGGRESSIVE, false) local conditi = createConditionObject(CONDITION_MUTED) setConditionParam(conditi, CONDITION_PARAM_TICKS, 10000*10000) local condition = createConditionObject(CONDITION_INVISIBLE) setConditionParam(condition, CONDITION_PARAM_TICKS, 200000) function enterInTv(cid, name) local function comparePos(pos, post) local pos = getThingPos(pos) local post = getThingPos(post) return pos.x == pos.x or pos.y == pos.y or pos.z == pos.z and false or true end local function fallowPlayer(cid, player) if not isPlayer(cid) or getPlayerStorageValue(cid, 44670) == -1 then return true end if comparePos(cid, player) then doTeleportThing(cid, getThingPos(player)) doAddCondition(cid, condition) doAddCondition(cid, conditi) setCombatCondition(combat, condition) end return addEvent(fallowPlayer, 1800, cid, player) and doPlayerSave(cid) end setPlayerStorageValue(cid, 44670, name) local tv = db.getResult("SELECT * FROM `tv` WHERE `name` = '".. name .."';") local guid = tv:getDataInt("player") local player = getPlayerByNameWildcard(getPlayerNameByGUID(guid)) return fallowPlayer(cid, player) end function exitChannel(cid) doRemoveCondition(cid, CONDITION_INVISIBLE) doRemoveCondition(cid, CONDITION_MUTED) doRemoveCondition(cid, COMBAT_PARAM_AGGRESSIVE) doTeleportThing(cid, getPlayerMasterPos(cid)) setPlayerStorageValue(cid, 44670, -1) doPlayerSave(cid) end function doShowListChannel(cid) local tv = db.getResult("SELECT * FROM `tv` WHERE `player` ORDER BY `conec`") str = "Channel Disponiveis:\n\n" if tv:getID() == -1 then doShowTextDialog(cid, 1387, "Não ha channel disponiveis") return true end while true do local conect = tv:getDataInt("conec") local player = tv:getDataInt("player") local channel = tv:getDataString("name") local players = getPlayerNameByGUID(player) str = str .. channel .. " -("..players..")\n\n" if not tv:next() then doShowTextDialog(cid, 1397, str) break end end end function getConectTv(name) local tv = db.getResult("SELECT * FROM `tv` WHERE `name` = '".. name .."';") return tv:getDataInt("conec") == 1 and true or tv:getDataInt("conec") == 0 and false end function setStatusTv(cid, on) if on == "on" then return db.executeQuery("UPDATE `tv` SET `conec` = 1 WHERE `player` = "..getPlayerGUID(cid)) end if on == "off" or on ~= "on" then local tv = db.getResult("SELECT * FROM `tv` WHERE `player` = '".. getPlayerGUID(cid) .."';") local channel = tv:getDataString("name") db.executeQuery("UPDATE `tv` SET `conec` = 0 WHERE `player` = "..getPlayerGUID(cid)) for i =1, #getPlayersOnline() do if getWatchingNameChannel(getPlayersOnline()[i]) == channel and getPlayersOnline()[i] ~= cid then exitChannel(getPlayersOnline()[i]) doPlayerSendTextMessage(getPlayersOnline()[i], MESSAGE_INFO_DESCR, "A channel foi desligada") end end end end Vá em talkactions crie um arquivo Lua chamado de tv coloque isto: function onSay(cid, words, param, channel) local item = 1949 ----Item que você precisa local bloqued = {"sair", "list", "on", "off"} ----- Nomes de channel que não pode ser usado if param == "" or param == " " then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Diga o nome da channel que você quer") and false end if param == "on" or param == "off" then return setStatusTv(cid, param) end for i = 1, #bloqued do str = "Nomes não podem ser ultlizados" str = ""..str.."\n"..bloqued[i].."" if param == bloqued[i] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este nome não pode ser ultilizado porque e um comando do sistema") and false end end if #param <= 4 and #param >= 10 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O nome da sua channel deve ser maior que 4 caracteres e menor que 10 caracters") and false end if getPlayerItemCount(cid, item) < 1 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você precisa de um "..getItemNameById(item).."") and false end if getChannelPlayer(cid) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ja tem uma channel") and false end createTv(cid, param) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabéns sua channel "..param.." foi criada") return true end Vá em talkactions e crie um arquivo lua chamado de channel e coloque isto: function onSay(cid, words, param, channel) if param == "" or param == " " then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Diga /channel(nome da channel para se conectar)\n/channel(list) Lista das channels\n/channel(sair para sair da channel)") and false end if param ~= "list" and param ~= "sair" then if not isTv(param) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não existe esta channel") and false end if not (getTilePzInfo(getCreaturePosition(cid))) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você so pode entrar em uma channel quando estiver em pz") return true end if getChannelPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode entrar uma tv porque você ja tem uma") return true end if getWatchingNameChannel(cid) ~= -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você esta conectado a uma channel") return true end if not getConectTv(param) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Esta channel esta desativada") and false end enterInTv(cid, param) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você esta assitindo a channel "..param.."") return true end if param == "list" then return doShowListChannel(cid) end if param == "sair" then if getChannelPlayer(cid) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode sair de sua propria tv use o comando /tv off para desativar sua channel") return true end if getWatchingNameChannel(cid) == -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não esta conectado a uma channel") return true end exitChannel(cid) return true end return true end Vá em talkactions.xml e coloque estas tags: Vá em creaturescripts e crie um arquivo lua chamado tv e coloque isto: function onLogout(cid) if getChannelPlayer(cid) then local tv = db.getResult("SELECT * FROM `tv` WHERE `player` = '".. getPlayerGUID(cid) .."';") local channel = tv:getDataString("name") db.executeQuery("UPDATE `tv` SET `conec` = 0 WHERE `player` = "..getPlayerGUID(cid)) for i =1, #getPlayersOnline() do if getWatchingNameChannel(getPlayersOnline()[i]) == channel and getPlayersOnline()[i] ~= cid then exitChannel(getPlayersOnline()[i]) doPlayerSendTextMessage(getPlayersOnline()[i], MESSAGE_INFO_DESCR, "A channel foi desligada") end end doPlayerSendTextMessage(getPlayersOnline()[i], MESSAGE_INFO_DESCR, "Sua channel foi desativado ao você logar religue dizendo /tv on") return true end if getWatchingNameChannel(cid) ~= -1 then exitChannel(cid) return true end return true end function onAttack(cid, target) if getWatchingNameChannel(cid) ~= 1 then return false end return true end Registre o evento colocando isto antes do ultimo return true: Coloque esta tags em creaturescripts.xml: Configurações Midia: Ajude o tv system dizendo ideias e bugs para o sistema. Estarei optimizando o sistema e retirandos bugs.
  5. Ola galera xtibia. Eu resolvi fazer o Trainer OFF 1.0 o antigo trainer off beta tinha algumas limitações. Segue o link do Trainer off beta: http://www.xtibia.com/forum/topic/199659-trainer-off-sytem-beta-by-caotic/ Como o próprio nome diz e um treinamento quando o player está off. Ele paga uma taxa para treinar uma certa quantidade de horas e depois suas skills são upadas. Na versão superior foi adicionado Vamos ao sistema lets go: Crie um arquivo lua chamado de trainer em talkactions e coloque isto: local Train = { skill = 0, quant = 0, time = 0, vocations = {}, money = 0, player = 0 } local table = { ["fist"] = SKILL_FIST, ["sword"] = SKILL_SWORD, ["axe"] = SKILL_AXE, ["distance"] = SKILL_DISTANCE, ["shild"] = SKILL_SHIELD, ["fishing"] = SKILL_FISHING } local x = {"First Skill", "Sword Skill", "Axe Skill", "Distance Skill", "Shild Skill", "Fishing Skill"} function Train:new(cid, param, vocations, money, quant) local trainer = { vocations = {}, param = param, player = cid, money = tonumber(money), quant = tonumber(quant) } return setmetatable(trainer, {__index = self}) end function Train:start() cid = self.player local t = string.explode(self.param, ",") if not t[1] or not isNumeric(t[1]) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Diga o tempo que você quer treinar") and false end self.skill = table[t[2]] self.time = t[1]*36000*1000 self.money = self.money*t[1] self.quant = self.quant*t[1] if not t[2] or not table[t[2]] then str = "Lista de skills(Diga a sua skill)\nPara dizer e só escrever /treiner (tempo do treiner,skill)\n" for i = 1, #x do str = ""..str.."\n"..x[i].."" end doShowTextDialog(cid, 1397, str) return true end if isInArray(self.vocations, getPlayerVocation(cid)) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua vocação não permite o trainer") and false end if self.money >= getPlayerMoney(cid) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem "..self.money.." de money") and false end if self.time <= 36000*1000 then self.time = 36000*1000 end exhaustion.set(cid, 44226, self.time) doPlayerAddSkill(cid, self.skill, self.quant) doPlayerRemoveMoney(cid, self.money) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Pronto você esta em treinamento") doRemoveCreature(cid) end function onSay(cid, words, param, channel) local voc = {} ---- Vocações QUE NÃO SE PERMITIDAS TRAINER OFF(Se não tiver deixe sem nenhuma) local money = 200000 ----- Quanto de money PARA CADA hora local quant = 4 ------ Quantidade de skill que ele ganha PARA CADA HORA local trainer = Train:new(cid, param, voc, money, quant) trainer:start() return true end Agora vá em talkactions.xml e coloque esta tag: <talkaction words="/treiner" event="script" value="trainer.lua"/> Agora vá em creaturescripts e crie um arquivo lua chamado de treiner e coloque este codigo: function onLogin(cid) if exhaustion.get(cid, 44226) then doPlayerPopupFYI(cid, "Não e permitido logar enquanto esta treinando") return addEvent(doRemoveCreature, 180, cid) end return true end Registre o evento em login.lua colocando isto antes do ultimo return true: registerCreatureEvent(cid, "treiner") E coloque esta tag em creaturescripts.xml: <event type="login" name="treiner" register = "1" event="script" value="treiner.lua"/>
  6. Dremiski

    [NPC] Bounty Hunter

    Bom dia queridos amigos scripters! Venha aqui lhes desejar outro pedido e ficaria eternamente agradecido se pudessem me ajudar. Gostaria de saber se é possivel criar um npc a qual ele dê a ordem de mata um player, exemplo o Top level, porém gostaria que fizesse isso como quest pra dexa o jogo mais divertido. Ex: Se precisar fazer adaptações eu não me importo, desde que o fundamento continue o mesmo! Obrigado Scripters. Att, Dremiski
  7. Ola galera xtibiana!!! O summon system e um sistema de sumonar sistema com algumas novidades. A configuração fica dentro de arquivo xml ficando mais fácil e pratico de modificar. Para sumonar diga /sum(nome do monstro) Para ver a lista de sumons /sumons Então lets go. Dentro de sua pasta "Data" crie um nova pasta chamado de sumon. Depois dentro da pasta sumon crie um novo arquivo XML e coloque isto dentro: <monster name="Demon" mana="3000" level="300" item="2323" health="100" />< <monster name="Bug" mana="2" level="2" item="0" health="0" />< <monster name="Hydra" mana="2000" level="50" item="2323" health="0" />< Esta e minha configuração se quiser pode alterar. Depois vá em talkactions e crie um arquivo lua chamado de sumon e coloque isto: function onSay(cid, words, param, channel) function getSumonInFile() local x = {} local events = io.open("data/sumon/sumon.xml", "r") for i in events:read("*a"):gmatch('<monster name="(.-)" ') do table.insert(x, i) end return x end local function getExistSumonInFile(monster) for i = 1, #getSumonInFile() do if monster == getSumonInFile()[i] then return true end end return false end function getSumonRequiresInFile(monster, attr) local x = {} local events = io.open("data/sumon/sumon.xml", "r") for i in events:read("*a"):gmatch('<monster name="'..monster..'" (.-)/') do local req = tonumber(i:match(''..attr..'="(.-)" ')) table.insert(x, req) end return x[1] or 0 end local mana,level,item,health = getSumonRequiresInFile(param, "mana"),getSumonRequiresInFile(param, "level"),getSumonRequiresInFile(param, "item"),getSumonRequiresInFile(param, "health") local x = {"Vá "..param.." e derrote estes malditos","Seja bem vindo "..param.."","Váaaaa "..param.."","Eae "..param.." esta pronto?!","Vaii "..param.." você e realmente forte"} if param == "" or not param or param == " " then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Precisa de dizer o nome do monsto") and false end if not getExistSumonInFile(param) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este monstro não pode ser sumado") end if getCreatureMana(cid) <= mana then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem "..mana.."de mana para sumonar") and false end if getPlayerLevel(cid) <= level then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem "..level.." de level para summonar") and false end if getPlayerItemCount(cid, item) < 0 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem o item "..item.." para summonar") and false end if getCreatureHealth(cid) <= health then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não "..health.."de health para summonar") and false end doSummonMonster(cid, param) doCreatureAddHealth(cid, -health) doCreatureAddMana(cid, -mana) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, x[math.random(1, #x)]) return true end Agora de novo em talkactions crie um arquivo lua chamado de sumons e coloque isto: function onSay(cid, words, param, channel) function getSumonInFile() local x = {} local events = io.open("data/sumon/sumon.xml", "r") for i in events:read("*a"):gmatch('<monster name="(.-)" ') do table.insert(x, i) end return x end function getSumonRequiresInFile(monster, attr) local x = {} local events = io.open("data/sumon/sumon.xml", "r") for i in events:read("*a"):gmatch('<monster name="'..monster..'" (.-)/') do local req = tonumber(i:match(''..attr..'="(.-)" ')) table.insert(x, req) end return x[1] or 0 end str = "" for i = 1, #getSumonInFile() do local sum = getSumonInFile()[i] local mana,level,item,health = getSumonRequiresInFile(sum, "mana"),getSumonRequiresInFile(sum, "level"),getSumonRequiresInFile(sum, "item"),getSumonRequiresInFile(sum, "health") str = ""..str.."\n"..getSumonInFile()[i].." Level - "..level.." health - "..health.." mana - "..mana.."" end doPlayerPopupFYI(cid, str) return true end E prontinho vou ensinar a configuração no seu arquivo xml:
  8. Ola galera xtibiana O radio system eu ja tinha feito numa versão "beta" mais estava muito limitado. O link do sistema beta http://www.xtibia.com/forum/topic/190386-radio-sytem/ Então resolvi fazer uma versão superior O radio sytem e um sistema de (channel ou estações). Um player cria uma nova radio e depois outro player "sincroniza" a partir disso o dono da radio pode mandar mensagens a todos os participantes Para procurar uma radio e exibido uma janela que monstra o (Id da radio, dono da radio, radio esta online ou offline) Vamos aos códigos: function getRadPlayer(cid) local rad = db.getResult("SELECT `rad` FROM `players` WHERE `id` = "..getPlayerGUID(cid)) return rad:getID() ~= -1 and rad:getDataInt("rad") or false end function setPlayerRad(cid, rad) db.executeQuery("UPDATE `players` SET `rad` = "..rad.." WHERE `id` = "..getPlayerGUID(cid)) end function createNewRad(cid) db.executeQuery("INSERT INTO `rad` VALUES (".. getPlayerGUID(cid) ..", ".. 1 ..")") db.executeQuery("UPDATE `players` SET `rad` = "..getPlayerGUID(cid).." WHERE `id` = "..getPlayerGUID(cid)) end function getOwnerIdRad(cid) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` = ".. getPlayerGUID(cid) ..";") return rad:getID() ~= -1 and rad:getDataInt("id") or false end function getRadMens(cid) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` = ".. getPlayerGUID(cid) ..";") return rad:getID() ~= -1 and rad:getDataInt("mens") or 0 end function getPlayerOwnerRad(cid) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` = ".. getPlayerGUID(cid) ..";") return rad:getID() ~= -1 and true or false end function getExistRad(id) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` = ".. id ..";") return rad:getID() ~= -1 and true or false end function sendTextForRad(cid, text) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` = ".. getPlayerGUID(cid) ..";") local mens = getRadMens(cid)+1 for i =1, #getPlayersOnline() do if getRadPlayer(getPlayersOnline()[i]) == getPlayerGUID(cid) then doPlayerSendTextMessage(getPlayersOnline()[i], MESSAGE_INFO_DESCR, text) db.executeQuery("UPDATE `rad` SET `mens` = "..mens.." WHERE `id` = "..getPlayerGUID(cid)) end end end Vá em talkactions e crie um arquivo lua chamado de rad e coloque isto: function onSay(cid, words, param, channel) local t = string.explode(param, ",") if not t[1] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o id da radio para participar dela") and false end if getOwnerIdRad(cid) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não pode participar de outras radios porque você ja tem uma") and false end if not getExistRad(tonumber(t[1])) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Esta radio não existe") and false end setPlayerRad(cid, tonumber(t[1])) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você esta sincronizado na radio "..t[1].."") return true end Continue em talkactions e crie um arquivo lua chamado de list e coloque isto: function onSay(cid, words, param, channel) local rad = db.getResult("SELECT * FROM `rad` WHERE `id` ORDER BY `mens`") str = "Radio Ons:\n\n" if rad:getID() == -1 then doShowTextDialog(cid, 1387, "Não ha radio online") return true end while true do local id = rad:getDataInt("id") local name = getPlayerByNameWildcard(getPlayerNameByGUID(id)) and getPlayerNameByGUID(id) or "offline" str = str .. id .. " - Dono da Radio - ("..name..")\n\n" if not rad:next() then doShowTextDialog(cid, 1397, str) break end end return true end Depois em talkactions de novo crie um arquivo lua chamado de createrad e coloque isto: function onSay(cid, words, param, channel) local price = 22220 -- Preço para criar a radio (detalhe coloque um preço bem alto para o otserv não ficar com muitas radios) if getPlayerMoney(cid) <= price then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem dinheiro suficiente para criar uma radio") and false end if getPlayerOwnerRad(cid) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ja tem uma radio ID "..getOwnerIdRad(cid).."") and false end createNewRad(cid) doPlayerRemoveMoney(cid, price) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua radio foi criado seu ID é "..getOwnerIdRad(cid).." convide suas amigos para participar dela") return true end Terminado na mesma pasta(talkactions) crie um arquivo lua chamado de txt e coloque isto: function onSay(cid, words, param, channel) local t = string.explode(param, ",") if not t[1] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloca a mensagem que deseja enviar para os participantes da sua radio") and false end if not getPlayerOwnerRad(cid) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem radio") and false end if #param < 4 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua mensagem deve ser maior") and false end sendTextForRad(cid, "("..getOwnerIdRad(cid)..") "..getPlayerName(cid).." - "..t[1].." ") return true end Coloque esta tags em talkactions.xml: Para usar e simples:
  9. se alguem poder ajuda preciso de um sistema que quando manda serta magia de um stun, o player manda e bata no bixo e o bixo bata e pega em player igual ao dragon souls ! exori hur,exevo gran mas frigo,adori frigo etc... se vcs poderem me ajudar agradeço MSN:dggatinho94@hotmail.com
  10. Vou postar alguns scripts meus que estiveram engavetados. Faz algum tempo que fiz estes scripts, então não vou postar screenshots ou como configurar, mas as configurações são fáceis de entender, então divirtam-se. Edit: Cuidado, se usar muitas chuvas ao mesmo tempo ou em áreas muito grandes, é muito provável que vá dar lag no seu servidor! Porém, tenho planos de fazer um remake desse sistema, deixando muito melhor e praticamente sem lag numa área imensa, realmente imensa, do porte de 100000x100000 SQMs! Esse é de longe o meu melhor script para open tibia. Fiz todo usando a "orientação à objetos" de Lua, o que torna o sistema altamente customizável, podendo adicionar novos tipos de clima apenas com uma linha de comando. O Weather System é basicamente um sistema de chuva que te permite adicionar o clima que você quiser, como chuva ácida, chuva de meteoros e et cetera. Porém, o maior atrativo deste sistema é que ele não chove aonde há telhado, ou seja, os efeitos só vão acontecer no andar mais alto onde há tiles. Não vai chover embaixo de uma ponte, vai chover em cima dela. Não vai chover dentro da loja daquele NPC, vai chover no telhado da loja. Não vai chover dentro de cavernas, montanhas, ou qualquer lugar onde haja um tile por cima. Você pode criar uma chuva eterna, uma chuva que acontece de vez em quando em algum lugar, ou criar a chuva com o comando /weather com um GM. /data/lib/weather-system.lua -- This script is part of Weather System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- base (class) for weather types WeatherType = { effects = CONST_ME_NONE, interval = 10, items = {}, chance = 0, callback = nil, param = {}, } -- base (class) for weathers Weather = { type = nil, topleft = {x=0, y=0}, bottomright = {x=0, y=0}, intensity = 0, } -- create new instances of WeatherType function WeatherType:new(effects, interval, items, chance, callback, ...) local new_weathertype = { effects = effects, interval = interval, items = items, chance = chance, callback = callback, param = {...}, } return setmetatable(new_weathertype, {__index = self}) end -- create new instances of Weather function WeatherType:create(topleft, bottomright, intensity) if bottomright.x < topleft.x then local tmp_x = topleft.x topleft.x = bottomright.x bottomright.x = tmp_x end if bottomright.y < topleft.y then local tmp_y = topleft.y topleft.y = bottomright.y bottomright.y = tmp_y end local new_weather = { type = self, topleft = topleft, bottomright = bottomright, intensity = intensity, } return setmetatable(new_weather, {__index = Weather}) end -- start the weather's main loop function Weather:start(duration) if duration and duration <= 0 then return true end local area = (self.bottomright.x - self.topleft.x) * (self.bottomright.y - self.topleft.y) for i = 1, (area * self.intensity / 40) + 1 do local pos = {} pos.x = math.random(self.topleft.x, self.bottomright.x) pos.y = math.random(self.topleft.y, self.bottomright.y) pos.z = get_roof_tile(pos) if is_walkable(pos) then local send_effect = true -- if the weather type for this weather has a callback, call it if type(self.type.callback) == "function" then send_effect = self.type.callback(self.type, pos) end -- if callback returned true, send effect, no effect otherwise if send_effect then doSendMagicEffect(pos, type(self.type.effects) == "table" and self.type.effects[math.random(1, #self.type.effects)] or self.type.effects) end -- create item based on chance if math.random(1, 100) <= self.type.chance / 40 then doCreateItem(type(self.type.items) == "table" and self.type.items[math.random(1, #self.type.items)] or self.type.items, pos) end end end if not duration then addEvent(self.start, self.type.interval, self, false) else addEvent(self.start, self.type.interval, self, duration - self.type.interval) end return true end -- itemids that count as void when being checked for the top-most tile local include = { 434, 435, 436, 437, 438, 439, 440, 441, 442, 443, 444, 445, 921, 922, 923, 924, 925, 926, 927, 928, 929, 930, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 3188, 3189, 3218, 3221, 3222, 3298, 3299, 3300, 3301, 3302, 3303, 3304, 3305, 3306, 3307, 3308, 3309, 4456, 4457, 4458, 4459, 4460, 4461, 4462, 4463, 4464, 4465, 4466, 4467, 4514, 4542, 4543, 4544, 4545, 4546, 4547, 4548, 4549, 4550, 4551, 4552, 4553, 4554, 4555, 4556, 4557, 4558, 4559, 4560, 4561, 4562, 4563, 4564, 4565, 4596, 4597, 4598, 4599, 4600, 4601, 4602, 4603, 4604, 4605, 4606, 4607, 4667, 4668, 4669, 4670, 4671, 4672, 4673, 4674, 4675, 4676, 4677, 4678, 4679, 4680, 4681, 4682, 4683, 4684, 4685, 4686, 4687, 4688, 4689, 4690, 4713, 4714, 4715, 4716, 4717, 4718, 4719, 4720, 4721, 4722, 4723, 4724, 4725, 4726, 4727, 4728, 4729, 4730, 4731, 4732, 4733, 4734, 4735, 4736, 4737, 4738, 4739, 4740, 4741, 4742, 4760, 4761, 4762, 4763, 4764, 4765, 4766, 4767, 4768, 4769, 4770, 4771, 4772, 4773, 4774, 4775, 4776, 4777, 4778, 4779, 4780, 4781, 4782, 4783, 4784, 4785, 4786, 4787, 4788, 4789, 4790, 4791, 4792, 4793, 4794, 4795, 4796, 4797, 4798, 4799, 4800, 4801, 4802, 4803, 4804, 4805, 4806, 4807, 3226, 3227, 3228, 3229, 3230, 3231, 3232, 3233, 3234, 3235, 3236, 3237, 3238, 3239, 3240, 3241, 4514, 4515, 4516, 4517, 4518, 4519, 4520, 4521, 4522, 4523, 4524, 4525, 5045, 5046, 5047, 5048, 5049, 5050, 5051, 5052, 5053, 5054, 5816, 5817, 5818, 5819, 5820, 5821, 5822, 5823, 5824, 5825, 5826, 5827, 6160, 6161, 6162, 6163, 6164, 6165, 6166, 6167, 6168, 6169, 6170, 6171, 6695, 6696, 6697, 6698, 6699, 6700, 6701, 6702, 6703, 6704, 6705, 6706, 7067, 7068, 7069, 7070, 7071, 7072, 7073, 7074, 7075, 7076, 7077, 7078, 7079, 7080, 7081, 7082, 7083, 7084, 7085, 7086, 7087, 7088, 7089, 7090, 7107, 7108, 7109, 7110, 7111, 7112, 7113, 7114, 7115, 7116, 7117, 7118, 7119, 7120, 5771, 5772, 5773, 5774, 6211, 6212, 6213, 6214, 6215, 891, 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, 902, 6810, 6811, 6812, 6813, 6814, 6815, 6816, 6817, 6818, 6819, 6820, 6821, 7201, 7202, 7203, 7204, 7205, 7206, 7207, 7208, 7209, 7210, 7211, 7212, 7641, 7642, 7643, 7644, 7645, 7646, 7647, 7648, 7649, 7650, 7651, 7652, 7653, 7709, 7710, 7656, 7657, 7658, 7659, 7660, 7661, 7662, 7663, 7664, 7654, 7833, 7834, 7666, 7667, 7668, 7669, 7835, 7671, 7672, 7836, 7837, 477, 478, 487, 488, 8053, 8054, 8055, 8056, 8057, 8117, 8118, 8119, 8120, 8021, 8022, 8023, 8024, 8025, 8026, 8027, 8028, 8365, 8030, 8031, 8032, 3349, 3350, 3351, 3352, 3353, 3354, 3355, 3356, 3357, 3358, 3359, 3360, 3225, 3242, 3243, 3244, 3245, 3140, 3141, 3142, 3143, 3144, 3145, 3146, 3147, 3148, 3149, 3150, 3151, 8349, 8350, 8351, 8352, 8353, 8354, 8355, 8356, 8357, 8358, 8359, 8360, 8435, 8436, 8437, 8438, 8439, 8440, 8441, 8442, 8443, 8444, 8445, 8446, 8447, 8448, 8449, 8450, 8451, 8452, 8453, 8454, 8455, 8456, 8457, 8458, 8460, 8461, 8462, 8463, 8464, 8465, 8466, 8467, 8468, 8469, 8470, 8471, 9233, 9234, 9537, 9538, 9539, 9540, 9541, 9542, 9543, 9544, 9545, 9546, 9547, 9548, 9549, 9550, 9551, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9569, 9570, } -- get the top-most existent tile, and returns its z position function get_roof_tile(pos) pos.stackpos = 0 pos.z = 7 local thing = getTileThingByPos(pos) while pos.z >= 0 do if thing.uid == 0 or isInArray(include, thing.itemid) then return pos.z + 1 end pos.z = pos.z - 1 thing = getTileThingByPos(pos) end return 0 end -- checks if the position is walkable function is_walkable(pos) pos.stackpos = 0 if getTileThingByPos(pos).uid == 0 then return false end local thing = getThingFromPos(pos) while thing.uid ~= 0 and pos.stackpos <= 252 do if not isCreature(thing.uid) and (hasItemProperty(thing.uid, 3) or hasItemProperty(thing.uid, 7)) then return false end pos.stackpos = pos.stackpos + 1 thing = getThingFromPos(pos) end return true end -- simple callback for weathers to heal creatures function weather_heal(rain_type, pos) pos.stackpos = 253 if getTileThingByPos(pos).uid == 0 then return false end local thing = getThingFromPos(pos) if thing.uid ~= 0 then doCreatureAddHealth(thing.uid, rain_type.param[1]) doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE) end return true end -- simple callback for weathers to damage creatures function weather_damage(rain_type, pos) pos.stackpos = 253 if getTileThingByPos(pos).uid == 0 then return false end local thing = getThingFromPos(pos) if thing.uid ~= 0 then doCreatureAddHealth(thing.uid, -rain_type.param[1]) doSendMagicEffect(pos, CONST_ME_MAGIC_BLUE) end return true end -- simple callback for weathers to teleport creatures function weather_teleport(rain_type, pos) pos.stackpos = 253 if getTileThingByPos(pos).uid == 0 then return false end local thing = getThingFromPos(pos) if isCreature(thing.uid) then local topos = {x=rain_type.param[1], y=rain_type.param[2], z=rain_type.param[3]} doTeleportThing(thing.uid, topos) end return true end -- import the weathers definition's file dofile(getDataDir() .. "/lib/weather-types.lua") Para criar novos tipos de chuva, use o comando "WeatherType:new" como exemplificado no script abaixo: /data/lib/weather-types.lua -- This script is part of Weather System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- WeatherType:new(<table|number: effect(s)>, <number: interval>, <table|number: items>, <number: chance>[, function: callback[, ...]]) Rain = WeatherType:new(1, 15, {2016, 2017, 2018}, 60) DivineRain = WeatherType:new(1, 15, {2016, 2017, 2018}, 60, weather_heal, 200) Storm = WeatherType:new({1, 40}, 18, {2016, 2017, 2018}, 60) ThunderStorm = WeatherType:new({1, 40}, 18, {2016, 2017, 2018}, 60, weather_damage, 80) Blizzard = WeatherType:new({42, 43}, 20, {}, 0) AcidRain = WeatherType:new({8, 20}, 18, 1496, 60) MeteorRain = WeatherType:new(36, 18, {1492, 1493, 1494}, 10, weather_damage, 120) Sandstorm = WeatherType:new(34, 20, {}, 0) Snowfall = WeatherType:new(27, 15, {}, 0) Teleporter = WeatherType:new(10, 18, {}, 0, weather_teleport, 100, 100, 7) Fissure = WeatherType:new(6, 18, {1492, 1493, 1494}, 30, weather_damage, 300) StaticEnergy = WeatherType:new({11, 47}, 15, {}, 0, weather_damage, 30) Fireworks = WeatherType:new({28, 29, 30}, 18, {}, 0, weather_heal, 50) IceStorm = WeatherType:new(41, 20, {}, 0) Avalanche = WeatherType:new(44, 20, {}, 0) Para criar uma chuva eterna, altere a tabela "weathers" no script abaixo. /data/globalevents/scripts/weather-eternal.lua -- This script is part of Weather System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- erase the two examples and add your own new locations inside this table, so they will start when the server start local weathers = { -- Storm:create({x=100, y=100}, {x=200, y=200}, 0.5), -- Blizzard:create({x=100, y=100}, {x=200, y=200}, 0.3), } -- globalevent's callback event function onStartup() for i, weather in pairs(weathers) do weather:start(false) end return true end Para criar uma chuva aleatória (acontece de vez em quando em uma área), altere a tabela "weathers" no script abaixo. /data/globalevents/scripts/weather.lua -- This script is part of Weather System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- erase the two examples and add your own new locations inside this table, so they will be randomized local weathers = { -- Rain:create({x=100, y=100}, {x=200, y=200}, 0.5), -- Storm:create({x=100, y=100}, {x=200, y=200}, 0.3), } -- min and max durations of a weather, the value will be randomized local minduration = 240000 local maxduration = 600000 -- globalevent's callback event function onThink(interval, lastExecution, thinkInterval) if #weathers > 0 then weathers[math.random(1, #weathers)]:start(math.random(minduration, maxduration)) end return true end /data/globalevents/globalevents.xml <!-- Weather System --> <globalevent name="weather-eternal" type="start" event="script" value="weather-eternal.lua"/> <globalevent name="weather" interval="900" event="script" value="weather.lua"/> /data/talkactions/scripts/weather.lua -- This script is part of Weather System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- types of weather that can be passed as <weather type> argument to the command local weathers = { ["rain"] = Rain, ["divine-rain"] = DivineRain, ["storm"] = Storm, ["thunder-storm"] = ThunderStorm, ["blizzard"] = Blizzard, ["acid-rain"] = AcidRain, ["meteor-rain"] = MeteorRain, ["sandstorm"] = Sandstorm, ["snowfall"] = Snowfall, ["teleporter"] = Teleporter, ["fissure"] = Fissure, ["static-energy"] = StaticEnergy, ["fireworks"] = Fireworks, ["ice-storm"] = IceStorm, ["avalanche"] = Avalanche, } -- auxiliary function, checks if a given value is an index of a given table local function is_index(t, v) for i in pairs(t) do if i == v then return true end end return false end -- talkaction's callback event function onSay(cid, words, param) local param = string.explode(param, " ") local weather local topleft = {} local bottomright = {} local duration = 1000 local intensity = 0.5 -- number of arguments' validation if #param < 3 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Usage: " .. words .. " <weather type> <top-left position> <bottom-right position> [duration=3000] [intensity=0.5]") return true end -- weather type's validation if not is_index(weathers, string.lower(param[1])) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid weather type.") return true end weather = weathers[param[1]] -- top-left position's validation if not param[2] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Top-left position must be specified.") return true end -- top-left position's format validation local param_topleft = string.explode(param[2], "x") param_topleft[1] = tonumber(param_topleft[1]) param_topleft[2] = tonumber(param_topleft[2]) if not param_topleft[1] or param_topleft[1] < 0 or not param_topleft[2] or param_topleft[2] < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Top-left position is invalid. Use format <x>x<y> like this: 100x100. Values must be valid positive numbers.") return true end topleft.x = param_topleft[1] topleft.y = param_topleft[2] -- bottom-right position's validation if not param[3] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Bottom-right position must be specified.") return true end -- bottom-right position's format validation local param_bottomright = string.explode(param[3], "x") param_bottomright[1] = tonumber(param_bottomright[1]) param_bottomright[2] = tonumber(param_bottomright[2]) if not param_bottomright[1] or param_bottomright[1] < 0 or not param_bottomright[2] or param_bottomright[2] < 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Bottom-right position is invalid. Use format <x>x<y> like this: 100x100. Values must be valid positive numbers.") return true end bottomright.x = param_bottomright[1] bottomright.y = param_bottomright[2] -- duration's validation param[4] = tonumber(param[4]) if not param[4] then duration = 3000 elseif param[4] <= 0 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Weather duration must be a valid number greater than 0.") return true else duration = param[4] end -- intensity's validation param[5] = tonumber(param[5]) if param[5] and param[5] >= 0 and param[5] <= 1 then intensity = param[5] elseif param[5] then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Weather intensity must be a valid number between 0 and 1.") return true end -- create and start the weather with the specified arguments weather:create(topleft, bottomright, intensity):start(duration) return true end /data/talkactions/talkactions.xml <!-- Rain System --> <talkaction log="yes" words="/weather" access="3" event="script" value="weather.lua"/>
  11. Vou postar alguns scripts meus que estiveram engavetados. Faz algum tempo que fiz estes scripts, então não vou postar screenshots ou como configurar, mas as configurações são fáceis de entender, então divirtam-se. Esse é o remake de um dos meus melhores scripts, muito melhor que a primeira versão. Foi meu segundo script pra open tibia feito usando orientação a objetos (ao menos ao jeito OO de Lua). Quem já jogou Diablo 2 vai entender do que se trata. Esse sistema consiste em vários "teleports", chamados de "warps", espalhados no seu mapa, aonde você quiser. Cada warp tem uma identificação, por exemplo "dark cave" ou "venore". Todos os warps são interligados, o que significa que o player pode ir de um warp à outro, desde que esteja pisando em cima de um warp. Porém, ele só pode ir para outro lugar caso tenha ativado o warp desse lugar antes: Se um player nunca esteve na "dark cave" ou não ativou o warp de lá, ele não pode usar um outro warp para ir para lá. Para ativar um warp, o player deve dar "use" no warp ou pisar em cima dele. Para ver a lista de warps ativados e as restrições de cada warp, o player deve dar "use" no warp. Para ir de um warp para outro, o player deve satisfazer as condições de level ou mana do warp de destino e ter ativado o warp de destino antes. Além disso, deve saber a identificação do outro warp (que pode descobrir dando "use" em algum warp) e estar pisando em cima de algum warp, e então dizer "warp identificação do destino". Por exemplo, se eu estou em venore e quero ir para a dark cave, e já ativei o warp de lá antes, basta pisar em cima do warp de venore e dizer "warp dark cave". Você pode usar o item que quiser como sendo um warp. Eu usava o item de ID 9742, mas parece que ele é moveable. Apenas tenha certeza de alterar o ID do item no actions.xml e no movements.xml. Para criar um novo warp, coloque o item no mapa e abra o arquivo /data/lib/warpgate.lua, e vá até o final dele. Existem três warps de exemplo já adicionados. Apague-os e, para criar um novo, use o seguinte comando: warp:new(1000, "Gate 1", {x=1, y=1, z=7}, 10, 20) Onde o 1000 é a StorageID do warp, "Gate 1" é a identificação do warp, {x=1, y=1, z=7} é a posição do warp, 10 é a mana necessária e 20 é o level necessário. A mana e o level podem ser omitidos. Por exemplo, para configurar a dark cave com StorageID 5000: warp:new(5000, "Dark Cave", {x=100, y=120, z=8}) Agora, ao script: /data/lib/warpgate.lua -- This script is part of Warp Gate System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. warp = { config = { statusInactive = -1, statusActive = 1, talkType = TALKTYPE_ORANGE_1, warpEffect = CONST_ME_MAGIC_GREEN, stepIn = CONST_ME_MAGIC_BLUE, stepOut = CONST_ME_POFF, listPrefix = " ", listHeadline = "You can warp to:", noWarp = "You must stand above a warp gate.", noDestiny = "The gate you want to warp doesn't exist.", noMana = "You can't support the mana consumed by the gate you want to warp.", noLevel = "You can't support the level required by the gate you want to warp.", inDestiny = "You can't warp the gate that you are standing.", notActive = "You must find and activate your destiny's gate before warp it.", inFight = "You cannot warp a gate while you are in battle.", }, name = "", pos = { x = nil, y = nil, z = nil, }, mana = 0, level = 0, gates = {}, } function warp:new(id, name, pos, mana, level) if self:getWarpById(id) then return self:getWarpById(id) end local object = {id=id or #warp.gates+1, name=name, pos=pos, mana=mana, level=level} local index = {} setmetatable(object, {__index = self}) warp.gates[id] = {} setmetatable(warp.gates[id], {__index = object}) return object end function warp:getList() return self.gates end function warp:getWarpById(id) return self.gates[id] end function warp:getWarpByName(name) for index, warp in pairs(self.gates) do if warp.name:lower() == name:lower() then return warp end end return false end function warp:getWarpByPosition(pos) for index, warp in pairs(self.gates) do if warp.pos.x == pos.x and warp.pos.y == pos.y and warp.pos.z == pos.z then return warp end end return false end function warp:isActive(cid) if getPlayerStorageValue(cid, self.id) == self.config.statusActive then return true end return false end function warp:activate(cid) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The Warp Gate is now active!") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE) return setPlayerStorageValue(cid, self.id, self.config.statusActive) end function warp:deactivate(cid) return setPlayerStorageValue(cid, self.id, self.config.statusInactive) end warp:new(1000, "Gate 1", {x=1, y=1, z=7}) warp:new(2000, "Gate 2", {x=2, y=2, z=7}) warp:new(3000, "Gate 3", {x=3, y=3, z=7}) /data/actions/scripts/warpgate.lua -- This script is part of Warp Gate System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. function onUse(cid, item, frompos, itemEx, pos) local usedwarp = warp:getWarpByPosition(pos) if not usedwarp then return false end if not usedwarp:isActive(cid) then usedwarp:activate(cid) return true end local text, names = warp.config.listHeadline .. "\n", {} for index, gate in pairs(warp:getList()) do if gate:isActive(cid) then table.insert(names, gate.name) end end table.sort(names) for index, value in pairs(names) do text = text .. "\n" .. warp.config.listPrefix .. value if warp:getWarpByName(value).mana > 0 then text = text .. " [MP: " .. warp:getWarpByName(value).mana .. "]" end if warp:getWarpByName(value).level > 0 then text = text .. " [Lv: " .. warp:getWarpByName(value).level .. "]" end end doShowTextDialog(cid, item.itemid, text) return true end /data/actions/actions.xml <!-- Warp Gate System --> <action itemid="9742" script="warpgate.lua"/> /data/movements/scripts/warpgate.lua -- This script is part of Warp Gate System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. function onStepIn(cid, item, pos) local usedwarp = warp:getWarpByPosition(pos) if usedwarp then if not usedwarp:isActive(cid) then usedwarp:activate(cid) return true end doSendMagicEffect(pos, warp.config.stepIn) end return true end function onStepOut(cid, item, pos) if warp:getWarpByPosition(pos) then doSendMagicEffect(pos, warp.config.stepOut) end return true end /data/movements/movements.xml <!-- Warp Gate System --> <movevent type="StepIn" itemid="9742" script="warpgate.lua"/> <movevent type="StepOut" itemid="9742" script="warpgate.lua"/> /data/talkactions/scripts/warpgate.lua -- This script is part of Warp Gate System -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. function onSay(cid, words, param) local pos = getCreaturePosition(cid) local usedwarp = warp:getWarpByPosition(pos) local destwarp = warp:getWarpByName(param) if not usedwarp then doPlayerSendCancel(cid, warp.config.noWarp) doSendMagicEffect(pos, CONST_ME_POFF) return true end if not destwarp then doPlayerSendCancel(cid, warp.config.noDestiny) doSendMagicEffect(pos, CONST_ME_POFF) return true end if not destwarp:isActive(cid) then doPlayerSendCancel(cid, warp.config.notActive) doSendMagicEffect(pos, CONST_ME_POFF) return true end if getCreatureCondition(cid, CONDITION_INFIGHT) then doPlayerSendCancel(cid, warp.config.inFight) doSendMagicEffect(pos, CONST_ME_POFF) return true end if pos.x == destwarp.pos.x and pos.y == destwarp.pos.y and pos.z == destwarp.pos.z then doPlayerSendCancel(cid, warp.config.inDestiny) doSendMagicEffect(pos, CONST_ME_POFF) return true end if getCreatureMana(cid) < destwarp.mana then doPlayerSendCancel(cid, warp.config.noMana) doSendMagicEffect(pos, CONST_ME_POFF) return true end if getPlayerLevel(cid) < destwarp.level then doPlayerSendCancel(cid, warp.config.noLevel) doSendMagicEffect(pos, CONST_ME_POFF) return true end doSendMagicEffect(destwarp.pos, warp.config.warpEffect) doCreatureSay(cid, words .. " " .. param, warp.config.talkType) doCreatureAddMana(cid, -destwarp.mana) doTeleportThing(cid, destwarp.pos) return true end /data/talkactions/talkactions.xml <!-- Warp Gate System --> <talkaction words="warp" sensitive="false" event="script" value="warpgate.lua"/>
  12. Não usem com itens stackables. Vou postar alguns scripts meus que estiveram engavetados. Faz algum tempo que fiz estes scripts, então não vou postar screenshots ou como configurar, mas as configurações são fáceis de entender, então divirtam-se. Este é um sisteminha bem simples: Coloque uma ActionID (configurável nos .xml) em um item, e ele ficará imóvel e inutilizável, servido apenas como item de exibição. Bom para fazer lojas sem aquelas bancadas pra bloquear o caminho do player. Ele não conseguirá arrastar o item nem usar, então você pode colocar o item no meio da sala, em um lugar que todos possam chegar perto. Quando algum player dá look no item, vai ser exibido no final da descrição que o item é só de exposição. /data/actions/scripts/sample.lua -- This script is part of Sample Items -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. function onUse(cid, item) if not isPlayer(cid) then return true end doPlayerSendDefaultCancel(cid, RETURNVALUE_CANNOTUSETHISOBJECT) return true end /data/actions/actions.xml <!-- Sample Items --> <action actionid="9000" event="script" value="sample.lua"/> /data/creaturescripts/scripts/login.lua registerCreatureEvent(cid, "SampleItems") /data/creaturescripts/scripts/sample.lua -- This script is part of Sample Items -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. local actionid = 9000 local message = "This item is just a sample." function onLook(cid, thing, pos, dist) local descr if not isPlayer(cid) or thing.actionid ~= 9000 then return true end descr = getItemInfo(thing.itemid).description if descr then descr = descr .. " " end descr = (descr or "") .. message doItemSetAttribute(thing.uid, "description", descr) return true end /data/creaturescripts/creaturescripts.xml <!-- Sample Items --> <event type="look" name="SampleItems" event="script" value="sample.lua"/> /data/movements/scripts/sample.lua -- This script is part of Sample Items -- Copyright (C) 2011 Skyen Hasus -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. function onRemoveItem(item, tile, lastpos, cid) if not isPlayer(cid) then return true end doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTMOVEABLE) doTeleportThing(item.uid, lastpos, true) return true end /data/movements/movements.xml <!-- Sample Items --> <movevent type="RemoveItem" actionid="9000" event="script" value="sample.lua"/>
  13. Aew pessoal do XTibia estou postando um system que achei mt legal, o Car System entao vamos lá !! Abra a pasta do seu ot e vá em Data/Talkactions/Scripts crie um arquivo .lua chamado car e ponha : --<< Configurable >>-- local storages = { speed = 314622, status = 352993 } -- Empty storages local cfg = { min_speed = 300, -- better not increase than that [ the least speed for a car ] max_speed = 200, -- better not decrease than this [ the maximum speed for a car ] Increase_per_command = 100, -- The speed increase or decrease value per each command (!car speed // !car slow) Car_Explode = true -- Keep it true , so your map isnt filled with cars } -->> END <<-- --<< Functions >>-- function isWalkable(pos, creature, pz)-- Modificações by Hudsin,Arkires e Pinpao Xtibia if getTileThingByPos({x = pos.x, y = pos.y, z = pos.z, stackpos = 0}).itemid == 0 then return false end if getTopCreature(pos).uid > 0 and creature then return false end if getTileInfo(pos).protection and pz then return false, true end local n = not proj and 3 or 2 for i = 0, 255 do pos.stackpos = i local tile = getTileThingByPos(pos) if tile.itemid ~= 0 and not isCreature(tile.uid) then if hasProperty(tile.uid, n) or hasProperty(tile.uid, 7) then return false end end end return true end function getCarSpeed(cid) return getPlayerStorageValue(cid,storages.speed) end function setCarSpeed(cid,value) return setPlayerStorageValue(cid,storages.speed, getPlayerStorageValue(cid,storages.speed) + value) end function setCarStatus(cid,value) return setPlayerStorageValue(cid,storages.status,value) end function carMove(cid) return getPlayerStorageValue(cid,storages.status) > 0 and true or false end function move(cid,time) local dir = getCreatureLookDir(cid) local id = isInArray({1,3},getCreatureLookDir(cid)) and 7267 or 7266 local place = getPositionByDirection(getThingPos(cid),dir,1) if isWalkable(place,true,true,true) then doRemoveItem( getTileItemById(getThingPos(cid),7267).uid > 0 and getTileItemById(getThingPos(cid),7267).uid or getTileItemById(getThingPos(cid),7266).uid ) doTeleportThing(cid,place,false) addEvent(doSendMagicEffect,time+10,place,34) doCreateItem(id,1,place) if carMove(cid) then addEvent(move,time,cid,getCarSpeed(cid)) else doRemoveItem( getTileItemById(getThingPos(cid),7267).uid > 0 and getTileItemById(getThingPos(cid),7267).uid or getTileItemById(getThingPos(cid),7266).uid ) end else doCreatureSetNoMove(cid, 0) doPlayerSendTextMessage(cid,27,"You have hit somthng.") setCarStatus(cid,0) if cfg.Car_Explode then doRemoveItem( getTileItemById(getThingPos(cid),7267).uid > 1 and getTileItemById(getThingPos(cid),7267).uid or getTileItemById(getThingPos(cid),7266).uid ) doSendAnimatedText(getThingPos(cid),"Crashed",TEXTCOLOR_RED) doSendMagicEffect(getThingPos(cid),31) end end end --<< Functions Ends <<-- function onSay(cid, words, param, channel) if param == "speed" then if carMove(cid) then if getCarSpeed(cid) > cfg.max_speed then setCarSpeed(cid,-(cfg.Increase_per_command)) addEvent(doSendAnimatedText,10,getThingPos(cid),"Speeding",TEXTCOLOR_GREEN) else setCarSpeed(cid,cfg.max_speed) doPlayerSendCancel(cid,"You car.") end else doPlayerSendCancel(cid,"You should start moving first.") end elseif param == "slow" then if carMove(cid) then if getCarSpeed(cid) < cfg.min_speed then setCarSpeed(cid,cfg.Increase_per_command) addEvent(doSendAnimatedText,10,getThingPos(cid),"Slowing",TEXTCOLOR_GREEN) else setCarSpeed(cid,cfg.min_speed) doPlayerSendCancel(cid,"The car is in its minumium speed.") end else doPlayerSendCancel(cid,"You should start moving first.") end elseif param == "stop" then -- by DarkVelocity Xtibia if carMove(cid) then setCarStatus(cid,0) doCreatureSetNoMove(cid, 0) else doPlayerSendCancel(cid,"Car is already stopped.") end elseif param == "move" then if not carMove(cid) then if getTileItemById(getThingPos(cid),7267).uid < 1 and getTileItemById(getThingPos(cid),7266).uid < 1 then local item = isInArray({1,3},getCreatureLookDir(cid)) and 7267 or 7266 doCreateItem(item,1,getThingPos(cid)) end setPlayerStorageValue(cid,storages.speed,cfg.min_speed) setCarStatus(cid,1) doCreatureSetNoMove(cid, 1) move(cid,getCarSpeed(cid)) else doPlayerSendCancel(cid,"Car is already moving.") end end return true end Depois vá em Talkactions/talkactions.xml e ponha : <talkaction words="!car" event="script" value="car.lua"/> OBS :Esse system ele usa um treno para andar em cima dele como se fosse um carro é mt legal !! Espero que tenha ajudado !! Descupem se estiver mal organizado ou ruim podem colocar oque quiserem na resposta pois este é meu primeiro topico !! Te Ajudei ? REP + !! Não Vai Cair O Dedo !!
  14. Ola galerinha xtibiana. Vou disponibilizar um sistema de mensagens offline de modo simples e pratica. Não e necessário a utilização de database basta um arquivo de texto. Para mandar uma mensagem e so dizer /msg(nome do player, mensagem). E quando o player logar ele vai ter que abrir uma channel de mensagens off e ele receberá as mensagens. Vamos a instalação. Crie um arquivo de TEXTO chamado de mensagens na pasta data do seu otserv Agora vá em lib e crie um arquivo lua chamado de mensagens: function doSendMsg(cid, receptor, msg) local file = io.open("./mensagens.txt", "a") file:write("\n Player "..tostring(receptor).." Mensagem: "..tostring(msg).." por "..getCreatureName(cid).."End") file:close() end function getPlayerMgs(name) local x = {} local msg = io.open("./mensagens.txt", "r") for i in msg:read("*a"):gmatch("Player "..name.." Mensagem: (.-)End") do table.insert(x, tostring(i)) io.close() end return x or 0 end Vá em data/xml e abra o arquivo channel.xml. E coloque isto: Vá em talkactions e crie um arquivo lua chamado de mens e coloque isto: function onSay(cid, words, param, channel) local t = string.explode(param, ",") if not t[1] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você deve dizer o nome do player /msg(nome do player, mensagem)") and false end if not t[2] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você deve escrever a mensagem /msg(nome do player, mensagem)") and false end if #t[2] <= 4 then return doPlayerSendCancel(cid, "Você deve dizer a msg com mais de 4 caracteres /msg(nome do player, mensagem)") and false end if not playerExists(t[1]) then return doPlayerSendCancel(cid, "Este player não existe") and false end local pid = getPlayerByNameWildcard(receptor) if pid then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua mensagem não foi enviado porque este player esta online") and false end doSendMsg(cid, t[1], t[2]) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Sua mensagem foi enviado com sucesso para "..t[1].."") return true end Vá em talkactions.xml e coloque esta tag: Vá em creaturescripts e crie um arquivo lua chamado de mens e coloque este código: function onLogin(cid) local mens = getPlayerMgs(getCreatureName(cid)) local str = "Você tem "..#mens.." mensagens olhe na channel de Mensagens Off" if #mens >= 1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, str) return true end return true end Vá em creaturescripts e crie um arquivo lua chamado de mensagens e coloque isto: function onJoinChannel(cid, channelId) if channelId == 68 then local mens = getPlayerMgs(getCreatureName(cid)) for i = 1, #mens do doShowTextDialog(cid, 1397, mens[i]) end return true end return true end Registre o evento em login.lua colocando isto antes do ultimo return true: Vá em creaturescripts e coloque esta tag em creaturescripts.xml: E isto ae pessoal. Agora quando o player logar ele recebe a mensagem e basta ele abrir a channel e ir clikando "Ok" nas paginas do dialogo
  15. Olá galeres, maais um sistema pra vocês aqui. E novidade, dessa vez eu não usei MOD O que é: Um sistema em que o GOD cria uma pergunta com a resposta que quiser e os players devem respondê-la. Quem acerta, ganha 1 ponto, que posteriormente poderá ser trocado por quiz bags, que dão prêmios aleatórios ou simplesmente podem rasgar se você tiver azar. Scripts: Configurando: Imagens: Observações: • Não há bugs até o momento • Testado apenas em TFS 0.3.6 Créditos: LuckOake -- Pelo sistema em geral Vodkart -- Por arrumar a talkaction Demonbholder -- Por ajudar com o NPC Just this, obrigado.
  16. Como funciona? É um sistema aprimorado do Guild Points, onde há uma Loja EXCLUSIVA para Guilds no Website, assim não misturando Doadores e Jogadores Normais. Primeiramente faça o Download abaixo. Download Coloque os arquivos em seus devidos locais. - Os arquivos da pasta "talkactions" coloque em seu OTServer. - Os arquivos da pasta "Parte do Site" coloque no seu xampp, ou lampp se for Linux. Logo após vá no seu site/config/config.php e logo após de: $config['site']['shop_system'] = 1; Adicione: $config['site']['shopguild_system'] = 1; Agora execute as querys da pasta "Parte do Site" em sua database. Logo após vai em layout/tibiacom/layout.php e procure por: <a href='?subtopic=shopsystem'> Logo no final do script após </a> adicione: <a href='?subtopic=guildshop'> <div id='submenu_shopsystem' class='Submenuitem' onmouseover='MouseOverSubmenuItem(this)' onmouseout='MouseOutSubmenuItem(this)'> <div class='LeftChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div> <div id='ActiveSubmenuItemIcon_shopsystem' class='ActiveSubmenuItemIcon' style='background-image:url(".$layout_name."/images/menu/icon-activesubmenu.gif);'></div> <div class='SubmenuitemLabel'><font color='green'/><b>Shop Guild</b></font></div> <div class='RightChain' style='background-image:url(".$layout_name."/images/general/chain.gif);'></div> </div> </a> Após isso vá em index.php na pasta principal do seu WebSite, procure por: case "shopsystem"; E logo no final do script após break; adicione: case "shopguild"; $subtopic = "shopsystem"; $topic = "Shop System"; include("shopsystem.php"); break; Pronto! O sistema está perfeitamente instalado. Instruções: - Para adicionar ou remover items do Shop apenas pela database em z_guild_shop_system. - Para configurar a quantidade de pontos e a quantidade de players necessários edite no arquivo lua na parte dos talkactions. Créditos: Hastle Host ChaitoSoft Eduardo Lima
  17. » CLASSIC PREMIUM V2 ! « Versão Testada: TFS 0.3.6: 8.60 Opa galera, esse é mais um tópico meu, agora de Estagiário :)) Neste tópico irei apresentar-lhes o Classic Premium v2, que usei algumas coisas de base do Perfect System (by Vodkart), agora contém: • GOD pode checar quantos Premium Days o player tem, pelo comando /checkdays NOMEDOPLAYER • GOD também pode adicionar Premium Days, pelo comando /addpremium NOME, QUANTIDADE • Temos também o comando /removedays NOME, QUANTIDADE que o GOD poderá fazer. • Além disso, temos mais duas novidades, os comandos: !changender e !removeskull, ambos removem 5 Premium Days do player! » Comandos de GOD Vamos lá, primeiramente vá na pasta data/talkactions, crie um arquivo chamadopremiumtalk.lua e adicione isso dentro: function onSay(cid, words, param) local player = getPlayerByName(param) local t = string.explode(param, ",") if words == "/checkdays" then if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.") return true end if not isPlayer(player) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true end return doPlayerPopupFYI(cid, "Player checked have "..getPlayerPremiumDays(player).." days of Premium Account!") end if words == "/addpremium" then local t = string.explode(param, ",") local player = getPlayerByNameWildcard(t[1]) if not tonumber(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end if(not player)then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true end doPlayerAddPremiumDays(player, tonumber(t[2])) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You has been added "..tonumber(t[2]).." days of Premium Account to the player! ") doRemoveCreature(player) end if words == "/removedays" then local t = string.explode(param, ",") local player = getPlayerByNameWildcard(t[1]) if not tonumber(t[2]) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.") return true end if(not player)then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player not found.") return true end doPlayerRemovePremiumDays(player, tonumber(t[2])) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You has been removed "..tonumber(t[2]).." Premium Account Days of the player!") end return true end E no arquivo talkactions.xml adicione a tag que vêm a seguir: <talkaction words="/addpremium;/removedays;/checkdays" access="4" event="script" value="premiumtalk.lua"/> » Premium Door e Premium Scroll Muito bem, agora na pasta data/actions/scripts, crie um arquivo chamado scroll.lua e adicione isso dentro: local days_gain = 30 -- Dias que ganham function onUse (cid,item,frompos,item2,topos) if not doRemoveItem(item.uid) then return true end doPlayerAddPremiumDays(cid, days_gain) doSendMagicEffect(getCreaturePosition(cid), 14) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você acaba de ganhar 30 dias de Premium Account, terá áreas exclusivas e 35% a mais de EXP como benefício!") return true end Crie outro arquivo, mas agora com o nome de premiumdoor.lua e ponha isso dentro: function onUse(cid, item, frompos, item2, topos) if not isPremium(cid) then doPlayerSendTextMessage(cid,22,"Você precisa ter Premium Account para passar!") return false end doTransformItem(item.uid, item.itemid + 1) doTeleportThing(cid, frompos, true) return true end Abra o arquivo actions.xml e adicione essas tags: <action itemid="9004" event="script" value="scroll.lua"/> <action actionid="7779" script="premiumdoor.lua"/> OBS: Para fazer com que a porta seja para Premiums, no seu Map Editor, adicione a seguinte ACTIONID nela: 7779! » Classic Premium Tile Em data/movements/scripts, crie um arquivo chamado premiumtile.lua e adicione isso dentro: function onStepIn(cid, item, position, fromPosition) if not isPremium(cid) then doTeleportThing(cid, fromPosition, true) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Você não tem acesso Premium Account!") doSendMagicEffect(getCreaturePosition(cid), 2) return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"Bem Vindo á Área Premium!") return true end Ea tag no arquivo movements.xml coloque: <movevent type="StepIn" actionid="19456" event="script" value="premiumtile.lua"/> Para fazer com que apenas Premiums passe pelo piso, adicione a ACTIONID 19456 pelo seu Map Editor no piso! » Classic Mods Na pasta do seu OT, vá na pasta mods, crie um arquivo chamado classic_changender.xml e coloque isso dentro: <?xml version="1.0" encoding="UTF-8"?> <mod name="ChangeSex Classic" version="1.0" author="Roksas" enabled="yes"> <config name="changender_config"><![CDATA[ config = { costPremiumDays = 5 } ]]></config> <talkaction words="!changender" event="buffer"><![CDATA[ domodlib('changender_config') if(getPlayerSex(cid) >= 2) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Voce nao tem sexo para mudar!") return end if(getPlayerPremiumDays(cid) < config.costPremiumDays) then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Desculpe, voce nao tem " .. config.costPremiumDays .. " Premium Days necessarios!") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return end if(getPlayerPremiumDays(cid) < 65535) then doPlayerAddPremiumDays(cid, -config.costPremiumDays) end doPlayerSetSex(cid, getPlayerSex(cid) == PLAYERSEX_FEMALE and PLAYERSEX_MALE or PLAYERSEX_FEMALE) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Voce mudou seu sexo e isso lhe custou " .. config.costPremiumDays .. " days de Premium Account! Relogue para que faca efeito.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_RED) ]]></talkaction> </mod> E crie outro arquivo, mas com o nome de classic_removeskull.xml e adicione isso: <?xml version="1.0" encoding="UTF-8"?> <mod name="Classic Remover" version="1.0" author="Roksas" enabled="yes"> <talkaction words="!removeskull" event="script"><![CDATA[ local noRemove = {SKULL_YELLOW} local playerSkull = getPlayerSkullType(cid) if isInArray(noRemove, playerSkull) then doPlayerSendCancel(cid, "Voce nao pode remover esse tipo de skull.") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return true elseif playerSkull == SKULL_NONE or getPlayerPremiumDays(cid) < 5 then doPlayerSendCancel(cid, "Voce nao tem skull ou 5 days de Premium Account!") doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF) return true else db.executeQuery("UPDATE `killers` SET `unjustified` = 0 WHERE `id` IN (SELECT `kill_id` FROM `player_killers` WHERE `player_id` = " .. getPlayerGUID(cid) .. ")") doPlayerSendTextMessage(cid, 27, "Seus frags,skull e 5 days de Premium Account foram removidos!") doPlayerRemovePremiumDays (cid,5) doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_RED) doSendAnimatedText(getPlayerPosition(cid), "POFF!", 180) doCreatureSetSkullType(cid,0) doPlayerSetSkullEnd(cid, 0, playerSkull) end return true ]]></talkaction> </mod> » Classic Premium Rates Abra a pasta do seu OT, vá em data/creaturescripts/scripts, adicione um arquivo lá chamado premiumrate.lua e coloque isso dentro dele: function onLogin(cid) local rate = 1.35 local days = getPlayerPremiumDays(cid) if isPremium(cid) then doPlayerSetExperienceRate(cid, rate) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você tem "..((rate - 1)*100).."% de EXP em vantagem, Ainda lhe restam "..days.." dias de Premium!") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Tornesse Premium e tenha "..((rate - 1)*100).."% a mais de EXP!") end return true end Agora abra o arquivo login.lua na mesma pasta, procure por um trecho mais ou menos assim: registerCreatureEvent(cid, "kill") registerCreatureEvent(cid, "onPrepareDeath") registerCreatureEvent(cid, "PlayerLogout") registerCreatureEvent(cid, "onPrepareDeath") Ao encontrar, adicione isso no fim ou no começo ou no meio deles: registerCreatureEvent(cid, "ExpVip") Muito bem, agora no arquivo creaturescripts.xml adicione essa tag: <event type="login" name="ExpVip" script="premiumrate.lua"/> Explicando: Para configurar as rates procure por esse trecho no script: local rate = 1.35 O número 35, significa a porcentagem. Ou seja, 35% de Exp Rate em vantagem, ajuste como quiser: 20, 50, 60... Bom galera, isso foi tudo. Espero que tenham gostado da versão v2 do Classic Premium! Aguardo respostas, sugestões e críticas a respeito! Agradeço Vodkart por algumas funções e bases. Encerrarei com algumas ScreenShoots do meu Sistema! Obrigado e BENÇA ) » SCREENSHOOTS
  18. Versões: Foi feito para servidores que não tem o market system, mas funciona desde o 8.54 até 9.6+ Suporta: servidores Sqlite e MySql Sobre: O Npc basicamente funciona da seguinte maneira, você "deposita" alguns items neste npc e durante "X" dias ele vende para você, claro que o npc irá cobrar "Y" preço pelo serviço... Para mais informações acessem o link que explica com imagens: http://www.xtibia.co...mo-auction-npc/ Basta fazer o download, executar a query que é pedida e depois disso colocar os arquivos em seus respectivas pastas. Npc Auction.rar
  19. Ola pessoal do ekstibiana. Versões para cima de 9.x foi retirado o sistema de banimento que e muito necessario em ots. Então resolvi desenvolver uma versão "beta" para vocês O sistema ta bem limitadinho mais e funcional. Para banir uma pessoa diga /ban(nome da pessoa,dias,comentario) depois a personagem sera banida e seu ip sera banido. Para ver a lista de banidos fale /banidos Limitações do sistema Vamos a instalar o sistema. GO! Execute o seguinte comando na sua database: CREATE TABLE "ban" ( "player" INT NOT NULL, "ip" INT NOT NULL, "time" INT NOT NULL ); Agora vá em lib e crie um arquivo lua chamado de ban e coloque isto: function doPlayerBan(cid, time, coment) exhaustion.set(cid, 24546, time*3600*24*1000) db.executeQuery("INSERT INTO `ban` VALUES (".. getPlayerGUID(cid) ..", ".. getPlayerIp(cid) ..", ".. time ..")") setPlayerStorageValue(cid, 42622, tostring(coment)) doBroadcastMessage(""..getPlayerName(cid).." foi banido em "..time.." dia(s) por "..coment.."") end function getPlayerBan(cid) return exhaustion.check(cid, 24546) end function getPlayerIPbyBan(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` = ".. getPlayerGUID(cid) ..";") return ban:getDataInt("ip") end function getBanTimeByIp(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `ip` = ".. getPlayerIp(cid) ..";") return ban:getDataInt("time") end function getPlayerBanDb(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` = ".. getPlayerGUID(cid) ..";") if ban:getID() == -1 then return true end return false end function getPlayerBanIpDb(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `ip` = ".. getPlayerIp(cid) ..";") if ban:getID() == -1 then return true end return false end function getPlayerTimeBan(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` = ".. getPlayerGUID(cid) ..";") return ban:getDataInt("time") end function getPlayerIpBan(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` ORDER BY `time`") if ban:getID() == -1 then return false end while true do local ips = ban:getDataInt("ip") if getPlayerIp(cid) == ips then return true end if not ban:next() then return false end end end function doShowTextBans(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` ORDER BY `time`") str = "Players Banidos:\n\n" if ban:getID() == -1 then doShowTextDialog(cid, 1387, "Não existe nenhum player Banido") return true end while true do local name = ban:getDataInt("player") local time = ban:getDataInt("time") local player = getPlayerNameByGUID(name) str = str .. player .. " - Banido por "..time.." dia(s) \n\n" if not ban:next() then doShowTextDialog(cid, 1397, str) break end end end function doShowTextBansForGroupUp(cid) local ban = db.getResult("SELECT * FROM `ban` WHERE `player` ORDER BY `time`") str = "Players Banidos:\n\n" if ban:getID() == -1 then doShowTextDialog(cid, 1387, "Não existe nenhum player Banido") return true end while true do local name = ban:getDataInt("player") local time = ban:getDataInt("time") local ip = ban:getDataInt("ip") local player = getPlayerNameByGUID(name) local ip = doConvertIntegerToIp(ip) str = str .. player .. " - Banido por "..time.." dia(s) Ip "..ip.." \n\n" if not ban:next() then doShowTextDialog(cid, 1397, str) break end end end Agora vá em talkactions e crie um arquivo lua chamado de ban e coloque este codigo: function onSay(cid, words, param, channel) local t = string.explode(param, ",") if param == " " or param == "" or not param or isNumeric(param) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o nome do player dizendo /ban(nome do player,dias de ban,por que ele foi banido)") end if t[2] == " " or t[2] == "" or not t[2] then return doPlayerSendCancel(cid, "Coloque os dias de ban para o player dizendo /ban(nome do player,dias de ban,por que ele foi banido)") end if t[3] == " " or t[3] == "" or not t[3] then return doPlayerSendCancel(cid, "Coloque os comentarios do player dizendo /ban(nome do player,dias de ban,por que ele foi banido)") end local player = getPlayerByNameWildcard(t[1], false) if not player then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este player "..t[1].." não existe") end doPlayerBan(player, t[2], t[3]) doRemoveCreature(player) return true end Continue em talkactions e crie outra arquivo lua chamado de banidos: function onSay(cid, words, param, channel) if getPlayerGroupId(cid) >= 3 then return doShowTextBansForGroupUp(cid) end doShowTextBans(cid) return true end Coloque as seguintes tags em talkactions.xml: Agora vá em creaturescripts e crie um arquivo lua chamado de ban e coloque isto: function onLogin(cid) if getPlayerBan(cid) then doPlayerPopupFYI(cid, "Você esta banido") return addEvent(doRemoveCreature, 180, cid) end if getPlayerIpBan(cid) then doPlayerPopupFYI(cid, "Foi dectado um ip banido character banido") return addEvent(doRemoveCreature, 180, cid) end return true end Registre o evento em login.lua colocando isto antes do ultimo RETURN: registerCreatureEvent(cid, "ban") Terminado coloque esta tag em creaturescripts.xml:
  20. Bom galera, sempre vejo os Scripters criando sistemas de Vip, com Tile Vip, Itens Vip, e tudo que tiver direito. Na minha opinião;o isso se adapta mais em servidores High Exp x999. Hoje irei postar o meu Sistema de Premium para servidores Low Rate. Usei como exemplo o Double EXP do Vodkart! Vejamos: Primeiramente, vamos na pasta data/actions/scripts, crie um arquivo chamado PremiumScroll.lua e adicione isso dentro: function onUse (cid,item) if getPlayerPremiumDays (cid) > 14 then doPlayerSendTextMessage (cid, MESSAGE_INFO_DESCR, "Você precisa ter 15 ou menos dias restantes de Premium Account, para utilizar esse serviço novamente!") doSendMagicEffect (getCreaturePosition (cid), 2) end if doRemoveItem(item.uid, 0) then doPlayerAddPremiumDays(cid, 30) doSendMagicEffect(getCreaturePosition(cid), 14) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Você acaba de ganhar 30 dias de Premium Account, terá áreas exclusivas e 35% a mais de EXP como benefício!") end return true end Agora vá na pasta data/creaturescripts/scripts/login.lua .No meio do script terão alguns Events como esses exemplo: registerCreatureEvent(cid, "kill") registerCreatureEvent(cid, "onPrepareDeath") registerCreatureEvent(cid, "PlayerLogout") registerCreatureEvent(cid, "onPrepareDeath") registerCreatureEvent(cid, "deathBroadcast") registerCreatureEvent(cid, "DeathBroadcast") registerCreatureEvent(cid, "Idle") Agora ao meio desses, adicione esse Event: registerCreatureEvent(cid, "PremiumRate") Vá na pasta data novemente, abra a pasta items e em seguida o arquivo items.xml. Aperte CTRL + F e digite 9004. Assim você irá encontrar um item dourado, oque usaremos como "Premium Scroll". Apague-o e adicione essa tag: <item id="9004" article="a" name="Premium Scroll"> <attribute key="description" value="Esse Scroll lhe dá 30 dias de Premium!" /> <attribute key="weight" value="23.00" /> </item> Caso não exista e seu servidor for versão 8.60 adicione do mesmo jeito. Ok, ainda na pasta data/creaturescripts, na pasta scripts adicione um arquivo chamado PremiumRate.lua e adicione isso dentro: function onLogin(cid) local rate = 1.35 local days = getPlayerPremiumDays(cid) local config = { yes_premium = "Você tem "..((rate - 1)*100).."% de EXP em vantagem, Ainda lhe restam "..days.." dias de Premium!", not_premium = "Tornesse Premium e tenha "..((rate - 1)*100).."% a mais de EXP!", premium = isPremium(cid) } if (config.premium == TRUE) then doPlayerSetExperienceRate(cid, rate) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.yes_premium) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, config.not_premium) end return TRUE end Muito bem agora vamos adicionar as Tags! No arquivo actions.xml na pasta data/actions adicione essa tag: <action itemid="9004" event="script" value="PremiumScroll.lua"/> E no arquivo creaturescripts.xml: <event type="login" name="PremiumRate" script="premiumrate.lua"/> • Explicação do Sistema: Bom, no primeiro Script, ao usar o Item ID 9004 (Premium Scroll), os players recebem 30 dias de Premium, mas se já tiver mais de 15 dias não podera usar, apenas 15 ou menos dias! No segundo script eu mostrei a vocês o Sistema "Double EXP" do Vodkart, editei ele para que jogadores Premium Account pudessem ter as rates. Lá você pode encontrar esse trecho: local rate = 1.35 Aonde se situa o número "35" você muda para a porcentagem desejada. Como por exemplo 50 = 50%, 40 = 40%. E assim sucessivamente! • Algumas Screen Shoots do meu Sistema: Galera, muito obrigado. Espero que gostem, qualquer dúvida irei responder! Reportem erros, etc. @EDIT Se alguém tiver algum sugestão de incrementar o meu Sistema, só falar, ai eu ponho. Bye )
  21. Nome: Oneshot's Anti-bot Autor: Oneshot Tipo: Sistema Descrição Este é um sistema de anti-bot simples, que envia um código numérico de 6 dígitos para cada jogador online e pede para que, através de um comando, este código de verificação seja ativado. O jogador tem um limite de tempo para fazer isso, e caso não faça, este é banido por um tempo configurável ou então, preso em um certo lugar do mapa. Instalação 1. Em data/lib, crie um arquivo chamado antibot.lua e cole o conteúdo abaixo: ANTIBOT_STORAGE_1 = 109001 ANTIBOT_STORAGE_2 = 109002 ANTIBOT_STORAGE_3 = 109003 ANTIBOT_TYPE = 2 -- [1] = Banimento, [2] = Prisão ANTIBOT_DURATION = 120 -- Em segundos ANTIBOT_DURATION_DELAY = 10 -- Em segundos ANTIBOT_MESSAGE = "[Oneshot's Anti-bot]\nSeu código de verificação é %s, responda através do comando !antibot, caso contrário, será ".. (ANTIBOT_TYPE == 1 and "banido" or "preso") ..".\nVocê têm %s segundos." ANTIBOT_BAN_TIME = 24 * 60 * 60 ANTIBOT_PRISON = {x = 1019, y = 867, z = 7} ANTIBOT_PRISON_FROMPOSITION = {x = 1018, y = 865, z = 7} ANTIBOT_PRISON_TOPOSITION = {x = 1020, y = 869, z = 7} ANTIBOT_PRISON_DURATION = 3 * 60 * 60 ANTIBOT_TEMPLE = {x = 1027, y = 912, z = 5} function AntiBot(cid) if not isCreature(cid) then return end local time = getCreatureStorage(cid, ANTIBOT_STORAGE_1) local answer = getCreatureStorage(cid, ANTIBOT_STORAGE_2) if getPlayerAccess(cid) >= 3 or not(getPlayerAccountManager(cid) == MANAGER_NONE) then return end if isInRange(getThingPosition(cid), ANTIBOT_PRISON_FROMPOSITION, ANTIBOT_PRISON_TOPOSITION) then return end if time == -1 and answer == -1 then return end if os.time() >= time then doCreatureSetStorage(cid, ANTIBOT_STORAGE_1, -1) doCreatureSetStorage(cid, ANTIBOT_STORAGE_2, -1) doBroadcastMessage("[ANTI-BOT] O jogador ".. getCreatureName(cid) .." foi ".. (ANTIBOT_TYPE == 1 and "banido" or "preso") .." por uso de bot.") if ANTIBOT_TYPE == 1 then doAddAccountBanishment(getPlayerGUID(cid), 0, (os.time() + ANTIBOT_BAN_TIME), 12, 3, "[ANTI-BOT]") doRemoveCreature(cid) else doTeleportThing(cid, ANTIBOT_PRISON) doCreatureSetStorage(cid, ANTIBOT_STORAGE_3, os.time() + ANTIBOT_PRISON_DURATION) addEvent(function() if isCreature(cid) then doTeleportThing(cid, ANTIBOT_TEMPLE) end end, ANTIBOT_PRISON_DURATION * 1000) end else doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, ANTIBOT_MESSAGE:format(answer, (time - os.time()))) addEvent(AntiBot, ANTIBOT_DURATION_DELAY * 1000, cid) end end 2. Crie um arquivo chamado antibot.lua em data/globalevents/scripts, cole o conteúdo abaixo function onThink(interval) for _, cid in ipairs(getPlayersOnline()) do local answer = math.random(100000, 999999) doCreatureSetStorage(cid, ANTIBOT_STORAGE_1, os.time() + ANTIBOT_DURATION) doCreatureSetStorage(cid, ANTIBOT_STORAGE_2, answer) AntiBot(cid) end return true end Adicione a seguinte linha em globalevents.xml <globalevent name="antibot" interval="900" event="script" value="antibot.lua"/> 3. Crie um arquivo em data/creaturescripts/scripts, cole o conteúdo abaixo function onLogin(cid) local time = getCreatureStorage(cid, ANTIBOT_STORAGE_1) local answer = getCreatureStorage(cid, ANTIBOT_STORAGE_2) if answer == -1 then return true end if isInRange(getThingPosition(cid), ANTIBOT_PRISON_FROMPOSITION, ANTIBOT_PRISON_TOPOSITION) then if os.time() > getCreatureStorage(cid, ANTIBOT_STORAGE_3) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seu tempo de prisão acabou.") doTeleportThing(cid, ANTIBOT_TEMPLE) else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você ainda está preso por uso de bot.") end return true end if os.time() > ANTIBOT_STORAGE_1 then doCreatureSetStorage(cid, ANTIBOT_STORAGE_1, os.time() + ANTIBOT_DURATION) return true end AntiBot(cid) return true end Adicione a seguinte linha em seu creaturescripts.xml <event type="login" name="Antibot" event="script" value="antibot.lua"/> 4. Crie um arquivo chamado antibot.lua em data/talkactions/scripts, cole o conteúdo abaixo function onSay(cid, words, param, channel) param = tonumber(param) or "" local time = getCreatureStorage(cid, ANTIBOT_STORAGE_1) local answer = getCreatureStorage(cid, ANTIBOT_STORAGE_2) if time == -1 and answer == -1 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "O anti-bot não está ativado.") return true end if param == "" then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Digite uma senha de verificação válida.") return true end if param ~= answer then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você digitou a senha incorreta. Digite corretamente, caso contrário, será banido.") return true end doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Ótimo! Você digitou a resposta correta. O anti-bot foi desativado.") doCreatureSetStorage(cid, ANTIBOT_STORAGE_1, -1) doCreatureSetStorage(cid, ANTIBOT_STORAGE_2, -1) return true end Adicione a seguinte linha em seu talkactions.xml <talkaction words="!antibot" event="script" value="antibot.lua"/> Você pode fazer várias configurações na lib do sistema ANTIBOT_STORAGE_1 = 109001 ANTIBOT_STORAGE_2 = 109002 ANTIBOT_STORAGE_3 = 109003 ANTIBOT_TYPE = 2 -- [1] = Banimento, [2] = Prisão ANTIBOT_DURATION = 120 -- Em segundos ANTIBOT_DURATION_DELAY = 10 -- Em segundos ANTIBOT_MESSAGE = "[Oneshot's Anti-bot]\nSeu código de verificação é %s, responda através do comando !antibot, caso contrário, será ".. (ANTIBOT_TYPE == 1 and "banido" or "preso") ..".\nVocê têm %s segundos." ANTIBOT_BAN_TIME = 24 * 60 * 60 ANTIBOT_PRISON = {x = 1019, y = 867, z = 7} ANTIBOT_PRISON_FROMPOSITION = {x = 1018, y = 865, z = 7} ANTIBOT_PRISON_TOPOSITION = {x = 1020, y = 869, z = 7} ANTIBOT_PRISON_DURATION = 3 * 60 * 60 ANTIBOT_TEMPLE = {x = 1027, y = 912, z = 5} Como a duração do ban, a posição da prisão, o tempo de prisão, dentre outras coisas. Como não consegui fazer funcionar o banimento de um jogador só na versão 0.3.6pl1, sendo isto possível apenas na 0.4.0, resolvi colocar para o tipo de banimento ser na conta toda. Abraços.
  22. Ola galerinha do xtibiana. Vocês lembram do shopping system beta? Bem o shopping system beta foi um sistema criado por min a um tempinho. O link da versão beta é: http://www.xtibia.co...demo-by-caotic/ Os players podiam vender e comprar itens de forma rápida e pratica só que na versão demo ele tinha limitações então resolvi fazer a versão 1.0 com mais funções. Ele funciona da seguinte maneira: O player vende seu item no shopping depois outro player resolve ver o shopping e acaba comprando o item. Quando o player vendedor estiver online ele recebera a mensagem dizendo que o seu item foi vendido e ele recebera o money da compra. Na versão 1.0 do shopping system foi adicionado: Vamos a instalação. Primeiro execute estes comandos na sua database: CREATE TABLE "shop" ( "item" INT NOT NULL, "price" INT NOT NULL, "players" INT NOT NULL ); ALTER TABLE `players` ADD `shop` INT(15) NOT NULL DEFAULT 0 Agora va em lib e crie um arquivo lua chamado shop e coloque isto: function doPlayerAddItemInShop(cid, itemid, price) db.executeQuery("INSERT INTO `shop` VALUES (".. itemid ..", ".. price ..", ".. getPlayerGUID(cid) ..")") return true end function getItemPriceInShop(itemid) local shop = db.getResult("SELECT * FROM `shop` WHERE `item` = ".. itemid ..";") return shop:getDataInt("price") end function getItemPlayerInShop(itemid) local shop = db.getResult("SELECT * FROM `shop` WHERE `item` = ".. itemid ..";") return shop:getDataInt("players") end function getExistItemInShop(itemid) local shop = db.getResult("SELECT * FROM `shop` WHERE `item` = ".. itemid ..";") if shop:getID() ~= -1 then return true end return nil end function getExistItemPlayerInShop(player, itemid) local shop = db.getResult("SELECT * FROM `shop` WHERE `players` = ".. player .." and `item` = ".. itemid ..";") if shop:getID() ~= -1 then return true end return nil end function doPlayerBuyItemInShop(cid, itemid, player) doPlayerAddItem(cid, itemid) doPlayerRemoveMoney(cid, getItemPriceInShop(itemid)) db.executeQuery("UPDATE `players` SET `shop` = "..getItemPriceInShop(itemid).." WHERE `id` = "..getItemPlayerInShop(itemid)) db.executeQuery("DELETE FROM `shop` WHERE `players` = ".. player .." and `item` = ".. itemid ..";") end function getMoneyGainInShop(cid) local money = db.getResult("SELECT `shop` FROM `players` WHERE `id` = "..getPlayerGUID(cid)) return money:getDataInt("shop") end function setMoneyGainInShop(cid, money) db.executeQuery("UPDATE `players` SET `shop` = "..money.." WHERE `id` = "..getPlayerGUID(cid)) end function doShowListShop(cid) local item = db.getResult("SELECT * FROM `shop` WHERE `item` ORDER BY `price`") str = "Itens a venda no shopping:\n\n" if item:getID() == -1 then doShowTextDialog(cid, 1387, "Não ha itens disponiveis no shopping\n Não existe itens no shopping!") return true end while true do local list = item:getDataInt("item") local players = item:getDataInt("players") local price = item:getDataInt("price") local shops = "Itens em Shopping" local list = string.upper(getItemNameById(list)) local players = getPlayerNameByGUID(players) str = str .. list .. " -("..players..")- Preço ("..price..")]\n\n" if not item:next() then doShowTextDialog(cid, 1397, str) break end end end Agora vá em talkactions/script e crie um arquivo lua chamado list e coloque este codigo: function onSay(cid, words, param, channel) doShowListShop(cid) return true end Agora vá em talkactions denovo crie um arquivo lua chamado de shop e coloque isto: function onSay(cid, words, param, channel) if param == " " or param == "" or not param then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o id do item") end local t = string.explode(param, ",") if not t[1] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o id do item") end if not t[2] then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o preço do item") end if(isNumeric(t[1])) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o nome do item") end if not (isNumeric(t[2])) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque O PREÇO DO ITEM") end if not getItemIdByName(t[1], false) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este item "..t[1].." não existe") end local item = getItemIdByName(t[1]) local price = t[2] if getPlayerItemCount(cid, item) < 1 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem "..t[1].."") end if getExistItemPlayerInShop(getPlayerGUID(cid), item) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você já pos este item no shop") end doPlayerRemoveItem(cid, item, 1) doPlayerAddItemInShop(cid, item, price) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você colocou no shopping o seu item "..t[1].."") return true end Agora continue em talkactions e crie um arquivo lua chamado de comprar e coloque isto: function onSay(cid, words, param, channel) if param == " " or param == "" or not param or isNumeric(param) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o nome do item dizendo /compra(nome do item,nome do player)") end local t = string.explode(param, ",") if not getItemIdByName(t[1], false) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este item "..t[1].." não existe") end local itemid = getItemIdByName(t[1]) local player = getPlayerGUIDByName(t[2]) if not getExistItemInShop(itemid) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Este item não existe no shopping") end if t[2] == " " or t[2] == "" or isNumeric(t[2]) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Coloque o nome do vendendor dizendo /compra(nome do item,nome do player)") end if not doPlayerRemoveMoney(cid, getItemPriceInShop(itemid)) then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Você não tem "..getItemPriceInShop(itemid).." para comprar "..t[1].." do shopping") end if not player then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não existe nenhum item com o nome deste player.") end doPlayerBuyItemInShop(cid, itemid, player) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Parabens você comprou "..t[1].."") return true end Agora coloque estas tags em talkactions.xml: Agora vá em creaturescripts/scripts e crie um arquivo lua chamado de shop: function onThink(cid, interval) if getMoneyGainInShop(cid) > 0 then doPlayerAddMoney(cid, getMoneyGainInShop(cid)) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Seu itens foi vendidos você recebeu "..getMoneyGainInShop(cid).." money") setMoneyGainInShop(cid, 0) return true end return true end Registre o evento colocando em login.lua de creaturescripts e coloque isto antes do ultimo return: registerCreatureEvent(cid, "shop") Agora vá em creaturescrips.xml e coloque esta tag: E prontinho sistema instalado Comandos
  23. Report Sytem Ola galera do xtibiana hoje venho apresentar um sisteminha beta que fiz. O sistema e o seguinte: Um player qualquer reporta dizendo /report (e o nome do bug ou alguma irregularidade no otserv) se o adminstrador estiver online ele já recebe a mensagem e fica salva em um documento de log se o adminstrador não estiver online ele salva no documento de log e quando ele entrar recebe uma mensagem dizendo que existe uma nova denuncia. O log de reports e um documento de texto onde fica salvado todas as denuncias as denuncias são salvas assim: Todas bem organizadas e com quebra de linhas a cada denuncia. Vamos ao scripts: Primeiro crie um arquivo de texto(.txt) chamado report na sua pasta de seu ot onde fica o seu executavel. Lembre-se que deve ser um arquivo txt e que deve estar na pasta raiz do seu ot. Depois de criar o arquivo vá em talkactions e crie um arquivo LUA chamado de report. E coloque o seguinte script: function onSay(cid, words, param) if exhaustion.check(cid, 2123) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Precisa esperar para reportar novamente") return false end if #param <= 10 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seu report precisa ter pelo menos 10 caracters") return false end local file = io.open("./report.txt", "a") file:write("\n "..getPlayerName(cid).." "..os.date("%A").." as "..tostring(os.date("%X")):sub(1, 5).." reportou dizendo ("..param..")") file:close() setGlobalStorageValue(28212, getGlobalStorageValue(28212)+1) exhaustion.set(cid, 2123, 36000) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Seu report foi enviada com sucesso logo sera atendindo obrigado pela colaboração") for _, id in ipairs(getPlayersOnline()) do if getPlayerGroupId(cid) > 5 then doShowTextDialog(cid, 1952, ""..getPlayerName(cid).." acabou de reportar dizendo ("..param..") este report esta salvo no log") exhaustion.set(cid, 2123, 36000) return true end return true end end Agora vá em talkactions.xml e coloque a seguinte tag: <talkaction words="/report" event="script" value="report.lua"/> Agora vá em creaturescripts e crie um arquivo LUA chamado de alerta. E coloque isto dentro: function onLogin(cid) if getPlayerGroupId(cid) > 5 then if getGlobalStorageValue(28212) == 0 then doShowTextDialog(cid, 1952, "1 player reportaram para ver o report abra o log de reports") setGlobalStorageValue(28212, -1) return true end if getGlobalStorageValue(28212) ~= -1 then doShowTextDialog(cid, 1952, ""..getGlobalStorageValue(28212).." player reportaram para ver o report abra o log de reports") setGlobalStorageValue(28212, -1) return true end return true end return true end Coloque a tag em creaturescripts.xml <event type="login" name="report" event="script" value="alerta.lua"/> Depois registre o evento em login.lua Primeiro va em creaturescripts/scripts e abra o arquivo chamado login.lua antes do ultimo "return" coloque isto: registerCreatureEvent(cid, "report") E prontinho estamos o novo report sytem. A versão e beta mais esta funcional e bem intuitiva ótima para ser usada.
  24. FAAALA GALERES Eu (DE NOVO) trouxe pra vocês um sistema. MAAAS dessa vez, não é um sistema qualquer. Dessa vez é aquele tão cobiçado sistema de banimento do servidor RadBr! O que é: É um sistema de banimento através de warnings setadas pelo GOD em um player, e outro player poderá desbanir este já banido por barras (Default ID: 9971), dependendo do número de warnings. Script: Configurando: Imagens: Uso: /ban Nome,Motivo,Warnings* !unban Nome *OBS: Não é obrigatório especificar as warnings no comando /ban. Se não forem especificadas, serão adicionadas +1 warning automaticamente. (Exemplo: /ban Nome,Motivo) Observações: - Sou lindo, eu sei Créditos: - LuckOake (Pelo Sistema)
  25. Galera, alguem sabe ou pode criar ou sabe se ja existe um SIstema de Stage exemplo o cara do lvl 1 ao 50, ganha 500 de XP do lvl 51 ao 100 400 e assim vai? Por favor se eu estiver na area errado me move pois procurei achei essa mais adequada Obrigado
×
×
  • Criar Novo...