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); } }); }); }); }); } }
public void FireBarrage() { if (!SpecialAbilities.Exists(this)) { return; } IPooledEnumerable nearbyMobiles = Map.GetMobilesInRange(Location, FireBarrageRange); int mobileCount = 0; foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } if (!Map.InLOS(Location, mobile.Location)) { continue; } if (mobile.Hidden) { continue; } mobileCount++; } nearbyMobiles.Free(); nearbyMobiles = Map.GetMobilesInRange(Location, FireBarrageRange); List <Mobile> m_NearbyMobiles = new List <Mobile>(); foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } if (!Map.InLOS(Location, mobile.Location)) { continue; } if (mobile.Hidden) { continue; } if (Combatant != null) { if (mobileCount > 1 && mobile == Combatant) { continue; } } m_NearbyMobiles.Add(mobile); } nearbyMobiles.Free(); if (m_NearbyMobiles.Count == 0) { return; } Mobile mobileTarget = m_NearbyMobiles[Utility.RandomMinMax(0, m_NearbyMobiles.Count - 1)]; double spawnPercent = (double)intervalCount / (double)totalIntervals; int maxExtraFireballs = 10; int fireballs = 10 + (int)Math.Ceiling(((double)maxExtraFireballs * spawnPercent)); double directionDelay = .25; double initialDelay = 1; double fireballDelay = .1; double totalDelay = 1 + directionDelay + initialDelay + ((double)fireballs * fireballDelay); SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); m_NextFireBarrageAllowed = DateTime.UtcNow + NextFireBarrageDelay + TimeSpan.FromSeconds(totalDelay); m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay); AbilityInProgress = true; Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (SpecialAbilities.Exists(this)) { AbilityInProgress = false; } }); PublicOverheadMessage(MessageType.Regular, 0, false, "*takes deep breath*"); Point3D location = Location; Map map = Map; Point3D targetLocation = mobileTarget.Location; Map targetMap = mobileTarget.Map; Direction = Utility.GetDirection(Location, targetLocation); Timer.DelayCall(TimeSpan.FromSeconds(directionDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } Animate(5, 15, 1, true, false, 0); PlaySound(GetAngerSound()); Timer.DelayCall(TimeSpan.FromSeconds(initialDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } for (int a = 0; a < fireballs; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * fireballDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } if (DamageIntervalInProgress) { return; } bool mobileTargetValid = true; if (mobileTarget == null) { mobileTargetValid = false; } else if (mobileTarget.Deleted || !mobileTarget.Alive) { mobileTargetValid = false; } else { if (mobileTarget.Hidden || Utility.GetDistance(Location, mobileTarget.Location) >= FireBarrageRange) { mobileTargetValid = false; } } if (mobileTargetValid) { targetLocation = mobileTarget.Location; targetMap = mobileTarget.Map; } int effectSound = 0x357; int itemID = 0x36D4; int itemHue = 2602; int impactSound = 0x226; int impactHue = 2602; int xOffset = 0; int yOffset = 0; int distance = Utility.GetDistance(Location, targetLocation); if (distance > 1) { if (Utility.RandomDouble() <= .5) { xOffset = Utility.RandomList(-1, 1); } if (Utility.RandomDouble() <= .5) { yOffset = Utility.RandomList(-1, 1); } } IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 10), map); Point3D adjustedLocation = new Point3D(targetLocation.X + xOffset, targetLocation.Y + yOffset, targetLocation.Z); SpellHelper.AdjustField(ref adjustedLocation, targetMap, 12, false); IEntity endLocation = new Entity(Serial.Zero, new Point3D(adjustedLocation.X, adjustedLocation.Y, adjustedLocation.Z + 10), targetMap); Effects.PlaySound(location, map, effectSound); Effects.SendMovingEffect(startLocation, endLocation, itemID, 8, 0, false, false, itemHue, 0); double targetDistance = Utility.GetDistanceToSqrt(location, adjustedLocation); double destinationDelay = (double)targetDistance * .06; Direction newDirection = Utility.GetDirection(location, adjustedLocation); if (Direction != newDirection) { Direction = newDirection; } Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { Effects.PlaySound(adjustedLocation, targetMap, impactSound); Effects.SendLocationParticles(EffectItem.Create(adjustedLocation, targetMap, EffectItem.DefaultDuration), 0x3709, 20, 20, impactHue, 0, 0, 0); Queue m_Queue = new Queue(); nearbyMobiles = targetMap.GetMobilesInRange(adjustedLocation, 0); foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } m_Queue.Enqueue(mobile); } nearbyMobiles.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); int damage = (int)(Math.Round((double)DamageMin / 5)); if (mobile is BaseCreature) { damage *= 3; } else { if (Utility.GetDistance(Location, mobile.Location) <= 1) { damage = (int)(Math.Round((double)damage * .5)); } } DoHarmful(mobile); new Blood().MoveToWorld(mobile.Location, mobile.Map); AOS.Damage(mobile, this, damage, 0, 100, 0, 0, 0); } }); }); } }); }); }
public void WingBuffet() { if (!SpecialAbilities.Exists(this)) { return; } int wingFlaps = 3; double flapDuration = 0.5; double minRange = 10; double maxRange = 30; double spawnPercent = (double)intervalCount / (double)totalIntervals; int range = (int)(minRange + ((maxRange - minRange) * spawnPercent)); double totalDelay = 3; Combatant = null; SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); AbilityInProgress = true; DamageIntervalInProgress = true; m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(.5); Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } AbilityInProgress = false; DamageIntervalInProgress = false; m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay; }); PublicOverheadMessage(MessageType.Regular, 0, false, "*furiously beats wings*"); for (int a = 0; a < wingFlaps; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * flapDuration), delegate { if (!SpecialAbilities.Exists(this)) { return; } Effects.PlaySound(Location, Map, GetAngerSound()); Animate(19, 10, 2, true, false, 0); }); } Timer.DelayCall(TimeSpan.FromSeconds((double)wingFlaps * flapDuration), delegate { if (!SpecialAbilities.Exists(this)) { return; } Point3D location = Location; Map map = Map; Queue m_Queue = new Queue(); IPooledEnumerable nearbyMobiles = map.GetMobilesInRange(location, range); foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } m_Queue.Enqueue(mobile); } nearbyMobiles.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); int distance = range - Utility.GetDistance(location, mobile.Location); if (distance < 1) { distance = 1; } double damage = (double)(Utility.RandomMinMax(DamageMin, DamageMax)) * 2; SpecialAbilities.KnockbackSpecialAbility(1.0, location, this, mobile, damage, distance, -1, "", "The beast buffets you with its wings!"); } }); }
protected override bool OnMove(Direction d) { if (m_ChargeInProgress) { if (Utility.RandomDouble() <= .15) { Effects.PlaySound(Location, Map, 0x2F4); int effectHue = 0; DeDOSElectricField electricField = new DeDOSElectricField(this, effectHue, 1, 20, 3, 5, false, false, true, -1, true); electricField.MoveToWorld(Location, Map); } m_NextChargeAllowed = DateTime.UtcNow + NextChargeDelay; Queue m_Queue = new Queue(); IPooledEnumerable nearbyMobiles = Map.GetMobilesInRange(Location, 1); foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } if (!Map.InLOS(Location, mobile.Location)) { continue; } if (mobile == Combatant) { continue; } if (m_Trampled.Contains(mobile)) { continue; } m_Queue.Enqueue(mobile); } nearbyMobiles.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); m_Trampled.Add(mobile); Effects.PlaySound(Location, Map, Utility.RandomList(0x3BB, 0x3BA, 0x3B9)); Effects.PlaySound(mobile.Location, mobile.Map, mobile.GetHurtSound()); double damage = DamageMin; if (Combatant is BaseCreature) { damage *= 2; } new Blood().MoveToWorld(mobile.Location, mobile.Map); AOS.Damage(mobile, (int)damage, 100, 0, 0, 0, 0); if (mobile is PlayerMobile) { mobile.Animate(21, 6, 1, true, false, 0); } else if (mobile is BaseCreature) { BaseCreature bc_Creature = mobile as BaseCreature; if (bc_Creature.IsHighSeasBodyType) { bc_Creature.Animate(2, 14, 1, true, false, 0); } else if (bc_Creature.Body != null) { if (bc_Creature.Body.IsHuman) { bc_Creature.Animate(21, 6, 1, true, false, 0); } else { bc_Creature.Animate(2, 4, 1, true, false, 0); } } } SpecialAbilities.HinderSpecialAbility(1.0, this, mobile, 1.0, 1, false, -1, false, "", "You have been trampled and can't move!", "-1"); } CheckChargeResolved(); } Effects.PlaySound(Location, Map, Utility.RandomList(0x12E, 0x12D)); return(base.OnMove(d)); }
public override void OnThink() { base.OnThink(); Point3D location = Location; Map map = Map; //Outside of Guard Area if (GuardsHome && !(ControlMaster is PlayerMobile)) { if (Utility.GetDistance(Home, location) > MaxDistanceAllowedFromHome) { TimedStatic dirt = new TimedStatic(Utility.RandomList(7681, 7682), 5); dirt.Name = "dirt"; dirt.MoveToWorld(location, map); dirt.PublicOverheadMessage(MessageType.Regular, 0, false, ReturnHomeString); Effects.PlaySound(location, map, 0x657); int projectiles = 6; int particleSpeed = 4; for (int a = 0; a < projectiles; a++) { Point3D newLocation = new Point3D(location.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), location.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), location.Z); SpellHelper.AdjustField(ref newLocation, map, 12, false); IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 5), map); IEntity effectEndLocation = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 5), map); Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(0x3728), particleSpeed, 0, false, false, 0, 0); } Location = Home; Combatant = null; return; } } if (m_NeedWaypoint && m_CanTeleportToBaseNode && !(ControlMaster is PlayerMobile)) { Dictionary <UOACZWayPoint, int> DictWaypoints = new Dictionary <UOACZWayPoint, int>(); foreach (UOACZWayPoint waypoint in UOACZWayPoint.m_UOACZWaypoints) { if (!UOACZRegion.ContainsItem(waypoint)) { continue; } if (!waypoint.IsBaseNode) { continue; } int distanceToWaypoint = (Utility.GetDistance(Location, waypoint.Location)); if (distanceToWaypoint >= UOACZSystem.UndeadMaxDynamicWaypointRange) { continue; } int distanceWeight = (int)(Math.Round(((double)UOACZSystem.UndeadMaxDynamicWaypointRange - (double)distanceToWaypoint) * .05)); if (distanceWeight < 1) { distanceWeight = 1; } DictWaypoints.Add(waypoint, distanceWeight); } if (DictWaypoints.Count > 0) { int TotalValues = 0; foreach (KeyValuePair <UOACZWayPoint, int> pair in DictWaypoints) { TotalValues += pair.Value; } double ItemCheck = Utility.RandomDouble(); double CumulativeAmount = 0.0; double AdditionalAmount = 0.0; foreach (KeyValuePair <UOACZWayPoint, int> pair in DictWaypoints) { AdditionalAmount = (double)pair.Value / (double)TotalValues; if (ItemCheck >= CumulativeAmount && ItemCheck < (CumulativeAmount + AdditionalAmount)) { UOACZWayPoint waypoint = pair.Key; if (waypoint != null) { if (!waypoint.Deleted) { CurrentWaypoint = pair.Key; m_NeedWaypoint = false; return; } } break; } CumulativeAmount += AdditionalAmount; } } else { m_NeedWaypoint = false; } } if ((DateTime.UtcNow >= m_LastActivity + InactivityThreshold) && !(ControlMaster is PlayerMobile)) { //Send to Random Town Waypoint BaseNode if (m_CanTeleportToBaseNode) { List <UOACZWayPoint> m_ValidBaseNodes = new List <UOACZWayPoint>(); foreach (UOACZWayPoint waypoint in UOACZWayPoint.m_UOACZWaypoints) { if (waypoint == null) { continue; } if (waypoint.Deleted) { continue; } if (!UOACZRegion.ContainsItem(waypoint)) { continue; } if (!waypoint.IsBaseNode) { continue; } if (waypoint.WaypointType == UOACZWayPoint.UOACZWaypointType.UndeadWilderness) { continue; } m_ValidBaseNodes.Add(waypoint); } if (m_ValidBaseNodes.Count > 0) { UOACZWayPoint targetWaypoint = m_ValidBaseNodes[Utility.RandomMinMax(0, m_ValidBaseNodes.Count - 1)]; MoveToWorld(targetWaypoint.Location, targetWaypoint.Map); CurrentWaypoint = targetWaypoint; m_LastActivity = DateTime.UtcNow; m_NeedWaypoint = false; return; } } m_NeedWaypoint = true; return; } if (Utility.RandomDouble() < 0.005) { if (Combatant == null) { Say(idleSpeech[Utility.Random(idleSpeech.Length - 1)]); } else { Say(combatSpeech[Utility.Random(combatSpeech.Length - 1)]); } } bool ignoreBreakableStatics = false; if (Hidden && ControlMaster is PlayerMobile) { ignoreBreakableStatics = true; } if (DateTime.UtcNow >= m_NextBreakableStaticCheckAllowed && DateTime.UtcNow >= m_NextBreakableStaticAttackAllowed && !ignoreBreakableStatics) { m_NextBreakableStaticCheckAllowed = DateTime.UtcNow + BreakableStaticCheckDelay; BreakableStatic targetBreakableStatic = null; Dictionary <BreakableStatic, int> DictBreakableStatics = new Dictionary <BreakableStatic, int>(); IPooledEnumerable nearbyItems = Map.GetItemsInRange(Location, 1); foreach (Item item in nearbyItems) { if (item.Deleted) { continue; } if (item is BreakableStatic) { if (!Map.InLOS(Location, item.Location)) { continue; } BreakableStatic breakableStatic = item as BreakableStatic; if (breakableStatic is UOACZBreakableStatic) { UOACZBreakableStatic uoaczBreakableStatic = breakableStatic as UOACZBreakableStatic; if (uoaczBreakableStatic.AllowHumanDamage) { continue; } } if (breakableStatic.DamageState == BreakableStatic.DamageStateType.Broken) { continue; } int weight = 5; if (breakableStatic == m_LastBreakableStaticAttacked) { weight += 10; } int damageBonus = (int)Math.Round((10 * (1 - (double)breakableStatic.HitPoints / (double)breakableStatic.MaxHitPoints))); weight += damageBonus; DictBreakableStatics.Add(breakableStatic, weight); } } nearbyItems.Free(); int TotalValues = 0; foreach (KeyValuePair <BreakableStatic, int> pair in DictBreakableStatics) { TotalValues += pair.Value; } double ItemCheck = Utility.RandomDouble(); double CumulativeAmount = 0.0; double AdditionalAmount = 0.0; foreach (KeyValuePair <BreakableStatic, int> pair in DictBreakableStatics) { AdditionalAmount = (double)pair.Value / (double)TotalValues; if (ItemCheck >= CumulativeAmount && ItemCheck < (CumulativeAmount + AdditionalAmount)) { targetBreakableStatic = pair.Key; break; } CumulativeAmount += AdditionalAmount; } if (targetBreakableStatic != null) { double minHinder = 1; double maxHinder = 1; double weaponUsageDelay = 3; BaseWeapon weapon = Weapon as BaseWeapon; if (weapon != null) { weaponUsageDelay = weapon.GetDelay(this, false).TotalSeconds; } bool stockpileNearby = false; if (targetBreakableStatic is UOACZStockpile) { stockpileNearby = true; } else { switch (targetBreakableStatic.DamageState) { case BreakableStatic.DamageStateType.Normal: minHinder = weaponUsageDelay * .5; maxHinder = weaponUsageDelay; break; case BreakableStatic.DamageStateType.LightlyDamaged: minHinder = weaponUsageDelay * .65; maxHinder = weaponUsageDelay; break; case BreakableStatic.DamageStateType.HeavilyDamaged: minHinder = weaponUsageDelay * .8; maxHinder = weaponUsageDelay; break; } } double delay = minHinder + ((maxHinder - minHinder) * Utility.RandomDouble()); if (ControlMaster is PlayerMobile) { delay = 1; SpecialAbilities.EntangleSpecialAbility(1.0, null, this, 1, delay, 0, false, "", "", "-1"); } else { if (stockpileNearby) { delay = 10; SpecialAbilities.EntangleSpecialAbility(1.0, null, this, 1, delay, 0, false, "", "", "-1"); m_NextBreakableStaticAttackAllowed = DateTime.UtcNow + BreakableStaticAttackDelay; } else { if (Utility.RandomDouble() <= .5) { SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, delay, true, 0, false, "", "", "-1"); } else { SpecialAbilities.EntangleSpecialAbility(1.0, null, this, 1, delay, 0, false, "", "", "-1"); } m_NextBreakableStaticAttackAllowed = DateTime.UtcNow + BreakableStaticAttackDelay; } } targetBreakableStatic.Interact(this, BreakableStatic.InteractionType.Weapon); } } }
public void Swallow() { if (!SpecialAbilities.Exists(this)) { return; } if (!SpecialAbilities.Exists(Combatant)) { return; } if (m_SwallowedMobiles.Contains(Combatant)) { return; } Mobile mobileTarget = Combatant; Combatant = null; double directionDelay = .25; double initialDelay = 1; double totalDelay = 1 + directionDelay + initialDelay; Direction direction = Utility.GetDirection(Location, mobileTarget.Location); PlaySound(0x5DA); SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, totalDelay, true, 0, false, "", "", "-1"); m_NextSwallowAllowed = DateTime.UtcNow + NextSwallowDelay + TimeSpan.FromSeconds(totalDelay); m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay); AbilityInProgress = true; Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (SpecialAbilities.Exists(this)) { AbilityInProgress = false; } }); Timer.DelayCall(TimeSpan.FromSeconds(directionDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } Animate(11, 15, 1, true, false, 0); PlaySound(0x5DA); double spawnPercent = (double)intervalCount / (double)totalIntervals; int maxExtraSwallowDuration = 10; double swallowDuration = 10 + (Math.Ceiling((double)maxExtraSwallowDuration * spawnPercent)); PublicOverheadMessage(MessageType.Regular, 0, false, "*swallows " + mobileTarget.Name + "*"); m_SwallowedMobiles.Add(mobileTarget); mobileTarget.Location = Location; double extraDamage = DamageMax; double damage = (double)DamageMin + (extraDamage * spawnPercent); if (mobileTarget is BaseCreature) { damage *= 1.5; } if (mobileTarget is PlayerMobile) { damage *= .5; } SpecialAbilities.BleedSpecialAbility(1.0, this, mobileTarget, damage, swallowDuration, 0, true, "", "", "-1"); SpecialAbilities.HinderSpecialAbility(1.0, null, mobileTarget, 1.0, swallowDuration, false, -1, false, "", "You have been 'engulfed' and cannot move or speak!", "-1"); mobileTarget.Squelched = true; mobileTarget.Hidden = true; Timer.DelayCall(TimeSpan.FromSeconds(swallowDuration), delegate { if (mobileTarget == null) { return; } if (mobileTarget.Deleted) { return; } mobileTarget.Squelched = false; mobileTarget.Hidden = false; if (!SpecialAbilities.Exists(this)) { return; } if (m_SwallowedMobiles.Contains(mobileTarget)) { m_SwallowedMobiles.Remove(mobileTarget); } if (!mobileTarget.Alive) { return; } PlaySound(0x56C); PublicOverheadMessage(MessageType.Regular, 0, false, "*spits out " + mobileTarget.Name + "*"); int knockbackDistance = 10; damage = 10; SpecialAbilities.KnockbackSpecialAbility(1.0, Location, this, mobileTarget, damage, knockbackDistance, -1, "", "Maggot spits you out!"); for (int a = 0; a < 6; a++) { TimedStatic ichor = new TimedStatic(Utility.RandomList(4650, 4651, 4652, 4653, 4654, 4655), 5); ichor.Hue = 2051; ichor.Name = "ichor"; Point3D newPoint = new Point3D(mobileTarget.Location.X + Utility.RandomList(-1, 1), mobileTarget.Location.Y + Utility.RandomList(-1, 1), mobileTarget.Location.Z); SpellHelper.AdjustField(ref newPoint, mobileTarget.Map, 12, false); ichor.MoveToWorld(newPoint, mobileTarget.Map); } }); }); }
public override void OnThink() { base.OnThink(); if (Utility.RandomDouble() < 0.01 && !Hidden && DateTime.UtcNow > m_NextSpeechAllowed) { if (Combatant == null) { Say(idleSpeech[Utility.Random(idleSpeech.Length - 1)]); } else { Say(combatSpeech[Utility.Random(combatSpeech.Length - 1)]); } m_NextSpeechAllowed = DateTime.UtcNow + NextSpeechDelay; } if (Combatant != null) { if (DateTime.UtcNow >= m_NextThrowingNetAllowed) { m_NextThrowingNetAllowed = DateTime.UtcNow + NextThrowingNetDelay; int effectRange = 10; IPooledEnumerable nearbyMobiles = Map.GetMobilesInRange(Location, effectRange); int mobileCount = 0; foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } if (!Map.InLOS(Location, mobile.Location)) { continue; } if (mobile.Hidden) { continue; } mobileCount++; } nearbyMobiles.Free(); nearbyMobiles = Map.GetMobilesInRange(Location, effectRange); List <Mobile> m_NearbyMobiles = new List <Mobile>(); foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } if (!Map.InLOS(Location, mobile.Location)) { continue; } if (mobile.Hidden) { continue; } if (Combatant != null) { if (mobileCount > 1 && mobile == Combatant) { continue; } } m_NearbyMobiles.Add(mobile); } nearbyMobiles.Free(); if (m_NearbyMobiles.Count == 0) { return; } Mobile mobileTarget = m_NearbyMobiles[Utility.RandomMinMax(0, m_NearbyMobiles.Count - 1)]; Point3D location = Location; Map map = Map; Point3D mobileLocation = mobileTarget.Location; Map mobileMap = mobileTarget.Map; SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, 1, true, 0, false, "", "", "-1"); IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 7), map); IEntity endLocation = new Entity(Serial.Zero, new Point3D(mobileTarget.X, mobileTarget.Y, mobileTarget.Z), mobileMap); int itemId = 3530; int itemHue = 2587; Effects.SendMovingEffect(startLocation, endLocation, itemId, 5, 0, false, false, 0, 0); double distance = Utility.GetDistance(location, mobileLocation); double destinationDelay = (double)distance * .08; double duration = Utility.RandomMinMax(3, 5); if (mobileTarget is BaseCreature) { duration *= 1.5; } PublicOverheadMessage(MessageType.Regular, 2586, false, "* .net *"); SpecialAbilities.EntangleSpecialAbility(1.0, null, mobileTarget, 1, duration, 0, true, "", "You have been ensnared in a net!", "-1"); Effects.PlaySound(location, map, Utility.RandomList(0x5D2, 0x5D3)); Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (mobileTarget == null) { return; } if (mobileTarget.Deleted || !mobileTarget.Alive) { return; } if (Utility.GetDistance(location, mobileTarget.Location) >= 30) { return; } for (int a = 0; a < 9; a++) { TimedStatic net = new TimedStatic(3538, duration - destinationDelay); Point3D netLocation = mobileTarget.Location; switch (a) { //Row 1 case 0: net.ItemID = 3538; netLocation = new Point3D(netLocation.X - 1, netLocation.Y - 1, netLocation.Z); break; case 1: net.ItemID = 3528; netLocation = new Point3D(netLocation.X, netLocation.Y - 1, netLocation.Z); break; case 2: net.ItemID = 3537; netLocation = new Point3D(netLocation.X + 1, netLocation.Y - 1, netLocation.Z); break; //Row 2 case 3: net.ItemID = 3539; netLocation = new Point3D(netLocation.X - 1, netLocation.Y, netLocation.Z); break; case 4: net.ItemID = 3530; netLocation = new Point3D(netLocation.X, netLocation.Y, netLocation.Z); break; case 5: net.ItemID = 3531; netLocation = new Point3D(netLocation.X + 1, netLocation.Y, netLocation.Z); break; //Row 3 case 6: net.ItemID = 3540; netLocation = new Point3D(netLocation.X - 1, netLocation.Y + 1, netLocation.Z); break; case 7: net.ItemID = 3529; netLocation = new Point3D(netLocation.X, netLocation.Y + 1, netLocation.Z); break; case 8: net.ItemID = 3541; netLocation = new Point3D(netLocation.X + 1, netLocation.Y + 1, netLocation.Z); break; } net.Hue = itemHue; net.Name = "the net"; net.MoveToWorld(netLocation, mobileMap); } }); } } }
public void CallForAid() { double maxExtraCreatures = 4; int creatures = 2 + (int)(Math.Ceiling(maxExtraCreatures * m_SpawnPercent)); double directionDelay = .25; double initialDelay = 2; double totalDelay = 1 + directionDelay + initialDelay; Combatant = null; SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); PublicOverheadMessage(MessageType.Regular, 0, false, "*calls for aid*"); Effects.PlaySound(Location, Map, GetAngerSound()); m_AbilityInProgress = true; m_NextAbilityAllowed = DateTime.UtcNow + GetNextAbilityDelay(); m_HealthIntervalAbilityInProgress = true; Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } m_AbilityInProgress = false; m_NextAbilityAllowed = DateTime.UtcNow + GetNextAbilityDelay(); m_HealthIntervalAbilityInProgress = false; }); Timer.DelayCall(TimeSpan.FromSeconds(directionDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } Animate(27, 16, 1, true, false, 0); }); Timer.DelayCall(TimeSpan.FromSeconds(initialDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } Effects.PlaySound(Location, Map, GetAngerSound()); for (int a = 0; a < creatures; a++) { Point3D targetLocation = Location; Map map = Map; List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, true, Location, Map, 1, 15, 1, 5, true); if (m_ValidLocations.Count > 0) { targetLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)]; } BaseCreature bc_Creature = null; if (m_SpawnPercent <= .25) { switch (Utility.RandomMinMax(1, 1)) { case 1: bc_Creature = new RoyalWhelp(); break; } } else if (m_SpawnPercent <= .50) { switch (Utility.RandomMinMax(1, 3)) { case 1: bc_Creature = new RoyalWhelp(); break; case 2: bc_Creature = new RoyalWhelp(); break; case 3: bc_Creature = new RoyalDrake(); break; } } else { switch (Utility.RandomMinMax(1, 3)) { case 1: bc_Creature = new RoyalWhelp(); break; case 2: bc_Creature = new RoyalDrake(); break; case 3: bc_Creature = new RoyalDragon(); break; } } if (bc_Creature != null) { m_Creatures.Add(bc_Creature); bc_Creature.MoveToWorld(targetLocation, map); bc_Creature.PlaySound(bc_Creature.GetIdleSound()); Effects.SendLocationParticles(EffectItem.Create(targetLocation, map, EffectItem.DefaultDuration), 0x3728, 10, 30, 0, 0, 2023, 0); } } }); }
public void SummonTurkeys() { if (!SpecialAbilities.Exists(this)) { return; } double spawnPercent = (double)intervalCount / (double)totalIntervals; double directionDelay = .25; double initialDelay = 1; double totalDelay = 1 + directionDelay + initialDelay; SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay); AbilityInProgress = true; Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } AbilityInProgress = false; }); Effects.PlaySound(Location, Map, 0x4d7); PublicOverheadMessage(MessageType.Regular, 0, false, "*establishes new pecking order*"); Point3D location = Location; Map map = Map; PlaySound(GetAngerSound()); Animate(28, 10, 1, true, false, 0); Timer.DelayCall(TimeSpan.FromSeconds(directionDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } PlaySound(0x468); int projectiles = 50; double projectileDelay = .02; int particleSpeed = 4; for (int a = 0; a < projectiles; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * projectileDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } Point3D newLocation = new Point3D(Location.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), Location.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), Location.Z); SpellHelper.AdjustField(ref newLocation, Map, 12, false); IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(Location.X, Location.Y, Location.Z + 5), Map); IEntity effectEndLocation = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 5), Map); Effects.SendMovingEffect(effectStartLocation, effectEndLocation, Utility.RandomList(3578, 3579), particleSpeed, 0, false, false, 0, 0); }); } Timer.DelayCall(TimeSpan.FromSeconds(projectiles * projectileDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } spawnPercent = (double)intervalCount / (double)totalIntervals; int turkeys = 5 + (int)(Math.Ceiling(7 * spawnPercent)); for (int a = 0; a < turkeys; a++) { Point3D creatureLocation = Location; Map creatureMap = Map; List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, 1, 15, 1, 8, true); if (m_ValidLocations.Count > 0) { creatureLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)]; } LesserGobbler creature = new LesserGobbler(); creature.MoveToWorld(creatureLocation, creatureMap); creature.PlaySound(creature.GetAngerSound()); Effects.SendLocationParticles(EffectItem.Create(creature.Location, creature.Map, TimeSpan.FromSeconds(5)), 0x3728, 10, 10, 2023); m_Creatures.Add(creature); } }); }); }
public void SetTimedEgg(Point3D location, Map map, EggType eggType) { int eggHue = Hue = Utility.RandomMinMax(2, 362); DecoyEasterEgg decoyEasterEgg = new DecoyEasterEgg(); decoyEasterEgg.Hue = eggHue; decoyEasterEgg.MoveToWorld(location, map); int delayTime = Utility.RandomMinMax(1, 10); Effects.SendLocationParticles(EffectItem.Create(location, map, TimeSpan.FromSeconds(0.25)), 0x9B5, 10, delayTime * 25, eggHue, 0, 5029, 0); Timer.DelayCall(TimeSpan.FromSeconds(delayTime), delegate { if (decoyEasterEgg != null) { if (!decoyEasterEgg.Deleted) { if (decoyEasterEgg.ParentEntity is PlayerMobile) { PlayerMobile pm_Owner = decoyEasterEgg.ParentEntity as PlayerMobile; pm_Owner.SendMessage("The eggs you gathered appear to be some sort of decoy, and they crumble in your backpack..."); pm_Owner.SendSound(0x134); } decoyEasterEgg.Delete(); } } int radius = 2; int effectSound = 0; switch (eggType) { case EggType.Explosive: effectSound = 0x359; break; case EggType.Entangle: effectSound = 0x211; break; case EggType.Poison: effectSound = 0x22F; break; case EggType.Ice: effectSound = 0x64F; break; case EggType.Banish: effectSound = 0x655; break; case EggType.Gust: effectSound = 0x64C; break; case EggType.Bloody: effectSound = 0x62B; break; } Effects.PlaySound(location, map, effectSound); Dictionary <Point3D, double> m_ExplosionLocations = new Dictionary <Point3D, double>(); m_ExplosionLocations.Add(location, 0); for (int a = 1; a < radius + 1; a++) { m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y - a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X, location.Y - a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y - a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X + a, location.Y + a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X, location.Y + a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y + a, location.Z), a); m_ExplosionLocations.Add(new Point3D(location.X - a, location.Y, location.Z), a); } foreach (KeyValuePair <Point3D, double> pair in m_ExplosionLocations) { Timer.DelayCall(TimeSpan.FromSeconds(pair.Value * .25), delegate { switch (eggType) { case EggType.Explosive: Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.5)), 0x36BD, 20, 10, 5044); break; case EggType.Entangle: radius = 3; Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.5)), 0x3973, 10, 50, 5029); break; case EggType.Poison: Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.5)), 0x372A, 10, 20, 59, 0, 5029, 0); break; case EggType.Ice: radius = 3; Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(0.25)), 0x3779, 10, 20, 1153, 0, 5029, 0); break; case EggType.Banish: radius = 3; Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), 0x3763, 10, 20, 2199, 0, 5029, 0); break; case EggType.Gust: radius = 4; Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), 0x1FB2, 10, 20, 0, 0, 5029, 0); break; case EggType.Bloody: Effects.SendLocationParticles(EffectItem.Create(pair.Key, map, TimeSpan.FromSeconds(.25)), Utility.RandomList(0x1645, 0x122A, 0x122B, 0x122C, 0x122D, 0x122E, 0x122F), 10, 20, 0, 0, 5029, 0); break; } }); } List <Mobile> m_TargetsHit = new List <Mobile>(); IPooledEnumerable eable = map.GetMobilesInRange(location, radius); foreach (Mobile mobile in eable) { if (mobile is EasterBunny) { continue; } if (!mobile.CanBeDamaged()) { continue; } m_TargetsHit.Add(mobile); } eable.Free(); int targets = m_TargetsHit.Count; for (int a = 0; a < targets; a++) { double damage = 0; Mobile mobile = m_TargetsHit[a]; if (mobile == null) { continue; } if (!mobile.Alive || mobile.Deleted) { continue; } switch (eggType) { case EggType.Explosive: damage = (double)(Utility.RandomMinMax(20, 40)); if (mobile is BaseCreature) { damage *= 1.5; } AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0); break; case EggType.Entangle: if (mobile != null) { SpecialAbilities.EntangleSpecialAbility(1.0, null, mobile, 1, 10, -1, true, "", "You are held in place!", "-1"); } break; case EggType.Poison: Poison poison = Poison.GetPoison(Utility.RandomMinMax(2, 4)); mobile.ApplyPoison(mobile, poison); break; case EggType.Ice: damage = (double)(Utility.RandomMinMax(10, 20)); if (mobile is BaseCreature) { damage *= 1.5; } SpecialAbilities.CrippleSpecialAbility(1.0, null, mobile, .5, 10, -1, true, "", "A blast of ice has slowed your actions!", "-1"); AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0); break; case EggType.Gust: SpecialAbilities.KnockbackSpecialAbility(1.0, Location, null, mobile, 40, 8, -1, "", "A gust of wind knocks you off your feet!"); break; case EggType.Banish: SpecialAbilities.HinderSpecialAbility(1.0, null, mobile, 1.0, 5, false, -1, false, "", "You cannot move or speak!", "-1"); mobile.Squelched = true; mobile.Hidden = true; Timer.DelayCall(TimeSpan.FromSeconds(5), delegate { if (mobile == null) { return; } mobile.Squelched = false; mobile.Hidden = false; }); break; case EggType.Bloody: SpecialAbilities.BleedSpecialAbility(1.0, null, mobile, 40, 8.0, 0x44D, true, "", "You begin to bleed!", "-1"); break; } } }); }
public void FireBreathSpin() { double maxRotations = 4; int rotations = (int)(Math.Ceiling(maxRotations * m_SpawnPercent)); double totalDelay = 1.5 + ((double)rotations * 1.5); Combatant = null; SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); m_AbilityInProgress = true; m_NextAbilityAllowed = DateTime.UtcNow + GetNextAbilityDelay(); m_HealthIntervalAbilityInProgress = true; Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } m_AbilityInProgress = false; m_NextAbilityAllowed = DateTime.UtcNow + GetNextAbilityDelay(); m_HealthIntervalAbilityInProgress = false; }); Effects.PlaySound(Location, Map, GetAngerSound()); SpecialAbilities.DoMassiveBreathAttack(this, Location, Direction, 5, true, BreathType.Fire, false); PublicOverheadMessage(MessageType.Regular, 0, false, "*takes a massive breath*"); for (int a = 0; a < rotations; a++) { Timer.DelayCall(TimeSpan.FromSeconds(1.5 + (a * 1.5)), delegate { if (!SpecialAbilities.Exists(this)) { return; } int newDirectionValue = (int)Direction; newDirectionValue += Utility.RandomList(-3, -4, -5, 3, 4, 5); if (newDirectionValue > 7) { newDirectionValue = 0 + (newDirectionValue - 8); } else if (newDirectionValue < 0) { newDirectionValue = 8 + newDirectionValue; } Direction nextDirection = (Direction)(newDirectionValue); SpecialAbilities.DoMassiveBreathAttack(this, Location, nextDirection, MassiveBreathRange, true, BreathType.Fire, false); }); } }
public virtual void BeginTunnel() { if (this == null) { return; } if (Deleted || !Alive) { return; } int digSound = 0x247; CantWalk = true; Say("*begins to dig a tunnel back to its magical lair*"); SpecialAbilities.HinderSpecialAbility(1.0, this, this, 1.0, 1, true, digSound, false, "", "", "-1"); digging = true; //Dirt int dirtCount = Utility.RandomMinMax(2, 3); for (int b = 0; b < dirtCount; b++) { Blood dirt = new Blood(); dirt.Name = "dirt"; dirt.ItemID = Utility.RandomList(7681, 7682); Point3D dirtLocation = new Point3D(Location.X + Utility.RandomList(-2, -1, 1, 2), Location.Y + Utility.RandomList(-2, -1, 1, 2), Z); dirt.MoveToWorld(dirtLocation, Map); } new BunnyHole().MoveToWorld(Location, Map); Animate(3, 5, 1, true, false, 0); for (int a = 1; a < 5; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a), delegate { if (this == null) { return; } if (Deleted || !Alive) { return; } Animate(3, 5, 1, true, false, 0); Say("*digs*"); SpecialAbilities.HinderSpecialAbility(1.0, this, this, 1.0, 1, false, digSound, false, "", "", "-1"); //Dirt int extraDirtCount = Utility.RandomMinMax(2, 3); for (int b = 0; b < extraDirtCount; b++) { Blood extraDirt = new Blood(); extraDirt.Name = "dirt"; extraDirt.ItemID = Utility.RandomList(7681, 7682); Point3D extraDirtLocation = new Point3D(Location.X + Utility.RandomList(-2, -1, 1, 2), Location.Y + Utility.RandomList(-2, -1, 1, 2), Z); extraDirt.MoveToWorld(extraDirtLocation, Map); } }); } Timer.DelayCall(TimeSpan.FromSeconds(5.0), delegate { if (this == null) { return; } if (Deleted || !Alive) { return; } Say("*poof*"); Effects.PlaySound(Location, Map, 0x657); Effects.SendLocationParticles(EffectItem.Create(Location, Map, TimeSpan.FromSeconds(5)), 0x3728, 10, 10, 2023); Delete(); }); }
protected override void OnTarget(Mobile from, object target) { if (from == null || m_Net == null) { return; } if (from.Deleted || !from.Alive || m_Net.Deleted || m_Net.RootParent != from) { return; } PlayerMobile player = from as PlayerMobile; if (player == null) { return; } if (!m_Net.IsChildOf(player.Backpack)) { player.SendMessage("That item must be in your pack in order to use it."); return; } if (!player.CanBeginAction(typeof(UOACZThrowingNet))) { player.SendMessage("You may only use a net once every " + m_Net.CooldownSeconds.ToString() + " seconds."); return; } UOACZPersistance.CheckAndCreateUOACZAccountEntry(player); if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } if (!player.IsUOACZHuman) { return; } Mobile mobileTarget = null; if (target is Mobile) { mobileTarget = target as Mobile; } else { player.SendMessage("That is not a valid target."); return; } if (mobileTarget == player) { player.SendMessage("You cannot target yourself."); return; } if (!UOACZSystem.IsUOACZValidMobile(mobileTarget)) { player.SendMessage("That is not a valid target."); return; } if (Utility.GetDistance(player.Location, mobileTarget.Location) > 8) { from.SendMessage("That is too far away"); return; } if (!player.Map.InLOS(player.Location, mobileTarget.Location)) { player.SendMessage("That is not within in your line of sight."); return; } SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1, 1, true, 0, false, "", "", "-1"); if (!from.Mounted) { player.Animate(31, 7, 1, true, false, 0); } double duration = 60; if (mobileTarget is UOACZBaseWildlife) { duration = 60; } if (mobileTarget is UOACZBaseUndead) { UOACZBaseUndead bc_Undead = mobileTarget as UOACZBaseUndead; double reduction = 1 - (bc_Undead.Difficulty * .10); if (reduction < .10) { reduction = .10; } duration *= reduction; } if (mobileTarget is UOACZBaseHuman) { UOACZBaseCivilian bc_Human = mobileTarget as UOACZBaseCivilian; double reduction = 1 - (bc_Human.Difficulty * .10); if (reduction < .10) { reduction = .10; } duration *= reduction; } PlayerMobile playerTarget = mobileTarget as PlayerMobile; if (playerTarget != null) { if (playerTarget.IsUOACZHuman) { duration = Utility.RandomMinMax(2, 4); } if (playerTarget.IsUOACZUndead) { duration = Utility.RandomMinMax(5, 10); } } UOACZPersistance.CheckAndCreateUOACZAccountEntry(player); player.m_UOACZAccountEntry.NetsThrown++; int itemId = m_Net.ItemID; int itemHue = m_Net.Hue; Effects.PlaySound(player.Location, player.Map, 0x5D3); player.DoHarmful(mobileTarget); Point3D playerLocation = player.Location; Map playerMap = player.Map; Point3D mobileLocation = mobileTarget.Location; Map mobileMap = mobileTarget.Map; IEntity startLocation = new Entity(Serial.Zero, new Point3D(playerLocation.X, playerLocation.Y, playerLocation.Z + 7), playerMap); IEntity endLocation = new Entity(Serial.Zero, new Point3D(mobileTarget.X, mobileTarget.Y, mobileTarget.Z), mobileMap); double distance = from.GetDistanceToSqrt(endLocation); double destinationDelay = (double)distance * .08; m_Net.Delete(); Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (!UOACZSystem.IsUOACZValidMobile(mobileTarget)) { return; } if (Utility.GetDistance(playerLocation, mobileLocation) >= 25) { return; } SpecialAbilities.HinderSpecialAbility(1.0, player, mobileTarget, 1, duration, true, -1, true, "You ensnare them in a net", "You have been ensnared in a net!", "-1"); for (int a = 0; a < 9; a++) { TimedStatic net = new TimedStatic(3538, duration - destinationDelay); Point3D netLocation = mobileTarget.Location; switch (a) { //Row 1 case 0: net.ItemID = 3538; netLocation = new Point3D(netLocation.X - 1, netLocation.Y - 1, netLocation.Z); break; case 1: net.ItemID = 3528; netLocation = new Point3D(netLocation.X, netLocation.Y - 1, netLocation.Z); break; case 2: net.ItemID = 3537; netLocation = new Point3D(netLocation.X + 1, netLocation.Y - 1, netLocation.Z); break; //Row 2 case 3: net.ItemID = 3539; netLocation = new Point3D(netLocation.X - 1, netLocation.Y, netLocation.Z); break; case 4: net.ItemID = 3530; netLocation = new Point3D(netLocation.X, netLocation.Y, netLocation.Z); break; case 5: net.ItemID = 3531; netLocation = new Point3D(netLocation.X + 1, netLocation.Y, netLocation.Z); break; //Row 3 case 6: net.ItemID = 3540; netLocation = new Point3D(netLocation.X - 1, netLocation.Y + 1, netLocation.Z); break; case 7: net.ItemID = 3529; netLocation = new Point3D(netLocation.X, netLocation.Y + 1, netLocation.Z); break; case 8: net.ItemID = 3541; netLocation = new Point3D(netLocation.X + 1, netLocation.Y + 1, netLocation.Z); break; } net.Hue = itemHue; net.Name = "a net"; net.MoveToWorld(netLocation, mobileMap); } }); }
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); } }); }); } }); }); }
public void IntervalEffect() { if (this == null) { return; } if (Deleted || !Alive) { return; } Point3D location = Location; Map map = Map; AbilityInProgress = true; double spawnPercent = (double)intervalCount / (double)totalIntervals; int loreStatues = 3 + (int)(Math.Ceiling(7 * spawnPercent)); int effectHue = Hue - 1; 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"); for (int a = 0; a < 2; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * 1), delegate { if (Deleted || !Alive) { return; } CantWalk = true; Frozen = true; PlaySound(GetAngerSound()); Animate(12, 12, 1, true, false, 0); }); } Timer.DelayCall(TimeSpan.FromSeconds(2), delegate { if (Deleted || !Alive) { return; } CantWalk = false; Frozen = false; AbilityInProgress = false; }); for (int a = 0; a < 4; a++) { double duration = 22 - (a * .5); Timer.DelayCall(TimeSpan.FromSeconds(a * .5), delegate { Effects.PlaySound(location, map, 0x1EC); for (int b = 0; b < loreStatues; b++) { if (Deleted || !Alive) { return; } Point3D runeLocation; List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, false, false, Location, Map, 1, 10, 1, 18, true); if (m_ValidLocations.Count > 0) { runeLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)]; } else { return; } TimedStatic forbiddenRunes = new TimedStatic(Utility.RandomList(3676, 3679, 3682, 3685, 3688), duration); forbiddenRunes.Name = "forbidden rune"; SpellHelper.AdjustField(ref runeLocation, map, 12, false); forbiddenRunes.MoveToWorld(runeLocation, map); TimedStatic timedStatic = new TimedStatic(0x3779, .5); timedStatic.Hue = effectHue; timedStatic.Name = "rune energy"; timedStatic.MoveToWorld(runeLocation, map); } }); } Timer.DelayCall(TimeSpan.FromSeconds(2), delegate { if (Deleted || !Alive) { return; } for (int a = 0; a < loreStatues; a++) { for (int b = 0; b < 3; b++) { List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(location, false, false, location, map, 1, 10, 1, 15, true); if (m_ValidLocations.Count > 0) { location = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)]; } bool foundStatue = false; IPooledEnumerable itemsNearby = map.GetItemsInRange(location, 2); { foreach (Item item in itemsNearby) { if (item is ForbiddenLoreStatue) { foundStatue = true; break; } } } itemsNearby.Free(); if (foundStatue || location == Location) { continue; } int statueAttackInterval = Utility.RandomMinMax(4, 6); int durationCount = (int)(Math.Ceiling(30 / (double)statueAttackInterval)); ForbiddenLoreStatue statue = new ForbiddenLoreStatue(10, DamageMin, DamageMin, statueAttackInterval, durationCount); statue.MoveToWorld(location, map); break; } } }); }
public void Enrage() { double spawnPercent = (double)intervalCount / (double)totalIntervals; double directionDelay = .25; double initialDelay = 1; double totalDelay = directionDelay + initialDelay; SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); m_NextEnrageAllowed = DateTime.UtcNow + NextEnrageDelay; m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay); AbilityInProgress = true; Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } AbilityInProgress = false; }); Effects.PlaySound(Location, Map, 0x4d7); PublicOverheadMessage(MessageType.Regular, 0, false, "*enters a fowl mood*"); Point3D location = Location; Map map = Map; PlaySound(GetAngerSound()); Animate(16, 8, 1, true, false, 0); Timer.DelayCall(TimeSpan.FromSeconds(directionDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } PlaySound(0x46A); FeatherExplosion(Location, Map, 20); SpecialAbilities.FrenzySpecialAbility(1.0, this, null, 1.0, EnrageDuration.TotalSeconds, 0, false, "", "", ""); SpecialAbilities.EnrageSpecialAbility(1.0, null, this, .5, EnrageDuration.TotalSeconds, 0, false, "", "", ""); Hue = EnragedHue; ActiveSpeed = .25; PassiveSpeed = .25; CurrentSpeed = .25; Timer.DelayCall(EnrageDuration, delegate { if (!SpecialAbilities.Exists(this)) { return; } Hue = NormalHue; ActiveSpeed = .35; PassiveSpeed = .35; CurrentSpeed = .35; }); }); }
public static void DoBreathAttack(BreathAttackType breathType, BaseCreature creature, Mobile target) { if (!SpecialAbilities.Exists(creature)) { return; } if (!SpecialAbilities.Exists(target)) { return; } if (!creature.CanBeHarmful(target)) { return; } creature.DoHarmful(target); creature.Direction = creature.GetDirectionTo(target); if (creature.IsHighSeasBodyType) { creature.Animate(Utility.RandomList(27), 5, 1, true, false, 0); } else { creature.Animate(12, 5, 1, true, false, 0); } SpecialAbilities.HinderSpecialAbility(1.0, null, creature, 1.0, 1.5, true, 0, false, "", "", "-1"); Timer.DelayCall(TimeSpan.FromSeconds(1.3), delegate { if (!SpecialAbilities.Exists(creature)) { return; } switch (breathType) { case BreathAttackType.Fire: Effects.PlaySound(creature.Location, creature.Map, 0x227); Effects.SendMovingEffect(creature, target, 0x36D4, 5, 0, false, false, 0, 0); break; case BreathAttackType.Ice: Effects.PlaySound(creature.Location, creature.Map, 0x64F); Effects.SendMovingEffect(creature, target, 0x36D4, 5, 0, false, false, 1153, 0); break; case BreathAttackType.Poison: Effects.PlaySound(creature.Location, creature.Map, 0x22F); Effects.SendMovingEffect(creature, target, 0x372A, 10, 0, false, false, 2208, 0); break; } Timer.DelayCall(TimeSpan.FromSeconds(1.0), delegate { if (creature == null) { return; } if (creature.CanBeHarmful(target)) { double baseDamage = (double)creature.DamageMax; if (creature.Controlled && creature.ControlMaster is PlayerMobile) { if (target is PlayerMobile) { baseDamage *= BaseCreature.BreathDamageToPlayerScalar * creature.PvPAbilityDamageScalar; } if (target is BaseCreature) { baseDamage *= BaseCreature.BreathDamageToCreatureScalar; } } DungeonArmor.PlayerDungeonArmorProfile defenderDungeonArmor = new DungeonArmor.PlayerDungeonArmorProfile(target, null); if (defenderDungeonArmor.MatchingSet && !defenderDungeonArmor.InPlayerCombat) { baseDamage *= defenderDungeonArmor.DungeonArmorDetail.BreathDamageReceivedScalar; } switch (breathType) { case BreathAttackType.Fire: Effects.PlaySound(target.Location, target.Map, 0x208); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, TimeSpan.FromSeconds(0.5)), 0x3996, 10, 20, 5029); break; case BreathAttackType.Ice: baseDamage = (double)creature.DamageMax * .75; if (target is PlayerMobile) { SpecialAbilities.CrippleSpecialAbility(1.0, creature, target, .05, 10, -1, true, "", "The blast of ice has slowed your actions!", "-1"); } else { SpecialAbilities.CrippleSpecialAbility(1.0, creature, target, .10, 10, -1, true, "", "The blast of ice has slowed your actions!", "-1"); } Effects.PlaySound(target.Location, target.Map, 0x208); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, TimeSpan.FromSeconds(0.25)), 0x3779, 10, 20, 1153, 0, 5029, 0); break; case BreathAttackType.Poison: baseDamage = (double)creature.DamageMax * .5; int poisonLevel = 0; if (creature.HitPoison != null) { poisonLevel = creature.HitPoison.Level; } double poisonChance = 1.0; if (creature.IsControlledCreature()) { if (target is PlayerMobile) { poisonChance = .5; poisonLevel--; } if (target is BaseCreature) { BaseCreature bc_Target = target as BaseCreature; if (bc_Target.IsControlledCreature()) { poisonChance = .5; poisonLevel--; } } } if (poisonLevel < 0) { poisonLevel = 0; } int poisonHue = 2208; poisonHue += poisonLevel; if (Utility.RandomDouble() <= poisonChance) { Poison poison = Poison.GetPoison(poisonLevel); target.ApplyPoison(target, poison); } Effects.PlaySound(target.Location, target.Map, 0x22F); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, TimeSpan.FromSeconds(0.25)), 0x372A, 10, 20, poisonHue, 0, 5029, 0); break; } int finalDamage = (int)baseDamage; if (target != null) { AOS.Damage(target, creature, finalDamage, 100, 0, 0, 0, 0); } } }); }); }
public void HeartyWingBuffet() { double spawnPercent = (double)intervalCount / (double)totalIntervals; int wings = 50 + (int)(Math.Ceiling(150 * spawnPercent)); int loops = (int)(Math.Ceiling((double)wings / 10)); double totalDelay = loops + 2.5; SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); m_NextHeartyWingBuffetAllowed = DateTime.UtcNow + NextHeartyWingBuffetDelay; m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay); AbilityInProgress = true; Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } AbilityInProgress = false; }); Effects.PlaySound(Location, Map, 0x4d7); PublicOverheadMessage(MessageType.Regular, 0, false, "*prepares hearty wing buffet*"); Point3D location = Location; Map map = Map; PlaySound(GetAngerSound()); Animate(16, 8, 1, true, false, 0); int radius = 10; Timer.DelayCall(TimeSpan.FromSeconds(1.0), delegate { if (!SpecialAbilities.Exists(this)) { return; } for (int a = 0; a < loops; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * 1), delegate { if (!SpecialAbilities.Exists(this)) { return; } Animate(16, 8, 1, true, false, 0); PlaySound(GetAngerSound()); Effects.PlaySound(location, map, 0x5CF); }); } for (int a = 0; a < wings; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * .1), delegate { if (!SpecialAbilities.Exists(this)) { return; } Point3D wingLocation = new Point3D(location.X + Utility.RandomMinMax(radius * -1, radius), location.Y + Utility.RandomMinMax(radius * -1, radius), location.Z); IEntity startLocation = new Entity(Serial.Zero, new Point3D(wingLocation.X - 1, wingLocation.Y - 1, wingLocation.Z + 100), map); IEntity endLocation = new Entity(Serial.Zero, new Point3D(wingLocation.X, wingLocation.Y, wingLocation.Z + 5), map); int particleSpeed = 8 + (int)(Math.Round(8 * (double)spawnPercent)); int itemId = Utility.RandomList(5641, 2489, 5639); Effects.SendMovingParticles(startLocation, endLocation, itemId, particleSpeed, 0, false, false, 0, 0, 9501, 0, 0, 0x100); double impactDelay = .75 - (.375 * spawnPercent); Timer.DelayCall(TimeSpan.FromSeconds(impactDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } Effects.PlaySound(endLocation, map, Utility.RandomList(0x357, 0x359)); Effects.SendLocationParticles(endLocation, 0x3709, 10, 20, 0, 0, 5029, 0); Item item = null; switch (itemId) { //case 5641: item = new LambLeg(); item.Name = "chicken drumstick"; break; //case 2489: item = new CookedBird(); break; //case 5639: item = new ChickenLeg(); break; } Point3D foodLocation = new Point3D(wingLocation.X, wingLocation.Y, wingLocation.Z); item.MoveToWorld(foodLocation, map); double firefieldChance = .15 + (.15 * spawnPercent); if (Utility.RandomDouble() <= firefieldChance) { Timer.DelayCall(TimeSpan.FromSeconds(.25), delegate { SingleFireField singleFireField = new SingleFireField(null, 0, 1, 30, 3, 5, false, false, true, -1, true); singleFireField.MoveToWorld(foodLocation, map); }); } IPooledEnumerable mobilesOnTile = map.GetMobilesInRange(wingLocation, 1); Queue m_Queue = new Queue(); foreach (Mobile mobile in mobilesOnTile) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } m_Queue.Enqueue(mobile); } mobilesOnTile.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); double damage = DamageMax; if (mobile is BaseCreature) { damage *= 2; } new Blood().MoveToWorld(mobile.Location, mobile.Map); AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0); } }); }); } }); }
public void SpawnCreatures() { if (!SpecialAbilities.Exists(this)) { return; } double spawnPercent = (double)intervalCount / (double)totalIntervals; int maxExtraCreatures = 8; int creatures = 2 + (int)Math.Ceiling((double)maxExtraCreatures * spawnPercent); PublicOverheadMessage(MessageType.Regular, 0, false, "*creatures burst from maggot*"); double stationaryDelay = 3; m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(.5); SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, stationaryDelay, true, 0, false, "", "", "-1"); Timer.DelayCall(TimeSpan.FromSeconds(stationaryDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } AbilityInProgress = false; DamageIntervalInProgress = false; m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay; }); for (int a = 0; a < creatures; a++) { List <Point3D> m_Locations = SpecialAbilities.GetSpawnableTiles(Location, false, true, Location, Map, 1, 10, 1, 3, true); Point3D newLocation = new Point3D(); if (m_Locations.Count > 0) { newLocation = m_Locations[0]; } else { newLocation = Location; } //TEST //ADD PLAGUE BEAST if (Utility.RandomDouble() >= .2) { Entrail entrail = new Entrail(); entrail.MoveToWorld(newLocation, Map); m_Creatures.Add(entrail); new Blood().MoveToWorld(entrail.Location, Map); } else { DiseasedViscera diseasedViscera = new DiseasedViscera(); diseasedViscera.MoveToWorld(newLocation, Map); m_Creatures.Add(diseasedViscera); new Blood().MoveToWorld(diseasedViscera.Location, Map); } } }
public static void Trick(BaseCreature creature, PlayerMobile player) { if (creature == null || player == null) { return; } int trickTextHue = 0x22; creature.PublicOverheadMessage(MessageType.Regular, trickTextHue, false, "Trick it is then!"); creature.PlaySound(0x246); double damageAmount = 0; int duration = 0; switch (Utility.RandomMinMax(1, 15)) { case 1: SpecialAbilities.BacklashSpecialAbility(1.0, null, player, .75, 60, -1, true, "", ""); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Ack! A curse! Causing your spellcasting proficiency to suffer!", player.NetState); } break; case 2: double bleedAmount = (double)player.HitsMax * .66; for (int a = 0; a < 5; a++) { Point3D newLocation = new Point3D(player.Location.X + Utility.RandomList(-1, 1), player.Location.Y + Utility.RandomList(-1, 1), player.Location.Z); new Blood().MoveToWorld(newLocation, player.Map); } SpecialAbilities.BleedSpecialAbility(1.0, null, player, bleedAmount, 8, -1, true, "", "", "-1"); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Curses! A dagger hidden in an apple!", player.NetState); } break; case 3: Point3D creatureLocation = creature.Location; Point3D playerLocation = player.Location; int projectiles = 15; int particleSpeed = 8; for (int a = 0; a < projectiles; a++) { Point3D newLocation = new Point3D(player.X + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Y + Utility.RandomList(-5, -4, -3, -2, -1, 1, 2, 3, 4, 5), player.Z); SpellHelper.AdjustField(ref newLocation, player.Map, 12, false); IEntity effectStartLocation = new Entity(Serial.Zero, new Point3D(newLocation.X, newLocation.Y, newLocation.Z + 10), player.Map); IEntity effectEndLocation = new Entity(Serial.Zero, new Point3D(player.X, player.Y, player.Z + 10), player.Map); Effects.SendMovingParticles(effectStartLocation, effectEndLocation, 0x3818, particleSpeed, 0, false, false, 2603, 0, 9501, 0, 0, 0x100); } player.FixedParticles(0x3967, 10, 40, 5036, 2603, 0, EffectLayer.CenterFeet); int damage = (int)(Math.Round((double)player.HitsMax * .33)); duration = 5; SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, duration, false, -1, false, "", "", "-1"); new Blood().MoveToWorld(player.Location, player.Map); AOS.Damage(player, damage, 0, 100, 0, 0, 0); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Electric candy! What an age we live in!", player.NetState); } break; case 4: SpecialAbilities.DiseaseSpecialAbility(1.0, null, player, 3, 60, -1, true, "", ""); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Blast! Expired candy!", player.NetState); } break; case 5: TimedStatic glue = new TimedStatic(4650, 30); glue.Name = "glue"; glue.Hue = 2067; glue.MoveToWorld(player.Location, player.Map); SpecialAbilities.EntangleSpecialAbility(1.0, null, player, 1.0, 30, -1, true, "", "", "-1"); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Your feet have been glued to the floor!", player.NetState); } break; case 6: damageAmount = (double)player.HitsMax * .5; SpecialAbilities.FlamestrikeSpecialAbility(1.0, null, player, damageAmount, 1, -1, true, "", "Spicy candy! So hot!"); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Spicy candy! So hot!", player.NetState); } break; case 7: damageAmount = (double)player.HitsMax * .5; Direction direction = Utility.GetDirection(creature.Location, player.Location); int windItemId = 8099; switch (direction) { case Direction.North: windItemId = 8099; break; case Direction.Right: windItemId = 8099; break; case Direction.West: windItemId = 8104; break; case Direction.Up: windItemId = 8104; break; case Direction.East: windItemId = 8109; break; case Direction.Down: windItemId = 8109; break; case Direction.South: windItemId = 8114; break; case Direction.Left: windItemId = 8114; break; } creature.MovingEffect(player, windItemId, 5, 1, false, false, 0, 0); player.PlaySound(0x64C); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "This candy totally blows...", player.NetState); } SpecialAbilities.KnockbackSpecialAbility(1.0, creature.Location, null, player, damageAmount, 20, -1, "", ""); break; case 8: SpecialAbilities.PetrifySpecialAbility(1.0, null, player, 1.0, 15, -1, true, "", "", "-1"); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Rock candy!", player.NetState); } break; case 9: if (player.Poison == null) { Poison poison = Poison.GetPoison(2); player.ApplyPoison(null, poison); } player.FixedEffect(0x372A, 10, 30, 2208, 0); Effects.PlaySound(player.Location, player.Map, 0x22F); int residueCount = Utility.RandomMinMax(3, 4); for (int a = 0; a < residueCount; a++) { Point3D poisonPoint = new Point3D(player.Location.X + Utility.RandomList(-1, 1), player.Location.Y + Utility.RandomList(-1, 1), player.Location.Z); SpellHelper.AdjustField(ref poisonPoint, player.Map, 12, false); TimedStatic poisonResidue = new TimedStatic(Utility.RandomList(0x1645, 0x122A, 0x122B, 0x122C, 0x122D, 0x122E, 0x122F), 5); poisonResidue.Hue = 2208; poisonResidue.Name = "poison residue"; poisonResidue.MoveToWorld(poisonPoint, player.Map); } if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Poisoned candy! Who would do such a thing!", player.NetState); } break; case 10: bool canPolymorph = true; if (!player.CanBeginAction(typeof(PolymorphSpell))) { canPolymorph = false; } if (!player.CanBeginAction(typeof(PolymorphPotion))) { canPolymorph = false; } if (!player.CanBeginAction(typeof(IncognitoSpell)) || player.IsBodyMod) { canPolymorph = false; } if (DisguiseTimers.IsDisguised(player)) { canPolymorph = false; } if (KinPaint.IsWearingKinPaint(player)) { canPolymorph = false; } if (!canPolymorph) { player.SendMessage("Hmm...Nothing seems to have happened. Or did it?"); return; } player.FixedParticles(0x373A, 10, 15, 5036, EffectLayer.Head); List <int> m_PossibleBodyValues = new List <int>(); m_PossibleBodyValues.Add(3); //Zombie m_PossibleBodyValues.Add(50); //Skeleton m_PossibleBodyValues.Add(56); //Skeleton m_PossibleBodyValues.Add(153); //Ghoul m_PossibleBodyValues.Add(302); //Skeletal Critter m_PossibleBodyValues.Add(309); //Patchwork Skeleton m_PossibleBodyValues.Add(148); //Necromancer m_PossibleBodyValues.Add(793); //Skeletal Horse m_PossibleBodyValues.Add(317); //Giant Bat m_PossibleBodyValues.Add(252); //Corpse Bride m_PossibleBodyValues.Add(57); //Skeletal Knight m_PossibleBodyValues.Add(116); //Nightmare m_PossibleBodyValues.Add(24); //Lich m_PossibleBodyValues.Add(154); //Mummy m_PossibleBodyValues.Add(104); //Skeletal Drake m_PossibleBodyValues.Add(740); //Skeletal Drake m_PossibleBodyValues.Add(308); //Giant Skeleton player.BodyMod = m_PossibleBodyValues[Utility.RandomMinMax(0, m_PossibleBodyValues.Count - 1)]; player.HueMod = 0; player.PlaySound(0x3BD); BaseArmor.ValidateMobile(player); duration = 120; player.BeginAction(typeof(PolymorphPotion)); Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate { if (player == null) { return; } player.EndAction(typeof(PolymorphPotion)); }); player.BeginAction(typeof(PolymorphSpell)); Timer.DelayCall(TimeSpan.FromSeconds(duration), delegate { if (player == null) { return; } player.BodyMod = 0; player.HueMod = -1; player.EndAction(typeof(PolymorphSpell)); BaseArmor.ValidateMobile(player); }); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Hmm, something tastes odd about this candy.", player.NetState); } break; case 11: Item innerLegs = player.FindItemOnLayer(Layer.InnerLegs); Item outerLegs = player.FindItemOnLayer(Layer.OuterLegs); Item pants = player.FindItemOnLayer(Layer.Pants); int layersFound = 0; if (innerLegs != null) { player.Backpack.DropItem(innerLegs); layersFound++; } if (outerLegs != null) { player.Backpack.DropItem(outerLegs); layersFound++; } if (pants != null) { player.Backpack.DropItem(pants); layersFound++; } if (layersFound > 0) { player.PlaySound(0x503); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "Your pants appear to have fallen down. How embarrassing!", player.NetState); } } else { player.SendMessage("Nothing seems to have happened. Or did it?..."); } break; case 12: player.FixedParticles(0x374A, 10, 15, 5028, 2604, 0, EffectLayer.Waist); player.PlaySound(0x5DA); player.Animate(22, 6, 1, true, false, 0); //Fall Forward player.Stam = 0; if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "You feel drowsy and fall on your face!", player.NetState); } break; case 13: player.BAC = 60; player.PlaySound(0x5A9); BaseBeverage.CheckHeaveTimer(player); player.Animate(34, 5, 1, true, false, 0); if (player.NetState != null) { player.PrivateOverheadMessage(MessageType.Regular, 0, false, "What was in that candy??? *hic*", player.NetState); } break; case 14: Warp(creature, player); break; case 15: Warp(creature, player); break; } }
public void CheckChargeResolved() { if (!m_ChargeInProgress) { return; } bool chargeExpired = false; bool clearCharge = false; if (Combatant == null) { chargeExpired = true; } else if (!Combatant.Alive || Combatant.Hidden || Utility.GetDistance(Location, Combatant.Location) > 24 || DateTime.UtcNow > m_ChargeTimeout) { chargeExpired = true; } if (chargeExpired) { clearCharge = true; } else if (SpecialAbilities.Exists(Combatant)) { if (Utility.GetDistance(Location, Combatant.Location) <= 1) { PublicOverheadMessage(MessageType.Regular, 0, false, "*tramples opponent*"); Effects.PlaySound(Location, Map, 0x59C); Effects.PlaySound(Combatant.Location, Combatant.Map, Combatant.GetHurtSound()); double damage = DamageMax; if (Combatant is BaseCreature) { damage *= 1.5; } new Blood().MoveToWorld(Combatant.Location, Combatant.Map); AOS.Damage(Combatant, (int)damage, 100, 0, 0, 0, 0); if (Combatant is PlayerMobile) { Combatant.Animate(21, 6, 1, true, false, 0); } else if (Combatant is BaseCreature) { BaseCreature bc_Combatant = Combatant as BaseCreature; if (bc_Combatant.IsHighSeasBodyType) { bc_Combatant.Animate(2, 14, 1, true, false, 0); } else if (bc_Combatant.Body != null) { if (bc_Combatant.Body.IsHuman) { bc_Combatant.Animate(21, 6, 1, true, false, 0); } else { bc_Combatant.Animate(2, 4, 1, true, false, 0); } } } SpecialAbilities.HinderSpecialAbility(1.0, this, Combatant, 1.0, 1, false, -1, false, "", "You have been trampled and can't move!", "-1"); clearCharge = true; } } if (clearCharge) { ClearCharge(); } }
public override void OnThink() { base.OnThink(); 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 && !IsHindered() && !Frozen && 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 = 50; double crippleAmount = .20; TimeSpan attackCooldown = NextPvMVoidAttackDelay; double effectChance = .15; double damageScalar = 1.0; if (Controlled && ControlMaster != null) { if (ControlMaster is PlayerMobile) { if (combatant is PlayerMobile) { effectChance = .01; } else { effectChance = .33; } } } 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 (this == null) { return; } if (Deleted || !Alive || IsDeadFollower || IsDeadBondedFollower) { 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 = SpecialAbilities.GetRandomAdjustedLocation(combatant.Location, combatant.Map, true, 1, 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, 10, 0, false, "", "", "-1"); SpecialAbilities.CrippleSpecialAbility(1.0, this, combatant, crippleAmount, 10, 0, false, "", "", "-1"); } weapon.OnHit(this, combatant, damageScalar); }); } } } } }
public override void OnThink() { base.OnThink(); if (Hidden) { m_NextDaggerAllowed = DateTime.UtcNow + TimeSpan.FromSeconds(Utility.RandomMinMax(8, 12)); } if (Alive && Controlled && ControlMaster is PlayerMobile && ControlOrder != OrderType.Stop) { if (Hidden || Combatant != null) { m_NextStealthCheckAllowed = DateTime.UtcNow + StealthDelay; } else if (DateTime.UtcNow > m_NextStealthCheckAllowed) { bool stealthValid = true; if (Combatant != null) { stealthValid = false; } if (stealthValid) { IPooledEnumerable eable = Map.GetMobilesInRange(Location, RangePerception); foreach (Mobile mobile in eable) { if (mobile.InLOS(this) && mobile.CanSee(this)) { if (mobile.Combatant == this) { stealthValid = false; break; } bool aggressive = false; foreach (AggressorInfo aggressorInfo in mobile.Aggressors) { if (aggressorInfo.Attacker == this || aggressorInfo.Defender == this) { aggressive = true; break; } } if (aggressive) { stealthValid = false; break; } } } eable.Free(); } if (stealthValid) { AIMiscAction.DoStealth(this); m_NextStealthCheckAllowed = DateTime.UtcNow + StealthDelay; } } } if (DateTime.UtcNow > m_NextDaggerAllowed && !CantWalk && !Frozen && !IsHindered() && !Hidden && Alive) { Mobile combatant = Combatant; if (combatant != null) { if (combatant.Alive && CanBeHarmful(combatant) && InLOS(combatant) && GetDistanceToSqrt(combatant) <= 8) { SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, 1.5, true, Utility.RandomList(0x5D2, 0x5D3), false, "", "", "-1"); m_NextDaggerAllowed = DateTime.UtcNow + NextDaggerDelay; Animate(31, 7, 1, true, false, 0); Timer.DelayCall(TimeSpan.FromSeconds(.475), delegate { if (this == null) { return; } if (!Alive || Deleted) { return; } if (Combatant == null) { return; } if (!Combatant.Alive || Combatant.Deleted) { return; } MovingEffect(combatant, 3921, 18, 1, false, false); double distance = this.GetDistanceToSqrt(combatant.Location); double destinationDelay = (double)distance * .08; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (this == null) { return; } if (!Alive || Deleted) { return; } if (Combatant == null) { return; } if (!Combatant.Alive || Combatant.Deleted) { return; } if (!CanBeHarmful(Combatant)) { return; } Effects.PlaySound(Location, Map, 0x145); double baseDamage = (double)DamageMax; if (Combatant is PlayerMobile) { baseDamage *= BaseCreature.BreathDamageToPlayerScalar * PvPAbilityDamageScalar; } if (Combatant is BaseCreature) { baseDamage *= BaseCreature.BreathDamageToCreatureScalar; } int finalDamage = (int)baseDamage; if (finalDamage < 1) { finalDamage = 1; } DoHarmful(combatant); int finalAdjustedDamage = AOS.Damage(combatant, this, finalDamage, 100, 0, 0, 0, 0); new Blood().MoveToWorld(combatant.Location, combatant.Map); }); }); } } } }
public override void OnThink() { base.OnThink(); if (DateTime.UtcNow > m_NextDaggerAllowed && !CantWalk && !Frozen && !IsHindered() && !Hidden && Alive && Utility.RandomDouble() < .1) { Mobile combatant = Combatant; if (combatant != null) { if (combatant.Alive && CanBeHarmful(combatant) && InLOS(combatant) && GetDistanceToSqrt(combatant) <= 8) { SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1, 1.5, true, Utility.RandomList(0x5D2, 0x5D3), false, "", "", "-1"); m_NextDaggerAllowed = DateTime.UtcNow + NextDaggerDelay; Animate(31, 7, 1, true, false, 0); Timer.DelayCall(TimeSpan.FromSeconds(.475), delegate { if (this == null) { return; } if (!Alive || Deleted) { return; } if (Combatant == null) { return; } if (!Combatant.Alive || Combatant.Deleted) { return; } MovingEffect(combatant, 3921, 18, 1, false, false); double distance = this.GetDistanceToSqrt(combatant.Location); double destinationDelay = (double)distance * .08; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (this == null) { return; } if (!Alive || Deleted) { return; } if (Combatant == null) { return; } if (!Combatant.Alive || Combatant.Deleted) { return; } if (!CanBeHarmful(Combatant)) { return; } Effects.PlaySound(Location, Map, 0x145); double baseDamage = (double)DamageMax; if (Combatant is PlayerMobile) { baseDamage *= BaseCreature.BreathDamageToPlayerScalar * PvPAbilityDamageScalar; } if (Combatant is BaseCreature) { baseDamage *= BaseCreature.BreathDamageToCreatureScalar; } int finalDamage = (int)baseDamage; if (finalDamage < 1) { finalDamage = 1; } DoHarmful(combatant); int finalAdjustedDamage = AOS.Damage(combatant, this, finalDamage, 100, 0, 0, 0, 0); new Blood().MoveToWorld(combatant.Location, combatant.Map); }); }); } } } }
public void Knockback() { if (!SpecialAbilities.Exists(Combatant)) { return; } if (!SpecialAbilities.MonsterCanDamage(this, Combatant)) { return; } Point3D targetLocation = Combatant.Location; Map map = Combatant.Map; double spawnPercent = (double)intervalCount / (double)totalIntervals; double initialDelay = 1; double totalDelay = 1 + initialDelay; Animate(14, 12, 1, true, false, 0); PlaySound(GetAngerSound()); PublicOverheadMessage(MessageType.Regular, 0, false, "*lashes out violently*"); SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); m_NextKnockbackAllowed = DateTime.UtcNow + NextKnockbackDelay + TimeSpan.FromSeconds(totalDelay); m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay); AbilityInProgress = true; Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (SpecialAbilities.Exists(this)) { AbilityInProgress = false; Combatant = null; } }); Timer.DelayCall(TimeSpan.FromSeconds(initialDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } double damage = (double)(Utility.RandomMinMax(DamageMin, DamageMax)) * 2; Queue m_Queue = new Queue(); IPooledEnumerable nearbyMobiles = Map.GetMobilesInRange(targetLocation, 1); foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } m_Queue.Enqueue(mobile); } nearbyMobiles.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); if (mobile is BaseCreature) { damage *= 2; } SpecialAbilities.KnockbackSpecialAbility(1.0, Location, this, mobile, damage, 15, -1, "", "The beast flings you aside!"); } }); }
public void IntervalEffect() { if (this == null) { return; } if (Deleted || !Alive) { return; } AbilityInProgress = true; double spawnPercent = (double)intervalCount / (double)totalIntervals; int pitTentacles = 2 + (int)(Math.Ceiling(8 * spawnPercent)); Effects.PlaySound(Location, Map, 0x653); 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"); for (int a = 0; a < 2; a++) { Timer.DelayCall(TimeSpan.FromSeconds(a * 1), delegate { if (this == null) { return; } if (Deleted || !Alive) { return; } CantWalk = true; Frozen = true; PlaySound(GetAngerSound()); Animate(12, 12, 1, true, false, 0); }); } Timer.DelayCall(TimeSpan.FromSeconds(2), delegate { if (this == null) { return; } if (Deleted || !Alive) { return; } CantWalk = false; Frozen = false; AbilityInProgress = false; }); for (int a = 0; a < pitTentacles; a++) { Point3D location = Location; Point3D pitLocation = Location; Map map = Map; List <Point3D> m_ValidLocations = SpecialAbilities.GetSpawnableTiles(Location, true, false, Location, Map, 1, 15, 1, 8, true); if (m_ValidLocations.Count > 0) { pitLocation = m_ValidLocations[Utility.RandomMinMax(0, m_ValidLocations.Count - 1)]; } for (int b = 1; b < 9; b++) { Timer.DelayCall(TimeSpan.FromSeconds(b * .25), delegate { if (this == null) { return; } if (Deleted || !Alive) { return; } Effects.PlaySound(pitLocation, map, 0x4CF); TimedStatic floorCrack = new TimedStatic(Utility.RandomList(6913, 6914, 6915, 6916, 6917, 6918, 6919, 6920), 5); floorCrack.Name = "floor crack"; Point3D floorCrackLocation = new Point3D(pitLocation.X + Utility.RandomList(-1, 1), pitLocation.Y + Utility.RandomList(-1, 1), pitLocation.Z); SpellHelper.AdjustField(ref floorCrackLocation, map, 12, false); floorCrack.MoveToWorld(floorCrackLocation, map); }); } Timer.DelayCall(TimeSpan.FromSeconds(1.5), delegate { if (this == null) { return; } if (Deleted || !Alive) { return; } TimedStatic floorHole = new TimedStatic(7025, 5); floorHole.Name = "pit to below"; floorHole.MoveToWorld(pitLocation, map); }); Timer.DelayCall(TimeSpan.FromSeconds(2), delegate { if (this == null) { return; } if (Deleted || !Alive) { return; } IEntity pitLocationEntity = new Entity(Serial.Zero, new Point3D(pitLocation.X, pitLocation.Y, pitLocation.Z), map); Effects.SendLocationParticles(pitLocationEntity, 0x3709, 10, 30, 2053, 0, 5052, 0); for (int b = 0; b < 4; b++) { TimedStatic pitPlasm = new TimedStatic(Utility.RandomList(4650, 4651, 4653, 4654, 4655), 5); pitPlasm.Name = "pit plasm"; pitPlasm.Hue = 2052; Point3D pitPlasmLocation = new Point3D(pitLocation.X + Utility.RandomList(-1, 1), pitLocation.Y + Utility.RandomList(-1, 1), pitLocation.Z); SpellHelper.AdjustField(ref pitPlasmLocation, map, 12, false); pitPlasm.MoveToWorld(pitPlasmLocation, map); } BaseCreature m_PitCreature = null; double creatureResult = Utility.RandomDouble(); if (creatureResult <= .10) { m_PitCreature = new FountainOfEvil(); m_PitCreature.Name = "enveloping darkness"; m_PitCreature.CorpseNameOverride = "enveloping darkness corpse"; m_PitCreature.Hue = 2250; m_PitCreature.BodyValue = 780; } else if (creatureResult <= .25) { m_PitCreature = new HookHorror(); m_PitCreature.Name = "a clawfiend"; m_PitCreature.CorpseNameOverride = "a clawfiend's corpse"; m_PitCreature.Hue = 1107; m_PitCreature.BodyValue = 303; } else if (creatureResult <= .50) { m_PitCreature = new SvirfneblinRogue(); m_PitCreature.Name = "an underling"; m_PitCreature.CorpseNameOverride = "an underling's corpse"; m_PitCreature.Hue = 2076; m_PitCreature.BodyValue = 776; } else { m_PitCreature = new PitTentacle(); } if (m_PitCreature != null) { m_PitCreature.BossMinion = true; m_PitCreature.MoveToWorld(pitLocation, map); m_Creatures.Add(m_PitCreature); } }); } }
public void FlameMark() { if (!SpecialAbilities.Exists(this)) { return; } IPooledEnumerable nearbyMobiles = Map.GetMobilesInRange(Location, FireBarrageRange); int mobileCount = 0; foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } if (!Map.InLOS(Location, mobile.Location)) { continue; } if (mobile.Hidden) { continue; } mobileCount++; } nearbyMobiles.Free(); nearbyMobiles = Map.GetMobilesInRange(Location, FireBarrageRange); List <Mobile> m_NearbyMobiles = new List <Mobile>(); foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } if (!Map.InLOS(Location, mobile.Location)) { continue; } if (mobile.Hidden) { continue; } if (Combatant != null) { if (mobileCount > 1 && mobile == Combatant) { continue; } } m_NearbyMobiles.Add(mobile); } nearbyMobiles.Free(); if (m_NearbyMobiles.Count == 0) { return; } Mobile mobileTarget = m_NearbyMobiles[Utility.RandomMinMax(0, m_NearbyMobiles.Count - 1)]; Point3D targetLocation = mobileTarget.Location; Map targetMap = mobileTarget.Map; double spawnPercent = (double)intervalCount / (double)totalIntervals; double directionDelay = .25; double initialDelay = 2; double totalDelay = 1 + directionDelay + initialDelay; int maxRadius = 4; int radius = 2 + (int)(Math.Ceiling((double)maxRadius * spawnPercent)); m_NextFlameMarkAllowed = DateTime.UtcNow + NextFlameMarkDelay + TimeSpan.FromSeconds(totalDelay); m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(totalDelay); AbilityInProgress = true; Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (SpecialAbilities.Exists(this)) { AbilityInProgress = false; } }); SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); Direction = Utility.GetDirection(Location, targetLocation); Timer.DelayCall(TimeSpan.FromSeconds(directionDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } if (DamageIntervalInProgress) { return; } Animate(29, 22, 1, true, false, 0); PlaySound(GetAngerSound()); PublicOverheadMessage(MessageType.Regular, 0, false, "*points a mighty claw*"); TimedStatic flamemark = new TimedStatic(6571, initialDelay); flamemark.Hue = 2591; flamemark.Name = "flamemark"; flamemark.MoveToWorld(targetLocation, targetMap); Timer.DelayCall(TimeSpan.FromSeconds(initialDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } int damage = DamageMin; int minRange = radius * -1; int maxRange = radius; int effectHue = 2602; Effects.PlaySound(targetLocation, targetMap, 0x306); for (int a = minRange; a < maxRange + 1; a++) { for (int b = minRange; b < maxRange + 1; b++) { Point3D newPoint = new Point3D(targetLocation.X + a, targetLocation.Y + b, targetLocation.Z); SpellHelper.AdjustField(ref newPoint, targetMap, 12, false); int distance = Utility.GetDistance(targetLocation, newPoint); double effectChance = 1.0 - ((double)distance * .05); if (Utility.RandomDouble() > effectChance) { continue; } Timer.DelayCall(TimeSpan.FromSeconds(distance * .10), delegate { if (Utility.RandomDouble() <= .1) { SingleFireField singleFireField = new SingleFireField(this, 0, 2, 30, 3, 5, false, false, true, -1, true); singleFireField.Hue = 2603; singleFireField.MoveToWorld(newPoint, targetMap); } Effects.PlaySound(newPoint, targetMap, Utility.RandomList(0x4F1, 0x5D8, 0x5DA, 0x580)); Effects.SendLocationParticles(EffectItem.Create(newPoint, targetMap, TimeSpan.FromSeconds(0.25)), 0x3709, 10, 30, effectHue, 0, 5029, 0); IPooledEnumerable mobilesOnTile = targetMap.GetMobilesInRange(newPoint, 0); Queue m_Queue = new Queue(); foreach (Mobile mobile in mobilesOnTile) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } m_Queue.Enqueue(mobile); } mobilesOnTile.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); if (mobile is BaseCreature) { damage *= 3; } new Blood().MoveToWorld(mobile.Location, mobile.Map); AOS.Damage(mobile, this, damage, 100, 0, 0, 0, 0); } }); } } }); }); }
public void Charge() { if (!SpecialAbilities.Exists(this)) { return; } m_NextChargeAllowed = DateTime.UtcNow + NextChargeDelay; int range = 18; Dictionary <Mobile, int> DictPossibleNewCombatants = new Dictionary <Mobile, int>(); IPooledEnumerable m_NearbyMobiles = Map.GetMobilesInRange(Location, range); foreach (Mobile mobile in m_NearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } if (!mobile.InLOS(this)) { continue; } if (mobile.Hidden) { continue; } int distance = Utility.GetDistance(mobile.Location, Location); if (mobile == Combatant && distance <= 4) { continue; } DictPossibleNewCombatants.Add(mobile, distance); } m_NearbyMobiles.Free(); if (DictPossibleNewCombatants.Count == 0) { return; } int TotalValues = 0; foreach (KeyValuePair <Mobile, int> pair in DictPossibleNewCombatants) { TotalValues += pair.Value; } double ItemCheck = Utility.RandomDouble(); double CumulativeAmount = 0.0; double AdditionalAmount = 0.0; bool foundNewCombatant = false; //Determine Combatant foreach (KeyValuePair <Mobile, int> pair in DictPossibleNewCombatants) { AdditionalAmount = (double)pair.Value / (double)TotalValues; if (ItemCheck >= CumulativeAmount && ItemCheck < (CumulativeAmount + AdditionalAmount)) { Combatant = pair.Key; foundNewCombatant = true; break; } CumulativeAmount += AdditionalAmount; } if (Combatant != null && foundNewCombatant) { double directionDelay = .25; double initialDelay = .5; double totalDelay = directionDelay + initialDelay; SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); Point3D location = Location; Map map = Map; Point3D targetLocation = Combatant.Location; Map targetMap = Combatant.Map; Direction = Utility.GetDirection(Location, targetLocation); Timer.DelayCall(TimeSpan.FromSeconds(directionDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } PublicOverheadMessage(MessageType.Regular, 0, false, "*charges*"); Animate(5, 5, 1, true, false, 0); PlaySound(GetAngerSound()); Timer.DelayCall(TimeSpan.FromSeconds(initialDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } bool validCombatant = true; if (Combatant == null) { validCombatant = false; } else { if (!SpecialAbilities.MonsterCanDamage(this, Combatant)) { validCombatant = false; } if (Combatant.Hidden) { validCombatant = false; } if (!Map.InLOS(Location, Combatant.Location)) { validCombatant = false; } if (Utility.GetDistance(Location, Combatant.Location) > range + 10) { validCombatant = false; } } if (validCombatant) { targetLocation = Combatant.Location; } Point3D effectStep = Location; int distance = Utility.GetDistance(effectStep, targetLocation); double stepDelay = .04; Queue m_Queue; IPooledEnumerable nearbyMobiles; for (int a = 0; a < distance; a++) { if (!SpecialAbilities.Exists(this)) { return; } Direction direction = Utility.GetDirection(effectStep, targetLocation); effectStep = SpecialAbilities.GetPointByDirection(effectStep, direction); Point3D effectLocation = effectStep; int index = a; Timer.DelayCall(TimeSpan.FromSeconds(index * stepDelay), delegate { Effects.SendLocationParticles(EffectItem.Create(effectLocation, map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2117, 0, 2023, 0); Effects.PlaySound(effectLocation, map, 0x5C6); Point3D adjustedLocation = effectLocation; adjustedLocation.Z++; new Blood().MoveToWorld(adjustedLocation, map); }); m_Queue = new Queue(); nearbyMobiles = map.GetMobilesInRange(effectStep, 0); foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } m_Queue.Enqueue(mobile); } nearbyMobiles.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); double damage = (double)DamageMin; if (mobile is BaseCreature) { damage *= 2; } int finalDamage = (int)(Math.Ceiling(damage)); DoHarmful(mobile); mobile.PlaySound(mobile.GetHurtSound()); new Blood().MoveToWorld(mobile.Location, mobile.Map); AOS.Damage(mobile, this, finalDamage, 100, 0, 0, 0, 0); } } Location = targetLocation; m_Queue = new Queue(); nearbyMobiles = map.GetMobilesInRange(targetLocation, 0); foreach (Mobile mobile in nearbyMobiles) { if (mobile == this) { continue; } if (!SpecialAbilities.MonsterCanDamage(this, mobile)) { continue; } m_Queue.Enqueue(mobile); } nearbyMobiles.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); double damage = (double)DamageMin; if (mobile is BaseCreature) { damage *= 2; } int finalDamage = (int)(Math.Ceiling(damage)); double knockbackDamage = 25; DoHarmful(mobile); mobile.PlaySound(mobile.GetHurtSound()); SpecialAbilities.KnockbackSpecialAbility(1.0, location, this, mobile, knockbackDamage, 2, -1, "", "You are knocked back by their charge!"); new Blood().MoveToWorld(mobile.Location, mobile.Map); AOS.Damage(mobile, this, finalDamage, 100, 0, 0, 0, 0); } }); }); } }
public void BreathSpin() { double spawnPercent = (double)intervalCount / (double)totalIntervals; int rotations = 1; if (spawnPercent >= .33) { rotations = 2; } if (spawnPercent >= .66) { rotations = 3; } double totalDelay = 1.5 + ((double)rotations * 1.5); Combatant = null; SpecialAbilities.HinderSpecialAbility(1.0, null, this, 1.0, totalDelay, true, 0, false, "", "", "-1"); AbilityInProgress = true; DamageIntervalInProgress = true; m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay + TimeSpan.FromSeconds(.5); Timer.DelayCall(TimeSpan.FromSeconds(totalDelay), delegate { if (!SpecialAbilities.Exists(this)) { return; } AbilityInProgress = false; DamageIntervalInProgress = false; m_NextAbilityAllowed = DateTime.UtcNow + NextAbilityDelay; }); Effects.PlaySound(Location, Map, GetAngerSound()); SpecialAbilities.DoMassiveBreathAttack(this, Location, Direction, 5, true, BreathType.Electricity, false); PublicOverheadMessage(MessageType.Regular, 0, false, "*takes a massive breath*"); for (int a = 0; a < rotations; a++) { Timer.DelayCall(TimeSpan.FromSeconds(1.5 + (a * 1.5)), delegate { if (!SpecialAbilities.Exists(this)) { return; } int newDirectionValue = (int)Direction; newDirectionValue += Utility.RandomList(-3, -4, -5, 3, 4, 5); if (newDirectionValue > 7) { newDirectionValue = 0 + (newDirectionValue - 8); } else if (newDirectionValue < 0) { newDirectionValue = 8 + newDirectionValue; } Direction nextDirection = (Direction)(newDirectionValue); SpecialAbilities.DoMassiveBreathAttack(this, Location, nextDirection, MassiveBreathRange, true, BreathType.Electricity, false); }); } }
protected override void OnTarget(Mobile from, object target) { PlayerMobile player = from as PlayerMobile; if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } if (!player.IsUOACZHuman) { return; } if (m_Torch == null) { return; } if (m_Torch.Deleted) { return; } IPoint3D location = target as IPoint3D; if (location == null) { return; } Map map = player.Map; if (map == null) { return; } SpellHelper.GetSurfaceTop(ref location); Mobile mobileTarget = null; targetLocation = new Entity(Serial.Zero, new Point3D(location), map); if (new Point3D(location) == from.Location) { return; } if (!player.CanBeginAction(typeof(UOACZTorch))) { player.SendMessage("You must wait a few moments before throwing another torch."); return; } if (Utility.GetDistance(player.Location, targetLocation.Location) > ThrowRange) { player.SendMessage("That location is too far away."); return; } player.RevealingAction(); SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, 1, true, 0, false, "", "", "-1"); m_Torch.Delete(); player.Animate(31, 7, 1, true, false, 0); int throwSound = 0x5D3; int hitSound = 0x5CF; int itemID = 2578; int itemHue = 0; Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate { if (!UOACZSystem.IsUOACZValidMobile(player)) { return; } if (!player.IsUOACZHuman) { return; } player.BeginAction(typeof(UOACZTorch)); Timer.DelayCall(TimeSpan.FromSeconds(UOACZTorch.CooldownSeconds), delegate { if (player != null) { player.EndAction(typeof(UOACZTorch)); } }); Effects.PlaySound(player.Location, player.Map, throwSound); IEntity startLocation = new Entity(Serial.Zero, new Point3D(player.Location.X, player.Location.Y, player.Location.Z + 5), player.Map); IEntity endLocation = new Entity(Serial.Zero, new Point3D(targetLocation.Location.X, targetLocation.Location.Y, targetLocation.Location.Z + 5), targetLocation.Map); Effects.SendMovingEffect(startLocation, endLocation, itemID, 15, 0, false, false, itemHue, 0); double distance = player.GetDistanceToSqrt(endLocation.Location); double destinationDelay = (double)distance * .04; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { Effects.PlaySound(endLocation.Location, endLocation.Map, hitSound); Effects.SendLocationParticles(EffectItem.Create(endLocation.Location, endLocation.Map, TimeSpan.FromSeconds(1.0)), 0x3709, 10, 30, 0, 0, 5052, 0); //Mobiles Queue m_Queue = new Queue(); IPooledEnumerable nearbyMobiles = endLocation.Map.GetMobilesInRange(endLocation.Location, 0); int mobilesHit = 0; foreach (Mobile mobile in nearbyMobiles) { if (!UOACZSystem.IsUOACZValidMobile(mobile)) { continue; } m_Queue.Enqueue(mobile); mobilesHit++; } nearbyMobiles.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); BaseCreature bc_Target = mobile as BaseCreature; PlayerMobile pm_Target = mobile as PlayerMobile; int minDamage = 20; int maxDamage = 40; double damageScalar = 2; if (pm_Target != null) { if (pm_Target.IsUOACZHuman) { damageScalar = 0; } if (pm_Target.IsUOACZUndead) { damageScalar = .66; } } int damage = (int)(Math.Round(((double)Utility.RandomMinMax(minDamage, maxDamage)) * damageScalar)); bool humanSource = false; if (player != null) { if (player.IsUOACZHuman) { humanSource = true; } } if (damage > 0) { if (humanSource) { player.DoHarmful(mobile); new Blood().MoveToWorld(mobile.Location, mobile.Map); AOS.Damage(mobile, player, damage, 100, 0, 0, 0, 0); } else { new Blood().MoveToWorld(mobile.Location, mobile.Map); AOS.Damage(mobile, damage, 100, 0, 0, 0, 0); } } } if (mobilesHit > 0) { Effects.PlaySound(endLocation.Location, endLocation.Map, 0x054); Effects.SendLocationParticles(EffectItem.Create(endLocation.Location, endLocation.Map, TimeSpan.FromSeconds(1.0)), 0x3709, 10, 30, 0, 0, 5052, 0); } bool oilLocationHit = false; //Items IPooledEnumerable nearbyItems = endLocation.Map.GetItemsInRange(endLocation.Location, 1); foreach (Item item in nearbyItems) { if (item is UOACZOilLocation) { m_Queue.Enqueue(item); } } nearbyItems.Free(); while (m_Queue.Count > 0) { UOACZOilLocation oilLocation = (UOACZOilLocation)m_Queue.Dequeue(); if (oilLocation == null) { continue; } if (oilLocation.Deleted) { continue; } if (oilLocation.Burning) { continue; } oilLocation.Ignite(player); oilLocationHit = true; } if (!oilLocationHit) { Effects.PlaySound(endLocation.Location, endLocation.Map, 0x3BE); Effects.SendLocationParticles(EffectItem.Create(endLocation.Location, endLocation.Map, TimeSpan.FromSeconds(1.0)), 0x3735, 10, 30, 0, 0, 5052, 0); } }); }); }