public InternalGump( Mobile mobile, SpecialScroll 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, m_Scroll.Message, true, true );

				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
				
				if ( m_Scroll.Title != 0 )
					AddHtmlLocalized( 40, 20, 260, 20, m_Scroll.Title, 0xFFFFFF, false, false );
				else
					AddHtml( 40, 20, 260, 20, m_Scroll.DefaultTitle, false, false );

				//if ( m_Scroll is StatCapScroll )
				//	AddHtmlLocalized( 310, 20, 120, 20, 1038019, 0xFFFFFF, false, false ); // Power
				//else
					AddHtmlLocalized( 310, 20, 120, 20, 1044060 + (int)m_Scroll.Skill, 0xFFFFFF, false, false );
			}
Example #2
0
        public virtual void Construct(Mobile m, SkillName sk, double value)
        {
            SpecialScroll scroll = Items.OfType <SpecialScroll>().FirstOrDefault(s => s.Skill == sk && s.Value == value);

            if (scroll != null)
            {
                if (m.Backpack == null || !m.Backpack.TryDropItem(m, scroll, false))
                {
                    m.SendLocalizedMessage(502868); // Your backpack is too full.
                }
                else
                {
                    BaseHouse house = BaseHouse.FindHouseAt(this);

                    if (house != null && house.LockDowns.ContainsKey(scroll))
                    {
                        house.LockDowns.Remove(scroll);
                    }

                    if (!scroll.Movable)
                    {
                        scroll.Movable = true;
                    }

                    if (scroll.IsLockedDown)
                    {
                        scroll.IsLockedDown = false;
                    }

                    m.SendLocalizedMessage(RemoveMessage);
                }
            }
        }
Example #3
0
            public InternalGump(Mobile mobile, SpecialScroll scroll)
                : base(25, 50)
            {
                this.m_Mobile = mobile;
                this.m_Scroll = scroll;

                this.AddPage(0);

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

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

                this.AddHtmlLocalized(40, 48, 387, 100, this.m_Scroll.Message, true, true);

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

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

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

                if (this.m_Scroll.Title != 0)
                {
                    this.AddHtmlLocalized(40, 20, 260, 20, this.m_Scroll.Title, 0xFFFFFF, false, false);
                }
                else
                {
                    this.AddHtml(40, 20, 260, 20, this.m_Scroll.DefaultTitle, false, false);
                }

                if (this.m_Scroll is StatCapScroll)
                {
                    this.AddHtmlLocalized(310, 20, 120, 20, 1038019, 0xFFFFFF, false, false); // Power
                }
                else
                {
                    this.AddHtmlLocalized(310, 20, 120, 20, AosSkillBonuses.GetLabel(this.m_Scroll.Skill), 0xFFFFFF, false, false);
                }
            }
Example #4
0
			public InternalGump( Mobile mobile, SpecialScroll 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, m_Scroll.Message, true, true );

				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
				
				if ( m_Scroll.Title != 0 )
					AddHtmlLocalized( 40, 20, 260, 20, m_Scroll.Title, 0xFFFFFF, false, false );
				else
					AddHtml( 40, 20, 260, 20, m_Scroll.DefaultTitle, false, false );

				if ( m_Scroll is StatCapScroll )
					AddHtmlLocalized( 310, 20, 120, 20, 1038019, 0xFFFFFF, false, false ); // Power
				else
					AddHtmlLocalized( 310, 20, 120, 20, 1044060 + (int)m_Scroll.Skill, 0xFFFFFF, false, false );
			}
        public static void GiveScrollTo(Mobile killer, SpecialScroll scroll)
        {
            if (scroll == null || killer == null)	//sanity
                return;

            if (scroll is ScrollofTranscendence)
                killer.SendLocalizedMessage(1094936); // You have received a Scroll of Transcendence!
            else
                killer.SendLocalizedMessage(1049524); // You have received a scroll of power!
			
            if (killer.Alive)
                killer.AddToBackpack(scroll);
            else
            {
                if (killer.Corpse != null && !killer.Corpse.Deleted)
                    killer.Corpse.DropItem(scroll);
                else
                    killer.AddToBackpack(scroll);
            }
			
            // 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))
                {
                    try
                    {
                        prot.SendLocalizedMessage(1049368); // You have been rewarded for your dedication to Justice!

                        SpecialScroll scrollDupe = Activator.CreateInstance(scroll.GetType()) as SpecialScroll;
					
                        if (scrollDupe != null)
                        {
                            scrollDupe.Skill = scroll.Skill;
                            scrollDupe.Value = scroll.Value;
                            prot.AddToBackpack(scrollDupe);
                        }
                    }
                    catch
                    {
                    }
                }
            }
        }
Example #6
0
        public void Calculate(SpecialScroll scroll, Mobile from)// does the calculations for Scroll binder
        {
            if (check == null)// triggers if the scroll binder has not been acceptably used before
            {
                check = scroll;
                m_skillname = scroll.Skill;
                m_skillvalue = scroll.Value;
                if (scroll is PowerScroll || scroll is StatCapScroll) // PS and Stat scroll both use base SkillNames
                {
                    m_count += 1;
                    Create(m_count, from);
                }
                else
                    Create(m_skillvalue, from); // Scroll of Trans can use the value for the addition

                scroll.Delete();
                return;
            }
            // long if statement to ensure that both the target and the current refferences are the same type
            if ((check is PowerScroll && scroll is PowerScroll)
                || (check is StatCapScroll && scroll is StatCapScroll)
                || (check is ScrollofTranscendence && scroll is ScrollofTranscendence))
            {
                if (scroll.Skill == m_skillname) //same SkillName
                {
                    if (scroll is PowerScroll && (m_skillvalue == scroll.Value)) // Same Value so we aren't adding in 105s to 110s
                    {
                        m_skillname = scroll.Skill;
                        m_count += 1;

                        Create(m_count, from);
                        scroll.Delete();
                        return;
                    }
                    else if (scroll is StatCapScroll && (m_skillvalue == scroll.Value))// Same value so we aren't adding +20's and +5's
                    {
                        m_skillname = scroll.Skill;
                        m_count += 1;

                        Create(m_count, from);
                        scroll.Delete();
                        return;
                    }
                    else if (scroll is ScrollofTranscendence)// no value check herer since its cumlative
                    {
                        m_count += scroll.Value;

                        Create(m_count, from);
                        scroll.Delete();
                        return;

                    }
                    else
                    {
                        from.SendMessage("That is not the same skill amount");// different value message
                        return;
                    }
                }
                else
                {
                    from.SendMessage(" That does not have the same skill ");//different skillname message
                    return;
                }
            }
            else
            {
                from.SendMessage(" That is not the same type ");// different target and refference message 
                return;
            }
        }
Example #7
0
        public void Calculate(SpecialScroll scroll, Mobile from) // does the calculations for Scroll binder
        {
            if (check == null)                                   // triggers if the scroll binder has not been acceptably used before
            {
                check        = scroll;
                m_skillname  = scroll.Skill;
                m_skillvalue = scroll.Value;
                if (scroll is PowerScroll || scroll is StatCapScroll) // PS and Stat scroll both use base SkillNames
                {
                    m_count += 1;
                    Create(m_count, from);
                }
                else
                {
                    Create(m_skillvalue, from); // Scroll of Trans can use the value for the addition
                }
                scroll.Delete();
                return;
            }
            // long if statement to ensure that both the target and the current refferences are the same type
            if ((check is PowerScroll && scroll is PowerScroll) ||
                (check is StatCapScroll && scroll is StatCapScroll) ||
                (check is ScrollofTranscendence && scroll is ScrollofTranscendence))
            {
                if (scroll.Skill == m_skillname)                                 //same SkillName
                {
                    if (scroll is PowerScroll && (m_skillvalue == scroll.Value)) // Same Value so we aren't adding in 105s to 110s
                    {
                        m_skillname = scroll.Skill;
                        m_count    += 1;

                        Create(m_count, from);
                        scroll.Delete();
                        return;
                    }
                    else if (scroll is StatCapScroll && (m_skillvalue == scroll.Value))// Same value so we aren't adding +20's and +5's
                    {
                        m_skillname = scroll.Skill;
                        m_count    += 1;

                        Create(m_count, from);
                        scroll.Delete();
                        return;
                    }
                    else if (scroll is ScrollofTranscendence)// no value check herer since its cumlative
                    {
                        m_count += scroll.Value;

                        Create(m_count, from);
                        scroll.Delete();
                        return;
                    }
                    else
                    {
                        from.SendMessage("That is not the same skill amount");// different value message
                        return;
                    }
                }
                else
                {
                    from.SendMessage(" That does not have the same skill ");//different skillname message
                    return;
                }
            }
            else
            {
                from.SendMessage(" That is not the same type ");// different target and refference message
                return;
            }
        }