// duplicates the item and returns a new object
// oItem - item to copy
// oTargetInventory - create item in this object's inventory. If this parameter
// is not valid, the item will be created in oItem's location
// bCopyVars - copy the local variables from the old item to the new one
// * returns the new item
// * returns OBJECT_INVALID for non-items.
// * can only copy empty item containers. will return OBJECT_INVALID if oItem contains
// other items.
// * if it is possible to merge this item with any others in the target location,
// then it will do so and return the merged object.
object CopyItem(object oItem, object oTargetInventory=OBJECT_INVALID, int bCopyVars=FALSE)
We use this to put items picked up by PCs back in the auction chest during bidding:
// This method copies a randomised item + fixes its description
object GetRandItemCopy( object oItem,object targetLocation){
string sMods = GetItemPropString(oItem);
string sDescription = GetDescription(oItem);
object copiedObject = CopyItem(oItem,targetLocation,TRUE);
int nMod = StringToInt(sMods);
sMods = GetSubString(sMods, FindSubString(sMods, " ") + 1, 10000);
switch (GetLocalInt(oItem, "Modified")) {
case 1: {
// Is a modified item
SetDescription(copiedObject,sDescription);
}
break;
case 2: {
// Is a randomised item
SetDescription(copiedObject,sDescription);
}
break;
case 3:{
// Is an augmenter
SetDescription(copiedObject,sDescription);
}
break;
default : SetDescription(copiedObject,sDescription);
}
return copiedObject;
}
Oh, on rereading, I guess your core problem is not being able to put it directly on the ground. You can just put it in a place with no walkmesh and then kill the place, dumping the item onto the ground. Sorry, kind of out of patience after the other thread, which took a while to put together. ::
Funky
Modifié par FunkySwerve, 31 juillet 2013 - 09:26 .