private void RepairStart(BaseShip ship, Mobile from, DamageType damageType) { if (ship == null || from == null) { return; } from.BeginAction(typeof(ShipRepairTool)); Timer.DelayCall(BaseShip.RepairDuration, delegate { from.EndAction(typeof(ShipRepairTool)); }); Effects.PlaySound(from.Location, from.Map, 0x23D); if (!from.Mounted && from.Body.IsHuman) { from.Animate(11, 5, 1, true, false, 0); } shipRepairTimer = new ShipRepairTimer(ship, from, this, damageType, BaseShip.RepairInterval); shipRepairTimer.Start(); //Henchman Repair Assistance List <Mobile> m_MobilesOnShip = ship.GetMobilesOnShip(false, false); foreach (Mobile mobile in m_MobilesOnShip) { if (mobile is HenchmanNavyCarpenter) { HenchmanNavyCarpenter navyCarpenter = mobile as HenchmanNavyCarpenter; mobile.Say("Assisting with ship repair!"); navyCarpenter.AssistRepair(); } if (mobile is HenchmanPirateCarpenter) { HenchmanPirateCarpenter pirateCarpenter = mobile as HenchmanPirateCarpenter; mobile.Say("Assisting with ship repair!"); pirateCarpenter.AssistRepair(); } } }
protected override void OnTick() { //No Longer Alive if (!m_From.Alive) { this.Stop(); return; } //No Longer On Ship or Close Enough to the Ship to Repair if (!(m_Ship.Contains(m_From) || m_Ship.GetShipToLocationDistance(m_Ship, m_From.Location) <= 6)) { m_From.SendMessage("You are not close enough to the ship to finish your repairs."); this.Stop(); return; } m_From.RevealingAction(); //Repair Time Remains if ((m_Start + BaseShip.RepairDuration) > DateTime.UtcNow) { Effects.PlaySound(m_From.Location, m_From.Map, 0x23D); if (!m_From.Mounted) { m_From.Animate(11, 5, 1, true, false, 0); } } //Repairs Complete else { Effects.PlaySound(m_From.Location, m_From.Map, 0x23D); if (!m_From.Mounted) { m_From.Animate(11, 5, 1, true, false, 0); } Stop(); m_ShipRepairTools.FinishRepairs(m_Ship, m_From, m_DamageType, true); } //Henchman Repair Assistance List <Mobile> m_MobilesOnShip = m_Ship.GetMobilesOnShip(false, false); foreach (Mobile mobile in m_MobilesOnShip) { if (mobile is HenchmanNavyCarpenter) { HenchmanNavyCarpenter navyCarpenter = mobile as HenchmanNavyCarpenter; navyCarpenter.AssistRepair(); } if (mobile is HenchmanPirateCarpenter) { HenchmanPirateCarpenter pirateCarpenter = mobile as HenchmanPirateCarpenter; pirateCarpenter.AssistRepair(); } } }