// returns the buff Id of a transformation menu selection public static BuffInfo GetBuffFromMenuSelection(MenuSelectionID menuId) { // don't return any of the buffs by menu selection if there isn't a selection. That's bad. if (menuId == MenuSelectionID.None) { return(null); } return(BuffInfoList.Where(x => x.MenuId == menuId).FirstOrDefault()); }
/// <summary> /// Initializes a new instance of the <see cref="PacketNpc"/> class. /// </summary> /// <param name="packet">The packet.</param> public PacketNpc(IL2RPacket packet) { NPCUID = packet.ReadUInt64(); NPCID = packet.ReadUInt32(); XPos = packet.ReadSingle(); YPos = packet.ReadSingle(); ZPos = packet.ReadSingle(); Direction = packet.ReadSingle(); CurrentHP = packet.ReadUInt32(); MaxHP = packet.ReadUInt32(); MoveSpeed = packet.ReadUInt32(); ushort BuffCount = packet.ReadUInt16(); // PktBuffInfo for (int i = 0; i < BuffCount; i++) { BuffInfoList.Add(new PacketBuffInfo(packet)); } byte CombatMode = packet.ReadByte(); uint SpawnInfoId = packet.ReadUInt32(); ulong TeamID = packet.ReadUInt64(); }
// A bunch of lists joined together, in order to contain every possible transformation buff. // when adding new ones, make sure they wind up here in some form, even if you just have to add them one at a time. // (Union() excludes duplicates automatically) public static List <BuffInfo> AllBuffs() { return(BuffInfoList.Where(x => x.BuffKeyName != BuffKeyNames.KaiokenFatigue && x.BuffKeyName != BuffKeyNames.TransformationExhaustion).ToList()); }
public static BuffInfo GetBuffByKeyName(string keyName) { return(BuffInfoList.Find(x => x.BuffKeyName == keyName)); }