//Contributed by Mike Daneman aka. Mishenka //Modified: 69MEH69 Added more items to pick up #include "69_inc_henai" void main() { 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); object oMaster = GetMaster(OBJECT_SELF); object oParty = GetFirstFactionMember(OBJECT_SELF, TRUE); while(GetIsObjectValid(oThing)) { if(GetObjectType(oThing)==OBJECT_TYPE_ITEM) { bFound = TRUE; sName = GetName(oThing); TurnToFaceObject(oThing); ActionMoveToObject (oThing, TRUE, 1.0f); ActionDoCommand (SendMessageToPC(oParty, GetName(oMaster)+"'s golem"+" picked up "+sName+".")); ActionPickUpItem(oThing); //oParty = GetNextFactionMember(OBJECT_SELF, 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); ActionDoCommand(AssignCommand(oThing,PlayAnimation(ANIMATION_PLACEABLE_OPEN))); TurnToFaceObject(oThing); ActionPlayAnimation(ANIMATION_LOOPING_GET_MID,3.0,0.5); object oItem = GetFirstItemInInventory(oThing); object oMaster = GetMaster(OBJECT_SELF); object oParty = GetFirstFactionMember(OBJECT_SELF, TRUE); while(GetIsObjectValid(oItem)) { ActionDoCommand (SendMessageToPC(oParty, GetName(oMaster)+"'s golem"+" picked up "+GetName(oItem)+" from "+GetName(oThing)+".")); ActionTakeItem(oItem,oThing); oParty = GetNextFactionMember(OBJECT_SELF, TRUE); oItem = GetNextItemInInventory(oThing); } ActionDoCommand(AssignCommand(oThing,PlayAnimation(ANIMATION_PLACEABLE_CLOSE))); } } } // 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) ActionSpeakString("I don't see where I can find any around here.", TALKVOLUME_PARTY); }