Beispiel #1
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);
            }
        }
Beispiel #2
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);
        }
Beispiel #3
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();
                    }
                });
            }
        }