OSI-style npc camps: http://www.uodemise.com/forum/showthread.php?t=115787
SoT should not exceed skillcaps: http://www.uodemise.com/forum/showthread.php?t=148630 Corrected Potion keg name: http://www.uodemise.com/forum/showthread.php?t=147423
This commit is contained in:
parent
83193125b8
commit
4dbb400ce3
8 changed files with 1266 additions and 622 deletions
|
|
@ -95,7 +95,7 @@ namespace Server.Items
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if ( m_Held == 0 )
|
if ( m_Held == 0 )
|
||||||
return 1041641;
|
return 1041084; // A specially lined keg for potions.
|
||||||
else if( m_Type >= PotionEffect.Conflagration )
|
else if( m_Type >= PotionEffect.Conflagration )
|
||||||
return 1072658 + (int) m_Type - (int) PotionEffect.Conflagration;
|
return 1072658 + (int) m_Type - (int) PotionEffect.Conflagration;
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -97,8 +97,8 @@ namespace Server.Items
|
||||||
if ( !CanUse( from ) )
|
if ( !CanUse( from ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
double tskill = from.Skills[Skill].Base;
|
double tskill = from.Skills[Skill].Base; // value of skill without item bonuses etc
|
||||||
double tcap = from.Skills[Skill].Cap;
|
double tcap = from.Skills[Skill].Cap; // maximum value permitted
|
||||||
bool canGain = false;
|
bool canGain = false;
|
||||||
|
|
||||||
double newValue = Value;
|
double newValue = Value;
|
||||||
|
|
@ -110,9 +110,12 @@ namespace Server.Items
|
||||||
{
|
{
|
||||||
if ( ( from.SkillsTotal + newValue * 10 ) > from.SkillsCap )
|
if ( ( from.SkillsTotal + newValue * 10 ) > from.SkillsCap )
|
||||||
{
|
{
|
||||||
for ( int i = 0; i <= 54; i++ )
|
int ns = from.Skills.Length; // number of items in from.Skills[]
|
||||||
|
|
||||||
|
for ( int i = 0; i < ns; i++ )
|
||||||
{
|
{
|
||||||
if ( from.Skills[i].Lock == SkillLock.Down && tskill >= newValue )
|
// skill must point down and its value must be enough
|
||||||
|
if ( from.Skills[i].Lock == SkillLock.Down && from.Skills[i].Base >= newValue )
|
||||||
{
|
{
|
||||||
from.Skills[i].Base -= newValue;
|
from.Skills[i].Base -= newValue;
|
||||||
canGain = true;
|
canGain = true;
|
||||||
|
|
|
||||||
|
|
@ -19,11 +19,11 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
public override bool Commandable { get { return false; } } // Our master cannot boss us around!
|
public override bool Commandable { get { return false; } } // Our master cannot boss us around!
|
||||||
|
|
||||||
[CommandProperty( AccessLevel.GameMaster )]
|
[CommandProperty(AccessLevel.GameMaster)]
|
||||||
public string Destination
|
public string Destination
|
||||||
{
|
{
|
||||||
get { return m_Destination == null ? null : m_Destination.Name; }
|
get { return m_Destination == null ? null : m_Destination.Name; }
|
||||||
set { m_DestinationString = value; m_Destination = EDI.Find( value ); }
|
set { m_DestinationString = value; m_Destination = EDI.Find(value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string[] m_TownNames = new string[]
|
private static string[] m_TownNames = new string[]
|
||||||
|
|
@ -42,7 +42,7 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
[Constructable]
|
[Constructable]
|
||||||
public BaseEscortable()
|
public BaseEscortable()
|
||||||
: base( AIType.AI_Melee, FightMode.Aggressor, 22, 1, 0.2, 1.0 )
|
: base(AIType.AI_Melee, FightMode.Aggressor, 22, 1, 0.2, 1.0)
|
||||||
{
|
{
|
||||||
InitBody();
|
InitBody();
|
||||||
InitOutfit();
|
InitOutfit();
|
||||||
|
|
@ -50,52 +50,52 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
public virtual void InitBody()
|
public virtual void InitBody()
|
||||||
{
|
{
|
||||||
SetStr( 90, 100 );
|
SetStr(90, 100);
|
||||||
SetDex( 90, 100 );
|
SetDex(90, 100);
|
||||||
SetInt( 15, 25 );
|
SetInt(15, 25);
|
||||||
|
|
||||||
Hue = Utility.RandomSkinHue();
|
Hue = Utility.RandomSkinHue();
|
||||||
|
|
||||||
if( Female = Utility.RandomBool() )
|
if (Female = Utility.RandomBool())
|
||||||
{
|
{
|
||||||
Body = 401;
|
Body = 401;
|
||||||
Name = NameList.RandomName( "female" );
|
Name = NameList.RandomName("female");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Body = 400;
|
Body = 400;
|
||||||
Name = NameList.RandomName( "male" );
|
Name = NameList.RandomName("male");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void InitOutfit()
|
public virtual void InitOutfit()
|
||||||
{
|
{
|
||||||
AddItem( new FancyShirt( Utility.RandomNeutralHue() ) );
|
AddItem(new FancyShirt(Utility.RandomNeutralHue()));
|
||||||
AddItem( new ShortPants( Utility.RandomNeutralHue() ) );
|
AddItem(new ShortPants(Utility.RandomNeutralHue()));
|
||||||
AddItem( new Boots( Utility.RandomNeutralHue() ) );
|
AddItem(new Boots(Utility.RandomNeutralHue()));
|
||||||
|
|
||||||
Utility.AssignRandomHair( this );
|
Utility.AssignRandomHair(this);
|
||||||
|
|
||||||
PackGold( 200, 250 );
|
PackGold(200, 250);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual bool SayDestinationTo( Mobile m )
|
public virtual bool SayDestinationTo(Mobile m)
|
||||||
{
|
{
|
||||||
EDI dest = GetDestination();
|
EDI dest = GetDestination();
|
||||||
|
|
||||||
if( dest == null || !m.Alive )
|
if (dest == null || !m.Alive)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Mobile escorter = GetEscorter();
|
Mobile escorter = GetEscorter();
|
||||||
|
|
||||||
if( escorter == null )
|
if (escorter == null)
|
||||||
{
|
{
|
||||||
Say( "I am looking to go to {0}, will you take me?", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name );
|
Say("I am looking to go to {0}, will you take me?", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if( escorter == m )
|
else if (escorter == m)
|
||||||
{
|
{
|
||||||
Say( "Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name );
|
Say("Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -109,42 +109,42 @@ namespace Server.Mobiles
|
||||||
get { return m_EscortTable; }
|
get { return m_EscortTable; }
|
||||||
}
|
}
|
||||||
|
|
||||||
private static TimeSpan m_EscortDelay = TimeSpan.FromMinutes( 5.0 );
|
private static TimeSpan m_EscortDelay = TimeSpan.FromMinutes(5.0);
|
||||||
|
|
||||||
public virtual bool AcceptEscorter( Mobile m )
|
public virtual bool AcceptEscorter(Mobile m)
|
||||||
{
|
{
|
||||||
EDI dest = GetDestination();
|
EDI dest = GetDestination();
|
||||||
|
|
||||||
if( dest == null )
|
if (dest == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Mobile escorter = GetEscorter();
|
Mobile escorter = GetEscorter();
|
||||||
|
|
||||||
if( escorter != null || !m.Alive )
|
if (escorter != null || !m.Alive)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
BaseEscortable escortable = (BaseEscortable)m_EscortTable[m];
|
BaseEscortable escortable = (BaseEscortable)m_EscortTable[m];
|
||||||
|
|
||||||
if( escortable != null && !escortable.Deleted && escortable.GetEscorter() == m )
|
if (escortable != null && !escortable.Deleted && escortable.GetEscorter() == m)
|
||||||
{
|
{
|
||||||
Say( "I see you already have an escort." );
|
Say("I see you already have an escort.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if( m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + m_EscortDelay) >= DateTime.Now )
|
else if (m is PlayerMobile && (((PlayerMobile)m).LastEscortTime + m_EscortDelay) >= DateTime.Now)
|
||||||
{
|
{
|
||||||
int minutes = (int)Math.Ceiling( ((((PlayerMobile)m).LastEscortTime + m_EscortDelay) - DateTime.Now).TotalMinutes );
|
int minutes = (int)Math.Ceiling(((((PlayerMobile)m).LastEscortTime + m_EscortDelay) - DateTime.Now).TotalMinutes);
|
||||||
|
|
||||||
Say( "You must rest {0} minute{1} before we set out on this journey.", minutes, minutes == 1 ? "" : "s" );
|
Say("You must rest {0} minute{1} before we set out on this journey.", minutes, minutes == 1 ? "" : "s");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if( SetControlMaster( m ) )
|
else if (SetControlMaster(m))
|
||||||
{
|
{
|
||||||
m_LastSeenEscorter = DateTime.Now;
|
m_LastSeenEscorter = DateTime.Now;
|
||||||
|
|
||||||
if( m is PlayerMobile )
|
if (m is PlayerMobile)
|
||||||
((PlayerMobile)m).LastEscortTime = DateTime.Now;
|
((PlayerMobile)m).LastEscortTime = DateTime.Now;
|
||||||
|
|
||||||
Say( "Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name );
|
Say("Lead on! Payment will be made when we arrive in {0}.", (dest.Name == "Ocllo" && m.Map == Map.Trammel) ? "Haven" : dest.Name);
|
||||||
m_EscortTable[m] = this;
|
m_EscortTable[m] = this;
|
||||||
StartFollow();
|
StartFollow();
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -153,32 +153,32 @@ namespace Server.Mobiles
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool HandlesOnSpeech( Mobile from )
|
public override bool HandlesOnSpeech(Mobile from)
|
||||||
{
|
{
|
||||||
if( from.InRange( this.Location, 3 ) )
|
if (from.InRange(this.Location, 3))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return base.HandlesOnSpeech( from );
|
return base.HandlesOnSpeech(from);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnSpeech( SpeechEventArgs e )
|
public override void OnSpeech(SpeechEventArgs e)
|
||||||
{
|
{
|
||||||
base.OnSpeech( e );
|
base.OnSpeech(e);
|
||||||
|
|
||||||
EDI dest = GetDestination();
|
EDI dest = GetDestination();
|
||||||
|
|
||||||
if( dest != null && !e.Handled && e.Mobile.InRange( this.Location, 3 ) )
|
if (dest != null && !e.Handled && e.Mobile.InRange(this.Location, 3))
|
||||||
{
|
{
|
||||||
if( e.HasKeyword( 0x1D ) ) // *destination*
|
if (e.HasKeyword(0x1D)) // *destination*
|
||||||
e.Handled = SayDestinationTo( e.Mobile );
|
e.Handled = SayDestinationTo(e.Mobile);
|
||||||
else if( e.HasKeyword( 0x1E ) ) // *i will take thee*
|
else if (e.HasKeyword(0x1E)) // *i will take thee*
|
||||||
e.Handled = AcceptEscorter( e.Mobile );
|
e.Handled = AcceptEscorter(e.Mobile);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnAfterDelete()
|
public override void OnAfterDelete()
|
||||||
{
|
{
|
||||||
if( m_DeleteTimer != null )
|
if (m_DeleteTimer != null)
|
||||||
m_DeleteTimer.Stop();
|
m_DeleteTimer.Stop();
|
||||||
|
|
||||||
m_DeleteTimer = null;
|
m_DeleteTimer = null;
|
||||||
|
|
@ -192,9 +192,9 @@ namespace Server.Mobiles
|
||||||
CheckAtDestination();
|
CheckAtDestination();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool OnMove( Direction d )
|
protected override bool OnMove(Direction d)
|
||||||
{
|
{
|
||||||
if( !base.OnMove( d ) )
|
if (!base.OnMove(d))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
CheckAtDestination();
|
CheckAtDestination();
|
||||||
|
|
@ -204,12 +204,12 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
public virtual void StartFollow()
|
public virtual void StartFollow()
|
||||||
{
|
{
|
||||||
StartFollow( GetEscorter() );
|
StartFollow(GetEscorter());
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void StartFollow( Mobile escorter )
|
public virtual void StartFollow(Mobile escorter)
|
||||||
{
|
{
|
||||||
if( escorter == null )
|
if (escorter == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ActiveSpeed = 0.1;
|
ActiveSpeed = 0.1;
|
||||||
|
|
@ -218,6 +218,10 @@ namespace Server.Mobiles
|
||||||
ControlOrder = OrderType.Follow;
|
ControlOrder = OrderType.Follow;
|
||||||
ControlTarget = escorter;
|
ControlTarget = escorter;
|
||||||
|
|
||||||
|
if ((IsPrisoner == true) && (CantWalk == true))
|
||||||
|
{
|
||||||
|
CantWalk = false;
|
||||||
|
}
|
||||||
CurrentSpeed = 0.1;
|
CurrentSpeed = 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -236,29 +240,29 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
public virtual Mobile GetEscorter()
|
public virtual Mobile GetEscorter()
|
||||||
{
|
{
|
||||||
if( !Controlled )
|
if (!Controlled)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
Mobile master = ControlMaster;
|
Mobile master = ControlMaster;
|
||||||
|
|
||||||
if( master == null )
|
if (master == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
if( master.Deleted || master.Map != this.Map || !master.InRange( Location, 30 ) || !master.Alive )
|
if (master.Deleted || master.Map != this.Map || !master.InRange(Location, 30) || !master.Alive)
|
||||||
{
|
{
|
||||||
StopFollow();
|
StopFollow();
|
||||||
|
|
||||||
TimeSpan lastSeenDelay = DateTime.Now - m_LastSeenEscorter;
|
TimeSpan lastSeenDelay = DateTime.Now - m_LastSeenEscorter;
|
||||||
|
|
||||||
if( lastSeenDelay >= TimeSpan.FromMinutes( 2.0 ) )
|
if (lastSeenDelay >= TimeSpan.FromMinutes(2.0))
|
||||||
{
|
{
|
||||||
master.SendLocalizedMessage( 1042473 ); // You have lost the person you were escorting.
|
master.SendLocalizedMessage(1042473); // You have lost the person you were escorting.
|
||||||
Say( 1005653 ); // Hmmm. I seem to have lost my master.
|
Say(1005653); // Hmmm. I seem to have lost my master.
|
||||||
|
|
||||||
SetControlMaster( null );
|
SetControlMaster(null);
|
||||||
m_EscortTable.Remove( master );
|
m_EscortTable.Remove(master);
|
||||||
|
|
||||||
Timer.DelayCall( TimeSpan.FromSeconds( 5.0 ), new TimerCallback( Delete ) );
|
Timer.DelayCall(TimeSpan.FromSeconds(5.0), new TimerCallback(Delete));
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -268,8 +272,8 @@ namespace Server.Mobiles
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ControlOrder != OrderType.Follow )
|
if (ControlOrder != OrderType.Follow)
|
||||||
StartFollow( master );
|
StartFollow(master);
|
||||||
|
|
||||||
m_LastSeenEscorter = DateTime.Now;
|
m_LastSeenEscorter = DateTime.Now;
|
||||||
return master;
|
return master;
|
||||||
|
|
@ -277,12 +281,12 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
public virtual void BeginDelete()
|
public virtual void BeginDelete()
|
||||||
{
|
{
|
||||||
if( m_DeleteTimer != null )
|
if (m_DeleteTimer != null)
|
||||||
m_DeleteTimer.Stop();
|
m_DeleteTimer.Stop();
|
||||||
|
|
||||||
m_DeleteTime = DateTime.Now + TimeSpan.FromSeconds( 30.0 );
|
m_DeleteTime = DateTime.Now + TimeSpan.FromSeconds(30.0);
|
||||||
|
|
||||||
m_DeleteTimer = new DeleteTimer( this, m_DeleteTime - DateTime.Now );
|
m_DeleteTimer = new DeleteTimer(this, m_DeleteTime - DateTime.Now);
|
||||||
m_DeleteTimer.Start();
|
m_DeleteTimer.Start();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -290,17 +294,17 @@ namespace Server.Mobiles
|
||||||
{
|
{
|
||||||
EDI dest = GetDestination();
|
EDI dest = GetDestination();
|
||||||
|
|
||||||
if( dest == null )
|
if (dest == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
Mobile escorter = GetEscorter();
|
Mobile escorter = GetEscorter();
|
||||||
|
|
||||||
if( escorter == null )
|
if (escorter == null)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if( dest.Contains( Location ) )
|
if (dest.Contains(Location))
|
||||||
{
|
{
|
||||||
Say( 1042809, escorter.Name ); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay.
|
Say(1042809, escorter.Name); // We have arrived! I thank thee, ~1_PLAYER_NAME~! I have no further need of thy services. Here is thy pay.
|
||||||
|
|
||||||
// not going anywhere
|
// not going anywhere
|
||||||
m_Destination = null;
|
m_Destination = null;
|
||||||
|
|
@ -308,50 +312,50 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
Container cont = escorter.Backpack;
|
Container cont = escorter.Backpack;
|
||||||
|
|
||||||
if( cont == null )
|
if (cont == null)
|
||||||
cont = escorter.BankBox;
|
cont = escorter.BankBox;
|
||||||
|
|
||||||
Gold gold = new Gold( 500, 1000 );
|
Gold gold = new Gold(500, 1000);
|
||||||
|
|
||||||
if( !cont.TryDropItem( escorter, gold, false ) )
|
if (!cont.TryDropItem(escorter, gold, false))
|
||||||
gold.MoveToWorld( escorter.Location, escorter.Map );
|
gold.MoveToWorld(escorter.Location, escorter.Map);
|
||||||
|
|
||||||
StopFollow();
|
StopFollow();
|
||||||
SetControlMaster( null );
|
SetControlMaster(null);
|
||||||
m_EscortTable.Remove( escorter );
|
m_EscortTable.Remove(escorter);
|
||||||
BeginDelete();
|
BeginDelete();
|
||||||
|
|
||||||
Misc.Titles.AwardFame( escorter, 10, true );
|
Misc.Titles.AwardFame(escorter, 10, true);
|
||||||
|
|
||||||
bool gainedPath = false;
|
bool gainedPath = false;
|
||||||
|
|
||||||
PlayerMobile pm = escorter as PlayerMobile;
|
PlayerMobile pm = escorter as PlayerMobile;
|
||||||
|
|
||||||
if( pm != null )
|
if (pm != null)
|
||||||
{
|
{
|
||||||
if( pm.CompassionGains > 0 && DateTime.Now > pm.NextCompassionDay )
|
if (pm.CompassionGains > 0 && DateTime.Now > pm.NextCompassionDay)
|
||||||
{
|
{
|
||||||
pm.NextCompassionDay = DateTime.MinValue;
|
pm.NextCompassionDay = DateTime.MinValue;
|
||||||
pm.CompassionGains = 0;
|
pm.CompassionGains = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( pm.CompassionGains >= 5 ) // have already gained 5 times in one day, can gain no more
|
if (pm.CompassionGains >= 5) // have already gained 5 times in one day, can gain no more
|
||||||
{
|
{
|
||||||
pm.SendLocalizedMessage( 1053004 ); // You must wait about a day before you can gain in compassion again.
|
pm.SendLocalizedMessage(1053004); // You must wait about a day before you can gain in compassion again.
|
||||||
}
|
}
|
||||||
else if( VirtueHelper.Award( pm, VirtueName.Compassion, this.IsPrisoner ? 400 : 200, ref gainedPath ) )
|
else if (VirtueHelper.Award(pm, VirtueName.Compassion, this.IsPrisoner ? 400 : 200, ref gainedPath))
|
||||||
{
|
{
|
||||||
if( gainedPath )
|
if (gainedPath)
|
||||||
pm.SendLocalizedMessage( 1053005 ); // You have achieved a path in compassion!
|
pm.SendLocalizedMessage(1053005); // You have achieved a path in compassion!
|
||||||
else
|
else
|
||||||
pm.SendLocalizedMessage( 1053002 ); // You have gained in compassion.
|
pm.SendLocalizedMessage(1053002); // You have gained in compassion.
|
||||||
|
|
||||||
pm.NextCompassionDay = DateTime.Now + TimeSpan.FromDays( 1.0 ); // in one day CompassionGains gets reset to 0
|
pm.NextCompassionDay = DateTime.Now + TimeSpan.FromDays(1.0); // in one day CompassionGains gets reset to 0
|
||||||
++pm.CompassionGains;
|
++pm.CompassionGains;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pm.SendLocalizedMessage( 1053003 ); // You have achieved the highest path of compassion and can no longer gain any further.
|
pm.SendLocalizedMessage(1053003); // You have achieved the highest path of compassion and can no longer gain any further.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -361,75 +365,75 @@ namespace Server.Mobiles
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseEscortable( Serial serial )
|
public BaseEscortable(Serial serial)
|
||||||
: base( serial )
|
: base(serial)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Serialize( GenericWriter writer )
|
public override void Serialize(GenericWriter writer)
|
||||||
{
|
{
|
||||||
base.Serialize( writer );
|
base.Serialize(writer);
|
||||||
|
|
||||||
writer.Write( (int)0 ); // version
|
writer.Write((int)0); // version
|
||||||
|
|
||||||
EDI dest = GetDestination();
|
EDI dest = GetDestination();
|
||||||
|
|
||||||
writer.Write( dest != null );
|
writer.Write(dest != null);
|
||||||
|
|
||||||
if( dest != null )
|
if (dest != null)
|
||||||
writer.Write( dest.Name );
|
writer.Write(dest.Name);
|
||||||
|
|
||||||
writer.Write( m_DeleteTimer != null );
|
writer.Write(m_DeleteTimer != null);
|
||||||
|
|
||||||
if( m_DeleteTimer != null )
|
if (m_DeleteTimer != null)
|
||||||
writer.WriteDeltaTime( m_DeleteTime );
|
writer.WriteDeltaTime(m_DeleteTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deserialize( GenericReader reader )
|
public override void Deserialize(GenericReader reader)
|
||||||
{
|
{
|
||||||
base.Deserialize( reader );
|
base.Deserialize(reader);
|
||||||
|
|
||||||
int version = reader.ReadInt();
|
int version = reader.ReadInt();
|
||||||
|
|
||||||
if( reader.ReadBool() )
|
if (reader.ReadBool())
|
||||||
m_DestinationString = reader.ReadString(); // NOTE: We cannot EDI.Find here, regions have not yet been loaded :-(
|
m_DestinationString = reader.ReadString(); // NOTE: We cannot EDI.Find here, regions have not yet been loaded :-(
|
||||||
|
|
||||||
if( reader.ReadBool() )
|
if (reader.ReadBool())
|
||||||
{
|
{
|
||||||
m_DeleteTime = reader.ReadDeltaTime();
|
m_DeleteTime = reader.ReadDeltaTime();
|
||||||
m_DeleteTimer = new DeleteTimer( this, m_DeleteTime - DateTime.Now );
|
m_DeleteTimer = new DeleteTimer(this, m_DeleteTime - DateTime.Now);
|
||||||
m_DeleteTimer.Start();
|
m_DeleteTimer.Start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public override bool CanBeRenamedBy( Mobile from )
|
public override bool CanBeRenamedBy(Mobile from)
|
||||||
{
|
{
|
||||||
return (from.AccessLevel >= AccessLevel.GameMaster);
|
return (from.AccessLevel >= AccessLevel.GameMaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AddCustomContextEntries( Mobile from, List<ContextMenuEntry> list )
|
public override void AddCustomContextEntries(Mobile from, List<ContextMenuEntry> list)
|
||||||
{
|
{
|
||||||
EDI dest = GetDestination();
|
EDI dest = GetDestination();
|
||||||
|
|
||||||
if( dest != null && from.Alive )
|
if (dest != null && from.Alive)
|
||||||
{
|
{
|
||||||
Mobile escorter = GetEscorter();
|
Mobile escorter = GetEscorter();
|
||||||
|
|
||||||
if( escorter == null || escorter == from )
|
if (escorter == null || escorter == from)
|
||||||
list.Add( new AskDestinationEntry( this, from ) );
|
list.Add(new AskDestinationEntry(this, from));
|
||||||
|
|
||||||
if( escorter == null )
|
if (escorter == null)
|
||||||
list.Add( new AcceptEscortEntry( this, from ) );
|
list.Add(new AcceptEscortEntry(this, from));
|
||||||
else if( escorter == from )
|
else if (escorter == from)
|
||||||
list.Add( new AbandonEscortEntry( this, from ) );
|
list.Add(new AbandonEscortEntry(this, from));
|
||||||
}
|
}
|
||||||
|
|
||||||
base.AddCustomContextEntries( from, list );
|
base.AddCustomContextEntries(from, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual string[] GetPossibleDestinations()
|
public virtual string[] GetPossibleDestinations()
|
||||||
{
|
{
|
||||||
if( !Core.ML )
|
if (!Core.ML)
|
||||||
return m_TownNames;
|
return m_TownNames;
|
||||||
else
|
else
|
||||||
return m_MLTownNames;
|
return m_MLTownNames;
|
||||||
|
|
@ -437,18 +441,18 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
public virtual string PickRandomDestination()
|
public virtual string PickRandomDestination()
|
||||||
{
|
{
|
||||||
if( Map.Felucca.Regions.Count == 0 || Map == null || Map == Map.Internal || Location == Point3D.Zero )
|
if (Map.Felucca.Regions.Count == 0 || Map == null || Map == Map.Internal || Location == Point3D.Zero)
|
||||||
return null; // Not yet fully initialized
|
return null; // Not yet fully initialized
|
||||||
|
|
||||||
string[] possible = GetPossibleDestinations();
|
string[] possible = GetPossibleDestinations();
|
||||||
string picked = null;
|
string picked = null;
|
||||||
|
|
||||||
while( picked == null )
|
while (picked == null)
|
||||||
{
|
{
|
||||||
picked = possible[Utility.Random( possible.Length )];
|
picked = possible[Utility.Random(possible.Length)];
|
||||||
EDI test = EDI.Find( picked );
|
EDI test = EDI.Find(picked);
|
||||||
|
|
||||||
if( test != null && test.Contains( Location ) )
|
if (test != null && test.Contains(Location))
|
||||||
picked = null;
|
picked = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -457,14 +461,14 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
public EDI GetDestination()
|
public EDI GetDestination()
|
||||||
{
|
{
|
||||||
if( m_DestinationString == null && m_DeleteTimer == null )
|
if (m_DestinationString == null && m_DeleteTimer == null)
|
||||||
m_DestinationString = PickRandomDestination();
|
m_DestinationString = PickRandomDestination();
|
||||||
|
|
||||||
if( m_Destination != null && m_Destination.Name == m_DestinationString )
|
if (m_Destination != null && m_Destination.Name == m_DestinationString)
|
||||||
return m_Destination;
|
return m_Destination;
|
||||||
|
|
||||||
if( Map.Felucca.Regions.Count > 0 )
|
if (Map.Felucca.Regions.Count > 0)
|
||||||
return (m_Destination = EDI.Find( m_DestinationString ));
|
return (m_Destination = EDI.Find(m_DestinationString));
|
||||||
|
|
||||||
return (m_Destination = null);
|
return (m_Destination = null);
|
||||||
}
|
}
|
||||||
|
|
@ -473,8 +477,8 @@ namespace Server.Mobiles
|
||||||
{
|
{
|
||||||
private Mobile m_Mobile;
|
private Mobile m_Mobile;
|
||||||
|
|
||||||
public DeleteTimer( Mobile m, TimeSpan delay )
|
public DeleteTimer(Mobile m, TimeSpan delay)
|
||||||
: base( delay )
|
: base(delay)
|
||||||
{
|
{
|
||||||
m_Mobile = m;
|
m_Mobile = m;
|
||||||
|
|
||||||
|
|
@ -509,12 +513,12 @@ namespace Server.Mobiles
|
||||||
get{ return m_Bounds; }
|
get{ return m_Bounds; }
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
public bool Contains( Point3D p )
|
public bool Contains(Point3D p)
|
||||||
{
|
{
|
||||||
return m_Region.Contains( p );
|
return m_Region.Contains(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EscortDestinationInfo( string name, Region region )
|
public EscortDestinationInfo(string name, Region region)
|
||||||
{
|
{
|
||||||
m_Name = name;
|
m_Name = name;
|
||||||
m_Region = region;
|
m_Region = region;
|
||||||
|
|
@ -526,27 +530,27 @@ namespace Server.Mobiles
|
||||||
{
|
{
|
||||||
ICollection list = Map.Felucca.Regions.Values;
|
ICollection list = Map.Felucca.Regions.Values;
|
||||||
|
|
||||||
if( list.Count == 0 )
|
if (list.Count == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_Table = new Hashtable();
|
m_Table = new Hashtable();
|
||||||
|
|
||||||
foreach( Region r in list )
|
foreach (Region r in list)
|
||||||
{
|
{
|
||||||
if( r.Name == null )
|
if (r.Name == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if( r is Regions.DungeonRegion || r is Regions.TownRegion )
|
if (r is Regions.DungeonRegion || r is Regions.TownRegion)
|
||||||
m_Table[r.Name] = new EscortDestinationInfo( r.Name, r );
|
m_Table[r.Name] = new EscortDestinationInfo(r.Name, r);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static EDI Find( string name )
|
public static EDI Find(string name)
|
||||||
{
|
{
|
||||||
if( m_Table == null )
|
if (m_Table == null)
|
||||||
LoadTable();
|
LoadTable();
|
||||||
|
|
||||||
if( name == null || m_Table == null )
|
if (name == null || m_Table == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
return (EscortDestinationInfo)m_Table[name];
|
return (EscortDestinationInfo)m_Table[name];
|
||||||
|
|
@ -558,8 +562,8 @@ namespace Server.Mobiles
|
||||||
private BaseEscortable m_Mobile;
|
private BaseEscortable m_Mobile;
|
||||||
private Mobile m_From;
|
private Mobile m_From;
|
||||||
|
|
||||||
public AskDestinationEntry( BaseEscortable m, Mobile from )
|
public AskDestinationEntry(BaseEscortable m, Mobile from)
|
||||||
: base( 6100, 3 )
|
: base(6100, 3)
|
||||||
{
|
{
|
||||||
m_Mobile = m;
|
m_Mobile = m;
|
||||||
m_From = from;
|
m_From = from;
|
||||||
|
|
@ -567,7 +571,7 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
public override void OnClick()
|
public override void OnClick()
|
||||||
{
|
{
|
||||||
m_Mobile.SayDestinationTo( m_From );
|
m_Mobile.SayDestinationTo(m_From);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -576,8 +580,8 @@ namespace Server.Mobiles
|
||||||
private BaseEscortable m_Mobile;
|
private BaseEscortable m_Mobile;
|
||||||
private Mobile m_From;
|
private Mobile m_From;
|
||||||
|
|
||||||
public AcceptEscortEntry( BaseEscortable m, Mobile from )
|
public AcceptEscortEntry(BaseEscortable m, Mobile from)
|
||||||
: base( 6101, 3 )
|
: base(6101, 3)
|
||||||
{
|
{
|
||||||
m_Mobile = m;
|
m_Mobile = m;
|
||||||
m_From = from;
|
m_From = from;
|
||||||
|
|
@ -585,7 +589,7 @@ namespace Server.Mobiles
|
||||||
|
|
||||||
public override void OnClick()
|
public override void OnClick()
|
||||||
{
|
{
|
||||||
m_Mobile.AcceptEscorter( m_From );
|
m_Mobile.AcceptEscorter(m_From);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -594,8 +598,8 @@ namespace Server.Mobiles
|
||||||
private BaseEscortable m_Mobile;
|
private BaseEscortable m_Mobile;
|
||||||
private Mobile m_From;
|
private Mobile m_From;
|
||||||
|
|
||||||
public AbandonEscortEntry( BaseEscortable m, Mobile from )
|
public AbandonEscortEntry(BaseEscortable m, Mobile from)
|
||||||
: base( 6102, 3 )
|
: base(6102, 3)
|
||||||
{
|
{
|
||||||
m_Mobile = m;
|
m_Mobile = m;
|
||||||
m_From = from;
|
m_From = from;
|
||||||
|
|
|
||||||
|
|
@ -13,19 +13,37 @@ namespace Server.Multis
|
||||||
private List<Mobile> m_Mobiles;
|
private List<Mobile> m_Mobiles;
|
||||||
private DateTime m_DecayTime;
|
private DateTime m_DecayTime;
|
||||||
private Timer m_DecayTimer;
|
private Timer m_DecayTimer;
|
||||||
|
private TimeSpan m_DecayDelay;
|
||||||
|
|
||||||
public virtual int EventRange{ get{ return 10; } }
|
public virtual int EventRange{ get{ return 10; } }
|
||||||
public virtual TimeSpan DecayDelay{ get{ return TimeSpan.FromMinutes( 30.0 ); } }
|
public virtual TimeSpan DecayDelay {
|
||||||
|
get { return m_DecayDelay; }
|
||||||
|
set {
|
||||||
|
m_DecayDelay = value;
|
||||||
|
RefreshDecay( true );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public BaseCamp( int multiID ) : base( multiID | 0x4000 )
|
public BaseCamp( int multiID ) : base( multiID | 0x4000 )
|
||||||
{
|
{
|
||||||
m_Items = new List<Item>();
|
m_Items = new List<Item>();
|
||||||
m_Mobiles = new List<Mobile>();
|
m_Mobiles = new List<Mobile>();
|
||||||
|
m_DecayDelay = TimeSpan.FromMinutes( 30.0 );
|
||||||
RefreshDecay( true );
|
RefreshDecay( true );
|
||||||
|
|
||||||
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckAddComponents ) );
|
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckAddComponents ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BaseCamp( int multiID, int mode ) : base( multiID | 0x4000*mode )
|
||||||
|
{
|
||||||
|
m_Items = new List<Item>();
|
||||||
|
m_Mobiles = new List<Mobile>();
|
||||||
|
m_DecayDelay = TimeSpan.FromMinutes(30.0);
|
||||||
|
RefreshDecay(true);
|
||||||
|
|
||||||
|
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( CheckAddComponents ) );
|
||||||
|
}
|
||||||
|
|
||||||
public void CheckAddComponents()
|
public void CheckAddComponents()
|
||||||
{
|
{
|
||||||
if ( Deleted )
|
if ( Deleted )
|
||||||
|
|
@ -56,14 +74,16 @@ namespace Server.Multis
|
||||||
{
|
{
|
||||||
m_Items.Add( item );
|
m_Items.Add( item );
|
||||||
|
|
||||||
item.MoveToWorld( new Point3D( X + xOffset, Y + yOffset, Z + zOffset ), Map );
|
int zavg = Map.GetAverageZ(X + xOffset, Y + yOffset);
|
||||||
|
item.MoveToWorld( new Point3D( X + xOffset, Y + yOffset, zavg + zOffset ), Map );
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void AddMobile( Mobile m, int wanderRange, int xOffset, int yOffset, int zOffset )
|
public virtual void AddMobile( Mobile m, int wanderRange, int xOffset, int yOffset, int zOffset )
|
||||||
{
|
{
|
||||||
m_Mobiles.Add( m );
|
m_Mobiles.Add(m);
|
||||||
|
|
||||||
Point3D loc = new Point3D( X + xOffset, Y + yOffset, Z + zOffset );
|
int zavg = Map.GetAverageZ(X + xOffset, Y + yOffset);
|
||||||
|
Point3D loc = new Point3D(X + xOffset, Y + yOffset, zavg + zOffset);
|
||||||
BaseCreature bc = m as BaseCreature;
|
BaseCreature bc = m as BaseCreature;
|
||||||
|
|
||||||
if ( bc != null )
|
if ( bc != null )
|
||||||
|
|
@ -109,7 +129,14 @@ namespace Server.Multis
|
||||||
m_Items[i].Delete();
|
m_Items[i].Delete();
|
||||||
|
|
||||||
for ( int i = 0; i < m_Mobiles.Count; ++i )
|
for ( int i = 0; i < m_Mobiles.Count; ++i )
|
||||||
|
{
|
||||||
|
BaseCreature bc = (BaseCreature)m_Mobiles[i];
|
||||||
|
|
||||||
|
if ( bc.IsPrisoner == false )
|
||||||
m_Mobiles[i].Delete();
|
m_Mobiles[i].Delete();
|
||||||
|
else if ( m_Mobiles[i].CantWalk == true )
|
||||||
|
m_Mobiles[i].Delete();
|
||||||
|
}
|
||||||
|
|
||||||
m_Items.Clear();
|
m_Items.Clear();
|
||||||
m_Mobiles.Clear();
|
m_Mobiles.Clear();
|
||||||
|
|
@ -151,4 +178,36 @@ namespace Server.Multis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class LockableBarrel : LockableContainer
|
||||||
|
{
|
||||||
|
[Constructable]
|
||||||
|
public LockableBarrel()
|
||||||
|
: base(0xE77)
|
||||||
|
{
|
||||||
|
Weight = 1.0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public LockableBarrel(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();
|
||||||
|
|
||||||
|
if (Weight == 8.0)
|
||||||
|
Weight = 1.0;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
197
Scripts/Multis/Camps/BrigandCamp.cs
Normal file
197
Scripts/Multis/Camps/BrigandCamp.cs
Normal file
|
|
@ -0,0 +1,197 @@
|
||||||
|
using System;
|
||||||
|
using Server;
|
||||||
|
using Server.Items;
|
||||||
|
using Server.Mobiles;
|
||||||
|
|
||||||
|
namespace Server.Multis
|
||||||
|
{
|
||||||
|
public class BrigandCamp : BaseCamp
|
||||||
|
{
|
||||||
|
public virtual Mobile Brigands{ get{ return new Brigand(); } }
|
||||||
|
public virtual Mobile Executioners{ get{ return new Executioner(); } }
|
||||||
|
|
||||||
|
private Mobile m_Prisoner;
|
||||||
|
|
||||||
|
private int m_SpawnRange;
|
||||||
|
|
||||||
|
[Constructable]
|
||||||
|
public BrigandCamp() : base( 0x10ee, 0 ) // dummy garbage at center
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AddComponents()
|
||||||
|
{
|
||||||
|
BaseCreature bc;
|
||||||
|
//BaseEscortable be;
|
||||||
|
|
||||||
|
Visible = false;
|
||||||
|
DecayDelay = TimeSpan.FromMinutes( 5.0 );
|
||||||
|
|
||||||
|
AddItem(new Static(0x10ee), 0, 0, 0);
|
||||||
|
AddItem(new Static(0xfac), 0, 7, 0);
|
||||||
|
|
||||||
|
switch ( Utility.Random( 3 ) )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0xDE3 ), 0, 7, 0 ); // Campfire
|
||||||
|
AddItem( new Item( 0x974 ), 0, 7, 1 ); // Cauldron
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0x1E95 ), 0, 7, 1 ); // Rabbit on a spit
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0x1E94 ), 0, 7, 1 ); // Chicken on a spit
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AddCampChests();
|
||||||
|
|
||||||
|
for ( int i = 0; i < 4; i ++ )
|
||||||
|
{
|
||||||
|
AddMobile( Brigands, 6, Utility.RandomMinMax( -7, 7 ), Utility.RandomMinMax( -7, 7 ), 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ( Utility.Random( 2 ) )
|
||||||
|
{
|
||||||
|
case 0: m_Prisoner = new Noble(); break;
|
||||||
|
default: m_Prisoner = new SeekerOfAdventure(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//be = (BaseEscortable)m_Prisoner;
|
||||||
|
//be.m_Captive = true;
|
||||||
|
|
||||||
|
bc = (BaseCreature)m_Prisoner;
|
||||||
|
bc.IsPrisoner = true;
|
||||||
|
bc.CantWalk = true;
|
||||||
|
|
||||||
|
m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 );
|
||||||
|
AddMobile( m_Prisoner, 2, Utility.RandomMinMax( -2, 2 ), Utility.RandomMinMax( -2, 2 ), 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddCampChests()
|
||||||
|
{
|
||||||
|
LockableContainer chest = null;
|
||||||
|
|
||||||
|
switch (Utility.Random(3))
|
||||||
|
{
|
||||||
|
case 0: chest = new MetalChest(); break;
|
||||||
|
case 1: chest = new MetalGoldenChest(); break;
|
||||||
|
default: chest = new WoodenChest(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
chest.LiftOverride = true;
|
||||||
|
|
||||||
|
TreasureMapChest.Fill(chest, 1);
|
||||||
|
|
||||||
|
AddItem(chest, -2, -2, 0);
|
||||||
|
|
||||||
|
LockableContainer crates = null;
|
||||||
|
|
||||||
|
switch (Utility.Random(4))
|
||||||
|
{
|
||||||
|
case 0: crates = new SmallCrate(); break;
|
||||||
|
case 1: crates = new MediumCrate(); break;
|
||||||
|
case 2: crates = new LargeCrate(); break;
|
||||||
|
default: crates = new LockableBarrel(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
crates.TrapType = TrapType.ExplosionTrap;
|
||||||
|
crates.TrapPower = Utility.RandomMinMax(30, 40);
|
||||||
|
crates.TrapLevel = 2;
|
||||||
|
|
||||||
|
crates.RequiredSkill = 76;
|
||||||
|
crates.LockLevel = 66;
|
||||||
|
crates.MaxLockLevel = 116;
|
||||||
|
crates.Locked = true;
|
||||||
|
|
||||||
|
crates.DropItem(new Gold(Utility.RandomMinMax(100, 400)));
|
||||||
|
crates.DropItem(new Arrow(10));
|
||||||
|
crates.DropItem(new Bolt(10));
|
||||||
|
|
||||||
|
crates.LiftOverride = true;
|
||||||
|
|
||||||
|
if (Utility.RandomDouble() < 0.8)
|
||||||
|
{
|
||||||
|
switch (Utility.Random(4))
|
||||||
|
{
|
||||||
|
case 0: crates.DropItem(new LesserCurePotion()); break;
|
||||||
|
case 1: crates.DropItem(new LesserExplosionPotion()); break;
|
||||||
|
case 2: crates.DropItem(new LesserHealPotion()); break;
|
||||||
|
default: crates.DropItem(new LesserPoisonPotion()); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AddItem(crates, 2, 2, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't refresh decay timer
|
||||||
|
public override void OnEnter( Mobile m )
|
||||||
|
{
|
||||||
|
if ( m.Player && m_Prisoner != null && m_Prisoner.CantWalk )
|
||||||
|
{
|
||||||
|
int number;
|
||||||
|
|
||||||
|
switch ( Utility.Random( 8 ) )
|
||||||
|
{
|
||||||
|
case 0: number = 502261; break; // HELP!
|
||||||
|
case 1: number = 502262; break; // Help me!
|
||||||
|
case 2: number = 502263; break; // Canst thou aid me?!
|
||||||
|
case 3: number = 502264; break; // Help a poor prisoner!
|
||||||
|
case 4: number = 502265; break; // Help! Please!
|
||||||
|
case 5: number = 502266; break; // Aaah! Help me!
|
||||||
|
case 6: number = 502267; break; // Go and get some help!
|
||||||
|
default: number = 502268; break; // Quickly, I beg thee! Unlock my chains! If thou dost look at me close thou canst see them.
|
||||||
|
}
|
||||||
|
m_Prisoner.Yell( number );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't refresh decay timer
|
||||||
|
public override void OnExit(Mobile m)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public BrigandCamp( Serial serial ) : base( serial )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AddItem( Item item, int xOffset, int yOffset, int zOffset )
|
||||||
|
{
|
||||||
|
if ( item != null )
|
||||||
|
item.Movable = false;
|
||||||
|
|
||||||
|
base.AddItem( item, xOffset, yOffset, zOffset );
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Serialize( GenericWriter writer )
|
||||||
|
{
|
||||||
|
base.Serialize( writer );
|
||||||
|
|
||||||
|
writer.Write( (int) 0 ); // version
|
||||||
|
|
||||||
|
writer.Write( m_Prisoner );
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Deserialize( GenericReader reader )
|
||||||
|
{
|
||||||
|
base.Deserialize( reader );
|
||||||
|
|
||||||
|
int version = reader.ReadInt();
|
||||||
|
|
||||||
|
switch ( version )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
m_Prisoner = reader.ReadMobile();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
196
Scripts/Multis/Camps/LizardmenCamp.cs
Normal file
196
Scripts/Multis/Camps/LizardmenCamp.cs
Normal file
|
|
@ -0,0 +1,196 @@
|
||||||
|
using System;
|
||||||
|
using Server;
|
||||||
|
using Server.Items;
|
||||||
|
using Server.Mobiles;
|
||||||
|
|
||||||
|
namespace Server.Multis
|
||||||
|
{
|
||||||
|
public class LizardmenCamp : BaseCamp
|
||||||
|
{
|
||||||
|
public virtual Mobile Lizardmen{ get{ return new Lizardman(); } }
|
||||||
|
|
||||||
|
private Mobile m_Prisoner;
|
||||||
|
|
||||||
|
private int m_SpawnRange;
|
||||||
|
|
||||||
|
[Constructable]
|
||||||
|
public LizardmenCamp() : base( 0x10ee , 0 ) // dummy garbage at center
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AddComponents()
|
||||||
|
{
|
||||||
|
BaseCreature bc;
|
||||||
|
//BaseEscortable be;
|
||||||
|
|
||||||
|
Visible = false;
|
||||||
|
DecayDelay = TimeSpan.FromMinutes( 5.0 );
|
||||||
|
AddItem(new Static(0x10ee), 0, 0, 0);
|
||||||
|
AddItem(new Static(0xfac), 0, 7, 0);
|
||||||
|
|
||||||
|
switch ( Utility.Random( 3 ) )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0xDE3 ), 0, 7, 0 ); // Campfire
|
||||||
|
AddItem( new Item( 0x974 ), 0, 7, 1); // Cauldron
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0x1E95 ), 0, 7, 1); // Rabbit on a spit
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0x1E94 ), 0, 7, 1); // Chicken on a spit
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AddItem(new Item(0x41F), 4, 4, 0); // Gruesome Standart South
|
||||||
|
|
||||||
|
AddCampChests();
|
||||||
|
|
||||||
|
for ( int i = 0; i < 4; i ++ )
|
||||||
|
{
|
||||||
|
AddMobile( Lizardmen, 6, Utility.RandomMinMax( -7, 7 ), Utility.RandomMinMax( -7, 7 ), 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
switch ( Utility.Random( 2 ) )
|
||||||
|
{
|
||||||
|
case 0: m_Prisoner = new Noble(); break;
|
||||||
|
default: m_Prisoner = new SeekerOfAdventure(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
//be = (BaseEscortable)m_Prisoner;
|
||||||
|
//be.m_Captive = true;
|
||||||
|
|
||||||
|
bc = (BaseCreature)m_Prisoner;
|
||||||
|
bc.IsPrisoner = true;
|
||||||
|
bc.CantWalk = true;
|
||||||
|
|
||||||
|
m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 );
|
||||||
|
AddMobile( m_Prisoner, 2, Utility.RandomMinMax( -2, 2 ), Utility.RandomMinMax( -2, 2 ), 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AddCampChests()
|
||||||
|
{
|
||||||
|
LockableContainer chest = null;
|
||||||
|
|
||||||
|
switch ( Utility.Random( 3 ) )
|
||||||
|
{
|
||||||
|
case 0: chest = new MetalChest(); break;
|
||||||
|
case 1: chest = new MetalGoldenChest(); break;
|
||||||
|
default: chest = new WoodenChest(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
chest.LiftOverride = true;
|
||||||
|
|
||||||
|
TreasureMapChest.Fill( chest, 1 );
|
||||||
|
|
||||||
|
AddItem( chest, 2, -2, 0 );
|
||||||
|
|
||||||
|
LockableContainer crates = null;
|
||||||
|
|
||||||
|
switch ( Utility.Random( 4 ) )
|
||||||
|
{
|
||||||
|
case 0: crates = new SmallCrate(); break;
|
||||||
|
case 1: crates = new MediumCrate(); break;
|
||||||
|
case 2: crates = new LargeCrate(); break;
|
||||||
|
default: crates = new LockableBarrel(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
crates.TrapType = TrapType.ExplosionTrap;
|
||||||
|
crates.TrapPower = Utility.RandomMinMax( 30, 40 );
|
||||||
|
crates.TrapLevel = 2;
|
||||||
|
|
||||||
|
crates.RequiredSkill = 76;
|
||||||
|
crates.LockLevel = 66;
|
||||||
|
crates.MaxLockLevel = 116;
|
||||||
|
crates.Locked = true;
|
||||||
|
|
||||||
|
crates.DropItem( new Gold( Utility.RandomMinMax( 100, 400 ) ) );
|
||||||
|
crates.DropItem( new Arrow( 10 ) );
|
||||||
|
crates.DropItem( new Bolt( 10 ) );
|
||||||
|
|
||||||
|
crates.LiftOverride = true;
|
||||||
|
|
||||||
|
if ( Utility.RandomDouble() < 0.8 )
|
||||||
|
{
|
||||||
|
switch ( Utility.Random( 4 ) )
|
||||||
|
{
|
||||||
|
case 0: crates.DropItem( new LesserCurePotion() ); break;
|
||||||
|
case 1: crates.DropItem( new LesserExplosionPotion() ); break;
|
||||||
|
case 2: crates.DropItem( new LesserHealPotion() ); break;
|
||||||
|
default: crates.DropItem(new LesserPoisonPotion()); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AddItem( crates, -2, 2, 0 );
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't refresh decay timer
|
||||||
|
public override void OnEnter(Mobile m)
|
||||||
|
{
|
||||||
|
if ( m.Player && m_Prisoner != null && m_Prisoner.CantWalk )
|
||||||
|
{
|
||||||
|
int number;
|
||||||
|
|
||||||
|
switch ( Utility.Random( 8 ) )
|
||||||
|
{
|
||||||
|
case 0: number = 502261; break; // HELP!
|
||||||
|
case 1: number = 502262; break; // Help me!
|
||||||
|
case 2: number = 502263; break; // Canst thou aid me?!
|
||||||
|
case 3: number = 502264; break; // Help a poor prisoner!
|
||||||
|
case 4: number = 502265; break; // Help! Please!
|
||||||
|
case 5: number = 502266; break; // Aaah! Help me!
|
||||||
|
case 6: number = 502267; break; // Go and get some help!
|
||||||
|
default: number = 502268; break; // Quickly, I beg thee! Unlock my chains! If thou dost look at me close thou canst see them.
|
||||||
|
}
|
||||||
|
m_Prisoner.Yell( number );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't refresh decay timer
|
||||||
|
public override void OnExit(Mobile m)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public LizardmenCamp( Serial serial ) : base( serial )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void AddItem( Item item, int xOffset, int yOffset, int zOffset )
|
||||||
|
{
|
||||||
|
if ( item != null )
|
||||||
|
item.Movable = false;
|
||||||
|
|
||||||
|
base.AddItem( item, xOffset, yOffset, zOffset );
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Serialize( GenericWriter writer )
|
||||||
|
{
|
||||||
|
base.Serialize( writer );
|
||||||
|
|
||||||
|
writer.Write( (int) 0 ); // version
|
||||||
|
|
||||||
|
writer.Write( m_Prisoner );
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Deserialize( GenericReader reader )
|
||||||
|
{
|
||||||
|
base.Deserialize( reader );
|
||||||
|
|
||||||
|
int version = reader.ReadInt();
|
||||||
|
|
||||||
|
switch ( version )
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
m_Prisoner = reader.ReadMobile();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -7,87 +7,175 @@ namespace Server.Multis
|
||||||
{
|
{
|
||||||
public class OrcCamp : BaseCamp
|
public class OrcCamp : BaseCamp
|
||||||
{
|
{
|
||||||
|
public virtual Mobile Orcs{ get{ return new Orc(); } }
|
||||||
|
|
||||||
private Mobile m_Prisoner;
|
private Mobile m_Prisoner;
|
||||||
private BaseDoor m_Gate;
|
|
||||||
|
private int m_SpawnRange;
|
||||||
|
|
||||||
[Constructable]
|
[Constructable]
|
||||||
public OrcCamp() : base( 0x1D4C )
|
public OrcCamp() : base( 0x10ee, 0 ) // dummy garbage at center
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AddComponents()
|
public override void AddComponents()
|
||||||
{
|
{
|
||||||
BaseCreature bc;
|
BaseCreature bc;
|
||||||
|
//BaseEscortable be;
|
||||||
|
|
||||||
IronGate gate = new IronGate( DoorFacing.EastCCW );
|
Visible = false;
|
||||||
m_Gate = gate;
|
DecayDelay = TimeSpan.FromMinutes(5.0);
|
||||||
|
AddItem(new Static(0x10ee), 0, 0, 0);
|
||||||
|
AddItem(new Static(0xfac), 0, 7, 0);
|
||||||
|
|
||||||
gate.KeyValue = Key.RandomValue();
|
switch ( Utility.Random( 3 ) )
|
||||||
gate.Locked = true;
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0xDE3 ), 0, 7, 0 ); // Campfire
|
||||||
|
AddItem( new Item( 0x974 ), 0, 7, 1 ); // Cauldron
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0x1E95 ), 0, 7, 1 ); // Rabbit on a spit
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0x1E94 ), 0, 7, 1 ); // Chicken on a spit
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AddItem(new Item(0x428), -5, -4, 0); // Gruesome Standart West
|
||||||
|
|
||||||
AddItem( gate, -2, 1, 0 );
|
AddCampChests();
|
||||||
|
|
||||||
MetalChest chest = new MetalChest();
|
for ( int i = 0; i < 3; i ++ )
|
||||||
|
{
|
||||||
chest.ItemID = 0xE7C;
|
AddMobile( Orcs, 6, Utility.RandomMinMax( -7, 7 ), Utility.RandomMinMax( -7, 7 ), 0 );
|
||||||
chest.LiftOverride = true;
|
}
|
||||||
chest.DropItem( new Key( KeyType.Iron, gate.KeyValue ) );
|
AddMobile( new OrcCaptain(), 2, Utility.RandomMinMax( -7, 7 ), Utility.RandomMinMax( -7, 7 ), 0 );
|
||||||
|
|
||||||
TreasureMapChest.Fill( chest, 2 );
|
|
||||||
|
|
||||||
AddItem( chest, 4, 4, 1 );
|
|
||||||
|
|
||||||
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 ) )
|
switch ( Utility.Random( 2 ) )
|
||||||
{
|
{
|
||||||
case 0: m_Prisoner = new Noble(); break;
|
case 0: m_Prisoner = new Noble(); break;
|
||||||
case 1: m_Prisoner = new SeekerOfAdventure(); break;
|
default: m_Prisoner = new SeekerOfAdventure(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//be = (BaseEscortable)m_Prisoner;
|
||||||
|
//be.m_Captive = true;
|
||||||
|
|
||||||
bc = (BaseCreature)m_Prisoner;
|
bc = (BaseCreature)m_Prisoner;
|
||||||
bc.IsPrisoner = true;
|
bc.IsPrisoner = true;
|
||||||
m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 );
|
bc.CantWalk = true;
|
||||||
|
|
||||||
AddMobile( m_Prisoner, 2, -2, 0, 0 );
|
m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 );
|
||||||
|
AddMobile( m_Prisoner, 2, Utility.RandomMinMax( -2, 2 ), Utility.RandomMinMax( -2, 2 ), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnEnter( Mobile m )
|
private void AddCampChests()
|
||||||
{
|
{
|
||||||
base.OnEnter( m );
|
LockableContainer chest = null;
|
||||||
|
|
||||||
if ( m.Player && m_Prisoner != null && m_Gate != null && m_Gate.Locked )
|
switch (Utility.Random(3))
|
||||||
|
{
|
||||||
|
case 0: chest = new MetalChest(); break;
|
||||||
|
case 1: chest = new MetalGoldenChest(); break;
|
||||||
|
default: chest = new WoodenChest(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
chest.LiftOverride = true;
|
||||||
|
|
||||||
|
TreasureMapChest.Fill(chest, 1);
|
||||||
|
|
||||||
|
AddItem(chest, -2, 2, 0);
|
||||||
|
|
||||||
|
LockableContainer crates = null;
|
||||||
|
|
||||||
|
switch (Utility.Random(4))
|
||||||
|
{
|
||||||
|
case 0: crates = new SmallCrate(); break;
|
||||||
|
case 1: crates = new MediumCrate(); break;
|
||||||
|
case 2: crates = new LargeCrate(); break;
|
||||||
|
default: crates = new LockableBarrel(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
crates.TrapType = TrapType.ExplosionTrap;
|
||||||
|
crates.TrapPower = Utility.RandomMinMax(30, 40);
|
||||||
|
crates.TrapLevel = 2;
|
||||||
|
|
||||||
|
crates.RequiredSkill = 76;
|
||||||
|
crates.LockLevel = 66;
|
||||||
|
crates.MaxLockLevel = 116;
|
||||||
|
crates.Locked = true;
|
||||||
|
|
||||||
|
crates.DropItem(new Gold(Utility.RandomMinMax(100, 400)));
|
||||||
|
crates.DropItem(new Arrow(10));
|
||||||
|
crates.DropItem(new Bolt(10));
|
||||||
|
|
||||||
|
crates.LiftOverride = true;
|
||||||
|
|
||||||
|
if (Utility.RandomDouble() < 0.8)
|
||||||
|
{
|
||||||
|
switch (Utility.Random(4))
|
||||||
|
{
|
||||||
|
case 0: crates.DropItem(new LesserCurePotion()); break;
|
||||||
|
case 1: crates.DropItem(new LesserExplosionPotion()); break;
|
||||||
|
case 2: crates.DropItem(new LesserHealPotion()); break;
|
||||||
|
default: crates.DropItem(new LesserPoisonPotion()); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AddItem(crates, 2, -2, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't refresh decay timer
|
||||||
|
public override void OnEnter(Mobile m)
|
||||||
|
{
|
||||||
|
if ( m.Player && m_Prisoner != null && m_Prisoner.CantWalk )
|
||||||
{
|
{
|
||||||
int number;
|
int number;
|
||||||
|
|
||||||
switch ( Utility.Random( 4 ) )
|
switch ( Utility.Random( 8 ) )
|
||||||
{
|
{
|
||||||
default:
|
case 0: number = 502261; break; // HELP!
|
||||||
case 0: number = 502264; break; // Help a poor prisoner!
|
case 1: number = 502262; break; // Help me!
|
||||||
case 1: number = 502266; break; // Aaah! Help me!
|
case 2: number = 502263; break; // Canst thou aid me?!
|
||||||
case 2: number = 1046000; break; // Help! These savages wish to end my life!
|
case 3: number = 502264; break; // Help a poor prisoner!
|
||||||
case 3: number = 1046003; break; // Quickly! Kill them for me! HELP!!
|
case 4: number = 502265; break; // Help! Please!
|
||||||
|
case 5: number = 502266; break; // Aaah! Help me!
|
||||||
|
case 6: number = 502267; break; // Go and get some help!
|
||||||
|
default: number = 502268; break; // Quickly, I beg thee! Unlock my chains! If thou dost look at me close thou canst see them.
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Prisoner.Yell( number );
|
m_Prisoner.Yell( number );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't refresh decay timer
|
||||||
|
public override void OnExit(Mobile m)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public OrcCamp( Serial serial ) : base( serial )
|
public OrcCamp( Serial serial ) : base( serial )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void AddItem( Item item, int xOffset, int yOffset, int zOffset )
|
||||||
|
{
|
||||||
|
if ( item != null )
|
||||||
|
item.Movable = false;
|
||||||
|
|
||||||
|
base.AddItem( item, xOffset, yOffset, zOffset );
|
||||||
|
}
|
||||||
|
|
||||||
public override void Serialize( GenericWriter writer )
|
public override void Serialize( GenericWriter writer )
|
||||||
{
|
{
|
||||||
base.Serialize( writer );
|
base.Serialize( writer );
|
||||||
|
|
||||||
writer.Write( (int) 0 ); // version
|
writer.Write( (int) 1 ); // version
|
||||||
|
|
||||||
writer.Write( m_Prisoner );
|
writer.Write( m_Prisoner );
|
||||||
writer.Write( m_Gate );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deserialize( GenericReader reader )
|
public override void Deserialize( GenericReader reader )
|
||||||
|
|
@ -98,10 +186,15 @@ namespace Server.Multis
|
||||||
|
|
||||||
switch ( version )
|
switch ( version )
|
||||||
{
|
{
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
m_Prisoner = reader.ReadMobile();
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
m_Prisoner = reader.ReadMobile();
|
m_Prisoner = reader.ReadMobile();
|
||||||
m_Gate = reader.ReadItem() as BaseDoor;
|
reader.ReadItem();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,87 +7,174 @@ namespace Server.Multis
|
||||||
{
|
{
|
||||||
public class RatCamp : BaseCamp
|
public class RatCamp : BaseCamp
|
||||||
{
|
{
|
||||||
|
public virtual Mobile Ratmen{ get{ return new Ratman(); } }
|
||||||
|
|
||||||
private Mobile m_Prisoner;
|
private Mobile m_Prisoner;
|
||||||
private BaseDoor m_Gate;
|
|
||||||
|
private int m_SpawnRange;
|
||||||
|
|
||||||
[Constructable]
|
[Constructable]
|
||||||
public RatCamp() : base( 0x1D4C )
|
public RatCamp() : base( 0x10ee, 0 ) // dummy garbage at center
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AddComponents()
|
public override void AddComponents()
|
||||||
{
|
{
|
||||||
BaseCreature bc;
|
BaseCreature bc;
|
||||||
|
//BaseEscortable be;
|
||||||
|
|
||||||
IronGate gate = new IronGate( DoorFacing.EastCCW );
|
Visible = false;
|
||||||
m_Gate = gate;
|
DecayDelay = TimeSpan.FromMinutes(5.0);
|
||||||
|
AddItem(new Static(0x10ee), 0, 0, 0);
|
||||||
|
AddItem(new Static(0xfac), 0, 6, 0);
|
||||||
|
|
||||||
gate.KeyValue = Key.RandomValue();
|
switch ( Utility.Random( 3 ) )
|
||||||
gate.Locked = true;
|
{
|
||||||
|
case 0:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0xDE3 ), 0, 6, 0 ); // Campfire
|
||||||
|
AddItem( new Item( 0x974 ), 0, 6, 1 ); // Cauldron
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0x1E95 ), 0, 6, 1 ); // Rabbit on a spit
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
AddItem( new Item( 0x1E94 ), 0, 6, 1 ); // Chicken on a spit
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
AddItem(new Item(0x41F), 5, 5, 0); // Gruesome Standart South
|
||||||
|
|
||||||
AddItem( gate, -2, 1, 0 );
|
AddCampChests();
|
||||||
|
|
||||||
MetalChest chest = new MetalChest();
|
for ( int i = 0; i < 4; i ++ )
|
||||||
|
{
|
||||||
chest.ItemID = 0xE7C;
|
AddMobile( Ratmen, 6, Utility.RandomMinMax( -7, 7 ), Utility.RandomMinMax( -7, 7 ), 0 );
|
||||||
chest.LiftOverride = true;
|
}
|
||||||
chest.DropItem( new Key( KeyType.Iron, gate.KeyValue ) );
|
|
||||||
|
|
||||||
TreasureMapChest.Fill( chest, 2 );
|
|
||||||
|
|
||||||
AddItem( chest, 4, 4, 1 );
|
|
||||||
|
|
||||||
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 ) )
|
switch ( Utility.Random( 2 ) )
|
||||||
{
|
{
|
||||||
case 0: m_Prisoner = new Noble(); break;
|
case 0: m_Prisoner = new Noble(); break;
|
||||||
case 1: m_Prisoner = new SeekerOfAdventure(); break;
|
default: m_Prisoner = new SeekerOfAdventure(); break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//be = (BaseEscortable)m_Prisoner;
|
||||||
|
//be.m_Captive = true;
|
||||||
|
|
||||||
bc = (BaseCreature)m_Prisoner;
|
bc = (BaseCreature)m_Prisoner;
|
||||||
bc.IsPrisoner = true;
|
bc.IsPrisoner = true;
|
||||||
m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 );
|
bc.CantWalk = true;
|
||||||
|
|
||||||
AddMobile( m_Prisoner, 2, -2, 0, 0 );
|
m_Prisoner.YellHue = Utility.RandomList( 0x57, 0x67, 0x77, 0x87, 0x117 );
|
||||||
|
AddMobile( m_Prisoner, 2, Utility.RandomMinMax( -2, 2 ), Utility.RandomMinMax( -2, 2 ), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void OnEnter( Mobile m )
|
private void AddCampChests()
|
||||||
{
|
{
|
||||||
base.OnEnter( m );
|
LockableContainer chest = null;
|
||||||
|
|
||||||
if ( m.Player && m_Prisoner != null && m_Gate != null && m_Gate.Locked )
|
switch (Utility.Random(3))
|
||||||
|
{
|
||||||
|
case 0: chest = new MetalChest(); break;
|
||||||
|
case 1: chest = new MetalGoldenChest(); break;
|
||||||
|
default: chest = new WoodenChest(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
chest.LiftOverride = true;
|
||||||
|
|
||||||
|
TreasureMapChest.Fill(chest, 1);
|
||||||
|
|
||||||
|
AddItem(chest, -2, -2, 0);
|
||||||
|
|
||||||
|
LockableContainer crates = null;
|
||||||
|
|
||||||
|
switch (Utility.Random(4))
|
||||||
|
{
|
||||||
|
case 0: crates = new SmallCrate(); break;
|
||||||
|
case 1: crates = new MediumCrate(); break;
|
||||||
|
case 2: crates = new LargeCrate(); break;
|
||||||
|
default: crates = new LockableBarrel(); break;
|
||||||
|
}
|
||||||
|
|
||||||
|
crates.TrapType = TrapType.ExplosionTrap;
|
||||||
|
crates.TrapPower = Utility.RandomMinMax(30, 40);
|
||||||
|
crates.TrapLevel = 2;
|
||||||
|
|
||||||
|
crates.RequiredSkill = 76;
|
||||||
|
crates.LockLevel = 66;
|
||||||
|
crates.MaxLockLevel = 116;
|
||||||
|
crates.Locked = true;
|
||||||
|
|
||||||
|
crates.DropItem(new Gold(Utility.RandomMinMax(100, 400)));
|
||||||
|
crates.DropItem(new Arrow(10));
|
||||||
|
crates.DropItem(new Bolt(10));
|
||||||
|
|
||||||
|
crates.LiftOverride = true;
|
||||||
|
|
||||||
|
if (Utility.RandomDouble() < 0.8)
|
||||||
|
{
|
||||||
|
switch (Utility.Random(4))
|
||||||
|
{
|
||||||
|
case 0: crates.DropItem(new LesserCurePotion()); break;
|
||||||
|
case 1: crates.DropItem(new LesserExplosionPotion()); break;
|
||||||
|
case 2: crates.DropItem(new LesserHealPotion()); break;
|
||||||
|
default: crates.DropItem(new LesserPoisonPotion()); break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AddItem(crates, 2, 2, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't refresh decay timer
|
||||||
|
public override void OnEnter(Mobile m)
|
||||||
|
{
|
||||||
|
if ( m.Player && m_Prisoner != null && m_Prisoner.CantWalk )
|
||||||
{
|
{
|
||||||
int number;
|
int number;
|
||||||
|
|
||||||
switch ( Utility.Random( 4 ) )
|
switch ( Utility.Random( 8 ) )
|
||||||
{
|
{
|
||||||
default:
|
case 0: number = 502261; break; // HELP!
|
||||||
case 0: number = 502264; break; // Help a poor prisoner!
|
case 1: number = 502262; break; // Help me!
|
||||||
case 1: number = 502266; break; // Aaah! Help me!
|
case 2: number = 502263; break; // Canst thou aid me?!
|
||||||
case 2: number = 1046000; break; // Help! These savages wish to end my life!
|
case 3: number = 502264; break; // Help a poor prisoner!
|
||||||
case 3: number = 1046003; break; // Quickly! Kill them for me! HELP!!
|
case 4: number = 502265; break; // Help! Please!
|
||||||
|
case 5: number = 502266; break; // Aaah! Help me!
|
||||||
|
case 6: number = 502267; break; // Go and get some help!
|
||||||
|
default: number = 502268; break; // Quickly, I beg thee! Unlock my chains! If thou dost look at me close thou canst see them.
|
||||||
}
|
}
|
||||||
|
|
||||||
m_Prisoner.Yell( number );
|
m_Prisoner.Yell( number );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Don't refresh decay timer
|
||||||
|
public override void OnExit(Mobile m)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
public RatCamp( Serial serial ) : base( serial )
|
public RatCamp( Serial serial ) : base( serial )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void AddItem( Item item, int xOffset, int yOffset, int zOffset )
|
||||||
|
{
|
||||||
|
if ( item != null )
|
||||||
|
item.Movable = false;
|
||||||
|
|
||||||
|
base.AddItem( item, xOffset, yOffset, zOffset );
|
||||||
|
}
|
||||||
|
|
||||||
public override void Serialize( GenericWriter writer )
|
public override void Serialize( GenericWriter writer )
|
||||||
{
|
{
|
||||||
base.Serialize( writer );
|
base.Serialize( writer );
|
||||||
|
|
||||||
writer.Write( (int) 0 ); // version
|
writer.Write( (int) 1 ); // version
|
||||||
|
|
||||||
writer.Write( m_Prisoner );
|
writer.Write( m_Prisoner );
|
||||||
writer.Write( m_Gate );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Deserialize( GenericReader reader )
|
public override void Deserialize( GenericReader reader )
|
||||||
|
|
@ -98,10 +185,15 @@ namespace Server.Multis
|
||||||
|
|
||||||
switch ( version )
|
switch ( version )
|
||||||
{
|
{
|
||||||
|
case 1:
|
||||||
|
{
|
||||||
|
m_Prisoner = reader.ReadMobile();
|
||||||
|
break;
|
||||||
|
}
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
m_Prisoner = reader.ReadMobile();
|
m_Prisoner = reader.ReadMobile();
|
||||||
m_Gate = reader.ReadItem() as BaseDoor;
|
reader.ReadItem();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue