public static EffectItem Create( IPoint3D p, IMap map, TimeSpan duration ) { EffectItem item = null; for ( int i = m_Free.Count - 1; item == null && i >= 0; --i ) // We reuse new entries first so decay works better { EffectItem free = (EffectItem) m_Free[i]; m_Free.RemoveAt( i ); if ( !free.Deleted && free.Map == Map.Internal ) item = free; } if ( item == null ) { item = new EffectItem(); } else { item.ItemID = 1; } item.MoveToWorld( new Point3D( p ), map as Map ); item.BeginFree( duration ); return item; }
protected override void OnTick() { int z = m_Map.GetAverageZ(m_X, m_Y); bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false); for (int i = -3; !canFit && i <= 3; ++i) { canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false); if (canFit) { z += i; } } if (!canFit) { return; } Item g = new Gold(100, 200); g.Delete(); int r1 = (int)(Utility.RandomMinMax(80, 160) * (MyServerSettings.GetGoldCutRate() * .01)); int r2 = (int)(Utility.RandomMinMax(200, 400) * (MyServerSettings.GetGoldCutRate() * .01)); int r3 = (int)(Utility.RandomMinMax(400, 800) * (MyServerSettings.GetGoldCutRate() * .01)); int r4 = (int)(Utility.RandomMinMax(800, 1200) * (MyServerSettings.GetGoldCutRate() * .01)); int r5 = (int)(Utility.RandomMinMax(1200, 1600) * (MyServerSettings.GetGoldCutRate() * .01)); switch (Utility.Random(21)) { case 0: g = new Crystals(r1); break; case 1: g = new DDGemstones(r2); break; case 2: g = new DDJewels(r2); break; case 3: g = new DDGoldNuggets(r3); break; case 4: g = new Gold(r3); break; case 5: g = new Gold(r3); break; case 6: g = new Gold(r3); break; case 7: g = new DDSilver(r4); break; case 8: g = new DDSilver(r4); break; case 9: g = new DDSilver(r4); break; case 10: g = new DDSilver(r4); break; case 11: g = new DDSilver(r4); break; case 12: g = new DDSilver(r4); break; case 13: g = new DDCopper(r5); break; case 14: g = new DDCopper(r5); break; case 15: g = new DDCopper(r5); break; case 16: g = new DDCopper(r5); break; case 17: g = new DDCopper(r5); break; case 18: g = new DDCopper(r5); break; case 19: g = new DDCopper(r5); break; case 20: g = new DDCopper(r5); break; } g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map); if (0.5 >= Utility.RandomDouble()) { switch (Utility.Random(3)) { case 0: // Fire column { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052); Effects.PlaySound(g, g.Map, 0x208); break; } case 1: // Explosion { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044); Effects.PlaySound(g, g.Map, 0x307); break; } case 2: // Ball of fire { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052); break; } } } }
public static void RunThis() { LoggingFunctions.LogServer( "Start - Arrange Quest Search Crates" ); ///// MOVE THE SEARCH PEDESTALS ////////////////////////////////////// BuildQuests.SearchCreate(); LoggingFunctions.LogServer( "Done - Arrange Quest Search Crates" ); LoggingFunctions.LogServer( "Start - Change Stealing Pedestals" ); ///// MAKE THE STEAL PEDS LOOK DIFFERENT ///////////////////////////// BuildSteadPeds.CreateStealPeds(); LoggingFunctions.LogServer( "Done - Change Stealing Pedestals" ); LoggingFunctions.LogServer( "Start - Remove Spread Out Monsters, Drinkers, And Healers" ); ///// CLEANUP THE CREATURES MASS SPREAD OUT IN THE LAND ////////////// ArrayList targets = new ArrayList(); ArrayList healers = new ArrayList(); ArrayList exodus = new ArrayList(); ArrayList gargoyle = new ArrayList(); foreach ( Mobile creature in World.Mobiles.Values ) { if ( creature is CodexGargoyleA || creature is CodexGargoyleB ) { gargoyle.Add( creature ); } else if ( creature.WhisperHue == 999 || creature.WhisperHue == 911 ) { if ( creature != null ) { if ( creature is WanderingHealer || creature is Courier ){ healers.Add( creature ); } else if ( creature is Exodus ){ exodus.Add( creature ); } else { targets.Add( creature ); } } } } for ( int i = 0; i < targets.Count; ++i ) { Mobile creature = ( Mobile )targets[ i ]; if ( creature.Hidden == false ) { if ( creature.WhisperHue == 911 ) { Effects.SendLocationEffect( creature.Location, creature.Map, 0x3400, 60, 0x6E4, 0 ); Effects.PlaySound( creature.Location, creature.Map, 0x108 ); } else { creature.PlaySound( 0x026 ); Effects.SendLocationEffect( creature.Location, creature.Map, 0x352D, 16, 4 ); } } creature.Delete(); } for ( int i = 0; i < exodus.Count; ++i ) { Mobile creature = ( Mobile )exodus[ i ]; Server.Misc.IntelligentAction.BurnAway( creature ); Worlds.MoveToRandomDungeon( creature ); Server.Misc.IntelligentAction.BurnAway( creature ); } for ( int i = 0; i < gargoyle.Count; ++i ) { Mobile creature = ( Mobile )gargoyle[ i ]; Server.Misc.IntelligentAction.BurnAway( creature ); Worlds.MoveToRandomDungeon( creature ); Server.Misc.IntelligentAction.BurnAway( creature ); } for ( int i = 0; i < healers.Count; ++i ) { Mobile healer = ( Mobile )healers[ i ]; Effects.SendLocationParticles( EffectItem.Create( healer.Location, healer.Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 ); healer.PlaySound( 0x1FE ); healer.Delete(); } ArrayList drinkers = new ArrayList(); foreach ( Mobile drunk in World.Mobiles.Values ) if ( drunk is BarFlyWizardWest || drunk is BarFlyWizardSouth || drunk is BarFlyWizardNorth || drunk is BarFlyWizardEast || drunk is BarFlyWarriorWest || drunk is BarFlyWarriorSouth || drunk is BarFlyWarriorNorth || drunk is BarFlyWarriorEast ) { if ( drunk != null ) { drinkers.Add( drunk ); } } for ( int i = 0; i < drinkers.Count; ++i ) { Mobile drunk = ( Mobile )drinkers[ i ]; Effects.SendLocationParticles( EffectItem.Create( drunk.Location, drunk.Map, EffectItem.DefaultDuration ), 0x3728, 8, 20, 5042 ); Effects.PlaySound( drunk, drunk.Map, 0x201 ); drunk.Delete(); } LoggingFunctions.LogServer( "Done - Remove Spread Out Monsters, Drinkers, And Healers" ); }
public static void ResolvePotion(PlayerMobile player, Mobile mobileTarget, CustomAlchemyPotion potion) { if (!SpecialAbilities.Exists(player)) { return; } if (!SpecialAbilities.Exists(mobileTarget)) { return; } bool positiveEffect = potion.PositiveEffect; CustomAlchemy.EffectType primaryEffect = potion.PrimaryEffect; CustomAlchemy.EffectType secondaryEffect = potion.SecondaryEffect; CustomAlchemy.EffectPotencyType potencyType = potion.EffectPotency; int throwSound = 0x5D3; int itemID = potion.ItemID; int itemHue = potion.Hue; int hitSound = Utility.RandomList(0x38E, 0x38F, 0x390); int effectSound = 0x5D8; ConsumePotion(player, potion); SpecialAbilities.HinderSpecialAbility(1.0, null, player, 1.0, 0.75, true, 0, false, "", "", "-1"); Point3D location = player.Location; Map map = player.Map; Point3D targetLocation = mobileTarget.Location; Map targetMap = mobileTarget.Map; bool drinkPotion = false; if (positiveEffect && player == mobileTarget && potencyType == EffectPotencyType.Target) { drinkPotion = true; } if (drinkPotion) { player.Animate(34, 5, 1, true, false, 0); Effects.PlaySound(player.Location, player.Map, Utility.RandomList(0x4CC, 0x4CD, 0x030, 0x031)); } else { player.Animate(31, 7, 1, true, false, 0); Effects.PlaySound(player.Location, player.Map, throwSound); } Timer.DelayCall(TimeSpan.FromSeconds(.5), delegate { if (!SpecialAbilities.Exists(player)) { return; } //Update Target Location if MobileTarget still Valid if (mobileTarget != null && !drinkPotion) { if (Utility.GetDistance(mobileTarget.Location, targetLocation) < 20 && mobileTarget.Map == targetMap) { targetLocation = mobileTarget.Location; } } double distance = Utility.GetDistance(location, targetLocation); double destinationDelay = (double)distance * .04; IEntity startLocation = new Entity(Serial.Zero, new Point3D(location.X, location.Y, location.Z + 5), map); IEntity endLocation = new Entity(Serial.Zero, new Point3D(targetLocation.X, targetLocation.Y, targetLocation.Z + 5), targetMap); if (drinkPotion) { destinationDelay = 0; } else { Effects.SendMovingEffect(startLocation, endLocation, itemID, 10, 0, false, false, itemHue, 0); } Timer.DelayCall(TimeSpan.FromSeconds(destinationDelay), delegate { //Update Target Location if MobileTarget still Valid if (mobileTarget != null && !drinkPotion) { if (Utility.GetDistance(mobileTarget.Location, targetLocation) < 20 && mobileTarget.Map == targetMap) { targetLocation = mobileTarget.Location; } } int primaryEffectItemId = 0x3709; int primaryEffectHue = 0; int primaryEffectSound = 0x208; int secondaryEffectItemId = 0x3709; int secondaryEffectHue = 0; int secondaryEffectSound = 0x208; List <Point3D> m_EffectLocations = new List <Point3D>(); if (drinkPotion && SpecialAbilities.Exists(player)) { m_EffectLocations.Add(player.Location); } else { int radius = 0; switch (potencyType) { case EffectPotencyType.SmallAoE: radius = 2; break; case EffectPotencyType.MediumAoE: radius = 4; break; case EffectPotencyType.LargeAoE: radius = 6; break; } int minRange = -1 * radius; int maxRange = radius + 1; for (int a = minRange; a < maxRange; a++) { for (int b = minRange; b < maxRange; b++) { Point3D newLocation = new Point3D(targetLocation.X + a, targetLocation.Y + b, targetLocation.Z); if (!m_EffectLocations.Contains(newLocation)) { m_EffectLocations.Add(newLocation); } } } } foreach (Point3D point in m_EffectLocations) { Effects.SendLocationParticles(EffectItem.Create(point, map, TimeSpan.FromSeconds(0.25)), primaryEffectItemId, 10, 30, primaryEffectHue, 0, 5029, 0); //Effect } /* * //Positive * StrengthIncrease, * DexterityIncrease, * IntelligenceIncrease, * HitsRegenIncrease, * StamRegenIncrease, * ManaRegenIncrease, * MeleeDamageDealtIncrease, * MeleeDamageResistIncrease, * SpellDamageDealtIncrease, * SpellDamageResistIncrease, * AccuracyIncrease, * EvasionIncrease, * * //Negative * Entangle, * Petrify, * FireDamage, * FrostDamage, * AbyssalDamage, * ShockDamage, * EarthDamage, * BleedDamage, * Disease, * Poison, * AccuracyReduction, * EvasionReduction * * Target, * SmallAoE, * MediumAoE, * LargeAoE */ if (drinkPotion) { } }); }); }
protected override TimeSpan Play(int step) { switch (step) { case 0: { Effects.PlaySound(Location, Map, 0x106); Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x3735, 1, 182, 0xBE3); return(TimeSpan.FromSeconds(4.0)); } case 1: { Effects.PlaySound(Location, Map, 0x222); return(TimeSpan.FromSeconds(4.0)); } case 2: { Effects.PlaySound(Location, Map, 0x21F); return(TimeSpan.FromSeconds(5.0)); } case 3: { EffectItem dummy = EffectItem.Create(Location, Map, TimeSpan.FromSeconds(20.0)); dummy.PublicOverheadMessage(MessageType.Regular, 0x3B2, true, "* The ground erupts with chaotic growth! *"); Effects.PlaySound(Location, Map, 0x12D); SpawnReagents(); SpawnReagents(); return(TimeSpan.FromSeconds(2.0)); } case 4: { Effects.PlaySound(Location, Map, 0x12D); SpawnReagents(); SpawnReagents(); return(TimeSpan.FromSeconds(2.0)); } case 5: { Effects.PlaySound(Location, Map, 0x12D); SpawnReagents(); SpawnReagents(); return(TimeSpan.FromSeconds(3.0)); } default: { Effects.PlaySound(Location, Map, 0x12D); SpawnReagents(); SpawnReagents(); return(TimeSpan.Zero); } } }
protected override void OnTarget(Mobile from, object o) { if (m_Talisman == null || m_Talisman.Deleted) { return; } Mobile target = o as Mobile; if (from.Talisman != m_Talisman) { from.SendLocalizedMessage(502641); // You must equip this item to use it. } else if (target == null) { from.SendLocalizedMessage(1046439); // That is not a valid target. } else if (m_Talisman.ChargeTime > 0) { from.SendLocalizedMessage(1074882, m_Talisman.ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge. } else if (m_Talisman.Charges == 0 && m_Talisman.MaxCharges > 0) { from.SendLocalizedMessage(1042544); // This item is out of charges. } else { switch (m_Talisman.Removal) { case TalismanRemoval.Curse: target.PlaySound(0xF6); target.PlaySound(0x1F7); target.FixedParticles(0x3709, 1, 30, 9963, 13, 3, EffectLayer.Head); IEntity mfrom = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z - 10), from.Map); IEntity mto = new Entity(Serial.Zero, new Point3D(target.X, target.Y, target.Z + 50), from.Map); Effects.SendMovingParticles(mfrom, mto, 0x2255, 1, 0, false, false, 13, 3, 9501, 1, 0, EffectLayer.Head, 0x100); StatMod mod; mod = target.GetStatMod("[Magic] Str Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Str Offset"); } mod = target.GetStatMod("[Magic] Dex Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Dex Offset"); } mod = target.GetStatMod("[Magic] Int Offset"); if (mod != null && mod.Offset < 0) { target.RemoveStatMod("[Magic] Int Offset"); } target.Paralyzed = false; EvilOmenSpell.CheckEffect(target); StrangleSpell.RemoveCurse(target); CorpseSkinSpell.RemoveCurse(target); CurseSpell.RemoveEffect(target); BuffInfo.RemoveBuff(target, BuffIcon.Clumsy); BuffInfo.RemoveBuff(target, BuffIcon.FeebleMind); BuffInfo.RemoveBuff(target, BuffIcon.Weaken); BuffInfo.RemoveBuff(target, BuffIcon.MassCurse); target.SendLocalizedMessage(1072408); // Any curses on you have been lifted if (target != from) { from.SendLocalizedMessage(1072409); // Your targets curses have been lifted } break; case TalismanRemoval.Damage: target.PlaySound(0x201); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); BleedAttack.EndBleed(target, true); MortalStrike.EndWound(target); BuffInfo.RemoveBuff(target, BuffIcon.Bleed); BuffInfo.RemoveBuff(target, BuffIcon.MortalStrike); target.SendLocalizedMessage(1072405); // Your lasting damage effects have been removed! if (target != from) { from.SendLocalizedMessage(1072406); // Your Targets lasting damage effects have been removed! } break; case TalismanRemoval.Ward: target.PlaySound(0x201); Effects.SendLocationParticles(EffectItem.Create(target.Location, target.Map, EffectItem.DefaultDuration), 0x3728, 1, 13, 0x834, 0, 0x13B2, 0); MagicReflectSpell.EndReflect(target); ReactiveArmorSpell.EndArmor(target); ProtectionSpell.EndProtection(target); target.SendLocalizedMessage(1072402); // Your wards have been removed! if (target != from) { from.SendLocalizedMessage(1072403); // Your target's wards have been removed! } break; case TalismanRemoval.Wildfire: // TODO break; } m_Talisman.OnAfterUse(from); } }
public override bool OnMoveOver(Mobile m) { if (owner != m) { int StrMax = power; int StrMin = (int)(power / 2); if ( (m is PlayerMobile && m.Blessed == false && m.Alive && m.AccessLevel == AccessLevel.Player && Server.Misc.SeeIfGemInBag.GemInPocket(m) == false) || (m is BaseCreature && m.Blessed == false && !(m is PlayerMobile)) ) { int Sprung = 1; if (m is PlayerMobile) { Sprung = Server.Items.HiddenTrap.CheckTrapAvoidance(m, this); } if (Sprung > 0) { if (m.CheckSkill(SkillName.EvalInt, 0, 125)) { if (m is PlayerMobile) { m.LocalOverheadMessage(Network.MessageType.Emote, 0x3B2, false, "You got near a magical trap, but you were too intelligent to suffer the effects."); } Sprung = 0; } } if (Sprung > 0) { if (this.Hue == 0x48F) // POISON TRAP { int itHurts = m.PoisonResistance; int itSicks = 0; if (itHurts >= 70) { itSicks = 1; } else if (itHurts >= 50) { itSicks = 2; } else if (itHurts >= 30) { itSicks = 3; } else if (itHurts >= 10) { itSicks = 4; } else { itSicks = 5; } switch (Utility.RandomMinMax(1, itSicks)) { case 1: m.ApplyPoison(m, Poison.Lesser); break; case 2: m.ApplyPoison(m, Poison.Regular); break; case 3: m.ApplyPoison(m, Poison.Greater); break; case 4: m.ApplyPoison(m, Poison.Deadly); break; case 5: m.ApplyPoison(m, Poison.Lethal); break; } Effects.SendLocationEffect(this.Location, this.Map, 0x11A8 - 2, 16, 3, 0, 0); Effects.PlaySound(this.Location, this.Map, 0x231); if (m is PlayerMobile) { m.LocalOverheadMessage(MessageType.Emote, 0x22, true, "You triggered a magical trap!"); } itHurts = (int)((Utility.RandomMinMax(StrMin, StrMax) * (100 - m.PoisonResistance)) / 100); m.Damage(itHurts, m); } else if (this.Hue == 0x489) // FLAME TRAP { Effects.SendLocationParticles(EffectItem.Create(this.Location, this.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052); Effects.PlaySound(this.Location, this.Map, 0x225); if (m is PlayerMobile) { m.LocalOverheadMessage(MessageType.Emote, 0x22, true, "You triggered a magical trap!"); } int itHurts = (int)((Utility.RandomMinMax(StrMin, StrMax) * (100 - m.FireResistance)) / 100); m.Damage(itHurts, m); } else if (this.Hue == 0x48E) // EXPLOSION TRAP { m.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head); m.PlaySound(0x307); if (m is PlayerMobile) { m.LocalOverheadMessage(MessageType.Emote, 0x22, true, "You triggered a magical trap!"); } int itHurts = (int)((Utility.RandomMinMax(StrMin, StrMax) * (100 - m.PhysicalResistance)) / 100); m.Damage(itHurts, m); } else if (this.Hue == 0x490) // ELECTRICAL TRAP { m.BoltEffect(0); if (m is PlayerMobile) { m.LocalOverheadMessage(MessageType.Emote, 0x22, true, "You triggered a magical trap!"); } int itHurts = (int)((Utility.RandomMinMax(StrMin, StrMax) * (100 - m.EnergyResistance)) / 100); m.Damage(itHurts, m); } else if (this.Hue == 0x480) // BLIZZARD TRAP { Point3D blast = new Point3D((m.X), (m.Y), m.Z); Effects.SendLocationEffect(blast, m.Map, 0x375A, 30, 10, 0x481, 0); m.PlaySound(0x10B); if (m is PlayerMobile) { m.LocalOverheadMessage(MessageType.Emote, 0x22, true, "You triggered a magical trap!"); } int itHurts = (int)((Utility.RandomMinMax(StrMin, StrMax) * (100 - m.ColdResistance)) / 100); m.Damage(itHurts, m); } } this.Delete(); } } return(true); }
public override void OnDoubleClick(Mobile from) { if (from.InRange(this.GetWorldLocation(), 1)) { if (from.CheckSkill(SkillName.TasteID, -5, 125)) { if (from.Body.IsHuman && !from.Mounted) { from.Animate(34, 5, 1, true, false, 0); } from.PlaySound(0x2D6); Item item = new PotionKeg(); PotionKeg barrel = (PotionKeg)item; barrel.Held = KegFilled; int potionType = Utility.RandomMinMax(1, 31); if (Utility.RandomMinMax(1, 125) <= from.Skills[SkillName.Cooking].Value) // COOKS CAN FIND A POTION 1 LEVEL HIGHER { if (potionType == 2) { potionType++; } else if (potionType == 3) { potionType++; } else if (potionType == 5) { potionType++; } else if (potionType == 7) { potionType++; } else if (potionType == 9) { potionType++; } else if (potionType == 10) { potionType++; } else if (potionType == 11) { potionType++; } else if (potionType == 12) { potionType = 30; } else if (potionType == 13) { potionType++; } else if (potionType == 15) { potionType++; } else if (potionType == 16) { potionType++; } else if (potionType == 18) { potionType++; } else if (potionType == 19) { potionType++; } else if (potionType == 21) { potionType++; } else if (potionType == 22) { potionType++; } else if (potionType == 24) { potionType++; } else if (potionType == 25) { potionType++; } else if (potionType == 27) { potionType++; } else if (potionType == 28) { potionType++; } } if (potionType == 1) { barrel.Type = PotionEffect.Nightsight; } else if (potionType == 2) { barrel.Type = PotionEffect.CureLesser; } else if (potionType == 3) { barrel.Type = PotionEffect.Cure; } else if (potionType == 4) { barrel.Type = PotionEffect.CureGreater; } else if (potionType == 5) { barrel.Type = PotionEffect.Agility; } else if (potionType == 6) { barrel.Type = PotionEffect.AgilityGreater; } else if (potionType == 7) { barrel.Type = PotionEffect.Strength; } else if (potionType == 8) { barrel.Type = PotionEffect.StrengthGreater; } else if (potionType == 9) { barrel.Type = PotionEffect.PoisonLesser; } else if (potionType == 10) { barrel.Type = PotionEffect.Poison; } else if (potionType == 11) { barrel.Type = PotionEffect.PoisonGreater; } else if (potionType == 12) { barrel.Type = PotionEffect.PoisonDeadly; } else if (potionType == 13) { barrel.Type = PotionEffect.Refresh; } else if (potionType == 14) { barrel.Type = PotionEffect.RefreshTotal; } else if (potionType == 15) { barrel.Type = PotionEffect.HealLesser; } else if (potionType == 16) { barrel.Type = PotionEffect.Heal; } else if (potionType == 17) { barrel.Type = PotionEffect.HealGreater; } else if (potionType == 18) { barrel.Type = PotionEffect.ExplosionLesser; } else if (potionType == 19) { barrel.Type = PotionEffect.Explosion; } else if (potionType == 20) { barrel.Type = PotionEffect.ExplosionGreater; } else if (potionType == 21) { barrel.Type = PotionEffect.InvisibilityLesser; } else if (potionType == 22) { barrel.Type = PotionEffect.Invisibility; } else if (potionType == 23) { barrel.Type = PotionEffect.InvisibilityGreater; } else if (potionType == 24) { barrel.Type = PotionEffect.RejuvenateLesser; } else if (potionType == 25) { barrel.Type = PotionEffect.Rejuvenate; } else if (potionType == 26) { barrel.Type = PotionEffect.RejuvenateGreater; } else if (potionType == 27) { barrel.Type = PotionEffect.ManaLesser; } else if (potionType == 28) { barrel.Type = PotionEffect.Mana; } else if (potionType == 29) { barrel.Type = PotionEffect.ManaGreater; } else if (potionType == 30) { barrel.Type = PotionEffect.PoisonLethal; } else { barrel.Type = PotionEffect.Invulnerability; } Server.Items.PotionKeg.SetColorKeg(item, item); from.SendMessage("This seems to be a " + barrel.Name + "."); from.AddToBackpack(barrel); } else { int nReaction = Utility.RandomMinMax(0, 10); if (nReaction == 1) { from.PlaySound(from.Female ? 813 : 1087); from.Say("*vomits*"); if (!from.Mounted) { from.Animate(32, 5, 1, true, false, 0); } Throwup puke = new Throwup(); puke.Map = from.Map; puke.Location = from.Location; from.SendMessage("You fail to identify the liquid, convulsing and spilling the keg."); } else if (nReaction == 2) { from.PlaySound(from.Female ? 798 : 1070); from.Say("*hiccup!*"); from.SendMessage("You fail to identify the liquid, spasming and spilling the keg."); } else if (nReaction == 3) { from.PlaySound(from.Female ? 792 : 1064); from.Say("*farts*"); from.SendMessage("You fail to identify the liquid, feeling gassy...you dump it out."); } else if (nReaction == 4) { from.PlaySound(from.Female ? 785 : 1056); from.Say("*cough!*"); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } from.SendMessage("You fail to identify the liquid, coughing and spilling the keg."); } else if (nReaction == 5) { from.PlaySound(from.Female ? 748 : 1055); from.Say("*clears throat*"); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } from.SendMessage("You fail to identify the liquid, hurting your throat...you dump out the keg."); } else if (nReaction == 6) { from.PlaySound(from.Female ? 782 : 1053); from.Say("*burp!*"); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } from.SendMessage("You fail to identify the liquid, accidentally drinking the entire keg."); } else if (nReaction > 6) { int nPoison = Utility.RandomMinMax(0, 10); from.Say("Poison!"); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0); from.PlaySound(Utility.RandomList(0x30, 0x2D6)); if (nPoison > 9) { from.ApplyPoison(from, Poison.Deadly); } else if (nPoison > 7) { from.ApplyPoison(from, Poison.Greater); } else if (nPoison > 4) { from.ApplyPoison(from, Poison.Regular); } else { from.ApplyPoison(from, Poison.Lesser); } from.SendMessage("Poison!"); } else { from.PlaySound(from.Female ? 820 : 1094); from.Say("*spits*"); if (!from.Mounted) { from.Animate(6, 5, 1, true, false, 0); } from.SendMessage("You fail to identify the liquid, spitting it out and dumping the keg."); } from.AddToBackpack(new Keg()); } this.Delete(); } else { from.SendLocalizedMessage(502138); // That is too far away for you to use } }
protected override void OnTarget(Mobile from, object o) { if (o is Item) { if (from.CheckTargetSkill(SkillName.ItemID, o, 0, 100)) { if (!Core.AOS) { ((Item)o).OnSingleClick(from); } //ItemID Mods Begin if (o is BaseArmor) { ((BaseArmor)o).Identified = true; } else if (o is BaseClothing) { ((BaseClothing)o).Identified = true; } else if (o is BaseJewel) { ((BaseJewel)o).Identified = true; } //ItemID Mods End else if (o is BaseAxe) { if (from.CheckTargetSkill(SkillName.ItemID, o, 40.0, 100)) { ((BaseAxe)o).Identified = true; from.BoltEffect(0x480); from.PlaySound(Utility.RandomList(0x028, 0x029, 0x206)); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x232); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); } } else if (o is BaseBashing) { if (from.CheckTargetSkill(SkillName.ItemID, o, 30.0, 100)) { ((BaseBashing)o).Identified = true; from.BoltEffect(0x480); from.PlaySound(Utility.RandomList(0x028, 0x029, 0x206)); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x233); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); } } else if (o is BaseKnife) { if (from.CheckTargetSkill(SkillName.ItemID, o, 15.0, 100)) { ((BaseKnife)o).Identified = true; from.BoltEffect(0x480); from.PlaySound(Utility.RandomList(0x028, 0x029, 0x206)); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x23B); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); } } else if (o is BasePoleArm) { if (from.CheckTargetSkill(SkillName.ItemID, o, 70.0, 100)) { ((BasePoleArm)o).Identified = true; from.BoltEffect(0x480); from.PlaySound(Utility.RandomList(0x028, 0x029, 0x206)); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x237); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); } } else if (o is BaseRanged) { if (from.CheckTargetSkill(SkillName.ItemID, o, 25.0, 100)) { ((BaseRanged)o).Identified = true; from.BoltEffect(0x480); from.PlaySound(Utility.RandomList(0x028, 0x029, 0x206)); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x234); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); } } else if (o is BaseSpear) { if (from.CheckTargetSkill(SkillName.ItemID, o, 50.0, 100)) { ((BaseSpear)o).Identified = true; from.BoltEffect(0x480); from.PlaySound(Utility.RandomList(0x028, 0x029, 0x206)); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x23C); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); } } else if (o is BaseStaff) { if (from.CheckTargetSkill(SkillName.ItemID, o, 35.0, 100)) { ((BaseStaff)o).Identified = true; from.BoltEffect(0x480); from.PlaySound(Utility.RandomList(0x028, 0x029, 0x206)); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x233); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); } } else if (o is BaseSword) { if (from.CheckTargetSkill(SkillName.ItemID, o, 25.0, 100)) { ((BaseSword)o).Identified = true; from.BoltEffect(0x480); from.PlaySound(Utility.RandomList(0x028, 0x029, 0x206)); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x237); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); } } } else { from.SendLocalizedMessage(500353); // You are not certain... } } else if (o is Corpse) { PlayerMobile pm = from as PlayerMobile; if (pm.Skills[SkillName.ItemID].Base >= 100.0) { Container cont = ( Container )o; foreach (Item item in cont.Items) { if (item is BaseWeapon) { ((BaseWeapon)item).Identified = true; } else if (item is BaseArmor) { ((BaseArmor)item).Identified = true; } } } } else if (o is Mobile) { ((Mobile)o).OnSingleClick(from); } else { from.SendLocalizedMessage(500353); // You are not certain... } }
public override void OnComponentUsed(AddonComponent ac, Mobile from) { if (!from.InRange(GetWorldLocation(), 2)) { from.SendMessage("You will have to get closer to open that."); } else if (from is PlayerMobile) { PlayerMobile pm = (PlayerMobile)from; bool HasBox = false; int goal = 0; int nextVirtue = 0; RuneBox box = null; if (from.Backpack.FindItemByType(typeof(RuneBox)) != null) { Item boxx = from.Backpack.FindItemByType(typeof(RuneBox)); RuneBox boxxx = (RuneBox)boxx; if (boxxx.RuneBoxOwner == from) { HasBox = true; box = boxxx; goal = box.HasCompassion + box.HasHonesty + box.HasHonor + box.HasHumility + box.HasJustice + box.HasSacrifice + box.HasSpirituality + box.HasValor; if (box.HasCompassion == 0) { nextVirtue = 1; } else if (box.HasHonesty == 0) { nextVirtue = 2; } else if (box.HasHonor == 0) { nextVirtue = 3; } else if (box.HasHumility == 0) { nextVirtue = 4; } else if (box.HasJustice == 0) { nextVirtue = 5; } else if (box.HasSacrifice == 0) { nextVirtue = 6; } else if (box.HasSpirituality == 0) { nextVirtue = 7; } else if (box.HasValor == 0) { nextVirtue = 8; } } } if (CharacterDatabase.GetKeys(from, "Virtue") || CharacterDatabase.GetKeys(from, "Corrupt")) // THEY ARE ALREADY DID THIS QUEST { HasBox = true; from.SendMessage("You don't need this chest as you already dealt with the runes."); } else if (goal < 8 && HasBox == true) { RuneGuardian sentinel = new RuneGuardian(); sentinel.gVirtue = nextVirtue; sentinel.gSummoner = from; sentinel.MoveToWorld(Location, Map); sentinel.Combatant = from; Effects.SendLocationParticles(EffectItem.Create(sentinel.Location, sentinel.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023); sentinel.PlaySound(0x1FE); RunesBaseEmpty Pedul = new RunesBaseEmpty(); Pedul.MoveToWorld(new Point3D(this.X, this.Y, this.Z), this.Map); from.SendMessage("You have awakened a sentinel."); this.Delete(); } else if (HasBox == true) { from.SendMessage("Your virtue chest is already in your pack."); } else { ArrayList targets = new ArrayList(); foreach (Item item in World.Items.Values) { if (item is RuneBox) { if (((RuneBox)item).RuneBoxOwner == from) { targets.Add(item); HasBox = true; } } } for (int i = 0; i < targets.Count; ++i) { Item item = ( Item )targets[i]; if (item is RuneBox) { from.AddToBackpack(item); from.SendMessage("Your virtue chest is already in your pack."); } } } if (!HasBox) { SetupVitrtue(from); from.SendMessage("You take possession of the Chest of Virtue!"); from.SendSound(0x3D); LoggingFunctions.LogGeneric(from, "has found the Chest of Virtue."); CharacterDatabase.SetKeys(from, "Runes", true); RunesBaseEmpty Pedul = new RunesBaseEmpty(); Pedul.MoveToWorld(new Point3D(this.X, this.Y, this.Z), this.Map); this.Delete(); } } }
protected override void OnTick() { if (m_Creep == null) { Stop(); } if (m_Creep.Deleted || m_Creep.ticks >= m_Creep.maxTicks) { m_Creep.Delete(); Stop(); } else { IPooledEnumerable mobilesOnTile = m_Creep.GetMobilesInRange(0); foreach (Mobile mobile in mobilesOnTile) { if (!mobile.CanBeDamaged() || !mobile.Alive || 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); } } mobilesOnTile.Free(); while (m_Queue.Count > 0) { Mobile mobile = (Mobile)m_Queue.Dequeue(); double damage = Utility.RandomMinMax(5, 15); if (mobile is BaseCreature) { damage *= 1.5; } AOS.Damage(mobile, (int)damage, 0, 100, 0, 0, 0); Effects.PlaySound(mobile.Location, mobile.Map, 0x62A); Effects.SendLocationParticles(EffectItem.Create(mobile.Location, mobile.Map, TimeSpan.FromSeconds(0.5)), 6899, 10, 25, 2596, 0, 5029, 0); mobile.SendMessage("The creep lashes out at you!"); } } m_Creep.ticks++; }
public override void OnHit(Mobile attacker, Mobile defender, double damageBonus) { int bombwhere = Utility.Random(7); switch (bombwhere) { case 0: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head); break; case 1: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.RightHand); break; case 2: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.LeftHand); break; case 3: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Waist); break; case 4: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.LeftFoot); break; case 5: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.RightFoot); break; case 6: defender.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.CenterFeet); break; } for (int x = defender.X - 5; x <= defender.X + 5; x++) { for (int y = defender.Y - 5; y <= defender.Y + 5; y++) { Blood g = new Blood(); g.Visible = false; g.MoveToWorld(new Point3D(x, y, defender.Z), defender.Map); switch (Utility.Random(10)) { case 0: // Fire column { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052); Effects.PlaySound(g, g.Map, 0x208); break; } case 1: // Explosion { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044); Effects.PlaySound(g, g.Map, 0x307); break; } case 2: { Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052); break; } default: break; } } } int explosionDamage = Utility.Random(30, 10); ArrayList targets = new ArrayList(); IPooledEnumerable eable = defender.Map.GetMobilesInRange(new Point3D(defender.Location), 5); foreach (Mobile m in eable) { targets.Add(m); } eable.Free(); if (targets.Count > 0) { explosionDamage /= targets.Count; for (int i = 0; i < targets.Count; ++i) { Mobile m = (Mobile)targets[i]; m.Damage(explosionDamage); m.FixedParticles(0x3709, 10, 30, 5052, EffectLayer.CenterFeet); m.PlaySound(0x208); } } base.OnHit(attacker, defender, damageBonus); }
public override void OnDoubleClick(Mobile from) { if (!Movable) { from.SendMessage("That cannot move so you cannot identify it."); return; } else if (!from.InRange(this.GetWorldLocation(), 3)) { from.SendMessage("You will need to get closer to identify that."); return; } else if (!IsChildOf(from.Backpack) && Server.Misc.MyServerSettings.IdentifyItemsOnlyInPack()) { from.SendMessage("This must be in your backpack to identify."); return; } else if (from.InRange(this.GetWorldLocation(), 1)) { if (from.CheckSkill(SkillName.TasteID, -5, 125)) { if (from.Body.IsHuman && !from.Mounted) { from.Animate(34, 5, 1, true, false, 0); } from.PlaySound(0x2D6); Server.Items.UnknownKeg.GiveKeg(from, this); } else { int nReaction = Utility.RandomMinMax(0, 10); if (nReaction == 1) { from.PlaySound(from.Female ? 813 : 1087); from.Say("*vomits*"); if (!from.Mounted) { from.Animate(32, 5, 1, true, false, 0); } Throwup puke = new Throwup(); puke.Map = from.Map; puke.Location = from.Location; from.SendMessage("You fail to identify the liquid, convulsing and spilling the keg."); } else if (nReaction == 2) { from.PlaySound(from.Female ? 798 : 1070); from.Say("*hiccup!*"); from.SendMessage("You fail to identify the liquid, spasming and spilling the keg."); } else if (nReaction == 3) { from.PlaySound(from.Female ? 792 : 1064); from.Say("*farts*"); from.SendMessage("You fail to identify the liquid, feeling gassy...you dump it out."); } else if (nReaction == 4) { from.PlaySound(from.Female ? 785 : 1056); from.Say("*cough!*"); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } from.SendMessage("You fail to identify the liquid, coughing and spilling the keg."); } else if (nReaction == 5) { from.PlaySound(from.Female ? 784 : 1055); from.Say("*clears throat*"); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } from.SendMessage("You fail to identify the liquid, hurting your throat...you dump out the keg."); } else if (nReaction == 6) { from.PlaySound(from.Female ? 782 : 1053); from.Say("*burp!*"); if (!from.Mounted) { from.Animate(33, 5, 1, true, false, 0); } from.SendMessage("You fail to identify the liquid, accidentally drinking the entire keg."); } else if (nReaction > 6) { int nPoison = Utility.RandomMinMax(0, 10); from.Say("Poison!"); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0); from.PlaySound(Utility.RandomList(0x30, 0x2D6)); if (nPoison > 9) { from.ApplyPoison(from, Poison.Deadly); } else if (nPoison > 7) { from.ApplyPoison(from, Poison.Greater); } else if (nPoison > 4) { from.ApplyPoison(from, Poison.Regular); } else { from.ApplyPoison(from, Poison.Lesser); } from.SendMessage("Poison!"); } else { from.PlaySound(from.Female ? 820 : 1094); from.Say("*spits*"); if (!from.Mounted) { from.Animate(6, 5, 1, true, false, 0); } from.SendMessage("You fail to identify the liquid, spitting it out and dumping the keg."); } from.AddToBackpack(new Keg()); } this.Delete(); } else { from.SendLocalizedMessage(502138); // That is too far away for you to use } }
public virtual void OnTelekinesis(Mobile from) { // We can Tele the Normal Bones as Well. Effects.SendLocationParticles(EffectItem.Create(Location, Map, EffectItem.DefaultDuration), 0x376A, 9, 32, 5022); Effects.PlaySound(Location, Map, 0x1F5); }
public Mobile SpawnGuardian(string name, int level, double PlayersHidingSkill) { Type type = ScriptCompiler.FindTypeByName(name); BaseCreature c = null; if (type != null) { try { object o = Activator.CreateInstance(type); if (o is BaseCreature) { c = o as BaseCreature; // decay time of a chest once it's opened c.Lifespan = TimeSpan.FromMinutes(15); // reset the alignment c.IOBAlignment = IOBAlignment.None; // Can chase you and can reveal you if you be hiding! c.CanRun = true; c.CanReveal = true; // stats based on chest level double factor = 1.0; if (level == 3) { factor = .3; } if (level == 4) { factor = .5; } if (level == 5) { factor = 1.0; } c.SetMana((int)(c.ManaMax * factor)); c.SetStr((int)(c.RawStr * factor)); c.SetDex((int)(c.RawDex * factor)); c.SetInt((int)(c.RawInt * factor)); c.SetHits((int)(((c.HitsMax / 100.0) * 60.0) * factor)); // these guys can reveal - set the Detect Hidden to match the players hiding so that they have a fighting chance c.SetSkill(SkillName.DetectHidden, PlayersHidingSkill * factor); // nerf their magery so that they // Sixth 20 52.1 100 c.SetSkill(SkillName.Magery, 52.1 * factor); // only attack aggressors c.FightMode = FightMode.Aggressor; // maybe 6 tiles? Keep him near by c.RangeHome = 6; // the chest is the home of the guardian c.Home = this.Location; // we are not bardable c.BardImmune = true; // make them a guardian c.AddItem(new Property(Use.IsGuardian, null)); // give them s***e speak if they are calmed c.AddItem(new Quip("Arr, but that be a pretty tune .. can you play me another?")); c.AddItem(new Quip("Thar be no time for singing and dancin' now matey.")); c.AddItem(new Quip("That be a downright lovely tune ye be playing thar.")); c.AddItem(new Quip("Har! Me thinks a cutlass would be a better choice!")); // show them Point3D loc = (GetSpawnPosition(c.RangeHome)); c.MoveToWorld(loc, this.Map); // teleport Effects.SendLocationParticles(EffectItem.Create(c.Location, c.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); Effects.PlaySound(c.Location, c.Map, 0x1FE); Timer.DelayCall(TimeSpan.FromSeconds(1.5), new TimerStateCallback(ShiteTalk_Callback), c); } } catch (Exception exc) { LogHelper.LogException(exc); System.Console.WriteLine("Exception caught in Spawner.Refresh: " + exc.Message); System.Console.WriteLine(exc.StackTrace); } } return(c as Mobile); }
public override void OnResponse(NetState state, RelayInfo info) { Mobile from = state.Mobile; if (from == null || m_SoulStone.Deleted || !m_SoulStone.IsChildOf(from.Backpack)) { return; } if (info.ButtonID > 0) { m_Skill = from.Skills[(info.ButtonID - 1)]; if (m_Skill == null) { return; } int count = from.Skills.Total; int cap = from.SkillsCap; var decreased = new List <Skill>(); int freepool = cap - count; int decreaseamount = 0; int bonuscopy = Math.Min((int)(m_SoulStone.SkillValue * 10.0), m_Skill.CapFixedPoint - m_Skill.BaseFixedPoint); if ((count + bonuscopy) > cap) { foreach (Skill sk in from.Skills.Where(t => t.Lock == SkillLock.Down && t.Base > 0.0)) { //from.SendMessage("{0} has {1}", from.Skills[i].Name, from.Skills[i].Base ); decreased.Add(sk); decreaseamount += sk.BaseFixedPoint; } if (decreaseamount <= 0) { from.SendMessage("You have exceeded the skill cap and do not have enough skill set to be decreased."); return; } } if (/*(m_Skill.Base + bonuscopy) <= m_Skill.Cap*/ m_Skill.Base < m_Skill.Cap && m_Skill.Lock != SkillLock.Locked && m_Skill.Lock != SkillLock.Down) { if (freepool + decreaseamount >= bonuscopy) { m_Skill.BaseFixedPoint += bonuscopy; if (freepool < bonuscopy) { int decreasebonus = bonuscopy; decreasebonus -= freepool; foreach (Skill s in decreased) { if (decreasebonus > 0) { if (s.BaseFixedPoint >= bonuscopy) { s.BaseFixedPoint -= decreasebonus; decreasebonus = 0; } else { decreasebonus -= s.BaseFixedPoint; s.BaseFixedPoint = 0; } } } } m_SoulStone.SkillValue -= (bonuscopy / 10.0); if (m_SoulStone.SkillValue <= 0.0) { m_SoulStone.Delete(); from.SendMessage("Your soul stone has lost all of its charge."); } /* * if ( ( m_SoulStone.Charge -= m_SoulStone.SkillValue ) <= 0.09 ) * m_SoulStone.Delete(); * else * { * m_SoulStone.SkillValue = 0.0; * m_SoulStone.NextUse = DateTime.UtcNow + SoulStone.UseDelay; * } */ from.SendLocalizedMessage(1070713); // You have successfully absorbed the Soulstone's skill points. Effects.SendLocationParticles( EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x243); Effects.SendMovingParticles( new Entity(Server.Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); } else { from.SendMessage("You must have enough skill set down to compensate for the skill gain."); } } else { from.SendMessage("You have to choose another skill."); } } }
private void Activate(object parent) { if (Effect == JewelEffect.None || Charges <= 0) { return; } if (parent is Mobile) { Mobile from = (Mobile)parent; string modName = this.Serial.ToString(); switch (Effect) { case JewelEffect.Strength: from.AddStatMod(new StatMod(StatType.Str, modName + "Str", 10, TimeSpan.Zero)); from.CheckStatTimers(); from.FixedParticles(0x375a, 10, 15, 5017, EffectLayer.Waist); from.PlaySound(0x1ee); break; case JewelEffect.Agility: from.AddStatMod(new StatMod(StatType.Dex, modName + "Dex", 10, TimeSpan.Zero)); from.CheckStatTimers(); from.FixedParticles(0x375a, 10, 15, 5010, EffectLayer.Waist); from.PlaySound(0x28e); break; case JewelEffect.Cunning: from.AddStatMod(new StatMod(StatType.Int, modName + "Int", 10, TimeSpan.Zero)); from.CheckStatTimers(); from.FixedParticles(0x375a, 10, 15, 5011, EffectLayer.Head); from.PlaySound(0x1eb); break; case JewelEffect.Bless: from.AddStatMod(new StatMod(StatType.Str, modName + "BlessStr", 10, TimeSpan.Zero)); from.AddStatMod(new StatMod(StatType.Dex, modName + "BlessDex", 10, TimeSpan.Zero)); from.AddStatMod(new StatMod(StatType.Int, modName + "BlessInt", 10, TimeSpan.Zero)); from.CheckStatTimers(); from.FixedParticles(0x373a, 10, 15, 5018, EffectLayer.Waist); from.PlaySound(0x1ea); break; case JewelEffect.Weaken: from.AddStatMod(new StatMod(StatType.Str, modName + "LowerStr", -10, TimeSpan.Zero)); from.CheckStatTimers(); from.FixedParticles(0x3779, 10, 15, 5009, EffectLayer.Waist); from.PlaySound(0x1e6); break; case JewelEffect.Clumsy: from.AddStatMod(new StatMod(StatType.Dex, modName + "LowerDex", -10, TimeSpan.Zero)); from.CheckStatTimers(); from.FixedParticles(0x3779, 10, 15, 5002, EffectLayer.Head); from.PlaySound(0x1df); break; case JewelEffect.Feeblemind: from.AddStatMod(new StatMod(StatType.Int, modName + "LowerInt", -10, TimeSpan.Zero)); from.CheckStatTimers(); from.FixedParticles(0x3779, 10, 15, 5004, EffectLayer.Head); from.PlaySound(0x1e4); break; case JewelEffect.Curse: from.AddStatMod(new StatMod(StatType.Str, modName + "CurseStr", -10, TimeSpan.Zero)); from.AddStatMod(new StatMod(StatType.Dex, modName + "CurseDex", -10, TimeSpan.Zero)); from.AddStatMod(new StatMod(StatType.Int, modName + "CurseInt", -10, TimeSpan.Zero)); from.CheckStatTimers(); from.FixedParticles(0x374a, 10, 15, 5028, EffectLayer.Waist); from.PlaySound(0x1ea); break; case JewelEffect.NightSight: from.EndAction(typeof(LightCycle)); from.BeginAction(typeof(LightCycle)); from.LightLevel = (int)LightCycle.DungeonLevel; from.FixedParticles(0x376a, 9, 32, 5007, EffectLayer.Waist); from.PlaySound(0x1e3); break; case JewelEffect.Invisibility: Effects.SendLocationParticles(EffectItem.Create(new Point3D(from.X, from.Y, from.Z + 16), from.Map, EffectItem.DefaultDuration), 0x376A, 10, 15, 5045); from.PlaySound(0x203); from.Hidden = true; break; case JewelEffect.MagicReflection: from.MagicDamageAbsorb = 15; from.FixedParticles(0x375a, 10, 15, 5037, EffectLayer.Waist); from.PlaySound(0x1e9); break; case JewelEffect.Protection: from.VirtualArmorMod += 10; from.FixedParticles(0x375a, 9, 20, 5016, EffectLayer.Waist); from.PlaySound(0x1ed); break; } ConsumeCharge(from, this); if (m_st != null) { m_st.Stop(); } m_st = new EffectTimer(from, this); m_st.Start(); } }
public void EndHeal() { StopHeal(); int healerNumber = -1, patientNumber = -1; bool playSound = true; bool checkSkills = false; SkillName primarySkill = GetPrimarySkill(m_Patient); SkillName secondarySkill = GetSecondarySkill(m_Patient); BaseCreature petPatient = m_Patient as BaseCreature; bool healDamage = true; bool healThroughPoison = true; double BandageHealThroughPoisonScalar = SpellHelper.HealThroughPoisonScalar; int effectHue = 0; AspectArmorProfile patientAspectArmorProfile = AspectGear.GetAspectArmorProfile(m_Patient); if (!m_Healer.Alive) { healDamage = false; healerNumber = 500962; // You were unable to finish your work before you died. patientNumber = -1; playSound = false; } else if (m_Patient.Hidden && m_Patient != m_Healer) { healDamage = false; m_Healer.SendMessage("You can no longer see your patient."); return; } else if (!m_Healer.InRange(m_Patient, Bandage.Range)) { healDamage = false; healerNumber = 500963; // You did not stay close enough to heal your target. patientNumber = -1; playSound = false; } else if ((SpellHelper.CheckMulti(m_Healer.Location, m_Healer.Map) || SpellHelper.CheckMulti(m_Patient.Location, m_Patient.Map)) && !m_Healer.InLOS(m_Patient)) { healDamage = false; healerNumber = 500963; // You did not stay close enough to heal your target. patientNumber = -1; playSound = false; } else if (!m_Patient.Alive || (petPatient != null && petPatient.IsDeadFollower)) { healDamage = false; double healing = m_Healer.Skills[primarySkill].Value; double anatomy = m_Healer.Skills[secondarySkill].Value; double chance = ((healing - 68.0) / 50.0) - (m_Slips * 0.02); if (((checkSkills = (healing >= 80.0 && anatomy >= 80.0)) && chance > Utility.RandomDouble()) || (Core.SE && petPatient.ControlMaster == m_Healer)) //TODO: Dbl check doesn't check for faction of the horse here? { if (m_Patient.Map == null || !m_Patient.Map.CanFit(m_Patient.Location, 16, false, false)) { healerNumber = 501042; // Target can not be resurrected at that location. patientNumber = 502391; // Thou can not be resurrected there! } else if (ArenaController.GetArenaAtLocation(m_Patient.Location, m_Patient.Map) != null) { healerNumber = 501042; // Target can not be resurrected at that location. patientNumber = 502391; // Thou can not be resurrected there! } else { healerNumber = 500965; // You are able to resurrect your patient. patientNumber = -1; m_Patient.PlaySound(0x214); m_Patient.FixedEffect(0x376A, 10, 16); if (petPatient != null && petPatient.IsDeadFollower) { Mobile master = petPatient.ControlMaster; if (master != null && master.InRange(petPatient, 3)) { healerNumber = 503255; // You are able to resurrect the creature. //TEST: NEW RESSURECT GUMP //master.CloseGump(typeof(PetResurrectGump)); //master.SendGump(new PetResurrectGump(m_Healer, petPatient)); } else { bool found = false; if (!found) { healerNumber = 1049670; // The pet's owner must be nearby to attempt resurrection. } } } else { m_Patient.CloseGump(typeof(ResurrectGump)); m_Patient.SendGump(new ResurrectGump(m_Patient, m_Healer)); } } } else { if (petPatient != null && petPatient.IsDeadFollower) { healerNumber = 503256; // You fail to resurrect the creature. } else { healerNumber = 500966; // You are unable to resurrect your patient. } patientNumber = -1; } } else if (m_Patient.Poisoned) { healDamage = false; m_Healer.SendLocalizedMessage(500969); // You finish applying the bandages. double healing = m_Healer.Skills[primarySkill].Value; double anatomy = m_Healer.Skills[secondarySkill].Value; double chance = ((healing - 30.0) / 50.0) - (m_Patient.Poison.Level * 0.05) - (m_Slips * 0.02); if ((checkSkills = (healing >= 60.0 && anatomy >= 60.0)) && chance > Utility.RandomDouble()) { if (m_Patient.CurePoison(m_Healer)) { healerNumber = (m_Healer == m_Patient) ? -1 : 1010058; // You have cured the target of all poisons. patientNumber = 1010059; // You have been cured of all poisons. } else { healerNumber = -1; patientNumber = -1; } } else { bool cured = false; AspectArmorProfile aspectArmorProfile = AspectGear.GetAspectArmorProfile(m_Patient); //Poison Aspect if (aspectArmorProfile != null) { if (aspectArmorProfile.m_Aspect == AspectEnum.Poison) { double extraCureChance = AspectGear.PoisonCureChanceBonus * (AspectGear.PoisonCureChanceBonusPerTier * (double)aspectArmorProfile.m_TierLevel); if (Utility.RandomDouble() <= extraCureChance) { m_Patient.CurePoison(m_Healer); cured = true; //TEST: Add Aspect Visuals } } } if (!cured) { healerNumber = 1010060; // You have failed to cure your target! patientNumber = -1; } } } else if (m_Patient.Hits == m_Patient.HitsMax) { healDamage = false; healerNumber = 500967; // You heal what little damage your patient had. patientNumber = -1; } if (healDamage) { checkSkills = true; patientNumber = -1; double healing = m_Healer.Skills[primarySkill].Value; double anatomy = m_Healer.Skills[secondarySkill].Value; double chance = ((healing + 20.0) / 100.0) - (m_Slips * 0.02); if (chance >= Utility.RandomDouble()) { healerNumber = 500969; // You finish applying the bandages. double min, max; if (Core.AOS) { min = (anatomy / 8.0) + (healing / 5.0) + 4.0; max = (anatomy / 6.0) + (healing / 2.5) + 4.0; } else { min = (anatomy / 5.0) + (healing / 5.0) + 3.0; max = (anatomy / 5.0) + (healing / 2.0) + 10.0; } double toHeal = min + (Utility.RandomDouble() * (max - min)); if (m_Patient.Body.IsMonster || m_Patient.Body.IsAnimal) { toHeal += m_Patient.HitsMax / 100; } toHeal -= m_Slips * 2.5; PlayerMobile playerHealer = m_Healer as PlayerMobile; if (playerHealer != null) { double superiorHealing = playerHealer.GetSpecialAbilityEntryValue(SpecialAbilityEffect.SuperiorHealing); if (superiorHealing > 0) { toHeal *= superiorHealing; } } if (toHeal < 1) { toHeal = 1; healerNumber = 500968; // You apply the bandages, but they barely help. } int finalHeal = (int)toHeal; m_Patient.Heal(finalHeal, m_Healer, false); } else { healerNumber = 500968; // You apply the bandages, but they barely help. playSound = false; } } if (healerNumber != -1) { m_Healer.SendLocalizedMessage(healerNumber); } if (patientNumber != -1) { m_Patient.SendLocalizedMessage(patientNumber); } if (healThroughPoison) { Effects.PlaySound(m_Healer.Location, m_Healer.Map, 0x64B); Effects.SendLocationParticles(EffectItem.Create(m_Healer.Location, m_Healer.Map, EffectItem.DefaultDuration), 0x376A, 9, 32, effectHue, 0, 5005, 0); } if (playSound) { m_Patient.PlaySound(0x57); } if (checkSkills) { m_Healer.CheckSkill(secondarySkill, 0.0, 120.0, 1.0); m_Healer.CheckSkill(primarySkill, 0.0, 120.0, 1.0); } }
public override void OnComponentUsed(AddonComponent ac, Mobile from) { if (!from.InRange(GetWorldLocation(), 3)) { from.SendMessage("You will have to get closer to drink from the magical pool!"); } else if (m_Uses > 0) { if (m_Pool == 1) // STRENGTH { if (Apply(from, StatType.Str, m_Bonus)) { from.FixedEffect(0x375A, 10, 15); from.PlaySound(Utility.RandomList(0x30, 0x2D6)); from.SendMessage("You feel stronger after drinking from the pool!"); this.m_Uses = this.m_Uses - 1; } } else if (m_Pool == 2) // INTELLECT { if (Apply(from, StatType.Int, m_Bonus)) { from.FixedEffect(0x375A, 10, 15); from.PlaySound(Utility.RandomList(0x30, 0x2D6)); from.SendMessage("You can think much more clearly after drinking from the pool!"); this.m_Uses = this.m_Uses - 1; } } else if (m_Pool == 3) // DEXTERITY { if (Apply(from, StatType.Dex, m_Bonus)) { from.FixedEffect(0x375A, 10, 15); from.PlaySound(Utility.RandomList(0x30, 0x2D6)); from.SendMessage("You feel more nimble after drinking from the pool!"); this.m_Uses = this.m_Uses - 1; } } else if (m_Pool == 4) // CURE { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); if (from.Poisoned) { from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist); from.CurePoison(from); from.SendMessage("You feel much better after drinking from the pool!"); this.m_Uses = this.m_Uses - 1; } else { from.SendMessage("You drink from the pool and nothing happens!"); this.m_Uses = this.m_Uses - 1; } } else if (m_Pool == 5) // HEAL { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); if (from.Hits < from.HitsMax) { if (from.Poisoned || MortalStrike.IsWounded(from)) { from.SendMessage("You drink from the pool and nothing happens!"); this.m_Uses = this.m_Uses - 1; } else { from.FixedParticles(0x373A, 10, 15, 5012, EffectLayer.Waist); int min = 6; int max = 10; if (m_Bonus > 8) { min = 20; max = 30; } else if (m_Bonus > 5) { min = 13; max = 20; } from.Heal(Utility.RandomMinMax(min, max)); from.SendMessage("You drink from the pool and your wounds magically heal!"); this.m_Uses = this.m_Uses - 1; } } else { from.SendMessage("You drink from the pool and nothing happens!"); this.m_Uses = this.m_Uses - 1; } } else if (m_Pool == 6) // WATER ELEMENTAL { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); try { Map map = this.Map; BaseCreature bc = (BaseCreature)Activator.CreateInstance(typeof(WaterElemental)); Point3D spawnLoc = this.Location; for (int i = 0; i < 10; i++) { int x = Location.X + Utility.Random(4); int y = Location.Y + Utility.Random(4); int z = Map.GetAverageZ(x, y); if (Map.CanSpawnMobile(new Point2D(x, y), this.Z)) { spawnLoc = new Point3D(x, y, this.Z); } else if (Map.CanSpawnMobile(new Point2D(x, y), z)) { spawnLoc = new Point3D(x, y, z); } } Timer.DelayCall(TimeSpan.FromSeconds(1), delegate() { bc.Home = Location; bc.RangeHome = 5; bc.FightMode = FightMode.Closest; bc.MoveToWorld(spawnLoc, map); bc.ForceReacquire(); }); } catch { } from.SendMessage("A water elemental emerges from the pool!"); this.m_Uses = this.m_Uses - 1; } else if (m_Pool == 7) // GOLD TO LEAD { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); Container cont = from.Backpack; Gold m_Gold = (Gold)from.Backpack.FindItemByType(typeof(Gold)); int m_Amount = from.Backpack.GetAmount(typeof(Gold)); if (cont.ConsumeTotal(typeof(Gold), m_Amount)) { from.AddToBackpack(new LeadCoin(m_Amount)); from.SendMessage("After drinking from the pool, you notice all of your gold has turned to lead!"); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); } else { from.SendMessage("You drink from the pool and nothing happens!"); } this.m_Uses = this.m_Uses - 1; } else if (m_Pool == 8) // EQUIPPED ITEM DISAPPEARS { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); this.m_Uses = this.m_Uses - 1; int mReturn = 0; if (from.FindItemOnLayer(Layer.OuterTorso) != null) { from.FindItemOnLayer(Layer.OuterTorso).Delete(); } else if (from.FindItemOnLayer(Layer.OneHanded) != null) { from.FindItemOnLayer(Layer.OneHanded).Delete(); } else if (from.FindItemOnLayer(Layer.TwoHanded) != null) { from.FindItemOnLayer(Layer.TwoHanded).Delete(); } else if (from.FindItemOnLayer(Layer.Bracelet) != null) { from.FindItemOnLayer(Layer.Bracelet).Delete(); } else if (from.FindItemOnLayer(Layer.Ring) != null) { from.FindItemOnLayer(Layer.Ring).Delete(); } else if (from.FindItemOnLayer(Layer.Helm) != null) { from.FindItemOnLayer(Layer.Helm).Delete(); } else if (from.FindItemOnLayer(Layer.Arms) != null) { from.FindItemOnLayer(Layer.Arms).Delete(); } else if (from.FindItemOnLayer(Layer.OuterLegs) != null) { from.FindItemOnLayer(Layer.OuterLegs).Delete(); } else if (from.FindItemOnLayer(Layer.Neck) != null) { from.FindItemOnLayer(Layer.Neck).Delete(); } else if (from.FindItemOnLayer(Layer.Gloves) != null) { from.FindItemOnLayer(Layer.Gloves).Delete(); } else if (from.FindItemOnLayer(Layer.Talisman) != null) { from.FindItemOnLayer(Layer.Talisman).Delete(); } else if (from.FindItemOnLayer(Layer.Shoes) != null) { from.FindItemOnLayer(Layer.Shoes).Delete(); } else if (from.FindItemOnLayer(Layer.Cloak) != null) { from.FindItemOnLayer(Layer.OneHanded).Delete(); } else if (from.FindItemOnLayer(Layer.FirstValid) != null) { from.FindItemOnLayer(Layer.FirstValid).Delete(); } else { mReturn = 1; from.SendMessage("You drink from the pool and nothing happens!"); } if (mReturn != 1) { from.SendMessage("After drinking from the pool, you notice one of your equipped items disappears!"); Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); } } else if (m_Pool == 9) // LOSE A STAT POINT { from.PlaySound(Utility.RandomList(0x30, 0x2D6)); this.m_Uses = this.m_Uses - 1; int mCurse = 1; if (m_Bonus > 8) { if (from.RawStr > 10) { from.RawStr = from.RawStr - 1; from.SendMessage("You lose a strength after drinking from the pool!"); } else { from.SendMessage("You drink from the pool and nothing happens!"); mCurse = 0; } } else if (m_Bonus > 5) { if (from.RawDex > 10) { from.RawDex = from.RawDex - 1; from.SendMessage("You lose a dexterity after drinking from the pool!"); } else { from.SendMessage("You drink from the pool and nothing happens!"); mCurse = 0; } } else { if (from.RawInt > 10) { from.RawInt = from.RawInt - 1; from.SendMessage("You lose an intelligence after drinking from the pool!"); } else { from.SendMessage("You drink from the pool and nothing happens!"); mCurse = 0; } } if (mCurse == 1) { from.FixedParticles(0x3779, 1, 15, 9905, 32, 2, EffectLayer.Head); from.FixedParticles(0x37B9, 1, 14, 9502, 32, 5, (EffectLayer)255); } } else if (m_Pool == 100) // TREASURE CHEST { int tType = 1; int tChest = Utility.Random(100); if (tChest > 95) { tType = 6; } else if (tChest > 85) { tType = 5; } else if (tChest > 70) { tType = 4; } else if (tChest > 50) { tType = 3; } else if (tChest > 25) { tType = 2; } from.PlaySound(0x364); from.AddToBackpack(new PoolChest(tType)); from.SendMessage("You pull a mystical chest out from the pool!"); this.m_Uses = 0; } else // POISON { if (from.Poisoned) { from.SendMessage("You are too sick to drink from this pool!"); } else { Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x36B0, 1, 14, 63, 7, 9915, 0); from.PlaySound(Utility.RandomList(0x30, 0x2D6)); if (m_Bonus > 9) { from.ApplyPoison(from, Poison.Deadly); } else if (m_Bonus > 7) { from.ApplyPoison(from, Poison.Greater); } else if (m_Bonus > 4) { from.ApplyPoison(from, Poison.Regular); } else { from.ApplyPoison(from, Poison.Lesser); } from.SendMessage("You feel more sick after drinking from the pool!"); this.m_Uses = this.m_Uses - 1; } } } else { from.SendMessage("The magic from the pool seems to be drained!"); } }
public override void OnResponse(RelayInfo info) { if (!Token.IsChildOf(User.Backpack) || !User.Alive || User.Skills.Total > 2000) { return; } int buttonID = info.ButtonID; if (buttonID == 0) { return; } switch (buttonID) { case 2500: // Edit SetStats(info); break; case 2501: // Continue SetStats(info); if ((Str + Dex + Int) != User.StatCap) { User.SendLocalizedMessage(1152359); // Your Strength, Dexterity, and Intelligence values do not add up to the total indicated in // the upper left area of this window. Before continuing, you must adjust these values so // their total adds up to exactly the displayed value. Please edit your desired attribute // values and click the EDIT button below to continue. } else { Effects.SendLocationParticles(EffectItem.Create(User.Location, User.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(User.Location, User.Map, 0x243); Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(User.X - 6, User.Y - 6, User.Z + 15), User.Map), User, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(User.X - 4, User.Y - 6, User.Z + 15), User.Map), User, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(User.X - 6, User.Y - 4, User.Z + 15), User.Map), User, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendTargetParticles(User, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); foreach (Skill sk in Selected) { sk.Base = 90; } User.RawStr = Str; User.RawDex = Dex; User.RawInt = Int; Token.Delete(); return; } break; default: { if (buttonID >= 5000) { Selected[buttonID - 5000] = null; } else if (!HasAllFive) { SkillName sk = (SkillName)buttonID - 500; for (int i = 0; i < Selected.Length; i++) { if (Selected[i] == null) { Selected[i] = User.Skills[sk]; break; } } } } break; } Refresh(); }
public override void OnResponse(NetState sender, RelayInfo info) { if (info.ButtonID == 0 || m_Stone.IsEmpty) { return; } Mobile from = sender.Mobile; if (!m_Stone.CheckUse(from)) { return; } if (info.ButtonID == 1) // Remove skill points { from.SendGump(new ConfirmRemovalGump(m_Stone)); return; } SkillName skill = m_Stone.Skill; double skillValue = m_Stone.SkillValue; Skill fromSkill = from.Skills[m_Stone.Skill]; /* If we have, say, 88.4 in our skill and the stone holds 100, we need * 11.6 free points. Also, if we're below our skillcap by, say, 8.2 points, * we only need 11.6 - 8.2 = 3.4 points. */ int requiredAmount = (int)(skillValue * 10) - fromSkill.BaseFixedPoint - (from.SkillsCap - from.SkillsTotal); bool cannotAbsorb = false; if (fromSkill.Lock != SkillLock.Up) { cannotAbsorb = true; } else if (requiredAmount > 0) { int available = 0; for (int i = 0; i < from.Skills.Length; ++i) { if (from.Skills[i].Lock != SkillLock.Down) { continue; } available += from.Skills[i].BaseFixedPoint; } if (requiredAmount > available) { cannotAbsorb = true; } } if (cannotAbsorb) { // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER> /* You cannot absorb the selected skill from the Soulstone at this time. The selected * skill may be locked or set to lower in your skill menu. You may also be at your * total skill cap. Click on "Skills" in your paperdoll menu to check your * raise/locked/lower settings and your total skills. Make any needed adjustments, * then click "Continue". If you do not wish to transfer the selected skill at this * time, click "Cancel". */ from.SendGump(new ErrorGump(m_Stone, 1070717, 1070716)); return; } if (skillValue > fromSkill.Cap) { // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER> /* The amount of skill stored in this stone exceeds your individual skill cap for * that skill. In order to retrieve the skill points stored in this stone, you must * obtain a Power Scroll of the appropriate type and level in order to increase your * skill cap. You cannot currently retrieve the skill points stored in this stone. */ from.SendGump(new ErrorGump(m_Stone, 1070717, 1070715)); return; } if (fromSkill.Base >= skillValue) { // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER> /* You cannot transfer the selected skill to the Soulstone at this time. The selected * skill has a skill level higher than what is stored in the Soulstone. */ // Wrong message?! from.SendGump(new ErrorGump(m_Stone, 1070717, 1070802)); return; } #region Scroll of ALacrity PlayerMobile pm = from as PlayerMobile; if (pm.AcceleratedStart > DateTime.Now) { // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER> /*You may not use a soulstone while your character is under the effects of a Scroll of Alacrity.*/ // Wrong message?! from.SendGump(new ErrorGump(m_Stone, 1070717, 1078115)); return; } #endregion if (requiredAmount > 0) { for (int i = 0; i < from.Skills.Length; ++i) { if (from.Skills[i].Lock != SkillLock.Down) { continue; } if (requiredAmount >= from.Skills[i].BaseFixedPoint) { requiredAmount -= from.Skills[i].BaseFixedPoint; from.Skills[i].Base = 0.0; } else { from.Skills[i].BaseFixedPoint -= requiredAmount; break; } } } fromSkill.Base = skillValue; m_Stone.SkillValue = 0.0; from.SendLocalizedMessage(1070713); // You have successfully absorbed the Soulstone's skill points. m_Stone.LastUserName = from.Name; Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x243); Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); if (m_Stone is SoulstoneFragment) { SoulstoneFragment frag = m_Stone as SoulstoneFragment; if (--frag.UsesRemaining <= 0) { from.SendLocalizedMessage(1070974); // You have used up your soulstone fragment. } } }
protected override void OnTick() { if (m_Item.Deleted) { return; } if (!m_Item.Visible) { if (m_InLOS && m_CanFit) { m_Item.Visible = true; } else { m_Item.Delete(); } if (!m_Item.Deleted) { m_Item.ProcessDelta(); Effects.SendLocationParticles(EffectItem.Create(m_Item.Location, m_Item.Map, EffectItem.DefaultDuration), m_Item.ItemID, 9, 10, 5029); } } else if (DateTime.Now > m_Item.m_End) { m_Item.Delete(); Stop(); } else { Map map = m_Item.Map; BaseCreature caster = m_Item.m_Caster; if (map != null && caster != null) { foreach (Mobile m in m_Item.GetMobilesInRange(0)) { if ((m.Z + 16) > m_Item.Z && (m_Item.Z + 12) > m.Z && ValidTarget(caster, m)) { m_Queue.Enqueue(m); } } while (m_Queue.Count > 0) { Mobile m = (Mobile)m_Queue.Dequeue(); if (caster.Name == ("an ice dragon")) { caster.Animate(19, 10, 2, true, false, 0); return; } if (caster.Name == ("a fire dragon")) { caster.Animate(19, 10, 2, true, false, 0); return; } caster.DoHarmful(m); caster.BreathDealDamage(m); caster.AOESpecialEffect(m); /* * int damage = Utility.Random(8) + 3; * * if (!Core.AOS && m.CheckSkill(SkillName.MagicResist, 0.0, 30.0)) * { * damage = 1; * * m.SendLocalizedMessage(501783); // You feel yourself resisting magical energy. * } * * AOS.Damage(m, caster, damage, 0, 0, 100, 0, 0); */ m.PlaySound(0x15); } } } }
public override void OnDoubleClick(Mobile from) { if (from.Talisman != this) { from.SendLocalizedMessage(502641); // You must equip this item to use it. } else if (m_ChargeTime > 0) { from.SendLocalizedMessage(1074882, m_ChargeTime.ToString()); // You must wait ~1_val~ seconds for this to recharge. } else if (m_Charges == 0 && m_MaxCharges > 0) { from.SendLocalizedMessage(1042544); // This item is out of charges. } else { Type type = GetSummoner(); if (m_Summoner != null && !m_Summoner.IsEmpty) { type = m_Summoner.Type; } if (type != null) { object obj; try { obj = Activator.CreateInstance(type); } catch { obj = null; } if (obj is Item) { Item item = (Item)obj; int count = 1; if (m_Summoner != null && m_Summoner.Amount > 1) { if (item.Stackable) { item.Amount = m_Summoner.Amount; } else { count = m_Summoner.Amount; } } if (from.Backpack == null || count * item.Weight > from.Backpack.MaxWeight || from.Backpack.Items.Count + count > from.Backpack.MaxItems) { from.SendLocalizedMessage(500720); // You don't have enough room in your backpack! item.Delete(); item = null; return; } for (int i = 0; i < count; i++) { from.PlaceInBackpack(item); if (i + 1 < count) { item = Activator.CreateInstance(type) as Item; } } if (item is Board) { from.SendLocalizedMessage(1075000); // You have been given some wooden boards. } else if (item is IronIngot) { from.SendLocalizedMessage(1075001); // You have been given some ingots. } else if (item is Bandage) { from.SendLocalizedMessage(1075002); // You have been given some clean bandages. } else if (m_Summoner.Name != null) { from.SendLocalizedMessage(1074853, m_Summoner.Name.ToString()); // You have been given ~1_name~ } } else if (obj is BaseCreature) { BaseCreature mob = (BaseCreature)obj; if (from.Followers + mob.ControlSlots > from.FollowersMax) { from.SendLocalizedMessage(1074270); // You have too many followers to summon another one. mob.Delete(); return; } BaseCreature.Summon(mob, from, from.Location, mob.BaseSoundID, TimeSpan.FromMinutes(30)); Effects.SendLocationParticles(EffectItem.Create(mob.Location, mob.Map, EffectItem.DefaultDuration), 0x3728, 1, 10, 0x26B6); mob.Summoned = false; mob.ControlOrder = OrderType.Friend; m_Creature = mob; } } if (m_Removal != TalismanRemoval.None) { from.Target = new TalismanTarget(this); } } }
public void Use(Mobile from, bool firstStage) { if (Deleted) { return; } if (SkillCheck.HasAnyAcceleratedSkillGain(from)) { from.SendLocalizedMessage(1077951); // You are already under the effect of an accelerated skillgain scroll. return; } if (IsChildOf(from.Backpack)) { Skill skill = from.Skills[m_Skill]; if (skill != null) { if (firstStage) { from.CloseGump <ScrollOfTranscendence.InternalGump>(); from.SendGump(BuildGump(from, this)); } else { // calculamos las skills que puede bajar double potentialFreeSkill = 0; for (int i = 0; i < from.Skills.Length; i++) { Skill sk = from.Skills[i]; if (sk.Lock == SkillLock.Down) { potentialFreeSkill += sk.Base; } } if (skill.Lock == SkillLock.Locked || skill.Lock == SkillLock.Down || skill.Base >= skill.Cap || from.Skills.Total - (10 * potentialFreeSkill) >= from.Skills.Cap) { from.SendLocalizedMessage(1094935); // You cannot increase this skill at this time. The skill may be locked or set to lower in your skill menu. If you are at your total skill cap, you must use a Powerscroll to increase your current skill cap. } else { double toRaise = Math.Min(m_Value, skill.Cap - skill.Base); // bajamos las skills que necesitemos, o las que podamos bajar double toFree = toRaise - ((double)(from.Skills.Cap - from.Skills.Total) / 10); if (toFree < 0.0) { toFree = 0.0; } for (int i = 0; i < from.Skills.Length && toFree > 0; i++) { Skill sk = from.Skills[i]; if (sk.Lock == SkillLock.Down) { if (sk.Base > toFree) { sk.Base -= toFree; toFree = 0; } else { toFree -= sk.Base; sk.Base = 0; } } } toRaise -= toFree; skill.Base += toRaise; Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x243); Effects.SendMovingParticles(new DummyEntity(Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new DummyEntity(Serial.Zero, new Point3D(from.X - 4, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendMovingParticles(new DummyEntity(Serial.Zero, new Point3D(from.X - 6, from.Y - 4, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); Delete(); } } } } else { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } }
public virtual void DoEffect(Point3D loc, Map map) { Effects.SendLocationParticles(EffectItem.Create(loc, map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052); Effects.PlaySound(loc, map, 0x225); }
public bool Teleport(Mobile from) { if (Factions.Sigil.ExistsOn(from)) { from.SendLocalizedMessage(1061632); // You can't do that while carrying the sigil. return(false); } else if (Server.Misc.WeightOverloading.IsOverloaded(from)) { from.SendLocalizedMessage(502359, "", 0x22); // Thou art too encumbered to move. return(false); } else if (!SpellHelper.CheckTravel(from, TravelCheckType.TeleportFrom)) { return(false); } else if (!SpellHelper.CheckTravel(from, MapDest, PointDest, TravelCheckType.TeleportTo)) { return(false); } else if (MapDest == null) { from.SendLocalizedMessage(501942); // That location is blocked. return(false); } else if (SpellHelper.CheckMulti(PointDest, MapDest)) { from.SendLocalizedMessage(502831); // Cannot teleport to that spot. return(false); } else { Mobile m = from; bool sendEffect = (!m.Hidden || m.AccessLevel == AccessLevel.Player); if (sendEffect) { Effects.SendLocationParticles(EffectItem.Create(Location, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 2023); Effects.SendLocationParticles(EffectItem.Create(PointDest, m.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023); } else { m.FixedParticles(0x376A, 9, 32, 0x13AF, EffectLayer.Waist); } m.PlaySound(0x1FE); IPooledEnumerable eable = m.GetItemsInRange(0); foreach (Item item in eable) { if (item is Server.Spells.Sixth.ParalyzeFieldSpell.InternalItem || item is Server.Spells.Fifth.PoisonFieldSpell.InternalItem || item is Server.Spells.Fourth.FireFieldSpell.FireFieldItem) { item.OnMoveOver(m); } } eable.Free(); DoTeleport(m); m.ProcessDelta(); return(true); } }
public void SendStoneEffects(StoneEffect mStoneEffect, int effHue, Mobile m) { if (effHue > 0) { effHue--; //Adjust the friggin hue to match true effect color } switch (mStoneEffect) { //[s7] case StoneEffect.Gate: Effects.SendLocationParticles(EffectItem.Create(m.Location, m.Map, EffectItem.DefaultDuration), 0x1FCB, 10, 14, effHue, 0, 0x1FCB, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x20E); m.Frozen = true; Timer.DelayCall(TimeSpan.FromSeconds(0.65), new TimerStateCallback(InternalShowGate), new object[] { m, effHue }); Timer.DelayCall(TimeSpan.FromSeconds(1.5), new TimerStateCallback(InternalHideGate), new object[] { m, effHue }); break; //[/s7] case StoneEffect.FlameStrike1: Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208); break; case StoneEffect.FlameStrike3: Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 6), m.Map, 0x3709, 15, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 6), m.Map, 0x3709, 15, effHue, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208); break; case StoneEffect.Snow: Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x376A, 15, effHue, 0); //0x47D ); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 492); break; case StoneEffect.FlameStrikeLightningBolt: Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x208); Effects.SendBoltEffect(m, true, 0); break; case StoneEffect.Sparkle1: Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x375A, 15, effHue, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x213); break; case StoneEffect.Sparkle3: Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x373A, 15, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x373A, 15, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z - 1), m.Map, 0x373A, 15, effHue, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x213); break; case StoneEffect.Explosion: Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x36BD, 15, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x36BD, 15, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x307); break; case StoneEffect.ExplosionLightningBolt: Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x36BD, 15, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x36BD, 15, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x36BD, 15, effHue, 0); Effects.SendBoltEffect(m, true, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x307); break; case StoneEffect.DefaultRunUO: Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 4), m.Map, 0x3728, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x3728, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z - 4), m.Map, 0x3728, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 4), m.Map, 0x3728, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x3728, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z - 4), m.Map, 0x3728, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 11), m.Map, 0x3728, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 7), m.Map, 0x3728, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 3), m.Map, 0x3728, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3728, 13, effHue, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x228); break; case StoneEffect.Glow: Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z), m.Map, 0x37C4, 15, effHue, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x1E2); break; case StoneEffect.PoisonField: Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z), m.Map, 0x3915, 15, effHue, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x231); break; case StoneEffect.Fireball: Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 6), m.Map, 0x36D4, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x36D4, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z + 6), m.Map, 0x36D4, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 8), m.Map, 0x36D4, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x36D4, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z + 6), m.Map, 0x36D4, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 11), m.Map, 0x36D4, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 8), m.Map, 0x36D4, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y + 1, m.Z + 10), m.Map, 0x36D4, 13, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z + 1), m.Map, 0x3709, 15, effHue, 0); Effects.PlaySound(new Point3D(m.X, m.Y, m.Z), m.Map, 0x15E); break; case StoneEffect.FireStorm1: //Added By Nitewender (further modifed by me to carry color effect to timer m.PlaySound(520); m.PlaySound(525); m.Hidden = !m.Hidden; Effects.SendLocationEffect(new Point3D(m.X + 1, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X - 1, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 1, m.Z), m.Map, 0x3709, 17, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y - 1, m.Z), m.Map, 0x3709, 17, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0); m_Timer = new FireStormTimer(DateTime.UtcNow, m, effHue, 0, 1); m_Timer.Start(); break; case StoneEffect.FireStorm2: //CEO Using above idea, this one does the firestorm outside->in m.PlaySound(520); m.PlaySound(525); Effects.SendLocationEffect(new Point3D(m.X + 5, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X - 5, m.Y, m.Z), m.Map, 0x3709, 17, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y + 5, m.Z), m.Map, 0x3709, 17, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X, m.Y - 5, m.Z), m.Map, 0x3709, 17, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X + 5, m.Y - 5, m.Z), m.Map, 0x3709, 17, effHue, 0); Effects.SendLocationEffect(new Point3D(m.X - 5, m.Y + 5, m.Z), m.Map, 0x3709, 17, effHue, 0); m_Timer = new FireStormTimer(DateTime.UtcNow, m, effHue, 5, -1); m_Timer.Start(); break; } }
public override void OnResponse(NetState sender, RelayInfo info) { if (info.ButtonID == 0 || m_Stone.IsEmpty) { return; } Mobile from = sender.Mobile; if (!m_Stone.CheckUse(from)) { return; } if (info.ButtonID == 1) // Remove skill points { from.SendGump(new ConfirmRemovalGump(m_Stone)); return; } double skillValue = m_Stone.SkillValue; Skill fromSkill = from.Skills[m_Stone.Skill]; if (fromSkill.Lock != SkillLock.Up || (from.SkillsTotal - fromSkill.BaseFixedPoint + ((int)skillValue * 10) > from.SkillsCap)) { // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER> /* You cannot absorb the selected skill from the Soulstone at this time. The selected * skill may be locked or set to lower in your skill menu. You may also be at your * total skill cap. Click on "Skills" in your paperdoll menu to check your * raise/locked/lower settings and your total skills. Make any needed adjustments, * then click "Continue". If you do not wish to transfer the selected skill at this * time, click "Cancel". */ from.SendGump(new ErrorGump(m_Stone, 1070717, 1070716)); return; } if (skillValue > fromSkill.Cap) { // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER> /* The amount of skill stored in this stone exceeds your individual skill cap for * that skill. In order to retrieve the skill points stored in this stone, you must * obtain a Power Scroll of the appropriate type and level in order to increase your * skill cap. You cannot currently retrieve the skill points stored in this stone. */ from.SendGump(new ErrorGump(m_Stone, 1070717, 1070715)); return; } if (fromSkill.Base >= skillValue) { // <CENTER>Unable to Absorb Selected Skill from Soulstone</CENTER> /* You cannot transfer the selected skill to the Soulstone at this time. The selected * skill has a skill level higher than what is stored in the Soulstone. */ // Wrong message?! from.SendGump(new ErrorGump(m_Stone, 1070717, 1070802)); return; } fromSkill.Base = skillValue; m_Stone.SkillValue = 0.0; m_Stone.NextUse = DateTime.Now + UseDelay; from.SendLocalizedMessage(1070713); // You have successfully absorbed the Soulstone's skill points. Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0, 0, 0, 0, 0, 5060, 0); Effects.PlaySound(from.Location, from.Map, 0x243); Effects.SendMovingParticles(new Entity(Server.Serial.Zero, new Point3D(from.X - 6, from.Y - 6, from.Z + 15), from.Map), from, 0x36D4, 7, 0, false, true, 0x497, 0, 9502, 1, 0, (EffectLayer)255, 0x100); Effects.SendTargetParticles(from, 0x375A, 35, 90, 0x00, 0x00, 9502, (EffectLayer)255, 0x100); }
public FreeTimer(EffectItem item, TimeSpan delay) : base(delay) { m_Item = item; Priority = TimerPriority.OneSecond; }
private void DoEffect() { Effects.SendLocationParticles( EffectItem.Create( Location, Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 ); Effects.PlaySound( Location, Map, 0x225 ); }
public FreeTimer( EffectItem item, TimeSpan delay ) : base( delay ) { m_Item = item; Priority = TimerPriority.OneSecond; }
public void Detonate() { Point3D location = Location; Map map = Map; if (!SpecialAbilities.Exists(m_Owner)) { return; } Mobile owner = m_Owner; Effects.PlaySound(Location, Map, 0x306); int radius = m_Radius; int minRange = radius * -1; int maxRange = radius; int minDamage = m_MinDamage; int maxDamage = m_MaxDamage; for (int a = minRange; a < maxRange + 1; a++) { for (int b = minRange; b < maxRange + 1; b++) { Point3D newPoint = new Point3D(location.X + a, location.Y + b, location.Z); newPoint.Z = map.GetSurfaceZ(newPoint, 30); int distance = Utility.GetDistance(location, newPoint); double effectChance = .95 - ((double)distance * .05); if (Utility.RandomDouble() > effectChance) { continue; } Timer.DelayCall(TimeSpan.FromSeconds(distance * .10), delegate { int impactItemId = 0x3709; int impactHue = 2074; if (Utility.RandomDouble() <= .75) { LavaField lavaField = new LavaField(null, 0, 1, m_LavaDuration, m_LavaMinDamage, m_LavaMaxDamage, false, false, true, -1, true); lavaField.MoveToWorld(newPoint, map); } else { Effects.PlaySound(newPoint, map, 0x5CF); Effects.SendLocationParticles(EffectItem.Create(newPoint, map, EffectItem.DefaultDuration), impactItemId, 20, 20, impactHue, 0, 0, 0); IPooledEnumerable mobilesOnTile = map.GetMobilesInRange(newPoint, 0); if (!SpecialAbilities.Exists(owner)) { return; } Queue m_Queue = new Queue(); foreach (Mobile mobile in mobilesOnTile) { if (m_Owner == mobile) { continue; } if (!SpecialAbilities.MonsterCanDamage(m_Owner, mobile)) { continue; } m_Queue.Enqueue(mobile); } mobilesOnTile.Free(); while (m_Queue.Count > 0) { double damage = Utility.RandomMinMax(minDamage, maxDamage); Mobile mobile = (Mobile)m_Queue.Dequeue(); if (mobile is BaseCreature) { damage *= 2; } int finalDamage = (int)(Math.Round((double)damage)); new Blood().MoveToWorld(mobile.Location, mobile.Map); AOS.Damage(mobile, m_Owner, finalDamage, 100, 0, 0, 0, 0); } } }); } } Delete(); }