Ir para conteúdo

fitaisolante

Banidos
  • Total de itens

    152
  • Registro em

  • Última visita

3 Seguidores

Sobre fitaisolante

Informações

  • Char no Tibia
    Tony Scott
  • Forma que conheci o xTibia
    Sites de Busca
  • Sou
    Scripter

Últimos Visitantes

O bloco dos últimos visitantes está desativado e não está sendo visualizado por outros usuários.

fitaisolante's Achievements

  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
  • Quem Está Navegando   0 membros estão online

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