Jump to content
  • 0

Metin2 Exp bomb quest


ZiuZitsu

Question

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

  • Answers 8
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

8 answers to this question

Recommended Posts

  • 0
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

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


  • Activity

    1. 45

      Official Pickup Slot Effect [REVERSED]

    2. 0

      damage from int to long long

    3. 22

      Green & Purple Potions Effect

    4. 12

      When Uninstalling Gaya System

    5. 12

      When Uninstalling Gaya System

    6. 12

      When Uninstalling Gaya System

    7. 12

      When Uninstalling Gaya System

    8. 12

      When Uninstalling Gaya System

  • Recently Browsing

    • No registered users viewing this page.
×
×
  • 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.