Jump to content
  • 0

Question

Posted (edited)

5 players in pvp without a party.

2 players are set to "set pvpteam_a,1;".

and

3 players are set to "set pvpteam_b,1;".

all players with set "set pvpteam_a,1;" cannot attack each other but they can attack team b.

this modification is possible?

Edited by Yurika

9 answers to this question

Recommended Posts

Posted

Yes, you should refer to faction system. I believe most use a variable to determine what faction they are apart of, and they are unable to attack their own faction, if a mapflag is set. All you have to do, is simple set the variable as they enter, and remove it when they leave.

Posted
Index: battle.c
===================================================================
--- battle.c	(revision 16860)
+++ battle.c	(working copy)
@@ -5051,6 +5051,14 @@
		}
	}

+	if ( s_bl->type == BL_PC && t_bl->type == BL_PC ) {
+		struct map_session_data *sd = BL_CAST(BL_PC, s_bl);
+		struct map_session_data *tsd = BL_CAST(BL_PC, t_bl);
+		if ( !strcmp( mapindex_id2name(sd->mapindex), "prontera" ) )
+			if ( pc_readglobalreg( sd, "pvpteam" ) == pc_readglobalreg( tsd, "pvpteam" ) )
+				return 0;
+	}
+
	switch( target->type ) { // Checks on actual target
		case BL_PC: {
				struct status_change* sc = status_get_sc(src);

Posted

	if ( s_bl->type == BL_PC && t_bl->type == BL_PC ) {

if the source and the target are both human players

		struct map_session_data *sd = BL_CAST(BL_PC, s_bl);
	struct map_session_data *tsd = BL_CAST(BL_PC, t_bl);

call out the data

		if ( !strcmp( mapindex_id2name(sd->mapindex), "prontera" ) )

the condition only apply in prontera map

			if ( pc_readglobalreg( sd, "pvpteam" ) == pc_readglobalreg( tsd, "pvpteam" ) )
			return 0;

if both of them having the same "pvpteam" variable, they can't hit each other

so set your script

set pvpteam, 1; // they assign to team no.1

set pvpteam, 2; // they assign to team no.2

those with same variable cannot hit each other

Posted (edited)

	if ( s_bl->type == BL_PC && t_bl->type == BL_PC ) {

if the source and the target are both human players

		struct map_session_data *sd = BL_CAST(BL_PC, s_bl);
	struct map_session_data *tsd = BL_CAST(BL_PC, t_bl);

call out the data

		if ( !strcmp( mapindex_id2name(sd->mapindex), "prontera" ) )

the condition only apply in prontera map

			if ( pc_readglobalreg( sd, "pvpteam" ) == pc_readglobalreg( tsd, "pvpteam" ) )
			return 0;

if both of them having the same "pvpteam" variable, they can't hit each other

so set your script

set pvpteam, 1; // they assign to team no.1

set pvpteam, 2; // they assign to team no.2

those with same variable cannot hit each other

annie ruru how to add other map?

Edited by TrojanWorm

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