Jump to content
  • 0
Sign in to follow this  
almarket23

How the script identify if the whole party member is dead?

Question

Hi  everyone. I've been searching this one but I can't really find it. How can the script identify that all party member is dead?


 


Cause this is what I am trying to do. The whole party will enter an instance. If the whole party member is dead the script will trigger it and the whole party will be warped out from the map after 2 mins.


 


I hope some knows how to do this. Thanks in advance :D


Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

I guess this would do the trick:
 

-	script	InstanceCheck	FAKE_NPC,{
	end;

OnPCDieEvent:
	if (!compare(strcharinfo(PC_MAP), "@"))
		end;
	.@player$ = strcharinfo(PC_NAME);
	.@party_id = getcharid(CHAR_ID_PARTY);
	.@map$ = strcharinfo(PC_MAP);
	getpartymember .@party_id, 2;
	copyarray .@party_aid[0], $@partymemberaid[0], $@partymembercount;
	sleep 100;	// Intended delay to processing.
	callsub S_CheckAlive, .@party_id, .@map$, .@party_aid;
	message .@player$, "All your allies are dead. Preparing to warp all of you to Prontera.";
	sleep 120000;
	callsub S_CheckAlive, .@party_id, .@map$, .@party_aid;
	mapwarp .@map$, "prontera", 156, 191;
	end;

S_CheckAlive:
	for (.@i = 0; .@i < getarraysize(getarg(2)); ++.@i) {
		if (attachrid(getelementofarray(getarg(2), .@i)))
			if (getcharid(CHAR_ID_PARTY) == getarg(0) && strcharinfo(PC_MAP) == getarg(1) && Hp)
				end;
	}
	return;
}

 
What this script does is compare every party member with the one who triggers the script, ignoring those outside of the instance map and stoping if one of them is inside but not dead. After all, will wait 2 minutes and then warp all of them to Prontera, after checking again if all of them are still dead.
 
R418.109273

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

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