Jump to content

Metin2 Exp bomb quest


Recommended Posts

Hello guys , when i was playing Shyper metin2 (now it's offline) it was a quest for exp bomb that was giving level when i was killing a metin . For example i could get exp only from 90lvl metin when i was 90lvl , when i was killing a metin for my level it was a message if i want a level. If you can help me please write down the quest.Thanks a lot for help :) 

Link to comment
Share on other sites

  • Replies 8
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

quest exp_bomb begin
	state start begin
		function get_level(vnum)
			local a = mysql_query("SELECT level FROM player.mob_proto WHERE vnum="..vnum)
			return a.level[1]
		end
		when kill with not npc.is_pc() begin
			local metin_id = {8001,8002} -- metin ids here
			for i = 1,table.getn(metin_id) do
				if metin_id[i] == npc.get_race() then
					if pc.get_level() == exp_bomb.get_level(npc.get_race()) then
						say("Do you want the level?")
						if select("Yes","No") == 1 then pc.give_exp2(pc.get_next_exp()) end
					end
				end
			end
		end
	end
end

If you don't want to use mysql_query every time you're killing a monster, generate a list with the level from all monsters with this script:

<?php
mysql_connect('ip', 'user', 'pw');
$query = mysql_query("select * from player.mob_proto");
$file = fopen("level_tables.lua","a");
fwrite($file,"function get_mob_level(vnum)ntlocal level_tables = {n");
while ($sqldata = mysql_fetch_array($query)) {
    fwrite($file,"tt[".$sqldata['vnum']."] = ".$sqldata['level'].",n");
}
fwrite($file,"t}ntreturn level_tables[vnum]nend");
?>

After you ran this script in your webserver or even at xampp/wampp.

 

Move the file level_tables.lua to your ../quest folder at ftp, open locale.lua and write this line wherever you want:

dofile(get_locale_base_path().. "/quest/level_tables.lua")

Next go to quest_functions and add this:

get_mob_level

Finally use this quest:

quest exp_bomb begin
	state start begin
		when kill with not npc.is_pc() begin
			local metin_id = {8001,8002} -- metin ids here
			for i = 1,table.getn(metin_id) do
				if metin_id[i] == npc.get_race() then
					if pc.get_level() == get_mob_level(npc.get_race()) then
						say("Do you want the level?")
						if select("Yes","No") == 1 then pc.give_exp2(pc.get_next_exp()) end
					end
				end
			end
		end
	end
end
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.