protected override void OnTarget( Mobile target ) { if ( CheckHSequence( target ) ) { int music, peace, provo, disco; GetSkillBonus( out music, out peace, out provo, out disco ); int resist = (int) Math.Max( 0, ( Target.Skills.MagicResist.Value - 80 ) / 10 ); int strMalus = 4 + ( 2 * ( disco + music ) + provo + peace ); strMalus -= ( 3 * resist ); if ( strMalus <= 0 ) { Caster.SendLocalizedMessage( 1115932 ); // Your target resists the effects of your spellsong. target.SendLocalizedMessage( 1115933 ); // You resist the effects of the spellsong. } else { m_StatMods = new StatMod[] { new StatMod( StatType.Str, "Despair Str", -strMalus ) }; m_Damage = 9 + ( 5 * disco ) + ( 4 * music ) + ( 2 * ( provo + peace ) ) - resist; if ( !target.IsPlayer ) { if ( CheckInstrumentSlays( target ) ) m_Damage = (int) ( m_Damage * 3 ); else m_Damage = (int) ( m_Damage * 1.5 ); } // Despair / Target: ~1_val~ <br>Damage: ~2_val~ Caster.AddBuff( new BuffInfo( BuffIcon.DespairCaster, 1151389, 1151390, String.Format( "{0}\t{1}", target.Name, m_Damage ) ) ); // Despair / ~1_STR~ Strength.<br>~2_DAM~ physical damage every 2 seconds while spellsong remains in effect.<br> target.AddBuff( new BuffInfo( BuffIcon.DespairTarget, 1115741, 1115743, String.Format( "-{0}\t{1}", strMalus, m_Damage ) ) ); StartSong(); } } FinishSequence(); }
public static void ApplySkillLoss( Mobile mob ) { SkillLossContext context = (SkillLossContext) m_SkillLoss[mob]; if ( context != null ) return; context = new SkillLossContext(); m_SkillLoss[mob] = context; ArrayList mods = context.m_Mods = new ArrayList(); for ( int i = 0; i < mob.Skills.Length; ++i ) { Skill sk = mob.Skills[i]; double baseValue = sk.Base; if ( baseValue > 0 ) { SkillMod mod = new DefaultSkillMod( sk.SkillName, true, -( baseValue * SkillLossFactor ) ); mods.Add( mod ); mob.AddSkillMod( mod ); } } context.m_Timer = Timer.DelayCall( SkillLossPeriod, new TimerStateCallback( ClearSkillLoss_Callback ), mob ); // Stat Loss / All of your skills have been reduced by one third. mob.AddBuff( new BuffInfo( BuffIcon.FactionStatLoss, 1153800, 1153826, SkillLossPeriod, mob, true ) ); }
protected override void OnTarget( Mobile target ) { if ( CheckHSequence( target ) ) { int music, peace, provo, disco; GetSkillBonus( out music, out peace, out provo, out disco ); int resist = (int) Math.Max( 0, ( Target.Skills.MagicResist.Value - 80 ) / 10 ); int propMalus = 5 + ( 5 * disco ) + ( 2 * ( provo + peace ) ); propMalus -= ( 2 * resist ); int damageFactor = 8 + ( 8 * disco ) + ( 3 * ( provo + peace ) ); damageFactor -= ( 4 * resist ); if ( propMalus <= 0 || damageFactor <= 0 ) { Caster.SendLocalizedMessage( 1115932 ); // Your target resists the effects of your spellsong. target.SendLocalizedMessage( 1115933 ); // You resist the effects of the spellsong. } else { m_Mods = new AttributeMod[] { new AttributeMod( MagicalAttribute.AttackChance, -propMalus ), new AttributeMod( MagicalAttribute.SpellDamage, -propMalus ) }; if ( CheckInstrumentSlays( target ) ) damageFactor = (int) ( damageFactor * 1.5 ); m_DamageFactor = damageFactor; int damageChance = 15 + ( 15 * music ) + ( 4 * ( provo + peace ) ); m_DamageChance = damageChance; // Tribulation / Target: ~1_val~ <br> Damage Factor: ~2_val~% <br> Damage Chance: ~3_val~% Caster.AddBuff( new BuffInfo( BuffIcon.TribulationCaster, 1151387, 1151388, String.Format( "{0}\t{1}\t{2}", target.Name, damageFactor, damageChance ) ) ); // Tribulation / ~1_HCI~% Hit Chance.<br>~2_SDI~% Spell Damage.<br>Damage taken has a ~3_EXP~% chance to cause additional burst of physical damage.<br> target.AddBuff( new BuffInfo( BuffIcon.TribulationTarget, 1115740, 1115742, String.Format( "-{0}\t-{1}\t{2}", propMalus, propMalus, damageChance ) ) ); StartSong(); } } FinishSequence(); }