Esempio n. 1
2
		public override void InitOutfit( Faction faction )
		{
			new Horse().Rider = this;

			AddItem( new StuddedChest() );
			AddItem( new StuddedArms() );
			AddItem( new StuddedGloves() );
			AddItem( new StuddedGorget() );
			AddItem( new StuddedLegs() );
			AddItem( new Boots() );
			AddItem( new SkullCap() );

			Bow bow = new Bow();

			bow.Movable = false;
			bow.Crafter = this;
			bow.Quality = WeaponQuality.Exceptional;

			AddItem( bow );

			Container pack = new Backpack();

			pack.Movable = false;

			Arrow arrows = new Arrow( 250 );

			arrows.LootType = LootType.Newbied;

			pack.DropItem( arrows );
			pack.DropItem( new Gold( 10, 25 ) );

			AddItem( pack );
		}
Esempio n. 2
2
        public static void Generate( Faction faction )
        {
            Map facet = Faction.Facet;

            TownCollection towns = Town.Towns;

            StrongholdDefintion stronghold = faction.Definition.Stronghold;

            if ( !CheckExistance( stronghold.JoinStone, facet, typeof( JoinStone ) ) )
            {
                new JoinStone( faction ).MoveToWorld( stronghold.JoinStone, facet );
            }

            if ( !CheckExistance( stronghold.FactionStone, facet, typeof( FactionStone ) ) )
            {
                new FactionStone( faction ).MoveToWorld( stronghold.FactionStone, facet );
            }

            for ( int i = 0; i < stronghold.Monoliths.Length; ++i )
            {
                Point3D monolith = stronghold.Monoliths[i];

                if ( !CheckExistance( monolith, facet, typeof( StrongholdMonolith ) ) )
                {
                    new StrongholdMonolith( towns[i], faction ).MoveToWorld( monolith, facet );
                }
            }
        }
Esempio n. 3
0
		public BaseMonolith( Town town, Faction faction ) : base( 0x1183 )
		{
			Movable = false;
			Town = town;
			Faction = faction;
			m_Monoliths.Add( this );
		}
Esempio n. 4
0
		public FactionWarHorse( Faction faction ) : base( 0xE2, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
		{
			BaseSoundID = 0xA8;

			SetStr( 400, 550 );
			SetDex( 180 );
			SetInt( 51, 55 );

			SetHits( 240 );
			SetMana( 0 );

			SetDamage( 2, 4 );

			

			
			
			
			
			

			SetSkill( SkillName.MagicResist, 25.1, 30.0 );
			SetSkill( SkillName.Tactics, 29.3, 44.0 );
			SetSkill( SkillName.Wrestling, 29.3, 44.0 );

			Fame = 300;
			Karma = 300;

			Tamable = true;
			ControlSlots = 1;

			Faction = faction;
		}
		public Election( Faction faction )
		{
			m_Faction = faction;
			m_Candidates = new CandidateCollection();

			StartTimer();
		}
		public EventWarHorse( Faction faction ) : base( "a war horse", 0xE2, 0x3EA0, AIType.AI_Melee, FightMode.Agressor, 10, 1, 0.2, 0.4 )
		{
			BaseSoundID = 0xA8;

			SetStr( 400 );
			SetDex( 180 );
			SetInt( 100 );

			SetHits( 300 );
			SetMana( 100 );
			SetStam( 180 );

			SetDamage( 15, 25 );

			SetSkill( SkillName.MagicResist, 100 );
			SetSkill( SkillName.Tactics, 120 );
			SetSkill( SkillName.Wrestling, 120 );

			Fame = 300;
			Karma = 300;

			Tamable = true;
			ControlSlots = 1;

			Faction = faction;
		}
Esempio n. 7
0
        public Election(Faction faction)
        {
            this.m_Faction = faction;
            this.m_Candidates = new List<Candidate>();

            this.StartTimer();
        }
Esempio n. 8
0
		public FactionTownStoneGump( PlayerMobile from, Faction faction, Town town ) : base( 50, 50 )
		{
			m_From = from;
			m_Faction = faction;
			m_Town = town;

			AddPage( 0 );

			AddBackground( 0, 0, 320, 250, 5054 );
			AddBackground( 10, 10, 300, 230, 3000 );

			AddHtmlText( 25, 30, 250, 25, town.Definition.FactionTownStoneHeader, false, false );

			AddHtmlLocalized( 55, 60, 150, 25, 1011557, false, false ); // Hire Sheriff
			AddButton( 20, 60, 4005, 4007, 1, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 90, 150, 25, 1011559, false, false ); // Hire Finance Minister
			AddButton( 20, 90, 4005, 4007, 2, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 120, 150, 25, 1011558, false, false ); // Fire Sheriff
			AddButton( 20, 120, 4005, 4007, 3, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 150, 150, 25, 1011560, false, false ); // Fire Finance Minister
			AddButton( 20, 150, 4005, 4007, 4, GumpButtonType.Reply, 0 );

			AddHtmlLocalized( 55, 210, 150, 25, 1011441, false, false ); // EXIT
			AddButton( 20, 210, 4005, 4007, 0, GumpButtonType.Reply, 0 );
		}
Esempio n. 9
0
        public Election(GenericReader reader)
        {
            int version = reader.ReadEncodedInt();

            switch ( version )
            {
                case 0:
                    {
                        this.m_Faction = Faction.ReadReference(reader);

                        this.m_LastStateTime = reader.ReadDateTime();
                        this.m_State = (ElectionState)reader.ReadEncodedInt();

                        this.m_Candidates = new List<Candidate>();

                        int count = reader.ReadEncodedInt();

                        for (int i = 0; i < count; ++i)
                        {
                            Candidate cd = new Candidate(reader);

                            if (cd.Mobile != null)
                                this.m_Candidates.Add(cd);
                        }

                        break;
                    }
            }

            this.StartTimer();
        }
Esempio n. 10
0
        public static void Generate(Faction faction)
        {
            Map facet = Faction.Facet;

            List<Town> towns = Town.Towns;

            StrongholdDefinition stronghold = faction.Definition.Stronghold;

			if (!CheckExistance(stronghold.JoinStone, facet, typeof(JoinStone)))
			{
				JoinStone join = new JoinStone(faction);
				WeakEntityCollection.Add("factions", join);
				join.MoveToWorld(stronghold.JoinStone, facet);
			}

			if (!CheckExistance(stronghold.FactionStone, facet, typeof(FactionStone)))
			{
				FactionStone stone = new FactionStone(faction);
				WeakEntityCollection.Add("factions", stone);
				stone.MoveToWorld(stronghold.FactionStone, facet);
			}

            for (int i = 0; i < stronghold.Monoliths.Length; ++i)
            {
                Point3D monolith = stronghold.Monoliths[i];

				if (!CheckExistance(monolith, facet, typeof(StrongholdMonolith)))
				{
					StrongholdMonolith mono = new StrongholdMonolith(towns[i], faction);
					WeakEntityCollection.Add("factions", mono);
					mono.MoveToWorld(monolith, facet);
				}
            }
        }
Esempio n. 11
0
        public HorseBreederGump( PlayerMobile from, Faction faction )
            : base(20, 30)
        {
            m_From = from;
            m_Faction = faction;

            AddPage( 0 );

            AddBackground( 0, 0, 320, 280, 5054 );
            AddBackground( 10, 10, 300, 260, 3000 );

            AddHtmlText( 20, 30, 300, 25, faction.Definition.Header, false, false );

            AddHtmlLocalized( 20, 60, 300, 25, 1018306, false, false ); // Purchase a Faction War Horse
            AddItem( 70, 120, 0x3FFE );

            AddItem( 150, 120, 0xEF2 );
            AddLabel( 190, 122, 0x3E3, FactionWarHorse.SilverPrice.ToString( "N0" ) ); // NOTE: Added 'N0'

            AddItem( 150, 150, 0xEEF );
            AddLabel( 190, 152, 0x3E3, FactionWarHorse.GoldPrice.ToString( "N0" ) ); // NOTE: Added 'N0'

            AddHtmlLocalized( 55, 210, 200, 25, 1011011, false, false ); // CONTINUE
            AddButton( 20, 210, 4005, 4007, 1, GumpButtonType.Reply, 0 );

            AddHtmlLocalized( 55, 240, 200, 25, 1011012, false, false ); // CANCEL
            AddButton( 20, 240, 4005, 4007, 0, GumpButtonType.Reply, 0 );
        }
 public FactionHorseVendor( Town town, Faction faction )
     : base(town, faction, "the Horse Breeder")
 {
     SetSkill( SkillName.AnimalLore, 64.0, 100.0 );
     SetSkill( SkillName.AnimalTaming, 90.0, 100.0 );
     SetSkill( SkillName.Veterinary, 65.0, 88.0 );
 }
Esempio n. 13
0
        public JoinStoneGump(PlayerMobile from, Faction faction)
            : base(20, 30)
        {
            this.m_From = from;
            this.m_Faction = faction;

            this.AddPage(0);

            this.AddBackground(0, 0, 550, 440, 5054);
            this.AddBackground(10, 10, 530, 420, 3000);

            this.AddHtmlText(20, 30, 510, 20, faction.Definition.Header, false, false);
            this.AddHtmlText(20, 130, 510, 100, faction.Definition.About, true, true);

            this.AddHtmlLocalized(20, 60, 100, 20, 1011429, false, false); // Led By :
            this.AddHtml(125, 60, 200, 20, faction.Commander != null ? faction.Commander.Name : "Nobody", false, false);

            this.AddHtmlLocalized(20, 80, 100, 20, 1011457, false, false); // Tithe rate :
            if (faction.Tithe >= 0 && faction.Tithe <= 100 && (faction.Tithe % 10) == 0)
                this.AddHtmlLocalized(125, 80, 350, 20, 1011480 + (faction.Tithe / 10), false, false);
            else
                this.AddHtml(125, 80, 350, 20, faction.Tithe + "%", false, false);

            this.AddButton(20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(55, 400, 200, 20, 1011425, false, false); // JOIN THIS FACTION

            this.AddButton(300, 400, 4005, 4007, 0, GumpButtonType.Reply, 0);
            this.AddHtmlLocalized(335, 400, 200, 20, 1011012, false, false); // CANCEL
        }
 public FactionOreVendor( Town town, Faction faction )
     : base(town, faction, "the Ore Man")
 {
     // NOTE: Skills verified
     SetSkill( SkillName.Carpentry, 85.0, 100.0 );
     SetSkill( SkillName.Lumberjacking, 60.0, 83.0 );
 }
Esempio n. 15
0
        public StrongholdRegion(Faction faction)
            : base(faction.Definition.FriendlyName, Faction.Facet, Region.DefaultPriority, faction.Definition.Stronghold.Area)
        {
            this.m_Faction = faction;

            this.Register();
        }
Esempio n. 16
0
		public FactionWarHorse( Faction faction ) : base( "a war horse", 0xE2, 0x3EA0, AIType.AI_Melee, FightMode.Aggressor, 10, 1, 0.2, 0.4 )
		{
			BaseSoundID = 0xA8;

			SetStr( 400 );
			SetDex( 125 );
			SetInt( 51, 55 );

			SetHits( 240 );
			SetMana( 0 );

			SetDamage( 5, 8 );

			SetDamageType( ResistanceType.Physical, 100 );

			SetResistance( ResistanceType.Physical, 40, 50 );
			SetResistance( ResistanceType.Fire, 30, 40 );
			SetResistance( ResistanceType.Cold, 30, 40 );
			SetResistance( ResistanceType.Poison, 30, 40 );
			SetResistance( ResistanceType.Energy, 30, 40 );

			SetSkill( SkillName.MagicResist, 25.1, 30.0 );
			SetSkill( SkillName.Tactics, 29.3, 44.0 );
			SetSkill( SkillName.Wrestling, 29.3, 44.0 );

			Fame = 300;
			Karma = 300;

			Tamable = true;
			ControlSlots = 1;

			Faction = faction;
		}
Esempio n. 17
0
		public Election( Faction faction )
		{
			m_Faction = faction;
			m_Candidates = new List<Candidate>();

			StartTimer();
		}
Esempio n. 18
0
		public override void InitBody( Faction faction )
		{
			InitStats( 100, 125, 25 );
			Title = "the guard";

			SpeechHue = Utility.RandomDyedHue();

			Hue = Utility.RandomSkinHue();

			if ( Female = Utility.RandomBool() )
			{
				Body = 0x191;
				Name = NameList.RandomName( "female" );
			}
			else
			{
				Body = 0x190;
				Name = NameList.RandomName( "male" );
			}

			Skills[SkillName.Anatomy].Base = 120.0;
			Skills[SkillName.Tactics].Base = 120.0;
			Skills[SkillName.Archery].Base = 120.0;
			Skills[SkillName.MagicResist].Base = 120.0;
			Skills[SkillName.DetectHidden].Base = 100.0;
		}
Esempio n. 19
0
        public PlayerState(GenericReader reader, Faction faction, List<PlayerState> owner)
        {
            this.m_Faction = faction;
            this.m_Owner = owner;

            int version = reader.ReadEncodedInt();

            switch ( version )
            {
                case 1:
                    {
                        this.m_IsActive = reader.ReadBool();
                        this.m_LastHonorTime = reader.ReadDateTime();
                        goto case 0;
                    }
                case 0:
                    {
                        this.m_Mobile = reader.ReadMobile();

                        this.m_KillPoints = reader.ReadEncodedInt();
                        this.m_MerchantTitle = (MerchantTitle)reader.ReadEncodedInt();

                        this.m_Leaving = reader.ReadDateTime();

                        break;
                    }
            }

            this.Attach();
        }
		public CrimsonCinctureFaction( Faction faction, Mobile mobile ) : base()
		{
			Hue = 0x21;
			m_Owner = mobile;
			Attributes.BonusDex = 5;
			Attributes.BonusHits = 10;
			Attributes.RegenHits = 2;
		}
Esempio n. 21
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            this.m_Faction = Faction.ReadReference(reader);
        }
			public StormGripFaction( Faction faction, Mobile mobile ) : base()
				{
					Attributes.BonusInt = 8;
					Attributes.Luck = 125;
					Attributes.WeaponDamage = 25;
					Attributes.AttackChance = 10;
					m_Owner = mobile;
				}
Esempio n. 23
0
        public StrongholdRegion( Faction faction )
            : base(faction.Definition.FriendlyName, Faction.Facet, Region.DefaultPriority, faction.Definition.Stronghold.Area)
        {
            m_Faction = faction;

            //Register();
            // DIVINITY -  remove stupid stronghold regions.  We'll just never register them, how about that.
        }
		public InquisitorsResolutionFaction( Faction faction, Mobile mobile ) : base()
		{
			Hue = 0x4F2;
			m_Owner = mobile;
			Attributes.CastRecovery = 3;
			Attributes.LowerManaCost = 8;
			ArmorAttributes.MageArmor = 1;
		}
Esempio n. 25
0
 public FactionState( Faction faction )
 {
     m_Faction = faction;
     m_Tithe = 50;
     m_Members = new PlayerStateCollection();
     m_Election = new Election( faction );
     m_FactionItems = new FactionItemCollection();
     m_FactionTraps = new FactionTrapCollection();
 }
		public HeartOfTheLionFaction( Faction faction, Mobile mobile ) : base()
		{
			Hue = 0x501;
			Attributes.Luck = 95;
			Attributes.DefendChance = 15;
			ArmorAttributes.LowerStatReq = 100;
			ArmorAttributes.MageArmor = 1;
			m_Owner = mobile;
		}
Esempio n. 27
0
        public BaseFactionTrap(Faction f, Mobile m, int itemID)
            : base(itemID)
        {
            this.Visible = false;

            this.m_Faction = f;
            this.m_TimeOfPlacement = DateTime.UtcNow;
            this.m_Placer = m;
        }
			public RuneBeetleCarapaceFaction( Faction faction, Mobile mobile ) : base()
				{
					Attributes.BonusMana = 10;
					Attributes.RegenMana = 3;
					Attributes.LowerManaCost = 15;
					ArmorAttributes.LowerStatReq = 100;
					ArmorAttributes.MageArmor = 1;
					m_Owner = mobile;
				}
        public BaseFactionTrap( Faction f, Mobile m, int itemID )
            : base(itemID)
        {
            Visible = false;

            m_Faction = f;
            m_TimeOfPlacement = DateTime.Now;
            m_Placer = m;
        }
 public FactionState( Faction faction )
 {
     m_Faction = faction;
     m_Tithe = 50;
     m_Members = new List<PlayerState>();
     m_Election = new Election( faction );
     m_FactionItems = new List<FactionItem>();
     m_FactionTraps = new List<BaseFactionTrap>();
 }
Esempio n. 31
0
 public FactionSawTrap(Faction f) : this(f, null)
 {
 }
Esempio n. 32
0
        public static void WriteReference(GenericWriter writer, Faction fact)
        {
            int idx = Factions.IndexOf(fact);

            writer.WriteEncodedInt((int)(idx + 1));
        }
Esempio n. 33
0
        private static void EventSink_Speech(SpeechEventArgs e)
        {
            Mobile from = e.Mobile;

            // jakob, added 2 new commands
            if (e.Speech.ToLower().IndexOf("i wish to appoint a deputy commander") > -1)
            {
                Faction faction = Faction.Find(from);
                if (faction != null && faction.IsCommander(from) && !faction.IsDeputyCommander(from))
                {
                    faction.BeginAppointDeputyCommander(from);
                }
            }
            else if (e.Speech.ToLower().IndexOf("i wish to demote the deputy commander") > -1)
            {
                Faction faction = Faction.Find(from);
                if (faction != null && faction.IsCommander(from) && !faction.IsDeputyCommander(from) && faction.DeputyCommander != null)
                {
                    faction.DeputyCommander = null;
                    from.SendMessage("You have fired the deputy commander.");
                }
            }
            // Kamron, added this
            else if (e.Speech.ToLower().IndexOf("i wish to renew my spirit") > -1)
            {
                PlayerState ps = PlayerState.Find(from);
                if (ps != null && from is PlayerMobile)
                {
                    PlayerMobile pm = (PlayerMobile)from;

                    if (ps.KillPoints <= 1)
                    {
                        from.SendMessage("Your spirit cannot be cleansed.");
                    }
                    else if (Faction.InSkillLoss(pm))
                    {
                        ps.KillPoints--;
                        Faction.ClearSkillLoss(pm);
                        from.SendMessage("You cleanse your spirit and remove your sins.");
                    }
                    else
                    {
                        from.SendMessage("Your spirit does not need cleansing.");
                    }
                }
            }
            // end


            int[] keywords = e.Keywords;

            for (int i = 0; i < keywords.Length; ++i)
            {
                switch (keywords[i])
                {
                case 0x00E4:                         // *i wish to access the city treasury*
                {
                    Town town = Town.FromRegion(from.Region);

                    if (town == null || !town.IsFinance(from) || !from.Alive)
                    {
                        break;
                    }

                    if (FactionGump.Exists(from))
                    {
                        from.SendLocalizedMessage(1042160);                                   // You already have a faction menu open.
                    }
                    else if (town.Owner != null && from is PlayerMobile)
                    {
                        from.SendGump(new FinanceGump((PlayerMobile)from, town.Owner, town));
                    }

                    break;
                }

                case 0x0ED:                         // *i am sheriff*
                {
                    Town town = Town.FromRegion(from.Region);

                    if (town == null || !town.IsSheriff(from) || !from.Alive)
                    {
                        break;
                    }

                    if (FactionGump.Exists(from))
                    {
                        from.SendLocalizedMessage(1042160);                                   // You already have a faction menu open.
                    }
                    else if (town.Owner != null)
                    {
                        from.SendGump(new SheriffGump((PlayerMobile)from, town.Owner, town));
                    }

                    break;
                }

                case 0x00EF:                         // *you are fired*
                {
                    Town town = Town.FromRegion(from.Region);

                    if (town == null)
                    {
                        break;
                    }

                    if (town.IsFinance(from) || town.IsSheriff(from))
                    {
                        town.BeginOrderFiring(from);
                    }

                    break;
                }

                case 0x00E5:                         // *i wish to resign as finance minister*
                {
                    PlayerState pl = PlayerState.Find(from);

                    if (pl != null && pl.Finance != null)
                    {
                        pl.Finance.Finance = null;
                        from.SendLocalizedMessage(1005081);                                   // You have been fired as Finance Minister
                    }

                    break;
                }

                case 0x00EE:                         // *i wish to resign as sheriff*
                {
                    PlayerState pl = PlayerState.Find(from);

                    if (pl != null && pl.Sheriff != null)
                    {
                        pl.Sheriff.Sheriff = null;
                        from.SendLocalizedMessage(1010270);                                   // You have been fired as Sheriff
                    }

                    break;
                }

                case 0x00E9:                         // *what is my faction term status*
                {
                    PlayerState pl = PlayerState.Find(from);

                    if (pl != null && pl.IsLeaving)
                    {
                        if (Faction.CheckLeaveTimer(from))
                        {
                            break;
                        }

                        TimeSpan remaining = (pl.Leaving + Faction.LeavePeriod) - DateTime.Now;

                        if (remaining.TotalDays >= 1)
                        {
                            from.SendLocalizedMessage(1042743, remaining.TotalDays.ToString("N0"));                                         // Your term of service will come to an end in ~1_DAYS~ days.
                        }
                        else if (remaining.TotalHours >= 1)
                        {
                            from.SendLocalizedMessage(1042741, remaining.TotalHours.ToString("N0"));                                         // Your term of service will come to an end in ~1_HOURS~ hours.
                        }
                        else
                        {
                            from.SendLocalizedMessage(1042742);                                       // Your term of service will come to an end in less than one hour.
                        }
                    }
                    else if (pl != null)
                    {
                        from.SendLocalizedMessage(1042233);                                   // You are not in the process of quitting the faction.
                    }

                    break;
                }

                case 0x00EA:                         // *message faction*
                {
                    Faction faction = Faction.Find(from);

                    if (faction == null || !faction.IsCommander(from))
                    {
                        break;
                    }

                    if (from.AccessLevel == AccessLevel.Player && !faction.FactionMessageReady)
                    {
                        from.SendLocalizedMessage(1010264);                                   // The required time has not yet passed since the last message was sent
                    }
                    else
                    {
                        faction.BeginBroadcast(from);
                    }

                    break;
                }

                case 0x00EC:                         // *showscore*
                {
                    PlayerState pl = PlayerState.Find(from);

                    if (pl != null)
                    {
                        Timer.DelayCall(TimeSpan.Zero, new TimerStateCallback(ShowScore_Sandbox), pl);
                    }

                    break;
                }                         /*
                                           * case 0x0178: // i honor your leadership
                                           * {
                                           *    Faction faction = Faction.Find( from );
                                           *
                                           *    if ( faction != null )
                                           *            faction.BeginHonorLeadership( from );
                                           *
                                           *    break;
                                           * } */
                }
            }
        }
Esempio n. 34
0
 private void ClearCorrupting()
 {
     m_Corrupting      = null;
     m_CorruptionStart = DateTime.MinValue;
 }
Esempio n. 35
0
        public FactionState(IGenericReader reader)
        {
            var version = reader.ReadEncodedInt();

            switch (version)
            {
                case 5:
                    {
                        LastAtrophy = reader.ReadDateTime();
                        goto case 4;
                    }
                case 4:
                    {
                        var count = reader.ReadEncodedInt();

                        for (var i = 0; i < count; ++i)
                        {
                            var time = reader.ReadDateTime();

                            if (i < m_LastBroadcasts.Length)
                                m_LastBroadcasts[i] = time;
                        }

                        goto case 3;
                    }
                case 3:
                case 2:
                case 1:
                    {
                        Election = new Election(reader);

                        goto case 0;
                    }
                case 0:
                    {
                        m_Faction = Faction.ReadReference(reader);

                        m_Commander = reader.ReadMobile();

                        if (version < 5)
                            LastAtrophy = DateTime.UtcNow;

                        if (version < 4)
                        {
                            var time = reader.ReadDateTime();

                            if (m_LastBroadcasts.Length > 0)
                                m_LastBroadcasts[0] = time;
                        }

                        Tithe = reader.ReadEncodedInt();
                        Silver = reader.ReadEncodedInt();

                        var memberCount = reader.ReadEncodedInt();

                        Members = new List<PlayerState>();

                        for (var i = 0; i < memberCount; ++i)
                        {
                            var pl = new PlayerState(reader, m_Faction, Members);

                            if (pl.Mobile != null)
                                Members.Add(pl);
                        }

                        m_Faction.State = this;

                        m_Faction.ZeroRankOffset = Members.Count;
                        Members.Sort();

                        for (var i = Members.Count - 1; i >= 0; i--)
                        {
                            var player = Members[i];

                            if (player.KillPoints <= 0)
                                m_Faction.ZeroRankOffset = i;
                            else
                                player.RankIndex = i;
                        }

                        FactionItems = new List<FactionItem>();

                        if (version >= 2)
                        {
                            var factionItemCount = reader.ReadEncodedInt();

                            for (var i = 0; i < factionItemCount; ++i)
                            {
                                var factionItem = new FactionItem(reader, m_Faction);

                                Timer.DelayCall(factionItem.CheckAttach); // sandbox attachment
                            }
                        }

                        Traps = new List<BaseFactionTrap>();

                        if (version >= 3)
                        {
                            var factionTrapCount = reader.ReadEncodedInt();

                            for (var i = 0; i < factionTrapCount; ++i)
                                if (reader.ReadItem() is BaseFactionTrap trap && !trap.CheckDecay())
                                    Traps.Add(trap);
                        }

                        break;
                    }
            }

            if (version < 1)
                Election = new Election(m_Faction);
        }
Esempio n. 36
0
        public Shadowlords()
        {
            m_Instance = this;

            Definition =
                new FactionDefinition(
                    3,
                    1109,         // shadow
                    2211,         // green
                    1109,         // join stone : shadow
                    2211,         // broadcast : green
                    0x79, 0x3EB0, // war horse
                    "Shadowlords", "shadow", "SL",
                    new TextDefinition(1011537, "SHADOWLORDS"),
                    new TextDefinition(1060772, "Shadowlords faction"),
                    new TextDefinition(1011424, "<center>SHADES OF DARKNESS</center>"),
                    new TextDefinition(1011451,
                                       "The Shadow Lords are a faction that has sprung up within the ranks of " +
                                       "Minax. Comprised mostly of undead and those who would seek to be " +
                                       "necromancers, they pose a threat to both the sides of good and evil. " +
                                       "Their plans have disrupted the hold Minax has over Felucca, and their " +
                                       "ultimate goal is to destroy all life."),
                    new TextDefinition(1011456, "This city is controlled by the Shadow Lords."),
                    new TextDefinition(1042255, "This sigil has been corrupted by the Shadowlords"),
                    new TextDefinition(1041046, "The faction signup stone for the Shadowlords"),
                    new TextDefinition(1041384, "The Faction Stone of the Shadowlords"),
                    new TextDefinition(1011466, ": Shadowlords"),
                    new TextDefinition(1005184, "Minions of the Shadowlords will now be ignored."),
                    new TextDefinition(1005185, "Minions of the Shadowlords will now be warned of their impending deaths."),
                    new TextDefinition(1005186, "Minions of the Shadowlords will now be attacked at will."),
                    new StrongholdDefinition(
                        new Rectangle2D[]
            {
                new Rectangle2D(960, 688, 8, 9),
                new Rectangle2D(944, 697, 24, 23)
            },
                        new Point3D(969, 768, 0),
                        new Point3D(947, 713, 0),
                        new Point3D[]
            {
                new Point3D(953, 713, 20),
                new Point3D(953, 709, 20),
                new Point3D(953, 705, 20),
                new Point3D(953, 701, 20),
                new Point3D(957, 713, 20),
                new Point3D(957, 709, 20),
                new Point3D(957, 705, 20),
                new Point3D(957, 701, 20)
            },
                        new Point3D(948, 713, 0)),
                    new RankDefinition[]
            {
                new RankDefinition(10, 991, 8, new TextDefinition(1060799, "Purveyor of Darkness")),
                new RankDefinition(9, 950, 7, new TextDefinition(1060798, "Agent of Evil")),
                new RankDefinition(8, 900, 6, new TextDefinition(1060797, "Bringer of Sorrow")),
                new RankDefinition(7, 800, 6, new TextDefinition(1060797, "Bringer of Sorrow")),
                new RankDefinition(6, 700, 5, new TextDefinition(1060796, "Keeper of Lies")),
                new RankDefinition(5, 600, 5, new TextDefinition(1060796, "Keeper of Lies")),
                new RankDefinition(4, 500, 5, new TextDefinition(1060796, "Keeper of Lies")),
                new RankDefinition(3, 400, 4, new TextDefinition(1060795, "Servant")),
                new RankDefinition(2, 200, 4, new TextDefinition(1060795, "Servant")),
                new RankDefinition(1, 0, 4, new TextDefinition(1060795, "Servant"))
            },
                    new GuardDefinition[]
            {
                new GuardDefinition(typeof(FactionHenchman), 0x1403, 5000, 1000, 10, new TextDefinition(1011526, "HENCHMAN"), new TextDefinition(1011510, "Hire Henchman")),
                new GuardDefinition(typeof(FactionMercenary), 0x0F62, 6000, 2000, 10, new TextDefinition(1011527, "MERCENARY"), new TextDefinition(1011511, "Hire Mercenary")),
                new GuardDefinition(typeof(FactionDeathKnight), 0x0F45, 7000, 3000, 10, new TextDefinition(1011512, "DEATH KNIGHT"), new TextDefinition(1011503, "Hire Death Knight")),
                new GuardDefinition(typeof(FactionNecromancer), 0x13F8, 8000, 4000, 10, new TextDefinition(1011513, "SHADOW MAGE"), new TextDefinition(1011504, "Hire Shadow Mage")),
            });
        }
Esempio n. 37
0
        public static void HandleDeath(Mobile victim, Mobile killer)
        {
            if (killer == null)
            {
                killer = victim.FindMostRecentDamager(true);
            }

            PlayerState killerState = PlayerState.Find(killer);

            Container pack = victim.Backpack;

            if (pack != null)
            {
                Container killerPack = (killer == null ? null : killer.Backpack);
                Item[]    sigils     = pack.FindItemsByType(typeof(Sigil));

                for (int i = 0; i < sigils.Length; ++i)
                {
                    Sigil sigil = (Sigil)sigils[i];

                    if (killerState != null && killerPack != null)
                    {
                        if (Sigil.ExistsOn(killer))
                        {
                            sigil.ReturnHome();
                            killer.SendLocalizedMessage(1010258);                               // The sigil has gone back to its home location because you already have a sigil.
                        }
                        else if (!killerPack.TryDropItem(killer, sigil, false))
                        {
                            sigil.ReturnHome();
                            killer.SendLocalizedMessage(1010259);                               // The sigil has gone home because your backpack is full.
                        }
                    }
                    else
                    {
                        sigil.ReturnHome();
                    }
                }
            }

            if (killerState == null)
            {
                return;
            }

            if (victim is BaseCreature)
            {
                BaseCreature bc            = (BaseCreature)victim;
                Faction      victimFaction = bc.FactionAllegiance;

                if (bc.Map == Faction.Facet && victimFaction != null && killerState.Faction != victimFaction)
                {
                    int silver = killerState.Faction.AwardSilver(killer, bc.FactionSilverWorth);

                    if (silver > 0)
                    {
                        killer.SendLocalizedMessage(1042748, silver.ToString("N0"));                             // Thou hast earned ~1_AMOUNT~ silver for vanquishing the vile creature.
                    }
                }

                #region Ethics
                if (bc.Map == Faction.Facet && bc.GetEthicAllegiance(killer) == BaseCreature.Allegiance.Enemy)
                {
                    Ethics.Player killerEPL = Ethics.Player.Find(killer);

                    if (killerEPL != null && (100 - killerEPL.Power) > Utility.Random(100))
                    {
                        ++killerEPL.Power;
                        ++killerEPL.History;
                    }
                }
                #endregion

                return;
            }

            PlayerState victimState = PlayerState.Find(victim);

            if (victimState == null)
            {
                return;
            }

            if (killer == victim || killerState.Faction != victimState.Faction)
            {
                ApplySkillLoss(victim);
            }

            if (killerState.Faction != victimState.Faction)
            {
                if (victimState.KillPoints <= -6)
                {
                    killer.SendLocalizedMessage(501693);                       // This victim is not worth enough to get kill points from.

                    #region Ethics
                    Ethics.Player killerEPL = Ethics.Player.Find(killer);
                    Ethics.Player victimEPL = Ethics.Player.Find(victim);

                    if (killerEPL != null && victimEPL != null && victimEPL.Power > 0 && victimState.CanGiveSilverTo(killer))
                    {
                        int powerTransfer = Math.Max(1, victimEPL.Power / 5);

                        if (powerTransfer > (100 - killerEPL.Power))
                        {
                            powerTransfer = 100 - killerEPL.Power;
                        }

                        if (powerTransfer > 0)
                        {
                            victimEPL.Power -= (powerTransfer + 1) / 2;
                            killerEPL.Power += powerTransfer;

                            killerEPL.History += powerTransfer;

                            victimState.OnGivenSilverTo(killer);
                        }
                    }
                    #endregion
                }
                else
                {
                    int award = Math.Max(victimState.KillPoints / 10, 1);

                    if (award > 40)
                    {
                        award = 40;
                    }

                    if (victimState.CanGiveSilverTo(killer))
                    {
                        if (victimState.KillPoints > 0)
                        {
                            int silver = 0;

                            silver = killerState.Faction.AwardSilver(killer, award * 40);

                            if (silver > 0)
                            {
                                killer.SendLocalizedMessage(1042736, String.Format("{0:N0} silver\t{1}", silver, victim.Name));                                     // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
                            }
                        }

                        victimState.KillPoints -= award;
                        killerState.KillPoints += award;

                        int offset = (award != 1 ? 0 : 2);                           // for pluralization

                        string args = String.Format("{0}\t{1}\t{2}", award, victim.Name, killer.Name);

                        killer.SendLocalizedMessage(1042737 + offset, args);                           // Thou hast been honored with ~1_KILL_POINTS~ kill point(s) for vanquishing ~2_DEAD_PLAYER~!
                        victim.SendLocalizedMessage(1042738 + offset, args);                           // Thou has lost ~1_KILL_POINTS~ kill point(s) to ~3_ATTACKER_NAME~ for being vanquished!

                        #region Ethics
                        Ethics.Player killerEPL = Ethics.Player.Find(killer);
                        Ethics.Player victimEPL = Ethics.Player.Find(victim);

                        if (killerEPL != null && victimEPL != null && victimEPL.Power > 0)
                        {
                            int powerTransfer = Math.Max(1, victimEPL.Power / 5);

                            if (powerTransfer > (100 - killerEPL.Power))
                            {
                                powerTransfer = 100 - killerEPL.Power;
                            }

                            if (powerTransfer > 0)
                            {
                                victimEPL.Power -= (powerTransfer + 1) / 2;
                                killerEPL.Power += powerTransfer;

                                killerEPL.History += powerTransfer;
                            }
                        }
                        #endregion

                        victimState.OnGivenSilverTo(killer);
                    }
                    else
                    {
                        killer.SendLocalizedMessage(1042231);                           // You have recently defeated this enemy and thus their death brings you no honor.
                    }
                }
            }
        }
Esempio n. 38
0
 public FactionSpikeTrap(Faction f)
     : this(f, null)
 {
 }
 public FactionBottleVendor(Town town, Faction faction) : base(town, faction, "the Bottle Seller")
 {
     SetSkill(SkillName.Alchemy, 85.0, 100.0);
     SetSkill(SkillName.TasteID, 65.0, 88.0);
 }
Esempio n. 40
0
 public FactionSawTrap(Faction f, Mobile m) : base(f, m, 0x11AC)
 {
 }
Esempio n. 41
0
 private void BeginCorrupting(Faction faction)
 {
     m_Corrupting      = faction;
     m_CorruptionStart = DateTime.Now;
 }
Esempio n. 42
0
        private static void EventSink_Speech(SpeechEventArgs e)
        {
            var from     = e.Mobile;
            var keywords = e.Keywords;

            for (var i = 0; i < keywords.Length; ++i)
            {
                switch (keywords[i])
                {
                case 0x00E4:     // *i wish to access the city treasury*
                {
                    var town = Town.FromRegion(from.Region);

                    if (town?.IsFinance(from) != true || !from.Alive)
                    {
                        break;
                    }

                    if (FactionGump.Exists(from))
                    {
                        from.SendLocalizedMessage(1042160);         // You already have a faction menu open.
                    }
                    else if (town.Owner != null && from is PlayerMobile mobile)
                    {
                        mobile.SendGump(new FinanceGump(mobile, town.Owner, town));
                    }

                    break;
                }

                case 0x0ED:     // *i am sheriff*
                {
                    var town = Town.FromRegion(from.Region);

                    if (town?.IsSheriff(from) != true || !from.Alive)
                    {
                        break;
                    }

                    if (FactionGump.Exists(from))
                    {
                        from.SendLocalizedMessage(1042160);         // You already have a faction menu open.
                    }
                    else if (town.Owner != null)
                    {
                        from.SendGump(new SheriffGump((PlayerMobile)from, town.Owner, town));
                    }

                    break;
                }

                case 0x00EF:     // *you are fired*
                {
                    var town = Town.FromRegion(from.Region);

                    if (town == null)
                    {
                        break;
                    }

                    if (town.IsFinance(from) || town.IsSheriff(from))
                    {
                        town.BeginOrderFiring(from);
                    }

                    break;
                }

                case 0x00E5:     // *i wish to resign as finance minister*
                {
                    var pl = PlayerState.Find(from);

                    if (pl?.Finance != null)
                    {
                        pl.Finance.Finance = null;
                        from.SendLocalizedMessage(1005081);         // You have been fired as Finance Minister
                    }

                    break;
                }

                case 0x00EE:     // *i wish to resign as sheriff*
                {
                    var pl = PlayerState.Find(from);

                    if (pl?.Sheriff != null)
                    {
                        pl.Sheriff.Sheriff = null;
                        from.SendLocalizedMessage(1010270);         // You have been fired as Sheriff
                    }

                    break;
                }

                case 0x00E9:     // *what is my faction term status*
                {
                    var pl = PlayerState.Find(from);

                    if (pl?.IsLeaving == true)
                    {
                        if (Faction.CheckLeaveTimer(from))
                        {
                            break;
                        }

                        var remaining = pl.Leaving + Faction.LeavePeriod - Core.Now;

                        if (remaining.TotalDays >= 1)
                        {
                            from.SendLocalizedMessage(
                                1042743,
                                remaining.TotalDays
                                .ToString("N0")
                                );     // Your term of service will come to an end in ~1_DAYS~ days.
                        }
                        else if (remaining.TotalHours >= 1)
                        {
                            // Your term of service will come to an end in ~1_HOURS~ hours.
                            from.SendLocalizedMessage(1042741, remaining.TotalHours.ToString("N0"));
                        }
                        else
                        {
                            // Your term of service will come to an end in less than one hour.
                            from.SendLocalizedMessage(1042742);
                        }
                    }
                    else if (pl != null)
                    {
                        // You are not in the process of quitting the faction.
                        from.SendLocalizedMessage(1042233);
                    }

                    break;
                }

                case 0x00EA:     // *message faction*
                {
                    var faction = Faction.Find(from);

                    if (faction?.IsCommander(from) != true)
                    {
                        break;
                    }

                    if (from.AccessLevel == AccessLevel.Player && !faction.FactionMessageReady)
                    {
                        // The required time has not yet passed since the last message was sent
                        from.SendLocalizedMessage(1010264);
                    }
                    else
                    {
                        faction.BeginBroadcast(from);
                    }

                    break;
                }

                case 0x00EC:     // *showscore*
                {
                    var pl = PlayerState.Find(from);

                    if (pl != null)
                    {
                        Timer.DelayCall(ShowScore_Sandbox, pl);
                    }

                    break;
                }

                case 0x0178:     // i honor your leadership
                {
                    Faction.Find(from)?.BeginHonorLeadership(from);
                    break;
                }
                }
            }
        }
Esempio n. 43
0
        public override void OnSpeech(SpeechEventArgs e)
        {
            base.OnSpeech(e);

            Mobile from = e.Mobile;

            if (!e.Handled && this.InRange(from, ListenRange) && from.Alive)
            {
                if (e.HasKeyword(0xE6) && (Insensitive.Equals(e.Speech, "orders") || this.WasNamed(e.Speech))) // *orders*
                {
                    if (this.m_Town == null || !this.m_Town.IsSheriff(from))
                    {
                        this.Say(1042189); // I don't work for you!
                    }
                    else if (Town.FromRegion(this.Region) == this.m_Town)
                    {
                        this.Say(1042180); // Your orders, sire?
                        this.m_OrdersEnd = DateTime.UtcNow + TimeSpan.FromSeconds(10.0);
                    }
                }
                else if (DateTime.UtcNow < this.m_OrdersEnd)
                {
                    if (this.m_Town != null && this.m_Town.IsSheriff(from) && Town.FromRegion(this.Region) == this.m_Town)
                    {
                        this.m_OrdersEnd = DateTime.UtcNow + TimeSpan.FromSeconds(10.0);

                        bool         understood = true;
                        ReactionType newType    = 0;

                        if (Insensitive.Contains(e.Speech, "attack"))
                        {
                            newType = ReactionType.Attack;
                        }
                        else if (Insensitive.Contains(e.Speech, "warn"))
                        {
                            newType = ReactionType.Warn;
                        }
                        else if (Insensitive.Contains(e.Speech, "ignore"))
                        {
                            newType = ReactionType.Ignore;
                        }
                        else
                        {
                            understood = false;
                        }

                        if (understood)
                        {
                            understood = false;

                            if (Insensitive.Contains(e.Speech, "civil"))
                            {
                                this.ChangeReaction(null, newType);
                                understood = true;
                            }

                            List <Faction> factions = Faction.Factions;

                            for (int i = 0; i < factions.Count; ++i)
                            {
                                Faction faction = factions[i];

                                if (faction != this.m_Faction && Insensitive.Contains(e.Speech, faction.Definition.Keyword))
                                {
                                    this.ChangeReaction(faction, newType);
                                    understood = true;
                                }
                            }
                        }
                        else if (Insensitive.Contains(e.Speech, "patrol"))
                        {
                            this.Home              = this.Location;
                            this.RangeHome         = 6;
                            this.Combatant         = null;
                            this.m_Orders.Movement = MovementType.Patrol;
                            this.Say(1005146); // This spot looks like it needs protection!  I shall guard it with my life.
                            understood = true;
                        }
                        else if (Insensitive.Contains(e.Speech, "follow"))
                        {
                            this.Home              = this.Location;
                            this.RangeHome         = 6;
                            this.Combatant         = null;
                            this.m_Orders.Follow   = from;
                            this.m_Orders.Movement = MovementType.Follow;
                            this.Say(1005144); // Yes, Sire.
                            understood = true;
                        }

                        if (!understood)
                        {
                            this.Say(1042183); // I'm sorry, I don't understand your orders...
                        }
                    }
                }
            }
        }
Esempio n. 44
0
        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (m.Player && m.Alive && this.InRange(m, 10) && !this.InRange(oldLocation, 10) && this.InLOS(m) && this.m_Orders.GetReaction(Faction.Find(m)).Type == ReactionType.Warn)
            {
                this.Direction = this.GetDirectionTo(m);

                string warning = null;

                switch (Utility.Random(6))
                {
                case 0:
                    warning = "I warn you, {0}, you would do well to leave this area before someone shows you the world of gray.";
                    break;

                case 1:
                    warning = "It would be wise to leave this area, {0}, lest your head become my commanders' trophy.";
                    break;

                case 2:
                    warning = "You are bold, {0}, for one of the meager {1}. Leave now, lest you be taught the taste of dirt.";
                    break;

                case 3:
                    warning = "Your presence here is an insult, {0}. Be gone now, knave.";
                    break;

                case 4:
                    warning = "Dost thou wish to be hung by your toes, {0}? Nay? Then come no closer.";
                    break;

                case 5:
                    warning = "Hey, {0}. Yeah, you. Get out of here before I beat you with a stick.";
                    break;
                }

                Faction faction = Faction.Find(m);

                this.Say(warning, m.Name, faction == null ? "civilians" : faction.Definition.FriendlyName);
            }
        }
Esempio n. 45
0
 public FactionExplosionTrap(Faction f, Mobile m)
     : base(f, m, 0x11C1)
 {
 }
Esempio n. 46
0
 public FactionSpikeTrap(Faction f, Mobile m)
     : base(f, m, 0x11A0)
 {
 }
Esempio n. 47
0
 public FactionItem(Item item, Faction faction)
 {
     Item    = item;
     Faction = faction;
 }
Esempio n. 48
0
        public TrueBritannians()
        {
            m_Instance = this;

            this.Definition =
                new FactionDefinition(
                    2,
                    1254,         // dark purple
                    2125,         // gold
                    2214,         // join stone : gold
                    2125,         // broadcast : gold
                    0x76, 0x3EB2, // war horse
                    "True Britannians", "true", "TB",
                    new TextDefinition(1011536, "LORD BRITISH"),
                    new TextDefinition(1060771, "True Britannians faction"),
                    new TextDefinition(1011423, "<center>TRUE BRITANNIANS</center>"),
                    new TextDefinition(1011450,
                                       "True Britannians are loyal to the throne of Lord British. They refuse " +
                                       "to give up their homelands to the vile Minax, and detest the Shadowlords " +
                                       "for their evil ways. In addition, the Council of Mages threatens the " +
                                       "existence of their ruler, and as such they have armed themselves, and " +
                                       "prepare for war with all."),
                    new TextDefinition(1011454, "This city is controlled by Lord British."),
                    new TextDefinition(1042254, "This sigil has been corrupted by the True Britannians"),
                    new TextDefinition(1041045, "The faction signup stone for the True Britannians"),
                    new TextDefinition(1041383, "The Faction Stone of the True Britannians"),
                    new TextDefinition(1011465, ": True Britannians"),
                    new TextDefinition(1005181, "Followers of Lord British will now be ignored."),
                    new TextDefinition(1005182, "Followers of Lord British will now be warned of their impending doom."),
                    new TextDefinition(1005183, "Followers of Lord British will now be attacked on sight."),
                    new StrongholdDefinition(
                        new Rectangle2D[]
            {
                new Rectangle2D(1292, 1556, 25, 25),
                new Rectangle2D(1292, 1676, 120, 25),
                new Rectangle2D(1388, 1556, 25, 25),
                new Rectangle2D(1317, 1563, 71, 18),
                new Rectangle2D(1300, 1581, 105, 95),
                new Rectangle2D(1405, 1612, 12, 21),
                new Rectangle2D(1405, 1633, 11, 5)
            },
                        new Point3D(1419, 1622, 20),
                        new Point3D(1330, 1621, 50),
                        new Point3D[]
            {
                new Point3D(1328, 1627, 50),
                new Point3D(1328, 1621, 50),
                new Point3D(1334, 1627, 50),
                new Point3D(1334, 1621, 50),
                new Point3D(1340, 1627, 50),
                new Point3D(1340, 1621, 50),
                new Point3D(1345, 1621, 50),
                new Point3D(1345, 1627, 50)
            }),
                    new RankDefinition[]
            {
                new RankDefinition(10, 991, 8, new TextDefinition(1060794, "Knight of the Codex")),
                new RankDefinition(9, 950, 7, new TextDefinition(1060793, "Knight of Virtue")),
                new RankDefinition(8, 900, 6, new TextDefinition(1060792, "Crusader")),
                new RankDefinition(7, 800, 6, new TextDefinition(1060792, "Crusader")),
                new RankDefinition(6, 700, 5, new TextDefinition(1060791, "Sentinel")),
                new RankDefinition(5, 600, 5, new TextDefinition(1060791, "Sentinel")),
                new RankDefinition(4, 500, 5, new TextDefinition(1060791, "Sentinel")),
                new RankDefinition(3, 400, 4, new TextDefinition(1060790, "Defender")),
                new RankDefinition(2, 200, 4, new TextDefinition(1060790, "Defender")),
                new RankDefinition(1, 0, 4, new TextDefinition(1060790, "Defender"))
            },
                    new GuardDefinition[]
            {
                new GuardDefinition(typeof(FactionHenchman), 0x1403, 5000, 1000, 10, new TextDefinition(1011526, "HENCHMAN"), new TextDefinition(1011510, "Hire Henchman")),
                new GuardDefinition(typeof(FactionMercenary), 0x0F62, 6000, 2000, 10, new TextDefinition(1011527, "MERCENARY"), new TextDefinition(1011511, "Hire Mercenary")),
                new GuardDefinition(typeof(FactionKnight), 0x0F4D, 7000, 3000, 10, new TextDefinition(1011528, "KNIGHT"), new TextDefinition(1011497, "Hire Knight")),
                new GuardDefinition(typeof(FactionPaladin), 0x143F, 8000, 4000, 10, new TextDefinition(1011529, "PALADIN"), new TextDefinition(1011498, "Hire Paladin")),
            });
        }
Esempio n. 49
0
        public static void FactionReset_OnCommand(CommandEventArgs e)
        {
            MonolithCollection monoliths = BaseMonolith.Monoliths;

            for (int i = 0; i < monoliths.Count; ++i)
            {
                monoliths[i].Sigil = null;
            }

            TownCollection towns = Town.Towns;

            for (int i = 0; i < towns.Count; ++i)
            {
                towns[i].Silver  = 0;
                towns[i].Sheriff = null;
                towns[i].Finance = null;
                towns[i].Tax     = 0;
                towns[i].Owner   = null;
            }

            SigilCollection sigils = Sigil.Sigils;

            for (int i = 0; i < sigils.Count; ++i)
            {
                sigils[i].Corrupted         = null;
                sigils[i].Corrupting        = null;
                sigils[i].LastStolen        = DateTime.MinValue;
                sigils[i].GraceStart        = DateTime.MinValue;
                sigils[i].CorruptionStart   = DateTime.MinValue;
                sigils[i].PurificationStart = DateTime.MinValue;
                sigils[i].LastMonolith      = null;
                sigils[i].ReturnHome();
            }

            FactionCollection factions = Faction.Factions;

            for (int i = 0; i < factions.Count; ++i)
            {
                Faction f = factions[i];

                ArrayList list = new ArrayList(f.Members);

                for (int j = 0; j < list.Count; ++j)
                {
                    f.RemoveMember(((PlayerState)list[j]).Mobile);
                }

                list = new ArrayList(f.State.FactionItems);

                for (int j = 0; j < list.Count; ++j)
                {
                    FactionItem fi = (FactionItem)list[j];

                    if (fi.Expiration == DateTime.MinValue)
                    {
                        fi.Item.Delete();
                    }
                    else
                    {
                        fi.Detach();
                    }
                }

                list = new ArrayList(f.Traps);

                for (int j = 0; j < list.Count; ++j)
                {
                    ((BaseFactionTrap)list[j]).Delete();
                }
            }
        }
Esempio n. 50
0
        public Minax()
        {
            m_Instance = this;

            Definition =
                new FactionDefinition(
                    0,
                    1645,         // dark red
                    1109,         // shadow
                    1645,         // join stone : dark red
                    1645,         // broadcast : dark red
                    0x78, 0x3EAF, // war horse
                    "Minax", "minax", "Min",
                    new TextDefinition(1011534, "MINAX"),
                    new TextDefinition(1060769, "Minax faction"),
                    new TextDefinition(1011421, "<center>FOLLOWERS OF MINAX</center>"),
                    new TextDefinition(1011448,
                                       "The followers of Minax have taken control in the old lands, " +
                                       "and intend to hold it for as long as they can. Allying themselves " +
                                       "with orcs, headless, gazers, trolls, and other beasts, they seek " +
                                       "revenge against Lord British, for slights both real and imagined, " +
                                       "though some of the followers wish only to wreak havoc on the " +
                                       "unsuspecting populace."),
                    new TextDefinition(1011453, "This city is controlled by Minax."),
                    new TextDefinition(1042252, "This sigil has been corrupted by the Followers of Minax"),
                    new TextDefinition(1041043, "The faction signup stone for the Followers of Minax"),
                    new TextDefinition(1041381, "The Faction Stone of Minax"),
                    new TextDefinition(1011463, ": Minax"),
                    new TextDefinition(1005190, "Followers of Minax will now be ignored."),
                    new TextDefinition(1005191, "Followers of Minax will now be told to go away."),
                    new TextDefinition(1005192, "Followers of Minax will now be hanged by their toes."),
                    new StrongholdDefinition(
                        new Rectangle2D[]
            {
                new Rectangle2D(1097, 2570, 70, 50)
            },
                        new Point3D(1172, 2593, 0),
                        new Point3D(1117, 2587, 18),
                        new Point3D[]
            {
                new Point3D(1113, 2601, 18),
                new Point3D(1113, 2598, 18),
                new Point3D(1113, 2595, 18),
                new Point3D(1113, 2592, 18),
                new Point3D(1116, 2601, 18),
                new Point3D(1116, 2598, 18),
                new Point3D(1116, 2595, 18),
                new Point3D(1116, 2592, 18)
            },
                        new Point3D(1118, 2587, 18)),
                    new RankDefinition[]
            {
                new RankDefinition(10, 991, 8, new TextDefinition(1060784, "Avenger of Mondain")),
                new RankDefinition(9, 950, 7, new TextDefinition(1060783, "Dread Knight")),
                new RankDefinition(8, 900, 6, new TextDefinition(1060782, "Warlord")),
                new RankDefinition(7, 800, 6, new TextDefinition(1060782, "Warlord")),
                new RankDefinition(6, 700, 5, new TextDefinition(1060781, "Executioner")),
                new RankDefinition(5, 600, 5, new TextDefinition(1060781, "Executioner")),
                new RankDefinition(4, 500, 5, new TextDefinition(1060781, "Executioner")),
                new RankDefinition(3, 400, 4, new TextDefinition(1060780, "Defiler")),
                new RankDefinition(2, 200, 4, new TextDefinition(1060780, "Defiler")),
                new RankDefinition(1, 0, 4, new TextDefinition(1060780, "Defiler"))
            },
                    new GuardDefinition[]
            {
                new GuardDefinition(typeof(FactionHenchman), 0x1403, 5000, 1000, 10, new TextDefinition(1011526, "HENCHMAN"), new TextDefinition(1011510, "Hire Henchman")),
                new GuardDefinition(typeof(FactionMercenary), 0x0F62, 6000, 2000, 10, new TextDefinition(1011527, "MERCENARY"), new TextDefinition(1011511, "Hire Mercenary")),
                new GuardDefinition(typeof(FactionBerserker), 0x0F4B, 7000, 3000, 10, new TextDefinition(1011505, "BERSERKER"), new TextDefinition(1011499, "Hire Berserker")),
                new GuardDefinition(typeof(FactionDragoon), 0x1439, 8000, 4000, 10, new TextDefinition(1011506, "DRAGOON"), new TextDefinition(1011500, "Hire Dragoon")),
            });
        }
Esempio n. 51
0
 public BroadcastPrompt(Faction faction)
 {
     m_Faction = faction;
 }
Esempio n. 52
0
 public StrongholdMonolith(Town town, Faction faction)
     : base(town, faction)
 {
 }
Esempio n. 53
0
        private void Sigil_OnTarget(Mobile from, object obj)
        {
            if (Deleted || !IsChildOf(from.Backpack))
            {
                return;
            }

            #region Give To Mobile
            if (obj is Mobile)
            {
                if (obj is PlayerMobile)
                {
                    PlayerMobile targ = (PlayerMobile)obj;

                    Faction toFaction   = Faction.Find(targ);
                    Faction fromFaction = Faction.Find(from);

                    if (toFaction == null)
                    {
                        from.SendLocalizedMessage(1005223);                           // You cannot give the sigil to someone not in a faction
                    }
                    else if (fromFaction != toFaction)
                    {
                        from.SendLocalizedMessage(1005222);                           // You cannot give the sigil to someone not in your faction
                    }
                    else if (Sigil.ExistsOn(targ))
                    {
                        from.SendLocalizedMessage(1005220);                           // You cannot give this sigil to someone who already has a sigil
                    }
                    else if (!targ.Alive)
                    {
                        from.SendLocalizedMessage(1042248);                           // You cannot give a sigil to a dead person.
                    }
                    else if (from.NetState != null && targ.NetState != null)
                    {
                        Container pack = targ.Backpack;

                        if (pack != null)
                        {
                            pack.DropItem(this);
                        }
                    }
                }
                else
                {
                    from.SendLocalizedMessage(1005221);                       //You cannot give the sigil to them
                }
            }
            #endregion
            else if (obj is BaseMonolith)
            {
                #region Put in Stronghold
                if (obj is StrongholdMonolith)
                {
                    StrongholdMonolith m = (StrongholdMonolith)obj;

                    if (m.Faction == null || m.Faction != Faction.Find(from))
                    {
                        from.SendLocalizedMessage(1042246);                           // You can't place that on an enemy monolith
                    }
                    else if (m.Town == null || m.Town != m_Town)
                    {
                        from.SendLocalizedMessage(1042247);                           // That is not the correct faction monolith
                    }
                    else
                    {
                        m.Sigil = this;

                        Faction newController = m.Faction;
                        Faction oldController = m_Corrupting;

                        if (oldController == null)
                        {
                            if (m_Corrupted != newController)
                            {
                                BeginCorrupting(newController);
                            }
                        }
                        else if (m_GraceStart > DateTime.MinValue && (m_GraceStart + CorruptionGrace) < DateTime.Now)
                        {
                            if (m_Corrupted != newController)
                            {
                                BeginCorrupting(newController);                                   // grace time over, reset period
                            }
                            else
                            {
                                ClearCorrupting();
                            }

                            m_GraceStart = DateTime.MinValue;
                        }
                        else if (newController == oldController)
                        {
                            m_GraceStart = DateTime.MinValue;                             // returned within grace period
                        }
                        else if (m_GraceStart == DateTime.MinValue)
                        {
                            m_GraceStart = DateTime.Now;
                        }

                        m_PurificationStart = DateTime.MinValue;
                    }
                }
                #endregion

                #region Put in Town
                else if (obj is TownMonolith)
                {
                    TownMonolith m = (TownMonolith)obj;

                    if (m.Town == null || m.Town != m_Town)
                    {
                        from.SendLocalizedMessage(1042245);                           // This is not the correct town sigil monolith
                    }
                    else if (m_Corrupted == null || m_Corrupted != Faction.Find(from))
                    {
                        from.SendLocalizedMessage(1042244);                           // Your faction did not corrupt this sigil.  Take it to your stronghold.
                    }
                    else
                    {
                        m.Sigil = this;

                        m_Corrupting        = null;
                        m_PurificationStart = DateTime.Now;
                        m_CorruptionStart   = DateTime.MinValue;

                        m_Town.Capture(m_Corrupted);
                        m_Corrupted = null;
                    }
                }
                #endregion
            }
            else
            {
                from.SendLocalizedMessage(1005224);                     //	You can't use the sigil on that
            }

            Update();
        }
Esempio n. 54
0
 public BaseFactionVendor Construct(Town town, Faction faction)
 {
     try { return(Activator.CreateInstance(m_Definition.Type, new object[] { town, faction }) as BaseFactionVendor); }
     catch { return(null); }
 }
Esempio n. 55
0
 public FactionStone(Faction faction) : base(0xEDC)
 {
     Movable = false;
     Faction = faction;
 }
Esempio n. 56
0
        public FactionStoneGump(PlayerMobile from, Faction faction) : base(20, 30)
        {
            m_From    = from;
            m_Faction = faction;

            AddPage(0);

            AddBackground(0, 0, 550, 440, 5054);
            AddBackground(10, 10, 530, 420, 3000);

            #region General
            AddPage(1);

            AddHtmlText(20, 30, 510, 20, faction.Definition.Header, false, false);

            AddHtmlLocalized(20, 60, 100, 20, 1011429, false, false);               // Led By :
            AddHtml(125, 60, 200, 20, faction.Commander != null ? faction.Commander.Name : "Nobody", false, false);

            AddHtmlLocalized(20, 80, 100, 20, 1011457, false, false);               // Tithe rate :
            if (faction.Tithe >= 0 && faction.Tithe <= 100 && (faction.Tithe % 10) == 0)
            {
                AddHtmlLocalized(125, 80, 350, 20, 1011480 + (faction.Tithe / 10), false, false);
            }
            else
            {
                AddHtml(125, 80, 350, 20, faction.Tithe + "%", false, false);
            }

            AddHtmlLocalized(20, 100, 100, 20, 1011458, false, false);               // Traps placed :
            AddHtml(125, 100, 50, 20, faction.Traps.Count.ToString(), false, false);

            AddHtmlLocalized(55, 225, 200, 20, 1011428, false, false);               // VOTE FOR LEADERSHIP
            AddButton(20, 225, 4005, 4007, ToButtonID(0, 0), GumpButtonType.Reply, 0);

            AddHtmlLocalized(55, 150, 100, 20, 1011430, false, false);               // CITY STATUS
            AddButton(20, 150, 4005, 4007, 0, GumpButtonType.Page, 2);

            AddHtmlLocalized(55, 175, 100, 20, 1011444, false, false);               // STATISTICS
            AddButton(20, 175, 4005, 4007, 0, GumpButtonType.Page, 4);

            bool isMerchantQualified = MerchantTitles.HasMerchantQualifications(from);

            PlayerState pl = PlayerState.Find(from);

            if (pl != null && pl.MerchantTitle != MerchantTitle.None)
            {
                AddHtmlLocalized(55, 200, 250, 20, 1011460, false, false);                   // UNDECLARE FACTION MERCHANT
                AddButton(20, 200, 4005, 4007, ToButtonID(1, 0), GumpButtonType.Reply, 0);
            }
            else if (isMerchantQualified)
            {
                AddHtmlLocalized(55, 200, 250, 20, 1011459, false, false);                   // DECLARE FACTION MERCHANT
                AddButton(20, 200, 4005, 4007, 0, GumpButtonType.Page, 5);
            }
            else
            {
                AddHtmlLocalized(55, 200, 250, 20, 1011467, false, false);                   // MERCHANT OPTIONS
                AddImage(20, 200, 4020);
            }

            AddHtmlLocalized(55, 250, 300, 20, 1011461, false, false);               // COMMANDER OPTIONS
            if (faction.IsCommander(from))
            {
                AddButton(20, 250, 4005, 4007, 0, GumpButtonType.Page, 6);
            }
            else
            {
                AddImage(20, 250, 4020);
            }

            AddHtmlLocalized(55, 275, 300, 20, 1011426, false, false);               // LEAVE THIS FACTION
            AddButton(20, 275, 4005, 4007, ToButtonID(0, 1), GumpButtonType.Reply, 0);

            AddHtmlLocalized(55, 300, 200, 20, 1011441, false, false);               // EXIT
            AddButton(20, 300, 4005, 4007, 0, GumpButtonType.Reply, 0);
            #endregion

            #region City Status
            AddPage(2);

            AddHtmlLocalized(20, 30, 250, 20, 1011430, false, false);               // CITY STATUS

            List <Town> towns = Town.Towns;

            for (int i = 0; i < towns.Count; ++i)
            {
                Town town = towns[i];

                AddHtmlText(40, 55 + (i * 30), 150, 20, town.Definition.TownName, false, false);

                if (town.Owner == null)
                {
                    AddHtmlLocalized(200, 55 + (i * 30), 150, 20, 1011462, false, false);                       // : Neutral
                }
                else
                {
                    AddHtmlLocalized(200, 55 + (i * 30), 150, 20, town.Owner.Definition.OwnerLabel, false, false);

                    BaseMonolith monolith = town.Monolith;

                    AddImage(20, 60 + (i * 30), (monolith != null && monolith.Sigil != null && monolith.Sigil.IsPurifying) ? 0x938 : 0x939);
                }
            }


            AddImage(20, 300, 2361);
            AddHtmlLocalized(45, 295, 300, 20, 1011491, false, false);               // sigil may be recaptured

            AddImage(20, 320, 2360);
            AddHtmlLocalized(45, 315, 300, 20, 1011492, false, false);               // sigil may not be recaptured

            AddHtmlLocalized(55, 350, 100, 20, 1011447, false, false);               // BACK
            AddButton(20, 350, 4005, 4007, 0, GumpButtonType.Page, 1);
            #endregion

            #region Statistics
            AddPage(4);

            AddHtmlLocalized(20, 30, 150, 20, 1011444, false, false);               // STATISTICS

            AddHtmlLocalized(20, 100, 100, 20, 1011445, false, false);              // Name :
            AddHtml(120, 100, 150, 20, from.Name, false, false);

            AddHtmlLocalized(20, 130, 100, 20, 1018064, false, false);               // score :
            AddHtml(120, 130, 100, 20, (pl != null ? pl.KillPoints : 0).ToString(), false, false);

            AddHtmlLocalized(20, 160, 100, 20, 1011446, false, false);               // Rank :
            AddHtml(120, 160, 100, 20, (pl != null ? pl.Rank.Rank : 0).ToString(), false, false);

            AddHtmlLocalized(55, 250, 100, 20, 1011447, false, false);               // BACK
            AddButton(20, 250, 4005, 4007, 0, GumpButtonType.Page, 1);
            #endregion

            #region Merchant Options
            if ((pl == null || pl.MerchantTitle == MerchantTitle.None) && isMerchantQualified)
            {
                AddPage(5);

                AddHtmlLocalized(20, 30, 250, 20, 1011467, false, false);                   // MERCHANT OPTIONS

                AddHtmlLocalized(20, 80, 300, 20, 1011473, false, false);                   // Select the title you wish to display

                MerchantTitleInfo[] infos = MerchantTitles.Info;

                for (int i = 0; i < infos.Length; ++i)
                {
                    MerchantTitleInfo info = infos[i];

                    if (MerchantTitles.IsQualified(from, info))
                    {
                        AddButton(20, 100 + (i * 30), 4005, 4007, ToButtonID(1, i + 1), GumpButtonType.Reply, 0);
                    }
                    else
                    {
                        AddImage(20, 100 + (i * 30), 4020);
                    }

                    AddHtmlText(55, 100 + (i * 30), 200, 20, info.Label, false, false);
                }

                AddHtmlLocalized(55, 340, 100, 20, 1011447, false, false);                   // BACK
                AddButton(20, 340, 4005, 4007, 0, GumpButtonType.Page, 1);
            }
            #endregion

            #region Commander Options
            if (faction.IsCommander(from))
            {
                #region General
                AddPage(6);

                AddHtmlLocalized(20, 30, 200, 20, 1011461, false, false);                   // COMMANDER OPTIONS

                AddHtmlLocalized(20, 70, 120, 20, 1011457, false, false);                   // Tithe rate :
                if (faction.Tithe >= 0 && faction.Tithe <= 100 && (faction.Tithe % 10) == 0)
                {
                    AddHtmlLocalized(140, 70, 250, 20, 1011480 + (faction.Tithe / 10), false, false);
                }
                else
                {
                    AddHtml(140, 70, 250, 20, faction.Tithe + "%", false, false);
                }

                AddHtmlLocalized(20, 100, 120, 20, 1011474, false, false);                   // Silver available :
                AddHtml(140, 100, 50, 20, faction.Silver.ToString("N0"), false, false);      // NOTE: Added 'N0' formatting

                AddHtmlLocalized(55, 130, 200, 20, 1011478, false, false);                   // CHANGE TITHE RATE
                AddButton(20, 130, 4005, 4007, 0, GumpButtonType.Page, 8);

                AddHtmlLocalized(55, 160, 200, 20, 1018301, false, false);                   // TRANSFER SILVER
                if (faction.Silver >= 10000)
                {
                    AddButton(20, 160, 4005, 4007, 0, GumpButtonType.Page, 7);
                }
                else
                {
                    AddImage(20, 160, 4020);
                }

                AddHtmlLocalized(55, 310, 100, 20, 1011447, false, false);                   // BACK
                AddButton(20, 310, 4005, 4007, 0, GumpButtonType.Page, 1);
                #endregion

                #region Town Finance
                if (faction.Silver >= 10000)
                {
                    AddPage(7);

                    AddHtmlLocalized(20, 30, 250, 20, 1011476, false, false);                       // TOWN FINANCE

                    AddHtmlLocalized(20, 50, 400, 20, 1011477, false, false);                       // Select a town to transfer 10000 silver to

                    for (int i = 0; i < towns.Count; ++i)
                    {
                        Town town = towns[i];

                        AddHtmlText(55, 75 + (i * 30), 200, 20, town.Definition.TownName, false, false);

                        if (town.Owner == faction)
                        {
                            AddButton(20, 75 + (i * 30), 4005, 4007, ToButtonID(2, i), GumpButtonType.Reply, 0);
                        }
                        else
                        {
                            AddImage(20, 75 + (i * 30), 4020);
                        }
                    }

                    AddHtmlLocalized(55, 310, 100, 20, 1011447, false, false);                       // BACK
                    AddButton(20, 310, 4005, 4007, 0, GumpButtonType.Page, 1);
                }
                #endregion

                #region Change Tithe Rate
                AddPage(8);

                AddHtmlLocalized(20, 30, 400, 20, 1011479, false, false);                   // Select the % for the new tithe rate

                int y = 55;

                for (int i = 0; i <= 10; ++i)
                {
                    if (i == 5)
                    {
                        y += 5;
                    }

                    AddHtmlLocalized(55, y, 300, 20, 1011480 + i, false, false);
                    AddButton(20, y, 4005, 4007, ToButtonID(3, i), GumpButtonType.Reply, 0);

                    y += 20;

                    if (i == 5)
                    {
                        y += 5;
                    }
                }

                AddHtmlLocalized(55, 310, 300, 20, 1011447, false, false);                   // BACK
                AddButton(20, 310, 4005, 4007, 0, GumpButtonType.Page, 1);
                #endregion
            }
            #endregion
        }
Esempio n. 57
0
 public FactionOreVendor(Town town, Faction faction) : base(town, faction, "the Ore Man")
 {
     // NOTE: Skills verified
     SetSkill(SkillName.Carpentry, 85.0, 100.0);
     SetSkill(SkillName.Lumberjacking, 60.0, 83.0);
 }
Esempio n. 58
0
        public SheriffGump(PlayerMobile from, Faction faction, Town town) : base(50, 50)
        {
            m_From    = from;
            m_Faction = faction;
            m_Town    = town;


            AddPage(0);

            AddBackground(0, 0, 320, 410, 5054);
            AddBackground(10, 10, 300, 390, 3000);

            #region General
            AddPage(1);

            AddHtmlLocalized(20, 30, 260, 25, 1011431, false, false);               // Sheriff

            AddHtmlLocalized(55, 90, 200, 25, 1011494, false, false);               // HIRE GUARDS
            AddButton(20, 90, 4005, 4007, 0, GumpButtonType.Page, 3);

            AddHtmlLocalized(55, 120, 200, 25, 1011495, false, false);               // VIEW FINANCES
            AddButton(20, 120, 4005, 4007, 0, GumpButtonType.Page, 2);

            AddHtmlLocalized(55, 360, 200, 25, 1011441, false, false);               // Exit
            AddButton(20, 360, 4005, 4007, 0, GumpButtonType.Reply, 0);
            #endregion

            #region Finances
            AddPage(2);

            int financeUpkeep = town.FinanceUpkeep;
            int sheriffUpkeep = town.SheriffUpkeep;
            int dailyIncome   = town.DailyIncome;
            int netCashFlow   = town.NetCashFlow;

            AddHtmlLocalized(20, 30, 300, 25, 1011524, false, false);            // FINANCE STATEMENT

            AddHtmlLocalized(20, 80, 300, 25, 1011538, false, false);            // Current total money for town :
            AddLabel(20, 100, 0x44, town.Silver.ToString("N0"));                 // NOTE: Added 'N0'

            AddHtmlLocalized(20, 130, 300, 25, 1011520, false, false);           // Finance Minister Upkeep :
            AddLabel(20, 150, 0x44, financeUpkeep.ToString("N0"));               // NOTE: Added 'N0'

            AddHtmlLocalized(20, 180, 300, 25, 1011521, false, false);           // Sheriff Upkeep :
            AddLabel(20, 200, 0x44, sheriffUpkeep.ToString("N0"));               // NOTE: Added 'N0'

            AddHtmlLocalized(20, 230, 300, 25, 1011522, false, false);           // Town Income :
            AddLabel(20, 250, 0x44, dailyIncome.ToString("N0"));                 // NOTE: Added 'N0'

            AddHtmlLocalized(20, 280, 300, 25, 1011523, false, false);           // Net Cash flow per day :
            AddLabel(20, 300, 0x44, netCashFlow.ToString("N0"));                 // NOTE: Added 'N0'

            AddHtmlLocalized(55, 360, 200, 25, 1011067, false, false);           // Previous page
            AddButton(20, 360, 4005, 4007, 0, GumpButtonType.Page, 1);
            #endregion

            #region Hire Guards
            AddPage(3);

            AddHtmlLocalized(20, 30, 300, 25, 1011494, false, false);               // HIRE GUARDS

            GuardListCollection guardLists = town.GuardLists;

            for (int i = 0; i < guardLists.Count; ++i)
            {
                GuardList guardList = guardLists[i];
                int       y         = 90 + (i * 60);

                AddButton(20, y, 4005, 4007, 0, GumpButtonType.Page, 4 + i);
                CenterItem(guardList.Definition.ItemID, 50, y - 20, 70, 60);
                AddHtmlText(120, y, 200, 25, guardList.Definition.Header, false, false);
            }

            AddHtmlLocalized(55, 360, 200, 25, 1011067, false, false);               // Previous page
            AddButton(20, 360, 4005, 4007, 0, GumpButtonType.Page, 1);
            #endregion

            #region Guard Pages
            for (int i = 0; i < guardLists.Count; ++i)
            {
                GuardList guardList = guardLists[i];

                AddPage(4 + i);

                AddHtmlText(90, 30, 300, 25, guardList.Definition.Header, false, false);
                CenterItem(guardList.Definition.ItemID, 10, 10, 80, 80);

                AddHtmlLocalized(20, 90, 200, 25, 1011514, false, false);                   // You have :
                AddLabel(230, 90, 0x26, guardList.Guards.Count.ToString());

                AddHtmlLocalized(20, 120, 200, 25, 1011515, false, false);                   // Maximum :
                AddLabel(230, 120, 0x12A, guardList.Definition.Maximum.ToString());

                AddHtmlLocalized(20, 150, 200, 25, 1011516, false, false);                // Cost :
                AddLabel(230, 150, 0x44, guardList.Definition.Price.ToString("N0"));      // NOTE: Added 'N0'

                AddHtmlLocalized(20, 180, 200, 25, 1011517, false, false);                // Daily Pay :
                AddLabel(230, 180, 0x37, guardList.Definition.Upkeep.ToString("N0"));     // NOTE: Added 'N0'

                AddHtmlLocalized(20, 210, 200, 25, 1011518, false, false);                // Current Silver :
                AddLabel(230, 210, 0x44, town.Silver.ToString("N0"));                     // NOTE: Added 'N0'

                AddHtmlLocalized(20, 240, 200, 25, 1011519, false, false);                // Current Payroll :
                AddLabel(230, 240, 0x44, sheriffUpkeep.ToString("N0"));                   // NOTE: Added 'N0'

                AddHtmlText(55, 300, 200, 25, guardList.Definition.Label, false, false);
                AddButton(20, 300, 4005, 4007, 1 + i, GumpButtonType.Reply, 0);

                AddHtmlLocalized(55, 360, 200, 25, 1011067, false, false);                   // Previous page
                AddButton(20, 360, 4005, 4007, 0, GumpButtonType.Page, 3);
            }
            #endregion
        }
Esempio n. 59
0
 public FactionExplosionTrap(Faction f)
     : this(f, null)
 {
 }