party loot with henchmen 100% working

some other changes I made last night before bed.
This commit is contained in:
EpicValor
2023-09-19 22:54:03 -05:00
parent 05986aecf7
commit e5f3606cac
33 changed files with 2974 additions and 693 deletions

View File

@@ -12,20 +12,26 @@ void main()
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(oMaster, TRUE);
while(GetIsObjectValid(oThing))
{
if(GetObjectType(oThing)==OBJECT_TYPE_ITEM)
{
bFound = TRUE;
{
object oParty = GetFirstFactionMember(oMaster, TRUE);
while (GetIsObjectValid(oParty))
{
// Check if it's a player character
if (GetIsPC(oParty))
{
sName = GetName(oThing);
TurnToFaceObject(oThing);
ActionMoveToObject (oThing, TRUE, 1.0f);
ActionDoCommand (SendMessageToPC(oParty, GetName(oMaster)+"'s golem"+" picked up "+sName+"."));
ActionPickUpItem(oThing);
}
oParty = GetNextFactionMember(oMaster, TRUE);
}
}
}
else // oThing is a placeable
{
@@ -39,21 +45,28 @@ void main()
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);
string iName = GetName(oItem);
object oParty = GetFirstFactionMember(oMaster, TRUE);
while (GetIsObjectValid(oParty))
{
// Check if it's a player character
if (GetIsPC(oParty))
{
ActionDoCommand (SendMessageToPC(oParty, GetName(oMaster)+"'s golem"+" picked up "+GetName(oItem)+" from "+GetName(oThing)+"."));
ActionTakeItem(oItem,oThing);
}
oParty = GetNextFactionMember(oMaster, TRUE);
oItem = GetNextItemInInventory(oThing);
}
ActionDoCommand(AssignCommand(oThing,PlayAnimation(ANIMATION_PLACEABLE_CLOSE)));
}
}
ActionDoCommand(AssignCommand(oThing,PlayAnimation(ANIMATION_PLACEABLE_CLOSE)));
}
}
}
} // else
oThing = GetNextObjectInShape(SHAPE_SPHERE,60.0,lCenter,TRUE,OBJECT_TYPE_PLACEABLE | OBJECT_TYPE_ITEM);