avertuss 48 Posted June 7, 2020 Share Posted June 7, 2020 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 comment Share on other sites More sharing options...
Contributor TMP4 10998 Posted June 7, 2020 Contributor Share Posted June 7, 2020 (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 June 7, 2020 by TMP4 2 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now