Example #1
0
        public virtual KotlAutomaton GetAutomaton(Mobile master)
        {
            KotlAutomaton automaton = new KotlAutomaton();

            automaton.Resource = _Resource;

            return(automaton);
        }
Example #2
0
        public BrokenAutomatonHead(KotlAutomaton automaton)
            : base(0x9DB1)
        {
            _Automaton = automaton;

            Weight   = 1.0;
            LootType = LootType.Blessed;
        }
Example #3
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            _Automaton = reader.ReadMobile() as KotlAutomaton;
        }
Example #4
0
        public static void OnBirth(KotlAutomaton automaton, AutomatonStatue statue)
        {
            if (Statues == null)
            {
                Statues = new Dictionary <KotlAutomaton, AutomatonStatue>();
            }

            if (!Statues.ContainsKey(automaton))
            {
                Statues[automaton] = statue;
            }
        }
Example #5
0
        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);
            }
        }
Example #6
0
        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;
                }
            }
        }
Example #7
0
        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);
        }
Example #8
0
        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();
                    }
                });
            }
        }