diff --git a/project/src/helpers/Dialogue/SptDialogueChatBot.ts b/project/src/helpers/Dialogue/SptDialogueChatBot.ts index 3d49055e..a844082a 100644 --- a/project/src/helpers/Dialogue/SptDialogueChatBot.ts +++ b/project/src/helpers/Dialogue/SptDialogueChatBot.ts @@ -66,6 +66,8 @@ export class SptDialogueChatBot implements IDialogueChatBot { "Hey! you got the right code!", "A secret code, how exciting!", "You found a gift code!", + "A gift code! incredible", + "A gift! what could it be!", ]), ); diff --git a/project/src/helpers/InRaidHelper.ts b/project/src/helpers/InRaidHelper.ts index cf865bf7..d11ff9ed 100644 --- a/project/src/helpers/InRaidHelper.ts +++ b/project/src/helpers/InRaidHelper.ts @@ -194,7 +194,11 @@ export class InRaidHelper { } // Pocket items are lost on death - if (item.slotId.startsWith("pocket")) { + // Ensure we dont pick up pocket items from manniquins + if ( + item.slotId.startsWith("pocket") && + this.inventoryHelper.doesItemHaveRootId(pmcProfile, item, pmcProfile.Inventory.equipment) + ) { return true; } diff --git a/project/src/helpers/InventoryHelper.ts b/project/src/helpers/InventoryHelper.ts index 1672cc57..041d9594 100644 --- a/project/src/helpers/InventoryHelper.ts +++ b/project/src/helpers/InventoryHelper.ts @@ -1148,6 +1148,28 @@ export class InventoryHelper { } } } + + /** + * Does the provided item have a root item with the provided id + * @param pmcData Profile with items + * @param item Item to check + * @param rootId Root item id to check for + * @returns True when item has rootId, false when not + */ + public doesItemHaveRootId(pmcData: IPmcData, item: IItem, rootId: string) { + let currentItem = item; + while (currentItem) { + // If we've found the equipment root ID, return true + if (currentItem._id === rootId) { + return true; + } + + // Otherwise get the parent item + currentItem = pmcData.Inventory.items.find((item) => item._id === currentItem.parentId); + } + + return false; + } } namespace InventoryHelper {