void c_ClientAcceptImbueItemInfo(object sender, ClientAcceptImbueItemEventArgs e) { Client c = (Client)sender; AcceptImbueItem i = e.Info; Equipment Item = null; BaseItem item = null; BaseItem imbueItem1 = null; ImbueError error; ImbueStat stat = ImbueStat.CriticalHit; try { item = c.MyCharacter.Bags[i.ToImbueItemBag - 1].Items.Single(x => (x.ItemID == i.ToImbueItemID && x.Slot == i.ToImbueItemSlot)); if (item is Equipment) { Item = item as Equipment; } imbueItem1 = c.MyCharacter.Bags[i.ImbueItem1Bag - 1].Items.Single(x => (x.ItemID == i.ImbueItem1ID)); double SuccessChance = 33.3f; // flat 1/3 chance as there chance to success, fail, and drop so :/ if (Item.Plus == 0 && imbueItem1 is Black) { SuccessChance = 100; } if (imbueItem1 is ImbueItem) { ImbueItem imbueitem = imbueItem1 as ImbueItem; SuccessChance += (double)imbueitem.ImbueChance; } // ADD UBER LEET REMOVE FROM BAG & SAVE DATABASE YOU LOST THE ITEM PLXO int value = 0; if (itemDataManager.PercentSuccess(SuccessChance)) { value = 1; // just - value to decrease xd Item.Damage += (short)value; Item.Plus++; error = ImbueError.Success; stat = ImbueStat.Damage; } else { if (Item.Plus >= 4 && itemDataManager.PercentSuccess(30)) { // I DROP YO STATS } error = ImbueError.FailedToRemake; stat = ImbueStat.None; value = 0; } c.Send(PacketManager.SendImbueMessage(error, stat, value, Item)); c.Send(PacketManager.SendRemoveItem(i.ImbueItem1Bag, i.ImbueItem1Slot)); Item.ImbueTries++; c.Send(PacketManager.SendImbuedItem((BaseItem)Item)); itemDataManager.UpdateItem((BaseItem)Item); } catch { } }