Jump to content

Item bonus - Without use (inside inventory required) few bugs


Recommended Posts

Hey guys, I'm working on the code so that my mount seals can give the bonus stated without needing the ride the mount, it needs to detect the item is in the inventory, give the bonus and if the item is taken from the inventory the bonus is removed.

 

Currently I've got it detecting, giving a bonus and removing it if the item is removed from the inventory, but I've got several bugs

 

  • Item is giving 2x amount it should ( there's no duplicate quest) & when the item is removed it only removes what the actual bonus should give. (example: item is meant to give 5,000 hp. HP without item 5,000, hp with item 15,000 & item is removed, re-log hp = 10,000 and not the initial 5,000)
  • When you ride the mount and then get off, it removes the bonus entirely

 

Any help is appreciated!

 

 

 

Mount Bonus Quest - (Gives 5,000 hp for testing)

quest mountbonus begin
    state start begin
        when login or enter with pc.getqf("mount_bonus") != 1 begin
            if pc.count_item(52001)>=1 then
                  pc.mount_bonus(1, 5000, 60*60*24*365)
                  pc.setqf("mount_bonus", 1)
            end
        end
        when logout or disconnect with pc.getqf("mount_bonus") == 1 begin
                      pc.setqf("mount_bonus", 0)
        end
    end
end

Mount Ride Quest

------------------------------------------------
-- Autor: Terenzo. (http://terenzo.tk)
-- Zakaz publikowania i sprzedawania!
------------------------------------------------
quest mount begin
	state start begin
		when 71114.use or 71165.use or 71166.use or 71115.use or 71116.use or 71117.use or 71118.use or 71119.use or 71120.use or 71121.use or 71124.use or 71125.use or 71126.use or
			71127.use or 71128.use or 71137.use or 71138.use or 71139.use or 71140.use or 71141.use or 71142.use or 52001.use or 52002.use or 52003.use or
			52004.use or 52005.use or 52006.use or 52007.use or 52008.use or 52009.use or 52010.use or 52011.use or 52012.use or 52013.use or 52014.use or
			52015.use or 52016.use or 52017.use or 52018.use or 52019.use or 52020.use or 52021.use or 52022.use or 52023.use or 52024.use or 52025.use or
			52026.use or 52027.use or 52028.use or 52029.use or 52030.use or 52031.use or 52032.use or 52033.use or 52034.use or 52035.use or 52036.use or
			52037.use or 52038.use or 52039.use or 52040.use or 52041.use or 52042.use or 52043.use or 52044.use or 52045.use or 52046.use or 52047.use or
			52048.use or 52049.use or 52050.use or 52051.use or 52052.use or 52053.use or 52054.use or 52055.use or 52056.use or 52057.use or 52058.use or
			52059.use or 52060.use or 52061.use or 52062.use or 52063.use or 52064.use or 52065.use or 52066.use or 52067.use or 52068.use or 52069.use or
			52070.use or 52071.use or 52072.use or 52073.use or 52074.use or 52075.use or 52076.use or 52077.use or 52078.use or 52079.use or 52080.use or
			52081.use or 52082.use or 52083.use or 52084.use or 52085.use or 52086.use or 52087.use or 52088.use or 52089.use or 52090.use with
			not pc.is_polymorphed() begin
			mount.ride(item.get_vnum())
		end
		when login begin
			if item.select_cell(97) then
				if 71114 <= item.vnum and item.vnum <= 71142 then
					pc.unmount()
					mount.ride(item.vnum)
				end
			end
			if item.select_cell(98) then
				if 71114 <= item.vnum and item.vnum <= 71142 then
					pc.unmount()
					mount.ride(item.vnum)
				end
			end
		end
		function ride(vnum)
			if pc.is_mount() then
				pc.unmount()
				return
			end
			local time = mount.info(vnum, 8)
			local bon1id = mount.info(vnum, 2) bon1val = mount.info(vnum, 3)
			local bon2id = mount.info(vnum, 4) bon2val = mount.info(vnum, 5)
			local bon3id = mount.info(vnum, 6) bon3val = mount.info(vnum, 7)

			if pc.get_armor() == 11901 or pc.get_armor() == 11902 then
				say("")
				say_title(pc.get_name().."...")
				say("Zdejmij swoj¹ sukniê i ponownie za³o¿ pieczêæ!")
				return
			elseif pc.get_armor() == 11903 or pc.get_armor() == 11904 then
				say("")
				say_title(pc.get_name().."...")
				say("Zdejmij swój garnitur i ponownie za³o¿ pieczêæ!")
				return
			end

			time = time*60
			pc.mount(mount.info(vnum, 1), time)
			if bon1id !=0 and bon1val !=0 then
				pc.mount_bonus(bon1id, bon1val, time)
			end
			if bon2id !=0 and bon2val !=0 then
				pc.mount_bonus(bon2id, bon2val, time)
			end
			if bon3id !=0 and bon3val !=0 then
				pc.mount_bonus(bon3id, bon3val, time)
			end
		end
		function info(vnum, index)
			mount_list={ --  mount  bon1  bon2  bon3  czas (min.)
				[52001] = {20223, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52002] = {20224, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52003] = {20225, 0, 0, 0, 0, 0, 0, 60*24*7},	
				[52004] = {20226, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52005] = {20227, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52006] = {20228, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52007] = {20229, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52008] = {20204, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52009] = {20205, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52010] = {20206, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52011] = {20207, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52012] = {20208, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52013] = {20209, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52014] = {20210, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52015] = {20211, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52016] = {20212, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52017] = {20213, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52018] = {20214, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52019] = {20215, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52020] = {20216, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52021] = {20217, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52022] = {20218, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52023] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52024] = {20111, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52025] = {20112, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52026] = {20113, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52027] = {20114, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52028] = {20115, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52029] = {20116, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52030] = {20117, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52031] = {20118, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52032] = {20119, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52033] = {20120, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52034] = {20121, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52035] = {20122, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52036] = {20123, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52037] = {20124, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52038] = {20125, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52039] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52040] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52041] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52042] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52043] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52044] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52045] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52046] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52047] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52048] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52049] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52050] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52051] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52052] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52053] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52054] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52055] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52056] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52057] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52058] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52059] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52060] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52061] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52062] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52063] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52064] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52065] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52066] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52067] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52068] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52069] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52070] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52071] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52072] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52073] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52074] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52075] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52076] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52077] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52078] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52079] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52080] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52081] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52082] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52083] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52084] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52085] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52086] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52087] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52088] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52089] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[52090] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71114] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71115] = {20110, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71116] = {20111, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71117] = {20111, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71118] = {20112, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71119] = {20112, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71120] = {20113, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71121] = {20113, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71124] = {20114, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71125] = {20115, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71126] = {20116, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71127] = {20117, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71128] = {20118, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71137] = {20120, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71138] = {20121, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71139] = {20122, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71140] = {20123, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71141] = {20124, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71142] = {20125, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71165] = {20221, 0, 0, 0, 0, 0, 0, 60*24*7},
				[71166] = {20222, 0, 0, 0, 0, 0, 0, 60*24*7},
			}
			return mount_list[vnum][index]
		end
	end
end
  • Love 2
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.