public override void OnCast() { BaseWeapon wep = GetWeapon(); if (wep != null && CheckSequence()) { wep.PlaySwingAnimation(Caster); TimeSpan duration = TimeSpan.FromMinutes(1); double skill = (Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value) / 2; _HCIBonus = (int)Math.Max(45, skill / 2.667); _SSIBonus = (int)Math.Max(30, skill / 4); string args = String.Format("{0}\t{1}\t{2}", Caster.Name, _HCIBonus.ToString(), _SSIBonus.ToString()); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.PlayingTheOddsDebuff, 1155913, 1156091, duration, Caster)); //Your bow range has been reduced as you play the odds. foreach (Mobile m in GetParty().Where(mob => mob is PlayerMobile)) { m.PlaySound(0x101); m.FixedEffect(0x13B2, 10, 20, 2728, 5); m.FixedEffect(0x37C4, 10, 20, 2728, 5); if (m != Caster) { BuffInfo.AddBuff(m, new BuffInfo(BuffIcon.PlayingTheOdds, 1155913, 1155998, duration, m, args)); } //~1_NAME~ grants you the following:<br>+~2_VAl~% Hit Chance Increase.<br>+~3_VAL~% Swing Speed Increase. } Caster.SendLocalizedMessage(1156091); // Your bow range has been reduced as you play the odds. Expires = DateTime.UtcNow + duration; BeginTimer(); AddToCooldown(TimeSpan.FromSeconds(90)); foreach (var mob in AcquireIndirectTargets(Caster.Location, 5).OfType <Mobile>()) { if (HitLower.ApplyDefense(mob)) { if (wep is BaseRanged && !(wep is BaseThrown)) { Caster.MovingEffect(mob, ((BaseRanged)wep).EffectID, 18, 1, false, false); } mob.PlaySound(0x28E); Effects.SendTargetEffect(mob, 0x37BE, 1, 4, 0x23, 3); Caster.DoHarmful(mob); } } wep.InvalidateProperties(); } FinishSequence(); }
public override void OnCast() { BaseWeapon wep = GetWeapon(); if (wep != null && CheckSequence()) { wep.PlaySwingAnimation(Caster); double skill = (Caster.Skills[CastSkill].Value + Caster.Skills[DamageSkill].Value) / 2; TimeSpan duration = TimeSpan.FromMinutes(1); _HCIBonus = (int)Math.Max(45, skill / 2.667); _SSIBonus = (int)Math.Max(30, skill / 4); string args = string.Format("{0}\t{1}\t{2}", Caster.Name, _HCIBonus.ToString(), _SSIBonus.ToString()); BuffInfo.AddBuff(Caster, new BuffInfo(BuffIcon.PlayingTheOddsDebuff, 1155913, 1156091, duration, Caster)); //Your bow range has been reduced as you play the odds. UpdateParty(true); Caster.SendLocalizedMessage(1156091); // Your bow range has been reduced as you play the odds. Expires = DateTime.UtcNow + duration; BeginTimer(); AddToCooldown(TimeSpan.FromSeconds(90)); foreach (var mob in AcquireIndirectTargets(Caster.Location, 5).OfType <Mobile>()) { if (HitLower.ApplyDefense(mob)) { if (wep is BaseRanged && !(wep is BaseThrown)) { Caster.MovingEffect(mob, ((BaseRanged)wep).EffectID, 18, 1, false, false); } mob.PlaySound(0x28E); Effects.SendTargetEffect(mob, 0x37BE, 1, 4, 0x23, 3); Caster.DoHarmful(mob); } } wep.InvalidateProperties(); } FinishSequence(); }