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

almarket23

New member
Messages
90
Points
0
Github
nexus
Emulator
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
default_biggrin.png


 
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

 
Back
Top