Saudações, xTibianos! Hoje venho lhes trazer um npc desenvolvido por mim, cuja ideia foi de nosso ADM @Daniel.
Antes de mais nada, gostaria de avisar: o NPC possui uma GRANDE possibilidade de customização. Você pode escolher quais sistemas você vai quer que ele tenha, pode escolher se vai usar prisão ou não, pode escolher o tempo de punição ao membro infrator, etc.
Sistemas presentes
Esse NPC possui os seguintes sistemas:
- Anti-bot system
Qualquer jogador pode ir até o NPC e denunciar algum outro jogador (que provavelmente esteja usando bot). O NPC então enviará uma checagem de bot ao jogador denunciado. Caso o jogador denunciado não responda a checagem dentro do tempo hábil, ele será punido (enviado para uma prisão ou kickado).
- Power Abuse system
Esse sistema serve para punir aqueles membros de level alto que ficam fazendo "free kill" (matando jogadores mais fracos abusivamente). Qualquer jogador (qualquer level) pode ir até o npc e denunciar algum outro jogador (level maior) alegando que ele sofreu power abuse. O npc fará uma checagem, e se o jogador denunciante tiver sido morto um minimo de X vezes (configurável) por aquele jogador denunciado, o jogador denunciado será punido (mandado pra prisão ou kickado).
Aparência do NPC
Esse é o NPC, visualmente falando:
inspiração:
Punisher (Justiceiro) - MARVEL
Instalação
Agora chega de enrolação, vamos à instalação do npc:
» Vá na pasta mods, crie um arquivo chamado JusticeiroMods.xml e coloque isso dentro:
<!-- System made by: Danihcv. To: xTibia.comDO NOT REMOVE THE CREDITS!--><?xml version="1.0" encoding="UTF-8"?> <mod name="NpcJusticeiro" version="1.0" author="Danihcv" contact="xtibia.com" enabled="yes"><!-- System made by: Danihcv. To: xTibia.com --><config name="justiceiro_func"><![CDATA[justiceiro_config = {limit = 15, --quantidade (mínima) de level's de diferença para ser considerado "power abuse" ao matar um playerstrBot = 69011,strPwrAbs = 69012}]]></config><!-- System made by: Danihcv. To: xTibia.com --><talkaction words="!antibot" event="script"><![CDATA[domodlib('justiceiro_func')strBot = justiceiro_config.strBotfunction onSay(cid, words, param, channel)if getPlayerStorageValue(cid, strBot) > 0 then if(param == '') then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Por favor, não esqueça de botar o resultado.") return true end local t = string.explode(param, ",") t[1] = tonumber(t[1]) if t[1] == getPlayerStorageValue(cid, strBot) then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Tudo certo! Desculpe o incômodo.") setPlayerStorageValue(cid, strBot, 0) elseif getPlayerStorageValue(cid, strBot) > 18 then doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Tarde demais. Agora pague por suas ações.") else doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Oops, seus cálculos estão errados. Rápido! Tente novamente.") endelsedoPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Não se preocupe, você não tem nada a provar no momento.")end return trueend]]></talkaction><!-- System made by: Danihcv. To: xTibia.com --><event type="login" name="NpcJusticeiroLoginn" event="script"><![CDATA[function onLogin(cid)registerCreatureEvent(cid, "NpcJusticeiroLogout")registerCreatureEvent(cid, "NpcJusticeiroLogin")registerCreatureEvent(cid, "NpcJusticeiroKill")return trueend]]></event><!-- System made by: Danihcv. To: xTibia.com --><event type="kill" name="NpcJusticeiroKill" event="script"><![CDATA[domodlib('justiceiro_func')limit = justiceiro_config.limitfunction onKill(cid, target)if isPlayer(target) and isPlayer(cid) then if getPlayerLevel(cid) >= (getPlayerLevel(target) + limit) then valorAtual = getPlayerStorageValue(target, ''..string.lower(tostring(getCreatureName(cid)))..'') if valorAtual == -1 then valorAtual = 0 end setPlayerStorageValue(target, ''..string.lower(tostring(getCreatureName(cid)))..'', valorAtual+1) endendreturn trueend]]></event><!-- System made by: Danihcv. To: xTibia.com --><event type="logout" name="NpcJusticeiroLogout" event="script"><![CDATA[domodlib('justiceiro_func')strBot = justiceiro_config.strBotstrPwrAbs = justiceiro_config.strPwrAbsfunction onLogout(cid)if (getPlayerStorageValue(cid, strBot) > 18) and (os.time() <= getPlayerStorageValue(cid, strBot)) thendoPlayerSendCancel(cid, 'Você não conseguirá sair tão fácil! Termine de cumprir sua pena e pense 2 vezes antes de usar bot.')return falseelseif (getPlayerStorageValue(cid, strPwrAbs) > os.time()) thendoPlayerSendCancel(cid, 'Você não conseguirá sair tão fácil! Termine de cumprir sua pena e pense 2 vezes antes de implicar com jogadores fracos.')return falseelsereturn trueendend]]></event><!-- System made by: Danihcv. To: xTibia.com --><event type="login" name="NpcJusticeiroLogin" event="script"><![CDATA[domodlib('justiceiro_func')strBot = justiceiro_config.strBotstrPwrAbs = justiceiro_config.strPwrAbsfunction onLogin(cid)if ((getPlayerStorageValue(cid, strBot) > 0) and (getPlayerStorageValue(cid, strBot) <= 18)) or (getPlayerStorageValue(cid, strBot) <= os.time()) thensetPlayerStorageValue(cid, strBot, 0)endif (getPlayerStorageValue(cid, strPwrAbs) > 0) and (getPlayerStorageValue(cid, strPwrAbs) < os.time()) thensetPlayerStorageValue(cid, strPwrAbs, 0)endreturn trueend]]></event></mod><!-- System made by: Danihcv. To: xTibia.comDO NOT REMOVE THE CREDITS!-->
*atente-se para essa parte configurável do script acima:
Citar
justiceiro_config = {
limit = 15, --quantidade (mínima) de level's de diferença para ser considerado "power abuse" ao matar um playerstrBot = 69011,
strPwrAbs = 69012
}
*nessa parte, o strBot e o strPwrAbs devem ser iguais aos informados no arquivo Justiceiro.lua que será mostrado mais abaixo
» Agora vá na pasta data\npc, crie um arquivo chamado Justiceiro.xml e coloque isso dentro:
<?xml version="1.0" encoding="UTF-8"?><npc name="Justiceiro" script="Justiceiro.lua" walkinterval="1500" speed="100" walkradius="2" floorchange="0"> <health max="100" now="100"/> <look type="278" head="114" body="95" legs="114" feet="95" addons="0" mount="0"/></npc>
» Agora vá na pasta data\npc\scripts, crie um arquivo chamado Justiceiro.lua e coloque isso dentro:
--[[Script made by: Danihcv. To: xTibia.com]]local keywordHandler = KeywordHandler:new()local npcHandler = NpcHandler:new(keywordHandler)NpcSystem.parseParameters(npcHandler) function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) endfunction onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) endfunction onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) endfunction onThink() getPlayersOnline() npcHandler:onThink() end-----------------------------------------------------------------------------------------------------------------------------------------------------PARTE CONFIGURAVEL----------------------------------PARTE CONFIGURAVEL------------------------------PARTE CONFIGURAVEL------------------------------------------------------------------------------------------------------------------------------------------------------------------------local usarAntiBot = "sim" --coloque "nao" caso não queira usar o anti-bot do npclocal usarPowerAbuse= "sim" --coloque "nao" caso não queira usar o power abuse system do npclocal cadeia = "sim" --use "sim" caso vc queira mandar o infrator para a cadeia, ou "nao" caso vc nao tenha uma cadeialocal cadeiaPos = { --coordenadas das celas da cadeia, para caso vc tenha colocado o 'cadeia = "sim"' no campo acima[1] = {coord = {x = 32314, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 1[2] = {coord = {x = 32317, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 2[3] = {coord = {x = 32320, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 3[4] = {coord = {x = 32322, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 4}local tempoBot = 5 --tempo em minutos para o player reportado como botter responder a verificaçãolocal tempoPunicao = 60 --tempo em minutos que o infrator ficara presolocal maxDeath = 7 --quantidade de mortes "desbalanceadas" (player mais fraco contra palyer muito mais forte) considerada como power abuselocal cooldown = 30 --tempo em segundos para o denunciante poder fazer outra denuncialocal strBotDen = 690110local strBot = 69011local strPwrAbsDen = 690120local strPwrAbs = 69012-------------------------------------------------------------------------------------------------------------------------------------------------FIM DA PARTE CONFIGURAVEL-----------------------FIM DA PARTE CONFIGURAVEL---------------------FIM DA PARTE CONFIGURAVEL---------------------------------------------------------------------------------------------------------------------------------------------------------------------local player = {}local playerAbs = {}function greetCallback(cid)npcHandler:say('Bem vindo, '..getCreatureName(cid)..'. Você tem alguma denúncia para fazer?', cid)if bot == cid thenbot = 0talkb = 0bb = 0endif PwrAbs == cid thenPwrAbs = 0talkp = 0bp = 0endnpcHandler:addFocus(cid)return falseendfunction creatureSayCallback(cid, type, msg)if(not npcHandler:isFocused(cid)) thenreturn falseendif(not npcHandler:isFocused(bot)) thenbot = 0endif(not npcHandler:isFocused(PwrAbs)) thenPwrAbs = 0end--Script made by: Danihcv. To: xTibia.comwhile (bb == 1) and (bot == cid) doif (isInArray(getPlayersOnline(), getPlayerByNameWildcard(tostring(msg)))) and (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot) < 1) and (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strPwrAbs) < 1) then for k, v in pairs (player) do if getPlayerByNameWildcard(tostring(msg)) == v then table.remove(player, k) table.insert(player, k, 73) end endtable.insert(player, getPlayerByNameWildcard(tostring(msg)))end--Script made by: Danihcv. To: xTibia.com if (talkb == 11) and (isInArray(getPlayersOnline(), getPlayerByNameWildcard(tostring(msg)))) and (bot == cid) then math.randomseed(os.time()) local firstNum = math.random(1, 9) local secondNum = math.random(1, 9) result = firstNum + secondNum if (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot) < 1) and (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strPwrAbs) < 1) then setPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot, result) doPlayerSendTextMessage(getPlayerByNameWildcard(tostring(msg)), MESSAGE_STATUS_WARNING, '[Anti-bot] Atenção, '..getCreatureName(getPlayerByNameWildcard(tostring(msg)))..'! Responda quanto é "'..firstNum..'+'..secondNum..'". Utilize o comando: !antibot "resultado" \nVocê tem '..tempoBot..' minutos para responder.') addEvent(function() f = 1 while f <= #player do if isCreature(player[f]) then if (getPlayerStorageValue(player[f], strBot) > 0) and (getPlayerStorageValue(player[f], strBot) <= 19) then if cadeia == "sim" then local i = 1 while i <= #cadeiaPos do if cadeiaPos[i].preso[1] == nil then table.insert(cadeiaPos[i].preso, player[f]) setPlayerStorageValue(player[f], strBot, (os.time()+(tempoPunicao*60))) doPlayerSendTextMessage(player[f], MESSAGE_STATUS_WARNING, '[Anti-bot] Atenção, '..getCreatureName(player[f])..'! Você não respondeu corretamente dentro do tempo hábil. Por isso, você ficará '..tempoPunicao..' minutos preso.') doTeleportThing(player[f], cadeiaPos[i].coord) addEvent(function() local g = 1 while g <= #cadeiaPos do if cadeiaPos[g].preso[1] ~= nil then if isCreature(cadeiaPos[g].preso[1]) then if ((getPlayerStorageValue(cadeiaPos[g].preso[1], strBot) > 18) and (tonumber(getPlayerStorageValue(cadeiaPos[g].preso[1], strBot)) <= os.time())) and (getPlayerStorageValue(cadeiaPos[g].preso[1], strPwrAbs) < 1) then setPlayerStorageValue(cadeiaPos[g].preso[1], strBot, 0) doTeleportThing(cadeiaPos[g].preso[1], getTownTemplePosition(getPlayerTown(cadeiaPos[g].preso[1]))) if (getCreatureSkullType(cadeiaPos[g].preso[1]) == SKULL_WHITE) or (getCreatureSkullType(cadeiaPos[g].preso[1]) == SKULL_RED) or (getCreatureSkullType(cadeiaPos[g].preso[1]) == SKULL_BLACK) then doSendMagicEffect(getTownTemplePosition(getPlayerTown(cadeiaPos[g].preso[1])), 2) else doRemoveCreature(cadeiaPos[g].preso[1]) end local j = 1 while j == 1 do if player[1] == cadeiaPos[g].preso[1] then table.remove(player, 1) j = 2 else table.remove(player, 1) end end table.remove(cadeiaPos[g].preso) g=(#cadeiaPos+1) else g=g+1 end else table.remove(cadeiaPos[g].preso) g=g+1 end else g=g+1 end end end, tempoPunicao*60*1000) i=(#cadeiaPos+2) else i=i+1 end end if i == (#cadeiaPos+1) then print(">>CADEIA TA CHEIA! Providencie mais celas!") p = 1 while p <= #player do if getPlayerStorageValue(player[p], strBot) > 1 and getPlayerStorageValue(player[p], strBot) <= 18 then setPlayerStorageValue(player[p], strBot, 0) doTeleportThing(player[p], getTownTemplePosition(getPlayerTown(player[p]))) if (getCreatureSkullType(player[p]) == SKULL_WHITE) or (getCreatureSkullType(player[p]) == SKULL_RED) or (getCreatureSkullType(player[p]) == SKULL_BLACK) then doSendMagicEffect(getTownTemplePosition(getPlayerTown(player[p])), 2) else doRemoveCreature(player[p]) end table.remove(player, p) p=#player+1 else p=p+1 end end end elseif cadeia == "nao" then if (player[1] ~= nil) then if isCreature(player[1]) then if (getPlayerStorageValue(player[1], strBot) > 0) then setPlayerStorageValue(player[1], strBot, 0) doTeleportThing(player[1], getTownTemplePosition(getPlayerTown(player[1]))) if (getCreatureSkullType(player[1]) == SKULL_WHITE) or (getCreatureSkullType(player[1]) == SKULL_RED) or (getCreatureSkullType(player[1]) == SKULL_BLACK) then doSendMagicEffect(getTownTemplePosition(getPlayerTown(player[1])), 2) else doRemoveCreature(player[1]) end table.remove(player, 1) end else table.remove(player, 1) end end end f=(#player+1) elseif getPlayerStorageValue(player[f], strBot) < 1 then table.remove(player, f) f = (#player+1) else f=f+1 end else table.remove(player, f) f = (#player+1) end end end, tempoBot*60*1000) bot = 0 setPlayerStorageValue(cid, strBotDen, os.time()+(cooldown)) npcHandler:say('Providências tomadas. Agora suma daqui.', cid) npcHandler:releaseFocus(cid) elseif (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot) >= 1) and (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot) <= 18) and (bot == cid) then bot = 0 npcHandler:say('Esse jogador já está sob investigação. Agora suma daqui.', cid) npcHandler:releaseFocus(cid) elseif ((getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot) > 18) or (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strPwrAbs) > 1)) and (bot == cid) then bot = 0 npcHandler:say('Esse jogador está cumprindo sua punição. Agora deixe de ocupar meu tempo.', cid) npcHandler:releaseFocus(cid) end elseif (talkb == 11) and not (isInArray(getPlayersOnline(), getPlayerByNameWildcard(tostring(msg)))) and (bot == cid) then npcHandler:say('Este jogador não existe ou não está online. Deixe de tomar meu tempo com suas besteiras.', cid) npcHandler:releaseFocus(cid) endfalar = 0bb = 0talkb = 0end--Script made by: Danihcv. To: xTibia.comwhile (bp == 2) and (PwrAbs == cid) doif isInArray(getPlayersOnline(), getPlayerByNameWildcard(tostring(msg))) and (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strPwrAbs) < 1) and (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot) < 1) and (getPlayerStorageValue(cid, ''..string.lower(tostring(msg))..'') >= maxDeath) thentable.insert(playerAbs, getPlayerByNameWildcard(tostring(msg)))end if (talkp == 12) and (isInArray(getPlayersOnline(), getPlayerByNameWildcard(tostring(msg)))) and (PwrAbs == cid) then if getPlayerStorageValue(cid, ''..string.lower(tostring(msg))..'') >= maxDeath then setPlayerStorageValue(cid, strPwrAbsDen, os.time()+(cooldown)) if (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strPwrAbs) < 1) and (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot) < 1) then setPlayerStorageValue(cid, ''..string.lower(tostring(msg))..'', 0) setPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strPwrAbs, 1) doPlayerSendTextMessage(getPlayerByNameWildcard(tostring(msg)), MESSAGE_STATUS_WARNING, '[Power Abuse] Atenção, '..getCreatureName(getPlayerByNameWildcard(tostring(msg)))..'! Foi constatado que você abusou de players mais fracos, por isso você ficará '..tempoPunicao..' minutos preso.') if cadeia == "sim" then local i = 1 while i <= (#cadeiaPos+1) do if (cadeiaPos[i].preso[1] == nil) then table.insert(cadeiaPos[i].preso, getPlayerByNameWildcard(tostring(msg))) setPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strPwrAbs, (os.time()+(tempoPunicao*60))) doTeleportThing(getPlayerByNameWildcard(tostring(msg)), cadeiaPos[i].coord) addEvent(function() ih = 1 while ih <= #cadeiaPos do if (isCreature(cadeiaPos[ih].preso[1])) and (getPlayerStorageValue(cadeiaPos[ih].preso[1], strPwrAbs) > 0) and (getPlayerStorageValue(cadeiaPos[ih].preso[1], strPwrAbs) <= os.time()) and (getPlayerStorageValue(cadeiaPos[ih].preso[1], strBot < 1)) then setPlayerStorageValue(cadeiaPos[ih].preso[1], strPwrAbs, 0) doTeleportThing(cadeiaPos[ih].preso[1], getTownTemplePosition(getPlayerTown(cadeiaPos[ih].preso[1]))) if (getCreatureSkullType(cadeiaPos[ih].preso[1]) == SKULL_WHITE) or (getCreatureSkullType(cadeiaPos[ih].preso[1]) == SKULL_RED) or (getCreatureSkullType(cadeiaPos[ih].preso[1]) == SKULL_BLACK) then doSendMagicEffect(getTownTemplePosition(getPlayerTown(cadeiaPos[ih].preso[1])), 2) else doRemoveCreature(cadeiaPos[ih].preso[1]) end table.remove(cadeiaPos[ih].preso) table.remove(playerAbs, 1) ih = (#cadeiaPos+1) else ih = ih+1 end end end, tempoPunicao*60*1000) i=(#cadeiaPos+2) else i=i+1 end if i == (#cadeiaPos+1) then print(">>CADEIA TA CHEIA! Providencie mais celas!") setPlayerStorageValue(playerAbs[#playerAbs], strPwrAbs, 0) doTeleportThing(playerAbs[#playerAbs], getTownTemplePosition(getPlayerTown(playerAbs[#playerAbs]))) if (getCreatureSkullType(playerAbs[#playerAbs]) == SKULL_WHITE) or (getCreatureSkullType(playerAbs[#playerAbs]) == SKULL_RED) or (getCreatureSkullType(playerAbs[#playerAbs]) == SKULL_BLACK) then doSendMagicEffect(getTownTemplePosition(getPlayerTown(playerAbs[#playerAbs])), 2) else doRemoveCreature(playerAbs[#playerAbs]) end table.remove(playerAbs, #playerAbs) i=(#cadeiaPos+2) end end elseif cadeia == "nao" then if (playerAbs[1] ~= nil) then if isCreature(playerAbs[1]) then if (getPlayerStorageValue(playerAbs[1], strPwrAbs) == 1) then setPlayerStorageValue(playerAbs[1], strPwrAbs, 0) doTeleportThing(playerAbs[1], getTownTemplePosition(getPlayerTown(playerAbs[1]))) if (getCreatureSkullType(playerAbs[1]) == SKULL_WHITE) or (getCreatureSkullType(playerAbs[1]) == SKULL_RED) or (getCreatureSkullType(playerAbs[1]) == SKULL_BLACK) then doSendMagicEffect(getTownTemplePosition(getPlayerTown(playerAbs[1])), 2) else doRemoveCreature(playerAbs[1]) end table.remove(playerAbs, 1) i=(#playerAbs+1) end else table.remove(playerAbs, 1) end end end PwrAbs = 0 npcHandler:say('Providências tomadas. Agora suma daqui.', cid) npcHandler:releaseFocus(cid) elseif (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot) >= 1) and (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot) <= 18) and (PwrAbs == cid) then PwrAbs = 0 npcHandler:say('Esse jogador já está sob investigação. Agora suma daqui.', cid) npcHandler:releaseFocus(cid) elseif ((getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strPwrAbs) > 1) or (getPlayerStorageValue(getPlayerByNameWildcard(tostring(msg)), strBot) > 18)) and (PwrAbs == cid) then PwrAbs = 0 npcHandler:say('Esse jogador está cumprindo sua punição. Agora deixe de ocupar meu tempo.', cid) npcHandler:releaseFocus(cid) end else if getPlayerStorageValue(cid, ''..string.lower(tostring(msg))..'') < 0 then npcHandler:say('Desculpe, mas esse jogador não te perturbou tanto assim... São necessárias '..maxDeath..' mortes em desvantagem para que o jogador seja punido. Este jogador nunca mexeu com você.\nAgora dê o fora daqui.', cid) else npcHandler:say('Desculpe, mas esse jogador não te perturbou tanto assim... São necessárias '..maxDeath..' mortes em desvantagem para que o jogador seja punido. Este jogador só mexeu com você '..getPlayerStorageValue(cid, ''..string.lower(tostring(msg))..'')..' vezes.\nAgora dê o fora daqui.', cid) end npcHandler:releaseFocus(cid) end elseif (talkp == 12) and (not isInArray(getPlayersOnline(), getPlayerByNameWildcard(tostring(msg)))) and (PwrAbs == cid) then npcHandler:say('Este jogador não existe ou não está online. Deixe de tomar meu tempo com suas besteiras.', cid) npcHandler:releaseFocus(cid) endfalar = 0bp = 0talkp = 0end--Script made by: Danihcv. To: xTibia.com if (msgcontains(msg, 'yes') or msgcontains(msg, 'sim')) and (npcHandler:isFocused(cid)) then if (usarAntiBot == "sim") and (usarPowerAbuse == "sim") then npcHandler:say('Então, o que tem pra reportar? Algum player está usando {bot}, ou você sofreu {power abuse}?', cid) elseif (usarAntiBot == "sim") and (usarPowerAbuse == "nao") then npcHandler:say('Então, o que tem pra reportar? Algum player está usando {bot}?', cid) elseif (usarAntiBot == "nao") and (usarPowerAbuse == "sim") then npcHandler:say('Então, o que tem pra reportar? Você sofreu {power abuse}?', cid) elseif (usarAntiBot == "nao") and (usarPowerAbuse == "nao") then npcHandler:say('Desculpe, não posso lhe ajudar com nada. Estou aqui apenas para ocupar espaço.', cid) end falar = 1 elseif msgcontains(msg, 'bot') and (falar == 1) and (usarAntiBot == "sim") then if getPlayerStorageValue(cid, strBotDen) <= os.time() then if (bot == nil) or (bot < 1) or (bot == cid) then npcHandler:say('Certo. Diga o nome do botter e eu tomarei as providências.', cid) talkb = 11 bot = cid bb = 1 f = 1 else npcHandler:say('Desculpe, estou atendendo outra pessoa que está com o mesmo problema. Volte daqui a pouco.', cid) npcHandler:releaseFocus(cid) end else npcHandler:say('Desculpe, mas você só pode fazer uma denuncia a cada '..cooldown..' segundos. Volte depois.', cid) npcHandler:releaseFocus(cid) end elseif msgcontains(msg, 'power abuse') and (falar == 1) and (usarPowerAbuse == "sim") then if getPlayerStorageValue(cid, strPwrAbsDen) <= os.time() then if (PwrAbs == nil) or (PwrAbs < 1) or (PwrAbs == cid) then npcHandler:say('Certo. Diga o nome do babaca e eu tomarei as providências.', cid) talkp = 12 PwrAbs = cid bp = 2 else npcHandler:say('Desculpe, estou atendendo outra pessoa que está com o mesmo problema. Volte daqui a pouco.', cid) npcHandler:releaseFocus(cid) end else npcHandler:say('Desculpe, mas você só pode fazer uma denuncia a cada '..cooldown..' segundos. Volte depois.', cid) npcHandler:releaseFocus(cid) end endreturn trueendnpcHandler:setCallback(CALLBACK_GREET, greetCallback)npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)npcHandler:addModule(FocusModule:new())--[[Script made by: Danihcv. To: xTibia.com]]
*atente-se para essa parte configurável do script acima:
-----------------------------------------------------------------------------------------------------------------------------------------------------PARTE CONFIGURAVEL----------------------------------PARTE CONFIGURAVEL------------------------------PARTE CONFIGURAVEL------------------------------------------------------------------------------------------------------------------------------------------------------------------------local usarAntiBot = "sim" --coloque "nao" caso não queira usar o anti-bot do npclocal usarPowerAbuse= "sim" --coloque "nao" caso não queira usar o power abuse system do npclocal cadeia = "sim" --use "sim" caso vc queira mandar o infrator para a cadeia, ou "nao" caso vc nao tenha uma cadeialocal cadeiaPos = { --coordenadas das celas da cadeia, para caso vc tenha colocado o 'cadeia = "sim"' no campo acima[1] = {coord = {x = 32314, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 1[2] = {coord = {x = 32317, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 2[3] = {coord = {x = 32320, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 3[4] = {coord = {x = 32322, y = 32280, z = 8}, preso={}--[[DEIXE ISSO VAZIO]]}, --ponha as coordenadas da cela 4}local tempoBot = 5 --tempo em minutos para o player reportado como botter responder a verificaçãolocal tempoPunicao = 60 --tempo em minutos que o infrator ficara presolocal maxDeath = 7 --quantidade de mortes "desbalanceadas" (player mais fraco contra palyer muito mais forte) considerada como power abuselocal cooldown = 30 --tempo em segundos para o denunciante poder fazer outra denuncialocal strBotDen = 690110local strBot = 69011local strPwrAbsDen = 690120local strPwrAbs = 69012-------------------------------------------------------------------------------------------------------------------------------------------------FIM DA PARTE CONFIGURAVEL-----------------------FIM DA PARTE CONFIGURAVEL---------------------FIM DA PARTE CONFIGURAVEL---------------------------------------------------------------------------------------------------------------------------------------------------------------------
obs: lembrando que você pode adicionar QUANTAS CELAS QUISER! Basta seguir a lógica da tabela relacionada as celas.
obs²: e não esqueça de ler as instruções contidas em cada linha dessa parte do script!
Como usá-lo em meu servidor? (recomendação)
Eu recomendo também usar em seu servidor algum sistema automático de anti-bot, além do npc.
-Por quê?
Porque dessa forma dificultará a vida do botter. Digamos que o sistema automático faça mande uma checagem para todos os jogadores a cada 1 hora.
Sem o meu npc, o botter pode entrar a cada hora no server e responder a checagem automática.
Já tendo o meu npc, o botter pode receber uma checagem de bot a qualquer instante (pois qualquer membro pode fazer a denuncia a qualquer instante). Assim, ele não terá uma previsão de tempo para que ele volte à janela do tibia somente para responder a checagem do bot.
Mapa de prisão
Bom, galera, esse é o npc. Se você quiser usar o sistema de prisão mas não tiver uma prisão em seu server, aqui tem uma prisão feita pelo @Daniel para que vocês possam baixar e usar em conjunto com esse sistema: http://www.xtibia.com/forum/topico/240867-86-pris%C3%A3o-30-celas/
Eu testei todo esse sistema que nem um condenado.
Não consegui achar nenhuma falha.
Então se alguém encontrar alguma falha, por favor relate-a no campo de comentários abaixo.
Por hoje é isso, pessoal.
Até a próxima.
Abraços.
Não autorizo a postagem desse conteúdo sem meus devidos créditos!