private void CopyFromThisToEleonArray(Eleon.Modding.ItemStack[] result) { for (int i = 0; i < result.Length; ++i) { result[i] = new Eleon.Modding.ItemStack(this[i].Id, this[i].Amount); } }
public Eleon.Modding.ItemStack[] ToEleonArray() { var result = new Eleon.Modding.ItemStack[this.Count]; CopyFromThisToEleonArray(result); return(result); }
public void FromItemStack(Eleon.Modding.ItemStack itemStack) { ammo = itemStack.ammo; count = itemStack.count; decay = itemStack.decay; id = itemStack.id; slotIdx = itemStack.slotIdx; }
// Grab the first 35 stacks public Eleon.Modding.ItemStack[] ExtractOutForItemExchange() { const int MaxItemExchangeCount = 35; var result = new Eleon.Modding.ItemStack[Math.Min(this.Count, MaxItemExchangeCount)]; CopyFromThisToEleonArray(result); this.RemoveRange(0, result.Length); return(result); }
private void ReplaceInventory(int entity_Id) { Eleon.Modding.ItemStack[] Toolbelt = new Eleon.Modding.ItemStack[10]; Eleon.Modding.ItemStack[] Backpack = new Eleon.Modding.ItemStack[40]; for (int i = 0; i <= 9; i++) { Toolbelt[i].id = 558; Toolbelt[i].count = i + 1; } for (int i = 0; i <= 39; i++) { Backpack[i].id = 558; Backpack[i].count = i + 1; } SendRequest(Eleon.Modding.CmdId.Request_Player_SetInventory, Eleon.Modding.CmdId.Request_Player_SetInventory, new Eleon.Modding.Inventory(entity_Id, Toolbelt, Backpack)); }
public ItemStack(Eleon.Modding.ItemStack itemStack) { this.Id = itemStack.id; this.Amount = itemStack.count; }
private void ItemExchange(int entity_Id) { Eleon.Modding.ItemStack[] itStack = new Eleon.Modding.ItemStack[] { new Eleon.Modding.ItemStack(2053, 1) }; SendRequest(Eleon.Modding.CmdId.Request_Player_ItemExchange, Eleon.Modding.CmdId.Request_Player_ItemExchange, new Eleon.Modding.ItemExchangeInfo(entity_Id, "Player Item Exchange Title", "Put your description here", "Your button text here", itStack)); }
private void Player_AddItem(int entityId, Eleon.Modding.ItemStack itemStack) { SendRequest(Eleon.Modding.CmdId.Request_Player_AddItem, Eleon.Modding.CmdId.Request_Player_AddItem, new Eleon.Modding.IdItemStack(entityId, itemStack)); }