public static SendMovingParticles ( IEntity from, IEntity to, int itemID, int speed, int duration, bool fixedDirection, bool explodes, int effect, int explodeEffect, int explodeSound ) : void | ||
from | IEntity | |
to | IEntity | |
itemID | int | |
speed | int | |
duration | int | |
fixedDirection | bool | |
explodes | bool | |
effect | int | |
explodeEffect | int | |
explodeSound | int | |
return | void |
protected override void OnTick() { if (this.m_From == null || this.m_From.Deleted) { this.Stop(); return; } if (this.m_Count == 0) { for (int i = -2; i < 3; i++) { for (int j = -2; j < 5; j++) { if ((i == -2 || i == 2) || (j == -2 || j == 2)) { Effects.SendMovingParticles( new Entity(Serial.Zero, new Point3D(this.m_From.X + i, this.m_From.Y + j, this.m_From.Z + 14), this.m_From.Map), this.m_Target, 0x46E9, 2, 0, false, false, 0, 0, 9502, 1, 0, (EffectLayer)255, 0x100); } else { continue; } } } } else { // It looked like it delt 67 damage, presuming 70% fire res thats about 223 damage delt before resistance. AOS.Damage(this.m_Target, this.m_From, Utility.RandomMinMax(210, 230), 0, 100, 0, 0, 0); this.Stop(); } this.m_Count++; Effects.PlaySound(this.Point, this.m_From.Map, 0x160); }
public static void SendMovingParticles(IEntity from, IEntity to, int itemID, int speed, int duration, bool fixedDirection, bool explodes, int hue, int renderMode, int effect, int explodeEffect, int explodeSound, int unknown) { Effects.SendMovingParticles(from, to, itemID, speed, duration, fixedDirection, explodes, hue, renderMode, effect, explodeEffect, explodeSound, ((EffectLayer)255), unknown); }
public static void SendMovingParticles(IEntity from, IEntity to, int itemID, int speed, int duration, bool fixedDirection, bool explodes, int effect, int explodeEffect, int explodeSound, int unknown) { Effects.SendMovingParticles(from, to, itemID, speed, duration, fixedDirection, explodes, 0, 0, effect, explodeEffect, explodeSound, unknown); }
protected override void OnTick() { if (m_ForebiddenLoreStatue == null) { Stop(); return; } if (m_ForebiddenLoreStatue.Deleted) { Stop(); return; } if (m_ForebiddenLoreStatue.EffectCount >= m_ForebiddenLoreStatue.EffectMaxCount) { m_ForebiddenLoreStatue.Delete(); Stop(); return; } m_ForebiddenLoreStatue.EffectCount++; Point3D location = m_ForebiddenLoreStatue.Location; Map map = m_ForebiddenLoreStatue.Map; int effectHue = m_ForebiddenLoreStatue.Hue - 1; int minDamage = m_ForebiddenLoreStatue.MinDamage; int maxDamage = m_ForebiddenLoreStatue.MaxDamage; List <Mobile> m_ValidMobiles = new List <Mobile>(); IPooledEnumerable mobileInRange = m_ForebiddenLoreStatue.Map.GetMobilesInRange(location, m_ForebiddenLoreStatue.Range); foreach (Mobile mobile in mobileInRange) { if (!SpecialAbilities.MonsterCanDamage(null, mobile)) { continue; } } mobileInRange.Free(); if (m_ValidMobiles.Count == 0) { return; } Mobile target = m_ValidMobiles[Utility.RandomMinMax(0, m_ValidMobiles.Count - 1)]; Point3D targetLocation = target.Location; IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 14), map); IEntity endLocation = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z + 5), map); int particleSpeed = 5; Effects.PlaySound(location, map, 0x227); Effects.SendMovingParticles(startLocation, endLocation, 0x36D4, particleSpeed, 0, false, false, effectHue, 0, 9501, 0, 0, 0x100); Point3D newLocation = new Point3D(location.X, location.Y, location.Z + 14); TimedStatic timedStatic = new TimedStatic(0x3779, .5); timedStatic.Hue = effectHue; timedStatic.Name = "dissipated energy"; timedStatic.MoveToWorld(newLocation, map); double distance = Utility.GetDistanceToSqrt(location, targetLocation); double destinationDelay = (double)distance * .08; Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { if (m_ForebiddenLoreStatue.Deleted) { return; } if (target == null) { return; } if (target.Deleted || !target.Alive) { return; } if (Utility.GetDistanceToSqrt(m_ForebiddenLoreStatue.Location, targetLocation) >= 30) { return; } int damage = Utility.RandomMinMax(minDamage, maxDamage); if (target is BaseCreature) { damage *= 2; } Effects.PlaySound(location, map, 0x208); target.FixedParticles(0x36BD, 20, 20, 5044, effectHue, 0, EffectLayer.Head); //Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, TimeSpan.FromSeconds(0.5)), 0x3996, 10, 20, effectHue, 0, 5029, 0); new Blood().MoveToWorld(targetLocation, map); AOS.Damage(target, damage, 0, 100, 0, 0, 0); }); }
public static void DoLevel(Mobile m, Setup set) { double TimesLeveled = 0; PlayerMobile pm = m as PlayerMobile; pm.PlaySound(0x5B4); Effects.SendLocationParticles(EffectItem.Create(pm.Location, pm.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(pm.Location, pm.Map, 0x243); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(pm.X - 6, pm.Y - 6, pm.Z + 15), pm.Map), pm, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(pm.X - 4, pm.Y - 6, pm.Z + 15), pm.Map), pm, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(pm.X - 6, pm.Y - 4, pm.Z + 15), pm.Map), pm, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); pm.PlaySound(0x20F); pm.FixedParticles(0x376A, 1, 31, 9961, 1160, 0, EffectLayer.Waist); pm.FixedParticles(0x37C4, 1, 31, 9502, 43, 2, EffectLayer.Waist); if (set.StatRefillOnLevel) { if (pm.Hits < pm.HitsMax) { pm.Hits = pm.HitsMax; } if (pm.Mana < pm.ManaMax) { pm.Mana = pm.ManaMax; } if (pm.Stam < pm.StamMax) { pm.Stam = pm.StamMax; } } /* * while (pm.Exp >= pm.LevelAt && pm.Level != pm.LevelCap) * { * if (set.AccumulativeExp) * return; * * int newexp = 0; * * if (pm.Exp > pm.LevelAt) * newexp = pm.Exp - pm.LevelAt; * * pm.Exp = newexp; * TimesLeveled++; * } */ for (int i = 1; pm.Exp >= pm.LevelAt; i++) { pm.LevelAt += set.NextLevelAt; pm.AccLevelAt += (int)(set.NextLevelAt + pm.AccKillExp); pm.Exp = 0; pm.KillExp = 0; if (pm.Profession == 1) { pm.RawStr += 4; pm.RawDex += 1; pm.RawInt += 0; } else if (pm.Profession == 2) { pm.RawStr += 1; pm.RawDex += 1; pm.RawInt += 3; } else if (pm.Profession == 3) { pm.RawStr += 3; pm.RawDex += 1; pm.RawInt += 1; } else if (pm.Profession == 4) { pm.RawStr += 2; pm.RawDex += 1; pm.RawInt += 2; } else if (pm.Profession == 5) { pm.RawStr += 2; pm.RawDex += 1; pm.RawInt += 2; } else if (pm.Profession == 6) { pm.RawStr += 3; pm.RawDex += 1; pm.RawInt += 1; } else if (pm.Profession == 7) { pm.RawStr += 1; pm.RawDex += 3; pm.RawInt += 1; } else if (pm.Profession == 8) { pm.RawStr += 1; pm.RawDex += 1; pm.RawInt += 3; } else if (pm.Profession == 9) { pm.RawStr += 2; pm.RawDex += 1; pm.RawInt += 2; } else if (pm.Profession == 10) { pm.RawStr += 1; pm.RawDex += 2; pm.RawInt += 2; } else if (pm.Profession == 11) { pm.RawStr += 1; pm.RawDex += 3; pm.RawInt += 1; } else if (pm.Profession == 12) { pm.RawStr += 1; pm.RawDex += 3; pm.RawInt += 1; } else if (pm.Profession == 666) // Running Pants { pm.RawStr += 1; pm.RawDex += 1; pm.RawInt += 1; } if (set.BonusStatOnLevel && pm.RawStatTotal != pm.StatCap && set.ChanceForBonusStat < Utility.Random(100)) { switch (Utility.Random(3)) { case 0: pm.RawStr += 1; break; case 1: pm.RawDex += 1; break; case 2: pm.RawInt += 1; break; } } TimesLeveled = i; } if (set.RefreshExpBarOnGain && pm.HasGump(typeof(ExpBar))) { pm.CloseGump(typeof(ExpBar)); pm.SendGump(new ExpBar(pm)); } pm.SendMessage("You're Level has increased by {0}", TimesLeveled); pm.Level += (int)TimesLeveled; }
protected override void OnTick() { if (m_From == null || m_From.Deleted) { Stop(); return; } if (m_Count == 0) { for (var i = 0; i < m_List.Count; i++) { m_List[i].Frozen = true; m_List[i].Kill(); } } else if (m_Count < 10) { for (var i = 0; i < m_List.Count; i++) { if (m_Count == 1) { m_List[i].SendMessage("Unnatural forces hold you free from the ground and swirl around you!"); } //TODO find cliloc. // Prevent them from resing during this trick. if (m_List[i].Alive) { m_List[i].Kill(); } m_List[i].Z++; var effects = Utility.RandomMinMax(3, 5) + 1; int x = 0, y = 0; for (var j = 0; j < effects; j++) { x = Utility.RandomMinMax(-1, 2); y = Utility.RandomMinMax(-1, 2); //TODO Match the look Effects.SendMovingParticles( new Entity(Serial.Zero, new Point3D(m_List[i].X + x, m_List[i].Y + y, m_List[i].Z - 5), m_List[i].Map), new Entity(Serial.Zero, new Point3D(m_List[i].X + x, m_List[i].Y + y, m_List[i].Z + 60), m_List[i].Map), 0x378A + Utility.Random(19) /*ItemID*/, 10, 0, false, false, 0, 0, 9502, 1, 0, (EffectLayer)255, 0x100); } } } else { for (var i = 0; i < m_List.Count; i++) { m_List[i].Z -= 0; m_List[i].Frozen = false; } Stop(); } m_Count++; }
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; } }