Register for your free account! | Forgot your password?

You last visited: Today at 05:13

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



World of Metin2 box drop event

Discussion on World of Metin2 box drop event within the Metin2 PServer Guides & Strategies forum part of the Metin2 Private Server category.

Reply
 
Old   #1
 
elite*gold: 11
Join Date: Nov 2010
Posts: 1,709
Received Thanks: 3,828
World of Metin2 box drop event

Hello everyone,

A long time ago, we were faced with a problem with the box drop events such as Moonlight Box which have, by default, a fixed drop rate. While some players could only collect 2 or 3 boxes, others could get hundreds if they farmed at the appropiate place.

To solve this unequality and make it more fair for everyone, we made each player have a personal drop rate which is lowered every time you drop the event item. This rate is reset every time you run the event. Here is the code for 2 events, Hexagonal Box and Moonlight Box.

Code:
quest drop_event begin
	state start begin
		when login with game.get_event_flag("drop_event") > 0 begin
			
			local level = pc.get_level()
			if game.get_event_flag("drop_event") == 1 then
				pc.setqf("rate",50-math.floor(level/4))
				set_state(moon)
			elseif game.get_event_flag("drop_event") == 2 then
				pc.setqf("rate",70-math.floor(level/4))
				set_state(hex)				
			end
		end
	end

	state moon begin
		when letter begin
			send_letter("Moonlight Treasures")	
		end
		when button or info begin
			say("Hello young hero!")
			say("")
			say("Today the moon is shining in its brightest form. And that's")
			say("because it is full moon today.")
			say("")
			say("On this special day, you can obtain Moonlight Boxes from")
			say("every monster you hunt.")
			say("")
			say_reward("Enjoy the full moon and the treasure it holds for you!")
			say("")
		end
			
		when kill begin
			if game.get_event_flag("drop_event") == 1 then
				local level = pc.get_level()
				local rate = pc.getqf("rate")
				local limit = tonumber(get_mob_level[npc.get_race()])
				if level < limit+11 then
					local drop = number(1,rate)
					if drop == 1 then
						pc.setqf("rate",rate+3)
						game.drop_item_with_ownership(50011)
					end
				end
			else
				set_state(start)
			end
		end
	end
	state hex begin
		when letter begin
			send_letter("Hexagonal Box")	
		end
		when button or info begin
			say("One of the traditions in Chinese New year is the gifting")
			say("and the wishes of good fortune. In Chinese culture, the")
			say("six sides of the Hexagonal Box represent these wishes.")
			say("")
			say_reward("Collect Hexagonal Boxes from any monster! Hexagonal")
			say_reward("boxes contain a random upgrade material.")
			say("")
		end
			
		when kill begin
			if game.get_event_flag("drop_event") == 2 then
				local level = pc.get_level()
				local rate = pc.getqf("rate")
				local limit = tonumber(get_mob_level[npc.get_race()])
				if level < limit+11 then
					local drop = number(1,rate)
					if drop == 1 then
						pc.setqf("rate",rate+2)
						game.drop_item_with_ownership(50037)
					end
				end
			else
				set_state(start)
			end
		end
	end
end


Thanks to musicinstructor and tim for the help as usual =)
.Shōgun is offline  
Thanks
10 Users
Old 05/03/2013, 08:36   #2
 
Prince43™'s Avatar
 
elite*gold: 0
Join Date: Jan 2013
Posts: 489
Received Thanks: 496
Nice quest but epvp have some of quests like this. well done i think any peoples will or need it


Kind Regards

Prince43™
Prince43™ is offline  
Old 05/03/2013, 10:29   #3
 
MrLibya's Avatar
 
elite*gold: 30
Join Date: Mar 2012
Posts: 517
Received Thanks: 339
Nice Man
I Was Really Need It
Thx

MrLibya is offline  
Thanks
1 User
Old 05/03/2013, 13:10   #4
 
.RazerX's Avatar
 
elite*gold: 0
Join Date: Mar 2013
Posts: 188
Received Thanks: 149
Very good realy!
Thanks for sharing!
.RazerX is offline  
Reply




All times are GMT +2. The time now is 05:13.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.