/// <summary> /// Ends a creature's concentration effect immediately. /// No message is sent by this method, so be sure to send one if you need to inform a player. /// </summary> /// <param name="creature">The creatures whose concentration we're ending.</param> public static void EndConcentrationEffect(NWCreature creature) { if (creature.IsPlayer) { Player player = DataService.Player.GetByID(creature.GlobalID); if (player.ActiveConcentrationPerkID == null) { return; } player.ActiveConcentrationPerkID = null; player.ActiveConcentrationTier = 0; DataService.SubmitDataChange(player, DatabaseActionType.Update); } else { creature.DeleteLocalInt("ACTIVE_CONCENTRATION_PERK_ID"); } creature.DeleteLocalInt("ACTIVE_CONCENTRATION_ABILITY_TICK"); creature.DeleteLocalObject("CONCENTRATION_TARGET"); creature.RemoveEffect(EffectTypeScript.SkillIncrease); // Remove the effect icon. ConcentratingCreatures.Remove(creature); }