public override void OnDoubleClick(Mobile from) { PlayerMobile pm = (PlayerMobile)from; if (!IsChildOf(from.Backpack)) { from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it. } else if (pm.City != null) { ArmyController army = from.Backpack.FindItemByType(typeof(ArmyController)) as ArmyController; if (pm.City.Mayor != from && pm.City.AssistMayor != from && pm.City.General != from) { from.SendMessage("You must be the mayor, assistant mayor, or general of a city to place this structure."); } else if (!PlayerGovernmentSystem.IsAtCity(from)) { from.SendMessage("You must be inside your city to place this structure."); } else if (army != null) { from.SendMessage("You appear to already have an army barracks. You may only control one army."); } else if (!PlayerGovernmentSystem.IsCityLevelReached(pm.City.Mayor, 3)) { from.SendMessage("Your city must be at least level 3 before you can place this structure."); } else if (PlayerGovernmentSystem.NeedsForensics && from.Skills[SkillName.Forensics].Base < 40.0) { from.SendMessage("You lack the required skill to place this building, You need at least 40.0 points in forensics."); } else { base.OnDoubleClick(from); } } else { from.SendMessage("You must be the mayor, assistant mayor, or general of a city in order to use this."); } }
public override void OnDoubleClick(Mobile from) { if (from.FollowersMax <= (from.Followers + 3)) { from.SendMessage("You have too many followers to Recruit anyone else."); return; } if (this.InUse == true) { from.SendMessage("You must wait 24 hours bewteen hiring each recruit."); return; } if (from.InRange(this.GetWorldLocation(), 2)) { if (from == this.Leader) { ArmyController army = from.Backpack.FindItemByType(typeof(ArmyController)) as ArmyController; if (army != null) { from.SendGump(new RecruitTypeGump(this, m_Control)); } else { from.SendMessage("Your Army Controller appears to be missing page a GM!!."); } } else { from.SendMessage("You must be the Leader of these Barracks to access this stone."); } } else { from.SendMessage("You are too far away to access that."); } }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 0: { m_Control = (ArmyController)reader.ReadItem(); m_Time = reader.ReadDeltaTime(); m_Leader = reader.ReadMobile(); m_InUse = (bool)reader.ReadBool(); m_Recruits = (int)reader.ReadInt(); m_Stone = (CityManagementStone)reader.ReadItem(); if (m_InUse = true) { new UserTimer(this).Start(); } break; } } }
public ArmyAttackTarget(ArmyController controller) : base(-1, false, TargetFlags.None) { m_ArmyController = controller; }
public ArmyRecruitTarget(ArmyController controller) : base(-1, false, TargetFlags.None) { m_ArmyController = controller; }
public ArmyGoToTarget(ArmyController controller) : base(-1, true, TargetFlags.None) { m_ArmyController = controller; }
public ArmySayPrompt(ArmyController controller) { m_ArmyController = controller; }