Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/enum/msg.lua
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ xi.msg.basic =
AUTO_OVERLOAD_CHANCE = 798, -- The <pet>'s overload chance is <number>%.
AUTO_OVERLOADED = 799, -- The <pet>'s overload chance is <number>%. The <pet> is overloaded!
SPIRIT_BOND = 800, -- Spirit Bond Activates. <Player> takes <number> points of damage. -- Wyvern Spirit bond
RECEIVES_JOB_POINTS = 807, -- <player> receives <number> job points.
}

-- Used to modify certain basic messages.
Expand Down
46 changes: 46 additions & 0 deletions scripts/globals/item_utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,52 @@ xi.itemUtils.removeMultipleEffects = function(target, effects, count, random)
end
end

-- Maat's Concoction / Maat's Mix: grant job points to the current job.
-- Retail cap is 500 total (unspent + spent) for that job.
-- https://www.bg-wiki.com/ffxi/Maat%27s_Mix
-- https://www.bg-wiki.com/ffxi/Maat%27s_Concoction
-- Animation 34 and 0x028 message 807 from siknoz captures (Concoction Raguza 2021-10-13,
-- Mix Siknawz 2025-07-21 and 2026-05-23). At 500 JP retail sends no 0x029; capturer
-- noted "just doesnt use it, no error message". onItemCheck -1 is RefuseSilently.
-- Under-99 fail message is unverified.
local jobPointsMax = 500

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unneeded. use the 500 directly, this number cannot ever change


---@nodiscard
---@param target CBaseEntity
---@return integer
xi.itemUtils.jobPointItemOnItemCheck = function(target)
if
not target:isPC() or
target:getMainLvl() < 99
then
return xi.msg.basic.ITEM_UNABLE_TO_USE_2
Comment thread
Xaver-DaRed marked this conversation as resolved.
end

local job = target:getMainJob()
local total = target:getJobPoints(job) + target:getSpentJobPoints()
if total >= jobPointsMax then
return -1
end

return 0
end

---@param target CBaseEntity
---@param amount integer
---@param action Action
---@return integer
xi.itemUtils.jobPointItemOnItemUse = function(target, amount, action)
local job = target:getMainJob()
local total = target:getJobPoints(job) + target:getSpentJobPoints()
local grant = math.min(amount, jobPointsMax - total)
if grant > 0 then
target:addJobPoints(job, grant)
action:messageID(target:getID(), xi.msg.basic.RECEIVES_JOB_POINTS)
end

return grant
end

-- for applying pet mods based on arbitrary conditions
-- I.E. avatar attack only for a particular pet
-- example usage in fervor_ring.lua
Expand Down
18 changes: 18 additions & 0 deletions scripts/items/maats_concoction.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----------------------------------
-- ID: 6597
-- Item: Maat's Concoction
-- Grants 50 Job Points to the current job
-- https://www.bg-wiki.com/ffxi/Maat%27s_Concoction
-----------------------------------
---@type TItem
local itemObject = {}

itemObject.onItemCheck = function(target, item, caster)
return xi.itemUtils.jobPointItemOnItemCheck(target)
end

itemObject.onItemUse = function(target, user, item, action)
return xi.itemUtils.jobPointItemOnItemUse(target, 50, action)
end

return itemObject
18 changes: 18 additions & 0 deletions scripts/items/maats_mix.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-----------------------------------
-- ID: 6598
-- Item: Maat's Mix
-- Grants 10 Job Points to the current job
-- https://www.bg-wiki.com/ffxi/Maat%27s_Mix
-----------------------------------
---@type TItem
local itemObject = {}

itemObject.onItemCheck = function(target, item, caster)
return xi.itemUtils.jobPointItemOnItemCheck(target)
end

itemObject.onItemUse = function(target, user, item, action)
return xi.itemUtils.jobPointItemOnItemUse(target, 10, action)
end

return itemObject
4 changes: 2 additions & 2 deletions sql/item_usable.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2414,8 +2414,8 @@ INSERT INTO `item_usable` VALUES (6593,'deep_yellow_curry',1,1,0,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (6594,'seafood_curry',1,1,0,0,0,0,0,0); -- TODO: Not implemented
INSERT INTO `item_usable` VALUES (6595,'chicken_curry',1,1,0,0,0,0,0,0); -- TODO: Not implemented
INSERT INTO `item_usable` VALUES (6596,'duck_curry',1,10,0,0,0,0,0,0); -- TODO: Not implemented
INSERT INTO `item_usable` VALUES (6597,'mutton_curry',1,1,0,0,0,0,0,0); -- TODO: Not implemented
INSERT INTO `item_usable` VALUES (6598,'maats_mix',1,1,0,0,0,0,0,0); -- TODO: Not implemented
INSERT INTO `item_usable` VALUES (6597,'maats_concoction',1,1,34,0,0,0,0,0); -- 0x028 ItemFinish animation (siknoz Raguza 2021-10-13)
INSERT INTO `item_usable` VALUES (6598,'maats_mix',1,1,34,0,0,0,0,0); -- 0x028 ItemFinish animation (siknoz Siknawz 2025-07-21 / 2026-05-23)
INSERT INTO `item_usable` VALUES (6599,'egg_sandwich',1,1,28,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (6600,'egg_sandwich_+1',1,1,28,0,0,0,0,0);
INSERT INTO `item_usable` VALUES (6601,'omelette_sandwich',1,1,28,0,0,0,0,0);
Expand Down
1 change: 1 addition & 0 deletions src/map/enums/msg_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,5 +286,6 @@ enum class MsgBasic : uint16_t
ROEUnable = 742, // You are currently unable to undertake this objective.
AutoExceedsCapacity = 745, // Your automaton exceeds one or more elemental capacity values and cannot be activated.
MountRequiredLevel = 773, // You are unable to call forth your mount because your main job level is not at least <level>.
ReceivesJobPoints = 807, // <player> receives <number> job points.
AlterEgoUpgrade = 828, // <category> attribute increased to #.
};
Loading