Ir para conteúdo

Featured Replies

Postado

Olá, galera queria como editar a chance de quebrar o vaso da catacumba, de preferencia tirar essa chance , para quando o player clicar ele quebrar e nao ter chance de quebrar

local config = {
	randomText = {"Waaaaaah", "You are too afraid to destroy this object"},
}

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

local exaustedSeconds = 30
local player = Player(cid)
local chances = math.random(10)


if item.actionid == 56530 then 	
	if(item.itemid == 13736) then	
		if getPlayerStorageValue(cid, 324329) <= os.time() then
			if chances == 1 then						
			doTransformItem(item.uid, 13495)					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
			else	
			player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
			player:getPosition():sendMagicEffect(CONST_ME_POFF)
			setPlayerStorageValue(cid, 324329, os.time()+exaustedSeconds*60)
		end
	else
			doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
		end
	end

elseif item.actionid == 56531 then
	if(item.itemid == 13500) then 
		if(getGlobalStorageValue(56531) < 1) then	
			if getPlayerStorageValue(cid, 324330) <= os.time() then
				if chances == 1 then								
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
				else
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324330, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the first jar.")
		end
	end

elseif item.actionid == 56532 then 	
	if(item.itemid == 13500) then 						
		if(getGlobalStorageValue(56532) < 1) then
			if getPlayerStorageValue(cid, 324331) <= os.time() then
				if chances == 1 then
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
				else	
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324331, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the second jar.")
			end
		end


elseif item.actionid == 56533 then
	if(item.itemid == 13500) then  							
		if(getGlobalStorageValue(56533) < 1) then
			if getPlayerStorageValue(cid, 324332) <= os.time() then	
				if chances == 1 then
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
			else	
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324332, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the third jar.")
		end
	end

elseif item.actionid == 56534 then
	if(item.itemid == 13736) then  							
		if(getGlobalStorageValue(56534) < 1) then
			if getPlayerStorageValue(cid, 324333) <= os.time() then	
				if chances == 1 then
				doTransformItem(item.uid, 13495) 					

			-- Sumonar Boss
			 doCreatureSay(cid, "The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes.", TALKTYPE_ORANGE_1)
			 addEvent(doSummonCreature, 45*1000, "Horestis", {x = 32943, y = 32795, z = 12}) 
			else	
				player:say(config["randomText"][math.random(#config["randomText"])], TALKTYPE_ORANGE_1)
				player:getPosition():sendMagicEffect(CONST_ME_POFF)
				setPlayerStorageValue(cid, 324333, os.time()+exaustedSeconds*60)
				end
			else
				doPlayerSendCancel(cid, "You need wait 30 minutes to use again.")
				end
			else
				doPlayerSendCancel(cid, "You need to break the third jar.")
		end
	end
end
	return true
end

 

Editado por markimbozi (veja o histórico de edições)

sigin.gif

Postado


se você retirar essas linhas o vaso não vai mais quebrar não

doTransformItem(item.uid, 13495) 	

lembrando que ela se repete varias vezes terá de retirar todas
se você quiser também pode alterar a mensagem q aparece quando falhar

 

The horestis tomb was broken, the boss of the tomb will be reborn in 45 seconds. The barrier will be built from here 10 minutes
Postado

@wevertonvrb Desculpe, mas vc está equivocado. Quando há a função math.random ele varia de uma maneira aleatória de 0 a 10 (uma vez que no caso o número máximo é 10). Assim, se colocar 100 a chance vai ficar menor ainda. Pra retirar a chance onde consta:

local chances = math.random(10)

Mude para:

local chances = 1

  

 

5YkRF3w.gif

 

 

 

 

 

 

CzysZUR.gifytaam6k.png

 

 

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo