Jump to content
  • 0

Question

Posted (edited)

I was just wondering if there's an easier way to check a player's job in the source than what I've been using, which is this, for example, to determine if they're 3rd classes:

if( bl->type == BL_PC && pc_mapid2jobid(((TBL_PC*)bl)->class_, ((TBL_PC*)bl)->status.sex) >= JOB_RUNE_KNIGHT )

But I would like to know if there's an easier way to just determine a single class, or will I have to write this statement out for every class I plan to check for?

Edited by michaelsoftman

4 answers to this question

Recommended Posts

Posted

It's not an NPC, it's a source edit.

I'm messing around with the Dark Collector class (turning it into a usable class out of boredom) and so I configuring class specific drops for them. I could do

if( bl->type == BL_PC && pc_mapid2jobid(((TBL_PC*)bl)->class_, ((TBL_PC*)bl)->status.sex) == JOB_DARK_COLLECTOR )

I just want to know if this is the most efficient way or not. I'm not too familiar with some of the source code commands.

Posted (edited)

I was just wondering if there's an easier way to check a player's job in the source than what I've been using, which is this, for example, to determine if they're 3rd classes:

if( bl->type == BL_PC && pc_mapid2jobid(((TBL_PC*)bl)->class_, ((TBL_PC*)bl)->status.sex) >= JOB_RUNE_KNIGHT )

But I would like to know if there's an easier way to just determine a single class, or will I have to write this statement out for every class I plan to check for?

Try this?

if((sd->class_&MAPID_BASEMASK) == MAPID_DARK_COLLECTOR)

or this

if(sd->class_ == MAPID_DARK_COLLECTOR)

Saw lot's of those in skill.c checks.

Edited by CandyCandy

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...