Exemplo n.º 1
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;
                    }
                }
            }
Exemplo n.º 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.
            }
        }
Exemplo n.º 3
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;
                    }
                }
            }
Exemplo n.º 4
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;
                    }
                }
            }
Exemplo n.º 5
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;
                    }
                }
            }
Exemplo n.º 6
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;
					}
				}
			}
Exemplo n.º 7
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.
            }
        }
Exemplo n.º 8
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!
                    }
                }
            }
Exemplo n.º 9
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;
                    }
                }
            }