Jump to content
  • 0
Sign in to follow this  
dfabsgwapings

Set Variable HELP!

Question

Can anyone fix this for me please.. 

What I am doing is when the whole party killed a boss quest all of the member will have 

set Flower,1;

and my current script that I have is 

.@party_id = getcharid(1);
	getpartymember .@party_id, 1;
		for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
			if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
				attachrid $@partymembercid[.@i];
				if ( strcharinfo(3) == "poring_w03" )
					set Flower,7;
					sleep 5000;
					warpparty "prontera", 152, 150, .@party_id, "poring_w03";
			}
		}
end;

and what my script doing is only the one who killed the boss is the one was able to get the 

set Flower,1;

What I need is all of the party members should have 

set Flower,1;

 

Please help me guys.. Thanks in advance 

Share this post


Link to post
Share on other sites

4 answers to this question

Recommended Posts

  • 0

try moving sleep and warpparty out from loop.

should be right after your last curlys you posted above.

Share this post


Link to post
Share on other sites
  • 0

@Legend

I tried to do it however it only give the Variable on 1 player and once they do the quest again it gives the others the variable automatically while they are not yet done doing the quest.
 
This is the part of my script wherein the Boss is summoned and how the script work once the Boss is killed. Hope this one can help you solve the problem.
 
OnFinalRound:
	monster "poring_w02",97,96,"--ja--",3003,1,"BloodyRain::OnMyFinalBossDead";
	end;

OnMyFinalBossDead:
	mapannounce "poring_w02","Satan: Nooooooooooo.", bc_map,0xFF0000;
	.@party_id = getcharid(1);
		getpartymember .@party_id, 1;
		for ( .@i = 0; .@i < $@partymembercount; .@i++ ) {
			if ( isloggedin( $@partymemberaid[.@i], $@partymembercid[.@i] ) ) {
				attachrid $@partymemberaid[.@i];
				if ( strcharinfo(3) == "poring_w02" )
					set BloodyQuest,7;
					set .MobPetDead,0;
					set .PR_Round,0;
					set getvariableofnpc(.PQStatus,"Tree of Blood"),getvariableofnpc(.PQStatus,"Tree of Blood") - 1;
			}
		}
	detachrid;
	sleep 5000;
	warpparty "prontera", 152, 150, .@party_id, "poring_w02";
	end;

What I am doing is when the whole party killed a boss quest, all of the member will set the BloodyQuest to 7.

 

 

Edited by dfabsgwapings

Share this post


Link to post
Share on other sites
  • 0

you might as well add

getpartymember .@party_id, 2;

for the thorough explanation about getpartymember: https://github.com/HerculesWS/Hercules/blob/master/doc/script_commands.txt#L2599


Here you go,

// =============================================
prontera,170,171,4	script	Support#2	4_F_SURA,{
	getpartymember getcharid(1), 1;
	getpartymember getcharid(1), 2;
		for (.@a = 0; .@a < $@partymembercount; .@a++) {
			if (isloggedin($@partymemberaid[.@a], $@partymembercid[.@a])) {
				attachrid $@partymemberaid[.@a];
				testing123++;
				dispbottom "Current Count: "+testing123; // DEBUG PURPOSE
			}
		}
	detachrid;
	end;
}

 

Feel free to use that as reference.

Edited by Legend

Share this post


Link to post
Share on other sites
  • 0

Thankfully I added a new buildin for that: getvariableofpc()

 

Try this: 

set(getvariableofpc(<variable>, <account id>), <value>);

 

With your code it would give:

getpartymember(getcharid(CHAR_ID_PARTY), 2);

for (.@i = 0; .@i < $@partymembercount; ++.@i) {
	.@acc = $@partymemberaid[.@i];

	if (isloggedin(.@acc) && strcharinfo(PC_MAP, .@acc) == "poring_w03") {
		set(getvariableofpc(Flower, .@acc), 1);
	}
}
Edited by meko

Share this post


Link to post
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.   Restore formatting

  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.

Loading...
Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.