Ir para conteúdo

Flathoste

Membro
  • Registro em

  • Última visita

Histórico de Curtidas

  1. Gostei
    Flathoste recebeu reputação de Kizue em Baiak-ice 8.60 Atualizado com Real Castle e Varios sistemas   
    Quem nos roubou o dinheiro em caixa, foi você que  se passava de funcionario(amigo) e fez oque fez, grande indole de homem, você tem!
  2. Negativo
    Flathoste recebeu reputação de Absolute em Baiak-ice 8.60 Atualizado com Real Castle e Varios sistemas   
    Quem nos roubou o dinheiro em caixa, foi você que  se passava de funcionario(amigo) e fez oque fez, grande indole de homem, você tem!
  3. Gostei
    Flathoste deu reputação a Absolute em SNOWBAL EVENT TIBIA   
    Olá amigos, membros, visitantes, papagaios, enfim...

    Depois de muito me pedirem o evento SNOWBAL WAR EVENT, trago ele 100% pra vocês.

    Como funciona?
    Os jogadores irão se divertir em uma emocionante partida de guerra de bolas de neve. O objetivo principal do evento é derrubar o número máximo de jogadores durante uma partida - atirando bolas de neve contra seus inimigos. O jogador que mais pontos fizer até o termino do evento será o vencedor (recompensa pode ser configurada).

    Sem delongas, vamos ao que interessa...
     
     
     
     

    Em data/actions abra o seu actions.xml e insira a seguinte linha:
     
     
    <action actionid="7900" event="script" value="snowballaction.lua" />

    Em data/actions/scripts crie um arquivo com o nome de snowballaction.lua e insira o seguinte conteúdo:
    function onUse(cid, item, frompos, item2, topos) if item.actionid == 7900 then if(SBW_AMMOINFI) then doPlayerSendTextMessage(cid, 27, "as bolas de neve sao infinitas, nao ha necessidade que voce compre-as.") else if (getPlayerStorageValue(cid, SBW_SCORE) > 0) and (getPlayerStorageValue(cid, SBW_AMMO) < 30) then doPlayerSetStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE)-1) doPlayerSetStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO)+SBW_AMMOBUY) doPlayerSendTextMessage(cid, 27, "Voce trocou " .. SBW_AMMOBUY .. "x bolas de neve por 1 ponto de placar.") doSendMagicEffect(getCreaturePosition(cid),4) else doPlayerSendTextMessage(cid, 27, "Voce nao possui pontos de jogo o suficiente ou ja esta carregando muitas bolas de neve.") end end end end  
     
     
     

    Em data/talkactions abra o seu talkactions.xml e insira a seguinte linha:
     
    <talkaction words="!snowball" event="script" value="snowballtalk.lua"/>

    Em data/talkactions/scripts crie um arquivo com o nome de snowballtalk.lua e insira o seguinte conteúdo:
    function onSay(cid, words, param, channel) local k = string.explode(param, ",") if(k[1] ~= nil) then if(string.upper(k[1]) == 'INFO') then local score = {} local output = "Voce tem " .. getPlayerStorageValue(cid, SBW_SCORE) .. " pontos.\nVoce tem "..getPlayerStorageValue(cid, SBW_AMMO).."x municoes.\n------------------\nO maior matador:\n" for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, SBW_INEVENT) then table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)}) end end local lx = table.getn(score) if(lx > 3) then lx = 3 end table.sort(score, function(a, b) return a[2] > b[2] end) for k = 1,lx do output = output .. k..". "..score[k][1] .." [".. score[k][2] .."].\n" end doPlayerPopupFYI(cid, output) end if (string.upper(k[1]) == 'ATIRAR') then if(getPlayerStorageValue(cid, SBW_INEVENT) == 1) and not getTileInfo(getThingPos(cid)).protection then if getPlayerStorageValue(cid, SBW_EXAUSTHED) <= 1 then if(getPlayerStorageValue(cid, SBW_AMMO) > 0) then if SBW_STATUS == 'on' then if(SBW_AMMOINFI == false) then doPlayerSetStorageValue(cid, SBW_AMMO, getPlayerStorageValue(cid, SBW_AMMO)-1) end doPlayerSetStorageValue(cid, SBW_EXAUSTHED, 2) lineAnimation(getPlayerLookDirection(cid),getCreaturePosition(cid),12,cid,1,0,1,0,0,0,1,0) addEvent(doPlayerSetStorageValue, SBW_SHOOTEXAUSTHED, cid, SBW_EXAUSTHED, 1) if (getPlayerStorageValue(cid, SBW_AMMO) ~= 1) then doPlayerSendTextMessage(cid, 27, "Restam "..getPlayerStorageValue(cid, SBW_AMMO).."x bolas de neve.") else doPlayerSendTextMessage(cid, 27, "Usando sua ultima bola de neve, recarregue.") end end else doPlayerSendCancel(cid, "Voce esta sem bolas de neve, recarregue no centro do campo ou mate um inimigo.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end else doPlayerPopupFYI(cid, "Acalme-se voce deve esperar para atirar novamente.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) return false end else doPlayerPopupFYI(cid, "Voce precisa estar dentro evento ou fora da pz.") doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) end end end return true end function lineAnimation(lookDir,playerPos,effect,cid,fvar,fpos,ffound,fposV,fcheck,fvcid,floopCounter,fvpid, name) local var = fvar local pos = fpos local found = ffound local posV = fposV local check = fcheck local vcid = fvcid local loopCounter = floopCounter local vpid = fvpid local storage = SBW_EXAUSTHED if var < 2 then vcid = cid end pos = playerPos if not isInWallArray(convert(lookDir,pos)) then--isInWallArray({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z}) then --isInArray(t.onShoot.misc.walls_id, getThingfromPos({x=convert(lookDir,pos).x, y=convert(lookDir,pos).y,z=convert(lookDir,pos).z, stackpos=0}).itemid) then doSendDistanceShoot(pos, convert(lookDir,pos),effect) pos = convert(lookDir,pos) var=var+1 posV = convertV(lookDir,playerPos) for _, pid in ipairs(getPlayersOnline()) do if (getCreaturePosition(pid).x == pos.x and getCreaturePosition(pid).y == pos.y and getCreaturePosition(pid).z == pos.z) then --if loopCounter > 2 then vpid = pid --end if (vpid ~= vcid) then if var > 2 then if (getCreaturePosition(pid).x == posV.x and getCreaturePosition(pid).y == posV.y and getCreaturePosition(pid).z == posV.z) then killPlayer(pid,pos,getCreatureName(vcid)) if (lookDir == 0) or (lookDir == 2) then var = 6 else var = 8 end end end killPlayer(pid,pos,vcid) if (lookDir == 0) or (lookDir == 2) then var = 6 else var = 8 end end end loopCounter = loopCounter +1 end if (lookDir == 0) or (lookDir == 2) then if var ~= 6 then addEvent(lineAnimation, SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid) else var = 1 end else if var ~= 8 then addEvent(lineAnimation, SBW_BALLSPEED, lookDir,pos,effect,nil,var,pos,found,posV,check,vcid,loopCounter,vpid) else var = 1 end end else doSendMagicEffect(convert(lookDir,pos),2) var = 1 end end local ret = {} function convert(lookDir,pos) local positions = { [0] = {x = pos.x, y = pos.y-1, z = pos.z}, [1] = {x = pos.x+1, y = pos.y, z = pos.z}, [2] = {x = pos.x, y = pos.y+1, z = pos.z}, [3] = {x = pos.x-1, y = pos.y, z = pos.z} } ret = positions[lookDir] return ret end local ret = {} function convertV(lookDir,pos) local positions = { [0] = {x = pos.x, y = pos.y+1, z = pos.z}, [1] = {x = pos.x-1, y = pos.y, z = pos.z}, [2] = {x = pos.x, y = pos.y-1, z = pos.z}, [3] = {x = pos.x+1, y = pos.y, z = pos.z} } ret = positions[lookDir] return ret end function isInWallArray(pos) for k = 0, table.getn(SBW_WALLSID) do if getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k] then --this doesn't even make sense but tried other ways and it gave errors, so meh 2lazy2search return true end end return false end function killPlayer(cid, pos, killer) local t_l = SBW_AREA[1] local b_r = SBW_AREA[2] local posti = {} local isPossibleToTeleportPlayer = false while (isPossibleToTeleportPlayer == FALSE) do posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7) if isInWallArray(posti) == FALSE then isPossibleToTeleportPlayer = TRUE end end doTeleportThing(cid, posti) doSendMagicEffect(pos,2) doSendMagicEffect(posti,6) doSendAnimatedText(pos, ""..getCreatureName(killer).." ", 55) doPlayerSendTextMessage(cid, 27, "Voce morreu para "..getCreatureName(killer)..".") doPlayerSetStorageValue(killer, SBW_SCORE, getPlayerStorageValue(killer, SBW_SCORE)+SBW_POINTSKILL) doPlayerSendTextMessage(killer, 27, "You've killed "..getCreatureName(cid)..".") if SBW_LOSTSCORE then doPlayerSetStorageValue(cid, SBW_SCORE, getPlayerStorageValue(cid, SBW_SCORE)-1) end if SBW_RESETAMMO then doPlayerSetStorageValue(cid, SBW_AMMO, SBW_MINAMMO) end end  
     
     
     
     
    Em data/globalevents abra o seu globalevents.xml e insira a seguinte linha:
    <globalevent name="StartSBW" time="19:00" event="script" value="events/snowballglobalevent.lua"/>
    Em data/globalevents/scripts crie um arquivo com o nome de snowballglobalevent.lua e insira o seguinte conteúdo:
    function onTime() function isInWallArray(pos) for k = 0, table.getn(SBW_WALLSID) do if (getTileItemById(pos, SBW_WALLSID[k]).itemid == SBW_WALLSID[k]) then return true end end return false end function endsnowball() local score = {} if not SBW_USEWAIT then doRemoveItem(getTileItemById(SBW_TP, 1387).uid) end for _, pid in ipairs(getPlayersOnline()) do if getPlayerStorageValue(pid, SBW_INEVENT) > 0 then table.insert(score, {getCreatureName(pid), getPlayerStorageValue(pid, SBW_SCORE)}) doPlayerSetStorageValue(pid, SBW_INEVENT, 0) doPlayerSetStorageValue(pid, SBW_SCORE, 0) doPlayerSetStorageValue(pid, SBW_AMMO, 0) doTeleportThing(pid, SBW_TPEND) end end table.sort(score, function(a, b) return a[2] > b[2] end) --local random_item = SBW_REWARDS[math.random(1, #SBW_REWARDS)] local hora = os.date("%X") local data = os.date("%x") if table.getn(score) > 0 then if SBW_ADDREWARD then for _, pid in ipairs(getPlayersOnline()) do if getCreatureName(pid) == score[1][1] then for op,ad in pairs(SBW_REWARDS) do doPlayerAddItem(pid, ad[1], ad[2]) end break end end end db.query("INSERT INTO `snowballwar` VALUES ('', ".. db.escapeString(score[1][1]) .. ",".. score[1][2] ..", ".. db.escapeString(data) ..", ".. db.escapeString(hora) ..");") db.query("UPDATE `players` SET `sbw_points`=`sbw_points`+".. score[1][2] .." WHERE `name` = " .. db.escapeString(score[1][1]) .. ";") doBroadcastMessage("[SNOWBALL EVENT] encerrou-se, parabens ao jogador "..score[1][1].." que venceu o SnowBall Event com "..score[1][2].." pontos.") end return true end local t_l = SBW_AREA[1] local b_r = SBW_AREA[2] function moveToEvent() for _, pid in ipairs(getPlayersOnline()) do if isInRange(getCreaturePosition(pid), SBW_WAITROOM[1], SBW_WAITROOM[2]) then local posti = {} local isPossibleToTeleportPlayer = false while (isPossibleToTeleportPlayer == FALSE) do posti = Position(math.random(t_l.x,b_r.x), math.random(t_l.y, b_r.y), 7) if (isInWallArray(posti) == FALSE) then isPossibleToTeleportPlayer = TRUE end end doTeleportThing(pid, posti) doPlayerSetStorageValue(pid, SBW_INEVENT, 1) doPlayerSetStorageValue(pid, SBW_AMMO, SBW_MINAMMO) doPlayerSetStorageValue(pid, SBW_SCORE, 0) doPlayerSendTextMessage(pid, 27, "[SNOWBALL WAR] Seja bem vindo, aqui estao os comandos que voce vai usar durante o evento\n!snowball atirar --Atirar uma bola de neve.\n!snowball info --Isso mostra seus pontos de jogos e a quantia de bolas de neve que voce tem. Tambem mostra o ranking de pontos do evento.\n Recarregue suas bolas de neve clicando em frente ao gerador no centro do campo.\nAltamente recomendado adicionar estes comandos a sua hotkeys.") end end doRemoveItem(getTileItemById(SBW_TP, 1387).uid) addEvent(endsnowball, SBW_DURATION*1000*60) doBroadcastMessage(SBW_MSGSTART) end local time = os.date("*t") local timeopen1 = math.ceil(SBW_TIMEWAIT / 4) local timeopen2 = math.ceil(SBW_TIMEWAIT / 2) if (SBW_STARTAUTO) and (isInArray(SBW_DAYS,time.wday)) then doBroadcastMessage(SBW_MSGWARNING) if SBW_USEWAIT then addEvent(doBroadcastMessage, timeopen1*1000*60, "[SNOWBALL WAR] - Resta(m) ".. timeopen2 .." minuto(s) para iniciar o evento!") if (timeopen2 ~= timeopen1) then addEvent(doBroadcastMessage, timeopen2*1000*60, "[SNOWBALL WAR] - Resta(m) ".. timeopen1 .." minuto(s) para iniciar o evento!") end addEvent(moveToEvent, SBW_TIMEWAIT*1000*60) doCreateTeleport(1387, SBW_TPGO, SBW_TP) else if SBW_TFS == "0.3" then doItemSetAttribute(doCreateItem(1387, SBW_TP), "aid", 2880) else doSetItemActionId(doCreateItem(1387, SBW_TP), 2880) end if(SBW_DURATION > 0) then addEvent(endsnowball, SBW_DURATION*1000*60) end end end return true end  
     
     
     
     
    Em data/movements abra o seu movements.xml e insira a seguinte linha:
    <movevent type="StepIn" actionid ="2880" event="script" value="snowballmovement.lua"/>  
    Em data/movements/scripts crie um arquivo com o nome de snowballglobalmovement.lua e insira o seguinte conteúdo:
    function onStepIn(cid, item, pos) doTeleportThing(cid, SBW_TPGO) doBroadcastMessage("[SNOWBALL WAR] O " ..getCreatureName(cid).. " player esta participando do evento snowball.", MESSAGE_STATUS_CONSOLE_ORANGE) doPlayerSetStorageValue(cid, SBW_INEVENT, 1) doPlayerSetStorageValue(cid, SBW_AMMO, SBW_MINAMMO) doPlayerSetStorageValue(cid, SBW_SCORE, 0) end  
     
     
     
     
    Já estamos quase terminando!
    Agora em data/lib crie um arquivo com o nome de SBW.lua com o seguinte conteúdo:
     
    -- This script is part of Snow Ball War Event Tibiaking Absolute -- -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // -- POSIÇÕES IMPORTANTES SBW_AREA = {{x = 1214, y = 1205, z = 7}, {x = 1251, y = 1242, z = 7}}-- AREA DO EVENTO | Canto superior esquerdo / inferior direito SBW_WAITROOM = {{x = 1229, y = 1220, z = 6}, {x = 1235, y = 1226, z = 6}} -- AREA DE ESPERA | Canto superior esquerdo / inferior direito SBW_TP = {x = 165, y = 45, z = 7} -- local onde teleport sera criado (entrada de jogadores) SBW_TPGO = {x = 1232, y = 1223, z = 6} -- local onde teleport vai levar (saida de jogadores) SBW_TPEND = {x = 155, y = 54, z = 7} -- local onde serao teleport ao final do evento SBW_GERADOR = {x = 1232, y = 1223, z = 7} -- local onde gerador vai ficar -- CONFIGURAÇÕES DO EVENTO SBW_DAYS = {1,2,3,4,5,6,7} -- dias de semana que vai abrir SBW_DURATION = 10 -- duração do evento em minutos SBW_POINTSKILL = 1 -- pontos de jogo por morte SBW_AMMOBUY = 20 -- quantia de munições compradas por cada ponto SBW_MINAMMO = 50 -- munição inicial dos jogadores SBW_TIMEWAIT = 3 -- tempo na sala de espera em minutos SBW_AMMOINFI = false SBW_LOSTSCORE = true SBW_RANDOMIZE = true SBW_RESETAMMO = true SBW_STARTAUTO = true SBW_USEWAIT = true --PREMIO DO EVENTO SBW_ADDREWARD = true SBW_REWARDS = { {6527,500}, {2345,1} } -- // Não mexa daqui para baixo SBW_TFS = "0.4" -- STORAGES SBW_EXAUSTHED = 2455 SBW_INEVENT = 2460 SBW_SCORE = 2465 SBW_AMMO = 2400 SBW_WALLSID = {5324,7003,7021,6712,7023,7002,6713,6714,6869,6822,6823,6824,6825,6826,6827,6828,6829,6830,6831,6832,6833,6707,6708,6709,6710,6711,2698,2697,7020,6719,6720,6721,6722,6723,6724,6725,6726,6727,6761,6762,6768,6769,4608,4609,4610,4611,4612,4613,4614,4615,4616,4617,4618,4619,4620,4621,4622,4623,4624,4625,4664,4665,4666,7008,7009,7010,7011,8239,7004,7005,7006,7007,6627,6628,6629,6630,6631,6632,6633,6634,6635,6636,6637,6638,7022} SBW_BALLSPEED = 150 SBW_SHOOTEXAUSTHED = 1000 SBW_SHOOTDIR = 0 SBW_STATUS = 'on' -- MENSAGENS SBW_MSGWARNING = "[SNOWBALL WAR] Abriu o teleport de ingresso para o evento, para participar se dirija ate o templo do servidor." SBW_MSGSTART = "[SNOWBALL WAR] O teleport foi removido e o evento foi iniciado, boa sorte a todos participantes." A frente das configuração solicitadas explica onde devem ser modificados.
     
     
     
     
     
    E por fim, vá até o seu banco de dados (phpmyadmin) e insira a seguinte query:
    CREATE TABLE IF NOT EXISTS `snowballwar` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(255) NOT NULL, `score` int(11) NOT NULL, `data` varchar(255) NOT NULL, `hora` varchar(255) NOT NULL, PRIMARY KEY (`id`), KEY `id` (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;  
    Ainda no phpmyadmin execute:
    ALTER TABLE `players` ADD `sbw_points` int(11);  
     
    Importe o arquivo SNOWBALL.otbm em seu mapa!
    Imagem do mapa:


    Download do mapa: https://www.sendspace.com/file/mae37z
    Scan do mapa: https://www.virustotal.com/pt/file/94a507c71ef4cc241e415f2a8290441f7fa77809d804e24be18e9581a85c4740/analysis/1479161634/
     
     


    É importante lembrar que peguei o script de um autor e realizei as modificações o tornando público para a comunidade exclusiva do TIBIAKING.

    Espero que façam um ótimo proveito.

    See you later.
  4. Gostei
    Flathoste deu reputação a Absolute em [ANTI-CLONE] 100% NOVO [O MELHOR]   
    Fala galera do TK!
     

     
    Trago hoje a vocês um sistema que desenvolvi sob uma base de shop com meu parceiro Thales Valentim do pokemonbr.com.br a alguns meses, pós vários testes e visando que funcionou perfeitamente trago para vocês!
     
    Como funciona?
    Toda vez que um ItemVIP ou qualquer Item comprado no SHOP do seu site, quando ele for entregar ao player, irá ficar; COMPRADOR POR:, ou seja; irá adicionar uma "KEY" algo que realmente saiu direto do seu SHOP, pois quando o item é disparado para o player ele vai entregar normal com a função "doCreateItemEx" e então adicionar a descrição no mesmo com a função "doItemSetAttribute".
    E como evitará os clones Absolute?
    Você terá uma QUERY para executar no seu banco de dados, fazendo uma checagem dos items VIPS que não possuem esse SERIAL KEY (o script também já faz a checagem), ou seja; os que não tiverem a KEY foram clonados (não saíram do SHOP), e então vocês poderão deleta-los manualmente caso necessário.
     
    É muito simples, apenas um script e a QUERY de checagem.

     
     
    Vamos a instalação?
     
    Em data/globalevents/scripts substitua o seu arquivo shop.lua por este:
    -- ### CONFIG ### -- message send to player by script "type" (types you can check in "global.lua") SHOP_MSG_TYPE = 19 -- time (in seconds) between connections to SQL database by shop script SQL_interval = 30 -- ### END OF CONFIG ### function onThink(interval, lastExecution) local result_plr = db.getResult("SELECT * FROM z_ots_comunication WHERE `type` = 'login';") if(result_plr:getID() ~= -1) then while(true) do id = tonumber(result_plr:getDataInt("id")) action = tostring(result_plr:getDataString("action")) delete = tonumber(result_plr:getDataInt("delete_it")) cid = getCreatureByName(tostring(result_plr:getDataString("name"))) if isPlayer(cid) == TRUE then local itemtogive_id = tonumber(result_plr:getDataInt("param1")) local itemtogive_count = tonumber(result_plr:getDataInt("param2")) local container_id = tonumber(result_plr:getDataInt("param3")) local container_count = tonumber(result_plr:getDataInt("param4")) local add_item_type = tostring(result_plr:getDataString("param5")) local add_item_name = tostring(result_plr:getDataString("param6")) local received_item = 0 local full_weight = 0 if add_item_type == 'container' then container_weight = getItemWeightById(container_id, 1) if isItemRune(itemtogive_id) == TRUE then items_weight = container_count * getItemWeightById(itemtogive_id, 1) else items_weight = container_count * getItemWeightById(itemtogive_id, itemtogive_count) end full_weight = items_weight + container_weight else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) if isItemRune(itemtogive_id) == TRUE then full_weight = getItemWeightById(itemtogive_id, 1) else full_weight = getItemWeightById(itemtogive_id, itemtogive_count) end end local free_cap = getPlayerFreeCap(cid) if full_weight <= free_cap then if add_item_type == 'container' then local new_container = doCreateItemEx(container_id, 1) doItemSetAttribute(new_container, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') local iter = 0 while iter ~= container_count do local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') doAddContainerItemEx(new_container, new_item) iter = iter + 1 end received_item = doPlayerAddItemEx(cid, new_container) else local new_item = doCreateItemEx(itemtogive_id, itemtogive_count) doItemSetAttribute(new_item, "description", 'Bought by ' .. getCreatureName(cid) .. ' [ID:' .. id .. '].') received_item = doPlayerAddItemEx(cid, new_item) end if received_item == RETURNVALUE_NOERROR then doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, 'You received >> '.. add_item_name ..' << from OTS shop.') doPlayerSave(cid) db.executeQuery("DELETE FROM `z_ots_comunication` WHERE `id` = " .. id .. ";") db.executeQuery("UPDATE `z_shop_history_item` SET `trans_state`='realized', `trans_real`=" .. os.time() .. " WHERE id = " .. id .. ";") else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. Please make place for this item in your backpack/hands and wait about '.. SQL_interval ..' seconds to get it.') end else doPlayerSendTextMessage(cid, SHOP_MSG_TYPE, '>> '.. add_item_name ..' << from OTS shop is waiting for you. It weight is '.. full_weight ..' oz., you have only '.. free_cap ..' oz. free capacity. Put some items in depot and wait about '.. SQL_interval ..' seconds to get it.') end end if not(result_plr:next()) then break end end result_plr:free() end return TRUE end  
    Confira se no seu globalevents.xml já possui a tag:
    <globalevent name="shop" interval="30000" script="shop.lua"/>  
    PRONTO, VOCÊ ESTÁ LIVRE DE CLONES! TÃO SIMPLES NÃO?

     
     
     
     
    Para fazer a checagem se há items clonados, abra o seu phpmyadmin e execute a seguinte query:
    ------------------- COMANDO SQL BY ABSOLUTE PARA VERIFICAR A TABELA PLAYER_DEPOTITEMS---------------------- SELECT `player_id`,`pid`,`sid`,CONVERT( `attributes` USING latin1 ) FROM `player_depotitems` WHERE CONVERT( `attributes` USING latin1 ) LIKE '%description%' ------------------- COMANDO SQL BY ABSOLUTE PARA VERIFICAR A TABELA PLAYER_ITEMS---------------------- SELECT `player_id`,`pid`,`sid`,CONVERT( `attributes` USING latin1 ) FROM `player_items` WHERE CONVERT( `attributes` USING latin1 ) LIKE '%description%'
     
     
    OBSERVAÇÃO IMPORTANTE: Caso seu servidor já esteja online e já possua vendas no seu SHOP, você terá que adicionar a "KEY" em todos os items ou reseta-los.
    OUTRA OBSERVAÇÃO: Nunca crie items VIP com o ADMIN e de aos jogadores, pois eles ficaram sem a "KEY" e poderão ser deletados.
     
     
    ESTE SCRIPT FUNCIONA PERFEITAMENTE NAS REVS 0.3.6 e 0_4, caso necessário passo para a 1.x. S
    IMPLES, PRATICO E PERFEITO NÃO?
     
     
    Quero vê-los usando, espero ter ajudado. :D
     
     
     
    Até a próxima!
     
     
    Absolute.
     
  5. Gostei
    Flathoste deu reputação a Absolute em [Castle War 24H] Conquiste o trono!   
    Fala galera linduxa do TK; hoje trago a vocês o tão desejado CASTLE WAR 24 HORAS, isto gera disputa intensa entre as guilds de seu servidor, atraindo assim mais jogadores que se interessam por guerras e seus demais sistemas! Modificado e com funções diferentes, no tópico ensinarei como instalar e como funciona.
     
     

     
     
    Como funciona? WOOOOOOOOW!
     
    Há um portal 24h aberto em algum lugar do seu mapa que ficará com o castle disponível 24h (avá).
    Quando uma guild qualquer acessar o portal do castelo, irá aparecer para o servidor que a X guild está tentando dominar o castelo, então o líde da guild dominante atual irá dizer !gocastle para teleportar ao castelo e defende-lo.
    O Objetivo para conquista do mesmo é invadi-lo derrotar os defensor da guild atual para abrir passagem, digamos assim, e subir ao trono, quando um membro da guild invadir o templo do trono e subir no mesmo a antiga guild dominadora é teleportada para o templo e o castelo fica sob domínio da nova guild.
    Você poderá colocar como premiação acesso a áreas exclusivas do castelo, no caso hunts e cia. (Fica a vosso critério)
     
    Evento testado nas versões 8.6; 9.6; 9.83; 9.86!
     
    Observação: 
    Comando !gocastle faz com que o líder possa teleportar todos os membros da sua guild online para perto dele, desde que ele esteja no castle. Comando pode ser usado a cada 3 horas (exhausted).  
     
     
     
     
    Vamos aos scripts do sistema;
     
    Em data/actions/scripts crie um arquivo com o nome de naviocastle.lua e coloque dentro:
    function onUse(cid, item, fromPosition, itemEx, toPosition) if(item.actionid == 65500) then if getTopCreature({x=32464,y=32378,z=5}).uid > 0 then doTeleportThing(getTopCreature({x=32464,y=32378,z=5}).uid, {x=32526,y=32421,z=5}) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerSendCancel(cid, "Você precisa estar em cima do tapete.") return true end elseif (item.actionid == 65501) then if getTopCreature({x=32526,y=32421,z=5}).uid > 0 then doTeleportThing(getTopCreature({x=32526,y=32421,z=5}).uid, {x=32464,y=32378,z=5}) doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF) else doPlayerSendCancel(cid, "Você precisa estar em cima do tapete.") end end return true end


     
     
     
    Em actions.xml adicione a seguinte linha:
    <action actionid="65500-65501" event="script" value="naviocastle.lua"/> Pós feito isto, em data/lib crie um arquivo com o nome de 015-COH e adicione dentro dele:
    -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // COH_PUSHTIME = 10800 -- Tempo (em segundos) de exhausted para usar o comando !gocastle - Padrão (3 horas) COH_AREA = {{x = 32458, y = 32332, z = 7}, {x = 32558, y = 32429, z = 7}} -- Canto superior esquerdo / inferior direito do Castle -- // Não mexa daqui para baixo COH_STATUS = 201320111714 COH_PREPARE1 = 201320111715 COH_PUSHSTOR = 201320111716 COH_PREPARE2 = 201320111717 function doCastleRemoveEnemies() for index, creature in ipairs(getPlayersOnline()) do if isInArea(getThingPos(creature), COH_AREA[1], COH_AREA[2]) then if getPlayerGuildName(creature) ~= getGlobalStorageValue(COH_STATUS) then doTeleportThing(creature, getTownTemplePosition(getPlayerTown(creature))) end end end return true end Proximo passo, em data/monster.xml adicione a seguinte linha:
    <monster name="Castle Guardian" file="Castle Guardian.xml"/> Em data/monsters crie um arquivo com o nome de Castle Guardian.xml e adicione o seguinte:
    <?xml version="1.0" encoding="UTF-8"?> <monster name="Castle Guardian" nameDescription="a castle guardian" race="blood" experience="0" speed="0" manacost="0"> <health now="800000" max="800000"/> <look type="131" head="57" body="19" legs="57" feet="95" addons="1" corpse="6080"/> <targetchange interval="5000" chance="30"/> <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="4"/> <flag staticattack="90"/> <flag runonhealth="800"/> </flags> <attacks> <attack name="melee" interval="2000" min="-60" max="-180"/> <attack name="physical" interval="1000" chance="35" range="7" min="-205" max="-385"> <attribute key="shootEffect" value="energy"/> </attack> <attack name="manadrain" interval="1000" chance="17" range="7" min="-205" max="-560"/> <attack name="speed" interval="1000" chance="12" range="7" speedchange="-600" duration="40000"> <attribute key="areaEffect" value="redshimmer"/> </attack> <attack name="fire" interval="2000" chance="45" range="7" radius="3" target="1" min="-250" max="-420"> <attribute key="shootEffect" value="burstarrow"/> <attribute key="areaEffect" value="firearea"/> </attack> <attack name="firefield" interval="1000" chance="20" range="7" radius="2" target="1"> <attribute key="shootEffect" value="fire"/> </attack> <attack name="energy" interval="2000" chance="25" length="8" spread="0" min="-265" max="-445"> <attribute key="areaEffect" value="energy"/> </attack> <attack name="speed" interval="6000" chance="10" range="5" speedchange="-600" duration="20000"> <attribute key="areaEffect" value="redshimmer"/> </attack> </attacks> <defenses armor="1" defense="1"/> <elements> <element firePercent="100"/> <element energyPercent="100"/> <element icePercent="100"/> <element earthPercent="90"/> <element holyPercent="-25"/> <element physicalPercent="-33"/> </elements> <immunities> <immunity paralyze="1"/> <immunity invisible="1"/> </immunities> <summons maxSummons="2"> <summon name="deathspawn" interval="1500" chance="0" max="0"/> </summons> <loot> <item id="2148" countmax="20" chance1="100000" chancemax="0"/> </loot> </monster> Pós isto;
     
     
    Em data/movements/scripts crie um arquivo com o nome de COH.lua e adicione o seguinte:
    -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // function onStepIn(cid, item, pos, fromPosition) local pos = getThingPos(cid) if item.actionid == 16203 then if not isPlayer(cid) then return true end if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then doSendMagicEffect(getThingPos(cid), 14) doSendAnimatedText(pos, "CoH", math.random(1, 255)) else doSendMagicEffect(getThingPos(cid), 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você não pertence á guild "..getGlobalStorageValue(COH_STATUS)..".") end return true end if item.actionid == 16202 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then if (getGlobalStorageValue(COH_STATUS) ~= getPlayerGuildName(cid)) then doPlayerSendTextMessage(cid, 20, "[Castle of Honor] Você e sua guild estão no comando, os antigos donos ["..tostring(getGlobalStorageValue(COH_STATUS)).."] podem se vingar!") setGlobalStorageValue(COH_PREPARE1, -1) setGlobalStorageValue(COH_PREPARE2, -1) setGlobalStorageValue(COH_STATUS, getPlayerGuildName(cid)) doCastleRemoveEnemies() doBroadcastMessage("[Castle of Honor] O jogador ["..getCreatureName(cid).."] e sua guild ["..getPlayerGuildName(cid).."] estão no comando do castelo, vá dominar e impedir isso!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.") end return true end if item.actionid == 16200 then if not isPlayer(cid) then return true end if getPlayerGuildId(cid) > 0 then doSendAnimatedText(pos, "CoH", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE1) ~= getPlayerGuildName(cid)) and ((getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid))) then setGlobalStorageValue(COH_PREPARE1, getPlayerGuildName(cid)) doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está tentando dominar o castelo, preparem-se!") end else doSendMagicEffect(pos, 2) doTeleportThing(cid, fromPosition, false) doPlayerSendCancel(cid, "[CoH] Você não possui uma guild.") return true end end if item.actionid == 16201 then if not isPlayer(cid) then return true end doSendAnimatedText(pos, "CoH", math.random(1, 255)) if (getGlobalStorageValue(COH_PREPARE2) ~= getPlayerGuildName(cid)) then setGlobalStorageValue(COH_PREPARE2, getPlayerGuildName(cid)) doBroadcastMessage("[Castle of Honor] Atenção! A guild "..getPlayerGuildName(cid).." está muito próxima do domínio, ataquem!") end end return true end Em data/movements/movements.xml adicione a seguinte linha:
    <movevent type="StepIn" actionid="16200-16203" event="script" value="COH.lua"/> Próximo passo:
     
    Em data/talkactions/scripts crie um arquivo com o nome de COHABSOLUTE.lua e adicione o seguinte:
    -- This program is free software: you can redistribute it and/or modify -- it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- -- This program is distributed in the hope that it will be useful, -- but WITHOUT ANY WARRANTY; without even the implied warranty of -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -- GNU General Public License for more details. -- -- You should have received a copy of the GNU General Public License -- along with this program. If not, see <http://www.gnu.org/licenses/>. -- // function onSay(cid, words, param) if getPlayerGuildLevel(cid) == GUILDLEVEL_LEADER then if getPlayerStorageValue(cid, COH_PUSHSTOR) < os.time() then if getGlobalStorageValue(COH_STATUS) == getPlayerGuildName(cid) then if isInArea(getThingPos(cid), COH_AREA[1], COH_AREA[2]) then if #getMembersOnline(getPlayerGuildId(cid)) > 0 then for index, creature in ipairs(getMembersOnline(getPlayerGuildId(cid))) do if (getTileInfo(getThingPos(creature)).protection ~= true) then return doPlayerSendCancel(cid, "[CoH] Os membros devem estar em área PZ.") end doTeleportThing(creature, getThingPos(cid)) end setPlayerStorageValue(cid, COH_PUSHSTOR, os.time() + COH_PUSHTIME) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "[Castle of Honor] Você teleportou seus membros, comando pode ser usado a cada "..tostring(COH_PUSHTIME / 60).." minuto(s).") else doPlayerSendCancel(cid, "[CoH] Para executar isso, sua guild deve ter 2 ou mais membros online.") end else doPlayerSendCancel(cid, "[CoH] Você deve estar no castelo.") end else doPlayerSendCancel(cid, "[CoH] Sua guild não é dona do castelo.") end else doPlayerSendCancel(cid, "[CoH] Você deve aguardar "..tostring(math.ceil((getPlayerStorageValue(cid, COH_PUSHSTOR) - os.time()) / 60)).." minuto(s) para usar este comando.") end else doPlayerSendCancel(cid, "[CoH] Você deve ser líder de uma guild para executar este comando.") end return true end function getMembersOnline(id) local mbr = {} for index, creature in ipairs(getPlayersOnline()) do if getPlayerGuildId(creature) == id then if getCreatureSkullType(creature) < 3 then table.insert(mbr, creature) end end end return mbr or #mbr end Em data/talkactions/talkactions.xml adicione a seguinte linha:
    <talkaction words="!castlepush;!pushmembers;!gocastle" event="script" value="COHABSOLUTE.lua"/> Quem disponibiliza o mapa do castelo a vocês é nosso amigo ViitinG, segue o link do tópico para download do mesmo já adaptado para este Castle:
    http://www.tibiaking.com/forum/topic/35730-mapa-evento-war-castle/
     
     
     
    Explicação das actions e demais (caso não use o mapa disponibilizado pelo Viiting lembre de adicionar ao castelo);
    ActionID 16200 - No meio do caminho para o castelo, ActionID 16201 - Perto do castelo, ActionID 16202 - No piso, trono que faz com que domine, e ActionID 16203 - Para a passagem de acesso ás hunts / city exclusivas da guild vencedora. Importante: Para colocar uma passagem para as hunts ou o que for a premiação da guild vencedora, coloque um caminho único com os actionIDS 16203, assim só a guild dominante do castelo poderá passar neste local. É importante lembrar que este script é de autoria do Roksas Nunez, ex scripter da empresa chaitosoft, fiz simples modificações de otimização.
     
     
    Qualquer dúvida peço que entre em contato comigo e poste aqui no tópico.
     
     
     
    Créditos:
    Absolute
    Roksas
    ViitinG
     
     
    Espero que gostem, afinal raro alguém disponibilizar algo tão desejado e útil assim!
     
     
     
    Até o próximo sistema.
     
     
     
     
    Absolute on tibiaking =p
  6. Gostei
    Flathoste deu reputação a Absolute em [Pikachu Event] - Derivados estilo Zombie!   
    Fala galerinha do TK, tudo bem?
    Recebi alguns pedidos para fazer um evento estilo Zombie, só que no modo de Pokemon (PÍÍÍKAAAAAAAAAAAAAAAAAAACHUUUUUU)
    rs.
     
     
     
    Enfim, vamos a instalação, depois ensinarei a configurar.
     
     
    Em data/mods crie um arquivo com o nome de pikachuevent.xml com o conteúdo:
    <?xml version="1.0" encoding="UTF-8"?> <mod name="PikachuEvent" version="1.0" author="Absolute" contact="tibiaking.com" enabled="yes"> <config name="config_pikachu_event"> <![CDATA[ configPikachuEvent = { storages = { main = 'PikachuEventMain', -- set free storage player = 'PikachuEventPlayer', -- set free storage joining = 'PikachuEventJoining', -- set free storage kills = 'PikachuEventKills', -- set free storage exhaust = 'PikachuEventExhaust', -- set free storage countEvent = 'PikachuEventCountEvent' -- set free storage }, position = {x=890,y=193,z=7}, -- position to which player is teleporting room = { from = {x=678,y=980,z=7}, -- left top corner of event room to = {x=678,y=1089,z=7} -- right bottom corner of event room }, rewards = {7958, 11366}, -- reward id which player can win (reward is random) players = { max = 50, -- max players in event min = 2, -- min players to event start minLevel = 50, -- min level to join to event pvpEnabled = false -- can players hit theirselfs }, days = { ['Tuesday'] = {'22:00:00'}, ['Thursday'] = {'22:00:00'}, ['Friday'] = {'22:00:00'}, ['Sunday'] = {'22:00:00'} }, spawnDelay = 2000, -- miliseconds amountCreatingMonsters = 5, monsters = {'Pikachu', 'Ash'}, -- 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 = 19200, -- [seconds] text = '-PL-\nAby wygrac i otrzymac nagrode, zabij jak najwieksza liczbe pikachu przez 20min lub pozostan sam na arenie.\n\n-ENG-\nTo win and get a reward, kill as many pikachus for 20 minutes or stay the same in the arena.' } ]]> </config> <lib name="lib_pikachu_event"> <![CDATA[ function doStopPikachuEvent() if getStorage(configPikachuEvent.storages.main) > 0 then local playerTable, creatureTable = {}, {} for x = configPikachuEvent.room.from.x, configPikachuEvent.room.to.x do for y = configPikachuEvent.room.from.y, configPikachuEvent.room.to.y do local n, i = getTileInfo({x=x, y=y, z=configPikachuEvent.room.from.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=x, y=y, z=configPikachuEvent.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=configPikachuEvent.room.from.z, stackpos=i}).uid end end end end if #playerTable > 1 then table.sort(playerTable, function(a, b) return (getCreatureStorage(a, configPikachuEvent.storages.kills)) > (getCreatureStorage(b, configPikachuEvent.storages.kills)) end) local prize = math.random(#configPikachuEvent.rewards) doTeleportThing(playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1]))) doCreatureSetStorage(playerTable[1], configPikachuEvent.storages.kills, 0) doPlayerAddItem(playerTable[1], configPikachuEvent.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(configPikachuEvent.rewards[prize])..' as reward.') doBroadcastMessage('Pikachu Plague Attack has finished. The winner is '..getCreatureName(playerTable[1])..'. Congratulations!') doSetStorage(configPikachuEvent.storages.main, -1) db.query("INSERT INTO `events` (`event_name`, `winner_name`, `won_item`, `time_win`) VALUES (\"Pikachu\", \"" .. getCreatureName(playerTable[1]) .. "\", \"" .. getItemNameById(configPikachuEvent.rewards[prize]) .. "\", " .. getStorage(configPikachuEvent.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], configPikachuEvent.storages.kills, 0) end for i = 1, #creatureTable do if isMonster(creatureTable[i]) then doRemoveCreature(creatureTable[i]) end end doSetStorage(configPikachuEvent.storages.countEvent, getStorage(configPikachuEvent.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 Pikachu Plague Attack.') doSetStorage(configPikachuEvent.storages.main, -1) doSetStorage(configPikachuEvent.storages.countEvent, getStorage(configPikachuEvent.storages.countEvent) + 1) end end end function doStartPikachuEvent() doSetStorage(configPikachuEvent.storages.joining, -1) if configPikachuEvent.players.min <= doCountPlayersPikachuEvent() then for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configPikachuEvent.storages.player) > 0 then doCreatureSetStorage(cid, configPikachuEvent.storages.player, -1) doTeleportThing(cid, configPikachuEvent.position) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'Get ready. Pikachus Plague Attack starts in '..configPikachuEvent.startEvent..' seconds.') end end addEvent(doSetStorage, configPikachuEvent.startEvent * 1000, configPikachuEvent.storages.main, 1) addEvent(doStopPikachuEvent, configPikachuEvent.stopEvent * 1000) addEvent(doRepeatCheckPikachuEvent, configPikachuEvent.startEvent * 1000 + 2000) doBroadcastMessage('Pikachu Plague Attack has started. LET\'S GO!') else for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configPikachuEvent.storages.player) > 0 then doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) end end doBroadcastMessage('Pikachu Plague Attack hasn\'t started beacuse there were not enough players.') end end function doRepeatCheckPikachuEvent() if getStorage(configPikachuEvent.storages.main) > 0 then local playerTable, creatureTable, xTable, yTable = {}, {}, {}, {} for x = configPikachuEvent.room.from.x, configPikachuEvent.room.to.x do for y = configPikachuEvent.room.from.y, configPikachuEvent.room.to.y do local n, i = getTileInfo({x=x, y=y, z=configPikachuEvent.room.to.z}).creatures, 1 if n ~= 0 then local v = getThingfromPos({x=x, y=y, z=configPikachuEvent.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=configPikachuEvent.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(#configPikachuEvent.rewards) addEvent(doTeleportThing, 200, playerTable[1], getTownTemplePosition(getPlayerTown(playerTable[1])), true) doPlayerAddItem(playerTable[1], configPikachuEvent.rewards[prize], 1) doCreatureSetStorage(playerTable[1], configPikachuEvent.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(configPikachuEvent.rewards[prize])..' as reward.') doBroadcastMessage('Pikachu 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 (\"Pikachu\", \"" .. getCreatureName(playerTable[1]) .. "\", \""..getItemNameById(configPikachuEvent.rewards[prize]).."\", "..getStorage(configPikachuEvent.storages.countEvent)..");") for i = 1, #creatureTable do if isMonster(creatureTable[i]) then doRemoveCreature(creatureTable[i]) end end doSetStorage(configPikachuEvent.storages.main, -1) doSetStorage(configPikachuEvent.storages.countEvent, getStorage(configPikachuEvent.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 Pikachu Plague Attack.') doSetStorage(configPikachuEvent.storages.main, -1) doSetStorage(configPikachuEvent.storages.countEvent, getStorage(configPikachuEvent.storages.countEvent) + 1) return end local pos = {x=xTable[math.random(#xTable)], y=yTable[math.random(#yTable)], z=7} for i = 1, configPikachuEvent.amountCreatingMonsters do doCreateMonster(configPikachuEvent.monsters[math.random(#configPikachuEvent.monsters)], pos, false, false, false) doSendMagicEffect(pos, CONST_ME_BATS) end addEvent(doRepeatCheckPikachuEvent, configPikachuEvent.spawnDelay) end end function doCountPlayersPikachuEvent() local x = 0 for _, cid in ipairs(getPlayersOnline()) do if getCreatureStorage(cid, configPikachuEvent.storages.player) > 0 then x = x + 1 end end return x end function doStartCountingPikachuEvent(x) if configPikachuEvent.delayTime-x > 0 then doBroadcastMessage('Pikachu Plague Attack is going to start in '..configPikachuEvent.delayTime-x..' minutes. You can join to the event by saying "!pikachu join".') addEvent(doStartCountingPikachuEvent, 60*1000, x+1) end end ]]> </lib> <talkaction words="!pikachu" event="script"> <![CDATA[ domodlib("config_pikachu_event") function onSay(cid, words, param) if getStorage(configPikachuEvent.storages.joining) ~= 1 then return doPlayerSendCancel(cid, 'Pikachu Plague Attack hasn\'t started yet.') elseif param == '' then return doPlayerSendCancel(cid, 'Command param required (say: "!pikachu join" or "!pikachu leave.").') elseif getPlayerLevel(cid) < configPikachuEvent.players.minLevel then return doPlayerSendCancel(cid, 'You can\'t join to the event if you don\'t have a require '..configPikachuEvent.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, configPikachuEvent.storages.exhaust) ~= false then return doPlayerSendCancel(cid, 'You must wait '..exhaustion.get(cid, configPikachuEvent.storages.exhaust)..' seconds to use this command again.') end if param == 'join' then if getCreatureStorage(cid, configPikachuEvent.storages.player) > 0 then return doPlayerSendCancel(cid, 'You have arleady joined to event. Wait patiently for start.') elseif doCountPlayersPikachuEvent() == configPikachuEvent.players.max then return doPlayerSendCancel(cid, 'Max players in the event have been reached.') end doCreatureSetNoMove(cid, true) doPlayerPopupFYI(cid, configPikachuEvent.text) doCreatureSetStorage(cid, configPikachuEvent.storages.player, 1) doAddCondition(cid, createConditionObject(CONDITION_INFIGHT, -1)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'You have joined to Pikachu 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 Pikachu Plague Attack.') elseif param == 'leave' then if getCreatureStorage(cid, configPikachuEvent.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, configPikachuEvent.storages.player, -1) doRemoveCondition(cid, CONDITION_INFIGHT) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ORANGE, 'You have left from the Pikachu Plague Attack.') end exhaustion.set(cid, configPikachuEvent.storages.exhaust, 5) return true end ]]> </talkaction> <talkaction words="!startpikachu" access="5" event="script"> <![CDATA[ domodlib("config_pikachu_event") domodlib("lib_pikachu_event") function onSay(cid, words, param) if getStorage(configPikachuEvent.storages.main) > 0 then return doPlayerSendCancel(cid, 'Pikachu Plague Attack is already running.') end doStartCountingPikachuEvent(0) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configPikachuEvent.storages.player) > 0 then doCreatureSetStorage(pid, configPikachuEvent.storages.player, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doCreatureSetStorage(pid, configPikachuEvent.storages.kills, 0) end end doSetStorage(configPikachuEvent.storages.joining, 1) addEvent(doStartPikachuEvent, configPikachuEvent.delayTime * 60 * 1000) return true end ]]> </talkaction> <talkaction words="!stoppikachu" access="5" event="script"> <![CDATA[ domodlib("config_pikachu_event") domodlib("lib_pikachu_event") function onSay(cid, words, param) if getStorage(configPikachuEvent.storages.main) > 0 then doStopPikachuEvent() else doPlayerSendCancel(cid, 'You can not do it if Pikachu Plague Attack is not enabled.') end return true end ]]> </talkaction> <globalevent name="Pikachu_Event_Days" interval="1000" event="script"> <![CDATA[ domodlib("config_pikachu_event") domodlib("lib_pikachu_event") local daysOpen = {} for k, v in pairs(configPikachuEvent.days) do table.insert(daysOpen, k) end function onThink(interval) if isInArray(daysOpen, os.date('%A')) then if isInArray(configPikachuEvent.days[os.date('%A')], os.date('%X', os.time())) then if getStorage(configPikachuEvent.storages.joining) ~= 1 then doStartCountingPikachuEvent(0) for _, pid in ipairs(getPlayersOnline()) do if getCreatureStorage(pid, configPikachuEvent.storages.player) > 0 then doCreatureSetStorage(pid, configPikachuEvent.storages.player, -1) doTeleportThing(pid, getTownTemplePosition(getPlayerTown(pid)), true) doCreatureSetStorage(pid, configPikachuEvent.storages.kills, 0) end end doSetStorage(configPikachuEvent.storages.joining, 1) addEvent(doStartPikachuEvent, configPikachuEvent.delayTime * 60 * 1000) end end end return true end ]]> </globalevent> <event type="statschange" name="Pikachu_Event_Dead" event="script"> <![CDATA[ domodlib("config_pikachu_event") function onStatsChange(cid, attacker, type, combat, value) if type == 1 and getCreatureHealth(cid) <= value then if isInRange(getThingPos(cid), configPikachuEvent.room.from, configPikachuEvent.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, configPikachuEvent.storages.kills, 0) return false end end elseif configPikachuEvent.players.pvpEnabled ~= true and isInArray({1,3}, type) and isPlayer(attacker) and isPlayer(cid) then if isInRange(getThingPos(cid), configPikachuEvent.room.from, configPikachuEvent.room.to) then return false end end return true end ]]> </event> <event type="kill" name="Pikachu_Event_Kill" event="script"> <![CDATA[ domodlib("config_pikachu_event") function onKill(cid, target, damage, flags) if isInRange(getThingPos(cid), configPikachuEvent.room.from, configPikachuEvent.room.to) then if isInArray(configPikachuEvent.monsters, getCreatureName(target)) then doCreatureSetStorage(cid, configPikachuEvent.storages.kills, math.max(0, getCreatureStorage(cid, configPikachuEvent.storages.kills) + 1)) end end return true end ]]> </event> <event type="login" name="Pikachu_Event_Login" event="script"> <![CDATA[ domodlib("config_pikachu_event") function onLogin(cid) if getCreatureStorage(cid, configPikachuEvent.storages.player) > 0 then doCreatureSetStorage(cid, configPikachuEvent.storages.player, -1) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)), true) doCreatureSetNoMove(cid, false) doRemoveCondition(cid, CONDITION_INFIGHT) doCreatureSetStorage(cid, configPikachuEvent.storages.player.kills, 0) end registerCreatureEvent(cid, 'Pikachu_Event_Dead') registerCreatureEvent(cid, 'Pikachu_Event_Kill') return true end ]]> </event> <globalevent name="Pikachu_Event_Start" type="startup" event="script"> <![CDATA[ domodlib("config_pikachu_event") function onStartup() doSetStorage(configPikachuEvent.storages.main, -1) doSetStorage(configPikachuEvent.storages.joining, -1) return true end ]]> </globalevent> </mod> Salve e feche.
     

    Em data/monsters/monster.xml adicione a linha:
    <monster name="Pikachu" file="pikachu"/> Em data/monters/scripts crie um arquivo com o nome de pikachu.xml com o conteúdo:
    <?xml version="1.0" encoding="UTF-8"?> <monster name="Pikachu" nameDescription="Pikachu" race="undead" experience="10500" speed="800" manacost="0"> <health now="200000" max="200000"/> <look type="88" head="20" body="30" legs="40" feet="50" corpse="6031"/> <targetchange interval="10000" chance="10"/> <strategy attack="100" defense="0"/> <flags> <flag summonable="1"/> <flag attackable="1"/> <flag hostile="1"/> <flag illusionable="1"/> <flag convinceable="1"/> <flag pushable="0"/> <flag canpushitems="1"/> <flag canpushcreatures="1"/> <flag targetdistance="1"/> <flag staticattack="90"/> <flag runonhealth="0"/> </flags> <attacks> <attack name="melee" interval="1200" range="1" min="-2000" max="-5000"/> </attacks> <defenses armor="25" defense="30"> </defenses> <voices interval="5000" chance="10"> <voice sentence="PIKAAAA PIKAAAAAA CHU DE ABSOLUTE."/> <voice sentence="PIKACHU EU ESCOLHO VC."/> </voices> <loot> <item id="2160" countmax="1" chance="50000"/> </loot> </monster> Crie a sprite a seu gosto.
     

     
    Explicação básica:
    position = {x=890,y=193,z=7}, -- Aqui a posição do centro da sua ARENA PIKACHU! from = {x=678,y=980,z=7}, -- Posição do final do canto esquerdo da sua arena to = {x=678,y=1089,z=7} -- Posição do final do canto direito da sua arena rewards = {7958, 11366}, -- Aqui a recompensa que o último player que restar na arena vai ganhar, no caso é RANDOM (ALEATÓRIA), pode ser ou um ou outro, caso queira deixar apenas uma recompensa deixe: rewards = {7958} players = { max = 50, -- Máximo de players que poderão participar min = 2, -- Mínimo de players pra começar o evento, claro 2 ou mais. minLevel = 50, -- level mínimo pra entrar no evento pvpEnabled = false -- PVP DESATIVADO DENTRO DA ARENA, para ativar deixe = true. days = { ['Tuesday'] = {'22:00:00'} -- Dias e hora que ocorrerão o evento automático. (ENGLISH) - Aí no caso está para terça-feira ás 22h (Lembrando que tem de ser o horário da máquina).
    Para dar inicio ao evento manualmente, basta digitar com o seu ADM: !startpikachu Então os players irão digitar !pikachu para participar. Observação: O Comando só pode ser executado sem battle e em área PZ (Pós usar o player ficará imóvel esperando o evento começar) Quando começa Absolute? - Quando atingir o número máximo de players ou 5 minutos. Observação: Crie um map do seu estilo, como quiser e comfigure com as posições.     Caso tenha críticas construtivas, poste.
    Lembrando que fiz este evento devido a pedidos que houve nas seções destinadas de scripting.
    Qualquer dúvida não deixe de perguntar, ninguém nasceu sabendo     Créditos: - Virrages (Event Base)
    - Absolute (Modificação, funções, adaptações e transformação)     Espero ver este evento em vários derivados.   Abraços!     Absolute.
     
  7. Gostei
    Flathoste deu reputação a Absolute em [Proibir Palavras] Anti Divulgação   
    Fala galerinha do TK, hoje trago a vocês um sistema de bloquear algumas palavras no servidor!
     
     
    Sabe aqueles players chatos que entram em seu otserver divulgando o servidor dele dias e dias, leva ban, volta e tudo mais? Poisé, chega disso né.
     
    Primeiro vai o script depois explicação/config:
     

     
     
    Em data/talkactions/scripts crie um arquivo com o nome de tibiakingproibiu.lua
    function getFixedText(cid, text, replace) local wrongWords = {"#####", "ots-list.pl", "google.br", ".ddns.net", "hopto.org", "no-ip.org", "servegame.com"} local lowerText = string.lower(text) local noSpaceText = string.gsub(string.gsub(string.gsub(lowerText, "%s", ""), "%p", ""),"-", "") for w = 1, #wrongWords do wordLen = string.len(wrongWords[w]) for p = 1, string.len(text) do if(string.sub(lowerText, p, p+wordLen-1) == wrongWords[w]) then text = string.sub(text, 1, p-1) .. string.rep(replace, wordLen) .. string.sub(text, p+wordLen) end end end if(string.lower(text) == lowerText) then for c = 1, #wrongWords do if(string.find(noSpaceText, string.gsub(string.gsub(wrongWords[c], "%p", ""),"-", "")) ~= nil) then return "I want to post forbidden links.." end end end return text end --[[Channels which are not added to block: 1 - Party Channel 2 - Channel for Staff members 3 - Rule Violation Channel 4 - Channel for Counselors/Tutors 65536 - Private Chat Channel <-- Private Chat cannot be blocked with this script ]]-- local blocked_channels = {5,8,9} --Game-Chat, Real Chat, Help Channel local trade_channels = {6,7} --All trade channels <- These are also blocked local replace = "°" --Symbols which are shown instead of forbidden links -> ° local delay = {16246,10} -- {empty_storage, lenght of muted} function onSay(cid, words, param, channel) local fixedWords = getFixedText(cid, words, replace) if words ~= fixedWords and getPlayerAccess(cid) == 0 then if getPlayerStorageValue(cid,delay[1]) > os.time() then return doPlayerSendCancel(cid,"Voce foi mutado por ".. getPlayerStorageValue(cid,delay[1])-os.time() .." segundos, aqui e proibido divulgar.") end setPlayerStorageValue(cid,delay[1],os.time()+delay[2]) if channel == CHANNEL_DEFAULT then doCreatureSay(cid, fixedWords, TALKTYPE_SAY) doPlayerPopupFYI(cid, "Link: "..words.." e proibido, mal educado!.") return true elseif isInArray(trade_channels, channel) then doPlayerPopupFYI(cid, "Link: "..words.." e proibido neste canal.") return true elseif isInArray(blocked_channels, channel) then doPlayerPopupFYI(cid, "Link: "..words.." e proibido, mal educado!.") doPlayerSendChannelMessage(cid, getCreatureName(cid), fixedWords, TALKTYPE_CHANNEL_Y, channel) return true end end return false end Logo em seguida em em talkactions.xml adicione a seguinte linha:
    <talkaction words="illegalWords" event="script" value="tibiakingproibiu.lua"/> Fim da instalação.

     
    Explicação/Config:
     
    local wrongWords = {"#####", "ots-list.pl", "google.br", ".ddns.net", "hopto.org", "no-ip.org", "servegame.com"} = Nas aspas ".." você colocará as palavras que deseja proibir, palavrões, divulgações e companhia...
     
    local noSpaceText = string.gsub(string.gsub(string.gsub(lowerText, "%s", ""), "%p", ""),"-", "") = Aqui aconselho não mexer. É para evitar divulgações acompanhadas das Words (palavras) ou seja lá está proibido .servegame.com, então quando o player falar baiakfulunao.servegame.com irá proibir.
    local delay = {16246,10} -- {empty_storage, lenght of muted} = no 16246 é a storage que irá salvar, não mexa. em 10 é o tempo em segundos que o player será mutado ao falar as palavras proibidas.
    doPlayerPopupFYI(cid, "Link: "..words.." e proibido, mal educado!.") = Este doPlayerPopup é que vai aparecer naquelas janelas que aparece para clicar em ok (caixa de mensagens) caso queira alterar para mensagem de console substitua: 
    doPlayerPopupFYI(cid, "Link: "..words.." e proibido, mal educado!.")
    por  
    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Link: "..words.." e proibido, mal educado!.") 
     
     

     
     
    É isso ae lindões do TK, caso haja alguma dúvida peço que perguntem!
     
     
    Créditos:
    Absolute
    OTLAND
     
     
    Até o próximo!
     
     
    Absolute
     

Informação Importante

Confirmação de Termo