Skip to content

Commit

Permalink
Merge pull request #52 from zerodowned/master
Browse files Browse the repository at this point in the history
EC Support Update
  • Loading branch information
zerodowned committed Jul 20, 2016
2 parents f8c33a7 + c750725 commit 2f7c4a5
Show file tree
Hide file tree
Showing 111 changed files with 9,597 additions and 6,039 deletions.
3 changes: 2 additions & 1 deletion Scripts/Commands/HelpInfo.cs
Expand Up @@ -272,7 +272,7 @@ public CommandListGump(int page, Mobile from, List<CommandInfo> list)

int last = (int)AccessLevel.Player - 1;

for (int i = m_Page * EntriesPerPage, line = 0; line < EntriesPerPage && i < m_List.Count; ++i, ++line)
for (int i = m_Page * EntriesPerPage, line = 0, extra = 0; line < EntriesPerPage && i < m_List.Count; ++i, ++line)
{
CommandInfo c = m_List[i];
if (from.AccessLevel >= c.AccessLevel)
Expand All @@ -284,6 +284,7 @@ public CommandListGump(int page, Mobile from, List<CommandInfo> list)
AddEntryHtml(20 + OffsetSize + 160, Color(c.AccessLevel.ToString(), 0xFF0000));
AddEntryHeader(20);
line++;
extra++;
}

last = (int)c.AccessLevel;
Expand Down
46 changes: 46 additions & 0 deletions Scripts/Gumps/ConfirmReleaseDeadPetGump.cs
@@ -0,0 +1,46 @@
using System;
using Server;
using Server.Mobiles;
using Server.Network;

namespace Server.Gumps
{
public class ConfirmReleaseDeadPetGump : Gump
{
public override int TypeID { get { return 0x259; } }

private Mobile m_From;
private BaseCreature m_Pet;

public ConfirmReleaseDeadPetGump( Mobile from, BaseCreature pet )
: base( 50, 50 )
{
m_From = from;
m_Pet = pet;

m_From.CloseGump( typeof( ConfirmReleaseDeadPetGump ) );

AddBackground( 0, 0, 270, 120, 0x13BE );

AddHtmlLocalized( 10, 10, 250, 75, 1049669, true, false ); // <div align=center>Releasing a ghost pet will destroy it, with no chance of recovery. Do you wish to continue?</div>

AddHtmlLocalized( 55, 90, 75, 20, 1011011, false, false ); // CONTINUE
AddButton( 20, 90, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 );

AddHtmlLocalized( 170, 90, 75, 20, 1011012, false, false ); // CANCEL
AddButton( 135, 90, 0xFA5, 0xFA7, 1, GumpButtonType.Reply, 0 );
}

public override void OnResponse( NetState sender, RelayInfo info )
{
if ( info.ButtonID == 2 )
{
if ( !m_Pet.Deleted && m_Pet.Controlled && m_From == m_Pet.ControlMaster && m_From.CheckAlive() )
{
if ( m_Pet.Map == m_From.Map && m_Pet.InRange( m_From, 14 ) )
m_Pet.Delete();
}
}
}
}
}
36 changes: 19 additions & 17 deletions Scripts/Gumps/ConfirmReleaseGump.cs
@@ -1,44 +1,46 @@
using System;
using Server.Mobiles;
using Server.Network;

namespace Server.Gumps
{
public class ConfirmReleaseGump : Gump
{
public override int TypeID { get { return 0x259; } }

private readonly Mobile m_From;
private readonly BaseCreature m_Pet;

public ConfirmReleaseGump(Mobile from, BaseCreature pet)
: base(50, 50)
{
this.m_From = from;
this.m_Pet = pet;

this.m_From.CloseGump(typeof(ConfirmReleaseGump));
m_From = from;
m_Pet = pet;

this.AddPage(0);
m_From.CloseGump(typeof(ConfirmReleaseGump));

this.AddBackground(0, 0, 270, 120, 5054);
this.AddBackground(10, 10, 250, 100, 3000);
AddBackground(0, 0, 270, 120, 5054);
AddBackground(10, 10, 250, 100, 3000);

this.AddHtmlLocalized(20, 15, 230, 60, 1046257, true, true); // Are you sure you want to release your pet?
AddHtmlLocalized(20, 15, 230, 60, 1046257, true, true); // Are you sure you want to release your pet?

this.AddButton(20, 80, 4005, 4007, 2, GumpButtonType.Reply, 0);
this.AddHtmlLocalized(55, 80, 75, 20, 1011011, false, false); // CONTINUE
AddHtmlLocalized(55, 80, 75, 20, 1011011, false, false); // CONTINUE
AddButton(20, 80, 4005, 4007, 2, GumpButtonType.Reply, 0);

this.AddButton(135, 80, 4005, 4007, 1, GumpButtonType.Reply, 0);
this.AddHtmlLocalized(170, 80, 75, 20, 1011012, false, false); // CANCEL
AddHtmlLocalized(170, 80, 75, 20, 1011012, false, false); // CANCEL
AddButton(135, 80, 4005, 4007, 1, GumpButtonType.Reply, 0);
}

public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
public override void OnResponse(NetState sender, RelayInfo info)
{
if (info.ButtonID == 2)
{
if (!this.m_Pet.Deleted && this.m_Pet.Controlled && this.m_From == this.m_Pet.ControlMaster && this.m_From.CheckAlive() /*&& m_Pet.CheckControlChance( m_From )*/)
if (!m_Pet.Deleted && m_Pet.Controlled && m_From == m_Pet.ControlMaster && m_From.CheckAlive())
{
if (this.m_Pet.Map == this.m_From.Map && this.m_Pet.InRange(this.m_From, 14))
if (m_Pet.Map == m_From.Map && m_Pet.InRange(this.m_From, 14))
{
this.m_Pet.ControlTarget = null;
this.m_Pet.ControlOrder = OrderType.Release;
m_Pet.ControlTarget = null;
m_Pet.ControlOrder = OrderType.Release;
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Gumps/Guilds/GuildAbbrvPrompt.cs
Expand Up @@ -6,6 +6,8 @@ namespace Server.Gumps
{
public class GuildAbbrvPrompt : Prompt
{
// Enter new guild abbreviation (3 characters max):
public override int MessageCliloc { get { return 1013061; } }
private readonly Mobile m_Mobile;
private readonly Guild m_Guild;
public GuildAbbrvPrompt(Mobile m, Guild g)
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Gumps/Guilds/GuildCharterPrompt.cs
Expand Up @@ -6,6 +6,8 @@ namespace Server.Gumps
{
public class GuildCharterPrompt : Prompt
{
// Enter the new guild charter (50 characters max):
public override int MessageCliloc { get { return 1013071; } }
private readonly Mobile m_Mobile;
private readonly Guild m_Guild;
public GuildCharterPrompt(Mobile m, Guild g)
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Gumps/Guilds/GuildDeclareWarPrompt.cs
Expand Up @@ -7,6 +7,8 @@ namespace Server.Gumps
{
public class GuildDeclareWarPrompt : Prompt
{
// Declare war through search - Enter Guild Name:
public override int MessageCliloc { get { return 1018001; } }
private readonly Mobile m_Mobile;
private readonly Guild m_Guild;
public GuildDeclareWarPrompt(Mobile m, Guild g)
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Gumps/Guilds/GuildNamePrompt.cs
Expand Up @@ -6,6 +6,8 @@ namespace Server.Gumps
{
public class GuildNamePrompt : Prompt
{
// Enter new guild name (40 characters max):
public override int MessageCliloc { get { return 1013060; } }
private readonly Mobile m_Mobile;
private readonly Guild m_Guild;
public GuildNamePrompt(Mobile m, Guild g)
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Gumps/Guilds/GuildTitlePrompt.cs
Expand Up @@ -6,6 +6,8 @@ namespace Server.Gumps
{
public class GuildTitlePrompt : Prompt
{
// Enter the new title for this guild member or 'none' to remove a title:
public override int MessageCliloc { get { return 1011128; } }
private readonly Mobile m_Leader;
private readonly Mobile m_Target;
private readonly Guild m_Guild;
Expand Down
2 changes: 2 additions & 0 deletions Scripts/Gumps/Guilds/GuildWebsitePrompt.cs
Expand Up @@ -6,6 +6,8 @@ namespace Server.Gumps
{
public class GuildWebsitePrompt : Prompt
{
// Enter the new website for the guild (50 characters max):
public override int MessageCliloc { get { return 1013072; } }
private readonly Mobile m_Mobile;
private readonly Guild m_Guild;
public GuildWebsitePrompt(Mobile m, Guild g)
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Gumps/HeritageTokenGump.cs
Expand Up @@ -318,7 +318,7 @@ public override void OnResponse(NetState sender, RelayInfo info)
cliloc = 1075196;
break;
case 0x6E:
types.Add(typeof(FountainOfLifeDeed));
types.Add(typeof(FountainOfLife));
cliloc = 1075197;
break;
case 0x6F:
Expand Down
95 changes: 49 additions & 46 deletions Scripts/Gumps/HouseDemolishGump.cs
Expand Up @@ -9,107 +9,110 @@ namespace Server.Gumps
{
public class HouseDemolishGump : Gump
{
public override int TypeID { get { return 0x9E6; } }

private readonly Mobile m_Mobile;
private readonly BaseHouse m_House;

public HouseDemolishGump(Mobile mobile, BaseHouse house)
: base(110, 100)
{
this.m_Mobile = mobile;
this.m_House = house;
m_Mobile = mobile;
m_House = house;

mobile.CloseGump(typeof(HouseDemolishGump));

this.Closable = false;
Closable = false;

this.AddPage(0);
AddPage(0);

this.AddBackground(0, 0, 420, 280, 5054);
AddBackground(0, 0, 420, 280, 5054);

this.AddImageTiled(10, 10, 400, 20, 2624);
this.AddAlphaRegion(10, 10, 400, 20);
AddImageTiled(10, 10, 400, 20, 2624);
AddAlphaRegion(10, 10, 400, 20);

this.AddHtmlLocalized(10, 10, 400, 20, 1060635, 30720, false, false); // <CENTER>WARNING</CENTER>
AddHtmlLocalized(10, 10, 400, 20, 1060635, 30720, false, false); // <CENTER>WARNING</CENTER>

this.AddImageTiled(10, 40, 400, 200, 2624);
this.AddAlphaRegion(10, 40, 400, 200);
AddImageTiled(10, 40, 400, 200, 2624);
AddAlphaRegion(10, 40, 400, 200);

this.AddHtmlLocalized(10, 40, 400, 200, 1061795, 32512, false, true); /* You are about to demolish your house.
AddHtmlLocalized(10, 40, 400, 200, 1061795, 32512, false, true); /* You are about to demolish your house.
* You will be refunded the house's value directly to your bank box.
* All items in the house will remain behind and can be freely picked up by anyone.
* Once the house is demolished, anyone can attempt to place a new house on the vacant land.
* This action will not un-condemn any other houses on your account, nor will it end your 7-day waiting period (if it applies to you).
* Are you sure you wish to continue?
*/

this.AddImageTiled(10, 250, 400, 20, 2624);
this.AddAlphaRegion(10, 250, 400, 20);
AddImageTiled(10, 250, 400, 20, 2624);
AddAlphaRegion(10, 250, 400, 20);

this.AddButton(10, 250, 4005, 4007, 1, GumpButtonType.Reply, 0);
this.AddHtmlLocalized(40, 250, 170, 20, 1011036, 32767, false, false); // OKAY
AddButton(10, 250, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(40, 250, 170, 20, 1011036, 32767, false, false); // OKAY

this.AddButton(210, 250, 4005, 4007, 0, GumpButtonType.Reply, 0);
this.AddHtmlLocalized(240, 250, 170, 20, 1011012, 32767, false, false); // CANCEL
AddButton(210, 250, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(240, 250, 170, 20, 1011012, 32767, false, false); // CANCEL
}

public override void OnResponse(NetState state, RelayInfo info)
{
if (info.ButtonID == 1 && !this.m_House.Deleted)
if (info.ButtonID == 1 && !m_House.Deleted)
{
if (this.m_House.IsOwner(this.m_Mobile))
if (m_House.IsOwner(m_Mobile))
{
if (this.m_House.MovingCrate != null || this.m_House.InternalizedVendors.Count > 0)
if (m_House.MovingCrate != null || m_House.InternalizedVendors.Count > 0)
{
return;
}
else if (!Guilds.Guild.NewGuildSystem && this.m_House.FindGuildstone() != null)
else if (!Guilds.Guild.NewGuildSystem && m_House.FindGuildstone() != null)
{
this.m_Mobile.SendLocalizedMessage(501389); // You cannot redeed a house with a guildstone inside.
m_Mobile.SendLocalizedMessage(501389); // You cannot redeed a house with a guildstone inside.
return;
}
/*else if ( m_House.PlayerVendors.Count > 0 )
{
m_Mobile.SendLocalizedMessage( 503236 ); // You need to collect your vendor's belongings before moving.
return;
}*/
else if (this.m_House.HasRentedVendors && this.m_House.VendorInventories.Count > 0)
else if (m_House.HasRentedVendors && m_House.VendorInventories.Count > 0)
{
this.m_Mobile.SendLocalizedMessage(1062679); // You cannot do that that while you still have contract vendors or unclaimed contract vendor inventory in your house.
m_Mobile.SendLocalizedMessage(1062679); // You cannot do that that while you still have contract vendors or unclaimed contract vendor inventory in your house.
return;
}
else if (this.m_House.HasRentedVendors)
else if (m_House.HasRentedVendors)
{
this.m_Mobile.SendLocalizedMessage(1062680); // You cannot do that that while you still have contract vendors in your house.
m_Mobile.SendLocalizedMessage(1062680); // You cannot do that that while you still have contract vendors in your house.
return;
}
else if (this.m_House.VendorInventories.Count > 0)
else if (m_House.VendorInventories.Count > 0)
{
this.m_Mobile.SendLocalizedMessage(1062681); // You cannot do that that while you still have unclaimed contract vendor inventory in your house.
m_Mobile.SendLocalizedMessage(1062681); // You cannot do that that while you still have unclaimed contract vendor inventory in your house.
return;
}

if (this.m_Mobile.AccessLevel >= AccessLevel.GameMaster)
if (m_Mobile.AccessLevel >= AccessLevel.GameMaster)
{
this.m_Mobile.SendMessage("You do not get a refund for your house as you are not a player");
this.m_House.RemoveKeys(this.m_Mobile);
this.m_House.Delete();
m_Mobile.SendMessage("You do not get a refund for your house as you are not a player");
m_House.RemoveKeys(m_Mobile);
m_House.Delete();
}
else
{
Item toGive;

if (this.m_House.IsAosRules)
if (m_House.IsAosRules)
{
if (this.m_House.Price > 0)
toGive = new BankCheck(this.m_House.Price);
if (m_House.Price > 0)
toGive = new BankCheck(m_House.Price);
else
toGive = this.m_House.GetDeed();
toGive = m_House.GetDeed();
}
else
{
toGive = this.m_House.GetDeed();
toGive = m_House.GetDeed();

if (toGive == null && this.m_House.Price > 0)
toGive = new BankCheck(this.m_House.Price);
if (toGive == null && m_House.Price > 0)
toGive = new BankCheck(m_House.Price);
}
if (AccountGold.Enabled && toGive is BankCheck)
{
Expand All @@ -132,29 +135,29 @@ public override void OnResponse(NetState state, RelayInfo info)
{
var box = m_Mobile.BankBox;

if (box.TryDropItem(this.m_Mobile, toGive, false))
if (box.TryDropItem(m_Mobile, toGive, false))
{
if (toGive is BankCheck)
this.m_Mobile.SendLocalizedMessage(1060397, ((BankCheck)toGive).Worth.ToString("#,0")); // ~1_AMOUNT~ gold has been deposited into your bank box.
m_Mobile.SendLocalizedMessage(1060397, ((BankCheck)toGive).Worth.ToString("#,0")); // ~1_AMOUNT~ gold has been deposited into your bank box.

this.m_House.RemoveKeys(this.m_Mobile);
this.m_House.Delete();
m_House.RemoveKeys(m_Mobile);
m_House.Delete();
}
else
{
toGive.Delete();
this.m_Mobile.SendLocalizedMessage(500390); // Your bank box is full.
m_Mobile.SendLocalizedMessage(500390); // Your bank box is full.
}
}
else
{
this.m_Mobile.SendMessage("Unable to refund house.");
m_Mobile.SendMessage("Unable to refund house.");
}
}
}
else
{
this.m_Mobile.SendLocalizedMessage(501320); // Only the house owner may do this.
m_Mobile.SendLocalizedMessage(501320); // Only the house owner may do this.
}
}
}
Expand Down

0 comments on commit 2f7c4a5

Please sign in to comment.