Ir para conteúdo

[Pedido] Tile Que Remove Storage


RHCP

Posts Recomendados

Tipo do script: movement

Protocolo (versão do Tibia): 8.60

Servidor utilizado: TFS 0.4

Nível de experiência: Iniciante

Adicionais/Informações:

Gostaria de um movement, que ao pisar num certo tile, a storage de valor 9000 de um player fosse removida

 

Obrigado

Editado por RHCP
Link para o comentário
Compartilhar em outros sites

Parece que não funciona, pois o player continua com a storage...

 

Vou explicar direito, estou com um sistema antibot, que ao pisar no tile dos treiners, ele fica com storage 9000, onde essa storage faz com que o antibot nao seja executado em players que possuem ela. Eu gostaria que no caso, ao sair do trainers, a storage fosse removida, e o unico modo que eu pensei foi através de movements, onde assim que pissasse no tile de saida, removesse a storage, porém, parece que ela ainda continua, pois o antibot nao executa em tal player ainda...

Link para o comentário
Compartilhar em outros sites

já entendi,é porque o event do tile anti bot ainda fica contando no player

 

mesmo se ele sair e for caçar mob dps de certo tempo vai ser kikado

 

eu fiz um script ja de anti exit nos treiners

Link para o comentário
Compartilhar em outros sites

estou usando o seguinte codigo:

 

 

local config = {
banDur = 4 -- in hours
}

local function doBanPlayer(cid)
if(isPlayer(cid)) then
 if(getPlayerStorageValue(cid, 100000)) then
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been banished for using unofficial software to play.")
  doAddPlayerBanishment(getPlayerGUID(cid), BAN_PLAYER, os.time() + config.banDur * 60 * 60, ACTION_BANISHMENT, "Using unofficial software to play.")
  doBroadcastMessage("[bANISHMENT SYSTEM]: " .. getPlayerName(cid) .. " was banned for " .. config.banDur .. " hours for using unofficial software to play.", MESSAGE_STATUS_WARNING)
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)
  addEvent(doRemoveCreature, 6000, cid)
  setPlayerStorageValue(cid, 100001, -1)
 end
end
return true
end

function onSay(cid, words, param)
if(not(param)) then
 doPlayerSendCancel(cid, "You need to specify a parameter.")
 doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
 return true
end
local param = string.lower(param)
if(words == "/report") then
 if(param == string.lower(getPlayerName(cid))) then
  doPlayerSendCancel(cid, "You can't report yourself.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 if(not(getPlayerByName(param))) then
  doPlayerSendCancel(cid, "There is no such player nor it exists.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 if(not(getCreatureCondition(getPlayerByName(param), CONDITION_INFIGHT))) then
  doPlayerSendCancel(cid, getPlayerName(getPlayerByName(param)) .. " is not hunting at the moment.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 -- if(getCreatureStorage(cid, 9000)) then
 -- doPlayerSendCancel(cid, "This Player is Training.")
 -- doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
 -- return true
 --end
 if(getPlayerStorageValue(cid, 100002) >= os.time()) then
  doPlayerSendCancel(cid, "You can only run one check per 5 minutes.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 for k, pid in pairs(getSpectators(getCreaturePosition(getPlayerByName(param)), 5, 7, false)) do
  if(cid == pid) then
break
  end
  if(k == table.maxn(getSpectators(getCreaturePosition(getPlayerByName(param)), 5, 7, false))) then
doPlayerSendCancel(cid, "You must have " .. getPlayerName(getPlayerByName(param)) .. " in your sight.")
doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
return true
  end
 end
 if(getPlayerStorageValue(getPlayerByName(param), 100000) >= os.time()) then
  doPlayerSendCancel(cid, "Someone has already requested a player check for: " .. getPlayerName(getPlayerByName(param)) .. ", to check " .. (getPlayerSex(getPlayerByName(param)) and "him" or "her") .. " again you must wait " .. getPlayerStorageValue(getPlayerByName(param), 100000) - os.time() .. " seconds")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 local firstRandom = math.random(1, 9)
 local secondRandom = math.random(1, 9)
 local returnValue = tonumber(firstRandom) * tonumber(secondRandom)
 local returnValueString = tonumber(firstRandom) .. " * " .. tonumber(secondRandom)
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've requested a bot check to player " .. getPlayerName(getPlayerByName(param)))
 doPlayerSendTextMessage(getPlayerByName(param), MESSAGE_STATUS_CONSOLE_BLUE, "Someone has requested you a bot check. If you do this math wrong, you'll be banned for " .. config.banDur .. " hours.")
 doPlayerSendTextMessage(getPlayerByName(param), MESSAGE_STATUS_CONSOLE_BLUE, "The math is " .. tostring(returnValueString) .. " = ?. To reply with action say '/reply ANSWER'. Remember you have only one change, so double check the answer.")
 setPlayerStorageValue(getPlayerByName(param), 100001, tonumber(returnValue))
 setPlayerStorageValue(getPlayerByName(param), 100000, os.time() + 900)
 setPlayerStorageValue(cid, 100002, os.time() + 300)
 addEvent(doBanPlayer, 1000 * 60 * 15, cid)
elseif(words == "/reply") then
 if(not(getPlayerStorageValue(cid, 100001))) then
  doPlayerSendCancel(cid, "You've no bot checks at the moment.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 if(tonumber(param) ~= tonumber(getPlayerStorageValue(cid, 100001))) then
  return doBanPlayer(cid)
 end
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've answered correctly.")
 doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
 setPlayerStorageValue(cid, 100001, -1)
end
return true
end

 

A parte comentada seria o do movement que o antibot nao executaria caso tivesse ela.

 

No caso, há como fazer tipo um blocked target? por exemplo, se tiver atacando Training Monk, não funcionaria nele.

Se tiver como, poderia me ajudar?

 

----------------

 

Edit:

Tentei adicionar o blocked targets, ficando da seguinte forma:

 

local config = {
banDur = 4, -- in hours
blocked_targets = "Training Monk"
}

local function doBanPlayer(cid)
if(isPlayer(cid)) then
 if(getPlayerStorageValue(cid, 100000)) then
  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've been banished for using unofficial software to play.")
  doAddPlayerBanishment(getPlayerGUID(cid), BAN_PLAYER, os.time() + config.banDur * 60 * 60, ACTION_BANISHMENT, "Using unofficial software to play.")
  doBroadcastMessage("[bANISHMENT SYSTEM]: " .. getPlayerName(cid) .. " was banned for " .. config.banDur .. " hours for using unofficial software to play.", MESSAGE_STATUS_WARNING)
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_GREEN)
  addEvent(doRemoveCreature, 6000, cid)
  setPlayerStorageValue(cid, 100001, -1)
 end
end
return true
end

function onSay(cid, words, param)
if(not(param)) then
 doPlayerSendCancel(cid, "You need to specify a parameter.")
 doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
 return true
end
local param = string.lower(param)
if(words == "/report") then
 if(param == string.lower(getPlayerName(cid))) then
  doPlayerSendCancel(cid, "You can't report yourself.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 if(not(getPlayerByName(param))) then
  doPlayerSendCancel(cid, "There is no such player nor it exists.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 if(not(getCreatureCondition(getPlayerByName(param), CONDITION_INFIGHT))) then
  doPlayerSendCancel(cid, getPlayerName(getPlayerByName(param)) .. " is not hunting at the moment.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 -- if(getCreatureStorage(cid, 9000)) then
 -- doPlayerSendCancel(cid, "This Player is Training.")
 -- doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
 -- return true
 --end
 if(getPlayerStorageValue(cid, 100002) >= os.time()) then
  doPlayerSendCancel(cid, "You can only run one check per 5 minutes.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 if(targetName == blocked_targets) then
  doPlayerSendCancel(cid, "This Player is Training.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 for k, pid in pairs(getSpectators(getCreaturePosition(getPlayerByName(param)), 5, 7, false)) do
  if(cid == pid) then
   break
  end
  if(k == table.maxn(getSpectators(getCreaturePosition(getPlayerByName(param)), 5, 7, false))) then
   doPlayerSendCancel(cid, "You must have " .. getPlayerName(getPlayerByName(param)) .. " in your sight.")
   doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
   return true
  end
 end
 if(getPlayerStorageValue(getPlayerByName(param), 100000) >= os.time()) then
  doPlayerSendCancel(cid, "Someone has already requested a player check for: " .. getPlayerName(getPlayerByName(param)) .. ", to check " .. (getPlayerSex(getPlayerByName(param)) and "him" or "her") .. " again you must wait " .. getPlayerStorageValue(getPlayerByName(param), 100000) - os.time() .. " seconds")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end
 local firstRandom = math.random(1, 9)
 local secondRandom = math.random(1, 9)
 local returnValue = tonumber(firstRandom) * tonumber(secondRandom)
 local returnValueString = tonumber(firstRandom) .. " * " .. tonumber(secondRandom)
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've requested a bot check to player " .. getPlayerName(getPlayerByName(param)))
 doPlayerSendTextMessage(getPlayerByName(param), MESSAGE_STATUS_CONSOLE_BLUE, "Someone has requested you a bot check. If you do this math wrong, you'll be banned for " .. config.banDur .. " hours.")
 doPlayerSendTextMessage(getPlayerByName(param), MESSAGE_STATUS_CONSOLE_BLUE, "The math is " .. tostring(returnValueString) .. " = ?. To reply with action say '/reply ANSWER'. Remember you have only one change, so double check the answer.")
 setPlayerStorageValue(getPlayerByName(param), 100001, tonumber(returnValue))
 setPlayerStorageValue(getPlayerByName(param), 100000, os.time() + 900)
 setPlayerStorageValue(cid, 100002, os.time() + 300)
 addEvent(doBanPlayer, 1000 * 60 * 15, cid)
elseif(words == "/reply") then
 if(not(getPlayerStorageValue(cid, 100001))) then
  doPlayerSendCancel(cid, "You've no bot checks at the moment.")
  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)
  return true
 end 
 if(tonumber(param) ~= tonumber(getPlayerStorageValue(cid, 100001))) then
  return doBanPlayer(cid)
 end
 doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You've answered correctly.")
 doSendMagicEffect(getPlayerPosition(cid), CONST_ME_MAGIC_BLUE)
 setPlayerStorageValue(cid, 100001, -1)
end
return true
end

 

 

Porém, mesmo que o player nao esteja mais atacando training monk, ainda diz que está atacando...

 

Alguma dica do que eu poderia fazer?

Editado por RHCP
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...