using CreateItemOnObject on chest with undroppable item
fot1
Member Posts: 74
Hello! I'm creating an undroppable item on the chest with CreateItemOnObject, but my players can't loot it. It reads "That item cannot be given away". It works just fine if I place the item in the container inventory using the toolset, though.
How can I put this item in a chest using scripts in order to players be able to take it?
Thanks in advance!
How can I put this item in a chest using scripts in order to players be able to take it?
Thanks in advance!
0
Comments
The chest's OnDisturbered event: something like so:
void main() { object oItem = GetInventoryDisturbItem(); if (GetTag(oItem) == "NoDropDagger")//test item tag { SetItemCursedFlag(oItem, TRUE); } }The module OnAcquireItem event: (if you have tag based scripts turned on then give the script the same name as the tag of the item) something like so:
#include "x2_inc_switches" void main() { int iEvent = GetUserDefinedItemEventNumber(); if (iEvent != X2_ITEM_EVENT_ACQUIRE) return; object oItem = GetModuleItemAcquired(); SetItemCursedFlag(oItem, TRUE); }Hope it helps. Good luck.