#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
81
Scripts/Engines/Factions/Items/JoinStone.cs
Normal file
81
Scripts/Engines/Factions/Items/JoinStone.cs
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
using System;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class JoinStone : BaseSystemController
|
||||
{
|
||||
private Faction m_Faction;
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.Administrator )]
|
||||
public Faction Faction
|
||||
{
|
||||
get{ return m_Faction; }
|
||||
set
|
||||
{
|
||||
m_Faction = value;
|
||||
|
||||
Hue = ( m_Faction == null ? 0 : m_Faction.Definition.HueJoin );
|
||||
AssignName( m_Faction == null ? null : m_Faction.Definition.SignupName );
|
||||
}
|
||||
}
|
||||
|
||||
public override string DefaultName { get { return "faction signup stone"; } }
|
||||
|
||||
[Constructable]
|
||||
public JoinStone() : this( null )
|
||||
{
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public JoinStone( Faction faction ) : base( 0xEDC )
|
||||
{
|
||||
Movable = false;
|
||||
Faction = faction;
|
||||
}
|
||||
|
||||
public override void OnDoubleClick( Mobile from )
|
||||
{
|
||||
if ( m_Faction == null )
|
||||
return;
|
||||
|
||||
if ( !from.InRange( GetWorldLocation(), 2 ) )
|
||||
from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
|
||||
else if ( FactionGump.Exists( from ) )
|
||||
from.SendLocalizedMessage( 1042160 ); // You already have a faction menu open.
|
||||
else if ( Faction.Find( from ) == null && from is PlayerMobile )
|
||||
from.SendGump( new JoinStoneGump( (PlayerMobile) from, m_Faction ) );
|
||||
}
|
||||
|
||||
public JoinStone( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
Faction.WriteReference( writer, m_Faction );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
Faction = Faction.ReadReference( reader );
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue