Jump to content

Recommended Posts

  • Premium

quest drob begin
    state start begin
      when xxx.kill begin
        local s = number(1, 100)
        if s <= 10 then
              game.drop_item(item)--item
            end
        end
    end
end
 
  • Love 1

If you're going to do something, then do it right.

Link to comment
https://metin2.dev/topic/3325-quest-drop-item/#findComment-21935
Share on other sites

  • 2 years later...
On 02.11.2016 at 8:44 PM, myenglishisbad said:

how to do if mob level is + 20 then player, and not drop

Try with that:

if npc.get_level() - pc.get_level() > 20 then
	syschat(string.format("<Debug Mode> QUEST name -> [tch = %d] | [ch = %d].", npc.get_level(), pc.get_level()))
	return 
end
Link to comment
https://metin2.dev/topic/3325-quest-drop-item/#findComment-78918
Share on other sites

21 minutes ago, myenglishisbad said:

didn´t work

Or maybe i'm not understand what you say? But here is a gif with test:

b1e7b298b5d473fa8d6c1204115205ac.gif

 

quest drop_test begin
	state start begin
		when kill begin
			if npc.get_level() - pc.get_level() > 20 then
				syschat(string.format("<Debug Mode> QUEST name -> [Mob = %d] | [You = %d]. The limit is greater than 20.", npc.get_level(), pc.get_level()))
				return 
			end
		end
	end
end

 

Edited by Metin2 Dev
Core X - External 2 Internal
Link to comment
https://metin2.dev/topic/3325-quest-drop-item/#findComment-78963
Share on other sites

  • Active Member
21 hours ago, VegaS said:

Try with that:


if npc.get_level() - pc.get_level() > 20 then
	syschat(string.format("<Debug Mode> QUEST name -> [tch = %d] | [ch = %d].", npc.get_level(), pc.get_level()))
	return 
end

Genius, use math.abs(npc.get_level() - pc.get_level())

if u have 20-40 = -20 ?

or condition like this:

local mLevel = pc.get_level()

local tLevel = npc.get_level()

 

if tLevel >= mLevel then

-- do something(only if target level is greater or equal with your level)

end

Link to comment
https://metin2.dev/topic/3325-quest-drop-item/#findComment-78965
Share on other sites

this is my quest

 

quest drop begin
	state start begin
		when kill begin
		
			local cav = npc.get_level() - pc.get_level()
			if cav > 20	then
				return
				
			else
				local number = number(1,100)
					if number <= 8 then
						game.drop_item_with_ownership(25040,1)
						syschat(string.format("Level do Mob %d",npc.get_level()))
					end
			end
		end
	end
end

this should explain, better, but when i kill moob with lv 120 and moob´s lv is 1 he drops

Link to comment
https://metin2.dev/topic/3325-quest-drop-item/#findComment-78966
Share on other sites

  • Honorable Member
2 minutes ago, Exygo said:

Genius, use math.abs(npc.get_level() - pc.get_level())

if u have 20-40 = -20 ?

..

 

"Nothing's free in this life.

Ignorant people have an obligation to make up for their ignorance by paying those who help them.

Either you got the brains or cash, if you lack both you're useless."

Syreldar

Link to comment
https://metin2.dev/topic/3325-quest-drop-item/#findComment-78968
Share on other sites

  • Active Member
3 minutes ago, myenglishisbad said:

yes you are right, hadn´t thought about that, but how I fix

I edited my previous post, maybe that helps better

Link to comment
https://metin2.dev/topic/3325-quest-drop-item/#findComment-78970
Share on other sites

Thank you guys i have resolved the quest, the quest stayed that :

 

quest drop begin
	state start begin
		when kill begin
		
			local cav = pc.get_level() - npc.get_level()
			if cav > 20	then
				return
				
			else
				local number = number(1,100)
					if number <= 8 then
						game.drop_item_with_ownership(25040,1)
						syschat(string.format("Level do Mob %d",npc.get_level()))
					end
			end
		end
	end
end

 

Link to comment
https://metin2.dev/topic/3325-quest-drop-item/#findComment-78971
Share on other sites

  • Active Member
quest drop begin
    state start begin
        when kill begin
            if math.abs(pc.get_level()-npc.get_level()) < 20 then
                -- you got drop
            end
        end
    end
end
Link to comment
https://metin2.dev/topic/3325-quest-drop-item/#findComment-78972
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • 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.