Jump to content

Bug pet mount


Go to solution Solved by Karbust,

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
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
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.