Maat's Cap

Post Reply
Kiri
Posts: 3
Joined: Wed Mar 06, 2013 3:42 pm

Maat's Cap

Post by Kiri » Sat Apr 27, 2013 8:16 pm

This should add in obtaining Maat's Cap somewhat smoothly.

I've commented everything I've added/changed.

Few notes in addition to the comments:

Whenever Maat is defeated, it adds a character variable based on the job you're on.

Variable is: MaatJob + jobIndex = jobIndex
(I apologize for this, but it was either this or write a bajillion lines of code for each job instead due to my limited LUA knowledge)

Let's say you beat Maat as WAR. WAR is indexed as 1.
Your character now has the variable MaatJob1 with the value of 1, indicating you've beaten Maat as a WAR.

Let's say you beat Maat as BRD. BRD is indexed as 10.
Your character now has the variable MaatJob10 with the value of 10, indicated you've beaten Maat as a BRD.

Then it takes all MaatJob variables and adds them together, and that's the value of MaatCap.

So beating Maat as BRD and WAR would net you a MaatCap value of 11.

Basically, the quest requires a MaatCap value of 120, which is the 15 job's indexes added together.


Also to note is that I have another variable called UpdatedMaatCapValue, just so I don't end up making people having to defeat Maat on the same job twice for cap.
---

Happy testing, I hope this doesn't glitch out anything.

Please let me know if I can do something better.
Attachments
MaatsCap.patch
(11.55 KiB) Downloaded 211 times

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Maat's Cap

Post by kjLotus » Sat Apr 27, 2013 9:28 pm

an easier way to do the char var is using the bit functions - making each bit represent 1 job. then the job index - 1 can be the bit number (WAR bit 0, MNK bit 1, etc).

this way, you get all of maat cap in one var, and can easily check the conditions

the functions are in lua_baseentity.cpp - getMaskBit, setMaskBit and countMaskBits. you'd use setMaskBit(true, jobindex-1, varname) when you kill maat, and then when you want to see if they qualify for maat's cap or not, countMaskBits(getVar(varname)) = 15

if you don't really understand how to use them, ask me in irc :D

Post Reply