public override double GetControlChance(Mobile m, bool useBaseSkill) { AbilityProfile profile = PetTrainingHelper.GetAbilityProfile(this); if (profile != null && profile.HasCustomized()) { return(base.GetControlChance(m, useBaseSkill)); } double tamingChance = base.GetControlChance(m, useBaseSkill); if (tamingChance >= 0.95) { return(tamingChance); } double skill = useBaseSkill ? m.Skills.Bushido.Base : m.Skills.Bushido.Value; if (skill < 90.0) { return(tamingChance); } double bushidoChance = (skill - 30.0) / 100; if (m.Skills.Bushido.Base >= 120) { bushidoChance += 0.05; } return(bushidoChance > tamingChance ? bushidoChance : tamingChance); }
public override double GetControlChance(Mobile m, bool useBaseSkill) { AbilityProfile profile = PetTrainingHelper.GetAbilityProfile(this); if (profile != null && profile.HasCustomized()) { return(base.GetControlChance(m, useBaseSkill)); } return(1.0); }
public override void OnAfterEffects(BaseCreature creature, Mobile defender) { if (creature.Controlled) { AbilityProfile profile = PetTrainingHelper.GetAbilityProfile(creature); if (profile != null && profile.HasAbility(MagicalAbility.Poisoning) || 0.2 > Utility.RandomDouble()) { creature.CheckSkill(SkillName.Poisoning, 0, creature.Skills[SkillName.Poisoning].Cap); } } }
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); }