Jump to content

  •  

Photo

PK Mode and Job Restrictions


  • Please log in to reply
2 replies to this topic

#1 raksone

raksone

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 02 April 2016 - 06:46 PM

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.
 

Spoiler

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

 

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.


Edited by raksone, 02 April 2016 - 06:47 PM.


#2 Cretino

Cretino

    Advanced Member

  • Members
  • PipPipPip
  • 50 posts

Posted 03 April 2016 - 02:40 AM

Hey there!

I think is it you want:

 

Attached File  battle.c.patch   1.87K   6 downloads

 

It exclude first and second class non high.

 

Exeptions:

Super Novice
Star Gladiator
Rebellion
Kagerou&Oboro
Gunslinger
Ninja
Soul Linker

 

If you want to add more or remove, follow the 'example' I used.



#3 raksone

raksone

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 03 April 2016 - 06:48 AM

Oh my god, you are a genious!

 

Thank you very much, it works pretty well.

 

I'm really grateful. Greetings!






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users


This topic has been visited by 18 user(s)