Skip to content

Commit 9cad1e0

Browse files
authored
Merge pull request #10010 from sruon/mmm
[core, lua, sql] MMM unlocks scripts, DB persist and packet
2 parents 539be9f + e9ea19f commit 9cad1e0

129 files changed

Lines changed: 2537 additions & 113 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

scripts/enum/msg.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ xi.msg.basic =
329329
STATUS_INCREASED = 562, -- The status parameters of <target> have increased.
330330
FOV_OBTAINS_GIL = 565, -- <target> obtains <gil>.
331331
FOV_OBTAINS_TABS = 566, -- <target> obtains <number> tab.<br>(Total: <number>)
332+
MMM_STOWED_AWAY = 567, -- <target> stowed away a <item> in his tattered Maze Monger pouch.
332333
STATUS_PREVENTS = 569, -- Your current status prevents you from using that ability.
333334
MAGIC_REMOVE_EFFECT_2 = 571, -- <number> of <target>'s status ailments disappear!
334335
MAGIC_ABSORB_AILMENT = 572, -- <caster> casts <spell>. <caster> absorbs <number> of <target>'s status ailments.

scripts/globals/moblin_maze_mongers/mmm_utils.lua

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,41 @@ xi.mmm.calculateCCPoints = function(player)
2424

2525
return ccPoints
2626
end
27+
28+
xi.mmm.onVoucherCheck = function(target, item)
29+
local voucherId = item:getID() - xi.item.MAZE_VOUCHER_01 + 1
30+
31+
if target:hasMazeVoucher(voucherId) then
32+
return xi.msg.basic.ITEM_UNABLE_TO_USE
33+
end
34+
35+
return 0
36+
end
37+
38+
xi.mmm.onVoucherUse = function(target, item, action)
39+
local voucherId = item:getID() - xi.item.MAZE_VOUCHER_01 + 1
40+
41+
target:learnMazeVoucher(voucherId)
42+
action:messageID(target:getID(), xi.msg.basic.MMM_STOWED_AWAY)
43+
44+
return item:getID()
45+
end
46+
47+
xi.mmm.onRuneCheck = function(target, item)
48+
local runeId = item:getID() - xi.item.MAZE_RUNE_001 + 1
49+
50+
if target:hasMazeRune(runeId) then
51+
return xi.msg.basic.ITEM_UNABLE_TO_USE
52+
end
53+
54+
return 0
55+
end
56+
57+
xi.mmm.onRuneUse = function(target, item, action)
58+
local runeId = item:getID() - xi.item.MAZE_RUNE_001 + 1
59+
60+
target:learnMazeRune(runeId)
61+
action:messageID(target:getID(), xi.msg.basic.MMM_STOWED_AWAY)
62+
63+
return item:getID()
64+
end

scripts/items/maze_rune_001.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-----------------------------------
2+
-- ID: 28800
3+
-- Maze Rune 001
4+
-- A small stone engraved with a runic symbol, shaped to fit in the notches of a Maze Tabula.
5+
-- The rune reads "Aquan."
6+
-----------------------------------
7+
---@type TItem
8+
local itemObject = {}
9+
10+
itemObject.onItemCheck = function(target, item, param, caster)
11+
return xi.mmm.onRuneCheck(target, item)
12+
end
13+
14+
itemObject.onItemUse = function(target, user, item, action)
15+
return xi.mmm.onRuneUse(target, item, action)
16+
end
17+
18+
return itemObject

scripts/items/maze_rune_002.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-----------------------------------
2+
-- ID: 28801
3+
-- Maze Rune 002
4+
-- A small stone engraved with a runic symbol, shaped to fit in the notches of a Maze Tabula.
5+
-- The rune reads "Amorph."
6+
-----------------------------------
7+
---@type TItem
8+
local itemObject = {}
9+
10+
itemObject.onItemCheck = function(target, item, param, caster)
11+
return xi.mmm.onRuneCheck(target, item)
12+
end
13+
14+
itemObject.onItemUse = function(target, user, item, action)
15+
return xi.mmm.onRuneUse(target, item, action)
16+
end
17+
18+
return itemObject

scripts/items/maze_rune_003.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-----------------------------------
2+
-- ID: 28802
3+
-- Maze Rune 003
4+
-- A small stone engraved with a runic symbol, shaped to fit in the notches of a Maze Tabula.
5+
-- The rune reads "Bird."
6+
-----------------------------------
7+
---@type TItem
8+
local itemObject = {}
9+
10+
itemObject.onItemCheck = function(target, item, param, caster)
11+
return xi.mmm.onRuneCheck(target, item)
12+
end
13+
14+
itemObject.onItemUse = function(target, user, item, action)
15+
return xi.mmm.onRuneUse(target, item, action)
16+
end
17+
18+
return itemObject

scripts/items/maze_rune_004.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-----------------------------------
2+
-- ID: 28803
3+
-- Maze Rune 004
4+
-- A small stone engraved with a runic symbol, shaped to fit in the notches of a Maze Tabula.
5+
-- The rune reads "Beast."
6+
-----------------------------------
7+
---@type TItem
8+
local itemObject = {}
9+
10+
itemObject.onItemCheck = function(target, item, param, caster)
11+
return xi.mmm.onRuneCheck(target, item)
12+
end
13+
14+
itemObject.onItemUse = function(target, user, item, action)
15+
return xi.mmm.onRuneUse(target, item, action)
16+
end
17+
18+
return itemObject

scripts/items/maze_rune_005.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-----------------------------------
2+
-- ID: 28804
3+
-- Maze Rune 005
4+
-- A small stone engraved with a runic symbol, shaped to fit in the notches of a Maze Tabula.
5+
-- The rune reads "Lizard."
6+
-----------------------------------
7+
---@type TItem
8+
local itemObject = {}
9+
10+
itemObject.onItemCheck = function(target, item, param, caster)
11+
return xi.mmm.onRuneCheck(target, item)
12+
end
13+
14+
itemObject.onItemUse = function(target, user, item, action)
15+
return xi.mmm.onRuneUse(target, item, action)
16+
end
17+
18+
return itemObject

scripts/items/maze_rune_006.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-----------------------------------
2+
-- ID: 28805
3+
-- Maze Rune 006
4+
-- A small stone engraved with a runic symbol, shaped to fit in the notches of a Maze Tabula.
5+
-- The rune reads "Vermin."
6+
-----------------------------------
7+
---@type TItem
8+
local itemObject = {}
9+
10+
itemObject.onItemCheck = function(target, item, param, caster)
11+
return xi.mmm.onRuneCheck(target, item)
12+
end
13+
14+
itemObject.onItemUse = function(target, user, item, action)
15+
return xi.mmm.onRuneUse(target, item, action)
16+
end
17+
18+
return itemObject

scripts/items/maze_rune_007.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-----------------------------------
2+
-- ID: 28806
3+
-- Maze Rune 007
4+
-- A small stone engraved with a runic symbol, shaped to fit in the notches of a Maze Tabula.
5+
-- The rune reads "Plantoid."
6+
-----------------------------------
7+
---@type TItem
8+
local itemObject = {}
9+
10+
itemObject.onItemCheck = function(target, item, param, caster)
11+
return xi.mmm.onRuneCheck(target, item)
12+
end
13+
14+
itemObject.onItemUse = function(target, user, item, action)
15+
return xi.mmm.onRuneUse(target, item, action)
16+
end
17+
18+
return itemObject

scripts/items/maze_rune_008.lua

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-----------------------------------
2+
-- ID: 28807
3+
-- Maze Rune 008
4+
-- A small stone engraved with a runic symbol, shaped to fit in the notches of a Maze Tabula.
5+
-- The rune reads "Undead."
6+
-----------------------------------
7+
---@type TItem
8+
local itemObject = {}
9+
10+
itemObject.onItemCheck = function(target, item, param, caster)
11+
return xi.mmm.onRuneCheck(target, item)
12+
end
13+
14+
itemObject.onItemUse = function(target, user, item, action)
15+
return xi.mmm.onRuneUse(target, item, action)
16+
end
17+
18+
return itemObject

0 commit comments

Comments
 (0)