From 0782f68209db401ed485f95145a0a6b6370578b9 Mon Sep 17 00:00:00 2001 From: Luan Luciano Date: Sun, 3 Dec 2023 23:43:54 -0300 Subject: [PATCH 1/2] update --- .../actions/other/unrealized_dream.lua | 102 ------------------ .../actions/valuables/random_items.lua | 27 +++++ 2 files changed, 27 insertions(+), 102 deletions(-) delete mode 100644 data-otservbr-global/scripts/actions/other/unrealized_dream.lua diff --git a/data-otservbr-global/scripts/actions/other/unrealized_dream.lua b/data-otservbr-global/scripts/actions/other/unrealized_dream.lua deleted file mode 100644 index 6b4f7398bef..00000000000 --- a/data-otservbr-global/scripts/actions/other/unrealized_dream.lua +++ /dev/null @@ -1,102 +0,0 @@ -local unrealizedDream = Action() - -function unrealizedDream.onUse(cid, item, frompos, item2, topos) - presente = math.random(1, 22) - pos = getPlayerPosition(cid) - - --surpriese bag-- - if presente == 1 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 12548, 1) -- Bag of Apple Slices - doRemoveItem(item.uid, 1) - elseif presente == 2 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 20275, 1) -- Dream Warden Claw - doRemoveItem(item.uid, 1) - elseif presente == 3 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 3242, 1) -- Stuffed Bunny - doRemoveItem(item.uid, 1) - elseif presente == 4 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 5929, 1) -- Goldfish Bowl - doRemoveItem(item.uid, 1) - elseif presente == 5 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 5792, 1) -- Dice - doRemoveItem(item.uid, 1) - elseif presente == 6 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 3577, 1) -- Meat - doRemoveItem(item.uid, 1) - elseif presente == 7 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 3004, 1) -- Wedding Ring - doRemoveItem(item.uid, 1) - elseif presente == 8 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 3463, 1) -- Mirror - doRemoveItem(item.uid, 1) - elseif presente == 9 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 7459, 1) -- Pair of Earmuffs - doRemoveItem(item.uid, 1) - elseif presente == 10 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 2992, 1) -- Snowball - doRemoveItem(item.uid, 1) - elseif presente == 11 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 3108, 1) -- Rubbish - doRemoveItem(item.uid, 1) - elseif presente == 12 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 2995, 1) -- Piggy Bank - doRemoveItem(item.uid, 1) - elseif presente == 13 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 3568, 1) -- Simple Dress - doRemoveItem(item.uid, 1) - elseif presente == 14 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 2856, 1) -- Present - doRemoveItem(item.uid, 1) - elseif presente == 15 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 3659, 1) -- Blue Rose - doRemoveItem(item.uid, 1) - elseif presente == 16 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 2950, 1) -- Lute - doRemoveItem(item.uid, 1) - elseif presente == 17 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 20272, 1) -- Bronze Prison Key - doRemoveItem(item.uid, 1) - elseif presente == 18 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 20270, 1) -- Silver Prison Key - doRemoveItem(item.uid, 1) - elseif presente == 19 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 20273, 1) -- Golden Prison Key - doRemoveItem(item.uid, 1) - elseif presente == 20 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 20062, 1) -- Cluster of Solace - doRemoveItem(item.uid, 1) - elseif presente == 21 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 651, 1) -- Spellwand - doRemoveItem(item.uid, 1) - elseif presente == 22 then - doSendMagicEffect(pos, 26) - doPlayerAddItem(cid, 20271, 1) -- Copper Prision Key - doRemoveItem(item.uid, 1) - end - - return 1 -end - -unrealizedDream:id(20264) -unrealizedDream:register() diff --git a/data-otservbr-global/scripts/actions/valuables/random_items.lua b/data-otservbr-global/scripts/actions/valuables/random_items.lua index c012c549a44..a0744a7b19a 100644 --- a/data-otservbr-global/scripts/actions/valuables/random_items.lua +++ b/data-otservbr-global/scripts/actions/valuables/random_items.lua @@ -76,6 +76,33 @@ local config = { }, effect = CONST_ME_CRAPS, }, + [20264] = { -- unrealized dream + chances = { + { from = 1, to = 1081, itemId = 3108 }, -- Rubbish (10.81%) + { from = 1082, to = 2125, itemId = 2992 }, -- Snowball (10.44%) + { from = 2126, to = 3109, itemId = 5792 }, -- Die (9.83%) + { from = 3110, to = 4074, itemId = 2856 }, -- Present (9.64%) + { from = 4075, to = 5039, itemId = 3659 }, -- Blue Rose (9.64%) + { from = 5040, to = 6007, itemId = 3568 }, -- Simple Dress (9.67%) + { from = 6008, to = 6969, itemId = 3463 }, -- Mirror (9.61%) + { from = 6970, to = 7457, itemId = 2995 }, -- Piggy Bank (4.87%) + { from = 7458, to = 7945, itemId = 2950 }, -- Lute (4.87%) + { from = 7946, to = 8268, itemId = 651 }, -- Spellwand (4.22%) + { from = 8269, to = 8659, itemId = 5929 }, -- Goldfish Bowl (3.90%) + { from = 8660, to = 8984, itemId = 3577 }, -- Meat (3.24%) + { from = 8985, to = 9192, itemId = 20271 }, -- Copper Prision Key (2.07%) + { from = 9193, to = 9396, itemId = 20272 }, -- Bronze Prison Key (2.03%) + { from = 9397, to = 9588, itemId = 20270 }, -- Silver Prison Key (1.91%) + { from = 9589, to = 9719, itemId = 20062 }, -- Cluster of Solace (1.30%) + { from = 9720, to = 9780, itemId = 3004 }, -- Wedding Ring (0.60%) + { from = 9781, to = 9842, itemId = 7459 }, -- Pair of Earmuffs (0.61%) + { from = 9843, to = 9894, itemId = 20275 }, -- Dream Warden Claw (0.51%) + { from = 9895, to = 9946, itemId = 20273 }, -- Golden Prison Key (0.51%) + { from = 9947, to = 9987, itemId = 3242}, -- Stuffed Bunny (0.40%) + { from = 9988, to = 10001, itemId = 12548 }, -- Bag of Apple Slices (0.13%) + }, + effect = CONST_ME_BUBBLES, + }, [22763] = { -- shaggy ogre bag chances = { { from = 1, to = 1440, itemId = 22187, count = 5 }, From b897929c387278fa452a2f2ebcb1ff967383c8bf Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 4 Dec 2023 02:44:28 +0000 Subject: [PATCH 2/2] Lua code format - (Stylua) --- data-otservbr-global/scripts/actions/valuables/random_items.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data-otservbr-global/scripts/actions/valuables/random_items.lua b/data-otservbr-global/scripts/actions/valuables/random_items.lua index a0744a7b19a..f91dcf4f15a 100644 --- a/data-otservbr-global/scripts/actions/valuables/random_items.lua +++ b/data-otservbr-global/scripts/actions/valuables/random_items.lua @@ -98,7 +98,7 @@ local config = { { from = 9781, to = 9842, itemId = 7459 }, -- Pair of Earmuffs (0.61%) { from = 9843, to = 9894, itemId = 20275 }, -- Dream Warden Claw (0.51%) { from = 9895, to = 9946, itemId = 20273 }, -- Golden Prison Key (0.51%) - { from = 9947, to = 9987, itemId = 3242}, -- Stuffed Bunny (0.40%) + { from = 9947, to = 9987, itemId = 3242 }, -- Stuffed Bunny (0.40%) { from = 9988, to = 10001, itemId = 12548 }, -- Bag of Apple Slices (0.13%) }, effect = CONST_ME_BUBBLES,