public void ThrowSkull(BaseCreature creature) { if (creature == null) { return; } if (creature.Deleted || !creature.Alive) { return; } if (creature.Combatant != null) { Mobile combatant = creature.Combatant; Point3D location = creature.Location; Map map = creature.Map; if (combatant.Alive && creature.InLOS(combatant) && creature.GetDistanceToSqrt(combatant) <= 12) { Animate(4, 4, 1, true, false, 0); double stationaryDuration = 3; creature.CantWalk = true; creature.Frozen = true; creature.AIObject.NextMove = creature.AIObject.NextMove + TimeSpan.FromSeconds(stationaryDuration); creature.LastSwingTime = creature.LastSwingTime + TimeSpan.FromSeconds(stationaryDuration); creature.NextSpellTime = creature.NextSpellTime + TimeSpan.FromSeconds(stationaryDuration); creature.NextCombatHealActionAllowed = creature.NextCombatHealActionAllowed + TimeSpan.FromSeconds(stationaryDuration); creature.NextCombatSpecialActionAllowed = creature.NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(stationaryDuration); creature.NextCombatEpicActionAllowed = creature.NextCombatEpicActionAllowed + TimeSpan.FromSeconds(stationaryDuration); IEntity startLocation = new Entity(Serial.Zero, new Point3D(creature.Location.X, creature.Location.Y, creature.Location.Z + 8), map); int attackSound = 0x5D3; int hitSound = 0x653; Effects.PlaySound(location, map, attackSound); creature.MovingEffect(combatant, 8707, 8, 1, false, false, 2612, 0); double distance = Utility.GetDistanceToSqrt(creature.Location, combatant.Location); double destinationDelay = (double)distance * .08; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (creature == null) { return; } if (creature.Deleted || !creature.Alive) { return; } creature.CantWalk = false; creature.Frozen = false; m_NextThrownSkullAllowed = DateTime.UtcNow + NextThrownSkullDelay; if (!SpecialAbilities.IsDamagable(combatant)) { return; } Effects.PlaySound(combatant.Location, combatant.Map, hitSound); Effects.SendLocationParticles(EffectItem.Create(combatant.Location, map, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 20, 2613, 0, 5029, 0); Effects.SendLocationParticles(EffectItem.Create(combatant.Location, map, TimeSpan.FromSeconds(0.25)), 0x3779, 10, 60, 2613, 0, 5029, 0); Effects.SendLocationParticles(EffectItem.Create(combatant.Location, map, TimeSpan.FromSeconds(0.5)), 0x3996, 10, 60, 2613, 0, 5029, 0); BaseCreature monsterToSpawn = null; double spawnPercent = (double)intervalCount / (double)totalIntervals; int creatureCount = 1 + (int)(Math.Ceiling(3 * spawnPercent)); for (int a = 0; a < creatureCount; a++) { switch (Utility.RandomMinMax(1, 10)) { case 1: monsterToSpawn = new Skeleton(); break; case 2: monsterToSpawn = new Skeleton(); break; case 3: monsterToSpawn = new Skeleton(); break; case 4: monsterToSpawn = new PatchworkSkeleton(); break; case 5: monsterToSpawn = new PatchworkSkeleton(); break; case 6: monsterToSpawn = new SkeletalKnight(); break; case 7: monsterToSpawn = new UndeadKnight(); break; case 8: monsterToSpawn = new RisenKnight(); break; case 9: monsterToSpawn = new RisenNoble(); break; case 10: monsterToSpawn = new SkeletalDrake(); break; } if (monsterToSpawn != null) { monsterToSpawn.BossMinion = true; monsterToSpawn.MoveToWorld(combatant.Location, combatant.Map); monsterToSpawn.BossMinion = true; m_Creatures.Add(monsterToSpawn); } } for (int a = 0; a < 5; a++) { Blood bones = new Blood(); bones.Name = "bones"; bones.ItemID = Utility.RandomList(6929, 6930, 6937, 6938, 6933, 6934, 6935, 6936, 6939, 6940, 6880, 6881, 6882, 6883); Point3D bonesLocation = new Point3D(combatant.Location.X + Utility.RandomList(-1, 1), combatant.Location.Y + Utility.RandomList(-1, 1), combatant.Location.Z); bones.MoveToWorld(bonesLocation, map); } int damage = creature.DamageMin; if (combatant is BaseCreature) { damage = (int)((double)damage * 1.5); } new Blood().MoveToWorld(combatant.Location, combatant.Map); AOS.Damage(combatant, creature, damage, 0, 100, 0, 0, 0); }); } } }
public void IntervalEffect() { if (Deleted || !Alive) { return; } double spawnPercent = (double)intervalCount / (double)totalIntervals; AbilityInProgress = true; int summonMotions = 5 - (int)(Math.Ceiling(4 * spawnPercent)); double summonDuration = 1; int creaturesToSummon = 2 + (int)(Math.Ceiling(8 * spawnPercent)); double stationaryDelay = summonMotions * summonDuration + 1; double minRange = 8; double maxRange = 24; Point3D location = Location; Map map = Map; int range = 10 + (int)(Math.Ceiling(20 * spawnPercent)); int effectHue = Hue - 1; Combatant = null; NextDecisionTime = DateTime.UtcNow + TimeSpan.FromSeconds(stationaryDelay); AIObject.NextMove = AIObject.NextMove + TimeSpan.FromSeconds(stationaryDelay); LastSwingTime = LastSwingTime + TimeSpan.FromSeconds(stationaryDelay); NextSpellTime = NextSpellTime + TimeSpan.FromSeconds(stationaryDelay); NextCombatHealActionAllowed = NextCombatHealActionAllowed + TimeSpan.FromSeconds(stationaryDelay); NextCombatSpecialActionAllowed = NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(stationaryDelay); NextCombatEpicActionAllowed = NextCombatEpicActionAllowed + TimeSpan.FromSeconds(stationaryDelay); SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, stationaryDelay, true, 0, false, "", "", "-1"); PublicOverheadMessage(MessageType.Regular, 0, false, "*draws upon the breath of the living*"); for (int a = 0; a < summonMotions; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * summonDuration), delegate { if (Deleted || !Alive) { return; } CantWalk = true; Frozen = true; Effects.PlaySound(Location, Map, GetAngerSound()); Animate(12, 12, 1, true, false, 0); Queue m_Queue = new Queue(); IPooledEnumerable mobilesInRange = map.GetMobilesInRange(location, range); foreach (Mobile mobile in mobilesInRange) { if (mobile.Deleted) { continue; } if (!mobile.Alive) { continue; } if (mobile == this) { continue; } if (mobile.AccessLevel > AccessLevel.Player) { continue; } bool validTarget = false; PlayerMobile pm_Target = mobile as PlayerMobile; BaseCreature bc_Target = mobile as BaseCreature; if (pm_Target != null) { validTarget = true; } if (bc_Target != null) { if (bc_Target.Controlled && bc_Target.ControlMaster is PlayerMobile) { validTarget = true; } } if (validTarget) { m_Queue.Enqueue(mobile); } } mobilesInRange.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); mobile.MovingEffect(this, 0x3728, 5, 1, false, false, effectHue, 0); } }); } Timer.DelayCall(TimeSpan.FromSeconds((double)summonMotions * summonDuration), delegate { if (Deleted || !Alive) { return; } CantWalk = false; Frozen = false; AbilityInProgress = false; PlaySound(0x64F); Queue m_Queue = new Queue(); IPooledEnumerable mobilesInRange = map.GetMobilesInRange(location, range); foreach (Mobile mobile in mobilesInRange) { if (mobile.Deleted) { continue; } if (!mobile.Alive) { continue; } if (mobile == this) { continue; } if (mobile.AccessLevel > AccessLevel.Player) { continue; } bool validTarget = false; PlayerMobile pm_Target = mobile as PlayerMobile; BaseCreature bc_Target = mobile as BaseCreature; if (pm_Target != null) { validTarget = true; } if (bc_Target != null) { if (bc_Target.Controlled && bc_Target.ControlMaster is PlayerMobile) { validTarget = true; } } if (validTarget) { m_Queue.Enqueue(mobile); } } mobilesInRange.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); Point3D mobileLocation = mobile.Location; int distance = range - (int)GetDistanceToSqrt(mobile); double damage = DamageMax; if (mobile is BaseCreature) { damage *= 2; } Direction direction = Utility.GetDirection(location, mobileLocation); int windId = GetWindItemId(direction, false); MovingEffect(mobile, windId, 5, 1, false, false, effectHue, 0); SpecialAbilities.KnockbackSpecialAbility(1.0, Location, this, mobile, damage, distance, -1, "", "You are knocked back by the breath of life!"); } Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate { if (Deleted || !Alive) { return; } for (int a = 0; a < creaturesToSummon; a++) { Point3D spawnLocation = Location; List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, 1, 15, 1, 10, true); if (m_ValidLocations.Count > 0) { spawnLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)]; } int particleSpeed = 5; IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 3), Map); IEntity effectEndLocation = new Entity(Serial.Zero, new Point3D(spawnLocation.X, spawnLocation.Y, spawnLocation.Z + 3), map); Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x3728, particleSpeed, 0, false, false, 0, 0); double distance = Utility.GetDistanceToSqrt(Location, spawnLocation); double destinationDelay = (double)distance * .08; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (Deleted || !Alive) { return; } Effects.PlaySound(spawnLocation, map, 0x653); Effects.SendLocationParticles(effectEndLocation, 0x3709, 10, 20, effectHue, 0, 5029, 0); Effects.SendLocationParticles(effectEndLocation, 0x3779, 10, 60, effectHue, 0, 5029, 0); Effects.SendLocationParticles(effectEndLocation, 0x3996, 10, 60, effectHue, 0, 5029, 0); Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate { if (this == null) { return; } if (Deleted || !Alive) { return; } BaseCreature monsterToSpawn = null; int maxCreatureValue = 1 + (int)(Math.Ceiling(10 * spawnPercent)); if (maxCreatureValue > 10) { maxCreatureValue = 10; } switch (Utility.RandomMinMax(1, maxCreatureValue)) { case 1: monsterToSpawn = new Zombie(); break; case 2: monsterToSpawn = new Skeleton(); break; case 3: monsterToSpawn = new Ghoul(); break; case 4: monsterToSpawn = new PatchworkSkeleton(); break; case 5: monsterToSpawn = new ZombieMagi(); break; case 6: monsterToSpawn = new SkeletalMage(); break; case 7: monsterToSpawn = new SkeletalKnight(); break; case 8: monsterToSpawn = new Mummy(); break; case 9: monsterToSpawn = new SkeletalDrake(); break; case 10: monsterToSpawn = new RottingCorpse(); break; } if (monsterToSpawn != null) { monsterToSpawn.BossMinion = true; monsterToSpawn.MoveToWorld(spawnLocation, map); m_Creatures.Add(monsterToSpawn); } }); }); } }); }); }
protected override void OnTick() { if ( m_Item.Deleted ) return; Mobile spawn; switch ( Utility.Random( 8 ) ) { default: case 0: spawn = new PatchworkSkeleton(); break; case 1: spawn = new Zombie(); break; case 2: spawn = new Wraith(); break; case 3: spawn = new SkeletalMage(); break; case 4: spawn = new Mummy(); break; case 5: spawn = new BoneKnight(); break; case 6: spawn = new SkeletalKnight(); break; case 7: spawn = new Lich(); break; } spawn.MoveToWorld( m_Item.Location, m_Item.Map ); //Effects.PlaySound( p, map, 0x1FB ); //Effects.SendLocationParticles( EffectItem.Create( p, map, EffectItem.DefaultDuration ), 0x3789, 1, 40, 0x3F, 3, 9907, 0 ); m_Item.Delete(); }
public void DamageEffect(Mobile from) { if (Deleted || !Alive) { return; } if (from == null) { return; } if (from.Deleted || !from.Alive) { return; } if (AbilityInProgress) { return; } double spawnPercent = (double)intervalCount / (double)totalIntervals; Mobile mobile = from; Point3D location = Location; Map map = Map; int effectHue = Hue - 1; if (InLOS(mobile) && GetDistanceToSqrt(mobile) <= 16) { Animate(4, 4, 1, true, false, 0); double stationaryDelay = 2; Combatant = null; NextDecisionTime = DateTime.UtcNow + TimeSpan.FromSeconds(stationaryDelay); AIObject.NextMove = AIObject.NextMove + TimeSpan.FromSeconds(stationaryDelay); LastSwingTime = LastSwingTime + TimeSpan.FromSeconds(stationaryDelay); NextSpellTime = NextSpellTime + TimeSpan.FromSeconds(stationaryDelay); NextCombatHealActionAllowed = NextCombatHealActionAllowed + TimeSpan.FromSeconds(stationaryDelay); NextCombatSpecialActionAllowed = NextCombatSpecialActionAllowed + TimeSpan.FromSeconds(stationaryDelay); NextCombatEpicActionAllowed = NextCombatEpicActionAllowed + TimeSpan.FromSeconds(stationaryDelay); SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, stationaryDelay, true, 0, false, "", "", "-1"); IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 8), map); Animate(15, 8, 1, true, false, 0); //Staff Effects.PlaySound(mobile.Location, mobile.Map, 0x64C); Direction direction = Utility.GetDirection(location, mobile.Location); int windId = GetWindItemId(direction, true); MovingEffect(mobile, windId, 5, 1, false, false, effectHue, 0); double distance = Utility.GetDistanceToSqrt(location, mobile.Location); double destinationDelay = (double)distance * .08; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (Deleted || !Alive) { return; } if (mobile == null) { return; } if (mobile.Deleted || !mobile.Alive) { return; } Point3D mobileLocation = mobile.Location; int damage = DamageMin; if (mobile is BaseCreature) { damage = (int)((double)damage * 2); } int knockbackDistance = 4 + (int)(Math.Ceiling(8 * spawnPercent)); SpecialAbilities.KnockbackSpecialAbility(1.0, Location, this, mobile, damage, knockbackDistance, -1, "", "You are knocked back!"); Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate { if (Deleted || !Alive) { return; } int particleSpeed = 5; IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 3), Map); IEntity effectEndLocation = new Entity(Serial.Zero, new Point3D(mobileLocation.X, mobileLocation.Y, mobileLocation.Z + 3), map); Effects.SendMovingEffect(effectStartLocation, effectEndLocation, 0x3728, particleSpeed, 0, false, false, 0, 0); double newDistance = Utility.GetDistanceToSqrt(Location, mobileLocation); double newDestinationDelay = (double)newDistance * .08; Timer.DelayCall(TimeSpan.FromSeconds(newDestinationDelay), delegate { if (Deleted || !Alive) { return; } Effects.PlaySound(mobileLocation, map, 0x653); Effects.SendLocationParticles(effectEndLocation, 0x3709, 10, 20, effectHue, 0, 5029, 0); Effects.SendLocationParticles(effectEndLocation, 0x3779, 10, 60, effectHue, 0, 5029, 0); Effects.SendLocationParticles(effectEndLocation, 0x3996, 10, 60, effectHue, 0, 5029, 0); Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate { if (Deleted || !Alive) { return; } BaseCreature monsterToSpawn = null; int maxCreatureValue = 1 + (int)(Math.Ceiling(10 * spawnPercent)); if (maxCreatureValue > 10) { maxCreatureValue = 10; } switch (Utility.RandomMinMax(1, maxCreatureValue)) { case 1: monsterToSpawn = new Zombie(); break; case 2: monsterToSpawn = new Skeleton(); break; case 3: monsterToSpawn = new Ghoul(); break; case 4: monsterToSpawn = new PatchworkSkeleton(); break; case 5: monsterToSpawn = new ZombieMagi(); break; case 6: monsterToSpawn = new SkeletalMage(); break; case 7: monsterToSpawn = new SkeletalKnight(); break; case 8: monsterToSpawn = new Mummy(); break; case 9: monsterToSpawn = new SkeletalDrake(); break; case 10: monsterToSpawn = new RottingCorpse(); break; } if (monsterToSpawn != null) { monsterToSpawn.EventMinion = true; monsterToSpawn.MoveToWorld(mobileLocation, map); m_Creatures.Add(monsterToSpawn); } }); }); }); }); } }