public virtual void OnAccept() { m_Owner.PlaySound(AcceptSound); m_Owner.SendLocalizedMessage(1049019); // You have accepted the Quest. m_Owner.Quests.Add(this); // give items if any for (int i = 0; i < m_Objectives.Count; i++) { BaseObjective objective = m_Objectives[i]; objective.OnAccept(); } if (m_Quester is BaseEscort) { BaseEscort escort = (BaseEscort)m_Quester; if (escort.SetControlMaster(m_Owner)) { escort.Quest = this; escort.LastSeenEscorter = DateTime.Now; escort.StartFollow(); escort.AddHash(Owner); escort.Say(1042806, "destination"); // Lead on! Payment will be made when we arrive at ~1_DESTINATION~! m_Owner.LastEscortTime = DateTime.Now; } } // tick tack StartTimer(); }
public virtual void OnAccept() { this.m_Owner.PlaySound(this.AcceptSound); this.m_Owner.SendLocalizedMessage(1049019); // You have accepted the Quest. this.m_Owner.Quests.Add(this); // give items if any for (int i = 0; i < this.m_Objectives.Count; i++) { BaseObjective objective = this.m_Objectives[i]; objective.OnAccept(); } if (this.m_Quester is BaseEscort) { BaseEscort escort = (BaseEscort)this.m_Quester; if (escort.SetControlMaster(this.m_Owner)) { escort.Quest = this; escort.LastSeenEscorter = DateTime.UtcNow; escort.StartFollow(); escort.AddHash(this.Owner); Region region = escort.GetDestination(); if (region != null) { escort.Say(1042806, region.Name); // Lead on! Payment will be made when we arrive at ~1_DESTINATION~! } else { escort.Say(1042806, "destination"); // Lead on! Payment will be made when we arrive at ~1_DESTINATION~! } this.m_Owner.LastEscortTime = DateTime.UtcNow; } } // tick tack this.StartTimer(); }
public static void DeleteEscort(Mobile owner) { PlayerMobile pm = owner as PlayerMobile; foreach (BaseQuest escortquest in pm.Quests.Where(x => x.Quester is BaseEscort)) { BaseEscort escort = (BaseEscort)escortquest.Quester; Timer.DelayCall(TimeSpan.FromSeconds(3), delegate { escort.Say(500901); // Ack! My escort has come to haunt me! owner.SendLocalizedMessage(1071194); // You have failed your escort quest… owner.PlaySound(0x5B3); escort.Delete(); }); } }
public virtual void OnResign(bool resignChain) { m_Owner.PlaySound(ResignSound); // update chain if (!resignChain && !QuestHelper.FirstChainQuest(this, Quester)) { UpdateChain(); } // delete items that were given on quest start for (int i = 0; i < m_Objectives.Count; i++) { if (m_Objectives[i] is ObtainObjective) { ObtainObjective obtain = (ObtainObjective)m_Objectives[i]; QuestHelper.RemoveStatus(m_Owner, obtain.Obtain); } else if (m_Objectives[i] is DeliverObjective) { DeliverObjective deliver = (DeliverObjective)m_Objectives[i]; QuestHelper.DeleteItems(m_Owner, deliver.Delivery, deliver.MaxProgress, true); } } // delete escorter if (m_Quester is BaseEscort) { BaseEscort escort = (BaseEscort)m_Quester; escort.Say(1005653); // Hmmm. I seem to have lost my master. escort.PlaySound(0x5B3); escort.BeginDelete(m_Owner); } RemoveQuest(resignChain); }