This commit is contained in:
commit
47711d616e
2644 changed files with 479454 additions and 0 deletions
49
Scripts/Multis/Camps/BankerCamp.cs
Normal file
49
Scripts/Multis/Camps/BankerCamp.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class BankerCamp : BaseCamp
|
||||
{
|
||||
[Constructable]
|
||||
public BankerCamp() : base( 0x1F6 )
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddComponents()
|
||||
{
|
||||
BaseDoor west, east;
|
||||
|
||||
AddItem( west = new LightWoodGate( DoorFacing.WestCW ), -4, 4, 7 );
|
||||
AddItem( east = new LightWoodGate( DoorFacing.EastCCW ), -3, 4, 7 );
|
||||
|
||||
west.Link = east;
|
||||
east.Link = west;
|
||||
|
||||
AddItem( new Sign( SignType.Bank, SignFacing.West ), -5, 5, -4 );
|
||||
|
||||
AddMobile( new Banker(), 4, -4, 3, 7 );
|
||||
AddMobile( new Banker(), 5, 4, -2, 0 );
|
||||
}
|
||||
|
||||
public BankerCamp( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
152
Scripts/Multis/Camps/BaseCamp.cs
Normal file
152
Scripts/Multis/Camps/BaseCamp.cs
Normal file
|
|
@ -0,0 +1,152 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public abstract class BaseCamp : BaseMulti
|
||||
{
|
||||
private ArrayList m_Items, m_Mobiles;
|
||||
private DateTime m_DecayTime;
|
||||
private Timer m_DecayTimer;
|
||||
|
||||
public virtual int EventRange{ get{ return 10; } }
|
||||
public virtual TimeSpan DecayDelay{ get{ return TimeSpan.FromMinutes( 30.0 ); } }
|
||||
|
||||
public BaseCamp( int multiID ) : base( multiID | 0x4000 )
|
||||
{
|
||||
m_Items = new ArrayList();
|
||||
m_Mobiles = new ArrayList();
|
||||
RefreshDecay( true );
|
||||
|
||||
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckAddComponents ) );
|
||||
}
|
||||
|
||||
public void CheckAddComponents()
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
AddComponents();
|
||||
}
|
||||
|
||||
public virtual void AddComponents()
|
||||
{
|
||||
}
|
||||
|
||||
public virtual void RefreshDecay( bool setDecayTime )
|
||||
{
|
||||
if ( Deleted )
|
||||
return;
|
||||
|
||||
if ( m_DecayTimer != null )
|
||||
m_DecayTimer.Stop();
|
||||
|
||||
if ( setDecayTime )
|
||||
m_DecayTime = DateTime.Now + DecayDelay;
|
||||
|
||||
m_DecayTimer = Timer.DelayCall( DecayDelay, new TimerCallback( Delete ) );
|
||||
}
|
||||
|
||||
public virtual void AddItem( Item item, int xOffset, int yOffset, int zOffset )
|
||||
{
|
||||
m_Items.Add( item );
|
||||
|
||||
item.MoveToWorld( new Point3D( X + xOffset, Y + yOffset, Z + zOffset ), Map );
|
||||
}
|
||||
|
||||
public virtual void AddMobile( Mobile m, int wanderRange, int xOffset, int yOffset, int zOffset )
|
||||
{
|
||||
m_Mobiles.Add( m );
|
||||
|
||||
Point3D loc = new Point3D( X + xOffset, Y + yOffset, Z + zOffset );
|
||||
BaseCreature bc = m as BaseCreature;
|
||||
|
||||
if ( bc != null )
|
||||
{
|
||||
bc.RangeHome = wanderRange;
|
||||
bc.Home = loc;
|
||||
}
|
||||
|
||||
if ( m is BaseVendor || m is Banker )
|
||||
m.Direction = Direction.South;
|
||||
|
||||
m.MoveToWorld( loc, this.Map );
|
||||
}
|
||||
|
||||
public virtual void OnEnter( Mobile m )
|
||||
{
|
||||
RefreshDecay( true );
|
||||
}
|
||||
|
||||
public virtual void OnExit( Mobile m )
|
||||
{
|
||||
RefreshDecay( true );
|
||||
}
|
||||
|
||||
public override bool HandlesOnMovement{ get{ return true; } }
|
||||
|
||||
public override void OnMovement( Mobile m, Point3D oldLocation )
|
||||
{
|
||||
bool inOldRange = Utility.InRange( oldLocation, Location, EventRange );
|
||||
bool inNewRange = Utility.InRange( m.Location, Location, EventRange );
|
||||
|
||||
if ( inNewRange && !inOldRange )
|
||||
OnEnter( m );
|
||||
else if ( inOldRange && !inNewRange )
|
||||
OnExit( m );
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
for ( int i = 0; i < m_Items.Count; ++i )
|
||||
((Item)m_Items[i]).Delete();
|
||||
|
||||
for ( int i = 0; i < m_Mobiles.Count; ++i )
|
||||
((Mobile)m_Mobiles[i]).Delete();
|
||||
|
||||
m_Items.Clear();
|
||||
m_Mobiles.Clear();
|
||||
}
|
||||
|
||||
public BaseCamp( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.WriteItemList( m_Items, true );
|
||||
writer.WriteMobileList( m_Mobiles, true );
|
||||
writer.WriteDeltaTime( m_DecayTime );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Items = reader.ReadItemList();
|
||||
m_Mobiles = reader.ReadMobileList();
|
||||
m_DecayTime = reader.ReadDeltaTime();
|
||||
|
||||
RefreshDecay( false );
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Multis/Camps/HealerCamp.cs
Normal file
49
Scripts/Multis/Camps/HealerCamp.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class HealerCamp : BaseCamp
|
||||
{
|
||||
[Constructable]
|
||||
public HealerCamp() : base( 0x1F4 )
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddComponents()
|
||||
{
|
||||
BaseDoor west, east;
|
||||
|
||||
AddItem( west = new LightWoodGate( DoorFacing.WestCW ), -4, 4, 7 );
|
||||
AddItem( east = new LightWoodGate( DoorFacing.EastCCW ), -3, 4, 7 );
|
||||
|
||||
west.Link = east;
|
||||
east.Link = west;
|
||||
|
||||
AddItem( new Sign( SignType.Healer, SignFacing.West ), -5, 5, -4 );
|
||||
|
||||
AddMobile( new Healer(), 4, -4, 3, 7 );
|
||||
AddMobile( new Healer(), 5, 4, -2, 0 );
|
||||
}
|
||||
|
||||
public HealerCamp( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
49
Scripts/Multis/Camps/MageCamp.cs
Normal file
49
Scripts/Multis/Camps/MageCamp.cs
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class MageCamp : BaseCamp
|
||||
{
|
||||
[Constructable]
|
||||
public MageCamp() : base( 0x1F5 )
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddComponents()
|
||||
{
|
||||
BaseDoor west, east;
|
||||
|
||||
AddItem( west = new LightWoodGate( DoorFacing.WestCW ), -4, 4, 7 );
|
||||
AddItem( east = new LightWoodGate( DoorFacing.EastCCW ), -3, 4, 7 );
|
||||
|
||||
west.Link = east;
|
||||
east.Link = west;
|
||||
|
||||
AddItem( new Sign( SignType.Mage, SignFacing.West ), -5, 5, -4 );
|
||||
|
||||
AddMobile( new Mage(), 4, -4, 3, 7 );
|
||||
AddMobile( new Mage(), 5, 4, -2, 0 );
|
||||
}
|
||||
|
||||
public MageCamp( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
105
Scripts/Multis/Camps/OrcCamp.cs
Normal file
105
Scripts/Multis/Camps/OrcCamp.cs
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class OrcCamp : BaseCamp
|
||||
{
|
||||
private Mobile m_Prisoner;
|
||||
private BaseDoor m_Gate;
|
||||
|
||||
[Constructable]
|
||||
public OrcCamp() : base( 0x1D4C )
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddComponents()
|
||||
{
|
||||
IronGate gate = new IronGate( DoorFacing.EastCCW );
|
||||
m_Gate = gate;
|
||||
|
||||
gate.KeyValue = Key.RandomValue();
|
||||
gate.Locked = true;
|
||||
|
||||
AddItem( gate, -2, 1, 0 );
|
||||
|
||||
MetalChest chest = new MetalChest();
|
||||
|
||||
chest.ItemID = 0xE7C;
|
||||
chest.DropItem( new Key( KeyType.Iron, gate.KeyValue ) );
|
||||
|
||||
TreasureMapChest.Fill( chest, 2 );
|
||||
|
||||
AddItem( chest, 4, 4, 0 );
|
||||
|
||||
AddMobile( new Orc(), 15, 0, -2, 0 );
|
||||
AddMobile( new Orc(), 15, 0, 1, 0 );
|
||||
AddMobile( new OrcishMage(), 15, 0, -1, 0 );
|
||||
AddMobile( new OrcCaptain(), 15, 0, 0, 0 );
|
||||
|
||||
switch ( Utility.Random( 2 ) )
|
||||
{
|
||||
case 0: m_Prisoner = new Noble(); break;
|
||||
case 1: m_Prisoner = new SeekerOfAdventure(); break;
|
||||
}
|
||||
|
||||
m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 );
|
||||
|
||||
AddMobile( m_Prisoner, 2, -2, 0, 0 );
|
||||
}
|
||||
|
||||
public override void OnEnter( Mobile m )
|
||||
{
|
||||
base.OnEnter( m );
|
||||
|
||||
if ( m.Player && m_Prisoner != null && m_Gate != null && m_Gate.Locked )
|
||||
{
|
||||
int number;
|
||||
|
||||
switch ( Utility.Random( 4 ) )
|
||||
{
|
||||
default:
|
||||
case 0: number = 502264; break; // Help a poor prisoner!
|
||||
case 1: number = 502266; break; // Aaah! Help me!
|
||||
case 2: number = 1046000; break; // Help! These savages wish to end my life!
|
||||
case 3: number = 1046003; break; // Quickly! Kill them for me! HELP!!
|
||||
}
|
||||
|
||||
m_Prisoner.Yell( number );
|
||||
}
|
||||
}
|
||||
|
||||
public OrcCamp( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Prisoner );
|
||||
writer.Write( m_Gate );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Prisoner = reader.ReadMobile();
|
||||
m_Gate = reader.ReadItem() as BaseDoor;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
105
Scripts/Multis/Camps/RatCamp.cs
Normal file
105
Scripts/Multis/Camps/RatCamp.cs
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Multis
|
||||
{
|
||||
public class RatCamp : BaseCamp
|
||||
{
|
||||
private Mobile m_Prisoner;
|
||||
private BaseDoor m_Gate;
|
||||
|
||||
[Constructable]
|
||||
public RatCamp() : base( 0x1D4C )
|
||||
{
|
||||
}
|
||||
|
||||
public override void AddComponents()
|
||||
{
|
||||
IronGate gate = new IronGate( DoorFacing.EastCCW );
|
||||
m_Gate = gate;
|
||||
|
||||
gate.KeyValue = Key.RandomValue();
|
||||
gate.Locked = true;
|
||||
|
||||
AddItem( gate, -2, 1, 0 );
|
||||
|
||||
MetalChest chest = new MetalChest();
|
||||
|
||||
chest.ItemID = 0xE7C;
|
||||
chest.DropItem( new Key( KeyType.Iron, gate.KeyValue ) );
|
||||
|
||||
TreasureMapChest.Fill( chest, 2 );
|
||||
|
||||
AddItem( chest, 4, 4, 0 );
|
||||
|
||||
AddMobile( new Ratman(), 15, 0, -2, 0 );
|
||||
AddMobile( new Ratman(), 15, 0, 1, 0 );
|
||||
AddMobile( new RatmanMage(), 15, 0, -1, 0 );
|
||||
AddMobile( new RatmanArcher(), 15, 0, 0, 0 );
|
||||
|
||||
switch ( Utility.Random( 2 ) )
|
||||
{
|
||||
case 0: m_Prisoner = new Noble(); break;
|
||||
case 1: m_Prisoner = new SeekerOfAdventure(); break;
|
||||
}
|
||||
|
||||
m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 );
|
||||
|
||||
AddMobile( m_Prisoner, 2, -2, 0, 0 );
|
||||
}
|
||||
|
||||
public override void OnEnter( Mobile m )
|
||||
{
|
||||
base.OnEnter( m );
|
||||
|
||||
if ( m.Player && m_Prisoner != null && m_Gate != null && m_Gate.Locked )
|
||||
{
|
||||
int number;
|
||||
|
||||
switch ( Utility.Random( 4 ) )
|
||||
{
|
||||
default:
|
||||
case 0: number = 502264; break; // Help a poor prisoner!
|
||||
case 1: number = 502266; break; // Aaah! Help me!
|
||||
case 2: number = 1046000; break; // Help! These savages wish to end my life!
|
||||
case 3: number = 1046003; break; // Quickly! Kill them for me! HELP!!
|
||||
}
|
||||
|
||||
m_Prisoner.Yell( number );
|
||||
}
|
||||
}
|
||||
|
||||
public RatCamp( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
writer.Write( m_Prisoner );
|
||||
writer.Write( m_Gate );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Prisoner = reader.ReadMobile();
|
||||
m_Gate = reader.ReadItem() as BaseDoor;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue