public void AddItemToHandel(ZoneCharacter pChar, byte pSlot) { Item pItem; if (!pChar.Inventory.InventoryItems.TryGetValue(pSlot, out pItem)) { return; } if (this.pCharFrom == pChar) { TradeItem Item = new TradeItem(pChar, pSlot, pFromItemCounter, pItem); this.pFromHandelItemList.Add(Item); this.SendTradeAddItemTo(this.pCharTo.Client, pItem, pFromItemCounter); this.SendTradeAddItemMe(this.pCharFrom.Client, pSlot, pFromItemCounter); pFromItemCounter++; } else if (this.pCharTo == pChar) { TradeItem Item = new TradeItem(pChar, pSlot, pToItemCounter, pItem); this.pFromHandelItemList.Add(Item); this.SendTradeAddItemTo(this.pCharFrom.Client, pItem, pToItemCounter); this.SendTradeAddItemMe(this.pCharTo.Client, pSlot, pToItemCounter); pToItemCounter++; } }
public void RemoveItemToHandel(ZoneCharacter pChar, byte pSlot) { if (this.pCharFrom == pChar) { TradeItem item = pFromHandelItemList.Find(d => d.TradeSlot == pSlot); this.pFromHandelItemList.Remove(item); SendItemRemovFromHandel(this.pCharTo.Client, pSlot); SendItemRemoveMe(this.pCharFrom.Client, pSlot); pFromItemCounter--; } else if (this.pCharTo == pCharTo) { TradeItem item = pToHandelItemList.Find(d => d.TradeSlot == pSlot); this.pToHandelItemList.Remove(item); SendItemRemovFromHandel(this.pCharFrom.Client, pSlot); SendItemRemoveMe(this.pCharTo.Client, pSlot); pToItemCounter--; } }
public void AddItemToHandel(ZoneCharacter pChar,byte pSlot) { Item pItem; if (!pChar.Inventory.InventoryItems.TryGetValue(pSlot, out pItem)) return; if (this.pCharFrom == pChar) { TradeItem Item = new TradeItem(pChar, pSlot, pFromItemCounter,pItem); this.pFromHandelItemList.Add(Item); this.SendTradeAddItemTo(this.pCharTo.Client, pItem,pFromItemCounter); this.SendTradeAddItemMe(this.pCharFrom.Client, pSlot, pFromItemCounter); pFromItemCounter++; } else if(this.pCharTo == pChar) { TradeItem Item = new TradeItem(pChar, pSlot, pToItemCounter,pItem); this.pFromHandelItemList.Add(Item); this.SendTradeAddItemTo(this.pCharFrom.Client, pItem, pToItemCounter); this.SendTradeAddItemMe(this.pCharTo.Client, pSlot, pToItemCounter); pToItemCounter++; } }