private void GetBelt(PlayerInfo pInfo) { Belt = new Dictionary <string, BCMItemStack>(); ItemStack[] inv; if (pInfo.EP != null) { //only recognises changes once the slot is seleted inv = pInfo.EP.inventory.GetSlots(); SelectedSlot = pInfo.EP.inventory.holdingItemIdx; } else { inv = pInfo.PDF.inventory; SelectedSlot = pInfo.PDF.selectedInventorySlot; } var j = 0; foreach (var item in inv) { BCMItemStack slot = null; if (item.itemValue.type != 0) { slot = new BCMItemStack(item); } Belt.Add(j.ToString(), slot); j++; } Bin.Add("SelectedSlot", SelectedSlot); Bin.Add("Belt", Belt); }
//use PCP for online players private void GetBag(PlayerInfo pInfo) { // Updates are instantly triggered when looting, but not when an item is moved to equipment so there is a delay of up to 30 seconds Bag = new Dictionary <string, BCMItemStack>(); var i = 1; foreach (var item in pInfo.EP != null ? pInfo.PCP.DataCache.bag : pInfo.PDF.bag) { BCMItemStack slot = null; if (item.itemValue.type != 0) { slot = new BCMItemStack(item); } Bag.Add(i.ToString(), slot); i++; } Bin.Add("Bag", Bag); }
private void GetBelt(PlayerInfo pInfo) { Belt = new Dictionary <string, BCMItemStack>(); ItemStack[] inv; if (pInfo.EP != null) { //only recognises changes once the slot is seleted inv = pInfo.EP.inventory.GetSlots(); SelectedSlot = pInfo.EP.inventory.holdingItemIdx; } else { inv = pInfo.PDF.inventory; SelectedSlot = pInfo.PDF.selectedInventorySlot; } var j = 0; foreach (var item in inv) { BCMItemStack slot = null; if (item.itemValue.type != 0) { slot = new BCMItemStack { Type = item.itemValue.type, Quality = item.itemValue.Quality, UseTimes = item.itemValue.UseTimes, MaxUse = item.itemValue.MaxUseTimes, AmmoIndex = item.itemValue.SelectedAmmoTypeIndex }; if (item.itemValue.Attachments != null && item.itemValue.Attachments.Length > 0) { slot.Attachments = new List <BCMAttachment>(); foreach (var attachment in item.itemValue.Attachments) { if (attachment != null && attachment.type != 0) { slot.Attachments.Add(new BCMAttachment { Type = attachment.type, Quality = attachment.Quality, MaxUse = attachment.MaxUseTimes, UseTimes = attachment.UseTimes }); } } } if (item.itemValue.Parts != null && item.itemValue.Parts.Length > 0) { slot.Parts = new List <BCMParts>(); foreach (var part in item.itemValue.Parts) { if (part != null && part.type != 0) { slot.Parts.Add(new BCMParts { Type = part.type, Quality = part.Quality, MaxUse = part.MaxUseTimes, UseTimes = part.UseTimes }); } } } slot.Count = item.count; } Belt.Add(j.ToString(), slot); j++; } Bin.Add("Belt", Belt); }
//use PCP for online players private void GetBag(PlayerInfo pInfo) { // Updates are instantly triggered when looting, but not when an item is moved to equipment so there is a delay of up to 30 seconds Bag = new Dictionary <string, BCMItemStack>(); var i = 1; foreach (var item in pInfo.EP != null ? pInfo.PCP.DataCache.bag : pInfo.PDF.bag) { BCMItemStack slot = null; if (item.itemValue.type != 0) { slot = new BCMItemStack { Type = item.itemValue.type, Quality = item.itemValue.Quality, UseTimes = item.itemValue.UseTimes, MaxUse = item.itemValue.MaxUseTimes, AmmoIndex = item.itemValue.SelectedAmmoTypeIndex }; if (item.itemValue.Attachments != null && item.itemValue.Attachments.Length > 0) { slot.Attachments = new List <BCMAttachment>(); foreach (var attachment in item.itemValue.Attachments) { if (attachment != null && attachment.type != 0) { slot.Attachments.Add(new BCMAttachment { Type = attachment.type, Quality = attachment.Quality, MaxUse = attachment.MaxUseTimes, UseTimes = attachment.UseTimes }); } } } if (item.itemValue.Parts != null && item.itemValue.Parts.Length > 0) { slot.Parts = new List <BCMParts>(); foreach (var part in item.itemValue.Parts) { if (part != null && part.type != 0) { slot.Parts.Add(new BCMParts { Type = part.type, Quality = part.Quality, MaxUse = part.MaxUseTimes, UseTimes = part.UseTimes }); } } } slot.Count = item.count; } Bag.Add(i.ToString(), slot); i++; } Bin.Add("Bag", Bag); }