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); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 1: _Type = (SutekResourceType)reader.ReadInt(); break; } }
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); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); var version = reader.ReadInt(); switch (version) { case 1: _Type = (SutekResourceType) reader.ReadInt(); break; } }
public static int GetLabelId(SutekResourceType type) { return _Table[(int) type][2]; }
public SutekQuestResource(SutekResourceType type) : base(0x1DB7) { ResourceType = type; Movable = false; }
public static int GetLabelId(SutekResourceType type) { return(_Table[(int)type][2]); }
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); } }
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); }