Management Karbust 4927 Posted July 22, 2017 Management Share Posted July 22, 2017 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 Link to comment Share on other sites More sharing options...
Developer PACI 930 Posted July 23, 2017 Developer Share Posted July 23, 2017 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. 1 when you return 0 and server doesn't boot: Link to comment Share on other sites More sharing options...
Management Solution Karbust 4927 Posted July 26, 2017 Author Management Solution Share Posted July 26, 2017 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! 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now