Jump to content
×
×
  • Create New...
  • 0

attempt to call field error


Zerial

Question

  • Premium

Hi everybody! I have got a mount quest, if i write ./qc mount.quest everything works. If i wrote python make.py the mount quest stops working and the syserr say:

[string "ride"]:7: attempt to call field `Ride' (a nil value)

What can i do?

Link to comment
  • Answers 7
  • Created
  • Last Reply

Top Posters For This Question

7 answers to this question

Recommended Posts

  • 0
  • Premium

Here is the quest:
 

quest ride begin
	state start begin
		function Ride( vnum, remain_time )
			ride_info = {
				[38141] = { 20130,	168*60*60, apply.ATTBONUS_MONSTER,	5,	1,	false,	true,	},
				[38142] = { 20130,	168*60*60, apply.EXP_DOUBLE_BONUS,	10,	1,	false,	true,	},
				[38143] = { 20130,	168*60*60, apply.MAX_HP,	2000,	1,	false,	true,	},
				[38144] = { 20130,	168*60*60, apply.DEF_GRADE_BONUS,	50,	1,	false,	true,	},
				[38145] = { 20130,	168*60*60, apply.ATT_GRADE_BONUS,	80,	1,	false,	true,	},
				[38146] = { 20146,	168*60*60, apply.ATTBONUS_MONSTER,	5,	1,	false,	true,	},
				[38147] = { 20146,	168*60*60, apply.EXP_DOUBLE_BONUS,	10,	1,	false,	true,	},
				[38148] = { 20146,	168*60*60, apply.MAX_HP,	2000,	1,	false,	true,	},
				[38149] = { 20146,	168*60*60, apply.DEF_GRADE_BONUS,	50,	1,	false,	true,	},
				[38150] = { 20146,	168*60*60, apply.ATT_GRADE_BONUS,	80,	1,	false,	true,	},		
				[38151] = { 20147,	168*60*60, apply.ATTBONUS_MONSTER,	5,	1,	false,	true,	},
				[38152] = { 20147,	168*60*60, apply.EXP_DOUBLE_BONUS,	10,		1,	false,	true,	},
				[38153] = { 20147,	168*60*60, apply.MAX_HP,	2000,		1,	false,	true,	},
				[38154] = { 20147,	168*60*60, apply.DEF_GRADE_BONUS,	50,	1,	false,	true,	},
				[38155] = { 20147,	168*60*60, apply.ATT_GRADE_BONUS,	80,	1,	false,	true,	},
				[38156] = { 20133,	168*60*60, apply.ATTBONUS_MONSTER,	7,	1,	false,	true,	},
				[38157] = { 20133,	168*60*60, apply.EXP_DOUBLE_BONUS,	15,	1,	false,	true,	},
				[38158] = { 20133,	168*60*60, apply.MAX_HP,	2500,	1,	false,	true,	},
				[38159] = { 20133,	168*60*60, apply.DEF_GRADE_BONUS,	60,	1,	false,	true,	},
				[38160] = { 20133,	168*60*60, apply.ATT_GRADE_BONUS,	90,	1,	false,	true,	},			
				[38161] = { 20135,	168*60*60, apply.ATTBONUS_MONSTER,	7,	1,	false,	true,	},
				[38162] = { 20135,	168*60*60, apply.EXP_DOUBLE_BONUS,	15,	1,	false,	true,	},
				[38163] = { 20135,	168*60*60, apply.MAX_HP,	2500,		1,	false,	true,	},
				[38164] = { 20135,	168*60*60, apply.DEF_GRADE_BONUS,	60,	1,	false,	true,	},
				[38165] = { 20135,	168*60*60, apply.ATT_GRADE_BONUS,	90,	1,	false,	true,	},
				[38166] = { 20131,	168*60*60, apply.ATTBONUS_MONSTER,	7,	1,	false,	true,	},
				[38167] = { 20131,	168*60*60, apply.EXP_DOUBLE_BONUS,	15,	1,	false,	true,	},
				[38168] = { 20131,	168*60*60, apply.MAX_HP,	2500,	1,	false,	true,	},
				[38169] = { 20131,	168*60*60, apply.DEF_GRADE_BONUS,	60,	1,	false,	true,	},
				[38170] = { 20131,	168*60*60, apply.ATT_GRADE_BONUS,	90,	1,	false,	true,	},                          
				[38171] = { 20136,	168*60*60, apply.ATTBONUS_MONSTER,	10,	1,	false,	true,	},
				[38172] = { 20136,	168*60*60, apply.EXP_DOUBLE_BONUS,	20,	1,	false,	true,	},
				[38173] = { 20136,	168*60*60, apply.MAX_HP,	3000,		1,	false,	true,	},
				[38174] = { 20136,	168*60*60, apply.DEF_GRADE_BONUS,	70,	1,	false,	true,	},
				[38175] = { 20136,	168*60*60, apply.ATT_GRADE_BONUS,	100,	1,	false,	true,	},
				[38176] = { 20137,	168*60*60, apply.ATTBONUS_MONSTER,	10,	1,	false,	true,	},
				[38177] = { 20137,	168*60*60, apply.EXP_DOUBLE_BONUS,	20,	1,	false,	true,	},
				[38178] = { 20137,	168*60*60, apply.MAX_HP,	3000,	1,	false,	true,	},
				[38179] = { 20137,	168*60*60, apply.DEF_GRADE_BONUS,	70,	1,	false,	true,	},
				[38180] = { 20137,	168*60*60, apply.ATT_GRADE_BONUS,	100,	1,	false,	true,	},
				[38181] = { 20132,	168*60*60, apply.ATTBONUS_MONSTER,	10,	1,	false,	true,	},
				[38182] = { 20132,	168*60*60, apply.EXP_DOUBLE_BONUS,	20,	1,	false,	true,	},
				[38183] = { 20132,	168*60*60, apply.MAX_HP,					3000,		1,	false,	true,	},
				[38184] = { 20132,	168*60*60, apply.DEF_GRADE_BONUS,	70,		1,	false,	true,	},
				[38185] = { 20132,	168*60*60, apply.ATT_GRADE_BONUS,	100,	1,	false,	true,	},
				[38186] = { 20139,	168*60*60, apply.ATTBONUS_MONSTER,	15,		1,	false,	true,	},
				[38187] = { 20139,	168*60*60, apply.EXP_DOUBLE_BONUS,	25,		1,	false,	true,	},
				[38188] = { 20139,	168*60*60, apply.MAX_HP,					3500,	1,	false,	true,	},
				[38189] = { 20139,	168*60*60, apply.DEF_GRADE_BONUS,	80,		1,	false,	true,	},
				[38190] = { 20139,	168*60*60, apply.ATT_GRADE_BONUS,	110,	1,	false,	true,	},	
				[38191] = { 20140,	168*60*60, apply.ATTBONUS_MONSTER,	15, 	1,	false,	true,	},
				[38192] = { 20140,	168*60*60, apply.EXP_DOUBLE_BONUS,	25,		1,	false,	true,	},
				[38193] = { 20140,	168*60*60, apply.MAX_HP,					3500,		1,	false,	true,	},
				[38194] = { 20140,	168*60*60, apply.DEF_GRADE_BONUS,	80,		1,	false,	true,	},
				[38195] = { 20140,	168*60*60, apply.ATT_GRADE_BONUS,	110,	1,	false,	true,	},
				[38196] = { 20141,	168*60*60, apply.ATTBONUS_MONSTER,	15,		1,	false,	true,	},
				[38197] = { 20141,	168*60*60, apply.EXP_DOUBLE_BONUS,	25,		1,	false,	true,	},
				[38198] = { 20141,	168*60*60, apply.MAX_HP,					3500,	1,	false,	true,	},
				[38199] = { 20141,	168*60*60, apply.DEF_GRADE_BONUS,	80,		1,	false,	true,	},
				[38200] = { 20141,	168*60*60, apply.ATT_GRADE_BONUS,	110,	1,	false,	true,	},
				[38201] = { 20144,	168*60*60, apply.ATTBONUS_MONSTER,	25, 	1,	false,	true,	},
				[38202] = { 20144,	168*60*60, apply.EXP_DOUBLE_BONUS,	35,		1,	false,	true,	},
				[38203] = { 20144,	168*60*60, apply.MAX_HP,					4500,		1,	false,	true,	},
				[38204] = { 20144,	168*60*60, apply.DEF_GRADE_BONUS,	100,		1,	false,	true,	},
				[38205] = { 20144,	168*60*60, apply.ATT_GRADE_BONUS,	130,		1,	false,	true,	},
				[38206] = { 20138,	168*60*60, apply.ATTBONUS_MONSTER,	25,		1,	false,	true,	},
				[38207] = { 20138,	168*60*60, apply.EXP_DOUBLE_BONUS,	35,		1,	false,	true,	},
				[38208] = { 20138,	168*60*60, apply.MAX_HP,					4500,	1,	false,	true,	},
				[38209] = { 20138,	168*60*60, apply.DEF_GRADE_BONUS,	100,	1,	false,	true,	},
				[38210] = { 20138,	168*60*60, apply.ATT_GRADE_BONUS,	130,	1,	false,	true,	},
				[38211] = { 20134,	168*60*60, apply.ATTBONUS_MONSTER,	30, 	1,	false,	true,	},
				[38212] = { 20134,	168*60*60, apply.EXP_DOUBLE_BONUS,	40,		1,	false,	true,	},
				[38213] = { 20134,	168*60*60, apply.MAX_HP,					5000,		1,	false,	true,	},
				[38214] = { 20134,	168*60*60, apply.DEF_GRADE_BONUS,	120,	1,	false,	true,	},
				[38215] = { 20134,	168*60*60, apply.ATT_GRADE_BONUS,	150,		1,	false,	true,	},
				[38138] = { 20145,	168*60*60, apply.ATTBONUS_MONSTER,	40, 	1,	false,	true,	},
				[38135] = { 20142,	168*60*60, apply.EXP_DOUBLE_BONUS,	50,		1,	false,	true,	},
				[38136] = { 20143,	168*60*60, apply.ATT_GRADE_BONUS,	200,	1,	false,	true,	},
				}

			if pc.level < ride_info[vnum][5] then
				syschat("Sorry, your level is too low.")
			else
				if ride_info[vnum][2] == 0 and remain_time != 0 then
					pc.mount( ride_info[vnum][1], remain_time*60 )
					pc.mount_bonus( ride_info[vnum][3], ride_info[vnum][4], remain_time*60 )
				else
					pc.mount( ride_info[vnum][1], ride_info[vnum][2] )
					pc.mount_bonus( ride_info[vnum][3], ride_info[vnum][4], ride_info[vnum][2] )
				end

				if true == ride_info[vnum][6] then
					pc.remove_item(vnum, 1)
				end	
			end	
		end

		when login begin
			local vnum, remain_time = pc.get_special_ride_vnum()

			if 0 != vnum then
				ride.Ride(vnum, remain_time)
			end
		end

	when 38141.use or 38142.use or 38143.use or 38144.use or 38145.use or 38146.use or 38147.use or 38148.use or 38149.use or 38150.use
	 or 38151.use or 38152.use or 38153.use or 38154.use or 38155.use or 38156.use or 38157.use or 38158.use or 38159.use or 38160.use
	 or 38161.use or 38162.use or 38163.use or 38164.use or 38165.use or 38166.use or 38167.use or 38168.use or 38169.use or 38170.use
	 or 38171.use or 38172.use or 38173.use or 38174.use or 38175.use or 38176.use or 38177.use or 38178.use or 38179.use or 38180.use
	 or 38181.use or 38182.use or 38183.use or 38184.use or 38185.use or 38186.use or 38187.use or 38188.use or 38189.use or 38190.use
	 or 38191.use or 38192.use or 38193.use or 38194.use or 38195.use or 38196.use or 38197.use or 38198.use or 38199.use or 38200.use 
	 or 38201.use or 38202.use or 38203.use or 38204.use or 38205.use or 38206.use or 38207.use or 38208.use or 38209.use or 38210.use
	 or 38211.use or 38212.use or 38213.use or 38214.use or 38215.use or 38135.use or 38136.use or 38138.use begin
			if pc.is_polymorphed() then
				syschat("You are polymorphed, try again later.")
			elseif false == pc.is_riding() then
			 	if true == horse.is_summon() then
					horse.unsummon()
				end

				-- ą«ÇŃ´ë·Î ĽłÁ¤(60łâ)
				-- item.set_socket(2, 60*24*365*60)
				ride.Ride(item.vnum, 0)
			else
				pc.unmount()
				--say("ŔĚąĚ Ĺ»°ÍŔ» ŔĚżëÁßŔÔ´Ď´Ů.")
				--say("")
			end
		end
	end
end

 

Link to comment
  • 0
  • Premium

This quest solved my problem: 

 

quest ride_mystery_boxes begin
	state start begin
		function Ride( vnum, remain_time )
			ride_info = {
				[ITEMID] = { MOUNTID,	5*60, apply.ATTBONUS_MONSTER,	5,	1,	false,	true,	},
				}

			if pc.level < ride_info[vnum][5] then
				syschat("Your level is too low.")
			else
				if 112 == pc.get_map_index() then
					return
				end
				if ride_info[vnum][2] == 0 and remain_time != 0 then
					pc.mount( ride_info[vnum][1], remain_time*60 )
					pc.mount_bonus( ride_info[vnum][3], ride_info[vnum][4], remain_time*60 )
				else
					pc.mount( ride_info[vnum][1], ride_info[vnum][2] )
					pc.mount_bonus( ride_info[vnum][3], ride_info[vnum][4], ride_info[vnum][2] )
				end

				if true == ride_info[vnum][6] then
					pc.remove_item(vnum, 1)
				end	
			end	
		end

		when login begin
			local vnum, remain_time = pc.get_special_ride_vnum()
	if  vnum != ITEMID then
				return
			end
			if 0 != vnum then
				ride_mystery_boxes.Ride(vnum, remain_time)
			end
		end

	when ITEMID.use begin
			 if pc.is_polymorphed() then
				 syschat("You are polymorphed, try again soon.")
			elseif false == pc.is_riding() then
			 	if true == horse.is_summon() then
					horse.unsummon()
				end
				 ride_mystery_boxes.Ride(item.vnum, 0)
			 else
				 syschat("You are already in a horse. ")
			 end
		end
	end
end

 

Link to comment

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


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.