public playerBuff(List <int> terrData, itemHandler handler) { int id = handler.resolveEncodedData(terrData[0], terrData[1]); buff = handler.searchBuffById(id); duration = handler.resolveEncodedData(terrData[4], terrData[5]); }
public invItem(List <int> terrData, itemHandler handler) { int id = handler.resolveEncodedData(terrData[0], terrData[1]); item = handler.searchItemByID(id); quantity = handler.resolveEncodedData(terrData[4], terrData[5]); prefix = handler.searchPrefixByID(terrData[8]); }
//returns the inventory item as a set of 10 bytes for reinserting into raw data public List <Byte> recompile(itemHandler handler) { List <Byte> final = new List <Byte> { }; List <int> encodedItem = handler.encodeData(buff.ID); List <int> encodedDuration = handler.encodeBuffs(duration * 60); //bytes 2, 3, 6, 7 and 9 seem to make the item dissapear if they are anything other than 0x00 final.Add((byte)encodedItem[0]); final.Add((byte)encodedItem[1]); final.Add(0x00); final.Add(0x00); final.Add((byte)encodedDuration[0]); final.Add((byte)encodedDuration[1]); final.Add((byte)encodedDuration[2]); final.Add(0x00); return(final); }
public invItem(List <int> terrData, itemHandler handler) { int id = handler.resolveEncodedData(terrData[0], terrData[1]); quantity = handler.resolveEncodedData(terrData[4], terrData[5]); prefix = handler.searchPrefixByID(terrData[8]); isFavorite = terrData.Last() == 1 ? true : false; if (quantity > 0 && id == 0) { item = handler.searchItemByID(-1); } else { item = handler.searchItemByID(id); } //Console.WriteLine(item.name + ":" + isFavorite); }
//returns the inventory item as a set of 10 bytes for reinserting into raw data public List <Byte> recompile(itemHandler handler) { List <Byte> final = new List <Byte> { }; List <int> encodedItem = handler.encodeData(item.ID); List <int> encodedQuant = handler.encodeData(quantity); //bytes 2, 3, 6, 7 and 9 seem to make the item dissapear if they are anything other than 0x00 final.Add((byte)encodedItem[0]); final.Add((byte)encodedItem[1]); final.Add(0x00); final.Add(0x00); final.Add((byte)encodedQuant[0]); final.Add((byte)encodedQuant[1]); final.Add(0x00); final.Add(0x00); final.Add((byte)prefix.ID); final.Add(0x00); return(final); }
//returns the inventory item as a set of 10 bytes for reinserting into raw data public List <Byte> recompile(itemHandler handler, encodeMethod e) { List <Byte> final = new List <Byte> { }; List <int> encodedItem = handler.encodeData(item.ID); List <int> encodedQuant = handler.encodeData(quantity); //bytes 2, 3, 6, 7 and 9 seem to make the item dissapear if they are anything other than 0x00 final.Add((byte)encodedItem[0]); final.Add((byte)encodedItem[1]); final.Add(0x00); final.Add(0x00); final.Add((byte)encodedQuant[0]); final.Add((byte)encodedQuant[1]); final.Add(0x00); final.Add(0x00); final.Add((byte)prefix.ID); if (e == encodeMethod.Long) { final.Add((byte)(isFavorite == true ? 0x01 : 0x00)); } return(final); }