Ir para conteúdo

fitaisolante

Banidos
  • Total de itens

    152
  • Registro em

  • Última visita

Tudo que fitaisolante postou

  1. O City War é um evento exclusivo do Global War em que você entra no teleport, e começa a matar players la dentro, e quem matar mais ao final do evento ganha... Ele anuncia de 5 em 5 minutos o placar dos players! Vou estar disponibilizando o mapa também, que é da versão 8.7. Crie uma arquivo lua com nome qualquer em data/lib e coloque isso dentro: configCW = {timetostart = 300, telpos = {x=32340, y=32213, z=7}, -- aonde o teleport aparecerá stats = 201201201701, -- não mexa kill = 201201201702, -- não mexa death = 201201201703, -- não mexa ostime = 201201201704, -- não mexa evttime = 25, -- quantos minutos o evento durará topleftPos = {x=32722, y=31336, z=6}, -- canto esquerdo superior botrightPos = {x=32791, y=31384, z=6}, -- canto direito inferior templepos = {x=32369, y=32241, z=7}, -- posição do templo arenapos = {{x=32722, y=31340, z=6}, {x=32786, y=31336, z=6}, {x=32722, y=31380, z=6}, {x=32783, y=31374, z=6}}, -- posições em que os players podem cair aleatoriamente dentro do evento times = 8, -- não mexa finaltime = 300 -- não mexa } function configCW:new() local newevt = {} setmetatable(newevt, self) self.__index = self doBroadcastMessage("The City War will be open in " .. self.timetostart .. " seconds.") setGlobalStorageValue(self.stats, 0) addEvent(function () newevt:start() end, self.timetostart*1000) end function configCW:start() if getGlobalStorageValue(self.stats) == 0 then setGlobalStorageValue(self.ostime, os.time()) local teleport = doCreateItem(1387, self.telpos) doItemSetAttribute(teleport, "aid", 5540) setGlobalStorageValue(self.stats, 1) doBroadcastMessage("The City War is starting...") for _, posi in pairs(self.arenapos) do local item = getTileItemById(posi, 1387) if(item.uid ~= 0) then doRemoveItem(item.uid) end end addEvent(function () self:preclose() end, self.evttime*1000*60) addEvent(function () self:announce(0) end, (self.evttime/self.times)*1000*60) end end function configCW:announce(times) if times < self.times then if #self:getTopFrags(true) >= 1 then doBroadcastMessage("Top City War fraggers: " .. self:getTopFrags()) end addEvent(function () self:announce(times+1) end, (self.evttime/self.times)*1000*60) end end function configCW:preclose() if getGlobalStorageValue(self.stats) == 1 then setGlobalStorageValue(self.stats, 2) doBroadcastMessage("The City War will end in " .. self.finaltime .. " seconds.") addEvent(function () self:close() end, self.finaltime*1000) local item = getTileItemById(self.telpos, 1387) if(item.uid ~= 0) then doRemoveItem(item.uid) end end end function configCW:close() if getGlobalStorageValue(self.stats) == 2 then if #self:getTopFrags(true) >= 1 then doBroadcastMessage("The City War has ended. The winners are: " .. self:getTopFrags()) else doBroadcastMessage("The City War has ended. There were no winners.") end doRemovePlayersFromArea(self.topleftPos, self.botrightPos, self.templepos) for _, posi in pairs(self.arenapos) do doCreateTeleport(1387, self.templepos, posi) end for place, info in ipairs(self:getTopFrags(true)) do if place > 5 then break end local cid = getPlayerByName(info) doPlayerSendTextMessage(cid, 4, "Congratulations, you were the " .. place .. "º place in the City War.") doPlayerAddItem(cid, 6571, 1) end setGlobalStorageValue(self.stats, -1) end end function configCW:isPlayerInEvent(cid) if getPlayerStorageValue(cid, self.stats) == -1 or getPlayerStorageValue(cid, self.stats) - os.time() <= -5 or getGlobalStorageValue(self.stats) < 1 then return false end return true end function configCW:getTopFrags(tab) local frag = {} for _, pid in pairs(getPlayersOnline()) do if (getPlayerStorageValue(pid, self.kill) ~= -1 or getPlayerStorageValue(pid, self.death) ~= -1) and self:isPlayerInEvent(pid) then local kill = getPlayerStorageValue(pid, self.kill)+1 local death = getPlayerStorageValue(pid, self.death)+1 print(getCreatureName(pid), kill-death) table.insert(frag, {getCreatureName(pid), kill-death}) end end print(#frag) local frag, str, n = doOrderTab(frag, 0), nil, 5 print(#frag) if tab then return frag else if #frag < 5 then n = #frag end for i = 1, n do local cid = getPlayerByName(frag[i]) local kill = getPlayerStorageValue(cid, self.kill)+1 local death = getPlayerStorageValue(cid, self.death)+1 str = str and str .. ", " .. frag[i] .. "[" .. kill .. "/" .. death .. "]" or frag[i] .. "[" .. kill .. "/" .. death .. "]" end end return str end function doOrderTab(tabela, value) local max, index = {}, nil for i = 1, #tabela do valor = value for a, b in ipairs(tabela) do if b[2] > valor then valor = b[2] valor2 = b[1] index = a end end table.remove(tabela, index) if valor ~= value then table.insert(max, valor2) end end return max end Agora em data/movements/scripts coloque: function onStepIn(cid, item, position, lastPosition, fromPosition, toPosition) if isPlayer(cid) and getGlobalStorageValue(configCW.stats) == 1 then doTeleportThing(cid, configCW.arenapos[math.random(1, #configCW.arenapos)]) doSendMagicEffect(getPlayerPosition(cid), 29) if not(configCW:isPlayerInEvent(cid)) then setPlayerStorageValue(cid, configCW.stats, getGlobalStorageValue(configCW.ostime) + configCW.evttime*60 + configCW.finaltime) setPlayerStorageValue(cid, configCW.kill, -1) setPlayerStorageValue(cid, configCW.death, -1) end else doTeleportThing(cid, fromPosition) end return true end e em movements.xml coloque: <!--City War --> <movevent type="StepIn" actionid="5540" event="script" value="city war.lua"/> Em creaturescripts/scripts coloque: function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) if isInRange(getCreaturePosition(cid), configCW.topleftPos, configCW.botrightPos) then setPlayerStorageValue(cid, configCW.death, getPlayerStorageValue(cid, configCW.death) +1) setPlayerStorageValue(lastHitKiller[1], configCW.kill, getPlayerStorageValue(lastHitKiller[1], configCW.kill) +1) end return true end E em creaturescripts.xml coloque: <!-- Citywar --> <event type="preparedeath" name="CityWar" event="script" value="city war.lua"/> Está instalado o seu sistema.. Para quem quiser o mapa, está aqui o download: http://www.mediafire.com/download/x2bnrnu7ttopbna/city_war.rar Créditos: Demonbholder 100% Eu por estar disponibilizando.
  2. O sistema funciona assim, o player da use em um item, e então toda vez que ele morrer e logar de volta a bless é re-colocada automaticamente. (não precisa dar use novamente no item, ele é para sempre) Vamos ao código! Em actions/scripts coloque dentro de um arquivo.lua: local efeito = {27,28, 29,79} function onUse(cid, item, frompos, item2, topos) if getPlayerStorageValue(cid, 89210) == 1 then doPlayerSendTextMessage(cid,22,"You already used this book!") else doPlayerSendTextMessage(cid,22,"Congratulations! From now, you will be blessed automatically.") setPlayerStorageValue(cid, 89210, 1) doRemoveItem(item.uid, 1) doSendMagicEffect(getThingPos(cid), efeito[math.random(#efeito)]) end end Em actions.xml coloque: <!-- Book Of Blessing --> <action itemid="8977" event="script" value="livro_blessing.lua"/> Eu coloquei o ID de um livro que não é possivel ser pego de loot. Agora em creaturescripts/scripts coloque: local cfg = { message = "You have been blessed automatically!", bless = {1, 2, 3, 4, 5}, efeito = {27,28, 29,79} } function onLogin(cid) for i = 1, #cfg.bless do if getPlayerStorageValue(cid, 89210) == 1 and getPlayerBlessing(cid, i) then doPlayerSendTextMessage(cid,22, "You are blessed!") return true end if getPlayerStorageValue(cid, 89210) == 1 then doPlayerAddBlessing(cid, i) doPlayerSendTextMessage(cid,22,cfg.message) doSendMagicEffect(getThingPos(cid), cfg.efeito[math.random(#cfg.efeito)]) end end return true end Em creaturescripts.xml: <!-- Bless Automatica --> <event type="login" name="checkbless" script="checkbless.lua"/> E está pronto o seu sistema!!! Esse sistema era exclusivo do Global War! Créditos: Keilost 100%
  3. E aí galera, vim apresentar o hunted system, é um sistema que consiste em um "caçador de recompensa", você diz "!hunt Nome do Player,quantidade de dinheiro" e então o player definido fica hunted para o servidor todo e quem mata-lo ganha a quantia de dinheiro que você ofereceu ( o dinheiro é descontado do seu char).. Fotos: Diga !hunt para saber os players hunted online... Vou parar de falar e ir ao sistema! Em talkactions/scripts crie um arquivo lua e coloque isso dentro: function onSay(cid, words, param) local multiplier = 10000 local str = string.explode(param, ",") if not str[1] then doShowTextDialog(cid, 2366, huntedsOnline()) return true end local hunt = getPlayerByNameWildcard(string.lower(str[1])) if (not isPlayer(hunt)) then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Hunted System] This player does not exist or is not online.") end local formula = (getPlayerLevel(hunt) * 10 / 50 * multiplier) if (cid == hunt) then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Hunted System] Sorry but you can not put a contract on yourself.") end if (getPlayerAccess(hunt) >= 3) then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Hunted System] You can not put a contract in this player.") end if (not str[2]) or (not isNumber(str[2])) then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Hunted System] Enter amount of golds that will be paid.") end if (getPlayerStorageValue(hunt, 201310251658) >= 1) then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Hunted System] Can not perform this operation. The chosen player already has contracts.") end if (getPlayerMoney(cid) < tonumber(str[2])) or (tonumber(str[2]) < formula) then return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Hunted System] You do not have enough money. For the player ["..str[1].."], you need pay ["..tostring(formula).."] or more golds.") end doPlayerRemoveMoney(cid, str[2]) setPlayerStorageValue(hunt, 201310251658, str[2]) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "[Hunted System] You have created a contract of reward for the player ["..str[1].."] by ["..tostring(str[2]).."] golds.") doBroadcastMessage("[Hunted System] "..getCreatureName(cid).." created a contract to kill the player ["..str[1].."] by ["..tostring(str[2]).."] golds.", MESSAGE_STATUS_CONSOLE_RED) return true end function huntedsOnline() local str = "Hunteds Online:\n\n" for _, a in ipairs(checkHunt()) do if #checkHunt() > 0 then str = ""..str.." - "..getCreatureName(a).." ["..tostring(getPlayerStorageValue(a, 201310251658)).." golds];\n" else str = "There are no contracts online.\n\n" end end return str end function checkHunt() local hunteds = {} for _, b in ipairs(getPlayersOnline()) do if getPlayerStorageValue(b, 201310251658) ~= -1 then table.insert(hunteds, b) end end return hunteds or #hunteds end em talkactions.xml coloque: <talkaction words="!hunt" event="script" value="b_hunterTalk.lua"/> Em creaturescripts/scripts coloque: function onPrepareDeath(cid, lastHitKiller, mostDamageKiller) local golds = getPlayerStorageValue(cid, 201310251658) if getTileInfo(getThingPos(cid)).nologout then return true end if (not isPlayer(cid)) or (not isPlayer(lastHitKiller[1])) then return true end if golds > 0 then setPlayerStorageValue(cid, 201310251658, -1) doPlayerAddMoney(lastHitKiller[1], tonumber(golds)) doBroadcastMessage("[Hunted System] ["..getCreatureName(lastHitKiller[1]).."] fulfilled in ["..getCreatureName(cid).."] the contract and received ["..tostring(golds).."] golds.", MESSAGE_STATUS_CONSOLE_RED) doPlayerSendTextMessage(lastHitKiller[1], 20, "[Hunted System] "..getCreatureName(lastHitKiller[1]).." fulfilled in ["..getCreatureName(cid).."] the contract and received a reward of ["..tostring(golds).."] golds.") return true end return true end e em creaturescripts.xml coloque: <event type="preparedeath" name="b_hunterKill" event="script" value="b_hunterKill.lua"/> Existe uma quantia mínima dependendo do level do player. Existe um sistema parecido só que é por NPC, achei mais legal essa por talkaction. Esse sistema é exclusivo do Global War, feito pelo scripter Roksas e sendo liberado por mim (Keilost).
  4. Obrigado, me ajudou muito... Eu esqueci de por o no position, eu já tinha tentado fazer isso só que não deu certo pois não puis rsrs.. Rep+
  5. Não irá funcionar amigo.. o [1] serve para chamar algum valor na tabela.. Exemplo: b = {arroz, feijão} b[1] = arroz b[2] = feijão
  6. Eu estou com um problema, o meu código não remove todas as pedras, podem me ajudar? local _gnr = { ["Gerador Azul I"] = {{x = 613, y = 42, z = 7, stackpos = 1}, {x = 613, y = 41, z = 7, stackpos = 1}, {x = 613, y = 40, z = 7, stackpos = 1}, {x = 613, y = 43, z = 7, stackpos = 1}, {x = 613, y = 44, z = 7, stackpos = 1}}, ["Gerador Azul II"] = {{x = 613, y = 42, z = 7, stackpos = 1}, {x = 613, y = 41, z = 7, stackpos = 1}, {x = 613, y = 40, z = 7, stackpos = 1}, {x = 613, y = 43, z = 7, stackpos = 1}, {x = 613, y = 44, z = 7, stackpos = 1}}, ["Gerador Azul III"] = {{x = 613, y = 42, z = 7, stackpos = 1}, {x = 613, y = 41, z = 7, stackpos = 1}, {x = 613, y = 40, z = 7, stackpos = 1}, {x = 613, y = 43, z = 7, stackpos = 1}, {x = 613, y = 44, z = 7, stackpos = 1}}, ["Gerador Vermelho I"] = {{x = 613, y = 42, z = 7, stackpos = 1}, {x = 613, y = 41, z = 7, stackpos = 1}, {x = 613, y = 40, z = 7, stackpos = 1}, {x = 613, y = 43, z = 7, stackpos = 1}, {x = 613, y = 44, z = 7, stackpos = 1}}, ["Gerador Vermelho II"] = {{x = 613, y = 42, z = 7, stackpos = 1}, {x = 613, y = 41, z = 7, stackpos = 1}, {x = 613, y = 40, z = 7, stackpos = 1}, {x = 613, y = 43, z = 7, stackpos = 1}, {x = 613, y = 44, z = 7, stackpos = 1}}, ["Gerador Vermelho III"] = {{x = 613, y = 42, z = 7, stackpos = 1}, {x = 613, y = 41, z = 7, stackpos = 1}, {x = 613, y = 40, z = 7, stackpos = 1}, {x = 613, y = 43, z = 7, stackpos = 1}, {x = 613, y = 44, z = 7, stackpos = 1}}, } function onDeath(cid, corpse, killer) if isMonster(cid) then for name, position in pairs(_gnr) do if ((getCreatureName(cid):lower()) == (name:lower())) then doRemoveItem(getThingFromPos(position[1]).uid, 1) end end se eu não boto [1] ele não remove nenhuma, se eu boto [1] ele remove uma..
  7. Só uma nota aqui, É TEMPO e não TEMPLO rsrsrsrsrsrs.. Mals por comentar com o tópico já movido.
  8. Fez o post bonitinho e tals uhahuaha.. Mas se fosse só um script que se tivesse tal skill de fishing ele consegueria pegar tal item seria mais facil..
  9. Para mim é de grande utilidade, para você pode não ser, para outro pode.. Depende do que você precisa, mas tá aí, estou contribuindo de alguma forma.
  10. Amigo, então me passe a função que adiciona pokemon ao player.
  11. function onSay(cid, words, param) if doPlayerRemoveMoney(cid, 100000) == true then doPlayerAddItem(cid, ID DO ITEM, quantidade) doPlayerSendTextMessage(cid,MESSAGE_EVENT_ADVANCE, 'You bought a pokemon!') else doPlayerSendCancel(cid, "You need 100.000 gold coins to buy the pokemon!") end return true end crie um arquivo lua em talkactions/scripts e coloque isso dentro. e em doPlayerAddItem, coloque o ID do item do pokemon e a quantidade em talkactions.xml coloque: <talkaction words="!buyditto" event="script" value="nome_do_arquivo.lua"/> coloque o nome do arquivo que criou ali em value.
  12. http://www.xtibia.com/forum/topic/197056-ctf-capture-the-flag/
  13. So adicionar no Script: doPlayerSendTextMessage(cid,25,"Mana Absorvida.") Já facilitei pra ele, coloquei para sair do char dele, como se fosse o healing.
  14. local config = { item1 = {XXXX, 2000}, -- {ID DO ITEM, QUANTIDADE QUE VAI ALMENTAR DE HEALTH} item2 = {XXXX, 2000}, -- {ID DO ITEM, QUANTIDADE QUE VAI ALMENTAR DE MANA} } function onUse(cid, item, frompos, item2, topos) if item.itemid == config.item1[1] then if getPlayerStorageValue(cid,12345) < 1 then setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) + config.item1[2]) setPlayerStorageValue(cid,12345,1) doCreatureSay(cid, "Você recebeu "..config.item1[2].." de health!", TALKTYPE_ORANGE_1) doRemoveItem(item.uid) else return doPlayerSendCancel(cid, "You can't use this item again.") end elseif item.itemid == config.item2[1] then if getPlayerStorageValue(cid,12346) < 1 then setCreatureMaxMana(cid, getCreatureMaxMana(cid) + config.item2[2]) setPlayerStorageValue(cid,12346,1) doCreatureSay(cid, "Você recebeu "..config.item2[2].." de mana!", TALKTYPE_ORANGE_1) doRemoveItem(item.uid) else return doPlayerSendCancel(cid, "You can't use this item again.") end end return true end
  15. Como funciona? O meu código faz o seguinte, ele registra a quantidade de players online em tal hora no dia (configurável) em um bloco de notas.. Para que eu vou usar isso? Ai vai da sua criatividade, eu mesmo uso para identificar quais são os horários de picos e também para saber se tem um crescimento de players ao passar dos dias. Aqui vai um exemplo de como ele registra os players: http://prntscr.com/2vb4zt Vamos ao script: Em globalevents.xml coloque essa tag: <globalevent name="Monitor_Online" interval="60000" event="script" value="monitoronline.lua"/> Em interval se o seu tfs não for 0.4, coloque 60 Agora na pasta scripts crie um arquivo lua chamado monitoronline.lua e adicione isso dentro: function onThink(interval, lastExecution) local file = io.open("./monitoronline.txt", "a") local hora = {"7:30","11:30","13:30","15:30","17:30","20:30","22:30"} if table.find(hora, os.date("%H:%M")) then file:write("\n Players Online: ".. #getPlayersOnline() .." \n ["..os.date("%x").."] ["..tostring(os.date("%X")):sub(1, 5).."]") file:close() end return true end E pronto, seu sistema já vai estar funcionando, o arquivo de texto aparece na pasta do seu executável.. Eu sincronizei ele com minha página web, se quiserem o código em PHP me mande PM. http://jogar.snowotserv.com/monitoramento.php Créditos: Keilost - 100%
  16. Quer um cafézinho também? haha... Pesquisar não faz mal a ninguém, isso é o BÁSICO de script e pode ser aprendido facilmente procurando na internet. Como criar um monstro: https://www.google.com.br/search?q=como+criar+um+monstro+otserv&oq=como+criar+um+monstro+otserv&aqs=chrome..69i57l2j69i59j69i60l2j69i61.3065j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8 Como criar um item: https://www.google.com.br/search?q=como+criar+um+item+otserv&oq=como+criar+um+item+otserv&aqs=chrome..69i57j0l5.5172j0j7&sourceid=chrome&espv=210&es_sm=93&ie=UTF-8
  17. Eu não acho certo as pessoas se envolverem no tópico, eu estou aprendendo script e no final das contas eu nem aprendo com o meu erro pois criaram outro código.
  18. É, se o cara não souber por o script, não vai funcionar mesmo né, tanto que eu testei e funcionou. Dica: é só você colocar doPlayerRemoveItem(cid,item.uid) não precisa colocar o ID e então ficaria assim: local l = 10000 -- quantidade de life e mana a ser adicionado ao player local s = 310212 -- storage, somente mexa se souber o que está fazendo function onSay(cid, words, param) if getPlayerStorageValue(cid, s) == -1 then setCreatureMaxHealth(cid, getCreatureHealth(cid) + l) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + l) doPlayerSendTextMessage(cid, "Voce ganhou 10000 de life e de mana") doPlayerRemoveItem(cid,item.uid) setPlayerStorageValue(cid, s, 1) return true end end
  19. Não é nada de mais, é alguém tentando se conectar com proxy no seu servidor ou mesmo usando porta do game em vez da porta de login para entrar... Nâo precisa se preocupa.
  20. Ah foi mal rsrs.. Estava fazendo outro código action e acabei confundindo... Editei acima
  21. Em talkactions/scripts crie um arquivo lua com nome qualquer e coloque isso dentro: local l = 10000 -- quantidade de life e mana a ser adicionado ao player local s = 310212 -- storage, somente mexa se souber o que está fazendo function onSay(cid, words, param) if getPlayerStorageValue(cid, s) == -1 then setCreatureMaxHealth(cid, getCreatureHealth(cid) + l) setCreatureMaxMana(cid, getCreatureMaxMana(cid) + l) doPlayerSendTextMessage(cid, "Voce ganhou 10000 de life e de mana") setPlayerStorageValue(cid, s, 1) return true end end em talkactions.xml coloque: <talkaction words="!reward" script="nome_do_arquivo.lua"/>
  22. Ah foi mal, esqueci rsrs... Sim, é os dias vip do seu sistema. local days = 7 -- dias vips local level = 300 -- level que precisa atingir para ganhar os dias function onAdvance(cid, skill, oldlevel, newlevel) if getPlayerLevel(cid) == level and getPlayerStorageValue(cid, 1902339) < 0 then setPlayerStorageValue(cid, 1902339, 1) addVipDaysByAccount(getAccountIdByName(cid), days) doCreatureSay(cid, "Você atingiu o level ".. level .." e ganhou ".. days .." dias vip.", TALKTYPE_ORANGE_1) return true end end
  23. em creaturescripts.xml <event type="advance" name="vip_level" event="script" value="nome_do_arquivo.lua"/> e em scripts, crie um arquivo lua com esse conteúdo. local days = 7 -- dias vips local level = 300 -- level que precisa atingir para ganhar os dias function onAdvance(cid, skill, oldlevel, newlevel) if getPlayerLevel(cid) == level then addVipDaysByAccount(getAccountIdByName(cid), days) doCreatureSay(cid, "Você atingiu o level ".. level .." e ganhou ".. days .." dias vip.", TALKTYPE_ORANGE_1) return true end end
  24. Cara... Scripter = Pessoa que desenvolve o script Script = código, função, etc
  • Quem Está Navegando   0 membros estão online

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