32 lines
1.2 KiB
Plaintext
32 lines
1.2 KiB
Plaintext
// consolidation rescue
|
|
void main()
|
|
{
|
|
object oWP=GetObjectByTag("UNC_HOLDING");
|
|
int nC=1;
|
|
object oCR=GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,oWP,nC);
|
|
object oDest;
|
|
object oLead;
|
|
location lLoc;
|
|
while(oCR!=OBJECT_INVALID)
|
|
{ // check to see if should be deconsolidated
|
|
oLead=GetLocalObject(oCR,"oConsolidationLeader");
|
|
if (oLead==OBJECT_INVALID||GetIsDead(oLead)==TRUE)
|
|
{ // need to deconsolidate
|
|
SetCommandable(TRUE,oCR);
|
|
SetAILevel(oCR,AI_LEVEL_NORMAL);
|
|
SetLocalInt(oCR,"nSState",0);
|
|
oDest=GetWaypointByTag(GetLocalString(oCR,"sTeamToRaid")+"_RECOVER");
|
|
if (oLead!=OBJECT_INVALID) lLoc=GetLocation(oLead);
|
|
else if (oDest!=OBJECT_INVALID) lLoc=GetLocation(oDest);
|
|
else { oDest=GetWaypointByTag(GetLocalString(oCR,"sTeamID")+"_RECOVER");
|
|
lLoc=GetLocation(oDest); }
|
|
DelayCommand(0.3,AssignCommand(oCR,ClearAllActions(TRUE)));
|
|
DelayCommand(0.4,AssignCommand(oCR,ActionJumpToLocation(lLoc)));
|
|
DeleteLocalObject(oCR,"oConsolidationLeader");
|
|
DeleteLocalInt(oCR,"bConsolidationLeader");
|
|
} // need to deconsolidate
|
|
nC++;
|
|
oCR=GetNearestCreature(CREATURE_TYPE_IS_ALIVE,TRUE,oWP,nC);
|
|
} // check to see if should be deconsolidated
|
|
}
|