예제 #1
0
        public ConfirmHeritageGump(HeritageQuester quester)
            : base(50, 50)
        {
            m_Quester = quester;

            Closable   = true;
            Disposable = true;
            Dragable   = true;
            Resizable  = false;

            AddPage(0);

            AddBackground(0, 0, 240, 135, 0x2422);

            object message = m_Quester.ConfirmMessage;

            if (message is int)
            {
                AddHtmlLocalized(15, 15, 210, 75, (int)message, 0x0, false, false);
            }
            else if (message is string)
            {
                AddHtml(15, 15, 210, 75, (string)message, false, false);
            }

            AddButton(160, 95, 0xF7, 0xF8, 1, GumpButtonType.Reply, 0);
            AddButton(90, 95, 0xF2, 0xF1, 0, GumpButtonType.Reply, 0);
        }
예제 #2
0
        public static void HeritageTransform(NetState state, PacketReader reader)
        {
            Mobile m = state.Mobile;

            if (reader.Size == 5)
            {
                m.SendLocalizedMessage(1073645); // You may try this again later...
            }
            else if (reader.Size == 15 && HeritageQuester.Check(m))
            {
                bool proceed = false;

                if (HeritageQuester.IsPending(m))
                {
                    proceed = true;

                    HeritageQuester quester = HeritageQuester.Pending(m);
                    m.Race = quester.Race;

                    quester.CheckCompleted(m, true); // removes done quests

                    if (m.Race == Race.Elf)
                    {
                        m.SendLocalizedMessage(1073653); // You are now fully initiated into the Elven culture.
                    }
                    else if (m.Race == Race.Human)
                    {
                        m.SendLocalizedMessage(1073654); // You are now fully human.
                    }
                }
                else if (RaceChangeToken.IsPending(m))
                {
                    Race race = RaceChangeToken.GetPendingRace(m);

                    if (race != null)
                    {
                        m.Race = race;

                        proceed = true;
                        m.SendLocalizedMessage(1111914); // You have successfully changed your race.

                        RaceChangeToken.OnRaceChange(m);
                    }
                }

                if (proceed)
                {
                    m.Hue              = reader.ReadUInt16();
                    m.HairItemID       = reader.ReadUInt16();
                    m.HairHue          = reader.ReadUInt16();
                    m.FacialHairItemID = reader.ReadUInt16();
                    m.FacialHairHue    = reader.ReadUInt16();
                }
            }

            HeritageQuester.RemovePending(m);
            RaceChangeToken.RemovePending(m);
        }
예제 #3
0
        private void CloseHeritageGump(object args)
        {
            if (args is Mobile m && HeritageQuester.IsPending(m))
            {
                m.Send(HeritagePacket.Close);

                HeritageQuester.RemovePending(m);
            }
        }
예제 #4
0
        public override void OnResponse(Server.Network.NetState state, RelayInfo info)
        {
            if (m_Quester == null)
            {
                return;
            }

            if (info.ButtonID == 1)
            {
                Mobile m = state.Mobile;

                if (HeritageQuester.Check(m))
                {
                    HeritageQuester.AddPending(m, m_Quester);
                    Timer.DelayCall(TimeSpan.FromMinutes(1), new TimerStateCallback(CloseHeritageGump), m);

                    state.Mobile.Send(new HeritagePacket(m.Female, (short)(m_Quester.Race.RaceID + 1)));
                }
            }
        }
예제 #5
0
        public static void HeritageTransform(NetState state, PacketReader reader)
        {
            Mobile m = state.Mobile;

            if (reader.Size == 5)
            {
                m.SendLocalizedMessage(1073645); // You may try this again later...

                HeritageQuester.RemovePending(m);
            }
            else if (reader.Size == 15)
            {
                if (HeritageQuester.IsPending(m))
                {
                    HeritageQuester quester = HeritageQuester.Pending(m);

                    m.Race = quester.Race;

                    m.Hue              = reader.ReadUInt16();
                    m.HairItemID       = reader.ReadUInt16();
                    m.HairHue          = reader.ReadUInt16();
                    m.FacialHairItemID = reader.ReadUInt16();
                    m.FacialHairHue    = reader.ReadUInt16();

                    HeritageQuester.RemovePending(m);
                    quester.CheckCompleted(m, true); // removes done quests

                    if (m.Race == Race.Elf)
                    {
                        m.SendLocalizedMessage(1073653); // You are now fully initiated into the Elven culture.
                    }
                    else if (m.Race == Race.Human)
                    {
                        m.SendLocalizedMessage(1073654); // You are now fully human.
                    }
                }
            }
        }
예제 #6
0
		public ConfirmHeritageGump( HeritageQuester quester ) : base( 50, 50 )
		{		
			m_Quester = quester;
			
			Closable = true;
			Disposable = true;
			Dragable = true;
			Resizable = false;
			
			AddPage( 0 );
			
			AddBackground( 0, 0, 240, 135, 0x2422 );
			
			object message = m_Quester.ConfirmMessage;
			
			if ( message is int )
				AddHtmlLocalized( 15, 15, 210, 75, (int) message, 0x0, false, false );
			else if ( message is string )
				AddHtml( 15, 15, 210, 75, (string) message, false, false );
				
			AddButton( 160, 95, 0xF7, 0xF8, (int) Buttons.Okay, GumpButtonType.Reply, 0 );
			AddButton( 90, 95, 0xF2, 0xF1, (int) Buttons.Close, GumpButtonType.Reply, 0 ); 		
		}
예제 #7
0
 public static void AddPending(Mobile m, HeritageQuester quester)
 {
     m_Pending[m] = quester;
 }
예제 #8
0
 public static void AddPending( Mobile m, HeritageQuester quester )
 {
     m_Pending[m] = quester;
 }