NWScript:
void TransportPartyToDestination(string sDestinationWaypointTag, float fWait)
{
object oDestination = GetWaypointByTag(sDestinationWaypointTag);
object oPC = GetNearestPC();
object oParty = GetFirstFactionMember(oPC);
while(GetIsObjectValid(oParty)) {
AssignCommand(oParty, ActionWait(fWait));
AssignCommand(oParty, ActionJumpToObject(oDestination));
oParty = GetNextFactionMember(oPC);
}
}
int GetIsArmed(object oCreature)
{
return (GetIsObjectValid(GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oCreature)));
}
int GetTotalLevel(object oCreature)
{
int nTotal = 0;
int nCounter;
for (nCounter = 1; nCounter <= 3; nCounter++)
nTotal += GetLevelByPosition(nCounter, oCreature);
return nTotal;
}
int GetAreaCreatureCount(object oArea)
{
int nCreatureCount = 0;
object oCreature = GetNearestObject(OBJECT_TYPE_CREATURE);
while(GetIsObjectValid(oCreature) && GetArea(oCreature) == oArea) {
nCreatureCount++;
oCreature = GetNearestObject(OBJECT_TYPE_CREATURE, OBJECT_SELF, nCreatureCount);
}
return nCreatureCount - 1;
}
float GetCreatureHPPercentage(object oCreature = OBJECT_SELF)
{
float fHP = IntToFloat(GetCurrentHitPoints(oCreature));
float fMaxHP = IntToFloat(GetMaxHitPoints(oCreature));
float fHPPercentage = (fHP / fMaxHP) * 100.0;
return fHPPercentage;
}