Jump to content

Recommended Posts

  • Management

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

raw

raw

Link to comment
https://metin2.dev/topic/16389-bug-pet-mount/
Share on other sites

  • Developer

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
https://metin2.dev/topic/16389-bug-pet-mount/#findComment-90810
Share on other sites

  • Management
  • Solution

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

raw

raw

Link to comment
https://metin2.dev/topic/16389-bug-pet-mount/#findComment-90938
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

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.