protected override void OnTarget(object o) { BaseWeapon weapon = GetWeapon(); if (weapon is BaseRanged && !(weapon is BaseThrown)) { IPoint3D p = o as IPoint3D; if (p != null && SpellHelper.CheckTown(p, Caster) && CheckSequence()) { System.Collections.Generic.List <Mobile> targets = AcquireIndirectTargets(p, 5).OfType <Mobile>().ToList(); int count = targets.Count; foreach (Mobile mob in targets) { Caster.MovingEffect(mob, ((BaseRanged)weapon).EffectID, 18, 1, false, false); if (weapon.CheckHit(Caster, mob)) { double damage = GetNewAosDamage(40, 1, 5, mob); if (count > 2) { damage = damage / count; } damage *= GetDamageScalar(mob); Caster.DoHarmful(mob); SpellHelper.Damage(this, mob, damage, 0, 100, 0, 0, 0); Server.Timer.DelayCall(TimeSpan.FromMilliseconds(800), obj => { Mobile mobile = obj as Mobile; if (mobile != null) { mobile.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head); } }, mob); mob.PlaySound(0x1DD); } } ColUtility.Free(targets); weapon.PlaySwingAnimation(Caster); Caster.PlaySound(0x101); } } }
protected override void OnTarget(object o) { BaseWeapon weapon = GetWeapon(); if (weapon is BaseRanged && !(weapon is BaseThrown)) { IPoint3D p = o as IPoint3D; if (p != null && SpellHelper.CheckTown(p, Caster) && CheckSequence()) { IPooledEnumerable eable = Caster.Map.GetMobilesInRange(new Point3D(p), 5); List <Mobile> targets = new List <Mobile>(); foreach (Mobile mob in eable) { if (Caster != mob && SpellHelper.ValidIndirectTarget(Caster, mob) && Caster.CanBeHarmful(mob, false)) { if (!Caster.InLOS(mob)) { continue; } targets.Add(mob); } } eable.Free(); double damage; foreach (Mobile mob in targets) { Caster.MovingEffect(mob, ((BaseRanged)weapon).EffectID, 18, 1, false, false); if (weapon.CheckHit(Caster, mob)) { damage = GetNewAosDamage(40, 1, 5, mob); if (targets.Count > 2) { damage = damage / targets.Count; } damage *= GetDamageScalar(mob); Caster.DoHarmful(mob); SpellHelper.Damage(this, mob, damage, 0, 100, 0, 0, 0); Server.Timer.DelayCall(TimeSpan.FromMilliseconds(800), obj => { Mobile mobile = obj as Mobile; if (mobile != null) { mobile.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head); } }, mob); mob.PlaySound(0x1DD); } } weapon.PlaySwingAnimation(Caster); Caster.PlaySound(0x101); } } }
public override void OnThink() { base.OnThink(); //Prevent Melee Attacks LastSwingTime = DateTime.UtcNow + TimeSpan.FromSeconds(30); Mobile combatant = Combatant; if (ControlMaster is PlayerMobile) { int minSeconds = 0; int maxSeconds = (int)(Math.Round(NextPvMVoidAttackDelay.TotalSeconds)); if (combatant == null) { m_NextVoidAttackAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(minSeconds, maxSeconds)); } } if (DateTime.UtcNow >= m_NextVoidAttackAllowed && AIObject.currentCombatRange != CombatRange.Withdraw && AIObject.Action != ActionType.Flee) { if (combatant != null && !CantWalk && !Frozen && !IsHindered() && Alive && !IsDeadFollower && !IsDeadBondedFollower) { if (combatant.Alive && InLOS(combatant) && GetDistanceToSqrt(combatant) <= 8) { RevealingAction(); SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, 1.0, true, 0, false, "", "", "-1"); double entangleDuration = 3; double pierceAmount = .25; double crippleAmount = .20; TimeSpan attackCooldown = NextPvMVoidAttackDelay; double effectChance = .2; double damageScalar = 1.0; m_NextVoidAttackAllowed = DateTime.UtcNow + attackCooldown; Animate(4, 4, 1, true, false, 0); BaseWeapon weapon = Weapon as BaseWeapon; if (weapon == null) { return; } bool hitSuccessful = false; if (weapon.CheckHit(this, combatant)) { hitSuccessful = true; } Effects.PlaySound(Location, Map, 0x5D8); int itemID = 0x573E; // Utility.RandomList(0x122A, 0x122B, 0x122C, 0x122D, 0x122E, 0x122F); int itemHue = 38; MovingEffect(combatant, itemID, 8, 1, false, false, itemHue, 0); IEntity startLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 10), Map); double distance = Utility.GetDistanceToSqrt(Location, combatant.Location); double destinationDelay = (double)distance * .08; if (hitSuccessful) { Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (this == null) { return; } if (Deleted || !Alive || IsDeadFollower || IsDeadBondedFollower) { return; } if (!SpecialAbilities.IsDamagable(combatant)) { return; } if (Utility.GetDistance(Location, combatant.Location) >= 20) { return; } new Blood(TimeSpan.FromSeconds(10)).MoveToWorld(new Point3D(combatant.X, combatant.Y, combatant.Z), Map); if (Utility.RandomDouble() <= effectChance) { Effects.PlaySound(combatant.Location, combatant.Map, 0x5DC); for (int a = 0; a < 3; a++) { Point3D voidResidueLocation = new Point3D(combatant.X + Utility.RandomMinMax(-1, 1), combatant.Y + Utility.RandomMinMax(-1, 1), combatant.Z); SpellHelper.AdjustField(ref voidResidueLocation, combatant.Map, 12, false); new Blood(TimeSpan.FromSeconds(10)).MoveToWorld(voidResidueLocation, combatant.Map); } combatant.SendMessage("You have been covered in sticky blood!"); combatant.FixedParticles(0x374A, 10, 15, 5021, 38, 0, EffectLayer.Waist); SpecialAbilities.EntangleSpecialAbility(1.0, this, combatant, 2, entangleDuration, 0, false, "", "", "-1"); } weapon.OnHit(this, combatant, damageScalar); }); } } } } }
public override void OnThink() { base.OnThink(); //Prevent Melee Attacks LastSwingTime = DateTime.UtcNow + TimeSpan.FromSeconds(30); if (DateTime.UtcNow >= m_NextVoidAttackAllowed && AIObject.currentCombatRange != CombatRange.Withdraw && AIObject.Action != ActionType.Flee) { Mobile combatant = Combatant; if (combatant != null && !CantWalk && !Frozen && Alive && !IsDeadPet && !IsDeadBondedPet) { if (combatant.Alive && InLOS(combatant) && GetDistanceToSqrt(combatant) <= 8) { RevealingAction(); SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, 1.0, true, 0, false, "", "", "-1"); double entangleDuration = 3; double pierceAmount = .25; double crippleAmount = .20; TimeSpan attackCooldown = NextPvMVoidAttackDelay; double effectChance = .10; double damageScalar = 1.0; if (Controlled && ControlMaster != null) { if (ControlMaster is PlayerMobile) { if (combatant is PlayerMobile) { effectChance = .01; } else { effectChance = .25; } } } if (ControlMaster is PlayerMobile && combatant is PlayerMobile) { entangleDuration = 1; attackCooldown = NextPvPVoidAttackDelay; } m_NextVoidAttackAllowed = DateTime.UtcNow + attackCooldown; Animate(4, 4, 1, true, false, 0); BaseWeapon weapon = Weapon as BaseWeapon; if (weapon == null) { return; } bool hitSuccessful = false; if (weapon.CheckHit(this, combatant)) { hitSuccessful = true; } Effects.PlaySound(Location, Map, 0x5D8); MovingEffect(combatant, 0x573E, 8, 1, false, false, 2200, 0); IEntity startLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 10), Map); double distance = Utility.GetDistanceToSqrt(Location, combatant.Location); double destinationDelay = (double)distance * .08; if (hitSuccessful) { Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (Deleted || !Alive || IsDeadPet || IsDeadBondedPet) { return; } if (!SpecialAbilities.IsDamagable(combatant)) { return; } if (Utility.GetDistance(Location, combatant.Location) >= 20) { return; } TimedStatic voidResidue = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5); voidResidue.Hue = 2051; voidResidue.Name = "void residue"; voidResidue.MoveToWorld(new Point3D(combatant.X, combatant.Y, combatant.Z), Map); if (Utility.RandomDouble() <= effectChance) { Effects.PlaySound(combatant.Location, combatant.Map, 0x5DC); for (int a = 0; a < 3; a++) { voidResidue = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5); voidResidue.Hue = 2051; voidResidue.Name = "void residue"; Point3D voidResidueLocation = new Point3D(combatant.X + Utility.RandomMinMax(-1, 1), combatant.Y + Utility.RandomMinMax(-1, 1), combatant.Z); SpellHelper.AdjustField(ref voidResidueLocation, combatant.Map, 12, false); voidResidue.MoveToWorld(voidResidueLocation, combatant.Map); } combatant.SendMessage("You have been covered in void residue!"); combatant.FixedParticles(0x374A, 10, 15, 5021, 2051, 0, EffectLayer.Waist); SpecialAbilities.EntangleSpecialAbility(1.0, this, combatant, 1, entangleDuration, 0, false, "", "", "-1"); SpecialAbilities.PierceSpecialAbility(1.0, this, combatant, pierceAmount, 50, 0, false, "", "", "-1"); SpecialAbilities.CrippleSpecialAbility(1.0, this, combatant, crippleAmount, 10, 0, false, "", "", "-1"); } weapon.OnHit(this, combatant, damageScalar); }); } } } } }