Reorganizes Project (#41)
This commit is contained in:
parent
08bf44af9a
commit
3614a66aee
3499 changed files with 79 additions and 55 deletions
|
|
@ -0,0 +1,121 @@
|
|||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Factions
|
||||
{
|
||||
public abstract class BaseFactionVendor : BaseVendor
|
||||
{
|
||||
private Faction m_Faction;
|
||||
private Town m_Town;
|
||||
|
||||
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)
|
||||
{
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.Administrator)]
|
||||
public Town Town
|
||||
{
|
||||
get => m_Town;
|
||||
set
|
||||
{
|
||||
Unregister();
|
||||
m_Town = value;
|
||||
Register();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.Counselor, AccessLevel.Administrator)]
|
||||
public Faction Faction
|
||||
{
|
||||
get => m_Faction;
|
||||
set
|
||||
{
|
||||
Unregister();
|
||||
m_Faction = value;
|
||||
Register();
|
||||
}
|
||||
}
|
||||
|
||||
protected override List<SBInfo> SBInfos{ get; } = new List<SBInfo>();
|
||||
|
||||
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()
|
||||
{
|
||||
m_Town?.UnregisterVendor(this);
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
{
|
||||
base.OnAfterDelete();
|
||||
|
||||
Unregister();
|
||||
}
|
||||
|
||||
public override bool CheckVendorAccess(Mobile from)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(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,66 @@
|
|||
using System.Collections.Generic;
|
||||
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 FactionBoardVendor(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
SBInfos.Add(new SBFactionBoard());
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem(new HalfApron());
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SBFactionBoard : SBInfo
|
||||
{
|
||||
public override IShopSellInfo SellInfo{ get; } = new InternalSellInfo();
|
||||
|
||||
public override List<GenericBuyInfo> BuyInfo{ get; } = new InternalBuyInfo();
|
||||
|
||||
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
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
using System.Collections.Generic;
|
||||
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 FactionBottleVendor(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override VendorShoeType ShoeType => Utility.RandomBool() ? VendorShoeType.Shoes : VendorShoeType.Sandals;
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
SBInfos.Add(new SBFactionBottle());
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem(new Robe(Utility.RandomPinkHue()));
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SBFactionBottle : SBInfo
|
||||
{
|
||||
public override IShopSellInfo SellInfo{ get; } = new InternalSellInfo();
|
||||
|
||||
public override List<GenericBuyInfo> BuyInfo{ get; } = new InternalBuyInfo();
|
||||
|
||||
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
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
using System.Collections.Generic;
|
||||
using Server.Items;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
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 FactionHorseVendor(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override VendorShoeType ShoeType => Female ? VendorShoeType.ThighBoots : VendorShoeType.Boots;
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
}
|
||||
|
||||
public override int GetShoeHue()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem(Utility.RandomBool() ? new QuarterStaff() : (Item)new ShepherdsCrook());
|
||||
}
|
||||
|
||||
public override void VendorBuy(Mobile from)
|
||||
{
|
||||
if (Faction == null || Faction.Find(from, true) != 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 mobile)
|
||||
mobile.SendGump(new HorseBreederGump(mobile, 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(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
using System.Collections.Generic;
|
||||
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 FactionOreVendor(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
SBInfos.Add(new SBFactionOre());
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem(new HalfApron());
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(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 };
|
||||
|
||||
public override IShopSellInfo SellInfo{ get; } = new InternalSellInfo();
|
||||
|
||||
public override List<GenericBuyInfo> BuyInfo{ get; } = new InternalBuyInfo();
|
||||
|
||||
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
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
using System.Collections.Generic;
|
||||
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 FactionReagentVendor(Serial serial) : base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override VendorShoeType ShoeType => Utility.RandomBool() ? VendorShoeType.Shoes : VendorShoeType.Sandals;
|
||||
|
||||
public override void InitSBInfo()
|
||||
{
|
||||
SBInfos.Add(new SBFactionReagent());
|
||||
}
|
||||
|
||||
public override void InitOutfit()
|
||||
{
|
||||
base.InitOutfit();
|
||||
|
||||
AddItem(new Robe(Utility.RandomBlueHue()));
|
||||
AddItem(new GnarledStaff());
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write(0); // version
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
|
||||
public class SBFactionReagent : SBInfo
|
||||
{
|
||||
public override IShopSellInfo SellInfo{ get; } = new InternalSellInfo();
|
||||
|
||||
public override List<GenericBuyInfo> BuyInfo{ get; } = new InternalBuyInfo();
|
||||
|
||||
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
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue