Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Quest] Promotion: Lance Corporal #6872

Open
wants to merge 4 commits into
base: base
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion scripts/globals/quests.lua
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ xi.quest.id =
-- JP ENTRIES OR INVALID
PROMOTION_PRIVATE_FIRST_CLASS = 90, -- + Converted
PROMOTION_SUPERIOR_PRIVATE = 91, -- + Converted
PROMOTION_LANCE_CORPORAL = 92,
PROMOTION_LANCE_CORPORAL = 92, -- + Converted
PROMOTION_CORPORAL = 93,
PROMOTION_SERGEANT = 94,
PROMOTION_SERGEANT_MAJOR = 95,
Expand Down
19 changes: 19 additions & 0 deletions scripts/globals/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,25 @@ utils.mask =

return bit.band(mask, fullMask) == fullMask
end,

splitBits = function(bits, size)
local result = {}
local mask = bit.lshift(1, size) - 1

while bits > 0 do
result[#result + 1] = bit.band(bits, mask)
bits = bit.rshift(bits, size)
end

return result
end,

varSplit = function(option, splitBit)
splitBit = splitBit or 16
local mask = bit.lshift(1, splitBit) - 1

return bit.band(option, mask), bit.rshift(option, splitBit)
end,
}

function utils.prequire(...)
Expand Down
Loading