Jump to content
  • 0

PK Mode and Job Restrictions


RamsayIV

Question


  • Group:  Members
  • Topic Count:  2
  • Topics Per Day:  0.00
  • Content Count:  3
  • Reputation:   0
  • Joined:  01/19/16
  • Last Seen:  

Hello community.
 
Well, i have enabled the PK Mode on my server but i've been trying to exclude the First and Second Classes from this mode, so only the Rebirth Classes (Lord Knight, Champion, etc...) can fight on the maps which this is enabled.
 
I've found that this can be edited in src/battle.c exactly in these lines:
 

if( state&BCT_ENEMY && battle_config.pk_mode && map[m].flag.fvf && !map_flag_gvg(m) && s_bl->type == BL_PC && t_bl->type == BL_PC )
{ // Prevent novice engagement on pk_mode (feature by Valaris)
TBL_PC *sd = (TBL_PC*)s_bl, *sd2 = (TBL_PC*)t_bl;
if (
(sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
(sd2->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||

(int)sd->status.base_level < battle_config.pk_min_level ||
(int)sd2->status.base_level < battle_config.pk_min_level ||
(battle_config.pk_level_range && abs((int)sd->status.base_level - (int)sd2->status.base_level) > battle_config.pk_level_range)
)
state &= ~BCT_ENEMY;
}

 

Where by default the Novice Class fights is disabled on PK Maps. I tried to add the Mage Class exception by adding this and IT DOES WORK.
 

if( state&BCT_ENEMY && battle_config.pk_mode && map[m].flag.fvf && !map_flag_gvg(m) && s_bl->type == BL_PC && t_bl->type == BL_PC )
{ // Prevent novice engagement on pk_mode (feature by Valaris)
TBL_PC *sd = (TBL_PC*)s_bl, *sd2 = (TBL_PC*)t_bl;
if (
(sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
(sd2->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||

 
(sd->class_&MAPID_UPPERMASK) == MAPID_MAGE ||
(sd2->class_&MAPID_UPPERMASK) == MAPID_MAGE ||


(int)sd->status.base_level < battle_config.pk_min_level ||
(int)sd2->status.base_level < battle_config.pk_min_level ||
(battle_config.pk_level_range && abs((int)sd->status.base_level - (int)sd2->status.base_level) > battle_config.pk_level_range)
)
state &= ~BCT_ENEMY;
}


 
But when i try to add the Wizard Class exception with the same condition it won't work:
 

if( state&BCT_ENEMY && battle_config.pk_mode && map[m].flag.fvf && !map_flag_gvg(m) && s_bl->type == BL_PC && t_bl->type == BL_PC )
{ // Prevent novice engagement on pk_mode (feature by Valaris)
TBL_PC *sd = (TBL_PC*)s_bl, *sd2 = (TBL_PC*)t_bl;
if (
(sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
(sd2->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||

 
(sd->class_&MAPID_UPPERMASK) == MAPID_MAGE ||
(sd2->class_&MAPID_UPPERMASK) == MAPID_MAGE ||

 
(sd->class_&MAPID_UPPERMASK) == MAPID_WIZARD ||
(sd2->class_&MAPID_UPPERMASK) == MAPID_WIZARD ||


(int)sd->status.base_level < battle_config.pk_min_level ||
(int)sd2->status.base_level < battle_config.pk_min_level ||
(battle_config.pk_level_range && abs((int)sd->status.base_level - (int)sd2->status.base_level) > battle_config.pk_level_range)
)
state &= ~BCT_ENEMY;
}

 

I don't why it doesnt work. I imagine that i have to use another condition but i have no clue about which one could be.

 

I was wondering if some of you could help me out with this.

 

Thank you in advance for your attention and possible help.

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  7
  • Reputation:   0
  • Joined:  08/22/12
  • Last Seen:  

Try replacing this:

 

(sd->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||

(sd2->class_&MAPID_UPPERMASK) == MAPID_NOVICE ||
 
(sd->class_&MAPID_UPPERMASK) == MAPID_MAGE ||
(sd2->class_&MAPID_UPPERMASK) == MAPID_MAGE ||

 
(sd->class_&MAPID_UPPERMASK) == MAPID_WIZARD ||
(sd2->class_&MAPID_UPPERMASK) == MAPID_WIZARD ||

 

With this

(!(sd->class_&JOBL_UPPER)) ||

(!(sd2->class_&JOBL_UPPER)) ||

Link to comment
Share on other sites

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.

×
×
  • Create New...