#W# Commands Decorate/GenTeleporter/SignParser tweaked. Added some regions. Mount/Unmount for regions.
This commit is contained in:
parent
3045c83799
commit
8fca4205a0
110 changed files with 974 additions and 68626 deletions
|
|
@ -25,12 +25,8 @@ namespace Server.Commands
|
|||
|
||||
m_Mobile.SendMessage( "Generating world decoration, please wait." );
|
||||
|
||||
Generate( "Data/Decoration/Britannia", Map.Trammel, Map.Felucca );
|
||||
Generate( "Data/Decoration/Trammel", Map.Trammel );
|
||||
Generate( "Data/Decoration/Felucca", Map.Felucca );
|
||||
Generate( "Data/Decoration/Ilshenar", Map.Ilshenar );
|
||||
Generate( "Data/Decoration/Malas", Map.Malas );
|
||||
Generate( "Data/Decoration/Tokuno", Map.Tokuno );
|
||||
Generate( "Data/Decoration/Vaelen", Map.Felucca );
|
||||
|
||||
|
||||
m_Mobile.SendMessage( "World generating complete. {0} items were generated.", m_Count );
|
||||
}
|
||||
|
|
@ -1147,4 +1143,4 @@ namespace Server.Commands
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
66
Scripts/Commands/RetrieveMount.cs
Normal file
66
Scripts/Commands/RetrieveMount.cs
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
public class RetrieveMountCommand
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("RetrieveMount", AccessLevel.Player, new CommandEventHandler(RetrieveMount_OnCommand));
|
||||
}
|
||||
|
||||
[Usage("RetrieveMount")]
|
||||
[Description("Automatically retrieves your last stabled mount and remounts you upon exiting a restricted zone.")]
|
||||
public static void RetrieveMount_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
PlayerMobile pm = e.Mobile as PlayerMobile;
|
||||
if (pm != null)
|
||||
{
|
||||
AutoRemountPlayer(pm);
|
||||
}
|
||||
}
|
||||
|
||||
public static void AutoRemountPlayer(PlayerMobile pm)
|
||||
{
|
||||
if (pm == null || pm.Deleted)
|
||||
return;
|
||||
|
||||
if (pm.Map == null || pm.Map == Map.Internal)
|
||||
return;
|
||||
|
||||
if (pm.Mounted)
|
||||
return;
|
||||
|
||||
BaseCreature mountToRetrieve = null;
|
||||
|
||||
for (int i = pm.Stabled.Count - 1; i >= 0; i--)
|
||||
{
|
||||
BaseCreature pet = pm.Stabled[i] as BaseCreature;
|
||||
|
||||
if (pet != null && pet is IMount && !pet.Deleted)
|
||||
{
|
||||
mountToRetrieve = pet;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (mountToRetrieve != null)
|
||||
{
|
||||
pm.Stabled.Remove(mountToRetrieve);
|
||||
mountToRetrieve.SetControlMaster(pm);
|
||||
mountToRetrieve.IsStabled = false;
|
||||
mountToRetrieve.MoveToWorld(pm.Location, pm.Map);
|
||||
IMount mount = mountToRetrieve as IMount;
|
||||
if (mount != null)
|
||||
{
|
||||
mount.Rider = pm;
|
||||
//pm.SendMessage("Welcome back! Your mount has been returned to you.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -38,7 +38,7 @@ namespace Server.Commands
|
|||
|
||||
public static void Parse( Mobile from )
|
||||
{
|
||||
string cfg = Path.Combine( Core.BaseDirectory, "Data/signs.cfg" );
|
||||
string cfg = Path.Combine( Core.BaseDirectory, "Data/Decoration/signs.cfg" );
|
||||
|
||||
if ( File.Exists( cfg ) )
|
||||
{
|
||||
|
|
@ -136,4 +136,4 @@ namespace Server.Commands
|
|||
sign.MoveToWorld( location, map );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
63
Scripts/Commands/StableMount.cs
Normal file
63
Scripts/Commands/StableMount.cs
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Commands;
|
||||
using Server.Mobiles;
|
||||
using Server.Items;
|
||||
|
||||
namespace Server.Commands
|
||||
{
|
||||
public class StableMountCommand
|
||||
{
|
||||
public static void Initialize()
|
||||
{
|
||||
CommandSystem.Register("StableMount", AccessLevel.Player, new CommandEventHandler(StableMount_OnCommand));
|
||||
}
|
||||
|
||||
[Usage("StableMount")]
|
||||
[Description("Forces a player off their mount and bypasses stable limits for zone control.")]
|
||||
public static void StableMount_OnCommand(CommandEventArgs e)
|
||||
{
|
||||
PlayerMobile pm = e.Mobile as PlayerMobile;
|
||||
if (pm != null)
|
||||
{
|
||||
ForceDismountAndStore(pm);
|
||||
}
|
||||
}
|
||||
|
||||
public static void ForceDismountAndStore(PlayerMobile pm)
|
||||
{
|
||||
if (pm == null || !pm.Mounted)
|
||||
return;
|
||||
|
||||
IMount mount = pm.Mount;
|
||||
|
||||
if (mount == null)
|
||||
return;
|
||||
|
||||
if (mount is BaseMount)
|
||||
{
|
||||
BaseMount baseMount = (BaseMount)mount;
|
||||
BaseCreature mountCreature = baseMount as BaseCreature;
|
||||
|
||||
if (mountCreature != null)
|
||||
{
|
||||
baseMount.Rider = null;
|
||||
|
||||
mountCreature.ControlTarget = null;
|
||||
mountCreature.ControlOrder = OrderType.Stay;
|
||||
mountCreature.Internalize();
|
||||
mountCreature.SetControlMaster(null);
|
||||
mountCreature.SummonMaster = null;
|
||||
mountCreature.IsStabled = true;
|
||||
pm.Stabled.Add(mountCreature);
|
||||
//pm.SendMessage("Mounts are not allowed here! Your mount has been tucked away.");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mount.Rider = null;
|
||||
pm.SendMessage("Ethereal mounts are not allowed in this zone.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,7 @@ namespace Server.Misc
|
|||
* 4) Changing or removing any predefined maps may cause server instability.
|
||||
*/
|
||||
|
||||
RegisterMap( 0, 0, 0, 7168, 4096, 4, "Felucca", MapRules.FeluccaRules );
|
||||
RegisterMap( 0, 0, 0, 7168, 4096, 0, "Vaelen", MapRules.FeluccaRules );
|
||||
RegisterMap( 1, 1, 1, 7168, 4096, 0, "Trammel", MapRules.TrammelRules );
|
||||
RegisterMap( 2, 2, 2, 2304, 1600, 1, "Ilshenar", MapRules.TrammelRules );
|
||||
RegisterMap( 3, 3, 3, 2560, 2048, 1, "Malas", MapRules.TrammelRules );
|
||||
|
|
|
|||
36
Scripts/Regions/BusinessRegion.cs
Normal file
36
Scripts/Regions/BusinessRegion.cs
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Regions
|
||||
{
|
||||
public class BusinessRegion : GuardedRegion
|
||||
{
|
||||
public BusinessRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnEnter( Mobile m )
|
||||
{
|
||||
base.OnEnter( m );
|
||||
if ( m != null && m.Player )
|
||||
{
|
||||
m.SendMessage( "Welcome to <BASEFONT COLOR='#FFD700'>{0}</BASEFONT>", this.Name );
|
||||
}
|
||||
if ( m != null && m.Player )
|
||||
{
|
||||
Server.Commands.StableMountCommand.ForceDismountAndStore((PlayerMobile)m);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnExit( Mobile m )
|
||||
{
|
||||
base.OnExit( m );
|
||||
if ( m != null && m.Player )
|
||||
{
|
||||
Server.Commands.RetrieveMountCommand.AutoRemountPlayer((PlayerMobile)m);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
28
Scripts/Regions/CaveRegion.cs
Normal file
28
Scripts/Regions/CaveRegion.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Xml;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Regions
|
||||
{
|
||||
public class CaveRegion : DungeonRegion
|
||||
{
|
||||
public CaveRegion( XmlElement xml, Map map, Region parent ) : base( xml, map, parent )
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnEnter( Mobile m )
|
||||
{
|
||||
base.OnEnter( m );
|
||||
if ( m != null && m.Player )
|
||||
{
|
||||
m.SendMessage( "You have entered a dark cave" );
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnExit( Mobile m )
|
||||
{
|
||||
base.OnExit( m );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -44,5 +44,36 @@ namespace Server.Regions
|
|||
|
||||
return base.CanUseStuckMenu( m );
|
||||
}
|
||||
|
||||
public override void OnEnter( Mobile m )
|
||||
{
|
||||
base.OnEnter( m );
|
||||
if ( m != null && m.Player )
|
||||
{
|
||||
m.SendMessage( "You have entered the <BASEFONT COLOR='#FF0000'>{0}</BASEFONT>", this.Name);
|
||||
Timer.DelayCall( TimeSpan.FromMilliseconds( 100 ), delegate()
|
||||
{
|
||||
if ( m != null && m.Alive )
|
||||
{
|
||||
Server.Commands.StableMountCommand.ForceDismountAndStore((PlayerMobile)m);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnExit( Mobile m )
|
||||
{
|
||||
base.OnExit( m );
|
||||
if ( m != null && m.Player )
|
||||
{
|
||||
Timer.DelayCall( TimeSpan.FromMilliseconds( 100 ), delegate()
|
||||
{
|
||||
if ( m != null && m.Alive )
|
||||
{
|
||||
Server.Commands.RetrieveMountCommand.AutoRemountPlayer((PlayerMobile)m);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue