Ir para conteúdo
  • 0

Use - Claw Of 'the Noxious Spawn'


GodalonexD

Pergunta

Bem sabe esse item, aquele que ganha do BOSS da serpent spawn.

Entao eu uso ele mesmo se tiver poison ele nao remove o poison e sim ao contrario ele tira dano do char diretamente...

eu queria colocar para remover todos os elementais

ou so poison e cursed igual ta no script abaixo

REP ++

 

local config =

{

conditionsToRemove = {CONDITION_POISON, CONDITION_CURSED}, --conditions to be removed

timeBetweenUse = 10, --time between uses (in seconds)

usesLimit = 60, --uses limit before transform the claw in the unuseful claw(itemid: 10311)

usesLimitTime = 1, --if you use the claw 'usesLimit' times or (60 times) before 'usesLimitTime' hours or (1 hours) then claw will be transformed in the unuseful claw

damage = 200, --damage if you use the claw in a non-protection zone

timeStorage = 64500, --storage to save the time between uses (timeBetweenUse)

usesStorage = 64501, --storage to save the times you use the claw before the 'usesLimit'

usesLimitStorage = 64502 --storage to save the times you use the claw before 'usesLimitTime' hours

}

 

function onUse(cid, item, fromPosition, itemEx, toPosition)

 

if(getPlayerStorageValue(cid, config.timeStorage) < 0) then

doPlayerSetStorageValue(cid, config.timeStorage, 0)

end

if(getPlayerStorageValue(cid, config.usesStorage) < 0) then

doPlayerSetStorageValue(cid, config.usesStorage, 0)

end

if(os.clock() - getPlayerStorageValue(cid, config.timeStorage)) > config.timeBetweenUse then

if(getTilePzInfo(getCreaturePosition(cid)) == true) then

doCreatureSay(cid, "It tightens around your wrist as you take it on.", TALKTYPE_MONSTER)

else

doCreatureSay(cid, "Ouch! The serpent claw stabbed you.", TALKTYPE_MONSTER)

doCreatureAddHealth(cid, -config.damage)

doSendAnimatedText(getCreaturePosition(cid), config.damage, TEXTCOLOR_RED)

end

 

doPlayerSetStorageValue(cid, config.timeStorage, os.clock())

 

if(os.clock() - (config.usesLimitTime * 3600) < getPlayerStorageValue(cid, config.usesLimitStorage)) then

doPlayerSetStorageValue(cid, config.usesStorage, getPlayerStorageValue(cid, config.usesStorage) + 1)

else

doPlayerSetStorageValue(cid, config.usesStorage, 0)

end

 

if(getPlayerStorageValue(cid, config.usesStorage) >= config.usesLimit) then

doTransformItem(item.uid, item.itemid + 2)

end

for i = 1, table.maxn(config.conditionsToRemove) do

doRemoveCondition(cid, config.conditionsToRemove)

end

else

return false

end

return true

end

Link para o comentário
Compartilhar em outros sites

2 respostass a esta questão

Posts Recomendados

  • 0

Nem testei:

 

 

function onUse(cid, item)

local config = {
conditionRemoves = {1, 2, 4, 8, 32, 1024, 2048, 32768, 262144, 524288, 1048576}, -- don't modifique
timeToUse = 30, -- in seconds
loseHealth = 500 -- quanto de vida perder se n usa em pz
}

if getPlayerStorageValue(cid, 83128) - os.time() < 1 and getTilePzInfo(getPlayerPosition(cid)) == false then
doPlayerSendTextMessage(cid, 27, "Conditions removed.")
setPlayerStorageValue(cid, 83128, os.time() + config.timeToUse * 1000)
for a = 1, #config.conditionRemoves do
doRemoveCondition(cid, config.conditionRemoves[a])
end
doPlayerSendTextMessage(cid, 28, "You need wait ".. getPlayerStorageValue(cid, 83128) - os.time() .. " to use again.")
end

if getTilePzInfo(getPlayerPosition(cid)) == true then
doPlayerSendTextMessage(cid, 28, "You only use this in protection zone.")
doCreatureAddHealth(cid, - config.loseHealth)
end
return true
end

 

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

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...