Jump to content
  • 0

PVP Party Warp


Yami

Question


  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  111
  • Reputation:   2
  • Joined:  01/02/14
  • Last Seen:  

Hi there, I have this heavily modified PVP warper script which I added a Party vs Party feature. But I need help to only warp party members if they are on town map. Here's the party warp script:

if (is_party_leader() == true) {
				if(getpartyleader(getcharid(1),2) == getcharid(0)) {
  				getpartymember getcharid(1), 1;
  				getpartymember getcharid(1), 2;
  				for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
    					if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
					attachrid $@partymemberaid[.@i];
					.@party_id = getcharid(1);
					warp "pvp_y_1-2",0,0;
					warpparty "Leader",0,0,.@party_id;
    					}
  				}
				}
			
			}// If leader close

Can someone help me add a restriction to only warp members that are in town map.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

On 6/12/2021 at 4:45 AM, Yami said:

Hi there, I have this heavily modified PVP warper script which I added a Party vs Party feature. But I need help to only warp party members if they are on town map. Here's the party warp script:


if (is_party_leader() == true) {
				if(getpartyleader(getcharid(1),2) == getcharid(0)) {
  				getpartymember getcharid(1), 1;
  				getpartymember getcharid(1), 2;
  				for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
    					if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
					attachrid $@partymemberaid[.@i];
					.@party_id = getcharid(1);
					warp "pvp_y_1-2",0,0;
					warpparty "Leader",0,0,.@party_id;
    					}
  				}
				}
			
			}// If leader close

Can someone help me add a restriction to only warp members that are in town map.

	setarray .@town_maps$, "prontera", "izlude", "geffen", "morroc";
	if(getpartyleader(getcharid(1),2) == getcharid(0)) {
		getpartymember getcharid(1), 1;
		getpartymember getcharid(1), 2;
		for ( .@i = 0; .@i < $@partymembercount; .@i++ )
			if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
				if(inarray(.@town_maps$, strcharinfo(3,$@partymembercid[.@i])) > -1)
					warp "pvp_y_1-2",0,0,$@partymembercid[.@i];
		warpparty "Leader",0,0,getcharid(1),"pvp_y_1-2",1,1;	
	}

 

Edited by Skorm
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  111
  • Reputation:   2
  • Joined:  01/02/14
  • Last Seen:  

On 6/12/2021 at 11:36 PM, Skorm said:
	setarray .@town_maps$, "prontera", "izlude", "geffen", "morroc";
	if(getpartyleader(getcharid(1),2) == getcharid(0)) {
		getpartymember getcharid(1), 1;
		getpartymember getcharid(1), 2;
		for ( .@i = 0; .@i < $@partymembercount; .@i++ )
			if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
				if(inarray(.@town_maps$, strcharinfo(3,$@partymembercid[.@i])) > -1)
					warp "pvp_y_1-2",0,0,$@partymembercid[.@i];
		warpparty "Leader",0,0,.@party_id,"pvp_y_1-2",500,500;	
	}

 

Thanks @Skorm I will try this script in a little bit!

@Skorm the script not working as intended,  sorry I should've explained it better. My npc script argument goes like this

1. Check if player is party leader (Only party leader can warp his team into pvp room, hence party leader check in the beginning)

2. If player is a party leader, warp his party (Like Emergency Call they all warp together) inside pvp room BUT if his party member is not in a town (maybe already inside pvp room, dungeons or somewhere else) they will not be warped with the team going inside pvp room. So restrict warping of members to only who are in a town.

****This is kinda tricky tho, because I have to warp the party leader inside the pvp room first, then warpparty the rest of the members into his position (which is random). Otherwise they will be all in random places inside the pvp room. So I modified the script you provided a little bit to do this just like my first script. And here's the updated script but it's not warping any party member anymore, I'm kinda confused.

 

		case 3:
			if (is_party_leader() == true) { //Check if leader
			setarray .@town_maps$, "prontera", "izlude", "geffen", "morroc";
				if(getpartyleader(getcharid(1),2) == getcharid(0)) {
				getpartymember getcharid(1), 1;
				getpartymember getcharid(1), 2;
					for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
						if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
							if(inarray(.@town_maps$, strcharinfo(3,$@partymembercid[.@i])) > -1)
							.@party_id = getcharid(1);
							warp "pvp_y_1-2",0,0; //Warp the leader first
							warpparty "Leader",0,0,.@party_id,"pvp_y_1-2",500,500; //Warp the rest to the leader position
							}
					}
				}

			
			}// If leader end

			//If not leader
			mes "You are Not a Party Leader";
			close;

The script is warping the leader, but not the rest of the party anymore. Which works fine from my original script (Warp leader, then warp members to him)

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

17 hours ago, Yami said:

@Skorm the script not working as intended,  sorry I should've explained it better. My npc script argument goes like this

1. Check if player is party leader (Only party leader can warp his team into pvp room, hence party leader check in the beginning)

2. If player is a party leader, warp his party (Like Emergency Call they all warp together) inside pvp room BUT if his party member is not in a town (maybe already inside pvp room, dungeons or somewhere else) they will not be warped with the team going inside pvp room. So restrict warping of members to only who are in a town.

****This is kinda tricky tho, because I have to warp the party leader inside the pvp room first, then warpparty the rest of the members into his position (which is random). Otherwise they will be all in random places inside the pvp room. So I modified the script you provided a little bit to do this just like my first script. And here's the updated script but it's not warping any party member anymore, I'm kinda confused.

The script is warping the leader, but not the rest of the party anymore. Which works fine from my original script (Warp leader, then warp members to him)

Ahh yeah I forgot that .@party_id was no longer being set. Anyways the way you have it now will not work right since warpparty is within the for loop. In my example it is outside the for loop and will only get run once as it should. Also I've modified my original post with the corrected script segment.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  111
  • Reputation:   2
  • Joined:  01/02/14
  • Last Seen:  

On 6/13/2021 at 9:10 PM, Skorm said:

Ahh yeah I forgot that .@party_id was no longer being set. Anyways the way you have it now will not work right since warpparty is within the for loop. In my example it is outside the for loop and will only get run once as it should. Also I've modified my original post with the corrected script segment.

Oh! I will try this right now! Thank you @Skorm. I'll update this thread 

 

@Skormscript is now working as intended!! Thanks a lot! 

I had to modify the range 500,500 to 1,1 so they all stick together and +500 coordinate made it spawn to a random spot because of invalid coordinates. Thanks again! 

On 6/12/2021 at 11:36 PM, Skorm said:

warpparty "Leader",0,0,getcharid(1),"pvp_y_1-2",500,500;

 

Edited by Yami
My bad
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

15 hours ago, Yami said:

@Skormscript is now working as intended!! Thanks a lot! 

I had to modify the range 500,500 to 1,1 so they all stick together and +500 coordinate made it spawn to a random spot because of invalid coordinates. Thanks again! 

 

Ahh yeah I see what they meant by that now sorry about that. I blame crappy documentation.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  35
  • Topics Per Day:  0.01
  • Content Count:  111
  • Reputation:   2
  • Joined:  01/02/14
  • Last Seen:  

1 hour ago, Skorm said:

Ahh yeah I see what they meant by that now sorry about that. I blame crappy documentation.

Haha! All good! I did not understand that myself until recently. Thanks for your help it's working as intended now.

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