Jump to content
  • Register Now

    Sign up and take advantage of the features of our community! Some forums are only accessible to our members!

  • 0

Drop items from table but remove that item when someone droped


avertuss

Question

Hi. Someone knows how to make quest with drop few items from table but when somebody droped item no one can drop the same item. I mean i have table with items id 19, 29, 39, 49, 59 when somebody drop item with id 29 nobody else can drop that item. 

Link to post

1 answer to this question

Recommended Posts

  • 0
Posted (edited)

I don't reccomend to open a text file every time and delete from it, we have eventflags for that.

quest m2dev begin
    state start begin
        when 101.kill begin
             if get_game.get_event_flag("drop1") == 0 and math.random(100) >= 50 then
                 game.drop_item_with_ownership(19, 1)
                 game.set_event_flag("drop1", 1)
             end
             if get_game.get_event_flag("drop2") == 0 and math.random(100) >= 50 then
                 game.drop_item_with_ownership(149, 1)
                 game.set_event_flag("drop2", 1)
            end
            if get_game.get_event_flag("drop3") == 0 and math.random(100) >= 50 then
                 game.drop_item_with_ownership(279, 1)
                 game.set_event_flag("drop3", 1)
            end
        end
    end
end

math.random(100) >= 50 <-- This is the chance, so it will generate a number up to 100 and if it 50 or greater, it will drop. So basicly 50% chance.

 

If you want re-enable a drop, write "/e drop1 0" with a GM character for re-enabling drop1.

You can re-enable with a quest too game.set_event_flag("drop1", 0)

Edited by TMP4 (see edit history)
  • Love 2
Link to post

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


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