Aantioch_Infernum/_module/nss/69_hench_pickup2.nss
EpicValor e5f3606cac party loot with henchmen 100% working
some other changes I made last night before bed.
2023-09-19 22:54:03 -05:00

65 lines
2.4 KiB
Plaintext

#include "69_inc_henai"
void main()
{
object oMaster = GetMaster();
ClearAllActions();
SetAssociateState(NW_ASC_IS_BUSY);
int bFound = FALSE;
string sName;
location lCenter = GetLocation(OBJECT_SELF);
object oThing = GetFirstObjectInShape(SHAPE_SPHERE, 60.0, lCenter, TRUE, OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_ITEM);
// Create a list of party members
object oPartyMember = GetFirstFactionMember(oMaster, TRUE);
while (GetIsObjectValid(oThing))
{
if (GetObjectType(oThing) == OBJECT_TYPE_ITEM)
{
bFound = TRUE;
sName = GetName(oThing);
{
ActionDoCommand(SendMessageToPC(oPartyMember, GetName(oMaster) +"'s" + " golem picked up " + sName + "."));
ActionPickUpItem(oThing);
//oPartyMember = GetNextFactionMember(oMaster, TRUE);
}
}
else // oThing is a placeable
{
if (GetHasInventory(oThing)) // Containers (including corpses)
{
// Don't search locked containers
// Only search trapped containers if you can't see the trap
if (!GetLocked(oThing) && (!GetIsTrapped(oThing) || (GetIsTrapped(oThing) && !GetTrapDetectedBy(oThing, OBJECT_SELF))))
{
bFound = TRUE;
ActionMoveToObject(oThing, TRUE, 1.0f);
ActionPlayAnimation(ANIMATION_LOOPING_GET_MID, 3.0, 0.5);
object oItem = GetFirstItemInInventory(oThing);
string sItem = GetName(oItem);
while (GetIsObjectValid(oItem))
{
ActionDoCommand (SendMessageToPC(oPartyMember, GetName(oMaster) +"'s" + " golem picked up " + sItem + "."));
ActionTakeItem(oItem, oThing);
oItem = GetNextItemInInventory(oThing);
}
ActionDoCommand(AssignCommand(oThing, PlayAnimation(ANIMATION_PLACEABLE_CLOSE)));
}
oPartyMember = GetNextFactionMember(oMaster);
}
//}
} // else
oThing = GetNextObjectInShape(SHAPE_SPHERE, 60.0, lCenter, TRUE, OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_ITEM);
} // while(GetIsObjectValid(oThing))
ActionDoCommand(SetAssociateState(NW_ASC_IS_BUSY, FALSE));
if (!bFound)
SpeakString("I don't see where I can find any around here.");
}