public virtual KotlAutomaton GetAutomaton(Mobile master) { KotlAutomaton automaton = new KotlAutomaton(); automaton.Resource = _Resource; return(automaton); }
public BrokenAutomatonHead(KotlAutomaton automaton) : base(0x9DB1) { _Automaton = automaton; Weight = 1.0; LootType = LootType.Blessed; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); _Automaton = reader.ReadMobile() as KotlAutomaton; }
public static void OnBirth(KotlAutomaton automaton, AutomatonStatue statue) { if (Statues == null) { Statues = new Dictionary <KotlAutomaton, AutomatonStatue>(); } if (!Statues.ContainsKey(automaton)) { Statues[automaton] = statue; } }
public override void OnMovement(Mobile m, Point3D lastLocation) { base.OnMovement(m, lastLocation); if (m.Player && m.InRange(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 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 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 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(); } }); } }