public static bool CheckThinkTrigger(BaseCreature bc) { AbilityProfile profile = PetTrainingHelper.GetAbilityProfile(bc); if (profile != null) { AreaEffect effect = null; AreaEffect[] effects = profile.GetAreaEffects().Where(a => !a.IsInCooldown(bc)).ToArray(); if (effects != null && effects.Length > 0) { effect = effects[Utility.Random(effects.Length)]; } if (effect != null) { return(effect.Trigger(bc, bc.Combatant as Mobile)); } } return(false); }
public static bool CheckThinkTrigger(BaseCreature bc) { AbilityProfile profile = PetTrainingHelper.GetAbilityProfile(bc); if (profile != null) { AreaEffect effect = null; List <AreaEffect> list = new List <AreaEffect>(); var af = profile.GetAreaEffects(); for (var index = 0; index < af.Length; index++) { var a = af[index]; if (!a.IsInCooldown(bc)) { list.Add(a); } } AreaEffect[] effects = list.ToArray(); if (effects.Length > 0) { effect = effects[Utility.Random(effects.Length)]; } if (effect != null) { return(effect.Trigger(bc, bc.Combatant as Mobile)); } } return(false); }