Skip to content

Commit

Permalink
feat: mystery box
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Nov 6, 2024
1 parent a2262f9 commit 8287bc5
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions data/scripts/actions/items/mystery_box.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
local mysteryBox = Action()

function mysteryBox.onUse(player, item, fromPosition, target, toPosition, isHotkey)
local items = { 25361, 25360 }
local randomItem = items[math.random(#items)]
player:addItem(randomItem, 1)
player:getPosition():sendMagicEffect(CONST_ME_MAGIC_BLUE)
item:remove(1)
return true
end

mysteryBox:id(26186)
mysteryBox:register()

0 comments on commit 8287bc5

Please sign in to comment.