/// <summary> /// Invoked when a buff value of the player is modified. /// If their buildmode is on, we set buffs of PluginUtils.BuildModeBuffs on the player. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private static void OnBuffUpdate(object sender, PlayerBuffUpdateEventArgs e) { if (e.Player.IsBuildModeOn()) { foreach (int buffID in PluginUtils.BuildModeBuffs) { e.Player.SetBuff(buffID, Int16.MaxValue); } } }
private static bool OnPlayerBuffUpdate(byte id) { if (PlayerBuffUpdate == null) return false; var args = new PlayerBuffUpdateEventArgs { ID = id, }; PlayerBuffUpdate.Invoke(null, args); return args.Handled; }