예제 #1
0
        public override void OnTrigger(Mobile from)
        {
            if (!from.Player || !from.Alive || from.AccessLevel > AccessLevel.Player)
            {
                return;
            }

            if (Server.Misc.SeeIfGemInBag.GemInPocket(from) == true || Server.Misc.SeeIfJewelInBag.JewelInPocket(from) == true)
            {
                return;
            }

            if (HiddenTrap.CheckTrapAvoidance(from, this) == 0)
            {
                return;
            }

            if (!from.Player)
            {
                return;
            }

            Effects.SendLocationEffect(Location, Map, 0x1D99, 48, 2, GetEffectHue(), 0);

            if (from.Alive && CheckRange(from.Location, 0) && from.Player)
            {
                int itHurts = (int)((Utility.RandomMinMax(50, 200) * (100 - from.PhysicalResistance)) / 100);
                Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), from, from, itHurts);
            }

            LoggingFunctions.LogTraps(from, "a giant spike trap");
        }
예제 #2
0
        public override void OnTrigger(Mobile from)
        {
            if (!from.Alive || !from.Player || from.AccessLevel > AccessLevel.Player)
            {
                return;
            }

            if (Server.Misc.SeeIfGemInBag.GemInPocket(from) == true || Server.Misc.SeeIfJewelInBag.JewelInPocket(from) == true)
            {
                return;
            }

            if (HiddenTrap.CheckTrapAvoidance(from, this) == 0)
            {
                return;
            }

            if (!from.Player)
            {
                return;
            }

            Effects.PlaySound(Location, Map, 0x359);

            Breathing = true;

            Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerCallback(FinishBreath));
            Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerCallback(TriggerDamage));

            LoggingFunctions.LogTraps(from, "a trapped stone face");
        }
예제 #3
0
        public override void OnTrigger(Mobile from)
        {
            if (!from.Alive || !from.Player || from.AccessLevel > AccessLevel.Player)
            {
                return;
            }

            if (Server.Misc.SeeIfGemInBag.GemInPocket(from) == true)
            {
                return;
            }

            if (HiddenTrap.CheckTrapAvoidance(from, this) == 0)
            {
                return;
            }

            if (!from.Player)
            {
                return;
            }

            Effects.SendLocationEffect(Location, Map, GetBaseID(this.Type) + 1, 6, 3, GetEffectHue(), 0);
            Effects.PlaySound(Location, Map, 0x21C);

            int itHurts = (int)((Utility.RandomMinMax(50, 200) * (100 - from.PhysicalResistance)) / 100);

            Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), from, from, itHurts);      // WIZARD

            from.LocalOverheadMessage(MessageType.Regular, 0x22, 500853);               // You stepped onto a blade trap!

            LoggingFunctions.LogTraps(from, "a sawing blade trap");
        }
예제 #4
0
        public override bool OnMoveOver(Mobile m)
        {
            if (!m.Alive || !m.Player || m.AccessLevel > AccessLevel.Player)
            {
                return(true);
            }

            if (m is PlayerMobile && Spells.Research.ResearchAirWalk.UnderEffect(m))
            {
                Point3D air = new Point3D((m.X + 1), (m.Y + 1), (m.Z + 5));
                Effects.SendLocationParticles(EffectItem.Create(air, m.Map, EffectItem.DefaultDuration), 0x2007, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(m, 0), 0, 5022, 0);
                m.PlaySound(0x014);
                return(true);
            }

            if (m.Player && m.Alive && (HiddenTrap.CheckTrapAvoidance(m, this) > 0))
            {
                CheckTimer();

                int itHurts = (int)((Utility.RandomMinMax(50, 200) * (100 - m.FireResistance)) / 100);
                m.Damage(itHurts, m);
                Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), m, m, itHurts);
                m.PlaySound(m.Female ? 0x327 : 0x437);

                LoggingFunctions.LogTraps(m, "a spouting flame trap");
            }

            return(false);
        }
예제 #5
0
        public override void OnTrigger(Mobile from)
        {
            if (!from.Alive || !from.Player || from.AccessLevel > AccessLevel.Player)
            {
                return;
            }

            if (Server.Misc.SeeIfGemInBag.GemInPocket(from) == true || Server.Misc.SeeIfJewelInBag.JewelInPocket(from) == true)
            {
                return;
            }

            if (HiddenTrap.CheckTrapAvoidance(from, this) == 0)
            {
                return;
            }

            if (!from.Player)
            {
                return;
            }

            if (from is PlayerMobile && Spells.Research.ResearchAirWalk.UnderEffect(from))
            {
                Point3D air = new Point3D((from.X + 1), (from.Y + 1), (from.Z + 5));
                Effects.SendLocationParticles(EffectItem.Create(air, from.Map, EffectItem.DefaultDuration), 0x2007, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(from, 0), 0, 5022, 0);
                from.PlaySound(0x014);
                return;
            }

            Effects.SendLocationEffect(Location, Map, GetBaseID(this.Type) + 1, 18, 3, GetEffectHue(), 0);
            Effects.PlaySound(Location, Map, 0x22C);

            int itHurts = 0;

            foreach (Mobile mob in GetMobilesInRange(0))
            {
                if (mob.Alive && !mob.IsDeadBondedPet && mob.Player)
                {
                    itHurts = (int)((Utility.RandomMinMax(50, 200) * (100 - mob.PhysicalResistance)) / 100);
                    Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), mob, mob, itHurts);
                }
            }

            Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerCallback(OnSpikeExtended));

            from.LocalOverheadMessage(MessageType.Regular, 0x22, 500852);               // You stepped onto a spike trap!

            LoggingFunctions.LogTraps(from, "a spike trap");
        }
예제 #6
0
        public override void OnTrigger(Mobile from)
        {
            if (!from.Alive || !from.Player || from.AccessLevel > AccessLevel.Player)
            {
                return;
            }

            if (Server.Misc.SeeIfGemInBag.GemInPocket(from) == true || Server.Misc.SeeIfJewelInBag.JewelInPocket(from) == true)
            {
                return;
            }

            if (HiddenTrap.CheckTrapAvoidance(from, this) == 0)
            {
                return;
            }

            if (!from.Player)
            {
                return;
            }

            if (from is PlayerMobile && Spells.Research.ResearchAirWalk.UnderEffect(from))
            {
                Point3D air = new Point3D((from.X + 1), (from.Y + 1), (from.Z + 5));
                Effects.SendLocationParticles(EffectItem.Create(air, from.Map, EffectItem.DefaultDuration), 0x2007, 9, 32, Server.Items.CharacterDatabase.GetMySpellHue(from, 0), 0, 5022, 0);
                from.PlaySound(0x014);
                return;
            }

            if (WarningFlame)
            {
                DoEffect();
            }

            if (from.Alive && from.Player && CheckRange(from.Location, 0))
            {
                int itHurts = (int)((Utility.RandomMinMax(50, 200) * (100 - from.FireResistance)) / 100);
                Spells.SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, from, itHurts, 0, 100, 0, 0, 0);

                if (!WarningFlame)
                {
                    DoEffect();
                }

                LoggingFunctions.LogTraps(from, "a fire column trap");
            }
        }
예제 #7
0
        public override void OnTrigger(Mobile from)
        {
            if (!from.Alive || !from.Player || from.AccessLevel > AccessLevel.Player)
            {
                return;
            }

            if (Server.Misc.SeeIfGemInBag.GemInPocket(from) == true)
            {
                return;
            }

            if (HiddenTrap.CheckTrapAvoidance(from, this) == 0)
            {
                return;
            }

            if (!from.Player)
            {
                return;
            }

            Effects.SendLocationEffect(Location, Map, GetBaseID(this.Type) + 1, 18, 3, GetEffectHue(), 0);
            Effects.PlaySound(Location, Map, 0x22C);

            int itHurts = 0;

            foreach (Mobile mob in GetMobilesInRange(0))
            {
                if (mob.Alive && !mob.IsDeadBondedPet && mob.Player)
                {
                    itHurts = (int)((Utility.RandomMinMax(50, 200) * (100 - mob.PhysicalResistance)) / 100);
                    Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), mob, mob, itHurts);
                }
            }

            Timer.DelayCall(TimeSpan.FromSeconds(1.0), new TimerCallback(OnSpikeExtended));

            from.LocalOverheadMessage(MessageType.Regular, 0x22, 500852);               // You stepped onto a spike trap!

            LoggingFunctions.LogTraps(from, "a spike trap");
        }
예제 #8
0
        public override bool OnMoveOver(Mobile m)
        {
            if (!m.Alive || !m.Player || m.AccessLevel > AccessLevel.Player)
            {
                return(true);
            }

            if (m.Player && m.Alive && (HiddenTrap.CheckTrapAvoidance(m, this) > 0))
            {
                CheckTimer();

                int itHurts = (int)((Utility.RandomMinMax(50, 200) * (100 - m.FireResistance)) / 100);
                m.Damage(itHurts, m);
                Spells.SpellHelper.Damage(TimeSpan.FromTicks(1), m, m, itHurts);
                m.PlaySound(m.Female ? 0x327 : 0x437);

                LoggingFunctions.LogTraps(m, "a spouting flame trap");
            }

            return(false);
        }
예제 #9
0
        public override void OnTrigger(Mobile from)
        {
            if (!from.Alive || !from.Player || from.AccessLevel > AccessLevel.Player)
            {
                return;
            }

            if (Server.Misc.SeeIfGemInBag.GemInPocket(from) == true)
            {
                return;
            }

            if (HiddenTrap.CheckTrapAvoidance(from, this) == 0)
            {
                return;
            }

            if (!from.Player)
            {
                return;
            }

            if (WarningFlame)
            {
                DoEffect();
            }

            if (from.Alive && from.Player && CheckRange(from.Location, 0))
            {
                int itHurts = (int)((Utility.RandomMinMax(50, 200) * (100 - from.FireResistance)) / 100);
                Spells.SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, from, itHurts, 0, 100, 0, 0, 0);

                if (!WarningFlame)
                {
                    DoEffect();
                }

                LoggingFunctions.LogTraps(from, "a fire column trap");
            }
        }
예제 #10
0
        public override void OnTrigger(Mobile from)
        {
            if (!from.Alive || !from.Player || ItemID != 0x1A81 || from.AccessLevel > AccessLevel.Player)
            {
                return;
            }

            if (Server.Misc.SeeIfGemInBag.GemInPocket(from) == true || Server.Misc.SeeIfJewelInBag.JewelInPocket(from) == true)
            {
                return;
            }

            if (HiddenTrap.CheckTrapAvoidance(from, this) == 0)
            {
                return;
            }

            if (!from.Player)
            {
                return;
            }

            ItemID = 0x1126;
            Effects.PlaySound(Location, Map, 0x306);

            int itHurts = 0;

            switch (ShroomType)
            {
            case 1:

                itHurts = (int)((Utility.RandomMinMax(40, 200) * (100 - from.PhysicalResistance)) / 100);
                Spells.SpellHelper.Damage(TimeSpan.FromSeconds(0.5), from, from, itHurts);
                from.FixedParticles(0x36BD, 20, 10, 5044, EffectLayer.Head);
                from.PlaySound(0x307);
                from.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "A mushroom exploded near you!");

                break;

            case 2:
                int itSicks = 5;

                if (from.PoisonResistance >= 70)
                {
                    itSicks = 1;
                }
                else if (from.PoisonResistance >= 50)
                {
                    itSicks = 2;
                }
                else if (from.PoisonResistance >= 30)
                {
                    itSicks = 3;
                }
                else if (from.PoisonResistance >= 10)
                {
                    itSicks = 4;
                }

                switch (Utility.RandomMinMax(1, itSicks))
                {
                case 1: from.ApplyPoison(from, Poison.Lesser);        break;

                case 2: from.ApplyPoison(from, Poison.Regular);       break;

                case 3: from.ApplyPoison(from, Poison.Greater);       break;

                case 4: from.ApplyPoison(from, Poison.Deadly);        break;

                case 5: from.ApplyPoison(from, Poison.Lethal);        break;
                }

                Effects.SendLocationEffect(this.Location, this.Map, 0x11A8 - 2, 16, 3, 0, 0);
                Effects.PlaySound(this.Location, this.Map, 0x231);
                from.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "A mushroom released odd spores!");

                break;

            case 3:

                from.BoltEffect(0);
                itHurts = (int)((Utility.RandomMinMax(40, 200) * (100 - from.EnergyResistance)) / 100);
                from.Damage(itHurts, from);
                from.LocalOverheadMessage(MessageType.Emote, 0xB1F, true, "A mushroom released strange energy!");

                break;
            }

            Timer.DelayCall(TimeSpan.FromSeconds(2.0), new TimerCallback(OnMushroomReset));

            LoggingFunctions.LogTraps(from, "a strange mushroom");
        }
예제 #11
0
        public override void OnComponentUsed(AddonComponent ac, Mobile from)
        {
            if (from.Blessed)
            {
                from.SendMessage("You cannot drink from the pool while in this state.");
            }
            else 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)                   // GAIN STATS
                {
                    if (from.StatCap > (from.RawStatTotal))
                    {
                        from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        int water = Utility.RandomMinMax(1, 3);
                        int up    = 1;

                        int chance = Utility.RandomMinMax(1, 100);

                        if (chance >= 98)
                        {
                            up = AvailPoints(from, 5);
                        }
                        else if (chance >= 87)
                        {
                            up = AvailPoints(from, 4);
                        }
                        else if (chance >= 75)
                        {
                            up = AvailPoints(from, 3);
                        }
                        else if (chance >= 50)
                        {
                            up = AvailPoints(from, 2);
                        }

                        if (water == 1)
                        {
                            from.RawInt = from.RawInt + up; from.SendMessage("You drink from the pool and you feel much smarter!");
                        }
                        else if (water == 2)
                        {
                            from.RawStr = from.RawStr + up; from.SendMessage("You drink from the pool and you feel much stronger!");
                        }
                        else
                        {
                            from.RawDex = from.RawDex + up; from.SendMessage("You drink from the pool and you feel much quicker!");
                        }

                        this.m_Uses = 0;
                    }
                    else
                    {
                        from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        from.SendMessage("You drink from the pool and nothing happens!");
                        this.m_Uses = this.m_Uses - 1;
                    }
                }
                else if (m_Pool == 2)                   // 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.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        from.SendMessage("You drink from the pool and nothing happens!");
                        this.m_Uses = this.m_Uses - 1;
                    }
                }
                else if (m_Pool == 3)                   // 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 = 50;
                            int max = 75;
                            if (m_Bonus > 8)
                            {
                                min = 125; max = 175;
                            }
                            else if (m_Bonus > 5)
                            {
                                min = 75; max = 125;
                            }
                            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.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        from.SendMessage("You drink from the pool and nothing happens!");
                        this.m_Uses = this.m_Uses - 1;
                    }
                }
                else if (m_Pool == 4)                   // 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 == 5)                   // GOLD TO LEAD
                {
                    from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                    Container cont  = from.Backpack;
                    int       nDull = 0;

                    int m_gAmount = from.Backpack.GetAmount(typeof(Gold));
                    int m_cAmount = from.Backpack.GetAmount(typeof(DDCopper));
                    int m_sAmount = from.Backpack.GetAmount(typeof(DDSilver));
                    int m_xAmount = from.Backpack.GetAmount(typeof(DDXormite));

                    if (cont.ConsumeTotal(typeof(Gold), m_gAmount))
                    {
                        from.AddToBackpack(new LeadCoin(m_gAmount));
                        nDull = 1;
                    }
                    if (cont.ConsumeTotal(typeof(DDCopper), m_cAmount))
                    {
                        from.AddToBackpack(new LeadCoin(m_cAmount));
                        nDull = 1;
                    }
                    if (cont.ConsumeTotal(typeof(DDSilver), m_sAmount))
                    {
                        from.AddToBackpack(new LeadCoin(m_sAmount));
                        nDull = 1;
                    }
                    if (cont.ConsumeTotal(typeof(DDXormite), m_xAmount))
                    {
                        from.AddToBackpack(new LeadCoin(m_xAmount));
                        nDull = 1;
                    }
                    if (nDull > 0)
                    {
                        from.SendMessage("After drinking from the pool, you notice all of your coins has turned to lead!");
                        Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                        LoggingFunctions.LogGenericQuest(from, "had all of their coins turn to lead after drinking from a strange pool");
                    }
                    else
                    {
                        from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                        from.SendMessage("You drink from the pool and nothing happens!");
                    }
                    this.m_Uses = this.m_Uses - 1;
                }
                else if (m_Pool == 6)                   // EQUIPPED ITEM DISAPPEARS
                {
                    from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                    this.m_Uses = this.m_Uses - 1;
                    int  mReturn = 0;
                    Item ILost   = HiddenTrap.GetMyItem(from);
                    if (ILost != null)
                    {
                        ILost.Delete(); mReturn = 1;
                    }
                    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);

                        LoggingFunctions.LogGenericQuest(from, "had an item vanish after drinking from a strange pool");
                    }
                }
                else if (m_Pool == 7)                   // 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 feel weaker 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 feel sluggish 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("Your mind is foggy 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 == 8)                   // TREASURE CHEST
                {
                    from.PlaySound(0x364);
                    from.SendMessage("You pull a mystical chest out from the pool!");
                    this.m_Uses = 0;
                    LootChest MyChest = new LootChest(6);
                    MyChest.ItemID = Utility.RandomList(0x2823, 0x2824, 0x4FE6, 0x4FE7, 0x281F, 0x2820);
                    MyChest.Hue    = Utility.RandomList(0x961, 0x962, 0x963, 0x964, 0x965, 0x966, 0x967, 0x968, 0x969, 0x96A, 0x96B, 0x96C, 0x96D, 0x96E, 0x96F, 0x970, 0x971, 0x972, 0x973, 0x974, 0x975, 0x976, 0x977, 0x978, 0x979, 0x97A, 0x97B, 0x97C, 0x97D, 0x97E, 0x4AA);
                    Region reg = Region.Find(from.Location, from.Map);
                    MyChest.Name = "mystical chest from " + Server.Misc.Worlds.GetRegionName(from.Map, from.Location);
                    int xTraCash = Utility.RandomMinMax(5000, 8000);
                    ContainerFunctions.AddGoldToContainer(xTraCash, MyChest, 0, from);
                    int artychance = GetPlayerInfo.LuckyPlayerArtifacts(from.Luck) + 10;
                    if (Utility.RandomMinMax(0, 100) < artychance)
                    {
                        Item arty = ArtifactBuilder.CreateArtifact("random");
                        MyChest.DropItem(arty); BaseContainer.DropItemFix(arty, from, MyChest.ItemID, MyChest.GumpID);
                    }
                    from.AddToBackpack(MyChest);

                    LoggingFunctions.LogGenericQuest(from, "found a chest full of treasure in some strange pool");
                }
                else if (m_Pool == 9)                   // COPPER SILVER TO GOLD
                {
                    from.PlaySound(Utility.RandomList(0x30, 0x2D6));
                    Container cont   = from.Backpack;
                    int       nShine = 0;

                    int m_cAmount = from.Backpack.GetAmount(typeof(DDCopper));
                    int m_sAmount = from.Backpack.GetAmount(typeof(DDSilver));
                    int m_dAmount = from.Backpack.GetAmount(typeof(LeadCoin));

                    if (cont.ConsumeTotal(typeof(DDCopper), m_cAmount))
                    {
                        from.AddToBackpack(new Gold(m_cAmount));
                        nShine = 1;
                    }
                    if (cont.ConsumeTotal(typeof(DDSilver), m_sAmount))
                    {
                        from.AddToBackpack(new Gold(m_sAmount));
                        nShine = 1;
                    }
                    if (cont.ConsumeTotal(typeof(LeadCoin), m_dAmount))
                    {
                        from.AddToBackpack(new Gold(m_dAmount));
                        nShine = 1;
                    }
                    if (nShine > 0)
                    {
                        from.SendMessage("After drinking from the pool, you notice your meager coins turn to gold!");
                        Effects.SendLocationParticles(EffectItem.Create(from.Location, from.Map, EffectItem.DefaultDuration), 0x3728, 10, 10, 5023);

                        LoggingFunctions.LogGenericQuest(from, "had all of their meager coins turn to gold after drinking from a strange pool");
                    }
                    else
                    {
                        from.SendMessage("You drink from the pool and nothing happens!");
                    }
                    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!");
            }
        }
예제 #12
0
        public override void OnTrigger(Mobile from)
        {
            if (m_Poison == null || !from.Player || !from.Alive || from.AccessLevel > AccessLevel.Player)
            {
                return;
            }

            if (Server.Misc.SeeIfGemInBag.GemInPocket(from) == true || Server.Misc.SeeIfJewelInBag.JewelInPocket(from) == true)
            {
                return;
            }

            if (HiddenTrap.CheckTrapAvoidance(from, this) == 0)
            {
                return;
            }

            if (!from.Player)
            {
                return;
            }

            Effects.SendLocationEffect(Location, Map, GetBaseID(this.Type) - 2, 16, 3, GetEffectHue(), 0);
            Effects.PlaySound(Location, Map, 0x231);

            int itHurts = from.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_Poison = Poison.Lesser;       break;

            case 2: m_Poison = Poison.Regular;      break;

            case 3: m_Poison = Poison.Greater;      break;

            case 4: m_Poison = Poison.Deadly;       break;

            case 5: m_Poison = Poison.Lethal;       break;
            }

            from.ApplyPoison(from, m_Poison);

            from.LocalOverheadMessage(MessageType.Regular, 0x22, 500855);               // You are enveloped by a noxious gas cloud!

            LoggingFunctions.LogTraps(from, "a poison gas trap");
        }