public override void DoAction(NWPlayer player, string pageName, int responseID) { if (player.Gold < 50) { player.FloatingText("You don't have enough credits to retrieve that item."); return; } var response = GetResponseByID("MainPage", responseID); Guid pcImpoundedItemID = (Guid)response.CustomData; var item = _data.Single <PCImpoundedItem>(x => x.ID == pcImpoundedItemID); if (item.DateRetrieved != null) { player.FloatingText("You have already retrieved that item."); return; } item.DateRetrieved = DateTime.UtcNow; _data.SubmitDataChange(item, DatabaseActionType.Update); _serialization.DeserializeItem(item.ItemObject, player); _.TakeGoldFromCreature(50, player, TRUE); LoadMainPage(); }
public bool Run(params object[] args) { NWPlaceable chest = NWPlaceable.Wrap(Object.OBJECT_SELF); int structureID = chest.GetLocalInt("STRUCTURE_TEMP_STRUCTURE_ID"); PCTerritoryFlagsStructure entity = _structure.GetPCStructureByID(structureID); Location location = chest.Location; foreach (PCTerritoryFlagsStructuresItem item in entity.PCTerritoryFlagsStructuresItems) { _serialization.DeserializeItem(item.ItemObject, chest); } chest.IsUseable = false; return(true); }
public bool Run(params object[] args) { NWPlaceable container = NWPlaceable.Wrap(Object.OBJECT_SELF); NWPlayer oPC = NWPlayer.Wrap(_.GetLastOpenedBy()); var items = _db.PCOverflowItems.Where(x => x.PlayerID == oPC.GlobalID); foreach (PCOverflowItem item in items) { NWItem oItem = _serialization.DeserializeItem(item.ItemObject, container); oItem.SetLocalInt("TEMP_OVERFLOW_ITEM_ID", (int)item.PCOverflowItemID); } container.IsUseable = false; return(true); }
public bool Run(params object[] args) { NWPlaceable container = (Object.OBJECT_SELF); NWPlayer oPC = (_.GetLastOpenedBy()); var items = _data.Where <PCOverflowItem>(x => x.PlayerID == oPC.GlobalID).ToList(); foreach (PCOverflowItem item in items) { NWItem oItem = _serialization.DeserializeItem(item.ItemObject, container); oItem.SetLocalString("TEMP_OVERFLOW_ITEM_ID", item.ID.ToString()); } container.IsUseable = false; return(true); }
public bool Run(params object[] args) { NWPlaceable chest = (Object.OBJECT_SELF); Guid structureID = new Guid(chest.GetLocalString("PC_BASE_STRUCTURE_ID")); var structure = _data.Single <PCBaseStructure>(x => x.ID == structureID); var items = _data.Where <PCBaseStructureItem>(x => x.PCBaseStructureID == structure.ID); foreach (var item in items) { _serialization.DeserializeItem(item.ItemObject, chest); } chest.IsUseable = false; return(true); }
public bool Run(params object[] args) { NWPlayer player = _.GetLastOpenedBy(); if (!player.IsPlayer) { return(false); } NWPlaceable terminal = Object.OBJECT_SELF; NWArea area = terminal.Area; int bankID = terminal.GetLocalInt("BANK_ID"); if (bankID <= 0) { Console.WriteLine("WARNING: Bank ID is not set on bank in area: " + area.Name); return(false); } Data.Entity.Bank entity = _data.SingleOrDefault <Data.Entity.Bank>(x => x.ID == bankID); if (entity == null) { entity = new Data.Entity.Bank { AreaName = area.Name, AreaResref = area.Resref, AreaTag = area.Tag, ID = bankID }; _data.SubmitDataChange(entity, DatabaseActionType.Insert); } var bankItems = _data.Where <BankItem>(x => x.PlayerID == player.GlobalID && x.BankID == entity.ID); foreach (BankItem item in bankItems.Where(x => x.PlayerID == player.GlobalID)) { _serialization.DeserializeItem(item.ItemObject, terminal); } terminal.IsLocked = true; player.SendMessage("Walk away from the terminal when you are finished banking."); return(true); }
public void OnModuleLoad() { List <PCCorpse> entities = _db.PCCorpses.ToList(); foreach (PCCorpse entity in entities) { NWArea area = NWArea.Wrap(_.GetObjectByTag(entity.AreaTag)); Vector position = new Vector((float)entity.PositionX, (float)entity.PositionY, (float)entity.PositionZ); Location location = _.Location(area.Object, position, (float)entity.Orientation); NWPlaceable corpse = NWPlaceable.Wrap(_.CreateObject(OBJECT_TYPE_PLACEABLE, CorpsePlaceableResref, location)); corpse.Name = entity.Name; corpse.IdentifiedDescription = entity.Name; corpse.SetLocalInt("CORPSE_ID", (int)entity.PCCorpseID); foreach (PCCorpseItem item in entity.PCCorpseItems) { _serialization.DeserializeItem(item.NWItemObject, corpse); } } }
private void OpenResourceBay() { NWPlaceable tower = (NWPlaceable)GetDialogTarget(); NWPlayer oPC = GetPC(); NWPlaceable bay = tower.GetLocalObject("CONTROL_TOWER_RESOURCE_BAY"); if (bay.IsValid) { NWObject accessor = bay.GetLocalObject("BAY_ACCESSOR"); if (!accessor.IsValid) { bay.Destroy(); } else { oPC.FloatingText("Someone else is already accessing that structure's inventory. Please wait."); return; } } Guid structureID = new Guid(tower.GetLocalString("PC_BASE_STRUCTURE_ID")); var structureItems = _data.Where <PCBaseStructureItem>(x => x.PCBaseStructureID == structureID); Location location = oPC.Location; bay = _.CreateObject(OBJECT_TYPE_PLACEABLE, "resource_bay", location); tower.SetLocalObject("CONTROL_TOWER_RESOURCE_BAY", bay.Object); bay.SetLocalObject("CONTROL_TOWER_PARENT", tower.Object); bay.SetLocalString("PC_BASE_STRUCTURE_ID", structureID.ToString()); foreach (var item in structureItems) { _serialization.DeserializeItem(item.ItemObject, bay); } oPC.AssignCommand(() => _.ActionInteractObject(bay.Object)); }
public void OnChestOpened(NWPlaceable oChest) { NWArea oArea = oChest.Area; int containerID = oChest.GetLocalInt("STORAGE_CONTAINER_ID"); if (containerID <= 0) { return; } StorageContainer entity = _db.StorageContainers.SingleOrDefault(x => x.StorageContainerID == containerID); bool chestLoaded = oChest.GetLocalInt("STORAGE_CONTAINER_LOADED") == 1; if (chestLoaded) { return; } if (entity == null) { entity = new StorageContainer { AreaName = oArea.Name, AreaResref = oArea.Resref, AreaTag = oArea.Tag, StorageContainerID = containerID }; _db.StorageContainers.Add(entity); _db.SaveChanges(); } foreach (StorageItem item in entity.StorageItems) { _serialization.DeserializeItem(item.ItemObject, oChest); } oChest.SetLocalInt("STORAGE_CONTAINER_LOADED", 1); }
public void OnChestOpen(NWPlaceable oChest) { NWPlayer oPC = (_.GetLastOpenedBy()); if (!oPC.IsPlayer) { return; } if (_.GetActionMode(oPC.Object, NWScript.ACTION_MODE_STEALTH) == NWScript.TRUE) { _.SetActionMode(oPC.Object, NWScript.ACTION_MODE_STEALTH, NWScript.FALSE); } string resref = oChest.Resref; int chestID = oChest.GetLocalInt(SearchSiteIDVariableName); int skillRank = _.GetSkillRank(NWScript.SKILL_SEARCH, oPC.Object); int numberOfSearches = (skillRank / ExtraSearchPerNumberLevels) + 1; PCSearchSite searchEntity = _data.SingleOrDefault <PCSearchSite>(x => x.PlayerID == oPC.GlobalID && x.SearchSiteID == chestID); DateTime timeLock = DateTime.UtcNow; if (numberOfSearches <= 0) { numberOfSearches = 1; } if (searchEntity != null) { timeLock = searchEntity.UnlockDateTime; } if (resref == SearchSiteCopyResref) { oChest.IsUseable = false; } _quest.SpawnQuestItems(oChest, oPC); if (timeLock < DateTime.UtcNow || searchEntity == null) { int dc = oChest.GetLocalInt(SearchSiteDCVariableName); for (int search = 1; search <= numberOfSearches; search++) { RunSearchCycle(oPC, oChest, dc); dc += _random.Random(3) + 1; } SaveChestInventory(oPC, oChest, false); } else { var searchItems = _data.Where <PCSearchSiteItem>(x => x.PlayerID == oPC.GlobalID && x.SearchSiteID == searchEntity.SearchSiteID).ToList(); foreach (PCSearchSiteItem item in searchItems) { NWItem oItem = _serialization.DeserializeItem(item.SearchItem, oChest); // Prevent item duplication in containers if (oItem.HasInventory) { foreach (NWItem containerItem in oItem.InventoryItems) { containerItem.Destroy(); } } } } }
private void BlowUpBase(PCBase pcBase) { NWArea area = (_.GetArea(Object.OBJECT_SELF)); List <AreaStructure> cache = area.Data["BASE_SERVICE_STRUCTURES"]; cache = cache.Where(x => x.PCBaseID == pcBase.ID).ToList(); foreach (var structure in cache) { // Child structures will be picked up later on in the process. // Just destroy the structure and continue on. if (structure.ChildStructure != null) { structure.Structure.Destroy(); continue; } var dbStructure = _data.Get <PCBaseStructure>(structure.PCBaseStructureID); var baseStructure = _data.Get <BaseStructure>(dbStructure.BaseStructureID); var items = _data.Where <PCBaseStructureItem>(x => x.PCBaseStructureID == structure.PCBaseStructureID).ToList(); var children = _data.Where <PCBaseStructure>(x => x.ParentPCBaseStructureID == dbStructure.ParentPCBaseStructureID).ToList(); // Explosion effect Location location = structure.Structure.Location; _.ApplyEffectAtLocation(DURATION_TYPE_INSTANT, _.EffectVisualEffect(VFX_FNF_FIREBALL), location); // Boot from instance, if any _base.BootPlayersOutOfInstance(structure.PCBaseStructureID); // Spawn container for items NWPlaceable container = (_.CreateObject(OBJECT_TYPE_PLACEABLE, "structure_rubble", structure.Structure.Location)); container.Name = baseStructure.Name + " Rubble"; // Drop item storage into container for (int i = items.Count - 1; i >= 0; i--) { var dbItem = items.ElementAt(i); _serialization.DeserializeItem(dbItem.ItemObject, container); _data.SubmitDataChange(dbItem, DatabaseActionType.Delete); } // Convert child placeables to items and drop into container for (int f = children.Count - 1; f >= 0; f--) { var child = children.ElementAt(f); var childItems = _data.Where <PCBaseStructureItem>(x => x.PCBaseStructureID == child.ID).ToList(); // Move child items to container for (int i = childItems.Count - 1; i >= 0; i++) { var dbItem = childItems.ElementAt(i); _serialization.DeserializeItem(dbItem.ItemObject, container); _data.SubmitDataChange(dbItem, DatabaseActionType.Delete); } // Convert child structure to item _base.ConvertStructureToItem(child, container); _data.SubmitDataChange(child, DatabaseActionType.Delete); } // Clear structure permissions var structurePermissions = _data.Where <PCBaseStructurePermission>(x => x.PCBaseStructureID == dbStructure.ID).ToList(); for (int p = structurePermissions.Count - 1; p >= 0; p--) { var permission = structurePermissions.ElementAt(p); _data.SubmitDataChange(permission, DatabaseActionType.Delete); } // Destroy structure placeable _data.SubmitDataChange(dbStructure, DatabaseActionType.Delete); structure.Structure.Destroy(); } // Remove from cache foreach (var record in cache) { ((List <AreaStructure>)area.Data["BASE_SERVICE_STRUCTURES"]).Remove(record); } var basePermissions = _data.Where <PCBasePermission>(x => x.PCBaseID == pcBase.ID).ToList(); // Clear base permissions for (int p = basePermissions.Count - 1; p >= 0; p--) { var permission = basePermissions.ElementAt(p); _data.SubmitDataChange(permission, DatabaseActionType.Delete); } _data.SubmitDataChange(pcBase, DatabaseActionType.Delete); Area dbArea = _data.Single <Area>(x => x.Resref == pcBase.AreaResref); if (pcBase.Sector == AreaSector.Northeast) { dbArea.NortheastOwner = null; } else if (pcBase.Sector == AreaSector.Northwest) { dbArea.NorthwestOwner = null; } else if (pcBase.Sector == AreaSector.Southeast) { dbArea.SoutheastOwner = null; } else if (pcBase.Sector == AreaSector.Southwest) { dbArea.SouthwestOwner = null; } }
private void HandleLoadOutfit(int responseID) { DialogResponse response = GetResponseByID("LoadOutfitPage", responseID); if (!response.HasCustomData) { ChangePage("MainPage"); } else { NWPlayer oPC = GetPC(); int outfitID = (int)response.CustomData[string.Empty]; PCOutfit entity = GetPlayerOutfits(GetPC()); NWPlaceable oTempStorage = NWPlaceable.Wrap(_.GetObjectByTag("OUTFIT_BARREL")); NWItem oClothes = oPC.Chest; NWItem storedClothes = null; oClothes.SetLocalString("TEMP_OUTFIT_UUID", oPC.GlobalID); if (outfitID == 1) { storedClothes = _serialization.DeserializeItem(entity.Outfit1, oTempStorage); } else if (outfitID == 2) { storedClothes = _serialization.DeserializeItem(entity.Outfit2, oTempStorage); } else if (outfitID == 3) { storedClothes = _serialization.DeserializeItem(entity.Outfit3, oTempStorage); } else if (outfitID == 4) { storedClothes = _serialization.DeserializeItem(entity.Outfit4, oTempStorage); } else if (outfitID == 5) { storedClothes = _serialization.DeserializeItem(entity.Outfit5, oTempStorage); } else if (outfitID == 6) { storedClothes = _serialization.DeserializeItem(entity.Outfit6, oTempStorage); } else if (outfitID == 7) { storedClothes = _serialization.DeserializeItem(entity.Outfit7, oTempStorage); } else if (outfitID == 8) { storedClothes = _serialization.DeserializeItem(entity.Outfit8, oTempStorage); } else if (outfitID == 9) { storedClothes = _serialization.DeserializeItem(entity.Outfit9, oTempStorage); } else if (outfitID == 10) { storedClothes = _serialization.DeserializeItem(entity.Outfit10, oTempStorage); } if (storedClothes == null) { throw new Exception("Unable to locate stored clothes."); } Object oCopy = _.CopyItem(oClothes.Object, oTempStorage.Object, TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LBICEP), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LBICEP, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LBICEP), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_BELT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_BELT), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_BELT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_BELT), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOOT), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LFOOT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LFOOT), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LFOREARM), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LFOREARM, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LFOREARM), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LHAND), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LHAND, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LHAND), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHIN), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LSHIN, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LSHIN), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LSHOULDER), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LSHOULDER, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LSHOULDER), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_LTHIGH), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LTHIGH, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_LTHIGH), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_NECK, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_NECK), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_NECK, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_NECK), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_PELVIS, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_PELVIS), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_PELVIS, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_PELVIS), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RBICEP), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RBICEP, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RBICEP), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOOT), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RFOOT, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RFOOT), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RFOREARM), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RFOREARM, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RFOREARM), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RHAND), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RHAND, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RHAND), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_ROBE, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_ROBE), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_ROBE, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_ROBE), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHIN), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RSHIN, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RSHIN), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RSHOULDER), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RSHOULDER, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RSHOULDER), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_RTHIGH), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RTHIGH, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_RTHIGH), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_MODEL, ITEM_APPR_ARMOR_MODEL_TORSO), TRUE); oCopy = _.CopyItemAndModify(oCopy, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_TORSO, _.GetItemAppearance(storedClothes.Object, ITEM_APPR_TYPE_ARMOR_COLOR, ITEM_APPR_ARMOR_MODEL_TORSO), TRUE); NWItem oFinal = NWItem.Wrap(_.CopyItem(oCopy, oPC.Object, TRUE)); oFinal.DeleteLocalString("TEMP_OUTFIT_UUID"); _.DestroyObject(oCopy); oClothes.Destroy(); storedClothes.Destroy(); oPC.AssignCommand(() => _.ActionEquipItem(oFinal.Object, INVENTORY_SLOT_CHEST)); foreach (NWItem item in oTempStorage.InventoryItems) { if (item.GetLocalString("TEMP_OUTFIT_UUID") == oPC.GlobalID) { item.Destroy(); } } ShowLoadOutfitOptions(); } }