Overwrite
Complete Overwrite of the Folder with the free shard. ServUO 57.3 has been added.
This commit is contained in:
35
Scripts/Items/Functional/Automaton/AutomatonActuator.cs
Normal file
35
Scripts/Items/Functional/Automaton/AutomatonActuator.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AutomatonActuator : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1156997; } } // Automaton Actuator
|
||||
|
||||
[Constructable]
|
||||
public AutomatonActuator()
|
||||
: base(0x9CE9)
|
||||
{
|
||||
}
|
||||
|
||||
public AutomatonActuator(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
106
Scripts/Items/Functional/Automaton/AutomatonStatue.cs
Normal file
106
Scripts/Items/Functional/Automaton/AutomatonStatue.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class AutomatonStatue : Item
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public KotlAutomaton Automaton { get; set; }
|
||||
|
||||
public override int LabelNumber { get { return 1124395; } } // Automaton
|
||||
public override bool HandlesOnMovement { get { return Automaton == null; } }
|
||||
|
||||
[Constructable]
|
||||
public AutomatonStatue()
|
||||
: base(Utility.RandomBool() ? 0x9DB3 : 0x9DB4)
|
||||
{
|
||||
Movable = false;
|
||||
}
|
||||
|
||||
public override void OnMovement(Mobile m, Point3D lastLocation)
|
||||
{
|
||||
base.OnMovement(m, lastLocation);
|
||||
|
||||
if (m.Player && m.InRange(this.Location, 5) && m.AccessLevel == AccessLevel.Player && 0.5 > Utility.RandomDouble())
|
||||
{
|
||||
var automaton = new KotlAutomaton();
|
||||
automaton.MoveToWorld(Location, Map);
|
||||
|
||||
OnBirth(automaton, this);
|
||||
|
||||
Visible = false;
|
||||
Automaton = automaton;
|
||||
|
||||
Timer.DelayCall(() => automaton.Combatant = m);
|
||||
}
|
||||
}
|
||||
|
||||
public static Dictionary<KotlAutomaton, AutomatonStatue> Statues { get; set; }
|
||||
|
||||
public static void OnBirth(KotlAutomaton automaton, AutomatonStatue statue)
|
||||
{
|
||||
if (Statues == null)
|
||||
Statues = new Dictionary<KotlAutomaton, AutomatonStatue>();
|
||||
|
||||
if (!Statues.ContainsKey(automaton))
|
||||
Statues[automaton] = statue;
|
||||
|
||||
}
|
||||
|
||||
public static void OnDeath(KotlAutomaton automaton)
|
||||
{
|
||||
if (Statues == null)
|
||||
return;
|
||||
|
||||
if (Statues.ContainsKey(automaton) && Statues[automaton] != null && !Statues[automaton].Deleted)
|
||||
{
|
||||
Statues[automaton].Delete();
|
||||
Statues.Remove(automaton);
|
||||
|
||||
if (Statues.Count == 0)
|
||||
Statues = null;
|
||||
}
|
||||
}
|
||||
|
||||
public AutomatonStatue(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
if (Automaton != null)
|
||||
{
|
||||
writer.Write(0);
|
||||
writer.Write(Automaton);
|
||||
}
|
||||
else
|
||||
{
|
||||
writer.Write(1);
|
||||
}
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
if (reader.ReadInt() == 0)
|
||||
{
|
||||
Automaton = reader.ReadMobile() as KotlAutomaton;
|
||||
|
||||
if (Automaton == null)
|
||||
{
|
||||
Delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
75
Scripts/Items/Functional/Automaton/BlackrockAutomaton.cs
Normal file
75
Scripts/Items/Functional/Automaton/BlackrockAutomaton.cs
Normal file
@@ -0,0 +1,75 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlackrockAutomaton : KotlAutomaton
|
||||
{
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public override Type RepairResource
|
||||
{
|
||||
get
|
||||
{
|
||||
return typeof(CrystallineBlackrock); // TODO: Needs to be regular blackrock. THis doesn't exist on ServUO
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public BlackrockAutomaton()
|
||||
{
|
||||
Name = "blackrock automaton";
|
||||
Body = 1406;
|
||||
BaseSoundID = 541;
|
||||
|
||||
Hue = 0x8497;
|
||||
|
||||
SetStr(800, 900);
|
||||
SetDex(67, 74);
|
||||
SetInt(255, 263);
|
||||
|
||||
SetHits(774, 876);
|
||||
|
||||
SetDamage(15, 20);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 55, 60);
|
||||
SetResistance(ResistanceType.Fire, 55, 60);
|
||||
SetResistance(ResistanceType.Cold, 50, 55);
|
||||
SetResistance(ResistanceType.Poison, 50, 55);
|
||||
SetResistance(ResistanceType.Energy, 45, 50);
|
||||
|
||||
SetSkill(SkillName.Anatomy, 90.3, 99.9);
|
||||
SetSkill(SkillName.MagicResist, 121.0, 126.7);
|
||||
SetSkill(SkillName.Tactics, 82.0, 94.8);
|
||||
SetSkill(SkillName.Wrestling, 94.4, 108.4);
|
||||
|
||||
SetWeaponAbility(WeaponAbility.ParalyzingBlow);
|
||||
SetWeaponAbility(WeaponAbility.Disarm);
|
||||
SetWeaponAbility(WeaponAbility.ArmorPierce);
|
||||
}
|
||||
|
||||
public override double WeaponAbilityChance { get { return 0.45; } }
|
||||
|
||||
public override void OnResourceChanged()
|
||||
{
|
||||
}
|
||||
|
||||
public BlackrockAutomaton(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)0);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
}
|
||||
}
|
||||
}
|
||||
46
Scripts/Items/Functional/Automaton/BlackrockAutomatonHead.cs
Normal file
46
Scripts/Items/Functional/Automaton/BlackrockAutomatonHead.cs
Normal file
@@ -0,0 +1,46 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x9DB1, 0x9DB2)]
|
||||
public class BlackrockAutomatonHead : KotlAutomatonHead
|
||||
{
|
||||
public override int LabelNumber { get { return 1157220; } } // Blackrock Automaton Head
|
||||
|
||||
[Constructable]
|
||||
public BlackrockAutomatonHead()
|
||||
{
|
||||
Hue = 1175;
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1157022, "#1157178"); // Rebuilt ~1_MATTYPE~ Automaton Head
|
||||
}
|
||||
|
||||
public override KotlAutomaton GetAutomaton(Mobile master)
|
||||
{
|
||||
return new BlackrockAutomaton();
|
||||
}
|
||||
|
||||
public BlackrockAutomatonHead(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
Scripts/Items/Functional/Automaton/BlackrockMoonstone.cs
Normal file
36
Scripts/Items/Functional/Automaton/BlackrockMoonstone.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class BlackrockMoonstone : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1156993; } } // Black Moonstone
|
||||
|
||||
[Constructable]
|
||||
public BlackrockMoonstone()
|
||||
: base(0x9CAA)
|
||||
{
|
||||
Hue = 1175;
|
||||
}
|
||||
|
||||
public BlackrockMoonstone(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
149
Scripts/Items/Functional/Automaton/BrokenAutomatonHead.cs
Normal file
149
Scripts/Items/Functional/Automaton/BrokenAutomatonHead.cs
Normal file
@@ -0,0 +1,149 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x9DB1, 0x9DB2)]
|
||||
public class BrokenAutomatonHead : Item
|
||||
{
|
||||
public static int RepairAmount = 75;
|
||||
|
||||
private KotlAutomaton _Automaton;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public KotlAutomaton Automaton { get { return _Automaton; } set { _Automaton = value; } }
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public virtual Type RepairResource
|
||||
{
|
||||
get
|
||||
{
|
||||
if(_Automaton == null)
|
||||
return typeof(IronIngot);
|
||||
|
||||
return _Automaton.RepairResource;
|
||||
}
|
||||
}
|
||||
|
||||
public override bool Nontransferable { get { return true; } }
|
||||
|
||||
public BrokenAutomatonHead(KotlAutomaton automaton)
|
||||
: base(0x9DB1)
|
||||
{
|
||||
_Automaton = automaton;
|
||||
|
||||
Weight = 1.0;
|
||||
LootType = LootType.Blessed;
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
if (_Automaton != null)
|
||||
{
|
||||
if(_Automaton is BlackrockAutomaton)
|
||||
list.Add(1157046, String.Format("{0}\t#{1}", _Automaton.Name, "1157178")); // ~1_NAME~'s Broken ~2_TYPE~ Automaton Head
|
||||
else
|
||||
list.Add(1157046, String.Format("{0}\t#{1}", _Automaton.Name, CraftResources.GetLocalizationNumber(_Automaton.Resource).ToString())); // ~1_NAME~'s Broken ~2_TYPE~ Automaton Head
|
||||
}
|
||||
else
|
||||
{
|
||||
base.AddNameProperty(list);
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool TryRepair(Mobile from)
|
||||
{
|
||||
if (from.Backpack != null && IsChildOf(from.Backpack))
|
||||
{
|
||||
Type res = RepairResource;
|
||||
|
||||
if (_Automaton == null || _Automaton.ControlMaster != from)
|
||||
{
|
||||
from.SendLocalizedMessage(1157051); // You must be the owner of that pet to have it repair.
|
||||
}
|
||||
else if (from.Backpack.GetAmount(res) < RepairAmount)
|
||||
{
|
||||
if (res == typeof(CrystallineBlackrock))
|
||||
from.SendLocalizedMessage(1157179, String.Format("\t{0}", _Automaton.Name));
|
||||
else
|
||||
from.SendLocalizedMessage(1157050, String.Format("#{0}\t{1}", CraftResources.GetLocalizationNumber(_Automaton.Resource).ToString(), _Automaton.Name)); // You need 75 ~1_MATERIAL~ ingots to repair the ~2_CREATURE~.
|
||||
}
|
||||
else
|
||||
{
|
||||
from.Backpack.ConsumeTotal(res, RepairAmount);
|
||||
|
||||
return RetrieveAutomaton(from);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public virtual bool RetrieveAutomaton(Mobile from)
|
||||
{
|
||||
KotlAutomaton automaton = _Automaton;
|
||||
|
||||
Delete();
|
||||
|
||||
if (automaton != null && !automaton.Deleted)
|
||||
{
|
||||
automaton.ResurrectPet();
|
||||
automaton.Hits = automaton.HitsMax;
|
||||
|
||||
automaton.MoveToWorld(from.Location, from.Map);
|
||||
from.PlaySound(0x23B);
|
||||
}
|
||||
else
|
||||
{
|
||||
from.SendMessage("An error has occured, your automaton has been deleted!");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public override bool OnDroppedInto(Mobile from, Container target, Point3D p)
|
||||
{
|
||||
if (target is BankBox)
|
||||
return true;
|
||||
|
||||
return base.OnDroppedInto(from, target, p);
|
||||
}
|
||||
|
||||
public override bool DropToWorld(Mobile from, Point3D p)
|
||||
{
|
||||
from.SendLocalizedMessage(1076254); // That item cannot be dropped.
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool AllowSecureTrade(Mobile from, Mobile to, Mobile newOwner, bool accepted)
|
||||
{
|
||||
from.SendLocalizedMessage(1076256); // That item cannot be traded.
|
||||
return false;
|
||||
}
|
||||
|
||||
public BrokenAutomatonHead(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
|
||||
writer.Write((int)0); // version
|
||||
|
||||
writer.Write(_Automaton);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
|
||||
int version = reader.ReadInt();
|
||||
|
||||
_Automaton = reader.ReadMobile() as KotlAutomaton;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x9DB1, 0x9DB2)]
|
||||
public class InoperativeAutomatonHead : Item
|
||||
{
|
||||
public override int LabelNumber { get { return 1157002; } } // Inoperative Automaton Head
|
||||
|
||||
[Constructable]
|
||||
public InoperativeAutomatonHead()
|
||||
: base(0x9DB1)
|
||||
{
|
||||
}
|
||||
|
||||
public InoperativeAutomatonHead(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
217
Scripts/Items/Functional/Automaton/KotlAutomaton.cs
Normal file
217
Scripts/Items/Functional/Automaton/KotlAutomaton.cs
Normal file
@@ -0,0 +1,217 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
public class KotlAutomaton : BaseCreature, IRepairableMobile
|
||||
{
|
||||
private CraftResource _Resource;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource
|
||||
{
|
||||
get { return _Resource; }
|
||||
set
|
||||
{
|
||||
var old = _Resource;
|
||||
_Resource = value;
|
||||
|
||||
if (old != _Resource)
|
||||
OnResourceChanged();
|
||||
|
||||
InvalidateProperties();
|
||||
}
|
||||
}
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public virtual Type RepairResource
|
||||
{
|
||||
get
|
||||
{
|
||||
CraftResourceInfo resInfo = CraftResources.GetInfo(_Resource);
|
||||
|
||||
if (resInfo == null || resInfo.ResourceTypes.Length == 0)
|
||||
return typeof(IronIngot);
|
||||
|
||||
return resInfo.ResourceTypes[0];
|
||||
}
|
||||
}
|
||||
|
||||
[Constructable]
|
||||
public KotlAutomaton()
|
||||
: base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
|
||||
{
|
||||
_Resource = CraftResource.Iron;
|
||||
|
||||
Name = "kotl automaton";
|
||||
Body = 1406;
|
||||
BaseSoundID = 541;
|
||||
|
||||
SetStr(793, 875);
|
||||
SetDex(67, 74);
|
||||
SetInt(255, 263);
|
||||
|
||||
SetHits(774, 876);
|
||||
|
||||
SetDamage(15, 20);
|
||||
|
||||
SetDamageType(ResistanceType.Physical, 100);
|
||||
|
||||
SetResistance(ResistanceType.Physical, 45, 50);
|
||||
SetResistance(ResistanceType.Fire, 45, 50);
|
||||
SetResistance(ResistanceType.Cold, 45, 50);
|
||||
SetResistance(ResistanceType.Poison, 45, 50);
|
||||
SetResistance(ResistanceType.Energy, 45, 50);
|
||||
|
||||
SetSkill(SkillName.Anatomy, 90.3, 99.9);
|
||||
SetSkill(SkillName.MagicResist, 121.0, 126.7);
|
||||
SetSkill(SkillName.Tactics, 82.0, 94.8);
|
||||
SetSkill(SkillName.Wrestling, 94.4, 108.4);
|
||||
SetSkill(SkillName.DetectHidden, 40.0);
|
||||
SetSkill(SkillName.Parry, 70.0, 80.0);
|
||||
|
||||
Fame = 14000;
|
||||
Karma = -14000;
|
||||
|
||||
ControlSlots = 4;
|
||||
SetWeaponAbility(WeaponAbility.ParalyzingBlow);
|
||||
SetWeaponAbility(WeaponAbility.Disarm);
|
||||
}
|
||||
|
||||
public override void GenerateLoot()
|
||||
{
|
||||
this.AddLoot(LootPack.Rich, 4);
|
||||
}
|
||||
|
||||
public virtual void OnResourceChanged()
|
||||
{
|
||||
Hue = 0x8000 | CraftResources.GetHue(_Resource);
|
||||
|
||||
CraftResourceInfo resInfo = CraftResources.GetInfo(_Resource);
|
||||
|
||||
if (resInfo == null)
|
||||
return;
|
||||
|
||||
CraftAttributeInfo attrs = resInfo.AttributeInfo;
|
||||
|
||||
if (attrs == null)
|
||||
return;
|
||||
|
||||
SetResistance(ResistanceType.Physical, Utility.RandomMinMax(45, 50) + attrs.ArmorPhysicalResist);
|
||||
SetResistance(ResistanceType.Fire, Utility.RandomMinMax(45, 50) + attrs.ArmorFireResist);
|
||||
SetResistance(ResistanceType.Cold, Utility.RandomMinMax(45, 50) + attrs.ArmorColdResist);
|
||||
SetResistance(ResistanceType.Poison, Utility.RandomMinMax(45, 50) + attrs.ArmorPoisonResist);
|
||||
SetResistance(ResistanceType.Energy, Utility.RandomMinMax(45, 50) + attrs.ArmorEnergyResist);
|
||||
|
||||
int fire = attrs.WeaponFireDamage;
|
||||
int cold = attrs.WeaponColdDamage;
|
||||
int poison = attrs.WeaponPoisonDamage;
|
||||
int energy = attrs.WeaponEnergyDamage;
|
||||
int physical = 100 - fire - cold - poison - energy;
|
||||
|
||||
SetDamageType(ResistanceType.Physical, physical);
|
||||
SetDamageType(ResistanceType.Fire, fire);
|
||||
SetDamageType(ResistanceType.Cold, cold);
|
||||
SetDamageType(ResistanceType.Poison, poison);
|
||||
SetDamageType(ResistanceType.Energy, energy);
|
||||
}
|
||||
|
||||
public override double GetControlChance(Mobile m, bool useBaseSkill)
|
||||
{
|
||||
if (m.Skills[SkillName.Tinkering].Base < 100.0)
|
||||
{
|
||||
m.SendLocalizedMessage(1157043); // You lack the skill to command this Automaton.
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1.0;
|
||||
}
|
||||
|
||||
public override bool OnBeforeDeath()
|
||||
{
|
||||
if (!Controlled)
|
||||
{
|
||||
if (Region.IsPartOf("KotlCity"))
|
||||
{
|
||||
AutomatonStatue.OnDeath(this);
|
||||
}
|
||||
}
|
||||
|
||||
return base.OnBeforeDeath();
|
||||
}
|
||||
|
||||
public override void OnDeath(Container c)
|
||||
{
|
||||
Mobile master = GetMaster();
|
||||
|
||||
if (Controlled && master != null && master.Backpack != null)
|
||||
{
|
||||
BrokenAutomatonHead broke = new BrokenAutomatonHead(this);
|
||||
|
||||
ControlTarget = null;
|
||||
ControlOrder = OrderType.Stay;
|
||||
Internalize();
|
||||
|
||||
IsStabled = true;
|
||||
Loyalty = MaxLoyalty;
|
||||
|
||||
master.Backpack.DropItem(broke); // This needs to drop regardless of weight/item count, right?
|
||||
|
||||
master.SendLocalizedMessage(1157048); // A broken automaton head has been placed in your backpack.
|
||||
}
|
||||
|
||||
base.OnDeath(c);
|
||||
}
|
||||
|
||||
public KotlAutomaton(Serial serial)
|
||||
: base(serial)
|
||||
{
|
||||
}
|
||||
|
||||
// Missing Wrestling Mastery Ability
|
||||
|
||||
public override double WeaponAbilityChance { get { return 0.33; } }
|
||||
|
||||
public override bool IsScaredOfScaryThings { get { return false; } }
|
||||
public override bool IsScaryToPets { get { return !Controlled; } }
|
||||
public override FoodType FavoriteFood { get { return FoodType.None; } }
|
||||
public override bool CanBeDistracted { get { return false; } }
|
||||
public override bool DeleteOnRelease { get { return true; } }
|
||||
public override bool AutoDispel { get { return !Controlled; } }
|
||||
public override bool BleedImmune { get { return true; } }
|
||||
public override bool BardImmune { get { return true; } }
|
||||
public override Poison PoisonImmune { get { return Poison.Lethal; } }
|
||||
|
||||
public override bool CanTransfer(Mobile m)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override bool CanFriend(Mobile m)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Serialize(GenericWriter writer)
|
||||
{
|
||||
base.Serialize(writer);
|
||||
writer.Write((int)1);
|
||||
|
||||
writer.Write((int)_Resource);
|
||||
}
|
||||
|
||||
public override void Deserialize(GenericReader reader)
|
||||
{
|
||||
base.Deserialize(reader);
|
||||
int version = reader.ReadInt();
|
||||
|
||||
_Resource = (CraftResource)reader.ReadInt();
|
||||
|
||||
if (version == 0)
|
||||
{
|
||||
SetWeaponAbility(WeaponAbility.ParalyzingBlow);
|
||||
SetWeaponAbility(WeaponAbility.Disarm);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
108
Scripts/Items/Functional/Automaton/KotlAutomatonHead.cs
Normal file
108
Scripts/Items/Functional/Automaton/KotlAutomatonHead.cs
Normal file
@@ -0,0 +1,108 @@
|
||||
using System;
|
||||
using Server.Mobiles;
|
||||
using Server.Engines.Craft;
|
||||
|
||||
namespace Server.Items
|
||||
{
|
||||
[FlipableAttribute(0x9DB1, 0x9DB2)]
|
||||
public class KotlAutomatonHead : Item, ICraftable
|
||||
{
|
||||
private bool _Activated;
|
||||
private CraftResource _Resource;
|
||||
|
||||
[CommandProperty(AccessLevel.GameMaster)]
|
||||
public CraftResource Resource { get { return _Resource; } set { _Resource = value; Hue = CraftResources.GetHue(this._Resource); InvalidateProperties(); } }
|
||||
|
||||
[Constructable]
|
||||
public KotlAutomatonHead()
|
||||
: base(0x9DB1)
|
||||
{
|
||||
LootType = LootType.Blessed;
|
||||
|
||||
Resource = CraftResource.Iron;
|
||||
}
|
||||
|
||||
public override void AddNameProperty(ObjectPropertyList list)
|
||||
{
|
||||
list.Add(1157022, String.Format("#{0}", CraftResources.GetLocalizationNumber(_Resource))); // Rebuilt ~1_MATTYPE~ Automaton Head
|
||||
}
|
||||
|
||||
public override void OnDoubleClick(Mobile from)
|
||||
{
|
||||
int skill = (int)from.Skills[SkillName.Tinkering].Base;
|
||||
|
||||
if (skill < 100.0)
|
||||
{
|
||||
from.SendLocalizedMessage(1157006); // You must be a Grandmaster Tinker to activate an Automaton.
|
||||
}
|
||||
else if (_Activated)
|
||||
{
|
||||
from.SendLocalizedMessage(1157007); // The Automaton is already being activated.
|
||||
}
|
||||
else
|
||||
{
|
||||
_Activated = true;
|
||||
|
||||
Timer.DelayCall(TimeSpan.FromSeconds(3), () =>
|
||||
{
|
||||
_Activated = false;
|
||||
|
||||
KotlAutomaton automaton = GetAutomaton(from);
|
||||
|
||||
if (automaton.SetControlMaster(from))
|
||||
{
|
||||
automaton.IsBonded = true;
|
||||
|
||||
Delete();
|
||||
|
||||
automaton.MoveToWorld(from.Location, from.Map);
|
||||
from.PlaySound(0x23B);
|
||||
}
|
||||
else
|
||||
{
|
||||
automaton.Delete();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
public virtual KotlAutomaton GetAutomaton(Mobile master)
|
||||
{
|
||||
KotlAutomaton automaton = new KotlAutomaton();
|
||||
automaton.Resource = _Resource;
|
||||
|
||||
return automaton;
|
||||
}
|
||||
|
||||
#region ICraftable Members
|
||||
public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, ITool tool, CraftItem craftItem, int resHue)
|
||||
{
|
||||
if (typeRes == null)
|
||||
typeRes = craftItem.Resources.GetAt(0).ItemType;
|
||||
|
||||
Resource = CraftResources.GetFromType(typeRes);
|
||||
|
||||
return quality;
|
||||
}
|
||||
#endregion
|
||||
|
||||
public KotlAutomatonHead(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();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user