Ir para conteúdo

glacialot

Membro
  • Registro em

  • Última visita

Tudo que glacialot postou

  1. Cara mudei la mas agora eu puxo a alavanca e nao faz nada :s Só diz que eu nao posso usa-la...
  2. Cara eu tive que fazer minha DB, dai deu certo... mas mesmo assim muito obrigado pela ajuda!!!
  3. Esquece deu certo, soh queria que nao desse pro cara sumonar mais bixo antes de matar o bixo e nao desse pras pessoas decer no tile enquanto tem alguem na sala com bixo sumonado...
  4. Exatamente cara, tem como fazer isso?é esse o problema, o cara vai la e fica sumonando bixo enquanto tem outro cara matando no andar debaixo... Frenezi ali no z:14 tenho q por o andar da minha sala neh?
  5. Isso, eu to colocando aqui, mas gostaria do RANK, pois meu objetivo é fazer waves fortes para o cara não chegar ao final, mas que cada wave ele possa ganhar um premio, e passar para a proxima wave...
  6. Aproveitando pra dar uma ideia, teria como fazer um RANK mostrando quantas Waves o cara conseguil matar? Tipo o cara fala !rank arena dai diz Rank da Arena: 1. Player1 / 10 Waves 2. Player2 / 8 Waves 3. Player3 / 5 waves
  7. Cara essa do TILE nao deu certo, porque na verdade todo mundo pode entrar na sala ao mesmo tempo, dai o cara vai la sumona o monster e lura ele para as pessoas matar, mas foda eh q se entra alguem na sala enquanto tão ele deleta o monsters... O bom seria quando o cara puxar a alavanca pra criar o monster, junto quando cria o monstro ele crie um PORTAO na escada, e esse portao soh é removida quando o cara mata o BOSS... teria como? Frenesy coloquei la o Script mas ele deu erro no carregar na distro, diz assim: Event onUse not found
  8. Pessoal eu instalei aqui a Maquina de Summon que tem no TK: http://www.tibiaking.com/forum/topic/26641-m%C3%A1q-summon-20-likeradbr/ Mas é o seguinte os cara vai la com o ITEM e fica sumonando um Monte de bixo e dai sai da sala, dai ninguem mais pode usar porque fica cheiooooo²² de bixo lá, tem como por Delay nisso ai ou por para o cara ter apenas um Summon Scrool no caso? ou que ele mate o BOSS antes de poder sumonar outro, ou até mesmo que ele preciso matar o BOSS pra sair da sala... Agradeçoo!
  9. dani eu ja adicionei a tabela, agora ele nao da mais o erro do events ali, mas continua nao teletransportando o time que perde...
  10. Pessoal to com um monte de linha na distro deste erro ai, porem vou no map editor e clico no ID delas e esta como NO TOWN e clico em alguma e ela não vai, como vou saber onde esta a casa pra mim setar a porta dela? http://prntscr.com/5vazo3 E lá no house XML nao tem as coordenadas tbm: <house name="" houseid="2174" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="7"/> <house name="" houseid="2184" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="49"/> <house name="" houseid="2185" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="35"/> <house name="" houseid="2186" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="62"/> <house name="" houseid="2191" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="96"/> <house name="" houseid="2192" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="57"/> <house name="" houseid="2193" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="11"/> <house name="" houseid="2194" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="12"/> <house name="" houseid="2195" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="11"/> <house name="" houseid="2196" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="16"/> <house name="" houseid="2197" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="16"/> <house name="" houseid="2215" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="21"/> <house name="" houseid="2216" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="21"/> <house name="" houseid="2217" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="20"/> <house name="" houseid="2218" entryx="0" entryy="0" entryz="0" rent="0" townid="0" size="20"/>
  11. UP up Pessoal não tinha reparado mas ele da um erro na distro quando termina o evento: http://prntscr.com/5v4hsj
  12. tipo um globalevent no caso?
  13. glacialot postou uma resposta no tópico em Suporte Tibia OTServer
    Obrigado pela ajuda dos Membros mas ainda não deu certo, segue o erro na outra linha agora: http://prntscr.com/5uwgeh Ele mudou algumas coisas na LIB tambem para criar os portões em alguns lugares, a lib agora esta assim: GRANTOWER = {} GRANTOWER.PREPARETIME = 2 -- Tempo até liberar a entrada para o evento. GRANTOWER.CLOSETIME = 10 -- Tempo em minutos de duração do evento. GRANTOWER.LEVEL = 80 -- Mínimo de level para participar do evento. GRANTOWER.MAXGUILD = 7 -- Máximo de players por guild dentro do evento. GRANTOWER.DATES = {{"Monday", "19:00"}, {"Tuesday", "19:00"}, {"Saturday", "19:00"}, {"Sunday", "22:30"}} -- Dias e horários que ocorrem o evento. GRANTOWER.ENTER = {x = 245, y = 641, z = 7} -- A posição da entrada do castelo, aonde os players são mandados pelo NPC. GRANTOWER.TOWERPOSITION = {x = 264, y = 613, z = 6} -- Posição aonde fica o Gran Tower (o monstro). GRANTOWER.AREA = {{x = 236, y = 587, z = 7}, {x = 283, y = 643, z = 5}} --[[A primeira posição é o canto superior esquerdo do mapa do castelo, e a segunda é o canto direito inferior OBSERVAÇÃO IMPORTANTE: O script foi modificado por mim (xWhiteWolf) para aguentar diferentes andares, apenas coloque a posição dos cantos e o primeiro até o ultimo andar que ele irá remover todo mundo em todos os andares quando alguém matar a gran tower, pra remover isso apenas coloque o z do mesmo andar da gran tower e apenas os membros que estão nesse andar serão teleportados, contudo isso pode ocasionar que pessoas consigam ficar dentro do castelo mesmo após o evento ter sido encerrado!]] GRANTOWER.AURAPERCENT = 0.8 --- porcentagem do dano que irá levar (0.8 = 80%) significa que ele ignora 20% de dano! (adicionado por xWhiteWolf) GRANTOWER.SHURIAURA = true --- colocar true/false se quiser ativar/desativar a aura de shurikens pro player que tem a gran aura. (adicionado por xWhiteWolf) GRANTOWER.GATES = { [1] = {id = 9485, pos = {x=1471, y=134, z=6, stackpos=1}}, [2] = {id = 9485, pos = {x=1472, y=134, z=6, stackpos=1}}, [3] = {id = 9533, pos = {x=1469, y=136, z=6, stackpos=1}}, [4] = {id = 9533, pos = {x=1469, y=137, z=6, stackpos=1}}, [5] = {id = 9485, pos = {x=1451, y=119, z=7, stackpos=1}}, [6] = {id = 9485, pos = {x=1452, y=119, z=7, stackpos=1}}, [7] = {id = 9485, pos = {x=1465, y=123, z=6, stackpos=1}}, [8] = {id = 9485, pos = {x=1466, y=123, z=6, stackpos=1}}, [9] = {id = 9485, pos = {x=1459, y=141, z=7, stackpos=1}}, [10] = {id = 9485, pos = {x=1460, y=141, z=7, stackpos=1}}, [11] = {id = 9485, pos = {x=1457, y=141, z=7, stackpos=1}}, [12] = {id = 9485, pos = {x=1458, y=141, z=7, stackpos=1}}, [13] = {id = 9485, pos = {x=1461, y=141, z=7, stackpos=1}}, [14] = {id = 9485, pos = {x=1448, y=130, z=5, stackpos=1}}, [15] = {id = 9485, pos = {x=1449, y=130, z=5, stackpos=1}}, [16] = {id = 9485, pos = {x=1450, y=130, z=5, stackpos=1}}, [17] = {id = 9485, pos = {x=1451, y=130, z=5, stackpos=1}}, [18] = {id = 9485, pos = {x=1452, y=130, z=5, stackpos=1}} } GRANTOWER.GUARDS = { [1] = {name = "Castle Dark Magician", pos = {x=1463, y=132, z=6}}, [2] = {name = "Castle Guardian", pos = {x=1451, y=122, z=7}}, [3] = {name = "Castle Magician", pos = {x=1467, y=115, z=6}}, [4] = {name = "Castle Soldier", pos = {x=1463, y=146, z=7}}, [5] = {name = "Castle Spellcaster", pos = {x=1449, y=115, z=5}} } --// Favor não mexer daqui para baixo se não souber oque está fazendo!!! GRANTOWER.EMPTYWINNER = "# [Nobody] #" GRANTOWER.PREPARE = 201405051746 GRANTOWER.RUNNING = 201405051747 GRANTOWER.AURA = 201405052018 GRANTOWER.DESTROYCOUNT = 201405051800 GRANTOWER.FINALWINNER = 201405051805 GRANTOWER.SAVELASTWINNER = 201405061333 GRANTOWER.SAVEWINNERGUILDID = 201405061403 function doPrepareGranTower() if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= 1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= 1)) then setGlobalStorageValue(GRANTOWER.PREPARE, 1) addEvent(doStartGranTower, GRANTOWER.PREPARETIME * 60 * 1000) addEvent(doBroadcastMessage, ((GRANTOWER.PREPARETIME / 2) * 60 * 1000), "[Gran Tower] Missing "..tostring((GRANTOWER.PREPARETIME / 2)).." minutes NPC Melkrapo will release the entrance to the event, get ready!") doBroadcastMessage("[Gran Tower] The event will be started in "..tostring(GRANTOWER.PREPARETIME).." minutes, please prepare your weapons and your team.") else print("[Erro] Gran Tower tentou ser iniciado ja ligado, favor verificar o codigo. (Roksas).") end return true end function doStartGranTower() if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= -1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= 1)) then setGlobalStorageValue(GRANTOWER.RUNNING, 1) setGlobalStorageValue(GRANTOWER.PREPARE, -1) setGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID, -1) setGlobalStorageValue(GRANTOWER.FINALWINNER, GRANTOWER.EMPTYWINNER) setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, GRANTOWER.EMPTYWINNER) setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, 0) doCreateMonster("Gran Tower", GRANTOWER.TOWERPOSITION) addEvent(doBroadcastMessage, ((GRANTOWER.CLOSETIME - 1) * 60 * 1000), "[Gran Tower] The event will be closed in one minute. Hurry up!") addEvent(doCloseGranTower, GRANTOWER.CLOSETIME * 60 * 1000) doBroadcastMessage("[Gran Tower] Open event! Run to destroy the Gran Tower.") else print("[Erro] Gran Tower tentou ser iniciado já ligado, favor verificar o código.") end return true end function doCloseGranTower() if ((getGlobalStorageValue(GRANTOWER.PREPARE) ~= 1) and (getGlobalStorageValue(GRANTOWER.RUNNING) ~= -1)) then for index, creature in ipairs(getGranTowerPlayers()) do doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature))) end for index, creature in ipairs(getPlayersOnline()) do if (getPlayerGuildId(creature) >= 1) then if getPlayerGuildId(creature) ~= getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) then setPlayerStorageValue(creature, GRANTOWER.AURA, -1) end end end setGlobalStorageValue(GRANTOWER.RUNNING, -1) if (getCreatureByName("Gran Tower")) then doRemoveCreature(getCreatureByName("Gran Tower"), true) end local TMP_WINNER = getGlobalStorageValue(GRANTOWER.FINALWINNER) doBroadcastMessage("[Gran Tower] The event was completed with "..tostring(getGlobalStorageValue(GRANTOWER.DESTROYCOUNT)).." wrecks to Gran Tower, the final winner was "..(TMP_WINNER)..".") setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, -1) setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, TMP_WINNER) setGlobalStorageValue(GRANTOWER.FINALWINNER, -1) local TMP_WINNER = nil end return true end function getGranTowerPlayers() -- xWhiteWolf local players = {} local andares = math.abs(GRANTOWER.AREA[1].z - GRANTOWER.AREA[2].z) for index, creature in ipairs(getPlayersOnline()) do local z = 0 local pos1 = {x = GRANTOWER.AREA[1].x, y = GRANTOWER.AREA[1].y, z = GRANTOWER.AREA[1].z} local pos2 = {x = GRANTOWER.AREA[2].x, y = GRANTOWER.AREA[2].y, z = GRANTOWER.AREA[2].z} for i = 0, andares do z = z or 0 pos1.z = pos1.z > pos2.z and pos2.z + z or pos1.z + z pos2.z = pos1.z z = 1 if isInArea(getThingPos(creature), pos1, pos2) then table.insert(players, creature) end end end return players end function getGranTowerGuild(guild_id) -- xWhiteWolf local players = {} local andares = math.abs(GRANTOWER.AREA[1].z - GRANTOWER.AREA[2].z) for index, creature in ipairs(getPlayersOnline()) do local z = 0 local pos1 = {x = GRANTOWER.AREA[1].x, y = GRANTOWER.AREA[1].y, z = GRANTOWER.AREA[1].z} local pos2 = {x = GRANTOWER.AREA[2].x, y = GRANTOWER.AREA[2].y, z = GRANTOWER.AREA[2].z} for i = 0, andares do z = z or 0 pos1.z = pos1.z > pos2.z and pos2.z + z or pos1.z + z pos2.z = pos1.z z = 1 if isInArea(getThingPos(creature), pos1, pos2) then if (getPlayerGuildId(creature) == guild_id) then table.insert(players, creature) end end end end return players end -- // Gran Aura \/ function newColor(n) local n = tonumber(n) or 0 local n = n + 19 return tonumber(n) or 0 end function newColor(n) local n = tonumber(n) or 132 local n = n - 19 return tonumber(n) or 132 end -- comentario: se a cor for preta o addon vai para branco sendo que o certo é diminuir 19.. local events = {} function changeOutfit(uid) -- arrumado por xWhiteWolf e adicionado a opção da Shuri local sec = 0.5 local temp = getCreatureOutfit(uid) if (type(temp) == "number") then return true end if getGlobalStorageValue(GRANTOWER.SAVELASTWINNER) ~= getCreatureName(uid) then if getGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID) ~= getPlayerGuildId(uid) then return true end end if GRANTOWER.SHURIAURA then local pos = getCreaturePosition(uid) local effectPos = { [1] = {x = pos.x - 2, y = pos.y - 2, z = pos.z}, [2] = {x = pos.x + 2, y = pos.y + 2, z = pos.z} } for i = 1, #effectPos do position = effectPos[i + 1] or effectPos[i - 1] doSendDistanceShoot(effectPos[i], position, 66) end end local outfit = { lookType = temp.lookType, lookHead = newColor(temp.lookHead), lookBody = newColor(temp.lookBody), lookLegs = newColor(temp.lookLegs), lookFeet = newColor(temp.lookFeet), lookAddons = getCreatureOutfit(uid).lookAddons, } doSetCreatureOutfit(uid, outfit, sec) local event = addEvent(function() if isCreature(uid) then changeOutfit(uid) end end, 3.0 * sec * 450) events[uid] = event return true end
  14. glacialot postou uma resposta no tópico em Suporte Tibia OTServer
    Pessoal estava eu e meu amigo (que é scripter) mechendo algumas coisas no evento Gran Tower, ele fez esse script aqui para que quando o cara matar a Gran Tower todos sejam teletransportado para fora do evento, mas agora ele foi viajar e não consigo contato com ele, e esta dando um erro ao abrir o OT: http://prntscr.com/5uv53g Script: function onDeath(cid, corpse, lastHitKiller, mostDamageKiller) local killer = lastHitKiller[1] if isPlayer(killer) and (getCreatureName(cid) == "Gran Tower") then if (getGlobalStorageValue(GRANTOWER.FINALWINNER) ~= getCreatureName(killer)) then if getPlayerGuildId(killer) >= 1 then for index, creature in ipairs(getGranTowerPlayers()) do doTeleportThing(creature, GRANTOWER.ENTER, true) end else for index, creature in ipairs(getGranTowerPlayers()) do if getPlayerStorageValue(creature, GRANTOWER.AURA) ~= -1 then doTeleportThing(creature, GRANTOWER.ENTER, true) end end end if (getPlayerGuildId(killer) >= 1) then setGlobalStorageValue(GRANTOWER.SAVEWINNERGUILDID, getPlayerGuildId(killer)) for index, creature in ipairs(getGranTowerGuild(getPlayerGuildId(killer))) do setPlayerStorageValue(creature, GRANTOWER.AURA, 1) end end setPlayerStorageValue(killer, GRANTOWER.AURA, 1) addEvent(changeOutfit, 0, killer) setGlobalStorageValue(GRANTOWER.SAVELASTWINNER, getCreatureName(killer)) addEvent(doCreateMonster, 2 * 1000, "Gran Tower", GRANTOWER.TOWERPOSITION) for i, 5 do doRemoveCreature(getThingPos(GRANTOWER.GUARDS[i].pos).uid)) addEvent(doCreateMonster, 500, GRANTOWER.GUARDS[i].name, GRANTOWER.GUARDS[i].pos) end for v, 18 do if getThingPos(GRANTOWER.GATES[v].pos).id ~= 9485 and 9533 then addEvent(doCreateItem, 500, GRANTOWER.GATES[i].id, GRANTOWER.GATES[v].pos) end end setGlobalStorageValue(GRANTOWER.FINALWINNER, getCreatureName(killer)) setGlobalStorageValue(GRANTOWER.DESTROYCOUNT, (getGlobalStorageValue(GRANTOWER.DESTROYCOUNT) + 1)) doBroadcastMessage("[Gran Tower] The Gran Aura is with "..getCreatureName(killer)..", run to destroy the Grand Tower and take it.") end end return true end function onTarget(cid, target) if isPlayer(cid) and isMonster(target) and (getCreatureName(target) == "Gran Tower") then if (getGlobalStorageValue(GRANTOWER.FINALWINNER) == getCreatureName(cid)) then doPlayerSendCancel(cid, "Você não pode atacar o Gran Tower, proteja ele!") return false end end return true end function onStatsChange(cid, attacker, type, combat, value) if (type == STATSCHANGE_HEALTHLOSS) and isMonster(cid) and isPlayer(attacker) and (getCreatureName(cid) == "Gran Tower") then if (getGlobalStorageValue(GRANTOWER.FINALWINNER) == getCreatureName(attacker)) then return false end end return true end
  15. Pessoal, to bolando uma ideia aqui de um Castle, pois bem eu fiz um script para quando o monstro morrer ele remover um portao que eu fiz e que de 4SQM, tem como quando ele renascer criar o portão novamente? Este é o script q remove os portões: function onDeath(cid, corpse, killer) local creatureName = "Castle Dark Magician" if getCreatureName(cid) == creatureName then registerCreatureEvent(cid, "castledarkmagician") doRemoveItem(getThingfromPos({x=1471, y=134, z=6, stackpos=1}).uid,1) doSendMagicEffect({x=1471, y=134, z=6, stackpos=1}, CONST_ME_POFF) doRemoveItem(getThingfromPos({x=1472, y=134, z=6, stackpos=1}).uid,2) doSendMagicEffect({x=1472, y=134, z=6, stackpos=1}, CONST_ME_POFF) doRemoveItem(getThingfromPos({x=1469, y=136, z=6, stackpos=1}).uid,3) doSendMagicEffect({x=1469, y=136, z=6, stackpos=1}, CONST_ME_POFF) doRemoveItem(getThingfromPos({x=1469, y=137, z=6, stackpos=1}).uid,4) doSendMagicEffect({x=1469, y=137, z=6, stackpos=1}, CONST_ME_POFF) end return true end
  16. glacialot postou uma resposta no tópico em Suporte Tibia OTServer
    <?xml version="1.0" encoding="UTF-8"?> <mod name="Zombie_Event" version="3.0" author="VirrageS" contact="otland.net" enabled="yes"> <config name="config_zombie_event"> <![CDATA[ configZombieEvent = { storages = { main = 'zombieEventMain', -- set free storage player = 'zombieEventPlayer', -- set free storage joining = 'zombieEventJoining', -- set free storage kills = 'zombieEventKills', -- set free storage exhaust = 'zombieEventExhaust', -- set free storage countEvent = 'zombieEventCountEvent' -- set free storage }, position = {x=801,y=2052,z=7}, -- position to which player is teleporting room = { from = {x=780,y=2037,z=7}, -- left top corner of event room to = {x=817,y=2075,z=7} -- right bottom corner of event room }, rewards = {7958, 11366, 2346, 7450}, -- reward id which player can win (reward is random) players = { max = 20, -- max players in event min = 2, -- min players to event start minLevel = 8, -- min level to join to event pvpEnabled = false -- can players hit theirselfs }, days = { ['Tuesday'] = {'21:59:20'}, ['Thursday'] = {'21:59:20'}, ['Friday'] = {'21:59:20'}, ['Sunday'] = {'21:59:20'} }, spawnDelay = 2000, -- miliseconds amountCreatingMonsters = 5, monsters = {'Scratchclaw', 'Propell Zombie', 'Vile Centurion', 'Mongrel Man', 'Daidalost'}, -- name of monsters which is creating in event delayTime = 5.0, -- time in which players who joined to event are teleporting to teleport position [miuntes] startEvent = 1, -- time from teleport to start event [seconds] stopEvent = 9200, -- [seconds] text = '-PL-\nAby wygrac i otrzymac nagrode, zabij jak najwieksza liczbe zombie przez 20min lub pozostan sam na arenie.\n\n-ENG-\nTo win and get a reward, kill as many zombies for 20 minutes or stay the same in the arena.' } ]]> </config> <lib name="lib_zombie_event"> <![CDATA[ function doStopZombieEvent() if getStorage(configZombieEvent.storages.main) > 0 then local playerTable, creatureTable = {}, {} for x = configZombieEvent.room.from.x, configZombieEvent.room.to.x do for y = configZombieEvent.room.from.y, configZombieEvent.room.to.y do local n, i = getTileInfo({x=x, y=y, z=configZombieEvent.room.from.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=x, y=y, z=configZombieEvent.room.from.z, stackpos=i}).uid while v ~= 0 do if isPlayer(v) then table.insert(playerTable, v) if n == #playerTable then break end elseif isMonster(v) then table.insert(creatureTable, v) if n == #creatureTable then break end end i = i + 1 v = getThingfromPos({x=x, y=y, z=configZombieEvent.room.from.z, stackpos=i}).uid end end end end if #playerTable > 1 then table.sort(playerTable, function(a, b) return (getCreatureStorage(a, configZombieEvent.storages.kills)) > (getCreatureStorage(b, configZombieEvent.storages.kills)) end) local prize = math.random(#configZombieEvent.rewards) doTeleportThing(playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1]))) doCreatureSetStorage(playerTable[1], configZombieEvent.storages.kills, 0) doPlayerAddItem(playerTable[1], configZombieEvent.rewards[prize], 1) doCreatureAddHealth(playerTable[1], getCreatureMaxHealth(playerTable[1]) - getCreatureHealth(playerTable[1])) doCreatureAddMana(playerTable[1], getCreatureMaxMana(playerTable[1]) - getCreatureMana(playerTable[1])) doPlayerSendTextMessage(playerTable[1], MESSAGE_EVENT_ADVANCE, 'You win! You have received '..getItemNameById(configZombieEvent.rewards[prize])..' as reward.') doBroadcastMessage('Zombie Plague Attack has finished. The winner is '..getCreatureName(playerTable[1])..'. Congratulations!') doSetStorage(configZombieEvent.storages.main, -1) db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Zombie\", \"" .. getCreatureName(playerTable[1]) .. "\", \"" .. getItemNameById(configZombieEvent.rewards[prize]) .. "\", " .. getStorage(configZombieEvent.storages.countEvent) ..");") for i = 2, #playerTable do doCreatureAddHealth(playerTable[i], getCreatureMaxHealth(playerTable[i]) - getCreatureHealth(playerTable[i])) doCreatureAddMana(playerTable[i], getCreatureMaxMana(playerTable[i]) - getCreatureMana(playerTable[i])) doTeleportThing(playerTable[i], getTownTemplePosition(getPlayerTown(playerTable[i]))) doPlayerSendTextMessage(playerTable[i], MESSAGE_EVENT_ADVANCE, 'You loss.') doSendMagicEffect(getThingPos(playerTable[i]), CONST_ME_STUN) doCreatureSetStorage(playerTable[i], configZombieEvent.storages.kills, 0) end for i = 1, #creatureTable do if isMonster(creatureTable[i]) then doRemoveCreature(creatureTable[i]) end end doSetStorage(configZombieEvent.storages.countEvent, getStorage(configZombieEvent.storages.countEvent) + 1) elseif #playerTable == 0 then for i = 1, #creatureTable do if isMonster(creatureTable[i]) then doRemoveCreature(creatureTable[i]) end end doBroadcastMessage('No one win in Zombie Plague Attack.') doSetStorage(configZombieEvent.storages.main, -1) doSetStorage(configZombieEvent.storages.countEvent, getStorage(configZombieEvent.storages.countEvent) + 1) end end end function doStartZombieEvent() doSetStorage(configZombieEvent.storages.joining, -1) if configZombieEvent.players.min <= doCountPlayersZombieEvent() then for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configZombieEvent.storages.player) > 0 then doCreatureSetStorage(cid, configZombieEvent.storages.player, -1) doTeleportThing(cid, configZombieEvent.position) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready. Zombie Plague Attack starts in '..configZombieEvent.startEvent..' seconds.') end end addEvent(doSetStorage, configZombieEvent.startEvent * 1000, configZombieEvent.storages.main, 1) addEvent(doStopZombieEvent, configZombieEvent.stopEvent * 1000) addEvent(doRepeatCheckZombieEvent, configZombieEvent.startEvent * 1000 + 2000) doBroadcastMessage('Zombie Plague Attack has started. LET\'S GO!') else for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configZombieEvent.storages.player) > 0 then doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) end end doBroadcastMessage('Zombie Plague Attack hasn\'t started beacuse there were not enough players.') end end function doRepeatCheckZombieEvent() if getStorage(configZombieEvent.storages.main) > 0 then local playerTable, creatureTable, xTable, yTable = {}, {}, {}, {} for x = configZombieEvent.room.from.x, configZombieEvent.room.to.x do for y = configZombieEvent.room.from.y, configZombieEvent.room.to.y do local n, i = getTileInfo({x=x, y=y, z=configZombieEvent.room.to.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=x, y=y, z=configZombieEvent.room.to.z, stackpos=i}).uid while v ~= 0 do if isPlayer(v) then table.insert(playerTable, v) if n == #playerTable then break end elseif isMonster(v) then table.insert(creatureTable, v) if n == #creatureTable then break end end i = i + 1 v = getThingfromPos({x=x, y=y, z=configZombieEvent.room.to.z, stackpos=i}).uid end end table.insert(xTable, x) table.insert(yTable, y) end end if #playerTable == 1 then local prize = math.random(#configZombieEvent.rewards) addEvent(doTeleportThing, 200, playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1])), true) doPlayerAddItem(playerTable[1], configZombieEvent.rewards[prize], 1) doCreatureSetStorage(playerTable[1], configZombieEvent.storages.kills, 0) doCreatureAddHealth(playerTable[1], getCreatureMaxHealth(playerTable[1]) - getCreatureHealth(playerTable[1])) doCreatureAddMana(playerTable[1], getCreatureMaxMana(playerTable[1]) - getCreatureMana(playerTable[1])) doPlayerSendTextMessage(playerTable[1], MESSAGE_EVENT_ADVANCE, 'You win! You have received '..getItemNameById(configZombieEvent.rewards[prize])..' as reward.') doBroadcastMessage('Zombie Plague Attack has finished. The winner is '..getCreatureName(playerTable[1])..'. Congratulations.') db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Zombie\", \"" .. getCreatureName(playerTable[1]) .. "\", \""..getItemNameById(configZombieEvent.rewards[prize]).."\", "..getStorage(configZombieEvent.storages.countEvent)..");") for i = 1, #creatureTable do if isMonster(creatureTable[i]) then doRemoveCreature(creatureTable[i]) end end doSetStorage(configZombieEvent.storages.main, -1) doSetStorage(configZombieEvent.storages.countEvent, getStorage(configZombieEvent.storages.countEvent) + 1) return elseif #playerTable == 0 then for i = 1, #creatureTable do if isMonster(creatureTable[i]) then doRemoveCreature(creatureTable[i]) end end doBroadcastMessage('No one win in Zombie Plague Attack.') doSetStorage(configZombieEvent.storages.main, -1) doSetStorage(configZombieEvent.storages.countEvent, getStorage(configZombieEvent.storages.countEvent) + 1) return end local pos = {x=xTable[math.random(#xTable)], y=yTable[math.random(#yTable)], z=7} for i = 1, configZombieEvent.amountCreatingMonsters do doCreateMonster(configZombieEvent.monsters[math.random(#configZombieEvent.monsters)], pos, false, false, false) doSendMagicEffect(pos, CONST_ME_BATS) end addEvent(doRepeatCheckZombieEvent, configZombieEvent.spawnDelay) end end function doCountPlayersZombieEvent() local x = 0 for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configZombieEvent.storages.player) > 0 then x = x + 1 end end return x end function doStartCountingZombieEvent(x) if configZombieEvent.delayTime-x > 0 then doBroadcastMessage('Zombie Plague Attack is going to start in '..configZombieEvent.delayTime-x..' minutes. You can join to the event by saying "!zombie join".') addEvent(doStartCountingZombieEvent, 60*1000, x+1) end end ]]> </lib> <talkaction words="!zombie" event="script"> <![CDATA[ domodlib("config_zombie_event") function onSay(cid, words, param) if getStorage(configZombieEvent.storages.joining) ~= 1 then return doPlayerSendCancel(cid, 'Zombie Plague Attack hasn\'t started yet.') elseif param == '' then return doPlayerSendCancel(cid, 'Command param required (say: "!zombie join" or "!zombie leave.").') elseif getPlayerLevel(cid) < configZombieEvent.players.minLevel then return doPlayerSendCancel(cid, 'You can\'t join to the event if you don\'t have a require '..configZombieEvent.players.minLevel..' level.') elseif getTileInfo(getThingPos(cid)).protection ~= true then return doPlayerSendCancel(cid, 'You can\'t join to the event if you aren\'t in protection zone.') elseif exhaustion.check(cid, configZombieEvent.storages.exhaust) ~= false then return doPlayerSendCancel(cid, 'You must wait '..exhaustion.get(cid, configZombieEvent.storages.exhaust)..' seconds to use this command again.') end if param == 'join' then if getCreatureStorage(cid, configZombieEvent.storages.player) > 0 then return doPlayerSendCancel(cid, 'You have arleady joined to event. Wait patiently for start.') elseif doCountPlayersZombieEvent() == configZombieEvent.players.max then return doPlayerSendCancel(cid, 'Max players in the event have been reached.') end doCreatureSetNoMove(cid, true) doPlayerPopupFYI(cid, configZombieEvent.text) doCreatureSetStorage(cid, configZombieEvent.storages.player, 1) doAddCondition(cid, createConditionObject(CONDITION_INFIGHT, -1)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have joined to Zombie Plague Attack. You can\'t move until event don\'t start. Wait patiently for the event start.') doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have joined to Zombie Plague Attack.') elseif param == 'leave' then if getCreatureStorage(cid, configZombieEvent.storages.player) <= 0 then return doPlayerSendCancel(cid, 'You can\'t leave from the event if you don\'t join.') end doCreatureSetNoMove(cid, false) doCreatureSetStorage(cid, configZombieEvent.storages.player, -1) doRemoveCondition(cid, CONDITION_INFIGHT) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have left from the Zombie Plague Attack.') end exhaustion.set(cid, configZombieEvent.storages.exhaust, 5) return true end ]]> </talkaction> <talkaction words="!startzombie" access="5" event="script"> <![CDATA[ domodlib("config_zombie_event") domodlib("lib_zombie_event") function onSay(cid, words, param) if getStorage(configZombieEvent.storages.main) > 0 then return doPlayerSendCancel(cid, 'Zombie Plague Attack is already running.') end doStartCountingZombieEvent(0) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configZombieEvent.storages.player) > 0 then doCreatureSetStorage(pid, configZombieEvent.storages.player, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doCreatureSetStorage(pid, configZombieEvent.storages.kills, 0) end end doSetStorage(configZombieEvent.storages.joining, 1) addEvent(doStartZombieEvent, configZombieEvent.delayTime * 60 * 1000) return true end ]]> </talkaction> <talkaction words="!stopzombie" access="5" event="script"> <![CDATA[ domodlib("config_zombie_event") domodlib("lib_zombie_event") function onSay(cid, words, param) if getStorage(configZombieEvent.storages.main) > 0 then doStopZombieEvent() else doPlayerSendCancel(cid, 'You can not do it if Zombie Plague Attack is not enabled.') end return true end ]]> </talkaction> <globalevent name="Zombie_Event_Days" interval="1000" event="script"> <![CDATA[ domodlib("config_zombie_event") domodlib("lib_zombie_event") local daysOpen = {} for k, v in pairs(configZombieEvent.days) do table.insert(daysOpen, k) end function onThink(interval) if isInArray(daysOpen, os.date('%A')) then if isInArray(configZombieEvent.days[os.date('%A')], os.date('%X', os.time())) then if getStorage(configZombieEvent.storages.joining) ~= 1 then doStartCountingZombieEvent(0) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configZombieEvent.storages.player) > 0 then doCreatureSetStorage(pid, configZombieEvent.storages.player, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doCreatureSetStorage(pid, configZombieEvent.storages.kills, 0) end end doSetStorage(configZombieEvent.storages.joining, 1) addEvent(doStartZombieEvent, configZombieEvent.delayTime * 60 * 1000) end end end return true end ]]> </globalevent> <event type="statschange" name="Zombie_Event_Dead" event="script"> <![CDATA[ domodlib("config_zombie_event") function onStatsChange(cid, attacker, type, combat, value) if type == 1 and getCreatureHealth(cid) <= value then if isInRange(getThingPos(cid), configZombieEvent.room.from, configZombieEvent.room.to) then if isPlayer(cid) then doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid)) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You loss due to attack.') doSendAnimatedText(getThingPos(cid), value, TEXTCOLOR_RED) doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT) doCreatureSetStorage(cid, configZombieEvent.storages.kills, 0) return false end end elseif configZombieEvent.players.pvpEnabled ~= true and isInArray({1,3}, type) and isPlayer(attacker) and isPlayer(cid) then if isInRange(getThingPos(cid), configZombieEvent.room.from, configZombieEvent.room.to) then return false end end return true end ]]> </event> <event type="kill" name="Zombie_Event_Kill" event="script"> <![CDATA[ domodlib("config_zombie_event") function onKill(cid, target, damage, flags) if isInRange(getThingPos(cid), configZombieEvent.room.from, configZombieEvent.room.to) then if isInArray(configZombieEvent.monsters, getCreatureName(target)) then doCreatureSetStorage(cid, configZombieEvent.storages.kills, math.max(0, getCreatureStorage(cid, configZombieEvent.storages.kills) + 1)) end end return true end ]]> </event> <event type="login" name="Zombie_Event_Login" event="script"> <![CDATA[ domodlib("config_zombie_event") function onLogin(cid) if getCreatureStorage(cid, configZombieEvent.storages.player) > 0 then doCreatureSetStorage(cid, configZombieEvent.storages.player, -1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doCreatureSetStorage(cid, configZombieEvent.storages.player.kills, 0) end registerCreatureEvent(cid, 'Zombie_Event_Dead') registerCreatureEvent(cid, 'Zombie_Event_Kill') return true end ]]> </event> <globalevent name="Zombie_Event_Start" type="startup" event="script"> <![CDATA[ domodlib("config_zombie_event") function onStartup() doSetStorage(configZombieEvent.storages.main, -1) doSetStorage(configZombieEvent.storages.joining, -1) return true end ]]> </globalevent> </mod> Não achei onde substitui.... esse eh o MOD Script do Zombie: <?xml version="1.0" encoding="UTF-8"?> <monster name="Propell Zombie" nameDescription="a propell zombie" race="undead" experience="6000" speed="90" manacost="0"> <health now="17500" max="17500"/> <look type="311" corpse="9875"/> <targetchange interval="5000" chance="8"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="0"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="0"/> <flag convinceable="0"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="0"/> <flag skull="black"/> </flags> <attacks> <attack name="melee" interval="2000" min="-999" max="-1000"/> <attack name="manadrain" interval="1000" chance="13" range="1" min="-700" max="-900"/> <attack name="death" interval="3000" chance="15" range="7" radius="4" min="-625" max="-953"> <attribute key="shootEffect" value="suddendeath"/> <attribute key="areaEffect" value="mortarea"/> </attack> </attacks> <defenses armor="15" defense="10"/> <elements> <element icePercent="30"/> <element firePercent="30"/> <element physicalPercent="-50"/> <element deathPercent="100"/> <element holyPercent="-20"/> <element energyPercent="10"/> <element earthPercent="10"/> </elements> <immunities> <immunity lifedrain="1"/> <immunity paralyze="1"/> <immunity invisible="1"/> <immunity earth="1"/> <immunity fire="1"/> </immunities> <summons maxSummons="2"> <summon name="Propell Zombie" interval="500" chance="10" max="3"/> </summons> <voices interval="5000" chance="10"> <voice sentence="Mst.... klll...."/> <voice sentence="Whrrrr... ssss.... mmm.... grrrrl"/> <voice sentence="Dnnnt... cmmm... clsrrr...."/> <voice sentence="Httt.... hmnnsss..."/> </voices> <loot> <item id="2148" countmax="64" chance="24000"/><!-- gold coin --> <item id="2227" chance="45000"/><!-- rotten meat --> <item id="2050" chance="46250"/><!-- torch --> <item id="2460" chance="8700"/><!-- brass helmet --> <item id="2457" chance="8700"/><!-- steel helmet --> <item id="2398" chance="7250"/><!-- mace --> <item id="1987" chance="100000"><!-- bag --> <inside> <item id="9808" chance="7250"/><!-- rusty armor --> <item id="2381" chance="2900"/><!-- battle hammer --> <item id="2381" chance="4350"/><!-- halberd --> <item id="2205" chance="2900"/><!-- life ring --> <item id="7620" chance="1450"/><!-- mana potion --> <item id="2657" chance="900"/><!-- simple dress --> </inside> </item> </loot> </monster>
  17. glacialot postou uma resposta no tópico em Suporte Tibia OTServer
    Pessoal, peguei um Zombie Event aqui e estou com um problema, o Zombie ao inves de quando encostar no Player ele ser teletransportado para o Templo, ele apenas ataca o player até a morte, teria como passar um script de zombie que teleport o player para o templo quando encosta nele? Gracias
  18. glacialot postou uma resposta no tópico em Suporte Tibia OTServer
    Preciso de um Distro 8.60 que rode o CAST... qual posso usar?
  19. Sim dani, ta tudo adicionado... Pessoal mechi algumas linhas e agora esta funcionando, porem ao termino do Evento o time Ganhador é mandado para o Templo e ganha a recompensa, mas o time que perde ainda fica no Evento, como faço para o time perdedor tambem ir para o templo? esse é o Evento funcionando agora: <?xml version="1.0" encoding="UTF-8"?> <mod name="Rush Event" version="1.0.0" author="VirrageS" enabled="yes"> <config name="config_rush_event"> <![CDATA[ configRushEvent = { storages = { main = 'rushEventMain', -- set free storage player = 'rushEventPlayer', -- set free storage joining = 'rushEventJoining', -- set free storage b_score = 'rushEventBlueScore', -- set free storage r_score = 'rushEventRedScore', -- set free storage exhaust = 'rushEventExhaust', countEvent = 'rushEventCountEvent' }, position = { blue = {x=732, y=1953, z=6}, -- posiotion to which player is teleporting red = {x=680, y=1981, z=6} -- posiotion to which player is teleporting }, room = { from = {x=663,y=1938,z=7}, -- left top corner of event room to = {x=749,y=2005,z=7} -- right bottom corner of event room }, rewards = {7720, 2157}, -- reward id which player can win (reward is random) players = { max = 30, min = 2, minLevel = 8 }, days = { ['Monday'] = {'21:00:00'}, ['Tuesday'] = {'17:00:00'}, ['Thursday'] = {'17:00:20'} }, fragLimit = 2, -- frag limit waitTime = 10, -- sekundy [ile gracz ma czekac jak padnie] delayTime = 3.0, -- time in which players who joined to event are teleporting to teleport position [miuntes] startEvent = 1, -- time from teleport to start event [seconds] stopEvent = 600, -- [seconds] text = 'Walka przez 10min lub 100 fragow, bez ue.' } ]]> </config> <lib name="lib_rush_event"> <![CDATA[ domodlib('config_rush_event') local conditionBlue = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionBlue, {lookType = 130, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87}) local conditionRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionRed, {lookType = 130, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) function doStartRushEvent() doSetStorage(configRushEvent.storages.joining, -1) if configRushEvent.players.min <= doCountPlayersRushEvent()[1] then for _, cid in ipairs(getPlayersOnline()) do local p = tostring(getCreatureStorage(cid, configRushEvent.storages.player)) if p ~= '' then doTeleportThing(cid, p ~= 'blue' and configRushEvent.position.red or configRushEvent.position.blue) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doAddCondition(cid, p ~= 'blue' and conditionRed or conditionBlue) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready. Rush Event starts in '..configRushEvent.startEvent..' seconds.') end end addEvent(doSetStorage, configRushEvent.startEvent * 1000, configRushEvent.storages.main, 1) addEvent(doStopRushEvent, configRushEvent.stopEvent * 1000) doBroadcastMessage('Rush Event has started. LET\'S GO!') else for _, cid in ipairs(getPlayersOnline()) do if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doCreatureSetStorage(cid, configRushEvent.storages.player, '') end end doBroadcastMessage('Rush Event hasn\'t started beacuse there not were enough players.') end end function doStopRushEvent() if getStorage(configRushEvent.storages.main) > 0 then local team = nil if getStorage(configRushEvent.storages.b_score) == configRushEvent.fragLimit then team = 'blue' elseif getStorage(configRushEvent.storages.r_score) == configRushEvent.fragLimit then team = 'red' else if getStorage(configRushEvent.storages.r_score) >= getStorage(configRushEvent.storages.b_score) then team = 'red' else team = 'blue' end end local prize = math.random(#configRushEvent.rewards) for _, cid in ipairs(getPlayersOnline()) do if isInRange(getThingPos(cid), configRushEvent.room.from, configRushEvent.room.to) then if team == tostring(getCreatureStorage(cid, configRushEvent.storages.player)) then doPlayerAddItem(cid, configRushEvent.rewards[prize], 1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Your team won! You have received '.. getItemNameById(configRushEvent.rewards[prize]) ..' as reward.') end doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid)) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doCreatureSetStorage(cid, configRushEvent.storages.player, '') doRemoveCondition(cid, CONDITION_OUTFIT) end end doBroadcastMessage('Rush Event has finished. The winner is '..team..' team ('..getStorage(configRushEvent.storages.r_score)..':'..getStorage(configRushEvent.storages.b_score)..'). Congratulations!') db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Rush\", \""..team.."\", \""..prize.."\", "..getStorage(configRushEvent.storages.countEvent)..");") doSetStorage(configRushEvent.storages.main, -1) doSetStorage(configRushEvent.storages.countEvent, getStorage(configRushEvent.storages.countEvent) + 1) doSetStorage(configRushEvent.storages.r_score, 0) doSetStorage(configRushEvent.storages.b_score, 0) end end function doCountPlayersRushEvent() local x, blue, red = 0,0,0 for _, cid in ipairs(getPlayersOnline()) do local p = tostring(getCreatureStorage(cid, configRushEvent.storages.player)) if p ~= '' then if p ~= 'blue' then red = red + 1 else blue = blue + 1 end x = x + 1 end end return {x, blue, red} end function doStartCountingRushEvent(x) if configRushEvent.delayTime-x > 0 then doBroadcastMessage('Rush Event is going to start in '..configRushEvent.delayTime-x..' minutes. You can join to the event by saying "!rush join".') addEvent(doStartCountingRushEvent, 60*1000, x+1) end end ]]> </lib> <talkaction words="!stoprush" access="5" event="script"> <![CDATA[ domodlib("lib_rush_event") function onSay(cid, words, param) if getStorage(configRushEvent.storages.main) < 1 then return doPlayerSendCancel(cid, 'You can not do it if Rush Event is not enabled.') end doStopRushEvent() return true end ]]> </talkaction> <talkaction words="!startrush" access="5" event="script"> <![CDATA[ domodlib("lib_rush_event") function onSay(cid, words, param) if getStorage(configRushEvent.storages.main) > 0 then return doPlayerSendCancel(cid, 'Rush Event is already running.') end for _, pid in ipairs(getPlayersOnline()) do if tostring(getCreatureStorage(pid, configRushEvent.storages.player)) ~= '' then doCreatureSetStorage(pid, configRushEvent.storages.player, '') doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doRemoveCondition(pid, CONDITION_OUTFIT) end end doStartCountingRushEvent(0) doSetStorage(configRushEvent.storages.joining, 1) addEvent(doStartRushEvent, configRushEvent.delayTime * 60 * 1000) return true end ]]> </talkaction> <talkaction words="!rush" event="script"> <![CDATA[ domodlib("lib_rush_event") function onSay(cid, words, param) if getStorage(configRushEvent.storages.joining) ~= 1 then return doPlayerSendCancel(cid, 'Rush Event hasn\'t started yet.') elseif param == '' then return doPlayerSendCancel(cid, 'Command param required (say: "!rush join" or "!rush leave.").') elseif getPlayerLevel(cid) < configRushEvent.players.minLevel then return doPlayerSendCancel(cid, 'You can\'t join to the event if you don\'t have a require '..configRushEvent.players.minLevel..' level.') elseif getTileInfo(getThingPos(cid)).protection ~= true then return doPlayerSendCancel(cid, 'You can\'t join to the event if you aren\'t in protection zone.') elseif exhaustion.check(cid, configRushEvent.storages.exhaust) ~= false then return doPlayerSendCancel(cid, 'You must wait '..exhaustion.get(cid, configRushEvent.storages.exhaust)..' seconds to use this command again.') end if param == 'join' then if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then return doPlayerSendCancel(cid, 'You have arleady joined to event. Wait patiently for start.') elseif doCountPlayersRushEvent()[1] == configRushEvent.players.max then return doPlayerSendCancel(cid, 'Max players in the event have been reached.') end doCreatureSetNoMove(cid, true) if configRushEvent.text ~= '' then doPlayerPopupFYI(cid, configRushEvent.text) end doCreatureSetStorage(cid, configRushEvent.storages.player, doCountPlayersRushEvent()[3] >= doCountPlayersRushEvent()[2] and 'blue' or 'red') doAddCondition(cid, createConditionObject(CONDITION_INFIGHT, -1)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have joined to Rush Event. You can\'t move until event don\'t start. Wait patiently for the event start.') doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have joined to Rush Event.') elseif param == 'leave' then if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then return doPlayerSendCancel(cid, 'You can\'t leave from the event if you don\'t join.') end doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doCreatureSetStorage(cid, configRushEvent.storages.player, '') doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have left from the Rush Event.') end exhaustion.set(cid, configRushEvent.storages.exhaust, 5) return true end ]]> </talkaction> <globalevent name="Rush_Event_Days" interval="1000" event="script"> <![CDATA[ domodlib("lib_rush_event") local daysOpen = {} for k, v in pairs(configRushEvent.days) do table.insert(daysOpen, k) end function onThink(cid, interval) if isInArray(daysOpen, os.date('%A')) then if isInArray(configRushEvent.days[os.date('%A')], os.date('%X', os.time())) then if getStorage(configRushEvent.storages.joining) ~= 1 then doStartCountingRushEvent(0) for _, pid in ipairs(getPlayersOnline()) do if tostring(getCreatureStorage(pid, configRushEvent.storages.player)) ~= '' then doCreatureSetStorage(pid, configRushEvent.storages.player, '') doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doRemoveCondition(pid, CONDITION_OUTFIT) end end doSetStorage(configRushEvent.storages.joining, 1) addEvent(doStartRushEvent, configRushEvent.delayTime * 60 * 1000) end end end return true end ]]> </globalevent> <event type="statschange" name="Rush_Event_Dead" event="script"> <![CDATA[ domodlib("lib_rush_event") function onStatsChange(cid, attacker, type, combat, value) if type == 1 and getCreatureHealth(cid) <= value then if isInRange(getThingPos(cid), configRushEvent.room.from, configRushEvent.room.to) then if isPlayer(cid) then local p = tostring(getCreatureStorage(cid, configRushEvent.storages.player)) doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid)) doTeleportThing(cid, p ~= 'blue' and configRushEvent.position.red or configRushEvent.position.blue) doCreatureSetNoMove(cid, true) addEvent(doCreatureSetNoMove, configRushEvent.waitTime * 1000, cid, false) if p ~= 'blue' then doSetStorage(configRushEvent.storages.b_score, math.max(getStorage(configRushEvent.storages.b_score), 0) + 1) if getStorage(configRushEvent.storages.b_score) == configRushEvent.fragLimit then doStopRushEvent() end else doSetStorage(configRushEvent.storages.r_score, math.max(getStorage(configRushEvent.storages.r_score), 0) + 1) if getStorage(configRushEvent.storages.r_score) == configRushEvent.fragLimit then doStopRushEvent() end end return false end end elseif isInArray({1,3}, type) and isPlayer(attacker) and isPlayer(cid) then if isInRange(getThingPos(cid), configRushEvent.room.from, configRushEvent.room.to) then if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) == tostring(getCreatureStorage(attacker, configRushEvent.storages.player)) then return false end end end return true end ]]> </event> <event type="login" name="Rush_Event_Login" event="script"> <![CDATA[ domodlib("config_rush_event") function onLogin(cid) if tostring(getCreatureStorage(cid, configRushEvent.storages.player)) ~= '' then doCreatureSetStorage(cid, configRushEvent.storages.player, '') doRemoveCondition(cid, CONDITION_OUTFIT) end registerCreatureEvent(cid, 'Rush_Event_Dead') return true end ]]> </event> <globalevent name="Rush_Event_Start" type="startup" event="script"> <![CDATA[ domodlib("config_rush_event") function onStartup() doSetStorage(configRushEvent.storages.main, -1) doSetStorage(configRushEvent.storages.r_score, 0) doSetStorage(configRushEvent.storages.b_score, 0) doSetStorage(configRushEvent.storages.joining, -1) return true end ]]> </globalevent> </mod> Só não esta manando o time perdedor para o templo...
  20. glacialot postou uma resposta no tópico em Suporte Tibia OTServer
    Pessoal to tentando por no meu OTServ o MOD do Capture The Flag que peguei do Servidor DarksandOts Free Data 8.60 mas ele verifica uma tabela na TB, como faço para add essa tabela? segue o MOD do CTF: <?xml version='1.0' encoding='UTF-8'?> <mod name='Capture The Flag' version='2.0' author='Collocorpusek' contact='7284838' enabled='yes'> <config name='CTF_config'> ESTE EH O ORIGINAL <![CDATA[ ctfConfig = { bases = { [1] = { -- Positions -- fromPos = {x = 4781, y = 3245, z = 7}, toPos = {x = 4787, y = 3251, z = 7}, showInfoPos = {x = 4784, y = 3248, z = 7}, -- Storage -- points = 123661, controled = 123662, -- Flags -- flags = { [1] = {pos = {x=4783, y=3250, z=7}, id = {1878,1867,1870}}, [2] = {pos = {x=4784, y=3250, z=7}, id = {1878,1867,1870}}, [3] = {pos = {x=4785, y=3250, z=7}, id = {1878,1867,1870}}, [4] = {pos = {x=4786, y=3247, z=7}, id = {1879,1868,1871}}, [5] = {pos = {x=4786, y=3248, z=7}, id = {1879,1868,1871}}, [6] = {pos = {x=4786, y=3249, z=7}, id = {1879,1868,1871}}, -- NEXT FLOOR -- [7] = {pos = {x=4784, y=3250, z=6}, id = {1878,1867,1870}}, [8] = {pos = {x=4785, y=3250, z=6}, id = {1878,1867,1870}}, [9] = {pos = {x=4786, y=3249, z=6}, id = {1879,1868,1871}}, [10] = {pos = {x=4786, y=3248, z=6}, id = {1879,1868,1871}}, -- NEXT FLOOR -- [11] = {pos = {x=4785, y=3250, z=5}, id = {1878,1867,1870}}, [12] = {pos = {x=4786, y=3249, z=5}, id = {1879,1868,1871}} }, topFlagPos = {pos = {x=4786, y=3250, z=2}, id = {4990,11330,11326}} }, [2] = { -- Positions -- fromPos = {x = 4780, y = 3262, z = 7}, toPos = {x = 4786, y = 3268, z = 7}, showInfoPos = {x = 4783, y = 3265, z = 7}, -- Storage -- points = 123663, controled = 123664, -- Flags -- flags = { [1] = {pos = {x=4785, y=3264, z=7}, id = {1879,1868,1871}}, [2] = {pos = {x=4785, y=3265, z=7}, id = {1879,1868,1871}}, [3] = {pos = {x=4785, y=3266, z=7}, id = {1879,1868,1871}}, [4] = {pos = {x=4784, y=3267, z=7}, id = {1878,1867,1870}}, [5] = {pos = {x=4783, y=3267, z=7}, id = {1878,1867,1870}}, [6] = {pos = {x=4782, y=3267, z=7}, id = {1878,1867,1870}}, -- NEXT FLOOR -- [7] = {pos = {x=4785, y=3265, z=6}, id = {1879,1868,1871}}, [8] = {pos = {x=4785, y=3266, z=6}, id = {1879,1868,1871}}, [9] = {pos = {x=4784, y=3267, z=6}, id = {1878,1867,1870}}, [10] = {pos = {x=4783, y=3267, z=6}, id = {1878,1867,1870}}, -- NEXT FLOOR -- [11] = {pos = {x=4785, y=3266, z=5}, id = {1879,1868,1871}}, [12] = {pos = {x=4784, y=3267, z=5}, id = {1878,1867,1870}} }, topFlagPos = {pos = {x=4785, y=3267, z=2}, id = {4990,11330,11326}} }, [3] = { -- Positions -- fromPos = {x = 4806, y = 3245, z = 7}, toPos = {x = 4812, y = 3251, z = 7}, showInfoPos = {x = 4809, y = 3248, z = 7}, -- Storage -- points = 123665, controled = 123666, -- Flags -- flags = { [1] = {pos = {x=4811, y=3247, z=7}, id = {1879,1868,1871}}, [2] = {pos = {x=4811, y=3248, z=7}, id = {1879,1868,1871}}, [3] = {pos = {x=4811, y=3249, z=7}, id = {1879,1868,1871}}, [4] = {pos = {x=4810, y=3250, z=7}, id = {1878,1867,1870}}, [5] = {pos = {x=4809, y=3250, z=7}, id = {1878,1867,1870}}, [6] = {pos = {x=4808, y=3250, z=7}, id = {1878,1867,1870}}, -- NEXT FLOOR -- [7] = {pos = {x=4811, y=3248, z=6}, id = {1879,1868,1871}}, [8] = {pos = {x=4811, y=3249, z=6}, id = {1879,1868,1871}}, [9] = {pos = {x=4810, y=3250, z=6}, id = {1878,1867,1870}}, [10] = {pos = {x=4809, y=3250, z=6}, id = {1878,1867,1870}}, -- NEXT FLOOR -- [11] = {pos = {x=4811, y=3249, z=5}, id = {1879,1868,1871}}, [12] = {pos = {x=4810, y=3250, z=5}, id = {1878,1867,1870}} }, topFlagPos = {pos = {x=4811, y=3250, z=2}, id = {4990,11330,11326}} }, [4] = { -- Positions -- fromPos = {x = 4808, y = 3261, z = 7}, toPos = {x = 4814, y = 3267, z = 7}, showInfoPos = {x = 4811, y = 3264, z = 7}, -- Storage -- points = 123667, controled = 123668, -- Flags -- flags = { [1] = {pos = {x=4813, y=3263, z=7}, id = {1879,1868,1871}}, [2] = {pos = {x=4813, y=3264, z=7}, id = {1879,1868,1871}}, [3] = {pos = {x=4813, y=3265, z=7}, id = {1879,1868,1871}}, [4] = {pos = {x=4812, y=3266, z=7}, id = {1878,1867,1870}}, [5] = {pos = {x=4811, y=3266, z=7}, id = {1878,1867,1870}}, [6] = {pos = {x=4810, y=3266, z=7}, id = {1878,1867,1870}}, -- NEXT FLOOR -- [7] = {pos = {x=4813, y=3264, z=6}, id = {1879,1868,1871}}, [8] = {pos = {x=4813, y=3265, z=6}, id = {1879,1868,1871}}, [9] = {pos = {x=4812, y=3266, z=6}, id = {1878,1867,1870}}, [10] = {pos = {x=4811, y=3266, z=6}, id = {1878,1867,1870}}, -- NEXT FLOOR -- [11] = {pos = {x=4813, y=3265, z=5}, id = {1879,1868,1871}}, [12] = {pos = {x=4812, y=3266, z=5}, id = {1878,1867,1870}} }, topFlagPos = {pos = {x=4813, y=3266, z=2}, id = {4990,11330,11326}} } }, red = { teleportPos = {x = 4821, y = 3257, z = 6}, deathPos = {x = 4821, y = 3257, z = 7}, storage = 123669, scores = 1236610 }, blue = { teleportPos = {x = 4773, y = 3257, z = 6}, deathPos = {x = 4773, y = 3257, z = 7}, storage = 1236611, scores = 1236612 }, walls = { {pos = {x = 4776, y = 3257, z = 6}, id = 1049}, {pos = {x = 4818, y = 3257, z = 6}, id = 1049} }, days = { {['Monday'] = {'03:00:20'}, ['Sunday'] = {'03:00:20'}} }, -- Main flag -- flag = { storage = 1236617, pos = {x = 4798, y = 3257, z = 7}, id = 1436 }, -- Rewards -- rewards = {3954, 7957, 2542}, -- Requires -- minLevel = 200000, minOfParticipants = 1, -- minimum graczy z kazdej druzyny aby event sie rozpoczal maxOfParticipants = 15, -- ile moze byc maksymalnie uczestnikow w jeden druzynie -- Storage -- eventStorage = 100014, joinEventStorage = 100015, groupStorage = 100016, -- Times -- finishEvent = 15, -- minuty timeToStartJoiningToCTF = 3.0, timeToStartCTFEvent = 2.0, -- Points -- maxTeamPoints = 1000, pointsForFlag = 100, pointsForEachBase = 50, -- Base -- maxBasePoints = 12, basePointsToControl = 10, -- Death -- deathStorage = 100017, deathCountStorage = 100018, deathTime = 15, -- seconds text = '-PL-\nNa srodku pola walki znajduje sie flaga. \nTrzeba ja zabrac i zaniesc do przejetej bazy. \nAby przejac baze trzeba stac wokol niej w przewadze. \nPrzejeta baze pokazuja zawieszone na niej flagi. \nPo odniesieniu flagi do bazy otrzymuje sie punkty.\n\n-ENG-\nIn the middle the battle is located flag. \nYou have to take it and carry it to the acquired base. \nTo take over the base you have to stand around her in the superiority. \nA compromised base shows the suspended flags. \nAfter the flag for the database receives the points.' } ]]> </config> <lib name='CTF_lib'> <![CDATA[ domodlib('CTF_config') ------------------------------------- ---- dla blue teamu przypisuje sie wartosci ujemne (basa) ---- dla red teamu przypisuje sie wartosci dodatnie (basa) function checkDeathRoomCTF() if getStorage(ctfConfig.deathCountStorage) - ctfConfig.deathTime == 0 then for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, ctfConfig.deathStorage) > 0 then local conditionBlue = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionBlue, {lookType = 130, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87}) local conditionRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionRed, {lookType = 130, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) if getCreatureStorage(cid, ctfConfig.blue.storage) > 0 then doAddCondition(cid, conditionBlue) doTeleportThing(cid, ctfConfig.blue.teleportPos) elseif getCreatureStorage(cid, ctfConfig.red.storage) > 0 then doTeleportThing(cid, ctfConfig.red.teleportPos) doAddCondition(cid, conditionRed) end doCreatureSetStorage(cid, ctfConfig.deathStorage, -1) doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid)) doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid)) end end for i = 1, 2 do local team = i == 1 and ctfConfig.blue or ctfConfig.red doSendAnimatedText(team.deathPos, '0', TEXTCOLOR_BLACK) end doSetStorage(ctfConfig.deathCountStorage, 0) else for i = 1, 2 do local team = i == 1 and ctfConfig.blue or ctfConfig.red doSendAnimatedText(team.deathPos, math.abs(getStorage(ctfConfig.deathCountStorage) - ctfConfig.deathTime), TEXTCOLOR_BLACK) end end doSetStorage(ctfConfig.deathCountStorage, getStorage(ctfConfig.deathCountStorage) + 1) end function doAddScoreToBaseCTF() for k, v in pairs(ctfConfig.bases) do local blue, red = 0, 0 for x = v.fromPos.x, v.toPos.x do for y = v.fromPos.y, v.toPos.y do local n, i = getTileInfo({x=x, y=y, z=v.toPos.z}).creatures, 1 if n ~= 0 then local t = getThingfromPos({x=x, y=y, z=v.toPos.z, stackpos=i}).uid while t ~= 0 do if isPlayer(t) then if getCreatureStorage(t, ctfConfig.red.storage) > 0 then red = red + 1 elseif getCreatureStorage(t, ctfConfig.blue.storage) > 0 then blue = blue + 1 end end i = i + 1 t = getThingfromPos({x=x, y=y, z=v.toPos.z, stackpos=i}).uid end end end end -- ustawia storage basy local addPoints = getStorage(v.points) + (red - blue) if math.abs(addPoints) > ctfConfig.maxBasePoints then doSetStorage(v.points, (addPoints < 0 and - ctfConfig.maxBasePoints or ctfConfig.maxBasePoints)) doSendAnimatedText(v.showInfoPos, ctfConfig.maxBasePoints .. '/' .. ctfConfig.maxBasePoints, (addPoints < 0 and COLOR_BLUE or COLOR_RED)) else -- Add points -- if math.abs(addPoints) < ctfConfig.basePointsToControl then doSendAnimatedText(v.showInfoPos, math.abs(addPoints) .. '/' .. ctfConfig.maxBasePoints, COLOR_GREY) else local takeControl = addPoints < 0 and 'blue' or 'red' doSendAnimatedText(v.showInfoPos, math.abs(addPoints) .. '/' .. ctfConfig.maxBasePoints, (takeControl == 'blue' and COLOR_BLUE or COLOR_RED)) end doSetStorage(v.points, addPoints) end -- Top flag -- local topFlag for _, id in pairs(v.topFlagPos.id) do if getTileItemById(v.topFlagPos.pos, id).uid > 0 then topFlag = getTileItemById(v.topFlagPos.pos, id).uid break end end if topFlag ~= nil then if math.abs(addPoints) < ctfConfig.basePointsToControl then doTransformItem(topFlag, v.topFlagPos.id[1]) doSetStorage(v.controled, '') else local whoControl = addPoints < 0 and 3 or 2 doTransformItem(topFlag, v.topFlagPos.id[whoControl]) doSetStorage(v.controled, (addPoints < 0 and 'blue' or 'red')) end end -- Tapestry -- for i, flags in pairs(v.flags) do local flag for _, id in pairs(flags.id) do if getTileItemById(flags.pos, id).uid > 0 then flag = getTileItemById(flags.pos, id).uid break end end if flag ~= nil then if i > math.abs(addPoints) then doTransformItem(flag, flags.id[1]) else local whoControl = addPoints < 0 and 3 or 2 doTransformItem(flag, flags.id[whoControl]) end end end end end function getBasesControledByTeamCTF(team) local bases = 0 for k, v in pairs(ctfConfig.bases) do if getStorage(v.controled) == team then bases = bases + 1 end end return bases end function isControledByTeamCTF(pos, team) for k, v in pairs(ctfConfig.bases) do if isInRange(pos, v.fromPos, v.toPos) then if getStorage(v.controled) == team then return true end end end return false end function getAmountParticipantsCTF() local blue, red = {}, {} for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, ctfConfig.blue.storage) > 0 then table.insert(blue, pid) elseif getCreatureStorage(pid, ctfConfig.red.storage) > 0 then table.insert(red, pid) end end return blue, red end function openCtfEvent() doSetStorage(ctfConfig.joinEventStorage, 1) doBroadcastMessage('[CTF]\n\nPrzygotuj sie do bitwy! Jesli masz conajmniej ' .. ctfConfig.minLevel .. ' level mozesz dolaczyc do eventu piszac "!ctf join".', MESSAGE_EVENT_ADVANCE) addEvent(doStartCtfEvent, ctfConfig.timeToStartCTFEvent * 1000 * 60) for k, v in pairs(ctfConfig.walls) do doCreateItem(v.id, 1, v.pos) end end function doStartCtfEvent() for _, pid in ipairs(getPlayersOnline()) do if isInArray({getCreatureStorage(pid, ctfConfig.blue.storage), getCreatureStorage(pid, ctfConfig.red.storage)}, 1) then doCreatureSetNoMove(pid, false) doRemoveCondition(pid, CONDITION_INFIGHT) doPlayerSetGroupId(pid, math.max(1, getCreatureStorage(pid, ctfConfig.groupStorage))) end end local blue, red = getAmountParticipantsCTF() if #blue >= ctfConfig.minOfParticipants and #red >= ctfConfig.minOfParticipants then doBroadcastMessage('[CTF]\n\nLet\'s go! Bramy otworzone!', MESSAGE_EVENT_ADVANCE) addEvent( function() if getStorage(ctfConfig.red.scores) > getStorage(ctfConfig.blue.scores) then doCloseCtfEvent('red') elseif getStorage(ctfConfig.red.scores) < getStorage(ctfConfig.blue.scores) then doCloseCtfEvent('blue') else doCloseCtfEvent(math.random(2) == 1 and 'blue' or 'red') end end, ctfConfig.finishEvent * 1000 * 60 ) else doBroadcastMessage('[CTF]\n\nEvent failed, not enough players joined to event!', MESSAGE_EVENT_ADVANCE) for _, pid in ipairs(getPlayersOnline()) do -- Storages -- if getCreatureStorage(pid, ctfConfig.blue.storage) == 1 then doCreatureSetStorage(pid, ctfConfig.blue.storage, -1) -- TP -- doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doRemoveCondition(pid, CONDITION_OUTFIT) elseif getCreatureStorage(pid, ctfConfig.red.storage) == 1 then doCreatureSetStorage(pid, ctfConfig.red.storage, -1) -- TP -- doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doRemoveCondition(pid, CONDITION_OUTFIT) end if getCreatureStorage(pid, ctfConfig.flag.storage) > 0 then doCreatureSetStorage(pid, ctfConfig.flag.storage, -1) end if getCreatureStorage(pid, ctfConfig.deathStorage) > 0 then doCreatureSetStorage(pid, ctfConfig.deathStorage, -1) end end -- Clean tabeli i event storage -- doSetStorage(ctfConfig.eventStorage, -1) end for k, v in pairs(ctfConfig.walls) do doRemoveItem(getTileItemById(v.pos, v.id).uid) end doSetStorage(ctfConfig.joinEventStorage, -1) end function doCloseCtfEvent(winTeam) if getStorage(ctfConfig.eventStorage) ~= -1 then doBroadcastMessage('[CTF]\n\nEvent ended! Winner is: ' .. winTeam .. ' team . Congratulations!', MESSAGE_INFO_DESCR) for _, eventPlayers in ipairs(getPlayersOnline()) do if getCreatureStorage(eventPlayers, ctfConfig.blue.storage) == 1 then local reward = ctfConfig.rewards[math.random(#ctfConfig.rewards)] -- Clean storage -- doCreatureSetStorage(eventPlayers, ctfConfig.blue.storage, -1) if winTeam == 'blue' then -- Add item if winner -- doPlayerAddItem(eventPlayers, reward, 1) end -- TP -- doTeleportThing(eventPlayers, getTownTemplePosition(getPlayerTown(eventPlayers)), true) doRemoveCondition(eventPlayers, CONDITION_OUTFIT) elseif getCreatureStorage(eventPlayers, ctfConfig.red.storage) == 1 then -- Clean storage -- doCreatureSetStorage(eventPlayers, ctfConfig.red.storage, -1) if winTeam == 'red' then -- Add item if winner -- doPlayerAddItem(eventPlayers, reward, 1) end -- TP -- doTeleportThing(eventPlayers, getTownTemplePosition(getPlayerTown(eventPlayers)), true) doRemoveCondition(eventPlayers, CONDITION_OUTFIT) end if getCreatureStorage(eventPlayers, ctfConfig.flag.storage) > 0 then doCreatureSetStorage(eventPlayers, ctfConfig.flag.storage, -1) end if getCreatureStorage(eventPlayers, ctfConfig.deathStorage) > 0 then doCreatureSetStorage(eventPlayers, ctfConfig.deathStorage, -1) end end -- Clean all storages -- for k, v in pairs(ctfConfig.bases) do doSetStorage(v.controled, 0) doSetStorage(v.points, 0) end doSetStorage(ctfConfig.red.scores, 0) doSetStorage(ctfConfig.blue.scores, 0) doSetStorage(ctfConfig.eventStorage, -1) doSetStorage(ctfConfig.joinEventStorage, -1) doSetStorage(ctfConfig.deathCountStorage, 0) end end function doStartCountingCtfEvent(x) if ctfConfig.timeToStartJoiningToCTF-x > 0 then doBroadcastMessage('[CTF]\n\nCapture The Flag Event zaczyna sie za '..ctfConfig.timeToStartJoiningToCTF+ctfConfig.timeToStartCTFEvent-x..' minuty.') addEvent(doStartCountingCtfEvent, 60*1000, x+1) else openCtfEvent() end end ]]> </lib> <talkaction words='!startctf' access='5' event='script'> <![CDATA[ domodlib('CTF_config') domodlib('CTF_lib') function onSay(cid, words, param) if getStorage(ctfConfig.eventStorage) ~= 1 then doStartCountingCtfEvent(0) doSetStorage(ctfConfig.eventStorage, 1) else doPlayerSendCancel(cid, 'You can not do it if "CTF event" is enabled yet.') end return true end ]]> </talkaction> <talkaction words='!ctf' log="yes" event='script'> <![CDATA[ domodlib('CTF_config') domodlib('CTF_lib') local conditionBlue = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionBlue, {lookType = 130, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87}) local conditionRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionRed, {lookType = 130, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) function onSay(cid, words, param) if getStorage(ctfConfig.joinEventStorage) == 1 then if getPlayerLevel(cid) < ctfConfig.minLevel then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You can not sing up to CTF event if you do not have a require level. [' .. ctfConfig.minLevel .. ']') end if getTileInfo(getThingPos(cid)).protection ~= true then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You can not sing up to CTF event if are not in protection zone.') end if getCreatureStorage(cid, ctfConfig.blue.storage) == 1 or getCreatureStorage(cid, ctfConfig.red.storage) == 1 then return doPlayerSendTextMessage(cid, MESSAGE_STATUS_SMALL, 'You are arleady joined to CTF event.') end local blue, red = getAmountParticipantsCTF() if #blue == ctfConfig.maxOfParticipants and #red == ctfConfig.maxOfParticipants then return doPlayerSendCancel(cid, 'Max players in the event has been reached!') end for _, v in ipairs(red) do if getPlayerIp(cid) == getPlayerIp(v) then return doPlayerSendCancel(cid, 'In CTF event there is arleady player who have same ip like you.') end end for _, v in ipairs(blue) do if getPlayerIp(cid) == getPlayerIp(v) then return doPlayerSendCancel(cid, 'In CTF event there is arleady player who have same ip like you.') end end if #blue > 0 or #red > 0 then if #blue > #red then -- TP, noMove -- doTeleportThing(cid, ctfConfig.red.teleportPos) -- Storages -- doCreatureSetStorage(cid, ctfConfig.red.storage, 1) -- Conditions -- doAddCondition(cid, conditionRed) elseif #blue < #red then -- TP, noMove -- doTeleportThing(cid, ctfConfig.blue.teleportPos) -- Storages -- doCreatureSetStorage(cid, ctfConfig.blue.storage, 1) -- Conditions -- doAddCondition(cid, conditionBlue) elseif #blue == #red then local team = math.random(2) == 1 and ctfConfig.blue or ctfConfig.red -- TP, noMove -- doTeleportThing(cid, team.teleportPos) -- Storages -- doCreatureSetStorage(cid, team.storage, 1) -- Conditions -- doAddCondition(cid, getCreatureStorage(cid, ctfConfig.blue.storage) > 0 and conditionBlue or conditionRed) end else local team = math.random(2) == 1 and ctfConfig.blue or ctfConfig.red -- TP -- doTeleportThing(cid, team.teleportPos) -- Storages -- doCreatureSetStorage(cid, team.storage, 1) -- Condition -- doAddCondition(cid, getCreatureStorage(cid, ctfConfig.blue.storage) > 0 and conditionBlue or conditionRed) end doPlayerPopupFYI(cid, ctfConfig.text) doCreatureSetNoMove(cid, true) -- Group -- doCreatureSetStorage(cid, ctfConfig.groupStorage, getPlayerGroupId(cid)) doPlayerSetGroupId(cid, 7) -- Condition -- doAddCondition(cid, createConditionObject(CONDITION_INFIGHT, -1)) else doPlayerSendCancel(cid, 'It is not time yet!') end return true end ]]> </talkaction> <!-- Flaga --> <action itemid='1436' event='script'> <![CDATA[ domodlib('CTF_config') domodlib('CTF_lib') function onUse(cid, item, fromPosition, itemEx, toPosition) doRemoveItem(itemEx.uid) doCreatureSetStorage(cid, ctfConfig.flag.storage, 1) doRemoveCondition(cid, CONDITION_OUTFIT) local conditionFlagRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionFlagRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionFlagRed, {lookType = 335, lookHead = 94, lookBody = 94, lookLegs = 79, lookFeet = 79, lookAddons = 3}) local conditionFlagBlue = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionFlagBlue, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionFlagBlue, {lookType = 335, lookHead = 87, lookBody = 87, lookLegs = 79, lookFeet = 79, lookAddons = 3}) doAddCondition(cid, (getCreatureStorage(cid, ctfConfig.blue.storage) == 1 and conditionFlagBlue or conditionFlagRed)) doChangeSpeed(cid, -(math.floor(getCreatureBaseSpeed(cid) / 2))) doBroadcastMessage('[CTF]\n\n' .. getCreatureName(cid) .. ' from [' .. (getCreatureStorage(cid, ctfConfig.blue.storage) == 1 and 'blue' or 'red') .. ' team] zabral flage! Let\'s capture this flag!!', MESSAGE_STATUS_WARNING) return true end ]]> </action> <!-- Events --> <event type='login' name='CTF_event_login' event='script'> <![CDATA[ domodlib('CTF_config') domodlib('CTF_lib') function onLogin(cid) if getCreatureStorage(cid, ctfConfig.blue.storage) == 1 then -- Clean storage -- doCreatureSetStorage(cid, ctfConfig.blue.storage, -1) doPlayerSetGroupId(cid, math.max(1, getCreatureStorage(cid, ctfConfig.groupStorage))) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) doRemoveCondition(cid, CONDITION_OUTFIT) elseif getCreatureStorage(cid, ctfConfig.red.storage) == 1 then -- Clean storage -- doCreatureSetStorage(cid, ctfConfig.red.storage, -1) doPlayerSetGroupId(cid, math.max(1, getCreatureStorage(cid, ctfConfig.groupStorage))) -- TP -- doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) doRemoveCondition(cid, CONDITION_OUTFIT) end if getCreatureStorage(cid, ctfConfig.flag.storage) > 0 then doCreatureSetStorage(cid, ctfConfig.flag.storage, -1) end if getCreatureStorage(cid, ctfConfig.deathStorage) > 0 then doCreatureSetStorage(cid, ctfConfig.deathStorage, -1) end registerCreatureEvent(cid, 'CTF_statsChange') registerCreatureEvent(cid, 'CTF_target') return true end ]]> </event> <event type='statschange' name='CTF_statsChange' event='script'> <![CDATA[ domodlib('CTF_config') domodlib('CTF_lib') function onStatsChange(cid, attacker, type, combat, value) if type == 1 and getCreatureHealth(cid) <= value then if isPlayer(cid) then if getCreatureStorage(cid, ctfConfig.red.storage) > 0 then addEvent(doTeleportThing, 0, cid, ctfConfig.red.deathPos) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You dead and you have been teleported to dead room. After few seconds you will be teleported again to the battle.') local deadOutfit = createConditionObject(CONDITION_OUTFIT) setConditionParam(deadOutfit, CONDITION_PARAM_TICKS, -1) addOutfitCondition(deadOutfit, {lookType = 313, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) doAddCondition(cid, deadOutfit) doRemoveConditions(cid) doCreatureAddHealth(cid, -(getCreatureHealth(cid) - 1)) doCreatureAddMana(cid, -(getCreatureMana(cid) - 1)) doCreatureSetStorage(cid, ctfConfig.deathStorage, 1) if getCreatureStorage(cid, ctfConfig.flag.storage) == 1 then if getTileItemById(getThingPos(cid), 2019).uid > 0 then doRemoveItem(getTileItemById(getThingPos(cid), 2019).uid) end doCreateItem(ctfConfig.flag.id, 1, getThingPos(cid)) doCreatureSetStorage(cid, ctfConfig.flag.storage, -1) doBroadcastMessage('[CTF]\n\n' .. getCreatureName(cid) .. ' from [red team] stracil flage!', MESSAGE_STATUS_WARNING) doChangeSpeed(cid, math.floor(getCreatureBaseSpeed(cid) / 2)) end return false elseif getCreatureStorage(cid, ctfConfig.blue.storage) > 0 then addEvent(doTeleportThing, 0, cid, ctfConfig.blue.deathPos) doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You dead and you have been teleported to dead room. After few seconds you will be teleported again to the battle.') local deadOutfit = createConditionObject(CONDITION_OUTFIT) setConditionParam(deadOutfit, CONDITION_PARAM_TICKS, -1) addOutfitCondition(deadOutfit, {lookType = 313, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) doAddCondition(cid, deadOutfit) doRemoveConditions(cid) doCreatureAddHealth(cid, -(getCreatureHealth(cid) - 1)) doCreatureAddMana(cid, -(getCreatureMana(cid) - 1)) doCreatureSetStorage(cid, ctfConfig.deathStorage, 1) if getCreatureStorage(cid, ctfConfig.flag.storage) > 0 then if getTileItemById(getThingPos(cid), 2019).uid > 0 then doRemoveItem(getTileItemById(getThingPos(cid), 2019).uid) end doCreateItem(ctfConfig.flag.id, 1, getThingPos(cid)) doCreatureSetStorage(cid, ctfConfig.flag.storage, -1) doBroadcastMessage('[CTF]\n\n' .. getCreatureName(cid) .. ' from [blue team] stracil flage!', MESSAGE_STATUS_WARNING) doChangeSpeed(cid, math.floor(getCreatureBaseSpeed(cid) / 2)) end return false end end end return true end ]]> </event> <event type='combat' name='CTF_target' event='script'> <![CDATA[ domodlib('CTF_config') domodlib('CTF_lib') function onCombat(cid, target) if isPlayer(cid) and isPlayer(target) then if getCreatureStorage(cid, ctfConfig.red.storage) == 1 and getCreatureStorage(target, ctfConfig.red.storage) == 1 then return doPlayerSendCancel(cid, 'You may not attack your team mates.') and false elseif getCreatureStorage(cid, ctfConfig.blue.storage) == 1 and getCreatureStorage(target, ctfConfig.blue.storage) == 1 then return doPlayerSendCancel(cid, 'You may not attack your team mates.') and false end end return true end ]]> </event> <movement type='StepIn' actionid='58834' event='script'> <![CDATA[ domodlib('CTF_config') domodlib('CTF_lib') function onStepIn(cid, item, position, fromPosition, toPosition, lastPosition, actor) if isPlayer(cid) then if getCreatureStorage(cid, ctfConfig.flag.storage) > 0 then if getCreatureStorage(cid, ctfConfig.red.storage) > 0 then if isControledByTeamCTF(getThingPos(cid), 'red') then local points = ctfConfig.pointsForFlag + (ctfConfig.pointsForEachBase * getBasesControledByTeamCTF('red')) if getStorage(ctfConfig.red.scores) + points >= ctfConfig.maxTeamPoints then -- Close event -- doCloseCtfEvent('red') doChangeSpeed(cid, math.floor(getCreatureBaseSpeed(cid) / 2)) else doChangeSpeed(cid, math.floor(getCreatureBaseSpeed(cid) / 2)) doRemoveCondition(cid, CONDITION_OUTFIT) local conditionRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionRed, {lookType = 130, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) doAddCondition(cid, conditionRed) doSetStorage(ctfConfig.red.scores, getStorage(ctfConfig.red.scores) + points) doBroadcastMessage('[CTF]\n\n' .. getCreatureName(cid) .. ' from [red team] przekazal flage do bazy. Aktualny wynik:\nRed team: ' .. getStorage(ctfConfig.red.scores) .. '/' .. ctfConfig.maxTeamPoints .. '\nBlue team: ' .. getStorage(ctfConfig.blue.scores) .. '/' .. ctfConfig.maxTeamPoints .. '', MESSAGE_STATUS_WARNING) end addEvent(doCreateItem, 15000, ctfConfig.flag.id, 1, ctfConfig.flag.pos) doCreatureSetStorage(cid, ctfConfig.flag.storage, -1) else doPlayerSendCancel(cid, 'This base isn\'t controlled by your team.') end elseif getCreatureStorage(cid, ctfConfig.blue.storage) > 0 then if isControledByTeamCTF(getThingPos(cid), 'blue') then local points = ctfConfig.pointsForFlag + ctfConfig.pointsForEachBase * getBasesControledByTeamCTF('blue') if getStorage(ctfConfig.blue.scores) + points >= ctfConfig.maxTeamPoints then -- Close event -- doCloseCtfEvent('blue') doChangeSpeed(cid, math.floor(getCreatureBaseSpeed(cid) / 2)) else doChangeSpeed(cid, math.floor(getCreatureBaseSpeed(cid) / 2)) doRemoveCondition(cid, CONDITION_OUTFIT) local conditionBlue = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionBlue, {lookType = 130, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87}) doAddCondition(cid, conditionBlue) doSetStorage(ctfConfig.blue.scores, getStorage(ctfConfig.blue.scores) + points) doBroadcastMessage('[CTF]\n\n' .. getCreatureName(cid) .. ' from [blue team] has supplied flag to the base. Actual results:\nRed team: ' .. getStorage(ctfConfig.red.scores) .. '/' .. ctfConfig.maxTeamPoints .. '\nBlue team: ' .. getStorage(ctfConfig.blue.scores) .. '/' .. ctfConfig.maxTeamPoints .. '', MESSAGE_STATUS_WARNING) end addEvent(doCreateItem, 15000, ctfConfig.flag.id, 1, ctfConfig.flag.pos) doCreatureSetStorage(cid, ctfConfig.flag.storage, -1) else doPlayerSendCancel(cid, 'This base isn\'t controlled by your team.') end end end end return true end ]]> </movement> <globalevent name='CTF_startEvent' interval='10000' event='script'> <![CDATA[ domodlib('CTF_config') domodlib('CTF_lib') local daysOpen = {} for k, v in pairs(ctfConfig.days) do table.insert(daysOpen, k) end function onThink(interval) if isInArray(daysOpen, os.date('%A')) then if isInArray(ctfConfig.days[os.date('%A')], os.date('%X', os.time())) then if getStorage(ctfConfig.eventStorage) ~= 1 then doStartCountingCtfEvent(0) doSetStorage(ctfConfig.eventStorage, 1) end end end if getStorage(ctfConfig.eventStorage) == 1 then checkDeathRoomCTF() for _, playerWithFlag in ipairs(getPlayersOnline()) do if getCreatureStorage(playerWithFlag, ctfConfig.flag.storage) == 1 then doSendAnimatedText(getThingPos(playerWithFlag), 'FLAG', COLOR_DARKYELLOW) break end end end return true end ]]> </globalevent> <globalevent name='CTF_bases' interval='5000' event='script'> <![CDATA[ domodlib('CTF_config') domodlib('CTF_lib') function onThink(interval) if getStorage(ctfConfig.eventStorage) == 1 then doAddScoreToBaseCTF() end return true end ]]> </globalevent> <globalevent name='CTF_outfits' interval='10000' event='script'> <![CDATA[ domodlib('CTF_config') local conditionBlue = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionBlue, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionBlue, {lookType = 130, lookHead = 87, lookBody = 87, lookLegs = 87, lookFeet = 87}) local conditionRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionRed, {lookType = 130, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) local conditionFlagRed = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionFlagRed, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionFlagRed, {lookType = 335, lookHead = 94, lookBody = 94, lookLegs = 79, lookFeet = 79, lookAddons = 3}) local conditionFlagBlue = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionFlagBlue, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionFlagBlue, {lookType = 335, lookHead = 87, lookBody = 87, lookLegs = 79, lookFeet = 79, lookAddons = 3}) local conditionDead = createConditionObject(CONDITION_OUTFIT) setConditionParam(conditionDead, CONDITION_PARAM_TICKS, -1) addOutfitCondition(conditionDead, {lookType = 313, lookHead = 94, lookBody = 94, lookLegs = 94, lookFeet = 94}) function onThink(interval) if getStorage(ctfConfig.eventStorage) == 1 then for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, ctfConfig.blue.storage) > 0 then doRemoveCondition(cid, CONDITION_OUTFIT) if getCreatureStorage(cid, ctfConfig.flag.storage) > 0 then doAddCondition(cid, conditionFlagBlue) elseif getCreatureStorage(cid, ctfConfig.deathStorage) > 0 then doAddCondition(cid, conditionDead) else doAddCondition(cid, conditionBlue) end elseif getCreatureStorage(cid, ctfConfig.red.storage) > 0 then doRemoveCondition(cid, CONDITION_OUTFIT) if getCreatureStorage(cid, ctfConfig.flag.storage) > 0 then doAddCondition(cid, conditionFlagRed) elseif getCreatureStorage(cid, ctfConfig.deathStorage) > 0 then doAddCondition(cid, conditionDead) else doAddCondition(cid, conditionRed) end end end end return true end ]]> </globalevent> <globalevent name='CTF_start' type='startup' event='script'> <![CDATA[ domodlib('CTF_config') function onStartup() for k, v in pairs(ctfConfig.bases) do doSetStorage(v.controled, 0) doSetStorage(v.points, 0) end doSetStorage(ctfConfig.red.scores, 0) doSetStorage(ctfConfig.blue.scores, 0) doSetStorage(ctfConfig.eventStorage, -1) doSetStorage(ctfConfig.joinEventStorage, -1) doSetStorage(ctfConfig.deathCountStorage, 0) return true end ]]> </globalevent> </mod>
  21. How I can create table to run Capture The Flag at my DB?
  22. glacialot postou uma resposta no tópico em Suporte Tibia OTServer
    Qual voce recomenda Summ? quero rodar o CAST nela... e mudar pra linux posteriormente...
  23. Pessoal estou pedindo a ajuda de vocês pois já testei varios MOD do Rush War e não tem como funcionar perfeitamente, uso TFS 0.4 3777, 8.60, eis que o evento começa, todos os chars se registrão, todos sao teletransportado para a sala de espera, o evento começa, a separação dos times esta tudo certo, quando um player mata outro tambem está certo, a questão é que depois de um tempo ele da o RESULTADO do evento e não marca as mortes, fica 0 para cada team, e mesmo depois de ter matado todos os adversarios o evento nao termina... fiz o teste com 2vs2, com quantia de frag para ganhar 2, ou seja quando um time mata o outro o evento teria que terminar, mas isso não acontece, segue o MOD: <?xml version="1.0" encoding="ISO-8859-1"?> <mod name="Rush Event" version="1.0" author="ChaitoSoft.com" contact="[email protected]" enabled="yes"> <description> TUTORIAL DE COMO CONFIGURAR O EVENTO ACOMPANHE POR AQUI: q - mensagem que vai ser exibida quando o evento começar d_1 - posição do tempo vermelho ao começar evento d_2 - posição do tempo azul ao começar evento x - mensagem que vai ser exibida quando o evento não começar w - posição da sala de espera, onde os players vão ficar antes de começar lvl - level minimo para participar do evento v - a quantidade de frags que será necessária para o time ganhar mn - quantidade minima de players para começar o evento m - maximo de players dentro do evento o - mensagem exibida quando o time vermelho ganhar y - mensagem exibida quando o time azul ganhar i_1 - id do premio (agora é crystal coin = 2160) i_2 - quantidade do premio (agora esta 10 crystal coins) t - tempo para começar o evento (agora esta is 5 minutos) r - tempo em que os resultados da batalha serão mostrados aos players (agora esta 3 minutos) Adicione isto em 050-function.lua: ------------------------------------------------------------------------------------------------- function doPlayerRemoveLethalConditions(cid) local tmp = {1, 2, 4, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 32768, 65536} for i = 1, #tmp do if(hasCondition(cid, tmp[i])) then doRemoveCondition(cid, tmp[i]) end end return true end ------------------------------------------------------------------------------------------------- Adicione isto em login.lua: ------------------------------------------------------------------------------------------------- registerCreatureEvent(cid, "RushCombat") registerCreatureEvent(cid, "RushAttack") registerCreatureEvent(cid, "RushDead") registerCreatureEvent(cid, "RushOutfit") ------------------------------------------------------------------------------------------------- Agora daqui pra baixo você vai configurar de acordo com o tutorial acima, o resto se não tiver conhecimento não mecha em nada pois poderá bugar o evento e não daremos suporte: --Day of Week in Number para o EVENT_DAY -- Domingo, Segunda, Terca, Quarta, Quinta, Sexta, Sabado -- Sunday - 0, Monday - 1, Tuesday - 2, Wednesday - 3, Thursday - 4, Friday - 5 Saturday - 6 </description> <config name="re"><![CDATA[ t = { a = 32145, g = 32146, l = 32147, u = 32148, h = 32149, wv = 32150, c = 0, q = "Desert Battle Event has been started! Enjoy and have fun!", f = 5447, f_1 = 5448, f_2 = 5449, d_1 = {x = 728, y = 1953, z = 7}, -- red temple d_2 = {x = 680, y = 1983, z = 7}, -- blue temple x = "O evento nao aconteceu porque poucas pessoas participaram.", w = {x = 698, y = 1918, z = 7}, lvl = 8, v = 2, mn = 4, m = 40, o = "Event was completed, RED TEAM has won Desert Battle Event!", y = "Event was completed, BLUE TEAM has won Desert Battle Event!", i_1 = 2160, i_2 = 100, t = 5, r = 3, EVENT_DAY = {1,3,5} } ]]></config> <globalevent name="Recognition" interval="150000" event="script"><![CDATA[ domodlib('re') function onThink(interval, lastExecution, thinkInterval) if(getGlobalStorageValue(t.a) == 1) then for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, t.f) == 1 then if(getPlayerStorageValue(pid, t.f_1) == 0) then doSendAnimatedText(getCreaturePosition(pid), "RED TEAM", TEXTCOLOR_RED) elseif(getPlayerStorageValue(pid, t.f_1) == 1) then doSendAnimatedText(getCreaturePosition(pid), "BLUE TEAM", TEXTCOLOR_LIGHTBLUE) end end end return true end return true end ]]></globalevent> <talkaction words="!desert1" event="script"><![CDATA[ domodlib('re') function onSay(cid, words, param, channel) if getPlayerGroupId(cid) > 3 then setGlobalStorageValue(t.g, 1) setGlobalStorageValue(t.u, 0) setGlobalStorageValue(t.l, 0) setGlobalStorageValue(t.a, 1) setGlobalStorageValue(t.c, 0) setGlobalStorageValue(t.wv, 0) doBroadcastMessage("Attention! Immediately register to Desert Battle Event, event will start for ".. t.t .." minutes. All players can join to event typing this command: !desert", MESSAGE_STATUS_WARNING) addEvent(function() doBroadcastMessage("Desert Battle event, started in 2 minutes. If you want to join, type this command: !desert", MESSAGE_STATUS_WARNING) end, (t.t - 2) * 1000 * 60) addEvent(function() doBroadcastMessage("Desert Battle event, started in a minute. If you want to join, type this command: !desert", MESSAGE_STATUS_WARNING) end, (t.t - 1) * 1000 * 60) addEvent(start, t.t * 1000 * 60) return true end return true end function results() if(getGlobalStorageValue(t.a) == 1) then local red = getGlobalStorageValue(t.l) local blue = getGlobalStorageValue(t.u) doBroadcastMessage("Desert Battle Events, results:\nRed Team scored: ".. red .." frags.\nBlue Team scored: ".. blue .." frags.\nMatch is under way to ".. t.v .." frags.", MESSAGE_STATUS_WARNING) addEvent(results, t.r * 1000 * 60) end end function start() if(getGlobalStorageValue(t.a) == 1 and getGlobalStorageValue(t.c) >= t.mn) then doBroadcastMessage(t.q, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.wv, 1) addEvent(results, t.r * 1000 * 60) for _, pid in ipairs(getPlayersOnline()) do local red = {lookType = 268, lookHead = 94, lookBody = 94, lookLegs = 114, lookFeet = 94, lookAddons = 3} local blue = {lookType = 268, lookHead = 39, lookBody = 88, lookLegs = 0, lookFeet = 19, lookAddons = 3} if getPlayerStorageValue(pid, t.f) == 1 then doCreatureAddHealth(pid, getCreatureMaxHealth(pid)) doCreatureAddMana(pid, getCreatureMaxMana(pid)) if((getPlayerStorageValue(pid, t.g) % 2) == 1) then doSetCreatureOutfit(pid, red, 5000 * 1000) setPlayerStorageValue(pid, t.h, 0) doTeleportThing(pid, t.d_1) setPlayerStorageValue(pid, t.f, 1) setPlayerStorageValue(pid, t.f_1, 0) setPlayerStorageValue(pid, t.f_2, 1) doSendMagicEffect(getCreaturePosition(pid), 10) doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, "You are in RED TEAM!\nThis battle will continue up to ".. t.v .." frags!") else doSetCreatureOutfit(pid, blue, 5000 * 1000) doTeleportThing(pid, t.d_2) setPlayerStorageValue(pid, t.h, 0) setPlayerStorageValue(pid, t.f, 1) setPlayerStorageValue(pid, t.f_1, 1) setPlayerStorageValue(pid, t.f_2, 0) doSendMagicEffect(getCreaturePosition(pid), 10) doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, "You are in BLUE TEAM!\nThis battle will continue up to ".. t.v .." frags!") end end end elseif(getGlobalStorageValue(t.c) < t.mn) then doBroadcastMessage(t.x, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.a, 0) for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, t.f) == 1 then setPlayerStorageValue(pid, t.f, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doSendMagicEffect(getCreaturePosition(pid), CONST_ME_TELEPORT) end end end end ]]></talkaction> <globalevent name="RushStart" time="02:23:01" event="script"><![CDATA[ domodlib('re') function onTime(interval, lastExecution) if(getRushEventOpenDay() == false) then return true; end setGlobalStorageValue(t.g, 1) setGlobalStorageValue(t.u, 0) setGlobalStorageValue(t.l, 0) setGlobalStorageValue(t.a, 1) setGlobalStorageValue(t.c, 0) setGlobalStorageValue(t.wv, 0) doBroadcastMessage("Attention! Immediately register to Desert Battle Event, event will start for ".. t.t .." minutes. All players can join to event typing this command: !desert", MESSAGE_STATUS_WARNING) addEvent(start, t.t * 1000 * 60) return true end function results() if(getGlobalStorageValue(t.a) == 1) then local red = getGlobalStorageValue(t.l) local blue = getGlobalStorageValue(t.u) doBroadcastMessage("Desert Battle Events, results:\nRed Team scored: ".. red .." frags.\nBlue Team scored: ".. blue .." frags.\nMatch is under way to ".. t.v .." frags.", MESSAGE_STATUS_WARNING) addEvent(results, t.r * 1000 * 60) end end function getRushEventOpenDay() for i = 1, #t.EVENT_DAY do if(tostring(t.EVENT_DAY[i]) == os.date("%w")) then return true end end return false end function start() if(getGlobalStorageValue(t.a) == 1 and getGlobalStorageValue(t.c) >= t.mn) then doBroadcastMessage(t.q, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.wv, 1) addEvent(results, t.r * 1000 * 60) for _, pid in ipairs(getPlayersOnline()) do local red = {lookType = 268, lookHead = 94, lookBody = 94, lookLegs = 114, lookFeet = 94, lookAddons = 3} local blue = {lookType = 268, lookHead = 39, lookBody = 88, lookLegs = 0, lookFeet = 19, lookAddons = 3} if getPlayerStorageValue(pid, t.f) == 1 then doCreatureAddHealth(pid, getCreatureMaxHealth(pid)) doCreatureAddMana(pid, getCreatureMaxMana(pid)) if((getPlayerStorageValue(pid, t.g) % 2) == 1) then doSetCreatureOutfit(pid, red, 5000 * 1000) setPlayerStorageValue(pid, t.h, 0) doTeleportThing(pid, t.d_1) doRemoveCondition(pid, CONDITION_INFIGHT) setPlayerStorageValue(pid, t.f, 1) setPlayerStorageValue(pid, t.f_1, 0) setPlayerStorageValue(pid, t.f_2, 1) doSendMagicEffect(getCreaturePosition(pid), 10) doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, "You are in RED TEAM!\nThis battle will continue up to ".. t.v .." frags!") else doSetCreatureOutfit(pid, blue, 5000 * 1000) setPlayerStorageValue(pid, t.h, 0) doTeleportThing(pid, t.d_2) doRemoveCondition(pid, CONDITION_INFIGHT) setPlayerStorageValue(pid, t.f, 1) setPlayerStorageValue(pid, t.f_1, 1) setPlayerStorageValue(pid, t.f_2, 0) doSendMagicEffect(getCreaturePosition(pid), 10) doPlayerSendTextMessage(pid, MESSAGE_EVENT_ADVANCE, "You are in BLUE TEAM!\nThis battle will continue up to ".. t.v .." frags!") end end end elseif(getGlobalStorageValue(t.c) < t.mn) then doBroadcastMessage(t.x, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.a, 0) for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, t.f) == 1 then setPlayerStorageValue(pid, t.f, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doRemoveCondition(pid, CONDITION_INFIGHT) doSendMagicEffect(getCreaturePosition(pid), CONST_ME_TELEPORT) end end end end ]]></globalevent> <talkaction words="!desert" event="script"><![CDATA[ domodlib('re') function onSay(cid, words, param, channel) if getGlobalStorageValue(t.a) == 1 and getGlobalStorageValue(t.wv) ~= 1 then if getPlayerLevel(cid) >= t.lvl then if getPlayerStorageValue(cid, t.f) == -1 then if getTilePzInfo(getPlayerPosition(cid)) == true then if getGlobalStorageValue(t.c) < t.m then setGlobalStorageValue(t.c, getGlobalStorageValue(t.c)+1) if getGlobalStorageValue(t.c) == t.m then doPlayerSendCancel(cid, "Event is full [" .. getGlobalStorageValue(t.c) .. " players]!") else doBroadcastMessage("" .. getPlayerName(cid) .. " has joined to Desert Battle! Actually we have: " .. getGlobalStorageValue(t.c) .. " players!", 19) end setPlayerStorageValue(cid, t.f, 1) setPlayerStorageValue(cid, t.h, -1) doTeleportThing(cid, t.w) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT) setPlayerStorageValue(cid, t.g, getGlobalStorageValue(t.g)) setGlobalStorageValue(t.g, tonumber(getGlobalStorageValue(t.g))+1) else doPlayerSendCancel(cid, "Event is full [" .. getGlobalStorageValue(t.c) .. " players]!") return true end else doPlayerSendCancel(cid, "You must be in protection zone.") return true end else doPlayerSendCancel(cid, "You are already registered in this event.") return true end else doPlayerSendCancel(cid, "Your level is too low to participate in this event.") return true end else doPlayerSendCancel(cid, "At the moment there are no records for this event.") return true end return true end ]]></talkaction> <event type="combat" name="RushCombat" event="script"><![CDATA[ domodlib('re') function onCombat(cid, target) if(getGlobalStorageValue(t.a) == 1) then if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, t.f) == 1 and getPlayerStorageValue(target, t.f) == 1 then if getPlayerStorageValue(cid, t.f_1) == getPlayerStorageValue(target, t.f_1) then return doPlayerSendCancel(cid, "Sorry, you cannot attack your own team.") and false end end end end return true end ]]></event> <event type="attack" name="RushAttack" event="script"><![CDATA[ domodlib('re') function onAttack(cid, target) if(getGlobalStorageValue(t.a) == 1) then if isPlayer(cid) and isPlayer(target) then if getPlayerStorageValue(cid, t.f) == 1 and getPlayerStorageValue(target, t.f) == 1 then if getPlayerStorageValue(cid, t.f_1) == getPlayerStorageValue(target, t.f_1) then return doPlayerSendCancel(cid, "Sorry, you cannot attack your own team.") and false end end end end return true end ]]></event> <event type="preparedeath" name="RushDead" event="script"><![CDATA[ domodlib('re') function onPrepareDeath(cid, deathList) if(not isPlayer(cid)) or (getGlobalStorageValue(t.a) ~= 1) or (getPlayerStorageValue(cid, t.f) ~= 1) then return true end if getGlobalStorageValue(t.a) == 1 then local strings = {""} local j, position, corpse = 1, 1, 0 for _, pid in ipairs(deathList) do if isCreature(pid) == true then strings[position] = j == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .. getCreatureName(pid) .. "" j = j + 1 else strings[position] = j == 1 and "" or strings[position] .. ", " strings[position] = strings[position] .."a field item" j = j + 1 end end for i, str in ipairs(strings) do if(str:sub(str:len()) ~= ",") then str = str .. "." end desc = "You recognize " desc = desc .. "" .. getCreatureName(cid) .. ". He was killed by " .. str end if(getPlayerSex(cid) == 1) then corpse = doCreateItem(3058, getCreaturePosition(cid)) else corpse = doCreateItem(3065, getCreaturePosition(cid)) end doItemSetAttribute(corpse, "description", desc) if((getPlayerStorageValue(cid, t.g) % 2) == 1) then setGlobalStorageValue(t.u, getGlobalStorageValue(t.u)+1) else setGlobalStorageValue(t.l, getGlobalStorageValue(t.l)+1) end local red = getGlobalStorageValue(t.l) local blue = getGlobalStorageValue(t.u) if blue < t.v or red < t.v then if(isPlayer(cid) == false) then return true end local redoutfit = {lookType = 268, lookHead = 94, lookBody = 94, lookLegs = 114, lookFeet = 94, lookAddons = 3} local blueoutfit = {lookType = 268, lookHead = 39, lookBody = 88, lookLegs = 0, lookFeet = 19, lookAddons = 3} if((getPlayerStorageValue(cid, t.g) % 2) == 1) then doTeleportThing(cid, t.d_1) doRemoveCondition(cid, CONDITION_INFIGHT) doSendMagicEffect(getCreaturePosition(cid), 10) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerRemoveLethalConditions(cid) if getCreatureSkullType(cid) == SKULL_WHITE then doCreatureSetSkullType(cid, 0) end doSetCreatureOutfit(cid, redoutfit, 5000 * 1000) else doTeleportThing(cid, t.d_2) doRemoveCondition(cid, CONDITION_INFIGHT) doSendMagicEffect(getCreaturePosition(cid), 10) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerRemoveLethalConditions(cid) if getCreatureSkullType(cid) == SKULL_WHITE then doCreatureSetSkullType(cid, 0) end doSetCreatureOutfit(cid, blueoutfit, 5000 * 1000) end end if blue >= t.v then doBroadcastMessage(t.y, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.h, 1) for _, pid in ipairs(getPlayersOnline()) do if(getPlayerStorageValue(pid, t.f_1) == 1) then doPlayerAddItem(pid, t.i_1, t.i_2) doPlayerAddItem(pid, 8306, 1) end end elseif red >= t.v then doBroadcastMessage(t.o, MESSAGE_STATUS_WARNING) setGlobalStorageValue(t.h, 1) for _, pid in ipairs(getPlayersOnline()) do if(getPlayerStorageValue(pid, t.f_2) == 1) then doPlayerAddItem(pid, t.i_1, t.i_2) doPlayerAddItem(pid, 8306, 1) end end end if getGlobalStorageValue(t.h) == 1 then setGlobalStorageValue(t.a, 0) setGlobalStorageValue(t.h, 0) setGlobalStorageValue(t.wv, -1) setPlayerStorageValue(cid, t.f, -1) setPlayerStorageValue(cid, t.g, 0) setPlayerStorageValue(cid, t.l, 0) setPlayerStorageValue(cid, t.u, 0) setPlayerStorageValue(cid, t.f_1, -1) setPlayerStorageValue(cid, t.f_2, -1) setPlayerStorageValue(cid, t.h, -1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) doRemoveCondition(cid, CONDITION_INFIGHT) doSendMagicEffect(getCreaturePosition(cid), 10) doCreatureAddHealth(cid, getCreatureMaxHealth(cid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(cid, getCreatureMaxMana(cid)) doPlayerRemoveLethalConditions(cid) for _, pid in ipairs(getPlayersOnline()) do if(getPlayerStorageValue(pid, t.f_1) == 1 or getPlayerStorageValue(pid, t.f_2) == 1) then setPlayerStorageValue(pid, t.f, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid))) doRemoveCondition(pid, CONDITION_INFIGHT) doSendMagicEffect(getCreaturePosition(pid), CONST_ME_TELEPORT) setPlayerStorageValue(pid, t.g, 0) setPlayerStorageValue(pid, t.l, 0) setPlayerStorageValue(pid, t.u, 0) setPlayerStorageValue(pid, t.f_1, -1) setPlayerStorageValue(pid, t.f_2, -1) setPlayerStorageValue(pid, t.h, -1) doCreatureAddHealth(pid, getCreatureMaxHealth(pid), MAGIC_EFFECT_UNKNOWN, COLOR_UNKNOWN, true) doCreatureAddMana(pid, getCreatureMaxMana(pid)) doPlayerRemoveLethalConditions(pid) doRemoveCondition(pid, CONDITION_OUTFIT) end end return false end return false end return true end ]]></event> <event type="outfit" name="RushOutfit" event="script"><![CDATA[ domodlib('re') function onOutfit(cid, old, current) if(getGlobalStorageValue(t.a) == 1) then if getPlayerGroupId(cid) > 3 then return true end if getPlayerStorageValue(cid, t.h) == 0 then if getPlayerStorageValue(cid, t.f) > -1 then doPlayerSendCancel(cid, "You cannot change your outfit during the event.") return false end end end return true end ]]></event> </mod> Agradeço a ajuda de todos! up
  24. glacialot postou uma resposta no tópico em Suporte Tibia OTServer
    Pessoal estou tentando usar a Distro do luanluciano93 ">http://https://imageshack.com/i/pdldwlDlp'> Meu notebook tem 12gb de memoria e é w7 64bits, oque preciso fazer?

Informação Importante

Confirmação de Termo