#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
115
Scripts/Engines/Factions/Mobiles/Vendors/BaseFactionVendor.cs
Normal file
115
Scripts/Engines/Factions/Mobiles/Vendors/BaseFactionVendor.cs
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public abstract class BaseFactionVendor : BaseVendor
|
||||
{
|
||||
private Town m_Town;
|
||||
private Faction m_Faction;
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.Administrator )]
|
||||
public Town Town
|
||||
{
|
||||
get{ return m_Town; }
|
||||
set{ Unregister(); m_Town = value; Register(); }
|
||||
}
|
||||
|
||||
[CommandProperty( AccessLevel.Counselor, AccessLevel.Administrator )]
|
||||
public Faction Faction
|
||||
{
|
||||
get{ return m_Faction; }
|
||||
set{ Unregister(); m_Faction = value; Register(); }
|
||||
}
|
||||
|
||||
public void Register()
|
||||
{
|
||||
if ( m_Town != null && m_Faction != null )
|
||||
m_Town.RegisterVendor( this );
|
||||
}
|
||||
|
||||
public override bool OnMoveOver( Mobile m )
|
||||
{
|
||||
if ( Core.ML )
|
||||
return true;
|
||||
|
||||
return base.OnMoveOver( m );
|
||||
}
|
||||
|
||||
public void Unregister()
|
||||
{
|
||||
if ( m_Town != null )
|
||||
m_Town.UnregisterVendor( this );
|
||||
}
|
||||
|
||||
private List<SBInfo> m_SBInfos = new List<SBInfo>();
|
||||
protected override List<SBInfo> SBInfos{ get { return m_SBInfos; } }
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
Unregister();
|
||||
}
|
||||
|
||||
public override bool CheckVendorAccess( Mobile from )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public BaseFactionVendor( Town town, Faction faction, string title ) : base( title )
|
||||
{
|
||||
Frozen = true;
|
||||
CantWalk = true;
|
||||
Female = false;
|
||||
BodyValue = 400;
|
||||
Name = NameList.RandomName( "male" );
|
||||
|
||||
RangeHome = 0;
|
||||
|
||||
m_Town = town;
|
||||
m_Faction = faction;
|
||||
Register();
|
||||
}
|
||||
|
||||
public BaseFactionVendor( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize( GenericWriter writer )
|
||||
{
|
||||
base.Serialize( writer );
|
||||
|
||||
writer.Write( (int) 0 ); // version
|
||||
|
||||
Town.WriteReference( writer, m_Town );
|
||||
Faction.WriteReference( writer, m_Faction );
|
||||
}
|
||||
|
||||
public override void Deserialize( GenericReader reader )
|
||||
{
|
||||
base.Deserialize( reader );
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
switch ( version )
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
m_Town = Town.ReadReference( reader );
|
||||
m_Faction = Faction.ReadReference( reader );
|
||||
Register();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Frozen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,76 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class FactionBoardVendor : BaseFactionVendor
|
||||
{
|
||||
public FactionBoardVendor( Town town, Faction faction ) : base( town, faction, "the LumberMan" ) // NOTE: title inconsistant, as OSI
|
||||
{
|
||||
SetSkill( SkillName.Carpentry, 85.0, 100.0 );
|
||||
SetSkill( SkillName.Lumberjacking, 60.0, 83.0 );
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
SBInfos.Add( new SBFactionBoard() );
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem( new HalfApron() );
|
||||
}
|
||||
|
||||
public FactionBoardVendor( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class SBFactionBoard : SBInfo
|
||||
{
|
||||
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
|
||||
private IShopSellInfo m_SellInfo = new InternalSellInfo();
|
||||
|
||||
public SBFactionBoard()
|
||||
{
|
||||
}
|
||||
|
||||
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
|
||||
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
|
||||
|
||||
public class InternalBuyInfo : List<GenericBuyInfo>
|
||||
{
|
||||
public InternalBuyInfo()
|
||||
{
|
||||
for ( int i = 0; i < 5; ++i )
|
||||
Add( new GenericBuyInfo( typeof( Board ), 3, 20, 0x1BD7, 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalSellInfo : GenericSellInfo
|
||||
{
|
||||
public InternalSellInfo()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class FactionBottleVendor : BaseFactionVendor
|
||||
{
|
||||
public FactionBottleVendor( Town town, Faction faction ) : base( town, faction, "the Bottle Seller" )
|
||||
{
|
||||
SetSkill( SkillName.Alchemy, 85.0, 100.0 );
|
||||
SetSkill( SkillName.TasteID, 65.0, 88.0 );
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
SBInfos.Add( new SBFactionBottle() );
|
||||
}
|
||||
|
||||
public override VendorShoeType ShoeType
|
||||
{
|
||||
get{ return Utility.RandomBool() ? VendorShoeType.Shoes : VendorShoeType.Sandals; }
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem( new Robe( Utility.RandomPinkHue() ) );
|
||||
}
|
||||
|
||||
public FactionBottleVendor( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class SBFactionBottle : SBInfo
|
||||
{
|
||||
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
|
||||
private IShopSellInfo m_SellInfo = new InternalSellInfo();
|
||||
|
||||
public SBFactionBottle()
|
||||
{
|
||||
}
|
||||
|
||||
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
|
||||
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
|
||||
|
||||
public class InternalBuyInfo : List<GenericBuyInfo>
|
||||
{
|
||||
public InternalBuyInfo()
|
||||
{
|
||||
for ( int i = 0; i < 5; ++i )
|
||||
Add( new GenericBuyInfo( typeof( Bottle ), 5, 20, 0xF0E, 0 ) );
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalSellInfo : GenericSellInfo
|
||||
{
|
||||
public InternalSellInfo()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class FactionHorseVendor : BaseFactionVendor
|
||||
{
|
||||
public FactionHorseVendor( Town town, Faction faction ) : base( town, faction, "the Horse Breeder" )
|
||||
{
|
||||
SetSkill( SkillName.AnimalLore, 64.0, 100.0 );
|
||||
SetSkill( SkillName.AnimalTaming, 90.0, 100.0 );
|
||||
SetSkill( SkillName.Veterinary, 65.0, 88.0 );
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public override VendorShoeType ShoeType
|
||||
{
|
||||
get{ return Female ? VendorShoeType.ThighBoots : VendorShoeType.Boots; }
|
||||
}
|
||||
|
||||
public override int GetShoeHue()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem( Utility.RandomBool() ? (Item)new QuarterStaff() : (Item)new ShepherdsCrook() );
|
||||
}
|
||||
|
||||
public FactionHorseVendor( Serial serial ) : base( serial )
|
||||
{
|
||||
}
|
||||
|
||||
public override void VendorBuy( Mobile from )
|
||||
{
|
||||
if ( this.Faction == null || Faction.Find( from, true ) != this.Faction )
|
||||
PrivateOverheadMessage( MessageType.Regular, 0x3B2, 1042201, from.NetState ); // You are not in my faction, I cannot sell you a horse!
|
||||
else if ( FactionGump.Exists( from ) )
|
||||
from.SendLocalizedMessage( 1042160 ); // You already have a faction menu open.
|
||||
else if ( from is PlayerMobile )
|
||||
from.SendGump( new HorseBreederGump( (PlayerMobile) from, this.Faction ) );
|
||||
}
|
||||
|
||||
public override void VendorSell( Mobile from )
|
||||
{
|
||||
}
|
||||
|
||||
public override bool OnBuyItems( Mobile buyer, List<BuyItemResponse> list )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool OnSellItems( Mobile seller, List<SellItemResponse> list )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
79
Scripts/Engines/Factions/Mobiles/Vendors/FactionOreVendor.cs
Normal file
79
Scripts/Engines/Factions/Mobiles/Vendors/FactionOreVendor.cs
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class FactionOreVendor : BaseFactionVendor
|
||||
{
|
||||
public FactionOreVendor( Town town, Faction faction ) : base( town, faction, "the Ore Man" )
|
||||
{
|
||||
// NOTE: Skills verified
|
||||
SetSkill( SkillName.Carpentry, 85.0, 100.0 );
|
||||
SetSkill( SkillName.Lumberjacking, 60.0, 83.0 );
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
SBInfos.Add( new SBFactionOre() );
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem( new HalfApron() );
|
||||
}
|
||||
|
||||
public FactionOreVendor( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class SBFactionOre : SBInfo
|
||||
{
|
||||
private static readonly object[] m_FixedSizeArgs = { true };
|
||||
|
||||
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
|
||||
private IShopSellInfo m_SellInfo = new InternalSellInfo();
|
||||
|
||||
public SBFactionOre()
|
||||
{
|
||||
}
|
||||
|
||||
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
|
||||
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
|
||||
|
||||
public class InternalBuyInfo : List<GenericBuyInfo>
|
||||
{
|
||||
public InternalBuyInfo()
|
||||
{
|
||||
for ( int i = 0; i < 5; ++i )
|
||||
Add( new GenericBuyInfo( typeof( IronOre ), 16, 20, 0x19B8, 0, m_FixedSizeArgs ) );
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalSellInfo : GenericSellInfo
|
||||
{
|
||||
public InternalSellInfo()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Server;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public class FactionReagentVendor : BaseFactionVendor
|
||||
{
|
||||
public FactionReagentVendor( Town town, Faction faction ) : base( town, faction, "the Reagent Man" )
|
||||
{
|
||||
SetSkill( SkillName.EvalInt, 65.0, 88.0 );
|
||||
SetSkill( SkillName.Inscribe, 60.0, 83.0 );
|
||||
SetSkill( SkillName.Magery, 64.0, 100.0 );
|
||||
SetSkill( SkillName.Meditation, 60.0, 83.0 );
|
||||
SetSkill( SkillName.MagicResist, 65.0, 88.0 );
|
||||
SetSkill( SkillName.Wrestling, 36.0, 68.0 );
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
SBInfos.Add( new SBFactionReagent() );
|
||||
}
|
||||
|
||||
public override VendorShoeType ShoeType
|
||||
{
|
||||
get{ return Utility.RandomBool() ? VendorShoeType.Shoes : VendorShoeType.Sandals; }
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem( new Robe( Utility.RandomBlueHue() ) );
|
||||
AddItem( new GnarledStaff() );
|
||||
}
|
||||
|
||||
public FactionReagentVendor( 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();
|
||||
}
|
||||
}
|
||||
|
||||
public class SBFactionReagent : SBInfo
|
||||
{
|
||||
private List<GenericBuyInfo> m_BuyInfo = new InternalBuyInfo();
|
||||
private IShopSellInfo m_SellInfo = new InternalSellInfo();
|
||||
|
||||
public SBFactionReagent()
|
||||
{
|
||||
}
|
||||
|
||||
public override IShopSellInfo SellInfo { get { return m_SellInfo; } }
|
||||
public override List<GenericBuyInfo> BuyInfo { get { return m_BuyInfo; } }
|
||||
|
||||
public class InternalBuyInfo : List<GenericBuyInfo>
|
||||
{
|
||||
public InternalBuyInfo()
|
||||
{
|
||||
for ( int i = 0; i < 2; ++i )
|
||||
{
|
||||
Add( new GenericBuyInfo( typeof( BlackPearl ), 5, 20, 0xF7A, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( Bloodmoss ), 5, 20, 0xF7B, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( MandrakeRoot ), 3, 20, 0xF86, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( Garlic ), 3, 20, 0xF84, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( Ginseng ), 3, 20, 0xF85, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( Nightshade ), 3, 20, 0xF88, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( SpidersSilk ), 3, 20, 0xF8D, 0 ) );
|
||||
Add( new GenericBuyInfo( typeof( SulfurousAsh ), 3, 20, 0xF8C, 0 ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class InternalSellInfo : GenericSellInfo
|
||||
{
|
||||
public InternalSellInfo()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue