How to use eA Job System to detect certain range of class

bWolfie

I'm the man
Messages
850
Points
0
Location
Alberta, Midgard
Github
bWolfie
Emulator
Hi,

I want to use the eA Job System to check an 'if' statement, having some trouble.
I want the statement to check:

  • If user is fully advanced class (e.g. Lord Knight, Paladin) OR user is at the end of the baby line (e.g. Baby Knight, Baby Hunter).
  • User is NOT first class (can the classes above).
This is my script.

Code:
.@eac = eaclass();
// if (2-1/2-2 + rebirth OR 2-1/2-2 + baby BUT NOT FIRST CLASS)
if (.@eac&EAJL_2&(EAJL_UPPER|EAJL_BABY))
{
     dothis();
}
 
Last edited by a moderator:
// if (2-1/2-2 + rebirth OR 2-1/2-2 + baby BUT NOT FIRST CLASS)
if ((.@eac & (EAJL_2_1 | EAJL_2_2)) && (.@eac & EAJL_BABY || .@eac & EAJL_UPPER)) { dothis(); }


Something like this? I think the "user is not a first class" will need to be done within the case, since the result of checking .@eac against anything above the first class would include its first class.

 
Last edited by a moderator:
// if (2-1/2-2 + rebirth OR 2-1/2-2 + baby BUT NOT FIRST CLASS)
if ((.@eac & (EAJL_2_1 | EAJL_2_2)) && (.@eac & EAJL_BABY || .@eac & EAJL_UPPER)) { dothis(); }


Something like this?
Sadly still triggering for 1-1 class like Swordman, Mage, Taekwon.

 
Sadly still triggering for 1-1 class like Swordman, Mage, Taekwon.
Yeah, edited my post to say that you'll need to include the 1-1 check within that one (which narrows it down to the user's class hierarchy).

Something like 

Code:
if ((.@eac & (EAJL_2_1 | EAJL_2_2)) && (.@eac & EAJL_BABY || .@eac & EAJL_UPPER)) {
	if (Class != Swordman && Class != Mage ...)
		dothis();
}
 
Hm okay. Thanks Smoke. I was hoping not to use a long if or switch statement, but I guess it can't be avoided :astonished:

 
Hm okay. Thanks Smoke. I was hoping not to use a long if or switch statement, but I guess it can't be avoided :astonished:
Yeah the EAJ masking system was built this way, although you could make a utility script function that returns if a class is a 1st, 2nd or 3rd job class.

 
Back
Top