public MilitaryAdvisor(GovernmentEntity g) : base(g.Nation) { Blessed = true; Government = g; Nation = g.Nation; RandomRichClothes(this, this.Nation); string advisorTitle = ""; switch (Nation) { case Nation.Alyrian: advisorTitle = "Kern"; Soldier.EquipAlyrian((Armament)1, this); break; case Nation.Azhuran: advisorTitle = "Tlacateccatl"; Soldier.EquipAzhuran((Armament)1, this); break; case Nation.Khemetar: advisorTitle = "Havildar"; Soldier.EquipKhemetar((Armament)1, this); break; case Nation.Mhordul: advisorTitle = "Bambaici"; Soldier.EquipMhordul((Armament)1, this); break; case Nation.Tyrean: advisorTitle = "Drengr"; Soldier.EquipTyrean((Armament)1, this); break; case Nation.Vhalurian: if (Female) { advisorTitle = "Lady"; } else { advisorTitle = "Sir"; } Soldier.EquipVhalurian((Armament)1, this); break; case Nation.Imperial: advisorTitle = "Tribune"; Soldier.EquipImperial((Armament)1, this); break; case Nation.Sovereign: if (Female) { advisorTitle = "Warmistress"; } else { advisorTitle = "Warmaster"; } Soldier.EquipSovereign((Armament)1, this); break; case Nation.Society: advisorTitle = "Advisor"; Soldier.EquipSociety((Armament)1, this); break; case Nation.Insularii: advisorTitle = "Maestor"; Soldier.EquipInsularii((Armament)1, this); break; } Name = advisorTitle + " " + Name + " of " + Government.Name.ToString(); }
public MilitaryWayPoint( GovernmentEntity government ) : base() { m_Government = government; Movable = false; government.WayPoints.Add( this ); }
public MilitaryPolicyGump(PlayerMobile viewer, GovernmentEntity g, int currentNav, int mainScroll) : base(0, 0) { InitialSetup(viewer, g, currentNav, mainScroll); AddNavigation(); AddMain(); }
public GovernmentPlayerVendorDeed( GovernmentEntity government ) : base(0x14F0) { Weight = 1.0; //LootType = LootType.Blessed; Government = government; Name = Government.Name + " Vendor Contract"; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); m_Government = (GovernmentEntity)reader.ReadItem(); if (m_Government == null || m_Government.Deleted) Delete(); }
public PlayerVendor( Mobile owner, BaseHouse house, GovernmentEntity government) { Owner = owner; House = house; Government = government; if (Government != null && !Government.Deleted) if(!Government.Employees.Contains(this)) Government.Employees.Add(this); if ( BaseHouse.NewVendorSystem ) { if (Government != null) { m_BankAccount = 0; m_HoldCopper = Wages; } else { m_BankAccount = 0; m_HoldCopper = 4; } } else { m_BankAccount = 1000; m_HoldCopper = 0; } ShopName = "Shop Not Yet Named"; m_SellItems = new Hashtable(); CantWalk = true; if ( !Core.AOS ) NameHue = 0x35; InitStats( 75, 75, 75 ); InitBody(); InitOutfit(); RawStr = 100; RawDex = 100; RawStam = 100; TimeSpan delay = PayTimer.GetInterval(); m_PayTimer = new PayTimer( this, delay ); m_PayTimer.Start(); m_NextPayTime = DateTime.Now + delay; }
public void Give(Mobile from, GovernmentEntity g) { if (m_Value < 0 || m_Resource == null) Delete(); else { if (!g.Resources.ContainsKey(m_Resource)) { from.SendMessage(g.Name.ToString() + " is unable to receive that resource."); return; } from.SendMessage("You give " + m_Value.ToString() + " " + m_Resource.ToString() + " to " + g.Name.ToString() + "."); } g.Resources[m_Resource] += m_Value; switch (m_Resource) { case ResourceType.Metals: from.PlaySound(0x02A); break; case ResourceType.Wood: from.PlaySound(0x23D); break; case ResourceType.Cloth: from.PlaySound(0x3E3); break; case ResourceType.Food: from.PlaySound(0x247); break; case ResourceType.Water: from.PlaySound(0x026); break; case ResourceType.Influence: from.PlaySound(0x5B4); break; } this.Delete(); }
public MilitarySpawner(GovernmentEntity government) : base() { government.MilitarySpawners.Add(this); Stationed = false; Government = government; Armaments = 0; Training = 0; FaceDirection = (Direction)Utility.Random(8); PayRate = 0; Name = ("A Military Spawner of " + Government.Name); Visible = false; Movable = false; SetSpawnTime(); SpawnRange = 0; HomeRange = 0; }
private List<Nation> m_KillNationOnSight = new List<Nation>(); //The list of Nations that will be attacked on being sighted. #endregion Fields #region Constructors public MilitaryInfo(GovernmentEntity g) { m_Government = g; }
public static int GetSellPrice(CraftResource r, GovernmentEntity g) { switch (r) { case CraftResource.Copper: case CraftResource.Tin: case CraftResource.Iron: case CraftResource.Silver: case CraftResource.Gold: return g.TradeInformation.MetalSalesPrice; case CraftResource.Cotton: case CraftResource.Wool: case CraftResource.Silk: case CraftResource.RegularLeather: case CraftResource.ThickLeather: case CraftResource.BeastLeather: case CraftResource.ScaledLeather: return g.TradeInformation.ClothSalesPrice; case CraftResource.Oak: case CraftResource.Yew: case CraftResource.Redwood: case CraftResource.Ash: return g.TradeInformation.WoodSalesPrice; default: return 0; } }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); m_Government = (GovernmentEntity)reader.ReadItem(); m_FaceDirection = (Direction)reader.ReadByte(); if (version < 1) { reader.ReadItem(); reader.ReadMobile(); } m_PayRate = reader.ReadInt(); m_Stationed = reader.ReadBool(); }
public static int Salary(int TrainingCost, int ArmsCost, GovernmentEntity Government) { if (TrainingCost + ArmsCost - Government.ResourceBudgetContribution() < 0) return 0; else return (TrainingCost + ArmsCost - Government.ResourceBudgetContribution()); }
public void AddSoldier(GovernmentEntity g, int type, int training, Direction d, int pay, PlayerMobile from) { if (Stationed) { from.SendMessage("There is already a soldier stationed here. You must remove that soldier from duty first."); return; } if (g.Treasury != null && !g.Treasury.Deleted && g.GetTreasuryBalance() >= pay) { IsInactivated = false; MaxCount = 1; SetSpawnTime(); Armaments = type; Training = training; FaceDirection = d; PayRate = pay; string govName = g.Name; if (Armaments < 1 || Armaments > 6) Armaments = Utility.RandomMinMax(1, 6); SpawnString = ""; SpawnString += ("Soldier," + Government.Nation + "," + Armaments.ToString() + "," + Training.ToString() + "," + govName.ToString()); SpawnString += ("/direction/" + d.ToString()); AddSpawn = SpawnString; if (PayRate > 0) { g.WithdrawFromTreasury(PayRate); from.SendMessage(PayRate.ToString() + " copper has been withdrawn for your treasury to pay for this soldier's training."); } Stationed = true; } else from.SendMessage("You do not have enough funds in your government organization's treasury to deploy that soldier."); }
public Soldier(Nation n, int arms, int training, GovernmentEntity gov) : this(n, arms, training, gov.Name) { }
public void InitialSetup(PlayerMobile viewer, GovernmentEntity g, int currentNav, int mainScroll) { Closable = true; Disposable = true; Dragable = true; Resizable = false; m_Viewer = viewer; m_Government = g; m_CurrentNav = currentNav; m_MainScroll = mainScroll; AddBackground(203, 50, 427, 504, 9270); AddBackground(217, 65, 399, 75, 3500); AddBackground(218, 145, 165, 394, 3500); AddBackground(393, 147, 224, 394, 3500); AddLabel(420 - (int)(m_Government.Name.ToString().Length * 3.5), 78, 0, m_Government.Name.ToString()); AddLabel(367, 101, 0, "Military Policies"); AddButton(595, 70, 22150, 22152, (int)Buttons.Close, GumpButtonType.Reply, 0); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); int test = 0; if (version > 57) { m_Orders = new List<OrderInfo>(); int orderCount = reader.ReadInt(); for (int i = 0; i < orderCount; i++) { OrderInfo newOrder = new OrderInfo("", 1, 1, this); OrderInfo.Deserialize(reader, newOrder); m_Orders.Add(newOrder); } } if (version > 55) { m_Deadly = reader.ReadInt(); } if (version > 54) { m_Nation = (Nation)reader.ReadInt(); m_Government = (GovernmentEntity)reader.ReadItem(); m_Organization = (CustomGuildStone)reader.ReadItem(); } if( version > 53 ) m_AuraType = (AuraType)reader.ReadInt(); if( version > 52 ) m_CustomBreathType = (CustomBreathType)reader.ReadInt(); if( version > 51 ) m_ManeuverResistance = reader.ReadInt(); if( version > 50 ) { m_CantInterrupt = reader.ReadBool(); m_CantParry = reader.ReadBool(); m_HasNoCorpse = reader.ReadBool(); } if( version > 49 ) { int count = reader.ReadInt(); for( int i = 0; i < count; i++ ) m_SecondaryWikiConfigs.Add( reader.ReadString() ); count = reader.ReadInt(); for( int i = 0; i < count; i++ ) { XMLEventType eventType = (XMLEventType)reader.ReadInt(); List<string> list = new List<string>(); int codeCount = reader.ReadInt(); for( int a = 0; a < codeCount; a++ ) list.Add( reader.ReadString() ); m_XMLEventsDatabase.Add( eventType, list ); } } if( version > 48 ) m_RangedAttackType = (RangedAttackType)reader.ReadInt(); if( version > 47 ) m_CustomSkinnableParts = reader.ReadStrongItemList(); if( version > 46 ) { m_NoWoundedMovePenalty = reader.ReadBool(); m_MeleeAttackType = (MeleeAttackType)reader.ReadInt(); } if( version > 45 ) m_WikiConfig = reader.ReadString(); if( version > 44 ) { m_Technique = reader.ReadString(); m_TechniqueLevel = reader.ReadInt(); } if( version > 43 ) m_StableTicket = reader.ReadItem(); if( version > 41 ) m_StabledOwner = reader.ReadMobile(); if( version > 40 ) m_ReceivedNewLoot = reader.ReadBool(); if( version > 39 ) { m_TimeOfDeath = reader.ReadDeltaTime(); if( reader.ReadBool() ) BeginRess( reader.ReadDeltaTime() - DateTime.Now, this.Corpse ); m_Lives = reader.ReadInt(); } if( version > 38 ) m_ReleaseTime = reader.ReadDateTime(); if( version > 37 ) m_MarkedForTermination = reader.ReadBool(); if( version > 36 ) { m_FavouriteStance = reader.ReadString(); m_FavouriteManeuver = reader.ReadString(); } if( version > 34 ) m_CombatStyles = new CombatStyles( reader ); if( version > 32 ) m_Feats = new Feats( reader, true ); if( version > 33 ) m_FixedScales = reader.ReadBool(); if( version > 31 ) { m_NoDeathCondition = reader.ReadBool(); m_NoDeath = reader.ReadBool(); m_NoDeathMsg = reader.ReadString(); m_NoDeathSound = reader.ReadInt(); } if( version > 30 ) this.Frozen = reader.ReadBool(); if( version > 27 ) { m_VanishTime = reader.ReadDateTime(); m_VanishEmote = reader.ReadString(); } m_CreatureGroup = (CreatureGroup)reader.ReadInt(); if( version < 29 ) { test = reader.ReadInt(); m_IsSneaky = test > 0; } else m_IsSneaky = reader.ReadBool(); if( version < 29 ) { test = reader.ReadInt(); m_TakesLifeOnKill = test > 0; } else m_TakesLifeOnKill = reader.ReadBool(); m_Description = reader.ReadString(); m_Intimidated = reader.ReadInt(); if( version < 29 ) { test = reader.ReadInt(); m_IsHuntingHound = test > 0; } else m_IsHuntingHound = reader.ReadBool(); m_XPScale = reader.ReadInt(); m_StatScale = reader.ReadInt(); m_SkillScale = reader.ReadInt(); m_Level = reader.ReadInt(); m_XP = reader.ReadInt(); m_NextLevel = reader.ReadInt(); if( version < 29 ) { test = reader.ReadInt(); m_Warned = test > 0; } else m_Warned = reader.ReadBool(); m_WarningTime = reader.ReadDateTime(); m_BribingTime = reader.ReadDateTime(); m_EmployerFeatLevel = reader.ReadInt(); m_TargetsName = reader.ReadString(); m_Employer = reader.ReadMobile(); m_HiringTime = reader.ReadDateTime(); if( version < 29 ) { test = reader.ReadInt(); m_Bribed = test > 0; } else m_Bribed = reader.ReadBool(); m_LastSeen = reader.ReadDateTime(); if( version < 29 ) { test = reader.ReadInt(); m_CanBeInformant = test > 0; } else m_CanBeInformant = reader.ReadBool(); m_CurrentAI = (AIType)reader.ReadInt(); m_DefaultAI = (AIType)reader.ReadInt(); m_iRangePerception = reader.ReadInt(); m_iRangeFight = reader.ReadInt(); m_iTeam = reader.ReadInt(); m_dActiveSpeed = reader.ReadDouble(); m_dPassiveSpeed = reader.ReadDouble(); m_dCurrentSpeed = reader.ReadDouble(); if ( m_iRangePerception == OldRangePerception ) m_iRangePerception = DefaultRangePerception; m_pHome.X = reader.ReadInt(); m_pHome.Y = reader.ReadInt(); m_pHome.Z = reader.ReadInt(); if ( version >= 1 ) { m_iRangeHome = reader.ReadInt(); int i, iCount; iCount = reader.ReadInt(); for ( i=0; i< iCount; i++ ) { string str = reader.ReadString(); Type type = Type.GetType( str ); if ( type != null ) { m_arSpellAttack.Add( type ); } } iCount = reader.ReadInt(); for ( i=0; i< iCount; i++ ) { string str = reader.ReadString(); Type type = Type.GetType( str ); if ( type != null ) { m_arSpellDefense.Add( type ); } } } else { m_iRangeHome = 0; } if ( version >= 2 ) { m_FightMode = ( FightMode )reader.ReadInt(); m_bControlled = reader.ReadBool(); m_ControlMaster = reader.ReadMobile(); m_ControlTarget = reader.ReadMobile(); m_ControlDest = reader.ReadPoint3D(); m_ControlOrder = (OrderType) reader.ReadInt(); m_dMinTameSkill = reader.ReadDouble(); if ( version < 9 ) reader.ReadDouble(); m_bTamable = reader.ReadBool(); m_bSummoned = reader.ReadBool(); if ( m_bSummoned ) { m_SummonEnd = reader.ReadDeltaTime(); new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start(); } m_iControlSlots = reader.ReadInt(); } else { m_FightMode = FightMode.Closest; m_bControlled = false; m_ControlMaster = null; m_ControlTarget = null; m_ControlOrder = OrderType.None; } if ( version >= 3 ) m_Loyalty = reader.ReadInt(); else m_Loyalty = MaxLoyalty; // Wonderfully Happy if ( version >= 4 ) m_CurrentWayPoint = reader.ReadItem() as WayPoint; if ( version >= 5 ) m_SummonMaster = reader.ReadMobile(); if ( version >= 6 ) { //m_HitsMax = reader.ReadInt(); //m_StamMax = reader.ReadInt(); //m_ManaMax = reader.ReadInt(); m_DamageMin = reader.ReadInt(); m_DamageMax = reader.ReadInt(); } if ( version >= 7 ) { m_PhysicalResistance = reader.ReadInt(); m_PhysicalDamage = reader.ReadInt(); m_FireResistance = reader.ReadInt(); m_FireDamage = reader.ReadInt(); m_ColdResistance = reader.ReadInt(); m_ColdDamage = reader.ReadInt(); m_PoisonResistance = reader.ReadInt(); m_PoisonDamage = reader.ReadInt(); m_EnergyResistance = reader.ReadInt(); m_EnergyDamage = reader.ReadInt(); } if ( version >= 8 ) m_Owners = reader.ReadStrongMobileList(); else m_Owners = new List<Mobile>(); if ( version >= 10 ) { m_IsDeadPet = reader.ReadBool(); m_IsBonded = reader.ReadBool(); m_BondingBegin = reader.ReadDateTime(); m_OwnerAbandonTime = reader.ReadDateTime(); } if ( version >= 11 ) m_HasGeneratedLoot = reader.ReadBool(); else m_HasGeneratedLoot = true; if ( version >= 12 ) m_Paragon = reader.ReadBool(); else m_Paragon = false; if ( version >= 13 && reader.ReadBool() ) m_Friends = reader.ReadStrongMobileList(); else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend ) ++m_ControlOrder; if ( version < 16 ) Loyalty *= 10; double activeSpeed = m_dActiveSpeed; double passiveSpeed = m_dPassiveSpeed; SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed ); bool isStandardActive = false; for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i ) isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] ); bool isStandardPassive = false; for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i ) isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] ); if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed ) m_dCurrentSpeed = activeSpeed; else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed ) m_dCurrentSpeed = passiveSpeed; if ( isStandardActive && !m_Paragon ) m_dActiveSpeed = activeSpeed; if ( isStandardPassive && !m_Paragon ) m_dPassiveSpeed = passiveSpeed; if ( version >= 14 ) { m_RemoveIfUntamed = reader.ReadBool(); m_RemoveStep = reader.ReadInt(); } if( version <= 14 && m_Paragon && Hue == 0x31 ) { Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501. } m_BluntResistance = reader.ReadInt(); m_BluntDamage = reader.ReadInt(); m_SlashingResistance = reader.ReadInt(); m_SlashingDamage = reader.ReadInt(); m_PiercingResistance = reader.ReadInt(); m_PiercingDamage = reader.ReadInt(); CheckStatTimers(); Timer.DelayCall( TimeSpan.FromSeconds( 5 ), new TimerCallback( WaitToChangeAI ) ); AddFollowers(); if ( IsAnimatedDead ) Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this ); if( this.Level < 1 ) this.Level = 1; if( this.Blessed && this.Alive ) this.CanBeInformant = true; m_Intimidated = 0; if( !( this is Mercenary ) && version < 34 && this.Level > 1 ) { int bonus = this.Level / 2; int rest = this.Level % 2; this.DamageMax += bonus + rest; this.DamageMin += bonus; } LevelSystem.FixStatsAndSkills( this ); m_Deserialized = true; }
public GovernmentReportsGump(PlayerMobile from, GovernmentEntity g, int currentReport) : this(from, g, currentReport, 0) { }
public bool SearchForClaimants() { if (SearchForOwners()) return false; if(m_Claimant == null || m_Claimant.Deleted) return false; if(m_ClaimantGovernment == null || m_ClaimantGovernment.Deleted) return false; IPooledEnumerable eable = this.Map.GetMobilesInRange(this.Location, 14); bool ClaimantNearby = false; foreach (Mobile m in eable) { if (m is PlayerMobile && (DateTime.Now > (m as PlayerMobile).LastDeath + TimeSpan.FromHours(1)) && m_ClaimantGovernment.Members.Contains(m)) { ClaimantNearby = true; m.RevealingAction(); continue; } if (m is BaseCreature && (m as BaseCreature).Government == m_Government) { ClaimantNearby = true; m.RevealingAction(); continue; } foreach (CustomGuildStone g in CustomGuildStone.Guilds) { if (m is PlayerMobile && (DateTime.Now > (m as PlayerMobile).LastDeath + TimeSpan.FromHours(12))) { if (CustomGuildStone.IsGuildMember(m as PlayerMobile, g) && g.AlliedGuilds.Contains(g)) { ClaimantNearby = true; m.RevealingAction(); continue; } } else if (m is BaseKhaerosMobile) { if ((m as BaseKhaerosMobile).Government != null && !(m as BaseKhaerosMobile).Government.Deleted && g.AlliedGuilds.Contains((m as BaseKhaerosMobile).Government)) { ClaimantNearby = true; m.RevealingAction(); continue; } } } if (m is BaseCreature && (m as BaseCreature).Controlled && (m as BaseCreature).ControlMaster != null && CustomGuildStone.IsGuildMember((m as BaseCreature).ControlMaster as PlayerMobile, m_ClaimantGovernment) && !(m as BaseCreature).IsDeadBondedPet && !(m as BaseCreature).IsDeadPet) { ClaimantNearby = true; m.RevealingAction(); continue; } if (ClaimantNearby) break; } eable.Free(); if (!ClaimantNearby && (m_ClaimTimer != null)) { m_Claimant.SendMessage("You failed to capture the " + this.Resource.ToString() + "!"); m_ClaimantGovernment = null; m_Claimant = null; m_ClaimTimer.Stop(); } return ClaimantNearby; }
public RemoveMilitaryAdvisorTarget(GovernmentEntity gov) : base(4, false, TargetFlags.None) { m_Government = gov; }
public AddMilitaryAdvisorTarget(GovernmentEntity g) : base(4, true, TargetFlags.None) { m_Government = g; }
public static bool CanDoBusiness(GovernmentEntity g, PlayerMobile pm) { if (CustomGuildStone.IsGuildEconomic(pm, g)) return true; foreach(string name in g.TradeInformation.NoBusinessList) { if(name.ToLower() == pm.Name.ToLower()) return false; } foreach(Nation n in g.TradeInformation.NoBusinessNations) { if(n == pm.GetDisguisedNation()) return false; } if(g.MilitaryPolicies.KillIndividualOnSight.Contains(pm.Name)) return false; if(g.MilitaryPolicies.JailIndividualOnSight.Contains(pm.Name)) return false; if(!g.MilitaryPolicies.Exceptions.Contains(pm.Name)) { if(g.MilitaryPolicies.JailNationOnSight.Contains(pm.GetDisguisedNation())) return false; if(g.MilitaryPolicies.KillNationOnSight.Contains(pm.GetDisguisedNation())) return false; } foreach(CustomGuildStone enemy in g.EnemyGuilds) { if(CustomGuildStone.IsGuildMember(pm, enemy) && pm.CustomGuilds[enemy].ActiveTitle) return false; } return true; }
public void Release(PlayerMobile pm, GovernmentEntity g) { if( !(GovernmentEntity.IsGuildOfficer(pm, g)) ) { pm.SendMessage("Only officers may order a resource to be abandoned."); return; } pm.RevealingAction(); pm.SendMessage("You order the " + this.Resource.ToString() + " to be abandoned by " + this.Government.Name.ToString() + "."); Owned = false; Name = BaseName; Government = null; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); bool newVendorSystem = false; //if (version == 3) // version = 4; switch ( version ) { case 4: { //Console.WriteLine("Government"); m_Government = (GovernmentEntity)reader.ReadItem(); goto case 3; } case 3: { //Console.WriteLine("SecondRace"); m_SellsToSecondRace = reader.ReadBool(); //Console.WriteLine("Count"); int count = reader.ReadInt(); //Console.WriteLine("Log"); for( int i = 0; i < count; i++ ) m_Log.Add( reader.ReadString() ); goto case 2; } case 2: case 1: { //Console.WriteLine("Read NewVendorSystem"); newVendorSystem = reader.ReadBool(); //Console.WriteLine("ShopName"); m_ShopName = reader.ReadString(); //Console.WriteLine("NextPayTime"); m_NextPayTime = reader.ReadDeltaTime(); // Console.WriteLine("House"); House = (BaseHouse) reader.ReadItem(); goto case 0; } case 0: { //Console.WriteLine("Owner"); m_Owner = reader.ReadMobile(); //Console.WriteLine("BankAccount"); m_BankAccount = reader.ReadInt(); //Console.WriteLine("HoldCopper"); m_HoldCopper = reader.ReadInt(); //Console.WriteLine("SellItems Hashtable"); m_SellItems = new Hashtable(); //Console.WriteLine("SellItemsLoop"); int count = reader.ReadInt(); for ( int i = 0; i < count; i++ ) { Item item = reader.ReadItem(); int price = reader.ReadInt(); if ( price > 100000000 ) price = 100000000; string description = reader.ReadString(); DateTime created = version < 1 ? DateTime.Now : reader.ReadDateTime(); if ( item != null ) { SetVendorItem( item, version < 1 && price <= 0 ? -1 : price, description, created ); } } break; } } //Console.WriteLine("NewVendorSystemActivateBool"); bool newVendorSystemActivated = BaseHouse.NewVendorSystem && !newVendorSystem; if ( version < 1 || newVendorSystemActivated ) { if ( version < 1 ) { m_ShopName = "Shop Not Yet Named"; Timer.DelayCall( TimeSpan.Zero, new TimerStateCallback( UpgradeFromVersion0 ), newVendorSystemActivated ); } else { Timer.DelayCall( TimeSpan.Zero, new TimerCallback( FixDresswear ) ); } m_NextPayTime = DateTime.Now + PayTimer.GetInterval(); if ( newVendorSystemActivated ) { m_HoldCopper += m_BankAccount; m_BankAccount = 0; } } TimeSpan delay = m_NextPayTime - DateTime.Now; m_PayTimer = new PayTimer( this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero ); m_PayTimer.Start(); Blessed = false; if ( Core.AOS && NameHue == 0x35 ) NameHue = -1; if( version < 2 ) { RawStr = 100; RawDex = 100; RawStam = 100; } m_Deserialized = true; }
public MilitaryPolicyGump(PlayerMobile viewer, GovernmentEntity g) : this(viewer, g, 0, 0) { }
public void InitialSetup(PlayerMobile from, GovernmentEntity g, int currentReport, int currentScroll) { Closable = true; Disposable = true; Dragable = true; Resizable = false; m_Viewer = from; m_Government = g; m_CurrentReport = currentReport; m_Scroll = currentScroll; m_Viewer.CloseGump(typeof(GovernmentReportsGump)); AddPage(0); AddBackground(245, 100, 325, 400, 9270); AddBackground(266, 122, 283, 74, 9350); AddBackground(266, 208, 283, 244, 9350); AddLabel(407 - (int)(m_Government.Name.Length * 3.5), 133, 0, m_Government.Name.ToString()); AddLabel(373, 162, 0, "Report #" + (m_CurrentReport + 1).ToString()); if (m_CurrentReport > 0) { AddButton(269, 465, 9766, 9767, (int)Button.LastReport, GumpButtonType.Reply, 0); AddLabel(291, 462, 1000, "Last Report"); } if (m_Government.Reports.Count - 1 > m_CurrentReport) { AddButton(529, 465, 9762, 9763, (int)Button.NextReport, GumpButtonType.Reply, 0); AddLabel(448, 462, 1000, "Next Report"); } }
public EmployeeContract(GovernmentEntity source, bool slave) : base(0x14F0) { m_Government = source; m_IsSlave = slave; if (m_IsSlave) Name = "A Contract of Slavery from " + m_Government.Name; else Name = "A Contract of Wage Employment from " + m_Government.Name; }
public GovernmentReportsGump(PlayerMobile from, GovernmentEntity g, int currentReport, int currentScroll) : base(0, 0) { InitialSetup(from, g, currentReport, currentScroll); AddReport(); }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); switch (version) { case 0: { m_Government = (GovernmentEntity)reader.ReadItem(); m_IsSlave = reader.ReadBool(); break; } } }
public static double CalculateResourceBonus(GovernmentEntity gov, Armament arm) { if (gov == null || gov.Deleted) return 0; double bonus = 0; double resDiv = (gov.MilitarySpawners.Count); resDiv -= (gov.Resources[ResourceType.Influence] / 1000); foreach (KeyValuePair<ResourceType, int> kvp in gov.Resources) { if (kvp.Value > 0) resDiv -= 0.75; } if (resDiv < 1) resDiv = 1; switch (arm) { case Armament.Light: { bonus += ( gov.Resources[ResourceType.Cloth] / resDiv ); bonus += (gov.Resources[ResourceType.Food] / resDiv); bonus += (gov.Resources[ResourceType.Water] / resDiv); break; } case Armament.Medium: { bonus += (gov.Resources[ResourceType.Metals] / (resDiv * 2)); bonus += (gov.Resources[ResourceType.Cloth] / (resDiv * 2)); bonus += (gov.Resources[ResourceType.Food] / resDiv); bonus += (gov.Resources[ResourceType.Water] / resDiv); break; } case Armament.Heavy: { bonus += (gov.Resources[ResourceType.Metals] / resDiv); bonus += (gov.Resources[ResourceType.Food] / resDiv); bonus += (gov.Resources[ResourceType.Water] / resDiv); break; } case Armament.Ranged: { bonus += (gov.Resources[ResourceType.Wood] / resDiv); bonus += (gov.Resources[ResourceType.Food] / resDiv); bonus += (gov.Resources[ResourceType.Water] / resDiv); break; } case Armament.LightCavalry: { bonus += (gov.Resources[ResourceType.Cloth] / resDiv); bonus += (gov.Resources[ResourceType.Food] / resDiv); bonus += (gov.Resources[ResourceType.Water] / resDiv); break; } case Armament.HeavyCavalry: { bonus += (gov.Resources[ResourceType.Metals] / resDiv); bonus += (gov.Resources[ResourceType.Food] / resDiv); bonus += (gov.Resources[ResourceType.Water] / resDiv); break; } default: break; } return bonus; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadInt(); m_Resource = (ResourceType)reader.ReadInt(); m_Government = (GovernmentEntity)reader.ReadItem(); m_Owned = reader.ReadBool(); m_ProductionDate = reader.ReadDateTime(); m_ProductionRate = reader.ReadInt(); BaseName = reader.ReadString(); m_Claimant = (PlayerMobile)reader.ReadMobile(); m_ClaimantGovernment = (GovernmentEntity)reader.ReadItem(); if (version < 1) ProductionDate = DateTime.Now.AddDays(1); if (m_Owned) { m_Timer = new ResourceTimer(this); m_Timer.Start(); } if (m_ClaimantGovernment != null && !m_ClaimantGovernment.Deleted) { m_ClaimTimer = new ClaimResourceTimer(this); m_ClaimTimer.Start(); } }