Skip to content

Commit

Permalink
formatting files
Browse files Browse the repository at this point in the history
  • Loading branch information
omarcopires committed Jul 24, 2024
1 parent 4aa16d0 commit 8fa5c79
Show file tree
Hide file tree
Showing 271 changed files with 12,538 additions and 4,881 deletions.
79 changes: 65 additions & 14 deletions data/actions/lib/actions.lua
Original file line number Diff line number Diff line change
@@ -1,20 +1,71 @@
local wildGrowth = {1499, 11099} -- wild growth destroyable by machete
local wildGrowth = { 1499, 11099 } -- wild growth destroyable by machete
local jungleGrass = { -- grass destroyable by machete
[2782] = 2781,
[3985] = 3984,
[19433] = 19431
[19433] = 19431,
}
local groundIds = {354, 355} -- pick usable ground
local sandIds = {231, 9059} -- desert sand
local groundIds = { 354, 355 } -- pick usable ground
local sandIds = { 231, 9059 } -- desert sand
local holeId = { -- usable rope holes, for rope spots see global.lua
294, 369, 370, 383, 392, 408, 409, 410, 427, 428, 429, 430, 462, 469, 470, 482,
484, 485, 489, 924, 1369, 3135, 3136, 4835, 4837, 7933, 7938, 8170, 8249, 8250,
8251, 8252, 8254, 8255, 8256, 8276, 8277, 8279, 8281, 8284, 8285, 8286, 8323,
8567, 8585, 8595, 8596, 8972, 9606, 9625, 13190, 14461, 19519, 21536, 23713,
26020
294,
369,
370,
383,
392,
408,
409,
410,
427,
428,
429,
430,
462,
469,
470,
482,
484,
485,
489,
924,
1369,
3135,
3136,
4835,
4837,
7933,
7938,
8170,
8249,
8250,
8251,
8252,
8254,
8255,
8256,
8276,
8277,
8279,
8281,
8284,
8285,
8286,
8323,
8567,
8585,
8595,
8596,
8972,
9606,
9625,
13190,
14461,
19519,
21536,
23713,
26020,
}
local holes = {468, 481, 483, 23712} -- holes opened by shovel
local fruits = {2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2684, 2685, 5097, 8839, 8840, 8841} -- fruits to make decorated cake with knife
local holes = { 468, 481, 483, 23712 } -- holes opened by shovel
local fruits = { 2673, 2674, 2675, 2676, 2677, 2678, 2679, 2680, 2681, 2682, 2684, 2685, 5097, 8839, 8840, 8841 } -- fruits to make decorated cake with knife

function destroyItem(player, target, toPosition)
if type(target) ~= "userdata" or not target:isItem() then
Expand Down Expand Up @@ -240,7 +291,7 @@ function onUseShovel(player, item, fromPosition, target, toPosition, isHotkey)
end

function onUseScythe(player, item, fromPosition, target, toPosition, isHotkey)
if not table.contains({2550, 10513}, item.itemid) then
if not table.contains({ 2550, 10513 }, item.itemid) then
return false
end

Expand All @@ -262,15 +313,15 @@ function onUseScythe(player, item, fromPosition, target, toPosition, isHotkey)
end

function onUseCrowbar(player, item, fromPosition, target, toPosition, isHotkey)
if not table.contains({2416, 10515}, item.itemid) then
if not table.contains({ 2416, 10515 }, item.itemid) then
return false
end

return destroyItem(player, target, toPosition)
end

function onUseKitchenKnife(player, item, fromPosition, target, toPosition, isHotkey)
if not table.contains({2566, 10511, 10515}, item.itemid) then
if not table.contains({ 2566, 10511, 10515 }, item.itemid) then
return false
end

Expand Down
14 changes: 7 additions & 7 deletions data/actions/scripts/others/bed_modification_kits.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
local beds = {
[7904] = {{7811, 7812}, {7813, 7814}}, -- green kit
[7905] = {{7819, 7820}, {7821, 7822}}, -- yellow kit
[7906] = {{7815, 7816}, {7817, 7818}}, -- red kit
[7907] = {{1754, 1755}, {1760, 1761}}, -- removal kit
[20252] = {{20197, 20198}, {20199, 20200}} -- canopy kit
[7904] = { { 7811, 7812 }, { 7813, 7814 } }, -- green kit
[7905] = { { 7819, 7820 }, { 7821, 7822 } }, -- yellow kit
[7906] = { { 7815, 7816 }, { 7817, 7818 } }, -- red kit
[7907] = { { 1754, 1755 }, { 1760, 1761 } }, -- removal kit
[20252] = { { 20197, 20198 }, { 20199, 20200 } }, -- canopy kit
}

local function internalBedTransform(item, targetItem, toPosition, itemArray)
Expand Down Expand Up @@ -34,12 +34,12 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey)
end

for _, bed in pairs(beds) do
if bed[1][1] == targetItemId or table.contains({1758, 5502, 18027}, targetItemId) then
if bed[1][1] == targetItemId or table.contains({ 1758, 5502, 18027 }, targetItemId) then
toPosition:sendMagicEffect(CONST_ME_POFF)
toPosition.y = toPosition.y + 1
internalBedTransform(item, target, toPosition, newBed[1])
break
elseif bed[2][1] == targetItemId or table.contains({1756, 5500, 18029}, targetItemId) then
elseif bed[2][1] == targetItemId or table.contains({ 1756, 5500, 18029 }, targetItemId) then
toPosition:sendMagicEffect(CONST_ME_POFF)
toPosition.x = toPosition.x + 1
internalBedTransform(item, target, toPosition, newBed[2])
Expand Down
70 changes: 58 additions & 12 deletions data/actions/scripts/others/construction_kits.lua
Original file line number Diff line number Diff line change
@@ -1,16 +1,62 @@
local constructionKits = {
[3901] = 1666, [3902] = 1670, [3903] = 1652, [3904] = 1674, [3905] = 1658,
[3906] = 3813, [3907] = 3817, [3908] = 1619, [3909] = 2105, [3910] = 12799,
[3911] = 1614, [3912] = 3806, [3913] = 3807, [3914] = 3809, [3915] = 1716,
[3916] = 1724, [3917] = 1732, [3918] = 1775, [3919] = 1774, [3920] = 1750,
[3921] = 3832, [3922] = 2095, [3923] = 2098, [3924] = 2064, [3925] = 2582,
[3926] = 2117, [3927] = 1728, [3928] = 1442, [3929] = 1446, [3930] = 1447,
[3931] = 2034, [3932] = 2604, [3933] = 2080, [3934] = 2084, [3935] = 3821,
[3936] = 3811, [3937] = 2101, [3938] = 3812, [5086] = 5046, [5087] = 5055,
[5088] = 5056, [6114] = 6111, [6115] = 6109, [6372] = 6356, [6373] = 6371,
[8692] = 8688, [9974] = 9975, [11126] = 11127, [11133] = 11129, [11124] = 11125,
[11205] = 11203, [14328] = 1616, [14329] = 1615, [16075] = 16020, [16099] = 16098,
[20254] = 20295, [20255] = 20297, [20257] = 20299
[3901] = 1666,
[3902] = 1670,
[3903] = 1652,
[3904] = 1674,
[3905] = 1658,
[3906] = 3813,
[3907] = 3817,
[3908] = 1619,
[3909] = 2105,
[3910] = 12799,
[3911] = 1614,
[3912] = 3806,
[3913] = 3807,
[3914] = 3809,
[3915] = 1716,
[3916] = 1724,
[3917] = 1732,
[3918] = 1775,
[3919] = 1774,
[3920] = 1750,
[3921] = 3832,
[3922] = 2095,
[3923] = 2098,
[3924] = 2064,
[3925] = 2582,
[3926] = 2117,
[3927] = 1728,
[3928] = 1442,
[3929] = 1446,
[3930] = 1447,
[3931] = 2034,
[3932] = 2604,
[3933] = 2080,
[3934] = 2084,
[3935] = 3821,
[3936] = 3811,
[3937] = 2101,
[3938] = 3812,
[5086] = 5046,
[5087] = 5055,
[5088] = 5056,
[6114] = 6111,
[6115] = 6109,
[6372] = 6356,
[6373] = 6371,
[8692] = 8688,
[9974] = 9975,
[11126] = 11127,
[11133] = 11129,
[11124] = 11125,
[11205] = 11203,
[14328] = 1616,
[14329] = 1615,
[16075] = 16020,
[16099] = 16098,
[20254] = 20295,
[20255] = 20297,
[20257] = 20299,
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
Expand Down
4 changes: 2 additions & 2 deletions data/actions/scripts/others/create_bread.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local liquidContainers = {1775, 2005, 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015, 2023, 2031, 2032, 2033}
local millstones = {1381, 1382, 1383, 1384}
local liquidContainers = { 1775, 2005, 2006, 2007, 2008, 2009, 2011, 2012, 2013, 2014, 2015, 2023, 2031, 2032, 2033 }
local millstones = { 1381, 1382, 1383, 1384 }

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
local itemId = item:getId()
Expand Down
32 changes: 21 additions & 11 deletions data/actions/scripts/others/decayto.lua
Original file line number Diff line number Diff line change
@@ -1,19 +1,29 @@
local decayItems = {
[1873] = 1874, [1874] = 1873, -- cuckoo clock
[1875] = 1876, [1876] = 1875, -- cuckoo clock
[2041] = 2042, [2042] = 2041, -- candelabrum
[2044] = 2045, [2045] = 2044, -- lamp
[2047] = 2048, [2048] = 2047, -- candlestick
[2050] = 2051, [2051] = 2050, -- torch
[2052] = 2053, [2053] = 2052, -- torch
[2054] = 2055, [2055] = 2054, -- torch
[2162] = 2163, [2163] = 2162, -- magic light wand
[5812] = 5813, [5813] = 5812, -- skull candle
[1873] = 1874,
[1874] = 1873, -- cuckoo clock
[1875] = 1876,
[1876] = 1875, -- cuckoo clock
[2041] = 2042,
[2042] = 2041, -- candelabrum
[2044] = 2045,
[2045] = 2044, -- lamp
[2047] = 2048,
[2048] = 2047, -- candlestick
[2050] = 2051,
[2051] = 2050, -- torch
[2052] = 2053,
[2053] = 2052, -- torch
[2054] = 2055,
[2055] = 2054, -- torch
[2162] = 2163,
[2163] = 2162, -- magic light wand
[5812] = 5813,
[5813] = 5812, -- skull candle
[7183] = 7184, -- baby seal doll
[10719] = 10720, -- friendship amulet
[11401] = 11402, -- Tibiora's box
[25545] = 25546, -- shield of destiny
[26098] = 26099 -- baby dragon
[26098] = 26099, -- baby dragon
}

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
Expand Down
10 changes: 8 additions & 2 deletions data/actions/scripts/others/die.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local depotTiles = {11062, 11063}
local depotTiles = { 11062, 11063 }
local diceEnabledOnDepot = true

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
Expand All @@ -17,7 +17,13 @@ function onUse(player, item, fromPosition, target, toPosition, isHotkey)

local spectators = Game.getSpectators(position, false, true, 3, 3)
for _, spectator in ipairs(spectators) do
player:say(player:getName() .. " rolled a " .. value .. ".", TALKTYPE_MONSTER_SAY, isInGhostMode, spectator, position)
player:say(
player:getName() .. " rolled a " .. value .. ".",
TALKTYPE_MONSTER_SAY,
isInGhostMode,
spectator,
position
)
end

item:transform(5791 + value)
Expand Down
Loading

0 comments on commit 8fa5c79

Please sign in to comment.