예제 #1
0
            public InternalTarget(Mobile from, ClockworkMechanism item, SutekResourceType type, int remaining, double delay, DateTime endtime)
                : base(2, true, TargetFlags.None)
            {
                this.m_Item      = item;
                this.m_Type      = type;
                this.m_Remaining = remaining;
                this.m_EndTime   = endtime;
                this.m_Delay     = delay;

                from.SendLocalizedMessage(1112821, String.Concat("#", SutekQuestResource.GetLabelId(this.m_Type).ToString())); // I need to add some ~1_INGREDIENT~.

                this.BeginTimeout(from, this.m_EndTime - DateTime.UtcNow);
            }
예제 #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 1:
                _Type = (SutekResourceType)reader.ReadInt();
                break;
            }
        }
예제 #3
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (m_Item == null || m_Item.Deleted)
                {
                    return;
                }

                if (targeted is SutekQuestResource && ((SutekQuestResource)targeted).ActualType == m_Type)
                {
                    CancelTimeout();

                    if (--m_Remaining > 0)
                    {
                        from.SendLocalizedMessage(1112819); // You've successfully added this ingredient.
                        m_Type    = SutekQuestResource.GetRandomResource();
                        m_Delay  += 0.1 + (Utility.RandomDouble() / 4.0);
                        m_EndTime = DateTime.UtcNow + TimeSpan.FromSeconds(m_Delay);
                    }
                    else
                    {
                        m_Item.StopTimer();
                        Item item = new CompletedClockworkAssembly();
                        if (null == m_Item.Parent && m_Item.Parent is Container)
                        {
                            item.Location = new Point3D(m_Item.Location);
                            ((Container)m_Item.Parent).AddItem(item);
                        }
                        else
                        {
                            item.MoveToWorld(m_Item.GetWorldLocation(), m_Item.Map);
                        }

                        m_Item.Delete();

                        from.SendLocalizedMessage(1112987); // The training clockwork fails and the creature vanishes.
                        from.SendLocalizedMessage(1112872);
                        // Your assembly is completed. Return it to Sutek for your reward!
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1112820); // That is not the right ingredient.
                    OnTargetCancel(from, TargetCancelType.Timeout);
                }
            }
예제 #4
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            var version = reader.ReadInt();

            switch (version)
            {
                case 1:
                    _Type = (SutekResourceType) reader.ReadInt();
                    break;
            }
        }
예제 #5
0
 public static int GetLabelId(SutekResourceType type)
 {
     return _Table[(int) type][2];
 }
예제 #6
0
 public SutekQuestResource(SutekResourceType type)
     : base(0x1DB7)
 {
     ResourceType = type;
     Movable = false;
 }
예제 #7
0
 public static int GetLabelId(SutekResourceType type)
 {
     return(_Table[(int)type][2]);
 }
예제 #8
0
 public SutekQuestResource(SutekResourceType type)
     : base(0x1DB7)
 {
     ResourceType = type;
     Movable      = false;
 }
예제 #9
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (this.m_Item == null || this.m_Item.Deleted)
                    return;

                if (targeted is SutekQuestResource && ((SutekQuestResource)targeted).ActualType == this.m_Type)
                {
                    this.CancelTimeout();

                    if (--this.m_Remaining > 0)    
                    {
                        from.SendLocalizedMessage(1112819); // You've successfully added this ingredient.
                        this.m_Type = SutekQuestResource.GetRandomResource();
                        this.m_Delay += 0.1 + (Utility.RandomDouble() / 4.0);
                        this.m_EndTime = DateTime.Now + TimeSpan.FromSeconds(this.m_Delay);
                    }
                    else
                    {
                        this.m_Item.StopTimer();
                        Item item = new CompletedClockworkAssembly();
                        if (null == this.m_Item.Parent && this.m_Item.Parent is Container)
                        {
                            item.Location = new Point3D(this.m_Item.Location);
                            ((Container)this.m_Item.Parent).AddItem(item);
                        }
                        else
                            item.MoveToWorld(this.m_Item.GetWorldLocation(), this.m_Item.Map);

                        this.m_Item.Delete();

                        from.SendLocalizedMessage(1112987); // The training clockwork fails and the creature vanishes.
                        from.SendLocalizedMessage(1112872); // Your assembly is completed. Return it to Sutek for your reward!
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1112820); // That is not the right ingredient.
                    this.OnTargetCancel(from, TargetCancelType.Timeout);
                }
            }
예제 #10
0
            public InternalTarget(Mobile from, ClockworkMechanism item, SutekResourceType type, int remaining, double delay, DateTime endtime)
                : base(2, true, TargetFlags.None)
            {
                this.m_Item = item;
                this.m_Type = type;
                this.m_Remaining = remaining;
                this.m_EndTime = endtime;
                this.m_Delay = delay;

                from.SendLocalizedMessage(1112821, String.Concat("#", SutekQuestResource.GetLabelId(this.m_Type).ToString())); // I need to add some ~1_INGREDIENT~.

                this.BeginTimeout(from, this.m_EndTime - DateTime.Now);
            }