public void UpdateClothing(Client client) { if (!client.HasData(EntityData.Account)) { return; } Account acc = client.GetData(EntityData.Account) as Account; Appearance app = Appearance.RetrieveAppearance(acc); app.Attach(client); Clothing clothing = Clothing.RetrieveClothing(acc); clothing.Attach(client); }
public static void TopOutfit(Client client, InventoryItem item) { Account account = AccountUtil.RetrieveAccount(client); Clothing clothing = Clothing.RetrieveClothing(account); TopOutfit topOutfit = JsonConvert.DeserializeObject <TopOutfit>(item.Properties); if (topOutfit == null) { return; } InventoryItem oldOutfit = new InventoryItem { ID = 0, Name = $"TopOutfit{new Random().Next(0, 999)}", StackCount = 1 }; oldOutfit.CreateTopOutfit( clothing.Mask, clothing.Undershirt, clothing.Torso, clothing.Top, clothing.Hats, clothing.Glasses ); topOutfit.Equip(clothing); clothing.Update(); clothing.UpdateClothing(client); Utilities.ForceCloseInventory(client); NAPI.Task.Run(() => { InventoryHandler.AddItemToInventory(client, oldOutfit.Name, 1, oldOutfit); }, 1000); }