• 0
dfabsgwapings

Help in detecting party member

Question

hi everyone,

can anyone help me fixing this part of my script?

getpartymember(getcharid(1),0);
	getpartymember(getcharid(1),1);
	getpartymember(getcharid(1),2);
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		set [email protected],query_sql("SELECT * FROM char_reg_num_db WHERE char_id = "[email protected][[email protected]]+"", [email protected],[email protected]$,[email protected],[email protected] ); 
			if (( [email protected] != [email protected][[email protected]] ) && ( [email protected]$ != "BloodQuest" ) && ( [email protected] != 6 )){
				mes "I'm sorry but one or some of your party member is not allowed to participate in Blood Quest.";
				close;
			}
	}
	mes "Which battlefield will you attempt?";
		if ( BloodQuest == 6 ) { switch(select("It's Bloody Rain")){
			case 1:
				[email protected] = getcharid(1);
				set .PQStatus,1;
				donpcevent "BloodyRain::OnStart";
				warpparty "hell", 112, 136, [email protected], "prontera";
				end;
			}
		}

what i am trying to do here is when the party leader click the npc and tried to start the quest the whole party will be warp to the quest map if the party meets the requirement of the NPC. 

 

The only requirement is if the members was able to talk to a pre-requisite npc and get the variable of ( BloodQuest == 6 ) the whole party will be able to begin the quest, however if some of the member did not meet the requirement the party will not be able to start the quest until the member will be able to talk to a pre-requisite npc or remove from the party.

 

I hope someone can help me..

Share this post


Link to post
Share on other sites

7 answers to this question

  • 0

post the whole script so people can help you not just the support team of hercules.. if you think they'd still your script then don't post it :D
ive seen many people asking for help and not posting their whole script.. and that's the sad thing they don't get help

Share this post


Link to post
Share on other sites
  • 0

What I usually do in cases like yours is to use attachrid() on every index of the info arrays, then do something for each player

In your case, I think that you will need to run this loop twice:
on the first time, you will
 

for(blablabla){
attachrid();
if(BloodQuest != 6){
announce strcharinfo(0)+" needs to talk to the NPC first";
end;
}
}

then in the second loop

for(blablabla){
attachrid();
warp "map", x, y;
}

That way you wont need to use SQL. Search in the forum/downloads for the addrid() script command (plugin?), it may help a bit.

Share this post


Link to post
Share on other sites
  • 0
	[email protected] = getcharid(3); // save account id of player who talk to npc
	getpartymember(getcharid(1),0);
	getpartymember(getcharid(1),1);
	getpartymember(getcharid(1),2);
	for ( [email protected] = 0; [email protected] < [email protected]; [email protected]++ ) {
		if ( isloggedin( [email protected][[email protected]], [email protected][[email protected]] ) ) { // check if they are online and..
			attachrid ([email protected][[email protected]]); // attach them to the script
			if (BloodQuest != 6) { // check your condition
				mes "I'm sorry but one or some of your party member is not allowed to participate in Blood Quest.";
				close;
			}
		}
	}
	attachrid([email protected]); // after all is done attach the npc back to player

may this help you

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now