This commit is contained in:
parent
e41632fe95
commit
9c5abc3b0d
48 changed files with 261 additions and 70 deletions
|
|
@ -7,6 +7,10 @@ namespace Server.Items
|
|||
[Constructable]
|
||||
public FireColumnTrap() : base( 0x1B71 )
|
||||
{
|
||||
m_MinDamage = 10;
|
||||
m_MaxDamage = 40;
|
||||
|
||||
m_WarningFlame = true;
|
||||
}
|
||||
|
||||
public override bool PassivelyTriggered{ get{ return true; } }
|
||||
|
|
@ -14,16 +18,54 @@ namespace Server.Items
|
|||
public override int PassiveTriggerRange{ get{ return 3; } }
|
||||
public override TimeSpan ResetDelay{ get{ return TimeSpan.FromSeconds( 0.5 ); } }
|
||||
|
||||
private int m_MinDamage;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public virtual int MinDamage
|
||||
{
|
||||
get { return m_MinDamage; }
|
||||
set { m_MinDamage = value; }
|
||||
}
|
||||
|
||||
private int m_MaxDamage;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public virtual int MaxDamage
|
||||
{
|
||||
get { return m_MaxDamage; }
|
||||
set { m_MaxDamage = value; }
|
||||
}
|
||||
|
||||
private bool m_WarningFlame;
|
||||
|
||||
[CommandProperty( AccessLevel.GameMaster )]
|
||||
public virtual bool WarningFlame
|
||||
{
|
||||
get { return m_WarningFlame; }
|
||||
set { m_WarningFlame = value; }
|
||||
}
|
||||
|
||||
public override void OnTrigger( Mobile from )
|
||||
{
|
||||
if ( from.AccessLevel > AccessLevel.Player )
|
||||
return;
|
||||
|
||||
Effects.SendLocationParticles( EffectItem.Create( Location, Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 );
|
||||
Effects.PlaySound( Location, Map, 0x225 );
|
||||
if ( WarningFlame )
|
||||
DoEffect();
|
||||
|
||||
if ( from.Alive && CheckRange( from.Location, 0 ) )
|
||||
Spells.SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, from, Utility.RandomMinMax( 10, 40 ), 0, 100, 0, 0, 0 );
|
||||
{
|
||||
Spells.SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, from, Utility.RandomMinMax( MinDamage, MaxDamage ), 0, 100, 0, 0, 0 );
|
||||
|
||||
if ( !WarningFlame )
|
||||
DoEffect();
|
||||
}
|
||||
}
|
||||
|
||||
private void DoEffect()
|
||||
{
|
||||
Effects.SendLocationParticles( EffectItem.Create( Location, Map, EffectItem.DefaultDuration ), 0x3709, 10, 30, 5052 );
|
||||
Effects.PlaySound( Location, Map, 0x225 );
|
||||
}
|
||||
|
||||
public FireColumnTrap( Serial serial ) : base( serial )
|
||||
|
|
@ -34,7 +76,11 @@ namespace Server.Items
|
|||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
writer.Write( (int) 1 ); // version
|
||||
|
||||
writer.Write( m_WarningFlame );
|
||||
writer.Write( m_MinDamage );
|
||||
writer.Write( m_MaxDamage );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
|
|
@ -42,6 +88,24 @@ namespace Server.Items
|
|||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
m_WarningFlame = reader.ReadBool();
|
||||
m_MinDamage = reader.ReadInt();
|
||||
m_MaxDamage = reader.ReadInt();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( version == 0 )
|
||||
{
|
||||
m_WarningFlame = true;
|
||||
m_MinDamage = 10;
|
||||
m_MaxDamage = 40;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue