public static void SetAbility(NetState state, IEntity e, EncodedReader reader) { var m = state.Mobile; var index = reader.ReadInt32(); if (index >= 1 && index < WeaponAbility.Abilities.Length) { WeaponAbility.SetCurrentAbility(m, WeaponAbility.Abilities[index]); } else { WeaponAbility.ClearCurrentAbility(m); } }