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

levelup.quest


Root

Question

[Message d'introduction]

Bonjour tous le monde

Version des files :2014 team fe 

Domaine (Base de données, Core, etc.) :quest

Votre niveau (débutant, intermédiaire, avancé) : débutant

 

Description du problème : Bonjour, est merci d'avance !Alors je suis dans la personnalisation de mon serveur. si j'ai bien compris cette quête correspond au mission de chasse ! j'aimerai savoir si j'ai juste au niveau de cela mais aussi comprendre mieux cette quête et pouvoir changer les recommence obtenu car celle présente devienne obsolète pour mon serveur.

 

 

levelup.quest

quest levelup begin
state run begin
	when letter begin

		local current = pc.getqf("current")
		local completed_level = pc.getqf("complete");

		if current == 0 and
			pc.get_level() > completed_level and
			pc.get_level() >  1 and
			pc.get_level() < 91 then

			local lev = pc.get_level()

			pc.setqf("buttonstate", 2)
			makequestbutton("Mission "..lev.." - début")
			pc.setqf("current", lev)
			pc.setqf("select", 1)
			pc.setqf("remain", special.levelup_quest[lev][2])
			setskin(NOWINDOW)
		end
		setstate(start)
	end
end

state start begin
	when info begin

		local lev = pc.getqf("current")

		if lev == 0 then return end
			setskin(SCROLL)
			setbgimage('level_bg.tga')

			local s = pc.getqf("select")

			if s == 0 then s = 1 end
				addimage(20,12,special.levelup_img[special.levelup_quest[lev][s*2-1]])
				setcolor(0,0,0)

				---                                                   l
				say("")
				say("")
				say("")
				say("Tuez: ", mob_name(special.levelup_quest[lev][s*2-1])," !")
				say("Nombre de cibles: ", special.levelup_quest[lev][s*2])
				say("Récompense:")
				raw_script("-"..special.levelup_quest[lev][5].." % d'expérience.[ENTER]")

			if lev <= table.getn(special.levelup_reward1) then
				raw_script("-"..item_name(special.levelup_reward1[lev][pc.job+1]))

			elseif lev> table.getn(special.levelup_reward1) and lev < 26 then
				raw_script("-Un objet aléatoire.")
			end

		if lev>=21 then
			raw_script("-Des Geeklard's.")
		end

		raw_script(newline)

		levelup.show_mob_pos(lev)

		select(locale.confirm)
		clearmapsignal()
		setskin(NOWINDOW)
	end

	when login begin

		local lev = pc.getqf("current")

		if lev != 0 then
			if pc.getqf("remain") <= 0 then
				setskin(NOWINDOW)
				pc.setqf("buttonstate", 3)
				makequestbutton("Mission "..lev.." - terminée")
			else
				setskin(NOWINDOW)
				pc.setqf("buttonstate", 1)
				makequestbutton("Mission "..lev.."")
			end
		end
	end

	when button begin

		local lev = pc.getqf("current")

		if lev == 0 then return end
			if pc.getqf("buttonstate") == 3 then

				local s = pc.getqf("select")

				if s == 0 then s = 1 end

				---                                                   l
				say_title("Mission "..lev.." - terminée:")
				say("Parfait, vous avez réussi la mission.")
				wait()

		if lev <= 20 then
			if lev <= table.getn(special.levelup_reward1) then
				pc.give_item("level"..lev.."item", special.levelup_reward1[lev][pc.job+1])
			else

			local v = number(1,100)

				if v <= special.levelup_reward3[1][1] then
					pc.give_item("level"..lev.."item",special.levelup_reward3[1][2],special.levelup_reward3[1][3])
				elseif v <= special.levelup_reward3[2][1] then
					pc.give_item("level"..lev.."item",special.levelup_reward3[2][2],special.levelup_reward3[2][3])
				elseif v <= special.levelup_reward3[3][1] then
					pc.give_item("level"..lev.."item",special.levelup_reward3[3][2],special.levelup_reward3[3][3])
				elseif v <= special.levelup_reward3[4][1] then
					pc.give_item("level"..lev.."item",special.levelup_reward3[4][2],special.levelup_reward3[4][3])
				else
					pc.give_item("level"..lev.."item",special.levelup_reward3[5][2],special.levelup_reward3[5][3])
				end
			end

			pc.give_exp_perc("level"..lev.."exp", lev, special.levelup_quest[lev][5])

			if lev == 12 or lev == 14 or lev == 16 or lev == 18 or lev == 20 then
				pc.give_item2(50083)
				say_reward("Vous avez reçu "..item_name(50083) .. ".")
			end
		else
			local ll = lev - 20

			if lev < 26 then

				local n = table.getn(special.levelup_reward_item_21[ll])
				local t = special.levelup_reward_item_21[ll][number(1, n)]

				say_reward("Vous avez reçu :")

				if type(t) == 'table' then
					pc.give_item2(t[1], t[2])
					say_reward("Vous avez reçu "..t[2].."­ "..item_name(t[1])..".")
				else
					pc.give_item2(t)
					say_reward("Vous avez reçu "..item_name(t)..".")
				end
			end

			local reward_gold = special.levelup_reward_gold21
			local reward_exp = special.levelup_reward_exp21

			if lev >= 31 and lev <= 40 then
				reward_gold = special.levelup_reward_gold31
				reward_exp = special.levelup_reward_exp31
			elseif lev >= 41 and lev <= 50 then
				reward_gold = special.levelup_reward_gold41
				reward_exp = special.levelup_reward_exp41
			elseif lev >= 51 and lev <= 60 then
				reward_gold = special.levelup_reward_gold51
				reward_exp = special.levelup_reward_exp51
			elseif lev >= 61 and lev <= 70 then
				reward_gold = special.levelup_reward_gold61
				reward_exp = special.levelup_reward_exp61
			elseif lev >= 71 and lev <=83 then
				reward_gold = special.levelup_reward_gold71
				reward_exp = special.levelup_reward_exp61
			elseif lev >= 84 and lev <= 90 then 
				reward_gold = special.levelup_reward_gold84
				reward_exp = special.levelup_reward_exp84
			end

			n = number(0, 99)

			local i = 0

			for i = 1, table.getn(reward_gold) do
				if n < reward_gold[i][2] then
					pc.change_money(reward_gold[i][1])
					say_reward("Vous avez reçu "..reward_gold[i][1].." Geeklard's.")
					break
				else
					n = n - reward_gold[i][2]
				end
			end

			n = number(0, 99)

			i = 0

			for i = 1, table.getn(reward_exp) do
				if n < reward_exp[i][2] then
					pc.give_exp_perc("level"..lev.."exp", lev, reward_exp[i][1])
					say_reward("Vous avez reçu "..reward_exp[i][1].."% d'expérience.")
					break
				else
					n = n - reward_exp[i][2]
				end
			end
			say("infos1")
		end

		local old_lev = lev

		lev = lev + 1

		if lev > 1 and lev < 91 and pc.level >= lev then
			pc.setqf("buttonstate", 2)
			makequestbutton("Mission "..lev.." - début")
			pc.setqf("current", lev)
			pc.setqf("select", 1)
			pc.setqf("remain",special.levelup_quest[lev][2])
			setskin(NOWINDOW)
			return
		else
			pc.setqf("complete", old_lev)
			pc.setqf("current", 0)
			q.done()
		end

		elseif pc.getqf("buttonstate") == 2 then

			local lev = pc.getqf("current")

			if lev == 0 then
				q.done()
			end

			---                                                   l
			say_title("Mission de chasse:")
			say("Pour votre prochaine mission de chasse vous")
			say("pouvez choisir quel type de monstre vous voulez")
			say("tuer.")

			local sel = select(
				mob_name(special.levelup_quest[lev][1]).." "..special.levelup_quest[lev][2].." nécessaires", 
				mob_name(special.levelup_quest[lev][3]).." "..special.levelup_quest[lev][4].." nécessaires"
			)

			setskin(SCROLL)
			setbgimage('level_bg.tga')
			pc.setqf("select", sel)
			addimage(20, 12, special.levelup_img[special.levelup_quest[lev][sel*2-1]])
			setcolor(0,0,0)

			---                                                   l
			say("")
			say("")
			say("")
			say("Tuez: ", mob_name(special.levelup_quest[lev][sel*2-1])," !")
			say("Nombre de cibles: ", special.levelup_quest[lev][sel*2])
			say("Récompense:")
			raw_script("-"..special.levelup_quest[lev][5].." % d'expérience.[ENTER]")

			if lev <= table.getn(special.levelup_reward1) then
				raw_script("-"..item_name(special.levelup_reward1[lev][pc.job+1]))

			elseif lev> table.getn(special.levelup_reward1) and lev < 26 then
				raw_script("-Un objet aléatoire.")
			end

			if lev>=21 then 
				raw_script("-Des Geeklard's.")
			end

			raw_script(newline)

			levelup.show_mob_pos(lev)

			local s = select("Ok! Allons-y!")

			if s == 1 then
				setskin(NOWINDOW)
				pc.setqf("remain",special.levelup_quest[lev][sel*2])
				syschat("Vous avez accepté le défi de tuer ", special.levelup_quest[lev][sel*2], " ", mob_name(special.levelup_quest[lev][sel*2-1]), ".")
				q.set_title("Tuer des "..mob_name(special.levelup_quest[lev][sel*2-1]))
				q.set_counter("Restant", pc.getqf("remain"))
				q.start()
			end

			setskin(NOWINDOW)
			clearmapsignal()

		elseif pc.getqf("buttonstate") == 1 then

			local s = pc.getqf("select")

			if s == 0 then s = 1 end

				local lev = pc.getqf("current")

				if lev != 0 then
					---                                                   l
					say_title("Mission de chasse:")
					say("Vous devez encore tuer")
					say(""..pc.getqf("remain").." spécimens du type: "..mob_name(special.levelup_quest[lev][s*2-1]))
					say("pour terminer la mission de chasse.")

					local ss = select("Informations sur la mission de chasse", "Continuer")

					if ss == 1 then
						setskin(SCROLL)
						setbgimage('level_bg.tga')
						addimage(20,12,special.levelup_img[special.levelup_quest[lev][s*2-1]])
						setcolor(0,0,0)

						---                                                   l
						say("")
						say("")
						say("")
						say("Tuez: ", mob_name(special.levelup_quest[lev][s*2-1])," !")
						say("Nombre de cibles: ", special.levelup_quest[lev][s*2])
						say("Récompense:")
						raw_script("-"..special.levelup_quest[lev][5].." % d'expérience.[ENTER]")

						if lev <= table.getn(special.levelup_reward1) then
							raw_script("-"..item_name(special.levelup_reward1[lev][pc.job+1]))

						elseif lev> table.getn(special.levelup_reward1) and lev < 26 then
							raw_script("-Un objet aléatoire.")
						end

						if lev>=21 then 
							raw_script("-Des Geeklard's.")
						end

					raw_script(newline)

					select(locale.confirm)
					setskin(NOWINDOW)
					clearmapsignal()
				end

				setskin(NOWINDOW)
				q.set_title("Tuer des "..mob_name(special.levelup_quest[lev][s*2-1]))
				q.set_counter("Restant", pc.getqf("remain"))
				q.start()
			end
		end
		pc.setqf("buttonstate", -1)
	end

	when levelup begin

		local lev = pc.getqf("current");

		if lev == 0 then

			lev = pc.level

			if lev < 2 or lev > 90 then return end

			pc.setqf("buttonstate", 2)
			makequestbutton("Commencez la mission "..lev.."")
			pc.setqf("current", lev)
			pc.setqf("select", 1)
			pc.setqf("remain", special.levelup_quest[lev][2])
			setskin(NOWINDOW)
		end
	end

	when kill begin

		local sel = pc.getqf("select")

		if sel == 0 then
			sel = 1
		end

		local lev = pc.getqf("current")

		if lev != 0 and npc.race == (special.levelup_quest[lev][sel*2-1]) and pc.getqf("buttonstate") == -1 then

			local remain = pc.getqf("remain") - 1

			if remain <= 0 then
				pc.setqf("remain", 0)
				q.set_counter_value(0)
				setskin(NOWINDOW)
				makequestbutton("Mission "..lev.." - terminée")
				pc.setqf("buttonstate", 3)
			else
				pc.setqf("remain", remain)
				q.set_counter_value(remain)
			end
		end
	end

	function show_mob_pos(lev)
		map_index = pc.get_map_index()

		if map_index <= 0 then
			test_chat("show_mob_pos: map_index("..map_index..") < 0")
			return 
		end

		if map_index > table.getn(special.lvq_map) then
			test_chat("show_mob_pos: map_index("..map_index..") > max("..table.getn(special.lvq_map)..")")
			return
		end

		lev_quest_list = special.lvq_map[map_index]

		if not lev_quest_list then
			test_chat("show_mob_pos: special.lvq_map[map_index("..map_index..")] is nil")
			return
		end

		mob_pos_list = lev_quest_list[lev]

		if not mob_pos_list then
			test_chat("show_mob_pos: special.lvq_map[map_index("..map_index..")][lev("..lev..")] is nil")
			return
		end

		table.foreachi(
			mob_pos_list, 
			function (n, mob_pos) 
			test_chat("addmapsignal("..mob_pos[1]..", "..mob_pos[2]..")")
			addmapsignal(mob_pos[1]*100, mob_pos[2]*100) 
		end)
		setmapcenterposition(200, 0)
	end
end
end

 

 

En postant ma demande d'aide, j'affirme avoir lu et accepté le règlement des demandes d'aides.

Link to comment
  • Answers 5
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

5 answers to this question

Recommended Posts

  • 0

Tien je te donne ma quete level up 127 change juste le level que tu veux et le PNJ ^^

 

------------------------------------------------------------------------------------------------

 

quest expseon begin

state start begin

when 20091.chat."Remettre de l'exp" with pc.get_level() < 127 begin

say_title("Seon")

--- l

say_reward("De l'exp ou monter lv. 127 ?")

z = select("De l'exp", "Monter lv. 127", "Quitter")

if z == 3 then

return

end

if z == 2 then

if pc.get_level() <= 70 then

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

pc.give_exp2(pc.get_next_exp())

end

repeat

pc.give_exp2(pc.get_next_exp())

until pc.get_level() == 127

if pc.get_level() < 127 then

say_title("Monter lv.127")

--- l

say_reward("Reclique sur Seon jusqu'à monter level max.")

end

if pc.get_level() == 127 then

say_title("Seon")

say_reward("Tu es maintenant level max (127).")

pc.remove_item(27002, 760)

pc.remove_item(27001, 92)

end

end

if z == 1 then

if pc.get_level() >= 126 then

say_title("Seon")

say_reward("Vous ne pouvez plus avoir d'exp.")

else

pc.give_exp2(1050000000)

pc.remove_item(27002, 754)

pc.remove_item(27001, 78)

end

end

end

end

Link to comment
  • 0
  • Bot

Si tu veux modifier les récompenses c'est à faire dans le questlib.lua à ces lignes

special.levelup_quest 
special.levelup_reward3
special.levelup_reward_gold21
special.levelup_reward_gold31
special.levelup_reward_gold41
special.levelup_reward_gold51
special.levelup_reward_exp21
special.levelup_reward_exp31
special.levelup_reward_exp41
special.levelup_reward_exp51
special.levelup_reward_item_21

  • J'adore 1

090100logo.png 090149logo-4-bis.png

Link to comment


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.