Jump to content


Photo

Set Variable HELP!


  • Please log in to reply
3 replies to this topic

#1 dfabsgwapings

dfabsgwapings

    Advanced Member

  • Members
  • PipPipPip
  • 140 posts
  • Github:dfabsgwapings

Posted 20 March 2017 - 09:32 AM

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 < [email protected]; .@i++ ) {
			if ( isloggedin( [email protected][.@i], [email protected][.@i] ) ) {
				attachrid [email protected][.@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 



#2 Legend

Legend

    Advanced Member

  • Members
  • PipPipPip
  • 334 posts
  • LocationHeaven ♥
  • Emulator:Hercules
  • Github:Legend95

Posted 20 March 2017 - 02:06 PM

try moving sleep and warpparty out from loop.
should be right after your last curlys you posted above.

You can use some of my *crappy* request scripts. It may somehow help you.

 

my ♥ belongs here


#3 dfabsgwapings

dfabsgwapings

    Advanced Member

  • Members
  • PipPipPip
  • 140 posts
  • Github:dfabsgwapings

Posted 20 March 2017 - 02:11 PM

@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 < [email protected]; .@i++ ) {
			if ( isloggedin( [email protected][.@i], [email protected][.@i] ) ) {
				attachrid [email protected][.@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, 20 March 2017 - 02:12 PM.


#4 Legend

Legend

    Advanced Member

  • Members
  • PipPipPip
  • 334 posts
  • LocationHeaven ♥
  • Emulator:Hercules
  • Github:Legend95

Posted 20 March 2017 - 04:09 PM

you might as well add

getpartymember .@party_id, 2;

for the thorough explanation about getpartymember: https://github.com/H...mands.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 < [email protected]; .@a++) {
			if (isloggedin([email protected][.@a], [email protected][.@a])) {
				attachrid [email protected][.@a];
				testing123++;
				dispbottom "Current Count: "+testing123; // DEBUG PURPOSE
			}
		}
	detachrid;
	end;
}

 

Feel free to use that as reference.


Edited by Legend, 20 March 2017 - 04:10 PM.

You can use some of my *crappy* request scripts. It may somehow help you.

 

my ♥ belongs here





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users


This topic has been visited by 15 user(s)