Jump to content
  • 0

Help with Party check


Reborn

Question


  • Group:  Members
  • Topic Count:  104
  • Topics Per Day:  0.03
  • Content Count:  290
  • Reputation:   3
  • Joined:  09/29/13
  • Last Seen:  

can anyone help me on this party check.

a leader will talk to the NPC for the whole party get warp to a specific map. the npc requirement will be

> all party members should be in the map of prontera. if some member are not in this map the party leader will get a message that all party members must be in prontera.
> all party members should be online. if some member are not online the party leader will get a message some of your party member are currently offline.
> all party members should have this variable called TICKETMANIAC. if some party member does not have 1 TICKETMANIAC variable, the party leader will get a message some of your party member doesn't have enough TICKETMANIAC.

if all party members including the leader meet the requirements

> all party member will be warp to a specific map let say payon.
> all party member TICKETMANIAC will decrease by 1.

 

Thanks in advance ...

Edited by neXus
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   431
  • Joined:  01/26/16
  • Last Seen:  

1 hour ago, crazyarashi said:

function	party_check	{
	.@map$ = "prontera";
	getpartymember getcharid(1),2;
	getpartymember getcharid(1),2;
	for( .@i = 0; .@i < $@partymembercount; .@i++ ){
		if(attachrid($@partymemberaid[.@i])) {
			if(strcharinfo(3) != .@map$){
			mes "All members is not in prontera.";
			close;
			}
			if(TICKETMANIAC == 1){
				mes "Some of your party members does not have ticket maniac.";
				close;
				}
			if(!isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i])){
				mes "A member is not online.";
				close;
				}
			TICKETMANIAC = 0;
			warp "payon",123,123;		
			end;
			}
		detachrid;
	}
	return;
}

feel free to test this (not sure if it's gonna work no time to test it) :))

Use getvar instead of attachrid

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  104
  • Topics Per Day:  0.03
  • Content Count:  290
  • Reputation:   3
  • Joined:  09/29/13
  • Last Seen:  

12 hours ago, crazyarashi said:

function	party_check	{
	.@map$ = "prontera";
	getpartymember getcharid(1),2;
	getpartymember getcharid(1),2;
	for( .@i = 0; .@i < $@partymembercount; .@i++ ){
		if(attachrid($@partymemberaid[.@i])) {
			if(strcharinfo(3) != .@map$){
			mes "All members is not in prontera.";
			close;
			}
			if(TICKETMANIAC == 1){
				mes "Some of your party members does not have ticket maniac.";
				close;
				}
			if(!isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i])){
				mes "A member is not online.";
				close;
				}
			TICKETMANIAC = 0;
			warp "payon",123,123;		
			end;
			}
		detachrid;
	}
	return;
}

feel free to test this (not sure if it's gonna work no time to test it) :))

11 hours ago, Secrets said:

Use getvar instead of attachrid

It's working except for one thing.. The function did check the location of all party member however if a member is not in the map of prontera, that player receive the message "All members is not in prontera.". this message should be getting by the party leader only.

Link to comment
Share on other sites

  • 0

  • Group:  Developer
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   431
  • Joined:  01/26/16
  • Last Seen:  

function	check	{
	.@pid = getcharid(1);
	if(!.@pid) end;
	if(getpartyleader(.@pid, 2) != getcharid(0)) {
		message strcharinfo(0), "You are not the party leader";
		end;
	}
	getpartymember .@pid,0;
	getpartymember .@pid,1;
	getpartymember .@pid,2;
	
	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
			getmapxy(.@map$,.@x,.@y,UNITTYPE_PC, $@partymembername$[.@i]);
			if(.@map$ != "prontera") {
				message strcharinfo(0), "Some members are not in Prontera";
				end;
			}
			if(getvar(TICKETMANIAC, $@partymembercid[.@i]) < 1) {
				message strcharinfo(0), "Some members don't have the ticket";
				end;
			}
			
		} else {
			message strcharinfo(0), "Some members are offline";
			end;
		}
	}
	
	for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
		if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) )
			set TICKETMANIAC, TICKETMANIAC - 1, $@partymembercid[.@i];
	}
	
	warpparty "morocc",0,0,.@pid;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  06/21/18
  • Last Seen:  

@Secrets How about checks if the player doesn't have a quest by using `checkquest` command. quest ID's are in arrays. Thanks

Link to comment
Share on other sites

  • -1

  • Group:  Developer
  • Topic Count:  50
  • Topics Per Day:  0.02
  • Content Count:  763
  • Reputation:   227
  • Joined:  02/11/17
  • Last Seen:  

function	party_check	{
	.@map$ = "prontera";
	getpartymember getcharid(1),2;
	getpartymember getcharid(1),2;
	for( .@i = 0; .@i < $@partymembercount; .@i++ ){
		if(attachrid($@partymemberaid[.@i])) {
			if(strcharinfo(3) != .@map$){
			mes "All members is not in prontera.";
			close;
			}
			if(TICKETMANIAC == 1){
				mes "Some of your party members does not have ticket maniac.";
				close;
				}
			if(!isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i])){
				mes "A member is not online.";
				close;
				}
			TICKETMANIAC = 0;
			warp "payon",123,123;		
			end;
			}
		detachrid;
	}
	return;
}

feel free to test this (not sure if it's gonna work no time to test it) :))

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