示例#1
0
        public override bool OnDragDrop(Mobile from, Item dropped)
        {
            int  entries = Entries.Count;
            bool d       = base.OnDragDrop(from, dropped);

            if (from is PlayerMobile && d && Entries.Count > entries)
            {
                int newPage = Math.Max(0, (Entries.Count - 1) / 16);

                RunicAtlasGump g = from.FindGump(typeof(RunicAtlasGump)) as RunicAtlasGump;

                if (g != null && g.Atlas == this)
                {
                    g.Page = newPage;
                    g.Refresh();
                }
                else
                {
                    if (g != null)
                    {
                        from.CloseGump(typeof(RunicAtlasGump));
                    }

                    g      = new RunicAtlasGump((PlayerMobile)from, this);
                    g.Page = newPage;
                    from.SendGump(g);
                }
            }

            return(d);
        }
        public static void CloseGump(Mobile from)
        {
            CharacterStatueGump gump = from.FindGump(typeof(CharacterStatueGump)) as CharacterStatueGump;

            if (gump != null)
            {
                gump.CloseGump();
                from.CloseGump(typeof(CharacterStatueGump));
            }
        }
示例#3
0
        public virtual bool HasGump(Mobile toCheck)
        {
            RunebookGump bookGump = toCheck.FindGump <RunebookGump>();

            if (bookGump != null && bookGump.Book == this)
            {
                return(true);
            }

            return(false);
        }
示例#4
0
		public override void OnDoubleClick( Mobile from )
		{
			if ( !CheckUse( from ) )
				return;
			
			if ( from.FindGump( typeof( InteriorDecorator.InternalGump ) ) == null )
				from.SendGump( new InternalGump( this ) );

			if ( m_Command != DecorateCommand.None )
				from.Target = new InternalTarget( this );
		}
示例#5
0
        public override bool HasGump(Mobile toCheck)
        {
            RunicAtlasGump bookGump = toCheck.FindGump <RunicAtlasGump>();

            if (bookGump != null && bookGump.Atlas == this)
            {
                return(true);
            }

            return(false);
        }
示例#6
0
        public void Clear(Mobile m)
        {
            var gump = m.FindGump <AnvilofArtifactsGump>();

            if (gump != null)
            {
                gump.Refresh();
            }

            Anvil = null;
        }
示例#7
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!InHouse(from))
                Command = DecorateCommand.GetHue;

            if (from.FindGump(typeof(InternalGump)) == null)
                from.SendGump(new InternalGump(from, this));

            if (Command != DecorateCommand.None)
                from.Target = new InternalTarget(this);
        }
示例#8
0
 public static void UpdateGump(Mobile m)
 {
     if (m != null && m is PlayerMobile && m.HasGump(typeof(AlimentationGump)))
     {
         Gump ag = m.FindGump(typeof(AlimentationGump));
         int  x  = ag.X;
         int  y  = ag.Y;
         m.CloseGump(typeof(AlimentationGump));
         m.SendGump(new AlimentationGump(m, x, y));
     }
 }
示例#9
0
        private static void SetPrimaryAbility_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            if (!from.HasGump(typeof(SpecialAttackGump)))
            {
                return;
            }
            SpecialAttackGump gump = (SpecialAttackGump)from.FindGump(typeof(SpecialAttackGump));

            gump.OnResponse(from.NetState, new RelayInfo(1, null, null));
        }
示例#10
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!CheckUse(this, from))
            {
                return;
            }

            if (from.FindGump(typeof(InteriorDecorator.InternalGump)) == null)
            {
                from.SendGump(new InternalGump(this));
            }

            if (m_Command != DecorateCommand.None)
            {
                from.Target = new InternalTarget(this);
            }
        }
        public static bool RefreshGump(Mobile player, object o)
        {
            if (player.HasGump(typeof(ObjectPropertyListGump)))
            {
                ObjectPropertyListGump gump = (ObjectPropertyListGump)player.FindGump(typeof(ObjectPropertyListGump));

                //if this gump that's up is showing this list entry, or if none was specified, then refresh
                if (o == null || gump.Object == o)
                {
                    //then, resend this gump!
                    player.SendGump(new ObjectPropertyListGump(gump));
                    return(true);
                }
            }

            return(false);
        }
示例#12
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!CheckUse(this, from))
            {
                return;
            }

            if (from.FindGump(typeof(LocksmithTools.InternalGump)) == null)
            {
                from.SendGump(new InternalGump(this));
            }

            if (m_Command != LocksmithCommand.None)
            {
                from.Target = new InternalTarget(this);
            }
        }
示例#13
0
        public void ResendProgressGump(Mobile m)
        {
            if (m == null || m.NetState == null || !(m is PlayerMobile))
            {
                return;
            }

            PetTrainingProgressGump g = m.FindGump(typeof(PetTrainingProgressGump)) as PetTrainingProgressGump;

            if (g == null)
            {
                Server.Gumps.BaseGump.SendGump(new PetTrainingProgressGump((PlayerMobile)m, Creature));
            }
            else
            {
                g.Refresh();
            }
        }
示例#14
0
        public override bool OnMoveOver(Mobile m)
        {
            switch (m_PadType)
            {
            default:
            case 0:      //Sail to the Serpent Isle?
            {
                m.CantWalk = true;

                if (m.FindGump <GumpSailToSerpentIsle>() == null)
                {
                    m.SendGump(new GumpSailToSerpentIsle(m));
                }
                break;
            }
            }
            return(true);
        }
示例#15
0
        public static bool RefreshGump(Mobile player, ItemStore store)
        {
            //if this mobile has an item store gump up
            if (player.HasGump(typeof(ItemStoreGump)))
            {
                ItemStoreGump gump = (ItemStoreGump)player.FindGump(typeof(ItemStoreGump));

                //if this gump that's up is showing this store, or if no store was specified
                if (store == null || gump.Store == store)
                {
                    //then, resend this gump!
                    player.SendGump(new ItemStoreGump(gump));
                    return(true);
                }
            }

            return(false);
        }
示例#16
0
        public static bool RefreshGump(Mobile player, StashEntry stashentry)
        {
            //if this mobile has a stash entry gump up
            if (player.HasGump(typeof(StashEntryGump)))
            {
                StashEntryGump gump = (StashEntryGump)player.FindGump(typeof(StashEntryGump));

                //if this gump that's up is showing this list entry, or if none was specified, then refresh
                if (stashentry == null || gump.StashEntry == stashentry)
                {
                    //then, resend this gump!
                    player.SendGump(new StashEntryGump(gump));
                    return(true);
                }
            }

            return(false);
        }
示例#17
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from is BaseCreature)
            {
                from.SendMessage("You can't decorate a house as a monster!");                 // pseudoseer is possessing a monster
                return;
            }
            if (CheckUse(this, from))
            {
                if (from.FindGump(typeof(InternalGump)) == null)
                {
                    from.SendGump(new InternalGump(this));
                }

                if (m_Command != DecorateCommand.None)
                {
                    from.Target = new InternalTarget(this);
                }
            }
        }
		public override void OnDoubleClick(Mobile from)
		{
			if (from is BaseCreature)
			{
				from.SendMessage("You can't decorate a house as a monster!"); // pseudoseer is possessing a monster
				return;
			}
			if (CheckUse(this, from))
			{
				if (from.FindGump(typeof(InternalGump)) == null)
				{
					from.SendGump(new InternalGump(this));
				}

				if (m_Command != DecorateCommand.None)
				{
					from.Target = new InternalTarget(this);
				}
			}
		}
示例#19
0
 public static bool Exists(Mobile mob)
 {
     return (mob.FindGump(typeof(FactionGump)) != null);
 }
示例#20
0
 public static bool Exists(Mobile mob)
 {
     return(mob.FindGump(typeof(FactionGump)) != null);
 }
示例#21
0
        public bool TryAddSeed(Mobile from, Seed seed, int index = -1)
        {
            if (!from.Backpack.CheckHold(from, seed, true, true) || seed.Amount <= 0)
            {
                return(false);
            }
            else if (!from.InRange(GetWorldLocation(), 3) || from.Map != Map)
            {
                return(false);
            }
            else if (TotalCount + seed.Amount <= MaxSeeds)
            {
                SeedEntry entry    = GetExisting(seed);
                int       oldcount = UniqueCount;

                if (entry != null)
                {
                    entry.Seed.Amount += seed.Amount;
                    seed.Delete();
                }
                else if (UniqueCount < MaxUnique)
                {
                    entry = new SeedEntry(seed);
                    DropItem(seed);

                    seed.Movable = false;
                }
                else
                {
                    from.SendLocalizedMessage(1151839); // There is not enough room in the box.
                }

                if (entry != null)
                {
                    InvalidateProperties();

                    if (Entries.Contains(entry))
                    {
                        if (index > -1 && index < Entries.Count - 1)
                        {
                            Entries.Remove(entry);
                            AddEntry(entry, index);
                        }
                    }
                    else
                    {
                        if (index > -1 && index < Entries.Count)
                        {
                            AddEntry(entry, index);
                        }
                        else
                        {
                            AddEntry(entry);
                        }
                    }

                    from.SendLocalizedMessage(1151846); // You put the seed in the seedbox.

                    if (from is PlayerMobile)
                    {
                        var gump = from.FindGump <SeedBoxGump>();

                        if (gump != null)
                        {
                            gump.CheckPage(entry);
                            gump.Refresh();
                        }
                        else
                        {
                            gump = new SeedBoxGump((PlayerMobile)from, this);
                            gump.CheckPage(entry);

                            BaseGump.SendGump(gump);
                        }
                    }

                    return(true);
                }
            }
            else
            {
                from.SendLocalizedMessage(1151839); // There is not enough room in the box.
            }

            return(false);
        }