Jump to content
  • 0

open 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

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
  • Love 2
Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



Shoutbox

Shoutbox

Chatroom Rules

 

Join our Discord

A request for help = Shoutbox Ban

Be respectful & Respect the rules

 

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