Jump to content
External pictures are being replaced... ×
×
×
  • Create New...
  • 0

Bug pet mount


Karbust

Question

  • Web Developer

Hello

Today I found out about another bug, it happens only when I push pet first and then mount the bonus aren't removed when I die... (if I push mount first and then the pet and I die, the bonus are removed)

I'm using this system but is not working:

		when die or logout begin
			if pet.count_summoned() == 1 then
				if pc.is_riding() then
					local pet_item = pc.getqf("pet_item")
					local pet_info = pet_system.get_pet_info(pet_item)
							
					if pet_info[4] != nil then
						local num_bonus = pet_info[4] -- valor de bonus a "desaplicar"
						for i = 1, num_bonus, 1 do
							affect.remove_collect(pet_info[5+2*(i-1)], pc.getqf("pet_"..item.vnum.."_level")*pet_info[6+2*(i-1)]/25, 60*60*24*365)
						end
					end
				else
					local pet_item = pc.getqf("pet_item")
					local pet_info = pet_system.get_pet_info(pet_item)
							
					if pet_info[4] != nil then
						local num_bonus = pet_info[4] -- valor de bonus a "desaplicar"
						for i = 1, num_bonus, 1 do
							affect.remove_collect(pet_info[5+2*(i-1)], pc.getqf("pet_"..item.vnum.."_level")*pet_info[6+2*(i-1)]/25, 60*60*24*365)
						end
					end
				end
			end
		end

This only happens with mounts, horse doesn't affect...

Thanks

QJ0orbR.png

Metin2 Icon Database

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
  • Web Developer

Solved!

I just needed to change "item_vnum" to "pet_item", since "pet_item" is the item vnum (local pet_item = pc.getqf("pet_item")) and the quest flag is being set when the pet is called: "pc.setqf("pet_item",item.vnum)"

Thanks!

  • Love 1

QJ0orbR.png

Metin2 Icon Database

Link to comment
Share on other sites

  • 1

i don't even know why you're using the same piece of code on each condition. there's no difference at all. it's useless.
also, you're using item.vnum (item.get_vnum()) without anything pointing to an item.

  • Love 1

when you return 0 and server doesn't boot:

unknown.png

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
  • Recently Browsing   0 members

    • No registered users viewing this page.


Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.