allex9213 10 Postado Maio 31, 2009 Share Postado Maio 31, 2009 (editado) Bom esse sistema parece ser muito bom para combater os botters que vao durmir e deixam seus chars treinando horas e horas.. (digo que parece por que nao testei, apenas retirei do OTFans e estou postando aqui.) Se nao me engano isso funciona assim: depois de um certo tempo o player e obrigado a puxar a alavanca para nao ser kikado. (se nao for isso me desculpem ) Creditos: .99% para Gesior .1% para mim que traduzi Vamos la entao: Va em data/actions/actions.xml e adicione: <action actionid="39000" script="other/trainer.lua"/> Depois va em data/actions/scripts/other/trainer (Crie um arquivo chamado trainer e adicione isso dentro:) max_afk_time = 300function onUse(cid, item, fromPosition, itemEx, toPosition) setPlayerStorageValue(cid, 39000, os.time()+max_afk_time) doPlayerSendCancel(cid, 'Now is ' .. os.date("%H:%M:%S", os.time()) .. '. You will be kicked from train room at ' .. os.date("%H:%M:%S", os.time()+max_afk_time) .. '!') if item.itemid == 1945 then doTransformItem(item.uid, 1946, 1) elseif item.itemid == 1946 then doTransformItem(item.uid, 1945, 1) end return TRUE end Depois va em: data/movements/movements.xml e adicione isso: <movevent event="StepIn" actionid="39001" script="trainer.lua"/> <movevent event="StepOut" actionid="39001" script="trainer.lua"/> <movevent event="StepIn" actionid="39002" script="trainer.lua"/> <movevent event="StepOut" actionid="39002" script="trainer.lua"/> Depois em data/movements/scripts/trainer (Crie um arquivo chamado trainer e adcione isso dentro: ) kick_position = {}players_train = {} check_train = 0 max_afk_time = 300 kick_position[1] = {x=1027,y=1046,z=7} kick_position[2] = {x=1027,y=1047,z=6} function onStepIn(cid, item, pos) if check_train == 0 then check_train = addEvent(checkTrainRooms, 1000, {action=1}) end setPlayerStorageValue(cid, 39000, os.time()+max_afk_time) setPlayerStorageValue(cid, 39001, item.actionid-39000) table.insert(players_train,cid) doPlayerSendTextMessage(cid,MESSAGE_EVENT_DEFAULT,'You must push lever every 10 minutes or you will be kicked from train room!') return TRUE end function onStepOut(cid, item, pos) setPlayerStorageValue(cid, 39000, 0) setPlayerStorageValue(cid, 39001, 0) for targetID,creature in ipairs(players_train) do if creature == cid then table.remove(players_train,targetID) end end return TRUE end function checkTrainRooms(param) local cid = param.cid if param.action == 1 then for targetID,creature in ipairs(players_train) do if isPlayer(creature) == TRUE then local player_storage = getPlayerStorageValue(creature, 39000) if player_storage <= os.time() then doTeleportThing(creature, kick_position[getPlayerStorageValue(creature, 39001)], TRUE) setPlayerStorageValue(creature, 39000, 0) setPlayerStorageValue(creature, 39001, 0) table.remove(players_train,targetID) doPlayerSendTextMessage(creature,MESSAGE_STATUS_CONSOLE_ORANGE,'You were kicked from train room! Come back later!') elseif player_storage - 10 <= os.time() then doPlayerSendTextMessage(creature,MESSAGE_EVENT_DEFAULT,'You got ' .. player_storage - os.time() .. ' seconds to push lever or you will be kicked from train room!') end else table.remove(players_train,targetID) end end addEvent(checkTrainRooms, 1000, {action=1}) end end Agora va em data/actions/scrpits/other/doors.lua e cole isso dentro: elseif isInArray(horizontalOpenDoors, item.itemid) == TRUE then local newPosition = toPosition newPosition.y = newPosition.y + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_CREATURE local doorCreature = getThingfromPos(doorPosition) if doorCreature.itemid ~= 0 then if getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and (isCreature(doorCreature.uid) == TRUE) then doPlayerSendCancel(cid, "Someone block doors.") else doTeleportThing(doorCreature.uid, newPosition, TRUE) if isInArray(openSpecialDoors, item.itemid) ~= TRUE then doTransformItem(item.uid, item.itemid - 1) end end return TRUE end doTransformItem(item.uid, item.itemid - 1) return TRUE elseif isInArray(verticalOpenDoors, item.itemid) == TRUE then local newPosition = toPosition newPosition.x = newPosition.x + 1 local doorPosition = fromPosition doorPosition.stackpos = STACKPOS_TOP_CREATURE local doorCreature = getThingfromPos(doorPosition) if doorCreature.itemid ~= 0 then if getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and (isCreature(doorCreature.uid) == TRUE) then doPlayerSendCancel(cid, "Sorry, not possible.") else doTeleportThing(doorCreature.uid, newPosition, TRUE) if isInArray(openSpecialDoors, item.itemid) ~= TRUE then doTransformItem(item.uid, item.itemid - 1) end end return TRUE end doTransformItem(item.uid, item.itemid - 1) return TRUE Nao deixe entrar dois jogadores no mesmo tile. Agora os actions Ids: Bom Galera, voces podem ate me criticar por falta de experiencia, mas garanto que fiz o melhor que pude, espero que consigam , quem conseguir e gostar Deixa um up ai que eu mando pro Gesior Editado Maio 31, 2009 por allex9213 Link para o comentário Compartilhar em outros sites More sharing options...
Killuaditchel 0 Postado Junho 4, 2009 Share Postado Junho 4, 2009 Cara é ruim, é ruim.......Isso só vai prejudicar porque depois de 300 segundos o muleque vai ter que ser kickado, e se ele quiser deixar o char treinar a noite toda, não dá, pois o Training monk vai kickar ele Training monk ADM O_O' Link para o comentário Compartilhar em outros sites More sharing options...
Joao Kleber 0 Postado Junho 5, 2009 Share Postado Junho 5, 2009 Bom tbm nao gostei mt do script pq msm se o cara tiver la train onestamente ele vai ser kikado,no caso de servidores lotados isso vai ser um problema. Link para o comentário Compartilhar em outros sites More sharing options...
robson10 0 Postado Junho 6, 2009 Share Postado Junho 6, 2009 Não é muito bom pq ja existem scripts do bot que pode puxar a alavanca!! ai eu vou ter trabalho pra botar o sistema no ot e vem um nego bota um script e ja era em um de meus ots tinha uma alavanca na poi que sumonava bixo, la teve um cara que ia dormir e deixava la puxando e matando os bixos Mas Vlw pera iniciativa!! Link para o comentário Compartilhar em outros sites More sharing options...
hpjp 11 Postado Junho 14, 2009 Share Postado Junho 14, 2009 galera tipo assim o cara fez desse jeito use quem kiser... Link para o comentário Compartilhar em outros sites More sharing options...
raelpsf 1 Postado Setembro 13, 2010 Share Postado Setembro 13, 2010 (editado) achei manero.. só que tipo, nao seria melhor por o contador no on step in, ai o cara se obriga a sair e entrar de novo.. ai nao tem como fazer nada com o bot.. ou sei lá.. Editado Setembro 13, 2010 por raelpsf Link para o comentário Compartilhar em outros sites More sharing options...
Posts Recomendados