Jump to content
  • 0

R> @pk state on/off in town only


Question

11 answers to this question

Recommended Posts

  • 0
Posted
Finally found one and works fine on latest version. (Credits to the Owner/s)

 

First : I got the main source codes edited by malufett here, but it allows you to use @pk anywhere.

 


 

Second : So I keep on searching and I found this function suggested by Brynner to restrict anyone to use @pk state on/off only on towns/non-PVP maps. 

 


 



if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) {
clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
return -1;
}


 

Third : I made a little editing on adding this function from Brynner.

 

at atcommand.c

 



int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) {

nullpo_retr(-1, sd);

if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) {
clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
return -1;
}

else if (!sd->state.pk_mode) {
sd->state.pk_mode = 1;
clif_displaymessage(sd->fd, "You are now no longer in PK mode.");
}

else {
sd->state.pk_mode = 0;
clif_displaymessage(sd->fd, "Returned to normal state.");
}

return 0;
}


Im currently using this code and it works fine on my test server. Thanks to all!

  • 0
Posted

 

Finally found one and works fine on latest version. (Credits to the Owner/s)
 
First : I got the main source codes edited by malufett here, but it allows you to use @pk anywhere.
 
 
Second : So I keep on searching and I found this function suggested by Brynner to restrict anyone to use @pk state on/off only on towns/non-PVP maps. 
 
 
if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) {
clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
return -1;
} 
 
Third : I made a little editing on adding this function from Brynner.
 
at atcommand.c
 
    int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) {

        nullpo_retr(-1, sd);

        if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) {
            clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
            return -1;
        }
        
        else if (!sd->state.pk_mode) {
            sd->state.pk_mode = 1;
            clif_displaymessage(sd->fd, "You are now no longer in PK mode.");
        }
        
        else {
            sd->state.pk_mode = 0;
            clif_displaymessage(sd->fd, "Returned to normal state.");
        }
        
        return 0;
    } 
Im currently using this code and it works fine on my test server. Thanks to all!

 

this file

 pk_mod_rA_r16215.PATCH?

  • 0
Posted

 

 

Finally found one and works fine on latest version. (Credits to the Owner/s)
 
First : I got the main source codes edited by malufett here, but it allows you to use @pk anywhere.
 
 
Second : So I keep on searching and I found this function suggested by Brynner to restrict anyone to use @pk state on/off only on towns/non-PVP maps. 
 
 
if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) {
clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
return -1;
} 
 
Third : I made a little editing on adding this function from Brynner.
 
at atcommand.c
 
    int atcommand_pkmode( const int fd, struct map_session_data *sd, const char *command, const char *message ) {

        nullpo_retr(-1, sd);

        if( map[sd->bl.m].flag.pvp || map[sd->bl.m].flag.gvg || map[sd->bl.m].flag.gvg_castle || map[sd->bl.m].flag.gvg_dungeon ) {
            clif_displaymessage(fd, "You can only change your PK state on non-PVP maps.");
            return -1;
        }
        
        else if (!sd->state.pk_mode) {
            sd->state.pk_mode = 1;
            clif_displaymessage(sd->fd, "You are now no longer in PK mode.");
        }
        
        else {
            sd->state.pk_mode = 0;
            clif_displaymessage(sd->fd, "Returned to normal state.");
        }
        
        return 0;
    } 
Im currently using this code and it works fine on my test server. Thanks to all!

 

this file

 pk_mod_rA_r16215.PATCH?

 

Yes

  • 0
Posted (edited)
Hello, I'm using the latest version of rAthena and I wanted to put this mod but I get this error when compiling, I hope you can help me.

Thank you.

 

Edited by noxty
  • 0
Posted (edited)
8 hours ago, noxty said:

error pk mode.jpg

-			if( map[m].flag.pvp && sd->state.pk_mode && flag&BCT_ENEMY && s_bl->type != BL_MOB )
-				return 0;

+			if( map_getmapflag(sd->bl.m, MF_PVP) && sd->state.pk_mode && flag&BCT_ENEMY && s_bl->type != BL_MOB )
+				return 0;

-				}else if( map[m].flag.pvp && sd->state.pk_mode && t_bl->type != BL_MOB )
-					return 0;

					return 0; // You can't target anything out of your duel

+				}else if (map_getmapflag(sd->bl.m, MF_PVP) && sd->state.pk_mode && t_bl->type != BL_MOB)
+					return 0;

Try This

Edited by Bringer
  • 0
Posted
18 hours ago, noxty said:

Thanks for the help but now I have another mistake, I hope you can help me.

Thank you


 


 


 
 
 
 

error pk mode 2.jpg

+			if( map_getmapflag(sd->bl.m, MF_PVP) && sd->state.pk_mode && flag&BCT_ENEMY && s_bl->type != BL_MOB )
+				return 0;

 

+				}else if (map_getmapflag(sd->bl.m, MF_PVP) && sd->state.pk_mode && t_bl->type != BL_MOB)
+

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