Dissidia Posted October 24, 2012 Posted October 24, 2012 (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 November 9, 2012 by Yurika Quote
GmOcean Posted October 24, 2012 Posted October 24, 2012 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. Quote
Dissidia Posted October 24, 2012 Author Posted October 24, 2012 thanks.. now i will try the faction system. Quote
Dissidia Posted November 4, 2012 Author Posted November 4, 2012 i cant patch the faction system, i only want what im posting in my 1st post. please someone help me. Quote
AnnieRuru Posted November 6, 2012 Posted November 6, 2012 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); Quote
Dissidia Posted November 6, 2012 Author Posted November 6, 2012 many thanks AnnieRuru, i will try it now.. tnx Quote
Dissidia Posted November 9, 2012 Author Posted November 9, 2012 AnnieRuru how it will work? not working in my server.. Quote
AnnieRuru Posted November 9, 2012 Posted November 9, 2012 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 Quote
PewN Posted December 9, 2012 Posted December 9, 2012 (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 December 9, 2012 by TrojanWorm Quote
Question
Dissidia
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 Yurika9 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.