public static void OnCreatureHit(Mobile attacker, Mobile defender, ref int damage) { if (attacker is BaseCreature && (((BaseCreature)attacker).Controlled || ((BaseCreature)attacker).Summoned)) { Mobile master = ((BaseCreature)attacker).GetMaster(); if (master != null) { CombatTrainingSpell spell = GetSpell(master, typeof(CombatTrainingSpell)) as CombatTrainingSpell; if (spell != null) { switch (spell.SpellType) { case TrainingType.Empowerment: break; case TrainingType.Berserk: damage = damage + (int)((double)damage * spell.DamageModifier(defender)); attacker.FixedParticles(0x376A, 10, 30, 5052, 1261, 7, EffectLayer.LeftFoot, 0); break; case TrainingType.ConsumeDamage: case TrainingType.AsOne: break; } } } } }
public static int GetHitChanceBonus(Mobile m) { if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned)) { Mobile master = ((BaseCreature)m).GetMaster(); if (master != null) { CombatTrainingSpell spell = GetSpell(master, typeof(CombatTrainingSpell)) as CombatTrainingSpell; if (spell != null && spell.SpellType != TrainingType.AsOne) { return((int)(45 * spell.DamageModifier(m))); } } } return(0); }
public static int RegenBonus(Mobile m) { if (m is BaseCreature && (((BaseCreature)m).Controlled || ((BaseCreature)m).Summoned)) { Mobile master = ((BaseCreature)m).GetMaster(); if (master != null) { CombatTrainingSpell spell = GetSpell(master, typeof(CombatTrainingSpell)) as CombatTrainingSpell; if (spell != null) { return((int)(30.0 * spell.DamageModifier(m))); } } } return(0); }
public static void CheckDamage(Mobile attacker, Mobile defender, DamageType type, ref int damage) { if (defender is BaseCreature && (((BaseCreature)defender).Controlled || ((BaseCreature)defender).Summoned)) { Mobile master = ((BaseCreature)defender).GetMaster(); if (master != null) { CombatTrainingSpell spell = GetSpell(master, typeof(CombatTrainingSpell)) as CombatTrainingSpell; if (spell != null) { switch (spell.SpellType) { case TrainingType.Empowerment: break; case TrainingType.Berserk: damage = damage - (int)((double)damage * spell.DamageModifier(defender)); defender.FixedParticles(0x376A, 10, 30, 5052, 1261, 7, EffectLayer.LeftFoot, 0); break; case TrainingType.ConsumeDamage: break; case TrainingType.AsOne: if (master is PlayerMobile) { var list = ((PlayerMobile)master).AllFollowers.Where(m => (m == defender || m.InRange(defender.Location, 3)) && m.CanBeHarmful(attacker)).ToList(); if (list.Count > 0) { damage = damage / list.Count; foreach (var m in list.Where(mob => mob != defender)) { m.Damage(damage, attacker, true, false); } } ColUtility.Free(list); } break; } if (spell._DamageTaken == 0) { defender.FixedEffect(0x3779, 10, 90, 1743, 0); } spell._DamageTaken = damage; } } } else if (attacker is BaseCreature && (((BaseCreature)attacker).Controlled || ((BaseCreature)attacker).Summoned)) { Mobile master = ((BaseCreature)attacker).GetMaster(); if (master != null) { CombatTrainingSpell spell = GetSpell(master, typeof(CombatTrainingSpell)) as CombatTrainingSpell; if (spell != null) { switch (spell.SpellType) { case TrainingType.Empowerment: damage = damage + (int)((double)damage * spell.DamageModifier(defender)); attacker.FixedParticles(0x376A, 10, 30, 5052, 1261, 7, EffectLayer.LeftFoot, 0); break; case TrainingType.Berserk: break; case TrainingType.ConsumeDamage: case TrainingType.AsOne: break; } } } } }