#W# Source and Scripts added. Added Scripts/Settings.cs to expose some basic tweak able settings.
This commit is contained in:
parent
b51c58f514
commit
3045c83799
3512 changed files with 627673 additions and 0 deletions
86
Scripts/Mobiles/Guards/BaseGuard.cs
Normal file
86
Scripts/Mobiles/Guards/BaseGuard.cs
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server.Misc;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Mobiles
|
||||
{
|
||||
public abstract class BaseGuard : Mobile
|
||||
{
|
||||
public static void Spawn( Mobile caller, Mobile target )
|
||||
{
|
||||
Spawn( caller, target, 1, false );
|
||||
}
|
||||
|
||||
public static void Spawn( Mobile caller, Mobile target, int amount, bool onlyAdditional )
|
||||
{
|
||||
if ( target == null || target.Deleted )
|
||||
return;
|
||||
|
||||
foreach ( Mobile m in target.GetMobilesInRange( 15 ) )
|
||||
{
|
||||
if ( m is BaseGuard )
|
||||
{
|
||||
BaseGuard g = (BaseGuard)m;
|
||||
|
||||
if ( g.Focus == null ) // idling
|
||||
{
|
||||
g.Focus = target;
|
||||
|
||||
--amount;
|
||||
}
|
||||
else if ( g.Focus == target && !onlyAdditional )
|
||||
{
|
||||
--amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
while ( amount-- > 0 )
|
||||
caller.Region.MakeGuard( target );
|
||||
}
|
||||
|
||||
public BaseGuard( Mobile target )
|
||||
{
|
||||
if ( target != null )
|
||||
{
|
||||
Location = target.Location;
|
||||
Map = target.Map;
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( Location, Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 5023 );
|
||||
}
|
||||
}
|
||||
|
||||
public BaseGuard( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
Effects.SendLocationParticles( EffectItem.Create( Location, Map, EffectItem.DefaultDuration ), 0x3728, 10, 10, 2023 );
|
||||
|
||||
PlaySound( 0x1FE );
|
||||
|
||||
Delete();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract Mobile Focus{ get; set; }
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue