Jump to content

Dúvida - Quest de Cavalo


LuizFernando
 Share

Recommended Posts

Tenho aqui está quest totalmente funcional, gostaria de saber se ao usar a medalha tem como colocar 50% a chance de upar o nível do cavalo, e se ao chegar no nível 11 e 21 ganhar o brasão do respectivo cavalo?

quest horse_levelup begin
    state start begin
        when 50050.use begin
            pc.remove_item(50050, 1)
            horse.unride()
            horse.advance()
            return
        end
    end
end

Link to comment
Share on other sites

Não testado:

quest horse_levelup begin
	state start begin
		when 50050.use begin
			--50% chance to upgrade horse
			if math.random(1,100) <= 50 then
				if pc.countitem("50050")>=1 then
					pc.remove_item(50050, 1)
					horse.unride()
					horse.advance()
					horse.ride()
					char_log(0, "HORSE_UPGRADE", "Medal used")
				end
			end
			--Give Armed Horse Book
			if horse.get_level()>=11 and not horse.is_dead() then
				if pc.countitem("50051")>=1 then
					horse.unride()
					pc.removeitem("50051", 1)
					pc.give_item2("50052", 1)
					horse.ride()
					char_log(0, "HORSE_UPGRADE", "Give Armed Horse Book")
				end
			end
			--Give Military Horse Book
			if horse.get_level()>=21 and not horse.is_dead() then
				if pc.countitem("50052")>=1 then
					horse.unride()
					pc.removeitem("50052", 1)
					pc.give_item2("50053", 1)
					horse.ride()
					char_log(0, "HORSE_UPGRADE", "Give Military Horse Book")
				end
			end
			return
		end
	end
end 

 

Link to comment
Share on other sites

Fiz só um ajuste não estava removendo o item quando falhava, mas já resolvi! Obrigado você é o cara TIERRI!

quest horse_levelup begin
    state start begin
        when 50050.use begin
            --50% chance to upgrade horse
            if math.random(1,100) <= 50 then
                if pc.countitem("50050")>=1 then
                    pc.removeitem(50050, 1)
                    horse.unride()
                    horse.advance()
                    horse.ride()
                end
            else
                    pc.removeitem(50050, 1)
            end
            --Give Armed Horse Book
            if horse.get_level()>=11 and not horse.is_dead() then
                if pc.countitem("50051")>=1 then
                    horse.unride()
                    pc.removeitem("50051", 1)
                    pc.give_item2("50052", 1)
                    horse.unsummon()
                end
            end
            --Give Military Horse Book
            if horse.get_level()>=21 and not horse.is_dead() then
                if pc.countitem("50052")>=1 then
                    horse.unride()
                    pc.removeitem("50052", 1)
                    pc.give_item2("50053", 1)
                    horse.unsummon()
                end
            end
            return
        end
    end
end 
 

Edited by LuizFernando
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...