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
Share on other sites

  • 2 years later...
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
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
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
Share on other sites

  • Premium
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
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
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
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
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.