Jump to content
  • 0

PK Mode Party Buffs not working


OscarScorp

Question


  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  217
  • Reputation:   16
  • Joined:  01/28/15
  • Last Seen:  

Good day,
I have my server with PK mode on outside towns, and added a command to Toggle PK mode On/Off, which works but the only problem is the following:

I'm having a problem when the player tries to buff party members with Area of Effect buffs such as Magnificat or Angelus.
If both players have PK Mode OFF, the AoE buff will not work on party members, but if the caster is in PK Mode ON or all party members have PK Mode ON, the buff will work on everyone.

What should I change here (src/map/battle.cpp) in order to make it work so:
- Caster & party members receive Party buff if both have PK Mode OFF.
- Caster & party members receive Party buff if both have PK Mode ON.
- Party buffs will not work if the caster is in PK mode ON and the party members have it OFF.

switch( t_bl->type ) { //Checks on target master
  case BL_PC: {
    struct map_session_data *sd;
    struct status_change *sc = NULL;
    struct map_session_data *ssd;

    if( t_bl == s_bl )
    	break;

    sd = BL_CAST(BL_PC, t_bl);
    sc = status_get_sc(t_bl);
//Edit: Added ssd for enabling use of support skills on party members in pvp maps, stores map_session_data for source of attack/skill.
    ssd = BL_CAST(BL_PC,s_bl);

    if( (sd->state.monster_ignore || (sc->data[SC_KINGS_GRACE] && s_bl->type != BL_PC)) && flag&BCT_ENEMY )
    	return 0; // Global immunity only to Attacks
//Edit:
    if( mapdata->flag[MF_PVP] && sd->state.pk_mode == 1 && flag&BCT_ENEMY && s_bl->type != BL_MOB ) {
   		if(sd->status.party_id == ssd->status.party_id)
      		state|=BCT_PARTY;
    	else
      		return 0;
    }

	...

Please, I ask you for support and will greatly thank you for your help!!
/thx

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  416
  • Reputation:   73
  • Joined:  05/16/19
  • Last Seen:  

just change it to all and set it if mapflag blah blah and return 0 for mobs 

 

do it in the skil.c

Edited by Naruto
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  217
  • Reputation:   16
  • Joined:  01/28/15
  • Last Seen:  

6 minutes ago, Naruto said:

just change it to all and set it if mapflag blah blah and return 0 for mobs 

 

do it in the skil.c

Sorry, I don't quite understand. Do I have to edit battle.cpp or skill.cpp? And what exactly?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  416
  • Reputation:   73
  • Joined:  05/16/19
  • Last Seen:  

1 hour ago, OscarScorp said:

Sorry, I don't quite understand. Do I have to edit battle.cpp or skill.cpp? And what exactly?

I would edit each skill individually, set the target in the skill_db to all instead of friend,

then in the skill.c do something like this ...... 

 

I mean i could think of an expression but maybe your right, maybe you should just not allow them to join parties or instantly kick them upon activation and request a new party . . . 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  217
  • Reputation:   16
  • Joined:  01/28/15
  • Last Seen:  

I think it's just trying to understand the logic behind these lines, which I don't fully understand how it works:

if( mapdata->flag[MF_PVP] && sd->state.pk_mode == 1 && flag&BCT_ENEMY && s_bl->type != BL_MOB ) {
  if(sd->status.party_id == ssd->status.party_id)
  	state|=BCT_PARTY;
  else
  	return 0;
}

I only know that sd->state.pk_mode == 1 means to detect PK status is OFF.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  20
  • Topics Per Day:  0.01
  • Content Count:  416
  • Reputation:   73
  • Joined:  05/16/19
  • Last Seen:  

11 minutes ago, OscarScorp said:

I think it's just trying to understand the logic behind these lines, which I don't fully understand how it works:


if( mapdata->flag[MF_PVP] && sd->state.pk_mode == 1 && flag&BCT_ENEMY && s_bl->type != BL_MOB ) {
  if(sd->status.party_id == ssd->status.party_id)
  	state|=BCT_PARTY;
  else
  	return 0;
}

I only know that sd->state.pk_mode == 1 means to detect PK status is OFF.

if mapflag is MF_PVP is on AND play state is pk mode ON AND flag is ENEMY AND target is NOT A MONSTER

>that second line i have no idea, just int declaring int probably from previous thing....just scroll up its probably hanging around already declared and now we redeclare is back to default

..... So if theyre in party :

theyre new target id is PARTY MEMBER

otherwise

fail

Edited by Naruto
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  62
  • Topics Per Day:  0.02
  • Content Count:  217
  • Reputation:   16
  • Joined:  01/28/15
  • Last Seen:  

Yeah, I understand that, but what I don't understand is how is related to Area of Effect Buffs such as Magnificat, Angelus, and in what way is it being affected.
- Mapflag PVP yes, my server is PVP mode, therefore all maps outside towns are PVP.
- Play state PK mode On/Off, correct, the user swaps between both of them. I've tried with it at 1, and at 0. Same problem.
- Flag = Enemy, I assume this applies to offensive abilities, but I don't see how it connects to AoE buffs such as Magnificat. Maybe the flag doesn't even need to be there? I've tried without it, or with flag ALL but problem remains.
- And obviously targets affected should not be mobs ( != BL_MOB ).

Here's the skill.cpp part of the Area buffs:

	case AL_ANGELUS:
	case PR_MAGNIFICAT:
	case PR_GLORIA:
	case SN_WINDWALK:
	case CASH_BLESSING:
	case CASH_INCAGI:
	case CASH_ASSUMPTIO:
	case WM_FRIGG_SONG:
		if( sd == NULL || sd->status.party_id == 0 || (flag & 1) )
			clif_skill_nodamage(bl, bl, skill_id, skill_lv, sc_start(src,bl,type,100,skill_lv,skill_get_time(skill_id,skill_lv)));
		else if( sd )
			party_foreachsamemap(skill_area_sub, sd, skill_get_splash(skill_id, skill_lv), src, skill_id, skill_lv, tick, flag|BCT_PARTY|1, skill_castend_nodamage_id);
		break;


I just don't understand how it is connected to these skills and how to solve it.
Does anyone has their server in PvP mode and have this issue as well? /wah

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...