Example #1
0
 public override void OnMovement(Mobile from, Point3D oldLocation)
 {
     if (from.InRange(this, 3) && from is PlayerMobile)
     {
         if (!from.HasGump(typeof(PopUpGump)))
             from.SendGump(new PopUpGump(Name));
     }
     if (!from.InRange(this, 3) && from is PlayerMobile)
     {
         if (from.HasGump(typeof(PopUpGump)))
             from.CloseGump(typeof(PopUpGump));
     }
 }
Example #2
0
	public void TryTalkTo( Mobile from, bool fromClick )
	{
		if ( !from.Hidden && !from.HasGump( typeOfRaceChangeConfirmGump ) && !RaceChangeConfirmGump.IsPending( from.NetState ) && CanTalkTo( from ) )
			TalkTo( from as PlayerMobile );
		else if ( fromClick )
			DenyTalk( from );
	}
Example #3
0
        public override void OnDoubleClick(Mobile from)
        {
            if (this.Parent != null || !this.VerifyMove(from))
                return;

            if (!from.InRange(this, 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            if (this.ItemID == 0xA57) // rolled
            {
                Direction dir = PlayerMobile.GetDirection4(from.Location, this.Location);

                if (dir == Direction.North || dir == Direction.South)
                    this.ItemID = 0xA55;
                else
                    this.ItemID = 0xA56;
            }
            else // unrolled
            {
                this.ItemID = 0xA57;

                if (!from.HasGump(typeof(LogoutGump)))
                {
                    CampfireEntry entry = Campfire.GetEntry(from);

                    if (entry != null && entry.Safe)
                        from.SendGump(new LogoutGump(entry, this));
                }
            }
        }
		protected override void OnTargetFinish( Mobile from )
		{
			if ( !m_Plant.Deleted && m_Plant.PlantStatus < PlantStatus.DecorativePlant && from.InRange( m_Plant.GetWorldLocation(), 3 ) && m_Plant.IsUsableBy( from ) )
			{
				if ( from.HasGump( typeof( MainPlantGump ) ) )
					from.CloseGump( typeof( MainPlantGump ) );

				from.SendGump( new MainPlantGump( m_Plant ) );
			}
		}
		public override void OnDoubleClick( Mobile from )
		{

			if ( !from.HasGump( typeof( PSCreditsGump ) ) )
				{
					from.SendGump( new PSCreditsGump());
				}
			else
				from.SendMessage ( "You already have this menu open!" );
            
		}
Example #6
0
 public override void OnDoubleClick(Mobile from)
 {
     //Fix for crash when 2 gumps opened simultainously
     if (from.HasGump(typeof(Suggestion)))
     {
         from.SendMessage("You already have a suggestion open, please finish with that one before opening a new one!");
         return;
     }
     //End fix for crash
     from.SendGump(new Suggestion());
 }
Example #7
0
		public override void OnDoubleClick( Mobile from )
		{
			Point2D start = new Point2D( from.X - 3, from.Y - 3 );
			Point2D end = new Point2D( from.X + 3, from.Y + 3 );

			m_Bounds = new Rectangle2D( start, end );

			if( !IsChildOf( from.Backpack ) )
			{
				from.SendLocalizedMessage( 1042001 ); //That must be in your pack to use it.
			}
			else if( AlreadyOwnTent( from ) )
			{
				from.SendMessage( "You already have a tent established." );
			}
			else if( from.HasGump( typeof( ConfirmTentPlacementGump ) ) )
			{
				from.CloseGump( typeof( ConfirmTentPlacementGump ) );
			}
			else if( from.Combatant != null )
			{
				from.SendMessage( "You can't place a tent while fighting!" );
			}
			else if( VerifyPlacement( from, m_Bounds ) )
			{
				TentAddon tent = new TentAddon();
				tent.MoveToWorld( new Point3D( from.X, from.Y, from.Z ), from.Map );

				TentFlap flap = new TentFlap( from, this );
				flap.MoveToWorld( new Point3D( from.X + 2, from.Y, from.Z ), from.Map );

				SecureTentChest chest = new SecureTentChest( from );
				chest.MoveToWorld( new Point3D( from.X - 1, from.Y - 2, from.Z ), from.Map );

				TentBedroll roll = new TentBedroll( from, tent, flap, chest );
				roll.MoveToWorld( new Point3D( from.X, from.Y + 1, from.Z ), from.Map );

				from.SendGump( new ConfirmTentPlacementGump( from, tent, flap, roll, chest, m_Bounds ) );

				this.Delete();
			}
			else
			{
				from.SendMessage( "You cannot place a tent in this area." );
			}
		}
Example #8
0
      public override void OnDoubleClick( Mobile from )
      {
      	if( m_Tracks.Count < 1 )
      	{
      		from.SendMessage( "This music box is empty." );
      	}
	else if( IsOwner( from ) )
	{
		if( !IsLockedDown )
			from.SendLocalizedMessage( 502692 ); // This must be in a house and be locked down to work.
		else
		{
			if( from.HasGump( typeof(MusicGump) ) )
				from.CloseGump( typeof(MusicGump) );
			
			from.SendGump( new MusicGump( this ) );
		}
	}
	else
	{
		from.SendLocalizedMessage( 502691 ); // You must be the owner to use this.
	}
      }
Example #9
0
        public static bool SendGump(TriggerObject trigObject, Mobile target, string GumpFile, bool closeGump )
        {
            if (GumpFile == null || target == null) return false;

            string path;
            GumpFileMap.TryGetValue(GumpFile.ToLower(), out path);
            if (path == null)
            {
                //path = Path.GetFullPath(ScriptFile);
                path = Path.Combine(Core.BaseDirectory, "UberScripts", GumpFile);
                if (!File.Exists(path))
                {
                    throw new UberScriptException("Script file did not exist at " + path);
                }
                GumpFileMap.Add(GumpFile.ToLower(), path);
            }

            UberGumpBase parsedGump;
            XmlDocument parsedXml;
            if (!Gumps.ContainsKey(path))
            {
                parsedXml = new XmlDocument(); //* create an xml document object.
                parsedXml.Load(path); //* load the XML document from the specified file.
                if (parsedXml == null) return false;
                parsedGump = new UberGumpBase(parsedXml.FirstChild);
                Gumps.Add(path, parsedGump);
            }
            else
            {
                parsedGump = Gumps[path];
            }

            if (closeGump && target.HasGump(typeof(UberScriptGump)))
                target.CloseGump(typeof(UberScriptGump));
            target.SendGump(new UberScriptGump(target, trigObject, parsedGump, GumpFile));
            return true;
        }
Example #10
0
        public override void OnDoubleClick(Mobile from)
        {
            if (null == from || 0 == this.m_Lifespan)
                return;

            if (!this.IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
            else
            {
                if (from.HasGump(typeof(ClockworkStartGump)))
                    from.CloseGump(typeof(ClockworkStartGump));

                from.SendGump(new ClockworkStartGump(this));
            }
        }
Example #11
0
        public override void OnDoubleClick(Mobile from)
        {
            if (!from.InRange(this.GetWorldLocation(), 2))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that
            }
            else if (this.m_Tournament != null)
            {
                Tournament tourny = this.m_Tournament.Tournament;

                if (tourny != null)
                {
                    if (this.m_Registrar != null)
                        this.m_Registrar.Direction = this.m_Registrar.GetDirectionTo(this);

                    switch ( tourny.Stage )
                    {
                        case TournamentStage.Fighting:
                            {
                                if (this.m_Registrar != null)
                                {
                                    if (tourny.HasParticipant(from))
                                    {
                                        this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                            0x35, false, "Excuse me? You are already signed up.", from.NetState);
                                    }
                                    else
                                    {
                                        this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                            0x22, false, "The tournament has already begun. You are too late to signup now.", from.NetState);
                                    }
                                }

                                break;
                            }
                        case TournamentStage.Inactive:
                            {
                                if (this.m_Registrar != null)
                                    this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                        0x35, false, "The tournament is closed.", from.NetState);

                                break;
                            }
                        case TournamentStage.Signup:
                            {
                                Ladder ladder = Ladder.Instance;

                                if (ladder != null)
                                {
                                    LadderEntry entry = ladder.Find(from);

                                    if (entry != null && Ladder.GetLevel(entry.Experience) < tourny.LevelRequirement)
                                    {
                                        if (this.m_Registrar != null)
                                        {
                                            this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                                0x35, false, "You have not yet proven yourself a worthy dueler.", from.NetState);
                                        }

                                        break;
                                    }
                                }

                                if (from.HasGump(typeof(AcceptTeamGump)))
                                {
                                    if (this.m_Registrar != null)
                                        this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                            0x22, false, "You must first respond to the offer I've given you.", from.NetState);
                                }
                                else if (from.HasGump(typeof(AcceptDuelGump)))
                                {
                                    if (this.m_Registrar != null)
                                        this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                            0x22, false, "You must first cancel your duel offer.", from.NetState);
                                }
                                else if (from is PlayerMobile && ((PlayerMobile)from).DuelContext != null)
                                {
                                    if (this.m_Registrar != null)
                                        this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                            0x22, false, "You are already participating in a duel.", from.NetState);
                                }
                                else if (!tourny.HasParticipant(from))
                                {
                                    ArrayList players = new ArrayList();
                                    players.Add(from);
                                    from.CloseGump(typeof(ConfirmSignupGump));
                                    from.SendGump(new ConfirmSignupGump(from, this.m_Registrar, tourny, players));
                                }
                                else if (this.m_Registrar != null)
                                {
                                    this.m_Registrar.PrivateOverheadMessage(MessageType.Regular,
                                        0x35, false, "You have already entered this tournament.", from.NetState);
                                }

                                break;
                            }
                    }
                }
            }
        }
Example #12
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (from == null || targeted == null)
                    return;

                if (targeted is Mobile && ((Mobile)targeted).Player)
                {
                    Mobile pm = targeted as Mobile;
                    
                    // test them for young status
                    if (YoungProtection(from, pm))
                    {
                        SendText(from, 100207, pm.Name); // "{0} is too inexperience to be challenged"
                        return;
                    }

                    // check the owner for existing challenges
                    XmlPoints a = (XmlPoints)XmlAttach.FindAttachment(from, typeof(XmlPoints));

                    if (a != null && !a.Deleted)
                    {
                        // issuing a challenge when one is already in place will initiate cancellation of the current challenge
                        if (a.Challenger != null)
                        {
                            // this will initiate the challenge cancellation timer
                            if (a.m_CancelTimer != null && a.m_CancelTimer.Running)
                            {
                                // timer is running
                                a.SendText(100208, a.m_CancelEnd - DateTime.UtcNow); // "{0} mins remaining until current challenge is cancelled."
                            }
                            else
                            {
                                a.SendText(100209, XmlPoints.CancelTimeout.TotalMinutes);  // "Canceling current challenge.  Please wait {0} minutes"

                                SendText(a.Challenger, 100210, from.Name, XmlPoints.CancelTimeout.TotalMinutes); // "{0} is canceling the current challenge. {1} minutes remain"

                                // start up the cancel challenge timer
                                a.DoTimer(XmlPoints.CancelTimeout);

                                // update the points gumps on the challenger if they are open
                                if (from.HasGump(typeof(PointsGump)))
                                {
                                    a.OnIdentify(from);
                                }
                                // update the points gumps on the challenge target if they are open
                                if (a.Challenger.HasGump(typeof(PointsGump)))
                                {
                                    XmlPoints ca = (XmlPoints)XmlAttach.FindAttachment(a.Challenger, typeof(XmlPoints));
                                    if (ca != null && !ca.Deleted)
                                        ca.OnIdentify(a.Challenger);
                                }
                            }
                            return;
                        }

                        // check the target for existing challengers
                        XmlPoints xa = (XmlPoints)XmlAttach.FindAttachment(pm, typeof(XmlPoints));

                        if (xa != null && !xa.Deleted)
                        {
                            if (xa.Challenger != null)
                            {
                                from.SendMessage(String.Format(a.Text(100211), pm.Name));  // "{0} is already being challenged."
                                return;
                            }
                        }

                        if (from == targeted)
                        {
                            from.SendMessage(a.Text(100212));  // "You cannot challenge yourself."
                        }
                        else
                        {
                            // send the confirmation gump to the challenged player
                            from.SendGump(new IssueChallengeGump(this.m_challenger, pm));
                        }
                    }
                    else
                    {
                        from.SendMessage(SystemText(100213)); // "No XmlPoints support."
                    }
                }
            }
	public override void OnDoubleClick( Mobile from )
	{
		if ( SkillBonus <= 0 || ( Expires && DateTime.UtcNow >= m_ExpireDate ) )
		{
			if ( from.AccessLevel >= AccessLevel.GameMaster )
				from.SendGump( new PropertiesGump( from, this ) );
			SendLocalizedMessageTo( from, 1042544 ); // This item is out of charges.
		}
		else if ( !IsChildOf( from.Backpack ) )
			from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
		else if ( !from.HasGump( typeof(MacingSkillScroll) ) )
			SendGump( from );
		else
			from.SendMessage( "You are already using a skill ball." );
	}
Example #14
0
        public override void OnDoubleClick(Mobile from)
        {
            if (from.AccessLevel > AccessLevel.Counselor)
            {
                TryCreateMissingBags();

                TryMoveBags();

                if (from.HasGump(typeof(ConfigSelectionGump)))
                {
                    for (int i = 0; i < m_ItemContaiers.Length; i++)
                        m_ItemContaiers[i].DisplayTo(from);

                    from.CloseGump(typeof(ConfigSelectionGump));
                }
                else if (m_SupplyType == SupplyType.Custom)
                {
                    from.SendAsciiMessage("Double click the pad again to open all bags at once.");
                    from.SendGump(new ConfigSelectionGump(from, this));
                }
                else
                    from.SendAsciiMessage("You need to turn the pad on to custom mode to customize the gear.");
            }
        }
	public override void OnDoubleClick( Mobile from )
	{
		if ( (this.SkillBonus == 0) && (from.AccessLevel < AccessLevel.GameMaster) )
		{
			from.SendMessage("This skill ball isn't charged. Please page for a GM.");
			return;
		}
		else if ( (from.AccessLevel >= AccessLevel.GameMaster) && (this.SkillBonus == 0) )
		{
			from.SendGump( new PropertiesGump( from, this ) );
			return;
		}
		else if ( !IsChildOf( from.Backpack ) )
			from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
           else if (!from.HasGump(typeof(TempDonationSkillBallGump)))
			from.SendGump( new TempDonationSkillBallGump( from, this ) );
		else
			from.SendMessage("You're already using a skill ball.");
	}
	public override void OnDoubleClick( Mobile from )
	{
		if ( IsChildOf( from ) && !from.HasGump( typeof(EtherealRideGump) ) )
		{
			from.SendGump( new EtherealRideGump( this ) );
		}
	}
Example #17
0
        // Use OnLocationChanged instead of OnEnter because it can be that we enter a house region even though we're not actually inside the house
        public override void OnLocationChanged( Mobile m, Point3D oldLocation )
        {
            if ( m_Recursion )
                return;

            base.OnLocationChanged( m, oldLocation );

            m_Recursion = true;

            if ( m is BaseCreature && ( (BaseCreature) m ).NoHouseRestrictions )
            {
            }
            else if ( m is BaseCreature && ( (BaseCreature) m ).IsHouseSummonable && !( BaseCreature.Summoning || m_House.IsInside( oldLocation, 16 ) ) )
            {
            }
            else if ( m_House.Public && m_House.IsBanned( m ) && m_House.IsInside( m ) )
            {
                m.Location = m_House.BanLocation;
            }
            else if ( !m_House.Public && !m_House.HasAccess( m ) && m_House.IsInside( m ) )
            {
                m.Location = m_House.BanLocation;

            }
            else if ( m_House.IsCombatRestricted( m ) && m_House.IsInside( m ) && !m_House.IsInside( oldLocation, 16 ) )
            {
                m.Location = m_House.BanLocation;
                m.SendLocalizedMessage( 1061637 ); // You are not allowed to access this.
            }
            else if ( m_House is HouseFoundation )
            {
                HouseFoundation foundation = (HouseFoundation) m_House;

                if ( foundation.Customizer != null && foundation.Customizer != m && m_House.IsInside( m ) )
                    m.Location = m_House.BanLocation;
            }

            // AƱadido para Antihousing
            if ( m_House.IsInside( m ) && CheckCombat( m, TimeSpan.FromMinutes( 2.0 ) ) )
            {
                for ( int i = 0; i < m.Aggressors.Count; i++ )
                {
                    bool found = false;

                    AggressorInfo info = (AggressorInfo) m.Aggressors[i];

                    Mobile aggressor = info.Attacker;

                    for ( int j = 0; j < m.Aggressed.Count; j++ )
                    {
                        AggressorInfo info2 = (AggressorInfo) m.Aggressed[j];

                        Mobile aggressed = info2.Attacker;

                        if ( aggressed == m )
                            found = true;
                    }

                    if ( !found )
                        m.Aggressed.Add( AggressorInfo.Create( m, aggressor, !m.Criminal ) );
                }
            }

            if ( m_House.InternalizedVendors.Count > 0 && m_House.IsInside( m ) && !m_House.IsInside( oldLocation, 16 ) && m_House.IsOwner( m ) && m.Alive && !m.HasGump( typeof( NoticeGump ) ) )
            {
                /* This house has been customized recently, and vendors that work out of this
                 * house have been temporarily relocated.  You must now put your vendors back to work.
                 * To do this, walk to a location inside the house where you wish to station
                 * your vendor, then activate the context-sensitive menu on your avatar and
                 * select "Get Vendor".
                 */
                m.SendGump( new NoticeGump( 1060635, 30720, 1061826, 32512, 320, 180, null, null ) );
            }

            m_Recursion = false;
        }
Example #18
0
 public override void OnDoubleClick(Mobile from)
 {
     if (SkillBonus <= 0)
     {
         if (from.AccessLevel >= AccessLevel.GameMaster)
         {
             from.SendGump(new PropertiesGump(from, this));
         }
         SendLocalizedMessageTo(from, 1042544); // This item is out of charges.
     }
     else if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
     }
     else if (!from.HasGump(typeof(SkillScroll)))
     {
         SendGump(from);
     }
 }
 protected override void OnTarget( Mobile from, object targeted )
 {
     BaseCreature creature = targeted as BaseCreature;
     if ( creature == null || !( creature.Controlled && creature.ControlMaster == from ) )
         from.SendMessage( "You cannot use this skill ball on that." );
     else if ( from.HasGump( typeof(SkillBall) ) )
         from.SendMessage( "You are already using a skill ball." );
     else if ( m_Ball.Expires && DateTime.Now >= m_Ball.ExpireDate )
         m_Ball.SendLocalizedMessageTo( from, 1042544 ); // This item is out of charges.
     else if ( m_Ball.ValidateUser( from ) )
         from.SendMessage( "Only the owner can use this skill ball." );
     else
         from.SendGump( new SkillBallGump( from, creature, m_Ball ) );
 }
Example #20
0
        // handles point gain when the player kills someone
        public override void OnKill(Mobile killed, Mobile killer)
        {
            if (killer == null || killed == null || !(killed.Player) || killer == killed)
                return;

            bool awardpoints = true;

            // if this was a team or challenge duel then clear agressor list
            if (killed == this.m_Challenger || killer == this.m_Challenger || AreInSameGame(killed, killer))
            {
                // and remove the challenger from the aggressor list so that the res noto is not affected
                this.ClearAggression(killed, killer);
            }

            // handle challenge team kills
            if (this.ChallengeGame != null && !this.ChallengeGame.Deleted)
            {
                this.ChallengeGame.OnKillPlayer(killer, killed);
            }

            // check to see whether points can be given
            if (!(this.AttachedTo is Mobile) || !this.CanAffectPoints((Mobile)this.AttachedTo, killer, killed, false))
            {
                awardpoints = false;
            }

            // if this was a challenge duel then clear the challenger field
            if (killed == this.m_Challenger || killer == this.m_Challenger)
            {
                this.m_Challenger = null;
            }
            
            // begin the section to award points

            if (!awardpoints)
                return;

            if (LogKills)
            {
                try
                {
                    using (StreamWriter op = new StreamWriter("kills.log", true))
                    {
                        op.WriteLine("{0}: {1} killed {2}", DateTime.UtcNow, killer, killed);
                    }
                }
                catch
                {
                }
            }

            int killedpoints = 0;
            // give the killer his points, either a fixed amount or scaled by the difference with the points of the killed
            // if the killed has more points than the killed then gain more
            ArrayList list = XmlAttach.FindAttachments(killed, typeof(XmlPoints));

            if (list != null && list.Count > 0)
            {
                killedpoints = ((XmlPoints)list[0]).Points;
            }

            int val = (int)((killedpoints - this.Points) * m_WinScale);
            if (val <= 0)
                val = 1;

            this.Points += val;
            
            int cval = (int)((killedpoints - this.Points) * m_CreditScale);
            if (cval <= 0)
                cval = 1;

            this.Credits += cval;

            this.m_LastKill = DateTime.UtcNow;

            killer.SendMessage(String.Format(this.Text(100215), val, killed.Name));  // "You receive {0} points for killing {1}"
            
            if (GainHonorFromDuel)
            {
                bool gainedPath = false;
                if (VirtueHelper.Award(killer, VirtueName.Honor, val, ref gainedPath))
                {
                    if (gainedPath)
                    {
                        killer.SendLocalizedMessage(1063226); // You have gained a path in Honor!
                    }
                    else
                    {
                        killer.SendLocalizedMessage(1063225); // You have gained in Honor.
                    }
                }
            }

            // add to the recently killed list
            //KillList.Add(new KillEntry(killed, DateTime.UtcNow));

            // add to the cumulative death count
            this.Kills++;

            // update the overall ranking list
            UpdateRanking(killer, this);

            // if broadcast is enabled then announce it
            if (this.Broadcast && m_SystemBroadcast)
            {
                BroadcastMessage(AccessLevel.Player, 0x482, String.Format(SystemText(100216), killer.Name, killed.Name));  // "{0} has defeated {1} in combat."
            }

            // update the points gump if it is open
            if (killer.HasGump(typeof(PointsGump)))
            {
                // redisplay it with the new info
                this.OnIdentify(killer);
            }

            // update the top players gump if it is open
            if (killer.HasGump(typeof(TopPlayersGump)))
            {
                killer.CloseGump(typeof(TopPlayersGump));
                killer.SendGump(new TopPlayersGump(this));
            }
        }
Example #21
0
        // Use OnLocationChanged instead of OnEnter because it can be that we enter a house region even though we're not actually inside the house
        public override void OnLocationChanged(Mobile m, Point3D oldLocation)
        {
            if (this.m_Recursion)
                return;

            base.OnLocationChanged(m, oldLocation);

            this.m_Recursion = true;

            if (m is BaseCreature && ((BaseCreature)m).NoHouseRestrictions)
            {
            }
            else if (m is BaseCreature && ((BaseCreature)m).IsHouseSummonable && !(BaseCreature.Summoning || this.m_House.IsInside(oldLocation, 16)))
            {
            }
            else if ((this.m_House.Public || !this.m_House.IsAosRules) && this.m_House.IsBanned(m) && this.m_House.IsInside(m))
            {
                m.Location = this.m_House.BanLocation;

                if (!Core.SE)
                    m.SendLocalizedMessage(501284); // You may not enter.
            }
            else if (this.m_House.IsAosRules && !this.m_House.Public && !this.m_House.HasAccess(m) && this.m_House.IsInside(m))
            {
                m.Location = this.m_House.BanLocation;

                if (!Core.SE)
                    m.SendLocalizedMessage(501284); // You may not enter.
            }
            else if (this.m_House.IsCombatRestricted(m) && this.m_House.IsInside(m) && !this.m_House.IsInside(oldLocation, 16))
            {
                m.Location = this.m_House.BanLocation;
                m.SendLocalizedMessage(1061637); // You are not allowed to access this.
            }
            else if (this.m_House is HouseFoundation)
            {
                HouseFoundation foundation = (HouseFoundation)this.m_House;

                if (foundation.Customizer != null && foundation.Customizer != m && this.m_House.IsInside(m))
                    m.Location = this.m_House.BanLocation;
            }

            if (this.m_House.InternalizedVendors.Count > 0 && this.m_House.IsInside(m) && !this.m_House.IsInside(oldLocation, 16) && this.m_House.IsOwner(m) && m.Alive && !m.HasGump(typeof(NoticeGump)))
            {
                /* This house has been customized recently, and vendors that work out of this
                * house have been temporarily relocated.  You must now put your vendors back to work.
                * To do this, walk to a location inside the house where you wish to station
                * your vendor, then activate the context-sensitive menu on your avatar and
                * select "Get Vendor".
                */
                m.SendGump(new NoticeGump(1060635, 30720, 1061826, 32512, 320, 180, null, null));
            }

            this.m_Recursion = false;
        }
Example #22
0
      public override bool OnDragLift(Mobile from)
      {
          if (from.HasGump(typeof(RunebookGump)))
          {
              from.SendLocalizedMessage(500169); // You cannot pick that up.
              return false;
          }
	
          foreach (Mobile m in this.m_Openers)
              if (this.IsOpen(m))
                  m.CloseGump(typeof(RunebookGump));
		
          this.m_Openers.Clear();
	
          return true;
      }
Example #23
0
        public override bool OnMoveInto(Mobile from, Direction d, Point3D newLocation, Point3D oldLocation)
        {
            if (!base.OnMoveInto(from, d, newLocation, oldLocation))
                return false;

            if (from is BaseCreature && ((BaseCreature)from).NoHouseRestrictions)
            {
            }
            else if (from is BaseCreature && !((BaseCreature)from).Controlled) // Untamed creatures cannot enter public houses
            {
                return false;
            }
            else if (from is BaseCreature && ((BaseCreature)from).IsHouseSummonable && !(BaseCreature.Summoning || this.m_House.IsInside(oldLocation, 16)))
            {
                return false;
            }
            else if (from is BaseCreature && !((BaseCreature)from).Controlled && this.m_House.IsAosRules && !this.m_House.Public)
            {
                return false;
            }
            else if ((this.m_House.Public || !this.m_House.IsAosRules) && this.m_House.IsBanned(from) && this.m_House.IsInside(newLocation, 16))
            {
                from.Location = this.m_House.BanLocation;

                if (!Core.SE)
                    from.SendLocalizedMessage(501284); // You may not enter.

                return false;
            }
            else if (this.m_House.IsAosRules && !this.m_House.Public && !this.m_House.HasAccess(from) && this.m_House.IsInside(newLocation, 16))
            {
                if (!Core.SE)
                    from.SendLocalizedMessage(501284); // You may not enter.

                return false;
            }
            else if (this.m_House.IsCombatRestricted(from) && !this.m_House.IsInside(oldLocation, 16) && this.m_House.IsInside(newLocation, 16))
            {
                from.SendLocalizedMessage(1061637); // You are not allowed to access this.
                return false;
            }
            else if (this.m_House is HouseFoundation)
            {
                HouseFoundation foundation = (HouseFoundation)this.m_House;

                if (foundation.Customizer != null && foundation.Customizer != from && this.m_House.IsInside(newLocation, 16))
                    return false;
            }

            if (this.m_House.InternalizedVendors.Count > 0 && this.m_House.IsInside(from) && !this.m_House.IsInside(oldLocation, 16) && this.m_House.IsOwner(from) && from.Alive && !from.HasGump(typeof(NoticeGump)))
            {
                /* This house has been customized recently, and vendors that work out of this
                * house have been temporarily relocated.  You must now put your vendors back to work.
                * To do this, walk to a location inside the house where you wish to station
                * your vendor, then activate the context-sensitive menu on your avatar and
                * select "Get Vendor".
                */
                from.SendGump(new NoticeGump(1060635, 30720, 1061826, 32512, 320, 180, null, null));
            }

            return true;
        }