HylianZ wrote: ↑Wed Feb 07, 2018 11:32 pm
Azure wrote: ↑Wed Feb 07, 2018 11:05 pm
I know there is already a code to change to License Board each character has, but is there a way to "clean" the previous board? as it is when I change from White Mage to Knight I still have every license I purchased as a White Mage unlocked.
Thanks again for this awesomeness!
[Link]
Here are the default Licenses, as they appear in the table. Make your character's board look like this in the table, then add the amount of LP you will need to get back to where you were.
If you're looking to change the second job and don't want to mess with the first, use PhoenixFlare's Matrix, linked in the post on page 7 and go through and manually set the licenses you need to remove to 0. It's a pain, to be sure, but it's the best I've got.
So I am looking to write a code to reset the licenses and jobs. The trick is to refund the LP. Anyway, I started a code that can do it, it will be tricky to finish.
The PheonixFlare matrix is helpful but a little off. Basically, what he has identified as bits are actually nibbles, that's why the math in that spreadsheet is all funky.
In the first value in your table that is called License 1, it is actually 4 bytes. (The first one is 80, i.e., octal or base 8). Each of the bits in those bytes correspond to a single box on the license board. So in that chart, the first byte in license 1 corresponds to the boxes for exodus through zeromus. In other words, the reason that is starts as 80 is because you have none of the summons listed there. Bitwise, it would be 00001000. As you start to fill in the summons, some of those bits will flip. Hope that makes sense.
So in order to reset licenses, we need to check those bits that have been changed and refund the appropriate amount of LP.
Anyway, its off to bed but here is my start:
Code: Select all
function isBitSet(value, bitnumber)
return bAnd(value, bShl(1,bitnumber)) ~= 0
end
function getLp(x)
address=getAddress(x)
byte1=readBytes(x)
byte2=readBytes(x+1)
byte3=readBytes(x+2)
byte4=readBytes(x+3)
byte5=readBytes(x+4)
byte6=readBytes(x+5)
byte7=readBytes(x+6)
byte8=readBytes(x+7)
byte9=readBytes(x+8)
byte10=readBytes(x+9)
byte11=readBytes(x+10)
byte12=readBytes(x+11)
lpRefund=0
--Exodus (50)
if isBitSet(byte1, 1)
lpRefund = lpRefund + 50
end
--Ultima (50)
if isBitSet(byte1, 2)
lpRefund = lpRefund + 50
end
-- etc., etc.
--Set new lp
lp = readBytes(x-4)
lp = lp = lpRefund
writeInteger(x-4, lp)
--Reset boards
writeBytes(x, byte1clean, byte2clean, etc. etc.)
--Also reset job selection