I forgot to change back experiments

and added a int check for PickupItems on some commoner spawns to pick up items dropped by a player
This commit is contained in:
EpicValor
2023-09-12 22:09:04 -05:00
parent 24b959be8b
commit 05ea8fc1ca
42 changed files with 2448 additions and 1244 deletions

View File

@@ -1587,19 +1587,22 @@ location sp_RandomLocation(object oNearest, int iRandArea)
void sp_PerformActions(object oNearest, object oCurrent) {
if (GetLocalInt(oNearest, "PickupItems"))
{
object oPickup = GetNearestObject(OBJECT_TYPE_ITEM, oNearest);
object oCurrent = GetNearestCreatureToLocation(CREATURE_TYPE_PLAYER_CHAR, FALSE, GetLocation(oPickup), 1, CREATURE_TYPE_IS_ALIVE, TRUE);
if (GetDistanceBetweenLocations(GetLocation(oPickup),
GetLocation(oCurrent)) < 30.0)
{
if (GetLocalInt(oCurrent, "PickupItems"))
{
object oPickup = GetNearestObject(OBJECT_TYPE_ITEM, oCurrent);
if (GetDistanceBetweenLocations(GetLocation(oCurrent),
GetLocation(oPickup)) < 8.0)
{
object oCurrent = GetNearestCreatureToLocation(CREATURE_TYPE_PLAYER_CHAR, FALSE, GetLocation(oPickup), 1, CREATURE_TYPE_IS_ALIVE, TRUE);
AssignCommand(oCurrent, ClearAllActions());
AssignCommand(oCurrent, ActionForceMoveToObject(oPickup, FALSE, 1.0f, 10.0f));
AssignCommand(oCurrent, ActionPickUpItem(oPickup));
AssignCommand(oCurrent, SpeakString("Ooo, a piece of candy!"));
AssignCommand(oCurrent, ClearAllActions());
AssignCommand(oCurrent, ActionForceMoveToObject(oPickup, FALSE, 5.0f, 10.0f));
AssignCommand(oCurrent, ActionForceMoveToObject(oPickup, FALSE, 1.0f, 10.0f));
AssignCommand(oCurrent, ActionPickUpItem(oPickup));
AssignCommand(oCurrent, ActionSpeakString("Ooh, a piece of candy!"));
}
}
}
// Debug
if (iDebug == 3) {
sp_Debug("sp_PerformActions");