Ejemplo n.º 1
0
        private static Item GetRandomSpecial(int level, Map map)
        {
            Item special;

            switch (Utility.Random(8))
            {
            default:
            case 0: special = new CreepingVine(); break;

            case 1: special = new MessageInABottle(); break;

            case 2: special = new ScrollofAlacrity(PowerScroll.Skills[Utility.Random(PowerScroll.Skills.Count)]); break;

            case 3: special = new Skeletonkey(); break;

            case 4: special = new TastyTreat(5); break;

            case 5: special = new TreasureMap(Utility.RandomMinMax(level, Math.Min(7, level + 1)), map); break;

            case 6: special = GetRandomRecipe(); break;

            case 7: special = ScrollofTranscendence.CreateRandom(1, 5); break;
            }

            return(special);
        }
Ejemplo n.º 2
0
 public BinderWarningGump(double value, ScrollBinderDeed binder, ScrollofTranscendence scroll, int needed)
 {
     m_Value  = value;
     m_Needed = needed;
     m_Scroll = scroll;
     m_Binder = binder;
 }
Ejemplo n.º 3
0
            public InternalGump(Mobile mobile, ScrollofTranscendence scroll)
                : base(25, 50)
            {
                m_Mobile = mobile;
                m_Scroll = scroll;

                AddPage(0);

                AddBackground(25, 10, 420, 200, 5054);

                AddImageTiled(33, 20, 401, 181, 2624);
                AddAlphaRegion(33, 20, 401, 181);

                AddHtmlLocalized(40, 48, 387, 100, 1094933, true, true);              /*Using a Scroll of Transcendence for a given skill will permanently increase your current
                                                                                       * level in that skill by the amount of points displayed on the scroll.
                                                                                       * As you may not gain skills beyond your maximum skill cap, any excess points will be lost.*/

                AddHtmlLocalized(125, 148, 200, 20, 1049478, 0xFFFFFF, false, false); // Do you wish to use this scroll?

                AddButton(100, 172, 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(135, 172, 120, 20, 1046362, 0xFFFFFF, false, false); // Yes

                AddButton(275, 172, 4005, 4007, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(310, 172, 120, 20, 1046363, 0xFFFFFF, false, false); // No

                double value = scroll.m_Value;

                AddHtml(40, 20, 260, 20, String.Format("<basefont color=#FFFFFF>Scroll of Transcendence ({0} Skill):</basefont>", value), false, false);

                AddHtmlLocalized(310, 20, 120, 20, 1044060 + (int)scroll.m_Skill, 0xFFFFFF, false, false);
            }
Ejemplo n.º 4
0
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)1);

            writer.WriteEncodedInt((int)m_Entries.Count);

            for (int i = 0; i < m_Entries.Count; ++i)
            {
                ScrollofTranscendence scroll = m_Entries[i] as ScrollofTranscendence;
                int skill = (int)scroll.Skill;
                writer.WriteEncodedInt(skill);
                double amount = scroll.Value;
                writer.Write(amount);
            }
        }
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			int count = reader.ReadEncodedInt();

			m_Entries = new ArrayList( count );

			for ( int i = 0; i < count; ++i )
			{
				SkillName skill = (SkillName)reader.ReadEncodedInt();
				double amount = reader.ReadDouble();
                ScrollofTranscendence scroll = new ScrollofTranscendence(skill,amount);
				m_Entries.Add(scroll);
			}
		}
Ejemplo n.º 6
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            int count = reader.ReadEncodedInt();

            m_Entries = new ArrayList(count);

            for (int i = 0; i < count; ++i)
            {
                SkillName             skill  = (SkillName)reader.ReadEncodedInt();
                double                amount = reader.ReadDouble();
                ScrollofTranscendence scroll = new ScrollofTranscendence(skill, amount);
                m_Entries.Add(scroll);
            }
        }
Ejemplo n.º 7
0
        public ScrollofTranscendenceBookGump(Mobile from, ScrollofTranscendenceBook book)
            : base(0, 0)
        {
            m_From = from;
            m_Book = book;

            y = (m_Book.Entries.Count - 1) * 50;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;
            AddPage(0);
            AddBackground(10, 50, 230, 113 + y, 9250);
            AddImageTiled(24, 65, 200, 85 + y, 2053);
            AddAlphaRegion(24, 65, 200, 85 + y);
            AddImageTiled(24, 87, 200, 10, 9264);
            AddImageTiled(24, 120, 200, 10, 9264);
            AddImageTiled(105, 95, 3, 55 + y, 9264);
            AddImageTiled(179, 95, 3, 55 + y, 9264);

            AddLabel(37, 65, 190, "Scroll of Transcendence Book");
            AddLabel(30, 100, 199, "Skill");
            AddLabel(110, 100, 199, "Value");
            AddLabel(185, 100, 199, "Drop");

            int y2      = 0;
            int butNumb = 1;

            for (int i = 0; i < m_Book.Entries.Count; i++)
            {
                ScrollofTranscendence scroll = m_Book.Entries[i] as ScrollofTranscendence;
                AddLabel(25, 130 + y2, 195, scroll.Skill.ToString());
                AddLabel(110, 130 + y2, 195, scroll.Value.ToString());
                AddButton(195, 133 + y2, 1209, 1210, butNumb, GumpButtonType.Reply, 0);
                y2 += 50;
                butNumb++;
            }
        }
Ejemplo n.º 8
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            if (dropped is ScrollofTranscendence)
            {
                if (!IsChildOf(from.Backpack))
                {
                    from.SendMessage("Book must be in your backpack to use it.");
                    return(false);
                }
                else if (m_Entries.Count < 20)                  //will hold 20
                {
                    ScrollofTranscendence scroll = (ScrollofTranscendence)dropped;
                    this.Entries.Add(scroll);

                    InvalidateProperties();

                    from.SendMessage(" Scroll was added to the book.");

                    if (from is PlayerMobile)
                    {
                        from.CloseGump(typeof(ScrollofTranscendenceBookGump));
                        from.SendGump(new ScrollofTranscendenceBookGump(from, this));
                    }

                    dropped.Delete();
                    return(true);
                }
                else
                {
                    from.SendMessage("The book is full.");
                    return(false);
                }
            }

            from.SendMessage("That is not a Scroll of Transcendence.");
            return(false);
        }
Ejemplo n.º 9
0
			public BinderWarningGump(double value, ScrollBinderDeed binder, ScrollofTranscendence scroll, int needed)
			{
				m_Value = value;
				m_Needed = needed;
				m_Scroll = scroll;
				m_Binder = binder;
			}
Ejemplo n.º 10
0
        public TreasureMapChest(Mobile owner, int level, bool temporary) : base(0xE40)
        {
            level = level + 4;
            if (level > 10)
            {
                level = 10;
            }

            m_Owner      = owner;
            m_Level      = level;
            m_DeleteTime = DateTime.UtcNow + TimeSpan.FromHours(3.0);

            m_Temporary = temporary;
            m_Guardians = new List <Mobile>();

            m_Timer = new DeleteTimer(this, m_DeleteTime);
            m_Timer.Start();

            Movable = false;
            Locked  = true;

            if (level > 0)
            {
                ContainerFunctions.FillTheContainer(level, this, owner);
            }
            if (level > 3)
            {
                ContainerFunctions.FillTheContainer(level, this, owner);
            }
            if (level > 7)
            {
                ContainerFunctions.FillTheContainer(level, this, owner);
            }
            if (GetPlayerInfo.LuckyPlayer(owner.Luck))
            {
                ContainerFunctions.FillTheContainer(level, this, owner);
            }

            ContainerFunctions.LockTheContainer(level, this, 1);

            int xTraCash = Utility.RandomMinMax((level * 700), (level * 1000));

            ContainerFunctions.AddGoldToContainer(xTraCash, this, 0);

            string sChest = "grand treasure chest";

            switch (level)
            {
            case 0: sChest = "meager treasure chest";               break;

            case 1: sChest = "simple treasure chest";               break;

            case 2: sChest = "good treasure chest";                 break;

            case 3: sChest = "great treasure chest";                break;

            case 4: sChest = "excellent treasure chest";    break;

            case 5: sChest = "superb treasure chest";               break;
            }

            Name = ContainerFunctions.GetOwner("Treasure Chest");
            Name = "the " + sChest + " of " + Name;

            // = SCROLL OF TRANCENDENCE
            if (level >= 4 && Utility.RandomDouble() > 0.9)
            {
                DropItem(ScrollofTranscendence.CreateRandom(level, level * 5));
            }

            // = ARTIFACTS
            int artychance = GetPlayerInfo.LuckyPlayerArtifacts(owner.Luck);

            if (Utility.RandomMinMax(0, 100) < ((level * 17) + artychance))
            {
                Item arty = ArtifactBuilder.CreateArtifact("random");
                DropItem(arty);
            }

            // = SCROLL OF ALACRITY or POWERSCROLL
            if (level > 1)
            {
                if (Utility.RandomDouble() < (0.02 + (level / 200)))
                {
                    SkillName WhatS = (SkillName)Utility.Random(SkillInfo.Table.Length);
                    DropItem(PowerScroll.CreateRandomNoCraft(5, 5));
                }
                else if (Utility.RandomDouble() < 0.075)
                {
                    SkillName WhatS = (SkillName)Utility.Random(SkillInfo.Table.Length);
                    DropItem(new ScrollofAlacrity(WhatS));
                }
            }

            int  giveRelics = level;
            Item relic      = Loot.RandomRelic();

            while (giveRelics > 0)
            {
                relic = Loot.RandomRelic();
                ContainerFunctions.RelicValueIncrease(level, relic);
                DropItem(relic);
                giveRelics = giveRelics - 1;
            }
        }
Ejemplo n.º 11
0
        public void OnTarget(Mobile from, object targeted)
        {
            if (targeted is Item && !((Item)targeted).IsChildOf(from.Backpack))
            {
                from.SendMessage("The scroll must be in your backpack to bind.");
                return;
            }

            switch (m_BinderType)
            {
            case BinderType.None:
            {
                if (targeted is PowerScroll)
                {
                    PowerScroll ps = (PowerScroll)targeted;

                    if (ps.Value >= 120)
                    {
                        from.SendLocalizedMessage(1113144);                                     //This scroll is already the highest of its type and cannot be bound.
                    }
                    else
                    {
                        double value  = ps.Value;
                        int    needed = 0;
                        if (value == 105)
                        {
                            needed = 8;
                        }
                        else if (value == 110)
                        {
                            needed = 12;
                        }
                        else if (value == 115)
                        {
                            needed = 10;
                        }
                        else
                        {
                            return;
                        }

                        m_Value      = value;
                        m_Needed     = needed;
                        m_Has        = 1;
                        m_Skill      = ps.Skill;
                        m_BinderType = BinderType.PowerScroll;
                        ps.Delete();
                        from.SendMessage("Binding Powerscroll.");
                        from.PlaySound(0x249);
                    }
                }
                else if (targeted is StatCapScroll)
                {
                    StatCapScroll ps = (StatCapScroll)targeted;

                    if (ps.Value >= 250)
                    {
                        from.SendLocalizedMessage(1113144);                                     //This scroll is already the highest of its type and cannot be bound.
                    }
                    else
                    {
                        double value  = ps.Value;
                        int    needed = 0;
                        if (value == 230)
                        {
                            needed = 6;
                        }
                        else if (value == 235)
                        {
                            needed = 8;
                        }
                        else if (value == 240)
                        {
                            needed = 8;
                        }
                        else if (value == 245)
                        {
                            needed = 5;
                        }
                        else
                        {
                            return;
                        }

                        m_Value      = value;
                        m_Needed     = needed;
                        m_Has        = 1;
                        m_BinderType = BinderType.StatScroll;
                        ps.Delete();
                        from.SendMessage("Binding Stat Scroll.");
                        from.PlaySound(0x249);
                    }
                }
                else if (targeted is ScrollofTranscendence)
                {
                    ScrollofTranscendence sot = (ScrollofTranscendence)targeted;

                    m_Skill      = sot.Skill;
                    m_BinderType = BinderType.SOT;
                    m_Needed     = 5;
                    m_Has        = sot.Value;
                    sot.Delete();
                    from.SendLocalizedMessage(1113146);         //Binding Scrolls of Transcendence
                    from.PlaySound(0x249);
                }
                else
                {
                    from.SendLocalizedMessage(1113142);                                     //You may only bind powerscrolls, stats scrolls or scrolls of transcendence.
                }
                break;
            }

            case BinderType.PowerScroll:
            {
                if (targeted is PowerScroll)
                {
                    PowerScroll ps = (PowerScroll)targeted;

                    if (ps.Value == m_Value)
                    {
                        if (ps.Skill == m_Skill)
                        {
                            m_Has++;

                            if (m_Has >= m_Needed)
                            {
                                GiveItem(from, new PowerScroll(m_Skill, m_Value + 5));
                                from.SendLocalizedMessage(1113145);                                                 //You've completed your binding and received an upgraded version of your scroll!
                                ps.Delete();
                                Delete();
                            }
                            else
                            {
                                ps.Delete();
                                from.PlaySound(0x249);
                                from.SendMessage("Binding Powerscroll.");
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(1113143);         //This scroll does not match the type currently being bound.
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1113143);                                         //This scroll does not match the type currently being bound.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1113143);                                     //This scroll does not match the type currently being bound.
                }
                break;
            }

            case BinderType.StatScroll:
            {
                if (targeted is StatCapScroll)
                {
                    StatCapScroll stat = (StatCapScroll)targeted;

                    if (stat.Value == m_Value)
                    {
                        m_Has++;

                        if (m_Has >= m_Needed)
                        {
                            GiveItem(from, new StatCapScroll((int)m_Value + 5));
                            from.SendLocalizedMessage(1113145);                                             //You've completed your binding and received an upgraded version of your scroll!
                            stat.Delete();
                            Delete();
                        }
                        else
                        {
                            from.SendMessage("Binding Stat Scroll.");
                            from.PlaySound(0x249);
                            stat.Delete();
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1113143);                                         //This scroll does not match the type currently being bound.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1113143);                                 //This scroll does not match the type currently being bound.
                }
                break;
            }

            case BinderType.SOT:
            {
                if (targeted is ScrollofTranscendence)
                {
                    ScrollofTranscendence sot = (ScrollofTranscendence)targeted;

                    if (sot.Skill == m_Skill)
                    {
                        double newValue = sot.Value + m_Has;

                        if (newValue == m_Needed)
                        {
                            GiveItem(from, new ScrollofTranscendence(m_Skill, m_Needed));
                            from.SendLocalizedMessage(1113145);                                             //You've completed your binding and received an upgraded version of your scroll!
                            Delete();
                        }
                        else if (newValue > m_Needed)
                        {
                            from.SendGump(new BinderWarningGump(newValue, this, sot, m_Needed));
                        }
                        else
                        {
                            m_Has += sot.Value;
                            sot.Delete();
                            from.PlaySound(0x249);
                            from.SendLocalizedMessage(1113146);         //Binding Scrolls of Transcendence
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(1113143);                                         //This scroll does not match the type currently being bound.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1113143);         //This scroll does not match the type currently being bound.
                }
                break;
            }
            }

            InvalidateProperties();
        }
Ejemplo n.º 12
0
            public InternalGump(Mobile mobile, ScrollofTranscendence scroll)
                : base(25, 50)
            {
                m_Mobile = mobile;
                m_Scroll = scroll;

                AddPage(0);

                AddBackground(25, 10, 420, 200, 5054);

                AddImageTiled(33, 20, 401, 181, 2624);
                AddAlphaRegion(33, 20, 401, 181);

                AddHtmlLocalized(40, 48, 387, 100, 1094933, true, true); /*Using a Scroll of Transcendence for a given skill will permanently increase your current 
                                                                          *level in that skill by the amount of points displayed on the scroll.
                                                                          *As you may not gain skills beyond your maximum skill cap, any excess points will be lost.*/

                AddHtmlLocalized(125, 148, 200, 20, 1049478, 0xFFFFFF, false, false); // Do you wish to use this scroll?

                AddButton(100, 172, 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddHtmlLocalized(135, 172, 120, 20, 1046362, 0xFFFFFF, false, false); // Yes

                AddButton(275, 172, 4005, 4007, 0, GumpButtonType.Reply, 0);
                AddHtmlLocalized(310, 172, 120, 20, 1046363, 0xFFFFFF, false, false); // No

                double value = scroll.m_Value;

                AddHtml(40, 20, 260, 20, String.Format("<basefont color=#FFFFFF>Scroll of Transcendence ({0} Skill):</basefont>", value), false, false);

                AddHtmlLocalized(310, 20, 120, 20, 1044060 + (int)scroll.m_Skill, 0xFFFFFF, false, false);
            }
        public static void Fill(LockableContainer cont, int level)
        {
            bool isFelucca = (cont.Map == Map.Felucca);
            bool inTokuno  = (cont.Map == Map.Tokuno);
            bool SoS       = false;

            if (cont.IsShipwreckedItem == true)
            {
                SoS = true;
            }

            cont.Movable = false;
            cont.Locked  = true;
            int numberItems;

            if (level == 0)
            {
                cont.LockLevel = 0; // Can't be unlocked

                cont.DropItem(new Gold(Utility.RandomMinMax(500, 1000)));

                if (Utility.RandomDouble() < 0.75)
                {
                    cont.DropItem(new TreasureMap(0, Map.Trammel));
                }
            }
            else
            {
                cont.TrapType  = TrapType.ExplosionTrap;
                cont.TrapPower = level * 25;
                cont.TrapLevel = level;

                // = Chest Lock Levels (~40% to open at cont.RequiredSkill / 100% at cont.MaxLockLevel)
                switch (level)
                {
                case 1: cont.RequiredSkill = 5; cont.LockLevel = -25; cont.MaxLockLevel = 55; break;

                case 2: cont.RequiredSkill = 45; cont.LockLevel = 25; cont.MaxLockLevel = 75; break;

                case 3: cont.RequiredSkill = 65; cont.LockLevel = 45; cont.MaxLockLevel = 95; break;

                case 4: cont.RequiredSkill = 75; cont.LockLevel = 55; cont.MaxLockLevel = 105; break;

                case 5: cont.RequiredSkill = 75; cont.LockLevel = 55; cont.MaxLockLevel = 105; break;

                case 6: cont.RequiredSkill = 80; cont.LockLevel = 60; cont.MaxLockLevel = 110; break;

                case 7: cont.RequiredSkill = 80; cont.LockLevel = 60; cont.MaxLockLevel = 110; break;
                }

                // = GOLD PIECES
                cont.DropItem(new Gold(level * 5000));

                // = TREASURE MAP or MiB
                if (!SoS)
                {
                    if (Utility.RandomDouble() < 0.2)
                    {
                        cont.DropItem(new TreasureMap(level, MapItem.GetRandomFacet()));
                    }
                    else if ((level < 7) && (Utility.RandomDouble() < 0.025))
                    {
                        cont.DropItem(new TreasureMap(level + 1, MapItem.GetRandomFacet()));
                    }
                    else if (Utility.RandomDouble() > 0.8)
                    {
                        if (Utility.RandomDouble() > 0.5)
                        {
                            cont.DropItem(new MessageInABottle(Map.Felucca));
                        }
                        else
                        {
                            cont.DropItem(new MessageInABottle(Map.Trammel));
                        }
                    }
                }
                else if (!SoS)
                {
                    int soslvl = Utility.Random(level) + 1;

                    if (Utility.RandomDouble() < 0.2)
                    {
                        cont.DropItem(new TreasureMap(soslvl, MapItem.GetRandomFacet()));
                    }
                }

                // = LEVEL 8 ARCANE SCROLLS
                for (int i = 0; i < level; ++i)
                {
                    cont.DropItem(Loot.RandomScroll(57, 64, SpellbookType.Regular));
                }

                // = MAGIC ITEMS
                Item item;

                numberItems = 24 + (level * 8);
                for (int i = 0; i < numberItems; ++i)
                {
                    if (Core.AOS)
                    {
                        item = Loot.RandomArmorOrShieldOrWeaponOrJewelry(inTokuno);
                    }
                    else
                    {
                        item = Loot.RandomArmorOrShieldOrWeapon(inTokuno);
                    }

                    if (item is BaseWeapon)
                    {
                        BaseWeapon weapon = (BaseWeapon)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(level, out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(weapon, attributeCount, min, max);
                        }
                        else
                        {
                            weapon.DamageLevel     = (WeaponDamageLevel)Utility.Random(6);
                            weapon.AccuracyLevel   = (WeaponAccuracyLevel)Utility.Random(6);
                            weapon.DurabilityLevel = (WeaponDurabilityLevel)Utility.Random(6);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseArmor)
                    {
                        BaseArmor armor = (BaseArmor)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(level, out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(armor, attributeCount, min, max);
                        }
                        else
                        {
                            armor.ProtectionLevel = (ArmorProtectionLevel)Utility.Random(6);
                            armor.Durability      = (ArmorDurabilityLevel)Utility.Random(6);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseHat)
                    {
                        BaseHat hat = (BaseHat)item;

                        if (Core.AOS)
                        {
                            int attributeCount;
                            int min, max;

                            GetRandomAOSStats(level, out attributeCount, out min, out max);

                            BaseRunicTool.ApplyAttributesTo(hat, attributeCount, min, max);
                        }

                        cont.DropItem(item);
                    }
                    else if (item is BaseJewel)
                    {
                        int attributeCount;
                        int min, max;

                        GetRandomAOSStats(level, out attributeCount, out min, out max);

                        BaseRunicTool.ApplyAttributesTo((BaseJewel)item, attributeCount, min, max);

                        cont.DropItem(item);
                    }
                }
            }

            // = REAGENTS
            int reagents;

            if (level == 0)
            {
                reagents = 10;
            }
            else
            {
                reagents = 3 + level;
            }

            for (int i = 0; i < reagents; i++)
            {
                Item itr = Loot.RandomPossibleReagent();
                itr.Amount = Utility.RandomMinMax(40, 60);
                cont.DropItem(itr);
            }
            // = STACK OF GEMS
            int gems;

            if (level == 0)
            {
                gems = 3;
            }
            else
            {
                gems = 1 + level * 3;
            }

            Item itg  = new Citrine();
            int  rndG = Utility.Random(9) + 1;

            if (rndG == 1)
            {
                itg = new Amber(gems);
            }
            if (rndG == 2)
            {
                itg = new Amethyst(gems);
            }
            if (rndG == 3)
            {
                itg = new Citrine(gems);
            }
            if (rndG == 4)
            {
                itg = new Diamond(gems);
            }
            if (rndG == 5)
            {
                itg = new Emerald(gems);
            }
            if (rndG == 6)
            {
                itg = new Ruby(gems);
            }
            if (rndG == 7)
            {
                itg = new Sapphire(gems);
            }
            if (rndG == 8)
            {
                itg = new StarSapphire(gems);
            }
            if (rndG == 9)
            {
                itg = new Tourmaline(gems);
            }
            cont.DropItem(itg);

            // = SCROLL OF ALACRITY or POWERSCROLL
            if (level > 1)
            {
                if (Utility.RandomDouble() < (0.02 + (level / 200)))
                {
                    SkillName WhatS = (SkillName)Utility.Random(SkillInfo.Table.Length);
                    cont.DropItem(PowerScroll.CreateRandomNoCraft(5, 5));
                }
                else if (Utility.RandomDouble() < 0.075)
                {
                    SkillName WhatS = (SkillName)Utility.Random(SkillInfo.Table.Length);
                    cont.DropItem(new ScrollofAlacrity(WhatS));
                }
            }

            // = SCROLL OF TRANCENDENCE
            if (level >= 4 && isFelucca && Utility.RandomDouble() > 0.9)
            {
                cont.DropItem(ScrollofTranscendence.CreateRandom(level, level * 5));
            }

            // = CREEPING VINES
            if (!SoS && Utility.RandomDouble() < 0.075)
            {
                cont.DropItem(new CreepingVines());
            }

            // = ILSHENAR LESSER ARTIFACT
            if (level >= 6 && Core.AOS)
            {
                cont.DropItem((Item)Activator.CreateInstance(m_Artifacts[Utility.Random(m_Artifacts.Length)]));
            }

            // = SKELETON KEY
            if (level < 7)
            {
                if (!SoS && Utility.RandomDouble() > (0.92 - (level / 100)))
                {
                    cont.DropItem(new SFSkeletonKey());
                }
            }
            // = [LVL 7] = MASTER SKELETON KEY
            if (level == 7)
            {
                if (Utility.RandomDouble() < 0.10)
                {
                    cont.DropItem(new SFMasterSkeletonKey());
                }
            }
        }
Ejemplo n.º 14
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            int bp;            //button pushed

            switch (info.ButtonID)
            {
            case 1: bp = 0; break;

            case 2: bp = 1; break;

            case 3: bp = 2; break;

            case 4: bp = 3; break;

            case 5: bp = 4; break;

            case 6: bp = 5; break;

            case 7: bp = 6; break;

            case 8: bp = 7; break;

            case 9: bp = 8; break;

            case 10: bp = 9; break;

            case 11: bp = 10; break;

            case 12: bp = 11; break;

            case 13: bp = 12; break;

            case 14: bp = 13; break;

            case 15: bp = 14; break;

            case 16: bp = 15; break;

            case 17: bp = 16; break;

            case 18: bp = 17; break;

            case 19: bp = 18; break;

            case 20: bp = 19; break;

            case 21: bp = 20; break;

            case 22: bp = 21; break;

            case 23: bp = 22; break;

            case 24: bp = 23; break;

            case 25: bp = 24; break;

            case 26: bp = 25; break;

            case 27: bp = 26; break;

            case 28: bp = 27; break;

            case 29: bp = 28; break;

            case 30: bp = 29; break;

            case 31: bp = 30; break;

            case 32: bp = 31; break;

            case 33: bp = 32; break;

            case 34: bp = 33; break;

            case 35: bp = 34; break;

            case 36: bp = 35; break;

            case 37: bp = 36; break;

            case 38: bp = 37; break;

            case 39: bp = 38; break;

            case 40: bp = 39; break;

            case 41: bp = 40; break;

            case 42: bp = 41; break;

            case 43: bp = 42; break;

            case 44: bp = 43; break;

            case 45: bp = 44; break;

            case 46: bp = 45; break;

            case 47: bp = 46; break;

            case 48: bp = 47; break;

            case 49: bp = 48; break;

            case 50: bp = 49; break;

            default: return;
            }

            ScrollofTranscendence scroll = m_Book.Entries[bp] as ScrollofTranscendence;
            SkillName             sklnm  = scroll.Skill;
            double sklval = scroll.Value;
            ScrollofTranscendence newScroll = new ScrollofTranscendence(sklnm, sklval);

            m_From.AddToBackpack(newScroll);
            m_Book.Entries.RemoveAt(bp);
            m_Book.InvalidateProperties();
        }
		public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
		{
			int bp;//button pushed
			switch(info.ButtonID)
			{
				case 1:bp = 0;break;
				case 2:bp = 1;break;
				case 3:bp = 2;break;
				case 4:bp = 3;break;
				case 5:bp = 4;break;
				case 6:bp = 5;break;
				case 7:bp = 6;break;
				case 8:bp = 7;break;
				case 9:bp = 8;break;
				case 10:bp = 9;break;
				case 11:bp = 10;break;
				case 12:bp = 11;break;
				case 13:bp = 12;break;
				case 14:bp = 13;break;
				case 15:bp = 14;break;
				case 16:bp = 15;break;
				case 17:bp = 16;break;
				case 18:bp = 17;break;
				case 19:bp = 18;break;
				case 20:bp = 19;break;
                case 21:bp = 20;break;
                case 22: bp = 21; break;
                case 23: bp = 22; break;
                case 24: bp = 23; break;
                case 25: bp = 24; break;
                case 26: bp = 25; break;
                case 27: bp = 26; break;
                case 28: bp = 27; break;
                case 29: bp = 28; break;
                case 30: bp = 29; break;
                case 31: bp = 30; break;
                case 32: bp = 31; break;
                case 33: bp = 32; break;
                case 34: bp = 33; break;
                case 35: bp = 34; break;
                case 36: bp = 35; break;
                case 37: bp = 36; break;
                case 38: bp = 37; break;
                case 39: bp = 38; break;
                case 40: bp = 39; break;
                case 41: bp = 40; break;
                case 42: bp = 41; break;
                case 43: bp = 42; break;
                case 44: bp = 43; break;
                case 45: bp = 44; break;
                case 46: bp = 45; break;
                case 47: bp = 46; break;
                case 48: bp = 47; break;
                case 49: bp = 48; break;
                case 50: bp = 49; break;
				default: return;
			}

            ScrollofTranscendence scroll = m_Book.Entries[bp] as ScrollofTranscendence;
			SkillName sklnm = scroll.Skill;
			double sklval = scroll.Value;
            ScrollofTranscendence newScroll = new ScrollofTranscendence(sklnm, sklval);
			m_From.AddToBackpack(newScroll);
			m_Book.Entries.RemoveAt(bp);
			m_Book.InvalidateProperties();
		}
Ejemplo n.º 16
0
        public static void GiveScrollOfTranscendenceFelTo(Mobile killer, ScrollofTranscendence SoTF)
        {
            if (SoTF == null || killer == null)	//sanity
                return;

            killer.SendLocalizedMessage(1094936); // You have received a Scroll of Transcendence!

            if (killer.Alive)
                killer.AddToBackpack(SoTF);
            else
            {
                if (killer.Corpse != null && !killer.Corpse.Deleted)
                    killer.Corpse.DropItem(SoTF);
                else
                    killer.AddToBackpack(SoTF);
            }


            // Justice reward
            PlayerMobile pm = (PlayerMobile)killer;
            for (int j = 0; j < pm.JusticeProtectors.Count; ++j)
            {
                Mobile prot = (Mobile)pm.JusticeProtectors[j];
                if (prot.Map != killer.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion(killer, prot))
                    continue;

                int chance = 0;

                switch (VirtueHelper.GetLevel(prot, VirtueName.Justice))
                {
                    case VirtueLevel.Seeker: chance = 60; break;
                    case VirtueLevel.Follower: chance = 80; break;
                    case VirtueLevel.Knight: chance = 100; break;
                }

                if (chance > Utility.Random(100))
                {
                    prot.SendLocalizedMessage(1049368); // You have been rewarded for your dedication to Justice!
                    ScrollofTranscendence SoTFduplicate = new ScrollofTranscendence(SoTF.Skill, SoTF.Value);
                    prot.AddToBackpack(SoTFduplicate);
                }
            }
        }
Ejemplo n.º 17
0
        public static void GiveTramTranscendenceScrollTo(Mobile m, ScrollofTranscendence st)
        {
            if (st == null || m == null)	//sanity
                return;

            m.SendLocalizedMessage(1094936); // You have received a Scroll of Transcendence!

            if (!Core.SE || m.Alive)
                m.AddToBackpack(st);
            else
            {
                if (m.Corpse != null && !m.Corpse.Deleted)
                    m.Corpse.DropItem(st);
                else
                    m.AddToBackpack(st);
            }

            if (m is PlayerMobile)
            {
                PlayerMobile pm = (PlayerMobile)m;

                for (int j = 0; j < pm.JusticeProtectors.Count; ++j)
                {
                    Mobile prot = pm.JusticeProtectors[j];

                    if (prot.Map != m.Map || prot.Kills >= 5 || prot.Criminal || !JusticeVirtue.CheckMapRegion(m, prot))
                        continue;

                    int chance = 0;

                    switch (VirtueHelper.GetLevel(prot, VirtueName.Justice))
                    {
                        case VirtueLevel.Seeker: chance = 60; break;
                        case VirtueLevel.Follower: chance = 80; break;
                        case VirtueLevel.Knight: chance = 100; break;
                    }

                    if (chance > Utility.Random(100))
                    {
                        ScrollofTranscendence scrollofTranscendence = new ScrollofTranscendence(st.Skill, st.Value);

                        prot.SendLocalizedMessage(1049368); // You have been rewarded for your dedication to Justice!

                        if (!Core.SE || prot.Alive)
                            prot.AddToBackpack(scrollofTranscendence);
                        else
                        {
                            if (prot.Corpse != null && !prot.Corpse.Deleted)
                                prot.Corpse.DropItem(scrollofTranscendence);
                            else
                                prot.AddToBackpack(scrollofTranscendence);
                        }
                    }
                }
            }
        }