本文整理汇总了C#中Server.Multis.BaseHouse.IsOwner方法的典型用法代码示例。如果您正苦于以下问题:C# BaseHouse.IsOwner方法的具体用法?C# BaseHouse.IsOwner怎么用?C# BaseHouse.IsOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Multis.BaseHouse
的用法示例。
在下文中一共展示了BaseHouse.IsOwner方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ValidatePlacement
public bool ValidatePlacement(Point3D loc)
{
Map map = m_From.Map;
if (map == null)
return false;
m_House = BaseHouse.FindHouseAt(m_From.Location, map, 20);
if (m_House == null || !m_House.IsOwner(m_From))
{
m_From.SendMessage("You must be standing in your house to place this");
return false;
}
if (loc.Y > m_From.Location.Y + YardSettings.Front || loc.Y < m_From.Location.Y - YardSettings.Back)
{
m_From.SendMessage("This is outside of your yard. Please re-try the placement");
return false;
}
if (loc.X > m_From.Location.X + YardSettings.Right || loc.X < m_From.Location.X - YardSettings.Left)
{
m_From.SendMessage("This is outside of your yard. Please re-try the placement");
return false;
}
return true;
}
示例2: HouseGumpAOS
public HouseGumpAOS( HouseGumpPageAOS page, Mobile from, BaseHouse house ) : base( 50, 40 )
{
m_House = house;
m_Page = page;
from.CloseGump( typeof( HouseGumpAOS ) );
//from.CloseGump( typeof( HouseListGump ) );
//from.CloseGump( typeof( HouseRemoveGump ) );
bool isCombatRestricted = house.IsCombatRestricted( from );
bool isOwner = house.IsOwner( from );
bool isCoOwner = isOwner || house.IsCoOwner( from );
bool isFriend = isCoOwner || house.IsFriend( from );
if ( isCombatRestricted )
isFriend = isCoOwner = isOwner = false;
AddPage( 0 );
if ( isFriend || page == HouseGumpPageAOS.Vendors )
{
AddBackground( 0, 0, 420, page != HouseGumpPageAOS.Vendors ? 440 : 420, 5054 );
AddImageTiled( 10, 10, 400, 100, 2624 );
AddAlphaRegion( 10, 10, 400, 100 );
AddImageTiled( 10, 120, 400, 260, 2624 );
AddAlphaRegion( 10, 120, 400, 260 );
AddImageTiled( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20, 2624 );
AddAlphaRegion( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20 );
AddButtonLabeled( 250, page != HouseGumpPageAOS.Vendors ? 410 : 390, 0, 1060675 ); // CLOSE
}
AddImage( 10, 10, 100 );
if ( m_House.Sign != null )
{
ArrayList lines = Wrap( m_House.Sign.GetName() );
if ( lines != null )
{
for ( int i = 0, y = (114 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
{
string s = (string)lines[i];
AddLabel( 10 + ((160 - (s.Length * 8)) / 2), y, 0, s );
}
}
}
if ( page == HouseGumpPageAOS.Vendors )
{
AddHtmlLocalized( 10, 120, 400, 20, 1062428, LabelColor, false, false ); // <CENTER>SHOPS</CENTER>
AddList( house.AvailableVendorsFor( from ), 1, false, false, from );
return;
}
if ( !isFriend )
return;
if ( house != null )
{
AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), 1060674 ); // Banish
AddButtonLabeled( 10, 410, GetButtonID( 0, 1 ), 1011261 ); // Lift a Ban
}
/*Zycron
else
{
AddButtonLabeled( 10, 390, GetButtonID( 0, 2 ), 1060676 ); // Grant Access
AddButtonLabeled( 10, 410, GetButtonID( 0, 3 ), 1060677 ); // Revoke Access
}
Zycron*/
AddPageButton( 150, 10, GetButtonID( 1, 0 ), 1060668, HouseGumpPageAOS.Information );
AddPageButton( 150, 30, GetButtonID( 1, 1 ), 1060669, HouseGumpPageAOS.Security );
AddPageButton( 150, 50, GetButtonID( 1, 2 ), 1060670, HouseGumpPageAOS.Storage );
AddPageButton( 150, 70, GetButtonID( 1, 3 ), 1060671, HouseGumpPageAOS.Customize );
AddPageButton( 150, 90, GetButtonID( 1, 4 ), 1060672, HouseGumpPageAOS.Ownership );
switch ( page )
{
case HouseGumpPageAOS.Information:
{
AddHtmlLocalized( 20, 130, 200, 20, 1011242, LabelColor, false, false ); // Owned By:
AddLabel( 210, 130, LabelHue, GetOwnerName() );
AddHtmlLocalized( 20, 170, 380, 20, 1018032, SelectedColor, false, false ); // This house is properly placed.
AddHtmlLocalized( 20, 190, 380, 20, 1018035, SelectedColor, false, false ); // This house is of modern design.
AddHtmlLocalized( 20, 210, 380, 20, (house is HouseFoundation) ? 1060681 : 1060680, SelectedColor, false, false ); // This is a (pre | custom)-built house.
AddHtmlLocalized( 20, 230, 380, 20, house.Public ? 1060678 : 1060679, SelectedColor, false, false ); // This house is (private | open to the public).
switch ( house.DecayType )
{
case DecayType.Ageless:
case DecayType.AutoRefresh:
{
AddHtmlLocalized( 20, 250, 380, 20, 1062209, SelectedColor, false, false ); // This house is <a href = "?ForceTopic97">Automatically</a> refreshed.
//.........这里部分代码省略.........
示例3: CheckHouse
public static bool CheckHouse( Mobile from, Point3D p, Map map, int height, ref BaseHouse house )
{
house = BaseHouse.FindHouseAt( p, map, height );
if ( from == null || house == null || !house.IsOwner( from ) )
return false;
return true;
}
示例4: PlayerBBGump
public PlayerBBGump( Mobile from, BaseHouse house, BasePlayerBB board, int page )
: base(50, 10)
{
from.CloseGump( typeof( PlayerBBGump ) );
m_Page = page;
m_From = from;
m_House = house;
m_Board = board;
AddPage( 0 );
AddImage( 30, 30, 5400 );
AddButton( 393, 145, 2084, 2084, 4, GumpButtonType.Reply, 0 ); // Scroll up
AddButton( 390, 371, 2085, 2085, 5, GumpButtonType.Reply, 0 ); // Scroll down
AddButton( 32, 183, 5412, 5413, 1, GumpButtonType.Reply, 0 ); // Post message
if ( house.IsOwner( from ) )
{
AddButton( 63, 90, 5601, 5605, 2, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 81, 89, 230, 20, 1062400, LabelColor, false, false ); // Set title
AddButton( 63, 109, 5601, 5605, 3, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 81, 108, 230, 20, 1062401, LabelColor, false, false ); // Post greeting
}
string title = board.Title;
if ( title != null )
AddHtml( 183, 68, 180, 23, title, false, false );
AddHtmlLocalized( 385, 89, 60, 20, 1062409, LabelColor, false, false ); // Post
AddLabel( 440, 89, LabelHue, page.ToString() );
AddLabel( 455, 89, LabelHue, "/" );
AddLabel( 470, 89, LabelHue, board.Messages.Count.ToString() );
PlayerBBMessage message = board.Greeting;
if ( page >= 1 && page <= board.Messages.Count )
message = (PlayerBBMessage)board.Messages[page - 1];
AddImageTiled( 150, 220, 240, 1, 2700 ); // Separator
AddHtmlLocalized( 150, 180, 100, 20, 1062405, 16715, false, false ); // Posted On:
AddHtmlLocalized( 150, 200, 100, 20, 1062406, 16715, false, false ); // Posted By:
if ( message != null )
{
AddHtml( 255, 180, 150, 20, message.Time.ToString( "yyyy-MM-dd HH:mm:ss" ), false, false );
Mobile poster = message.Poster;
string name = ( poster == null ? null : poster.Name );
if ( name == null || (name = name.Trim()).Length == 0 )
name = "Someone";
AddHtml( 255, 200, 150, 20, name, false, false );
string body = message.Message;
if ( body == null )
body = "";
AddHtml( 150, 240, 250, 100, body, false, false );
if ( message != board.Greeting && house.IsOwner( from ) )
{
AddButton( 130, 395, 1209, 1210, 6, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 150, 393, 150, 20, 1062410, LabelColor, false, false ); // Banish Poster
AddButton( 310, 395, 1209, 1210, 7, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 330, 393, 150, 20, 1062411, LabelColor, false, false ); // Delete Message
}
if ( from.AccessLevel >= AccessLevel.GameMaster )
AddButton( 135, 242, 1209, 1210, 8, GumpButtonType.Reply, 0 ); // Post props
}
}
示例5: HouseGump
public HouseGump( Mobile from, BaseHouse house )
: base(20, 30)
{
if ( house.Deleted )
return;
m_House = house;
from.CloseGump( typeof( HouseGump ) );
from.CloseGump( typeof( HouseListGump ) );
from.CloseGump( typeof( HouseRemoveGump ) );
bool isCombatRestricted = house.IsCombatRestricted( from );
bool isOwner = m_House.IsOwner( from );
bool isCoOwner = isOwner || m_House.IsCoOwner( from );
bool isFriend = isCoOwner || m_House.IsFriend( from );
if ( isCombatRestricted )
isFriend = isCoOwner = isOwner = false;
AddPage( 0 );
if ( isFriend )
{
AddBackground( 0, 0, 420, 430, 5054 );
AddBackground( 10, 10, 400,410, 3000 );
}
AddImage( 130, 0, 100 );
if ( m_House.Sign != null )
{
ArrayList lines = Wrap( m_House.Sign.Name );
if ( lines != null )
{
for ( int i = 0, y = (101 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
{
string s = (string)lines[i];
AddLabel( 130 + ((143 - (s.Length * 8)) / 2), y, 0, s );
}
}
}
if ( !isFriend )
return;
AddHtmlLocalized( 55, 103, 75, 20, 1011233, false, false ); // INFO
AddButton( 20, 103, 4005, 4007, 0, GumpButtonType.Page, 1 );
AddHtmlLocalized( 170, 103, 75, 20, 1011234, false, false ); // FRIENDS
AddButton( 135, 103, 4005, 4007, 0, GumpButtonType.Page, 2 );
AddHtmlLocalized( 295, 103, 75, 20, 1011235, false, false ); // OPTIONS
AddButton( 260, 103, 4005, 4007, 0, GumpButtonType.Page, 3 );
AddHtmlLocalized( 295, 390, 75, 20, 1011441, false, false ); // EXIT
AddButton( 260, 390, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 55, 390, 200, 20, 1011236, false, false ); // Change this house's name!
AddButton( 20, 390, 4005, 4007, 1, GumpButtonType.Reply, 0 );
// Info page
AddPage( 1 );
AddHtmlLocalized( 20, 135, 100, 20, 1011242, false, false ); // Owned by:
AddHtml( 120, 135, 100, 20, GetOwnerName(), false, false );
AddHtmlLocalized( 20, 170, 275, 20, 1011237, false, false ); // Number of locked down items:
AddHtml( 320, 170, 50, 20, m_House.LockDownCount.ToString(), false, false );
AddHtmlLocalized( 20, 190, 275, 20, 1011238, false, false ); // Maximum locked down items:
AddHtml( 320, 190, 50, 20, m_House.MaxLockDowns.ToString(), false, false );
AddHtmlLocalized( 20, 210, 275, 20, 1011239, false, false ); // Number of secure containers:
AddHtml( 320, 210, 50, 20, m_House.SecureCount.ToString(), false, false );
AddHtmlLocalized( 20, 230, 275, 20, 1011240, false, false ); // Maximum number of secure containers:
AddHtml( 320, 230, 50, 20, m_House.MaxSecures.ToString(), false, false );
AddHtmlLocalized( 20, 260, 400, 20, 1018032, false, false ); // This house is properly placed.
AddHtmlLocalized( 20, 280, 400, 20, 1018035, false, false ); // This house is of modern design.
if ( m_House.Public )
{
// TODO: Validate exact placement
AddHtmlLocalized( 20, 305, 275, 20, 1011241, false, false ); // Number of visits this building has had
AddHtml( 320, 305, 50, 20, m_House.Visits.ToString(), false, false );
}
// Friends page
AddPage( 2 );
AddHtmlLocalized( 45, 130, 150, 20, 1011266, false, false ); // List of co-owners
AddButton( 20, 130, 2714, 2715, 2, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 45, 150, 150, 20, 1011267, false, false ); // Add a co-owner
AddButton( 20, 150, 2714, 2715, 3, GumpButtonType.Reply, 0 );
//.........这里部分代码省略.........
示例6: HouseGump
public HouseGump(Mobile from, BaseHouse house) : base(20, 30)
{
if (house.Deleted)
return;
m_House = house;
from.CloseGump(typeof(HouseGump));
from.CloseGump(typeof(HouseListGump));
from.CloseGump(typeof(HouseRemoveGump));
bool isOwner = m_House.IsOwner(from);
bool isCoOwner = isOwner || m_House.IsCoOwner(from);
bool isFriend = isCoOwner || m_House.IsFriend(from);
AddPage(0);
if (isFriend)
{
AddBackground(0, 40, 380, 285, 0xA28);
AddBackground(15, 100, 350, 25, 0x13EC);
}
AddImage(120, 0, 100);
if (m_House.Sign != null)
{
ArrayList lines = Wrap(m_House.Sign.GetName());
if (lines != null)
{
for (int i = 0, y = (101 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14)
{
string s = (string)lines[i];
AddLabel(130 + ((143 - (s.Length * 8)) / 2), y, 0x455, (string)lines[i]);
}
}
}
if (!isFriend)
return;
AddLabel(30, 102, 0x0, "INFO");
AddButton(80, 104, 0x1459, 0x1459, 0, GumpButtonType.Page, 1);
AddLabel(120, 102, 0x0, "FRIENDS");
AddButton(210, 104, 0x1459, 0x1459, 0, GumpButtonType.Page, 2);
AddLabel(245, 102, 0x0, "OPTIONS");
AddButton(335, 103, 0x1459, 0x1459, 0, GumpButtonType.Page, 3);
AddButton(50, 290, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0);
// Info page
AddPage(1);
AddLabel(100, 140, 0x0, "Owned by");
AddLabel(180, 140, 0x455, GetOwnerName());
AddLabel(30, 170, 0x0, "Number of locked down items:");
AddLabel(250, 170, 0x0, m_House.LockDownCount.ToString() + " out of " + m_House.MaxLockDowns.ToString());
AddLabel(30, 190, 0x0, "Number of secure containers:");
AddLabel(250, 190, 0x0, m_House.SecureCount.ToString() + " out of " + m_House.MaxSecures.ToString());
AddLabel(30, 240, 0x0, "This house is of modern design");
if (m_House.Public)
{
AddHtmlLocalized(30, 260, 275, 20, 1011241, false, false);
AddHtml(320, 260, 50, 20, m_House.Visits.ToString(), false, false);
}
AddLabel(130, 290, 0x0, "Change the house's name!");
AddButton(310, 290, 0xA9A, 0xA9B, 1, GumpButtonType.Reply, 0);
// Friends page
AddPage(2);
AddLabel(55, 127, 0x0, "List of Co-Owners");
AddButton(30, 127, 0xA9A, 0xA9B, 2, GumpButtonType.Reply, 0);
AddLabel(55, 147, 0x0, "Add a Co-Owner");
AddButton(30, 147, 0xA9A, 0xA9B, 3, GumpButtonType.Reply, 0);
AddLabel(55, 167, 0x0, "Remove a Co-Owner");
AddButton(30, 167, 0xA9A, 0xA9B, 4, GumpButtonType.Reply, 0);
AddLabel(200, 127, 0x0, "List of Friends");
AddButton(175, 127, 0xA9A, 0xA9B, 6, GumpButtonType.Reply, 0);
AddLabel(200, 147, 0x0, "Add a Friend");
AddButton(175, 147, 0xA9A, 0xA9B, 7, GumpButtonType.Reply, 0);
AddLabel(200, 167, 0x0, "Remove a Friend");
AddButton(175, 167, 0xA9A, 0xA9B, 8, GumpButtonType.Reply, 0);
AddLabel(200, 187, 0x0, "Clear Friend List");
AddButton(175, 187, 0xA9A, 0xA9B, 9, GumpButtonType.Reply, 0);
//.........这里部分代码省略.........
示例7: ValidateHouse
private bool ValidateHouse( BaseHouse house, Mobile m )
{
if( house == null )
return false;
else if( house.IsOwner( m ) || house.IsCoOwner( m ) )
return true;
return false;
}
示例8: OnTarget
protected override void OnTarget( Mobile from, object targeted )
{
if ( from == null )
return;
if ( targeted is HouseSign )
{
HouseSign sign = ( HouseSign ) targeted;
if ( sign.Owner == null )
{
from.SendMessage( "That house sign does not seem to have a house associated with it." );
}
else
{
m_Godhouse = sign.Owner;
if ( m_Godhouse.IsOwner( from ) )
{
m_Godhouse.Owner = m_landlord;
m_Godhouse.Public = true;
m_landlord.Direction = from.Direction & Direction.Mask;
m_landlord.MoveToWorld( from.Location, from.Map );
m_landlord.Godhouse = m_Godhouse;
m_landlord.SayTo( from, "Props me and set the terms!" );
}
else
from.SendMessage( "This house is owned by a player and is off limits!" );
}
}
else
from.SendMessage( "That does not appear to be a house sign." );
}
示例9: HouseGump
public HouseGump(Mobile from, BaseHouse house)
: base(100, 50)
{
if (house.Deleted)
return;
bool isTent = house is Tent;
m_House = house;
from.CloseGump(typeof(HouseGump));
from.CloseGump(typeof(HouseListGump));
from.CloseGump(typeof(HouseRemoveGump));
bool isCombatRestricted = house.IsCombatRestricted(from);
bool isOwner = m_House.IsOwner(from);
bool isCoOwner = isOwner || m_House.IsCoOwner(from);
bool isFriend = isCoOwner || m_House.IsFriend(from);
if (isCombatRestricted)
isFriend = isCoOwner = isOwner = false;
AddPage(0);
if (isFriend)
{
AddBackground(100, 100, 400, 300, 0xA28);
AddBackground(116, 165, 369, 25, 0x13EC);
}
AddImage(230, 65, 100);
if (m_House.Sign != null)
{
ArrayList lines = Wrap(m_House.Sign.Name);
if (lines != null) //HOUSE SIGN NAME TO FIX
{
for (int i = 0, y = (101 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14)
{
string s = (string)lines[i];
string housename = String.Format("<big>{0}</big>", s);
AddHtml(230 + ((143 - (s.Length * 8)) / 2), y + 65, 100, 20, housename, false, false);
}
}
}
if (!isFriend)
return;
AddHtml(125, 168, 75, 20, "<big>INFO</big>", false, false); //INFO
AddButton(170, 169, 0x1459, 0x138B, 0, GumpButtonType.Page, 1);
AddHtml(230, 168, 75, 20, "<big>FRIENDS</big>", false, false); //FRIENDS
AddButton(310, 169, 0x1459, 0x138B, 0, GumpButtonType.Page, 2);
AddHtml(375, 168, 75, 20, "<big>OPTIONS</big>", false, false); //OPTIONS
AddButton(455, 169, 0x1459, 0x138B, 0, GumpButtonType.Page, 3);
// Info page
AddPage(1);
AddButton(150, 366, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0); //EXIT;
AddHtml(245, 365, 300, 20, "<big>Change this house's name!</big>", false, false); //Change this house's name!
AddButton(425, 365, 0xA9A, 0xA9B, 1, GumpButtonType.Reply, 0);
string ownedbyname = String.Format("<big><center><basefont color=white>Owned by <basefont color=black>{0}</big></center>", GetOwnerName());
AddHtml(100, 205, 400, 20, ownedbyname, false, false);
string lockdowns = String.Format("<big><basefont color=white>Number of locked down items:<basefont color=black> {0} out of {1}</basefont>", m_House.LockDownCount, m_House.MaxLockDowns);
AddHtml(140, 240, 350, 20, lockdowns, false, false);
string secures = String.Format("<big><basefont color=white>Number of secure containers:<basefont color=black> {0} out of {1}</basefont>", m_House.SecureCount, m_House.MaxSecures);
AddHtml(140, 260, 350, 20, secures, false, false);
AddHtml(140, 315, 400, 20, "<big><basefont color=white>This house is properly placed.</big></basefont>", false, false);
AddHtml(140, 333, 400, 20, "<big><basefont color=white>This house is of classic design.</big></basefont>", false, false);
if (m_House.Public)
{
string visits = String.Format("<big><basefont color=white>Number of visits this building has had: <basefont color=black>{0}</big></basefont>", m_House.Visits);
AddHtml(140, 295, 400, 20, visits, false, false);
}
// Friends page
AddPage(2);
AddButton(150, 366, 0xF7, 0xF8, 0, GumpButtonType.Reply, 0); //EXIT;
AddHtml(153, 194, 150, 20, "<big><basefont color=white>List of co-owners</basefont>", false, false); // <big><basefont color=white>List of co-owners</basefont>
AddButton(125, 194, 2714, 2715, 2, GumpButtonType.Reply, 0);
AddHtml(153, 216, 150, 20, "<big><basefont color=white>Add a co-owner</basefont>", false, false); // <big><basefont color=white>Add a co-owner</basefont>
AddButton(125, 216, 2714, 2715, 3, GumpButtonType.Reply, 0);
AddHtml(153, 238, 150, 20, "<big><basefont color=white>Remove a co-owner</basefont>", false, false); // <big><basefont color=white>Remove a co-owner</basefont>
AddButton(125, 238, 2714, 2715, 4, GumpButtonType.Reply, 0);
//.........这里部分代码省略.........
示例10: HouseGumpAOS
public HouseGumpAOS( HouseGumpPageAOS page, Mobile from, BaseHouse house )
: base(50, 40)
{
m_House = house;
m_Page = page;
from.CloseGump( typeof( HouseGumpAOS ) );
//from.CloseGump( typeof( HouseListGump ) );
//from.CloseGump( typeof( HouseRemoveGump ) );
bool isCombatRestricted = house.IsCombatRestricted( from );
bool isOwner = house.IsOwner( from );
bool isCoOwner = isOwner || house.IsCoOwner( from );
bool isFriend = isCoOwner || house.IsFriend( from );
if ( isCombatRestricted )
isFriend = isCoOwner = isOwner = false;
AddPage( 0 );
if ( isFriend || page == HouseGumpPageAOS.Vendors )
{
AddBackground(0, 0, 420, page != HouseGumpPageAOS.Vendors ? 440 : 420, 9270);
AddImageTiled( 10, 10, 400, 100, 2624 );
//AddAlphaRegion( 10, 10, 400, 100 );
AddImageTiled( 10, 120, 400, 260, 2624 );
//AddAlphaRegion( 10, 120, 400, 260 );
AddImageTiled( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20, 2624 );
//AddAlphaRegion( 10, 390, 400, page != HouseGumpPageAOS.Vendors ? 40 : 20 );
AddButtonLabeled( 250, page != HouseGumpPageAOS.Vendors ? 410 : 390, 0, "Fechar", true ); // CLOSE
}
AddImage( 10, 10, 100 );
if ( m_House.Sign != null )
{
ArrayList lines = Wrap( m_House.Sign.GetName() );
if ( lines != null )
{
for ( int i = 0, y = (114 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
{
string s = (string)lines[i];
AddLabel( 10 + ((160 - (s.Length * 8)) / 2), y, 0, s );
}
}
}
if ( page == HouseGumpPageAOS.Vendors )
{
AddHtmlLocalized( 10, 120, 400, 20, 1062428, LabelColor, false, false ); // <CENTER>SHOPS</CENTER>
AddList( house.AvailableVendorsFor( from ), 1, false, false, from );
return;
}
if ( !isFriend )
return;
if ( house.Public )
{
AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), "Banir", true); // Banish
AddButtonLabeled(10, 410, GetButtonID(0, 1), "Remover Ban", true); // Lift a Ban
}
else
{
AddButtonLabeled(10, 390, GetButtonID(0, 2), "Permitir Acesso", true); // Grant Access
AddButtonLabeled(10, 410, GetButtonID(0, 3), "Remover Acesso", true); // Revoke Access
}
AddPageButton( 150, 10, GetButtonID( 1, 0 ), "INFORMAÇÕES", HouseGumpPageAOS.Information );
AddPageButton( 150, 30, GetButtonID( 1, 1 ), "SEGURANÇA", HouseGumpPageAOS.Security );
AddPageButton( 150, 50, GetButtonID( 1, 2 ), "SECURES", HouseGumpPageAOS.Storage );
AddPageButton( 150, 70, GetButtonID( 1, 3 ), "CUSTOMIZAR", HouseGumpPageAOS.Customize );
AddPageButton( 150, 90, GetButtonID( 1, 4 ), "TRANSFERIR", HouseGumpPageAOS.Ownership );
switch ( page )
{
case HouseGumpPageAOS.Information:
{
//AddHtmlLocalized( 20, 130, 200, 20, 1011242, LabelColor, false, false ); // Owned By:
AddHtml(20, 130, 200, 20, "Dono: " + GetOwnerName(), false, false); // Owned By:
//AddLabel( 210, 130, LabelHue, GetOwnerName() );
AddHtml(20, 170, 380, 20, "Esta casa está colocada corretamente", false, false); // This house is properly placed.
AddHtml(20, 190, 380, 20, "Esta casa é de estilo moderno", false, false); // This house is of modern design.
AddHtml(20, 210, 380, 20, (house is HouseFoundation) ? "Esta é uma casa customizada" : "Esta é uma casa pré-moldada", false, false); // This is a (pre | custom)-built house.
//AddHtmlLocalized(20, 230, 380, 20, house.Public ? "" : 1060679, SelectedColor, false, false); // This house is (private | open to the public).
AddHtml(20, 230, 380, 20, house.Public ? "Esta casa é pública" : "Esta casa é restrita", false, false); // This house is (private | open to the public).
switch ( house.DecayType )
{
case DecayType.Ageless:
case DecayType.AutoRefresh:
//.........这里部分代码省略.........
示例11: CheckHouse
public static bool CheckHouse( Mobile from, Point3D p, Map map, int height, ref BaseHouse house )
{
house = BaseHouse.FindHouseAt( p, map, height );
if ( house == null || ( from != null && from.AccessLevel < AccessLevel.GameMaster && !house.IsOwner( from ) && !house.IsCoOwner(from)) )
return false;
return true;
}
示例12: HouseGumpAOS
public HouseGumpAOS( HouseGumpPageAOS page, Mobile from, BaseHouse house ) : base( 50, 40 )
{
m_House = house;
m_Page = page;
from.CloseGump( typeof( HouseGumpAOS ) );
//from.CloseGump( typeof( HouseListGump ) );
//from.CloseGump( typeof( HouseRemoveGump ) );
bool isOwner = house.IsOwner( from );
bool isCoOwner = isOwner || house.IsCoOwner( from );
bool isFriend = isCoOwner || house.IsFriend( from );
AddPage( 0 );
if ( isFriend )
{
AddBackground( 0, 0, 420, 440, 5054 );
AddImageTiled( 10, 10, 400, 100, 2624 );
AddAlphaRegion( 10, 10, 400, 100 );
AddImageTiled( 10, 120, 400, 260, 2624 );
AddAlphaRegion( 10, 120, 400, 260 );
AddImageTiled( 10, 390, 400, 40, 2624 );
AddAlphaRegion( 10, 390, 400, 40 );
AddButtonLabeled( 250, 410, 0, 1060675 ); // CLOSE
}
AddImage( 10, 10, 100 );
if ( m_House.Sign != null )
{
ArrayList lines = Wrap( m_House.Sign.Name );
if ( lines != null )
{
for ( int i = 0, y = (114 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
{
string s = (string)lines[i];
AddLabel( 10 + ((160 - (s.Length * 8)) / 2), y, 0, s );
}
}
}
if ( !isFriend )
return;
if ( house.Public )
{
AddButtonLabeled( 10, 390, GetButtonID( 0, 0 ), 1060674 ); // Banish
AddButtonLabeled( 10, 410, GetButtonID( 0, 1 ), 1011261 ); // Lift a Ban
}
else
{
AddButtonLabeled( 10, 390, GetButtonID( 0, 2 ), 1060676 ); // Grant Access
AddButtonLabeled( 10, 410, GetButtonID( 0, 3 ), 1060677 ); // Revoke Access
}
AddPageButton( 150, 10, GetButtonID( 1, 0 ), 1060668, HouseGumpPageAOS.Information );
AddPageButton( 150, 30, GetButtonID( 1, 1 ), 1060669, HouseGumpPageAOS.Security );
AddPageButton( 150, 50, GetButtonID( 1, 2 ), 1060670, HouseGumpPageAOS.Storage );
AddPageButton( 150, 70, GetButtonID( 1, 3 ), 1060671, HouseGumpPageAOS.Customize );
AddPageButton( 150, 90, GetButtonID( 1, 4 ), 1060672, HouseGumpPageAOS.Ownership );
switch ( page )
{
case HouseGumpPageAOS.Information:
{
AddHtmlLocalized( 20, 130, 200, 20, 1011242, LabelColor, false, false ); // Owned By:
AddLabel( 210, 130, LabelHue, GetOwnerName() );
AddHtmlLocalized( 20, 170, 380, 20, 1018032, SelectedColor, false, false ); // This house is properly placed.
AddHtmlLocalized( 20, 190, 380, 20, 1018035, SelectedColor, false, false ); // This house is of modern design.
AddHtmlLocalized( 20, 210, 380, 20, (house is HouseFoundation) ? 1060681 : 1060680, SelectedColor, false, false ); // This is a (pre | custom)-built house.
AddHtmlLocalized( 20, 230, 380, 20, house.Public ? 1060678 : 1060679, SelectedColor, false, false ); // This house is (private | open to the public).
AddHtmlLocalized( 20, 250, 380, 20, 1062209, SelectedColor, false, false ); // This house is <a href = "?ForceTopic97">Automatically</a> refreshed.
AddHtmlLocalized( 20, 290, 200, 20, 1060692, SelectedColor, false, false ); // Built On:
AddLabel( 250, 290, LabelHue, GetDateTime( house.BuiltOn ) );
AddHtmlLocalized( 20, 310, 200, 20, 1060693, SelectedColor, false, false ); // Last Traded:
AddLabel( 250, 310, LabelHue, GetDateTime( house.LastTraded ) );
AddHtmlLocalized( 20, 330, 200, 20, 1061793, SelectedColor, false, false ); // House Value
AddLabel( 250, 330, LabelHue, house.Price.ToString() );
AddHtmlLocalized( 20, 360, 300, 20, 1011241, SelectedColor, false, false ); // Number of visits this building has had:
AddLabel( 350, 360, LabelHue, house.Visits.ToString() );
break;
}
case HouseGumpPageAOS.Security:
{
AddButtonLabeled( 10, 130, GetButtonID( 3, 0 ), 1011266, isCoOwner ); // View Co-Owner List
AddButtonLabeled( 10, 150, GetButtonID( 3, 1 ), 1011267, isOwner ); // Add a Co-Owner
AddButtonLabeled( 10, 170, GetButtonID( 3, 2 ), 1018036, isOwner ); // Remove a Co-Owner
//.........这里部分代码省略.........
示例13: HouseGump
public HouseGump( Mobile from, BaseHouse house ) : base( 20, 30 )
{
if ( house.Deleted )
return;
m_House = house;
from.CloseGump( typeof( HouseGump ) );
from.CloseGump( typeof( HouseListGump ) );
from.CloseGump( typeof( HouseRemoveGump ) );
bool isOwner = m_House.IsOwner( from );
bool isCoOwner = isOwner || m_House.IsCoOwner( from );
bool isFriend = isCoOwner || m_House.IsFriend( from );
AddPage( 0 );
if ( isFriend )
{
AddBackground( 0, 0, 420, 430, 5054 );
AddBackground( 10, 10, 400,410, 3000 );
}
AddImage( 130, 0, 100 );
if ( m_House.Sign != null )
{
ArrayList lines = Wrap( m_House.Sign.Name );
if ( lines != null )
{
for ( int i = 0, y = (101 - (lines.Count * 14)) / 2; i < lines.Count; ++i, y += 14 )
{
string s = (string)lines[i];
AddLabel( 130 + ((143 - (s.Length * 8)) / 2), y, 0, s );
}
}
}
if ( !isFriend )
return;
AddHtmlLocalized( 55, 103, 75, 20, 1011233, false, false ); // INFO
AddButton( 20, 103, 4005, 4007, 0, GumpButtonType.Page, 1 );
AddHtmlLocalized( 170, 103, 75, 20, 1011234, false, false ); // FRIENDS
AddButton( 135, 103, 4005, 4007, 0, GumpButtonType.Page, 2 );
AddHtmlLocalized( 295, 103, 75, 20, 1011235, false, false ); // OPTIONS
AddButton( 260, 103, 4005, 4007, 0, GumpButtonType.Page, 3 );
AddHtmlLocalized( 295, 390, 75, 20, 1011441, false, false ); // EXIT
AddButton( 260, 390, 4005, 4007, 0, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 55, 390, 200, 20, 1011236, false, false ); // Change this house's name!
AddButton( 20, 390, 4005, 4007, 1, GumpButtonType.Reply, 0 );
// Info page
AddPage( 1 );
//const int fieldStartC = 260; // Center
const int fieldStartN = 120; // Near
const int fieldStartF = 320; // Far
AddHtmlLocalized( 20, 135, 100, 20, 1011242, false, false ); // Owned by:
AddHtml(fieldStartN, 135, 100, 20, GetOwnerName(), false, false);
// Angel Island House decay display - owner only.
if( from.Account == m_House.Owner.Account || from.AccessLevel >= AccessLevel.GameMaster )
{
if (m_House.TownshipRestrictedRefresh)
{ // replace the entire "Decay Time" line
AddLabel(20, 155, 0x20, @"** NON TOWNSHIP HOUSE - WILL NOT REFRESH! **");
}
else
{
AddHtml(20, 155, 100, 20, "Decay Time:", false, false); //time until decay
TimeSpan decay = m_House.StructureDecayTime - DateTime.Now;
int days = decay.Days;
double hours = decay.Hours;
hours += ((double)decay.Minutes) / 60;
string decaystring = string.Format("{0} days, {1:0.0} hours", days, hours);
AddHtml(fieldStartN, 155, 300, 20, decaystring, false, false);
}
}
int vstep = 175 - 20;
AddHtml(20, vstep += 20, 275, 20, "Number of locked down items:", false, false); // Number of locked down items:
AddHtml(fieldStartF, vstep, 64, 20, String.Format("{0}/{1}", m_House.LockDownCount.ToString(), m_House.MaxLockDowns.ToString()), false, false);
//AddHtmlLocalized(20, vstep += 20, 275, 20, 1011238, false, false); // Maximum locked down items:
//AddHtml(320, vstep, 50, 20, m_House.MaxLockDowns.ToString(), false, false);
AddHtml(20, vstep += 20, 275, 20, "Number of secure containers:", false, false); // Number of secure containers:
AddHtml(fieldStartF, vstep, 64, 20, String.Format("{0}/{1}", m_House.SecureCount.ToString(), m_House.MaxSecures.ToString()), false, false);
//AddHtmlLocalized(20, vstep += 20, 275, 20, 1011240, false, false); // Maximum number of secure containers:
//AddHtml(320, vstep, 50, 20, m_House.MaxSecures.ToString(), false, false);
//.........这里部分代码省略.........