示例#1
0
        public override void OnDoubleClick(Mobile from)
        {
            Guildstone stone = m_Stone as Guildstone;

            if (!IsChildOf(from.Backpack))
            {
                from.SendAsciiMessage("That must be in your pack for you to use it.");
            }
            else if (stone == null || stone.Deleted || stone.Guild == null || stone.Guild.Teleporter != this)
            {
                from.SendAsciiMessage("This teleporting object can not determine what guildstone to teleport.");
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house == null)
                {
                    from.SendAsciiMessage("You can only place a guildstone in a house.");
                }
                else if (!house.IsOwner(from))
                {
                    from.SendAsciiMessage("You can only place a guildstone in a house you own!");
                }
                else
                {
                    m_Stone.MoveToWorld(from.Location, from.Map);
                    Delete();
                    stone.Guild.Teleporter = null;
                }
            }
        }
示例#2
0
        public void Placement_OnTarget(Mobile from, object targeted, object state)
        {
            IPoint3D p = targeted as IPoint3D;

            if (p == null || Deleted)
            {
                return;
            }

            Point3D loc = new Point3D(p);

            BaseHouse house = BaseHouse.FindHouseAt(loc, from.Map, 16);

            if (IsChildOf(from.Backpack))
            {
                if (house != null && house.IsOwner(from))
                {
                    Item addon = new Guildstone(m_Guild, m_GuildName, m_GuildAbbrev);

                    addon.MoveToWorld(loc, from.Map);

                    house.Addons.Add(addon);
                    Delete();
                }
                else
                {
                    from.SendLocalizedMessage(1042036); // That location is not in your house.
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
示例#3
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Deed.Deleted)
                {
                    return;
                }

                if (!m_Deed.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042001);                       // That must be in your pack for you to use it.
                }
                else if (from.Guild != null)
                {
                    from.SendLocalizedMessage(501137);                       // You must resign from your current guild before founding another!
                }
                else
                {
                    BaseHouse house = BaseHouse.FindHouseAt(from);

                    BaseGuild NameTest = Guild.FindByName(text);
                    //make sure we dont initially create a guild with same name as a exsisting one.
                    if (NameTest != null)
                    {
                        from.SendMessage("A guild with that name already exsists.");
                    }

                    else if (house == null)
                    {
                        from.SendLocalizedMessage(501138);                           // You can only place a guildstone in a house.
                    }
                    else if (house.FindGuildstone() != null)
                    {
                        from.SendLocalizedMessage(501142);                          //Only one guildstone may reside in a given house.
                    }
                    else if (!house.IsOwner(from))
                    {
                        from.SendLocalizedMessage(501141);                           // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        m_Deed.Delete();

                        if (text.Length > 40)
                        {
                            text = text.Substring(0, 40);
                        }

                        Guild guild = new Guild(from, text, "none");

                        from.Guild      = guild;
                        from.GuildTitle = "Guildmaster";

                        Guildstone stone = new Guildstone(guild);

                        stone.MoveToWorld(from.Location, from.Map);

                        guild.Guildstone = stone;
                    }
                }
            }
示例#4
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Deed.Deleted)
                {
                    return;
                }

                if (!m_Deed.IsChildOf(from.Backpack))
                {
                    from.SendMessage("O Item precisa estar na sua Bag!");
                    //from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
                }
                else if (from.Guild != null)
                {
                    from.SendMessage("Voce precisa sair da Guilda Atual antes de Fundar outra!");
                    //from.SendLocalizedMessage( 501137 ); // You must resign from your current guild before founding another!
                }
                else
                {
                    BaseHouse house = BaseHouse.FindHouseAt(from);

                    if (house == null)
                    {
                        from.SendMessage("Voce so pode colocar uma GuildStone dentro da sua casa!");
                        //from.SendLocalizedMessage( 501138 ); // You can only place a guildstone in a house.
                    }
                    else if (house.FindGuildstone() != null)
                    {
                        from.SendMessage("Apenas uma GuildStone pode estar dentro da casa!");
                        //from.SendLocalizedMessage( 501142 );//Only one guildstone may reside in a given house.
                    }
                    else if (!house.IsOwner(from))
                    {
                        from.SendMessage("Voce so pode colocar a GuildStone dentro de sua propria casa!");
                        //from.SendLocalizedMessage( 501141 ); // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        m_Deed.Delete();

                        if (text.Length > 40)
                        {
                            text = text.Substring(0, 40);
                        }

                        Guild guild = new Guild(from, text, "none");

                        from.Guild      = guild;
                        from.GuildTitle = "Guildmaster";

                        Guildstone stone = new Guildstone(guild);

                        stone.MoveToWorld(from.Location, from.Map);

                        guild.Guildstone = stone;
                    }
                }
            }
        public override void OnDoubleClick(Mobile from)
        {
            Guildstone stone = m_Stone as Guildstone;

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (stone == null || stone.Deleted || stone.Guild == null || stone.Guild.Teleporter != this)
            {
                from.SendLocalizedMessage(501197);                   // This teleporting object can not determine what guildstone to teleport
            }
            else
            {
                BaseHouse       house       = BaseHouse.FindHouseAt(from);
                StaticHouseSign staticHouse = StaticHouseSign.StaticFindHouseAt(from);

                if (house == null && staticHouse == null)
                {
                    from.SendLocalizedMessage(501138);                       // You can only place a guildstone in a house.
                }
                else if (staticHouse == null)
                {
                    if (house.FindGuildstone() != null)
                    {
                        from.SendLocalizedMessage(501142);                          //Only one guildstone may reside in a given house.
                    }
                    else if (!house.IsOwner(from))
                    {
                        from.SendLocalizedMessage(501141);                           // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        m_Stone.MoveToWorld(from.Location, from.Map);
                        Delete();
                        stone.Guild.Teleporter = null;
                    }
                }
                else
                {
                    if (staticHouse.FindGuildstone(from) != null)
                    {
                        from.SendLocalizedMessage(501142);                           //Only one guildstone may reside in a given house.
                    }
                    else if (!staticHouse.IsOwner(from))
                    {
                        from.SendLocalizedMessage(501141);                           // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        m_Stone.MoveToWorld(from.Location, from.Map);
                        Delete();
                        stone.Guild.Teleporter = null;
                    }
                }
            }
        }
示例#6
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Deed.Deleted)
                {
                    return;
                }

                if (!m_Deed.IsChildOf(from.Backpack))
                {
                    from.SendAsciiMessage("That must be in your pack for you to use it.");                       // That must be in your pack for you to use it.
                }
                else if (from.Guild != null)
                {
                    from.SendAsciiMessage("You must resign from your current guild before founding another!");                       // You must resign from your current guild before founding another!
                }
                else
                {
                    BaseHouse house = BaseHouse.FindHouseAt(from);
                    BaseBoat  boat  = BaseBoat.FindBoatAt(from.Location, from.Map);

                    if (house == null && boat == null)
                    {
                        from.SendAsciiMessage("You can only place a guildstone in a house or on a ship."); // You can only place a guildstone in a house.
                    }
                    else if ((house != null && (house.FindGuildstone() != null)) || (boat != null && (boat.FindGuildstone() != null)))
                    {
                        from.SendAsciiMessage("Only one guildstone may reside in a given house or ship.");//Only one guildstone may reside in a given house.
                    }
                    else if ((house != null && (!Key.ContainsKey(from.Backpack, house.keyValue))) || (boat != null && !Key.ContainsKey(from.Backpack, boat.PPlank.KeyValue)))
                    {
                        from.SendAsciiMessage("You can only place a guildstone in a house or ship you own!"); // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        m_Deed.Delete();

                        if (text.Length > 40)
                        {
                            text = text.Substring(0, 40);
                        }

                        Guild guild = new Guild(from, text, text);

                        from.Guild      = guild;
                        from.GuildTitle = "Guildmaster";

                        Guildstone stone = new Guildstone(guild);

                        stone.MoveToWorld(from.Location, from.Map);

                        guild.Guildstone = stone;
                    }
                }
            }
示例#7
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Deed.Deleted)
                {
                    return;
                }

                if (!m_Deed.IsChildOf(from.Backpack))
                {
                    from.SendAsciiMessage("That must be in your pack for you to use it.");
                }
                else if (from.Guild != null)
                {
                    from.SendAsciiMessage("You must resign from your current guild before founding another!");
                }
                else
                {
                    BaseHouse house = BaseHouse.FindHouseAt(from);

                    if (house == null)
                    {
                        from.SendAsciiMessage("You can only place a guildstone in a house.");
                    }
                    else if (house.FindGuildstone() != null)
                    {
                        from.SendAsciiMessage("Only one guildstone may reside in a given house.");
                    }
                    else if (!house.IsOwner(from))
                    {
                        from.SendAsciiMessage("You can only place a guildstone in a house you own!");
                    }
                    else
                    {
                        m_Deed.Delete();

                        if (text.Length > 40)
                        {
                            text = text.Substring(0, 40);
                        }

                        Guild guild = new Guild(from, text, "none");

                        from.Guild      = guild;
                        from.GuildTitle = "Guildmaster";

                        Guildstone stone = new Guildstone(guild);

                        stone.MoveToWorld(from.Location, from.Map);

                        guild.Guildstone = stone;
                    }
                }
            }
		public MoveGuildstoneGump( Mobile from, Guildstone stone ) : base( 50, 50 )
		{
			m_Stone = stone;

			AddPage( 0 );

			AddBackground( 10, 10, 190, 140, 0x242C );

			AddHtml( 30, 30, 150, 75, String.Format( "<div align=CENTER>{0}</div>", "Are you sure you want to re-deed this guildstone?" ), false, false );

			AddButton( 40, 105, 0x81A, 0x81B, 0x1, GumpButtonType.Reply, 0 ); // Okay
			AddButton( 110, 105, 0x819, 0x818, 0x2, GumpButtonType.Reply, 0 ); // Cancel
		}
示例#9
0
        public override void OnDoubleClick(Mobile from)
        {
            Guildstone stone = m_Stone as Guildstone;

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                   // That must be in your pack for you to use it.
            }
            else if (stone == null || stone.Deleted || stone.Guild == null || stone.Guild.Teleporter != this)
            {
                from.SendLocalizedMessage(501197);                   // This teleporting object can not determine what guildstone to teleport
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);

                if (house == null || house is Tent)
                {
                    from.SendLocalizedMessage(501138);                       // You can only place a guildstone in a house.
                }
                else if (!house.IsOwner(from))
                {
                    from.SendLocalizedMessage(501141);                       // You can only place a guildstone in a house you own!
                }
                else
                {
                    IPooledEnumerable eable = from.GetItemsInRange(1);
                    foreach (Item item in eable)
                    {
                        if (item is BaseDoor && (item.X == from.X || item.Y == from.Y) && item.Z - 5 < from.Z && item.Z + 5 > from.Z)
                        {
                            from.SendAsciiMessage("You cannot place this in front of a door.");
                            eable.Free();
                            return;
                        }
                    }
                    eable.Free();
                    m_Stone.MoveToWorld(from.Location, from.Map);
                    Delete();
                    stone.Guild.Teleporter = null;
                }
            }
        }
示例#10
0
 public override void OnDoubleClick(Mobile from)
 {
     if (from.Alive == false && from.AccessLevel <= AccessLevel.Player)
     {
         from.SendMessage("You are dead and cannot do that.");
     }
     else if (!IsChildOf(from.Backpack))
     {
         from.SendLocalizedMessage(1042001);                 //This must be in your backpack
     }
     else
     {
         if (m_Guild != null && m_Guild.Guildstone != null && m_Guild.Guildstone is Guildstone)
         {
             Guildstone stone = m_Guild.Guildstone as Guildstone;
             if (stone.PlaceStone(from))
             {
                 from.SendMessage("You place the guildstone.");
                 m_Guild = null; // you need to clear this else you delete your guildstone!
                 this.Delete();
             }
             else
             {
                 from.SendMessage("You cannot place this stone here.");
             }
         }
         else
         {
             from.SendMessage("The guildstone cannot be found.");
             try
             {
                 throw new ApplicationException(String.Format("The Guildstone {1} for GuildRestorationDeed {0} is missing. Check GuildDisbanded.log.", this.Serial, this.m_Serial));
             }
             catch (Exception exp)
             {
                 LogHelper.LogException(exp);
                 this.m_Guild = null;    // you need to clear this else you delete your guildstone!
                 this.Delete();          // no sense of leaving this around
             }
         }
     }
 }
示例#11
0
        public override void OnDoubleClick(Mobile from)
        {
            if (Guild.NewGuildSystem)
            {
                return;
            }

            Guildstone stone = m_Stone as Guildstone;

            if (!IsChildOf(from.Backpack))
            {
                from.SendAsciiMessage("That must be in your pack for you to use it.");                   // That must be in your pack for you to use it.
            }
            else if (stone == null || stone.Deleted || stone.Guild == null || stone.Guild.Teleporter != this)
            {
                from.SendAsciiMessage("This teleporting object can not determine what guildstone to teleport.");                   // This teleporting object can not determine what guildstone to teleport
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(from);
                BaseBoat  boat  = BaseBoat.FindBoatAt(from.Location, from.Map);

                if (house == null && boat == null)
                {
                    from.SendAsciiMessage("You can only place a guildstone in a house or on a ship."); // You can only place a guildstone in a house.
                }
                else if ((house != null && (!Key.ContainsKey(from.Backpack, house.keyValue))) || (boat != null && !Key.ContainsKey(from.Backpack, boat.PPlank.KeyValue)))
                {
                    from.SendAsciiMessage("You can only place a guildstone in a house or ship you own!"); // You can only place a guildstone in a house you own!
                }
                else
                {
                    m_Stone.MoveToWorld(from.Location, from.Map);
                    Delete();
                    stone.Guild.Teleporter = null;
                }
            }
        }
示例#12
0
            public override void OnResponse( Mobile from, string text )
            {
                if ( m_Deed.Deleted )
                    return;

                if ( !m_Deed.IsChildOf( from.Backpack ) )
                {
                    from.SendMessage("O Item precisa estar na sua Bag!");
                    //from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
                }
                else if ( from.Guild != null )
                {
                    from.SendMessage("Voce precisa sair da Guilda Atual antes de Fundar outra!");
                    //from.SendLocalizedMessage( 501137 ); // You must resign from your current guild before founding another!
                }
                else
                {
                    BaseHouse house = BaseHouse.FindHouseAt( from );

                    if ( house == null )
                    {
                        from.SendMessage("Voce so pode colocar uma GuildStone dentro da sua casa!");
                        //from.SendLocalizedMessage( 501138 ); // You can only place a guildstone in a house.
                    }
                    else if ( house.FindGuildstone() != null )
                    {
                        from.SendMessage("Apenas uma GuildStone pode estar dentro da casa!");
                        //from.SendLocalizedMessage( 501142 );//Only one guildstone may reside in a given house.
                    }
                    else if ( !house.IsOwner( from ) )
                    {
                        from.SendMessage("Voce so pode colocar a GuildStone dentro de sua propria casa!");
                        //from.SendLocalizedMessage( 501141 ); // You can only place a guildstone in a house you own!
                    }
                    else
                    {
                        m_Deed.Delete();

                        if ( text.Length > 40 )
                            text = text.Substring( 0, 40 );

                        Guild guild = new Guild( from, text, "none" );

                        from.Guild = guild;
                        from.GuildTitle = "Guildmaster";

                        Guildstone stone = new Guildstone( guild );

                        stone.MoveToWorld( from.Location, from.Map );

                        guild.Guildstone = stone;
                    }
                }
            }
示例#13
0
			public override void OnResponse( Mobile from, string text )
			{
				if ( m_Deed.Deleted )
					return;

				if ( !m_Deed.IsChildOf( from.Backpack ) )
				{
					from.SendLocalizedMessage( 1042001 ); // That must be in your pack for you to use it.
				}
				else if ( from.Guild != null )
				{
					from.SendLocalizedMessage( 501137 ); // You must resign from your current guild before founding another!
				}
				else
				{
					BaseHouse house = BaseHouse.FindHouseAt( from );

					if ( house == null )
					{
						from.SendLocalizedMessage( 501138 ); // You can only place a guildstone in a house.
					}
					else if ( house.FindGuildstone() != null )
					{
						from.SendLocalizedMessage( 501142 );//Only one guildstone may reside in a given house.
					}
					else if ( !house.IsOwner( from ) )
					{
						from.SendLocalizedMessage( 501141 ); // You can only place a guildstone in a house you own!
					}
					else
					{
						m_Deed.Delete();

						if ( text.Length > 40 )
							text = text.Substring( 0, 40 );

						Guild guild = new Guild( from, text, "none" );

						from.Guild = guild;
						from.GuildTitle = "Guildmaster";

						Guildstone stone = new Guildstone( guild );

						stone.MoveToWorld( from.Location, from.Map );

						guild.Guildstone = stone;
					}
				}
			}
示例#14
0
        public void Placement_OnTarget(Mobile from, object targeted, object state)
        {
            IPoint3D p = targeted as IPoint3D;

            if (p == null || Deleted)
                return;

            Point3D loc = new Point3D(p);

            BaseHouse house = BaseHouse.FindHouseAt(loc, from.Map, 16);

            if (IsChildOf(from.Backpack))
            {
                if (house != null && house.IsOwner(from))
                {
                    Item addon = new Guildstone(m_Guild, m_GuildName, m_GuildAbbrev);

                    addon.MoveToWorld(loc, from.Map);

                    house.Addons.Add(addon);
                    Delete();
                }
                else
                {
                    from.SendLocalizedMessage(1042036); // That location is not in your house.
                }
            }
            else
            {
                from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
            }
        }
示例#15
0
        public void Place(Mobile from, Point3D location, bool bCheck)
        {
            Guild g = from.Guild as Guild;;

            if (!IsChildOf(from.Backpack))
            {
                from.SendLocalizedMessage(1042001);                 //This must be in your backpack
            }
            else if (g == null)
            {
                from.SendMessage("You must be a member of a guild to use this.");
            }
            else
            {
                BaseHouse  house = BaseHouse.FindHouseAt(from);
                Guildstone stone = null;

                if (house != null)
                {
                    stone = house.FindGuildstone();
                }
                else
                {
                    stone = g.Guildstone as Guildstone;
                }

                //if (house == null || stone == null || stone.Guild != from.Guild)
                if (stone == null || stone.Guild != from.Guild)
                {
                    //from.SendMessage("You must be in the house with your guild's guildstone to use this.");
                    from.SendMessage("You must be a member of a guild and not be in a building which houses another guildstone to use this.");
                }
                else
                {
                    bool bZoneOverlaps = false;
                    bZoneOverlaps = DoesTownshipRegionConflict(location, from.Map, TownshipStone.INITIAL_RADIUS, null);

                    if (bZoneOverlaps)
                    {
                        from.SendMessage("You can't create a township that conflicts with another township, guardzone, or other special area.");
                        return;
                    }

                    double guildPercentage = GetPercentageOfGuildedHousesInArea(location, from.Map, TownshipStone.INITIAL_RADIUS, from.Guild as Guild, true);

                    if (guildPercentage >= Township.TownshipSettings.GuildHousePercentage)
                    {
                        if (bCheck)
                        {
                            from.SendGump(new ConfirmPlacementGump(from, location, this));
                        }
                        else
                        {
                            TownshipStone ts = new TownshipStone(stone.Guild);
                            ts.GoldHeld = Township.TownshipSettings.InitialFunds;                             //initial gold :-)
                            ts.MoveToWorld(location, from.Map);
                            ts.CreateInitialArea(location);

                            from.SendMessage("The township has been created.");

                            this.Delete();
                        }
                    }
                    else
                    {
                        from.SendMessage("You can't create a township without owning most of the houses in the area.");
                    }
                }
            }
        }
示例#16
0
            public override void OnResponse(Mobile from, string text)
            {
                if (m_Deed.Deleted)
                {
                    return;
                }

                if (!m_Deed.IsChildOf(from.Backpack))
                {
                    from.SendLocalizedMessage(1042001);                       // That must be in your pack for you to use it.
                }
                else if (from.Guild != null)
                {
                    from.SendLocalizedMessage(501137);                       // You must resign from your current guild before founding another!
                }
                else
                {
                    BaseHouse house = BaseHouse.FindHouseAt(from);

                    if (house == null)
                    {
                        m_Deed.Delete();

                        if (text.Length > 30)
                        {
                            text = text.Substring(0, 30);
                        }

                        Guild guild = new Guild(from, text, null);

                        from.Guild      = guild;
                        from.GuildTitle = "Guildmaster";

                        Guildstone stone = new Guildstone(guild);

                        stone.MoveToWorld(from.Location, from.Map);

                        guild.Guildstone = stone;
                    }

                    /*else if ( house.FindGuildstone() != null )
                     * {
                     *  from.SendLocalizedMessage( 501142 );//Only one guildstone may reside in a given house.
                     * }*/
                    else if (house.IsCoOwner(from))
                    {
                        m_Deed.Delete();

                        if (text.Length > 30)
                        {
                            text = text.Substring(0, 30);
                        }

                        Guild guild = new Guild(from, text, "none");

                        from.Guild      = guild;
                        from.GuildTitle = "Guildmaster";

                        Guildstone stone = new Guildstone(guild);

                        stone.MoveToWorld(from.Location, from.Map);

                        guild.Guildstone = stone;
                    }
                    else
                    {
                        from.SendAsciiMessage("You can not place a guildstone in house you dont own.");
                        //from.SendLocalizedMessage( 501141 ); // You can only place a guildstone in a house you own!
                    }
                }
            }
示例#17
0
        private Guildstone FindGuild(string abv)
        {
            // cache the stone
			if (m_Stone != null && m_Stone is Guildstone && m_Stone.Deleted == false)
                return m_Stone;
			else
				m_Stone = null;

            Guild guild = null;
            string name = abv.ToLower();
            foreach (Item n in World.Items.Values)
            {
                if (n is Guildstone && n != null)
                {
                    if (((Guildstone)n).Guild != null)
                        guild = ((Guildstone)n).Guild;

					if (guild.Abbreviation != null && guild.NewPlayerGuild == true && guild.Abbreviation.ToLower() == name)
                    {   // cache the guildstone
                        m_Stone = (Guildstone)guild.Guildstone;
                        return m_Stone;
                    }
                }
            }

            return null;
        }