public override void OnTalk(PlayerMobile pm) { if (!HasQuest(pm)) { BaseBoat boat = FishQuestHelper.GetBoat(pm); if (boat != null && boat is BaseGalleon) { if (((BaseGalleon)boat).Scuttled) { pm.SendLocalizedMessage(1116752); //Your ship is a mess! Fix it first and then we can talk about catching pirates. } else { ProfessionalBountyQuest q = new ProfessionalBountyQuest((BaseGalleon)boat); q.Owner = pm; q.Quester = this; pm.CloseGump(typeof(MondainQuestGump)); pm.SendGump(new MondainQuestGump(q)); } } else if (boat != null && !(boat is BaseGalleon)) { SayTo(pm, 1116751); //The ship you are captaining could not take on a pirate ship. Bring a warship if you want this quest. } else if(m_NextSay < DateTime.UtcNow) { if (m_LastSay == 0) { if (this.Map != Map.Tokuno) Say(1152651); //I'm G.B. Bigglesby, proprietor of the G.B. Bigglesby Free Trade Floating Emporium. else Say("I am {0}, proprietor of {0} Free Trade Coroporation of Tokuno.", Name); m_LastSay = 1; } else { Say(1152652); //This sea market be me life's work and 'tis me pride and joy.. m_LastSay = 0; } m_NextSay = DateTime.UtcNow + TimeSpan.FromSeconds(5); } } }
public override bool OnBeforeDeath() { List<PlayerMobile> hasQuest = new List<PlayerMobile>(); List<DamageStore> rights = GetLootingRights(); for (int i = 0; i < rights.Count; i++) { if (!rights[i].m_HasRight) continue; Mobile mob = rights[i].m_Mobile; //if they have the quest and looting rights, give them a certificate if (mob is PlayerMobile && mob.NetState != null && QuestHelper.GetQuest((PlayerMobile)mob, typeof(ProfessionalBountyQuest)) != null) hasQuest.Add((PlayerMobile)mob); } if (hasQuest.Count > 0) { PlayerMobile questee = hasQuest[Utility.Random(hasQuest.Count)]; BaseQuest q = QuestHelper.GetQuest(questee, typeof(ProfessionalBountyQuest)); if (q != null && q is ProfessionalBountyQuest) { ((ProfessionalBountyQuest)q).OnPirateDeath(this); questee.AddToBackpack(new DeathCertificate(this)); } } if (m_IsCaught && m_Quest != null) { for (int i = 0; i < m_Quest.Objectives.Count; i++) { if (m_Quest.Objectives[i] is BountyQuestObjective && ((BountyQuestObjective)m_Quest.Objectives[i]).CapturedCaptain == this) { ((BountyQuestObjective)m_Quest.Objectives[i]).CapturedCaptain = null; ((BountyQuestObjective)m_Quest.Objectives[i]).Captured = false; m_Quest = null; } } } return base.OnBeforeDeath(); }
public BindingRope(ProfessionalBountyQuest quest) : base(5368) { m_Quest = quest; }
public void OnBound(ProfessionalBountyQuest quest) { if (quest == null || quest.Pole == null) return; BindingPole pole = quest.Pole; int x = pole.X; int y = pole.Y; while (x == pole.X && y == pole.Y) { x = Utility.RandomMinMax(pole.X - 1, pole.X + 1); y = Utility.RandomMinMax(pole.Y - 1, pole.Y + 1); } Frozen = true; Item toDisarm = FindItemOnLayer(Layer.OneHanded); if (toDisarm == null || !toDisarm.Movable) toDisarm = FindItemOnLayer(Layer.TwoHanded); if (toDisarm != null) { if (Backpack != null) Backpack.DropItem(toDisarm); else toDisarm.Delete(); } m_Quest = quest; if (quest != null && quest.Galleon != null) quest.Galleon.CapturedCaptain = this; Timer.DelayCall(TimeSpan.FromSeconds(2.5), new TimerStateCallback(MoveCaptainToShip), new object[] { x, y, pole }); }