Пример #1
0
        public EditNewsGump(TownCrierb crier, TownCrierStone stone) : base(10, 10)
        {
            m_Stone = stone;
            m_Crier = crier;

            AddPage(0);
            AddImageTiled(0, 0, 620, 460, 0x52);
            AddAlphaRegion(1, 1, 618, 458);

            AddLabel(250, 12, 2100, "Edit TownCrier News");
            AddLabel(10, 34, 2100, "News Entries");

            ArrayList m_Lines = GetFile();

            int row = 1;

            for (int i = 0; i < 15; i++)
            {
                string line = m_Lines[i] as string;

                AddImageTiled(10, 34 + (row * 22), 598, 20, 0xBBC);
                AddImageTiled(11, 34 + (row * 22) + 1, 596, 18, 0x2426);
                AddTextEntry(11, 34 + (row++ *22) + 1, 596, 18, 0x480, i, line);
            }

            AddLabel(500, 408, 2100, "Update File");
            AddButton(576, 408, 4005, 4007, 1, GumpButtonType.Reply, 0);
        }
Пример #2
0
        public virtual void OnActivate()
        {
            TownCrierStone stone = Stone as TownCrierStone;
            TimeSpan       delay;

            if (m_Timer != null)
            {
                m_Timer.Stop();
                m_Timer = null;
            }

            if (m_Timer == null)
            {
                if (!Custom && (stone != null) && stone.Active)
                {
                    delay   = stone.Delay;
                    m_Timer = new SpamTimer(this, delay);
                    m_Timer.Start();
                }
                else if (Active)
                {
                    delay   = Delay;
                    m_Timer = new SpamTimer(this, delay);
                    m_Timer.Start();
                }
            }
        }
Пример #3
0
        public override void OnDelete()
        {
            TownCrierStone stone = m_Stone as TownCrierStone;

            if (stone != null)
            {
                TownCrierb m_Crier = this as TownCrierb;
                stone.Registry.Remove(m_Crier);
            }
            base.OnDelete();
        }
Пример #4
0
        public TownCrierb() : base(AIType.AI_Thief, FightMode.None, 10, 1, 0.8, 1.6)
        {
            InitStats(100, 100, 25);

            Title         = "the town crier";
            Name          = NameList.RandomName("female");
            Female        = true;
            Body          = 0x191;
            Hue           = Utility.RandomSkinHue();
            NameHue       = 0x35;
            m_Stone       = null;
            m_StoneActive = false;
            m_Active      = false;
            m_Custom      = false;
            m_Random      = false;
            m_Delay       = new TimeSpan(0, 0, 10);
            this.Blessed  = true;

            AddItem(new FancyShirt(Utility.RandomBlueHue()));

            Item skirt;

            switch (Utility.Random(2))
            {
            case 0: skirt = new Skirt(); break;

            default:
            case 1: skirt = new Kilt(); break;
            }

            skirt.Hue = Utility.RandomGreenHue();

            AddItem(skirt);

            AddItem(new FeatheredHat(Utility.RandomGreenHue()));

            Item boots;

            switch (Utility.Random(2))
            {
            case 0: boots = new Boots(); break;

            default:
            case 1: boots = new ThighBoots(); break;
            }

            AddItem(boots);

            HairItemID = 0x203C;               // Long hair
            HairHue    = 1175;
        }
Пример #5
0
        public RangeHomeGump(TownCrierStone stone, TownCrierb crier) : base(50, 50)
        {
            m_Stone = stone;
            m_Crier = crier;
            AddPage(0);
            AddImageTiled(0, 0, 202, 52, 0x52);
            AddAlphaRegion(1, 1, 200, 50);

            string range = Convert.ToString(m_Crier.RangeHome);

            AddLabel(20, 2, 2100, "Set TownCrierb's RangeHome");
            AddButton(10, 24, 4005, 4007, 1, GumpButtonType.Reply, 0);
            AddImageTiled(50, 24, 140, 20, 0xBBC);
            AddImageTiled(51, 25, 138, 18, 0x2426);
            AddTextEntry(51, 25, 138, 18, 0x480, 0, range);
        }
Пример #6
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
            case 0:
            {
                m_Custom    = reader.ReadBool();
                m_Random    = reader.ReadBool();
                m_Delay     = reader.ReadTimeSpan();
                this.Frozen = reader.ReadBool();
                m_Stone     = reader.ReadItem() as TownCrierStone;
                m_Active    = reader.ReadBool();

                break;
            }
            }
        }
Пример #7
0
 public MakeCrierTarget(TownCrierStone stone, bool wondering) : base(-1, true, TargetFlags.None)
 {
     m_Stone     = stone;
     m_Wondering = wondering;
 }
Пример #8
0
        public TownCrierbGump(TownCrierStone stone, TownCrierb crier) : base(50, 50)
        {
            m_Stone = stone;
            m_Crier = crier;

            AddPage(0);
            AddImageTiled(0, 0, 410, 144, 0x52);
            AddAlphaRegion(1, 1, 408, 142);

            if (m_Stone == null)
            {
                AddLabel(160, 12, 2100, "TownCrier Controls");

                string custom = Convert.ToString(m_Crier.Custom);
                AddButton(10, 34, 4005, 4007, 1, GumpButtonType.Reply, 0);
                AddLabel(50, 34, 2100, "Custom = " + custom);

                string active = Convert.ToString(m_Crier.Active);
                AddButton(10, 56, 4005, 4007, 2, GumpButtonType.Reply, 0);
                AddLabel(50, 56, 2100, "Active = " + active);

                string random = Convert.ToString(m_Crier.Random);
                AddButton(200, 34, 4005, 4007, 3, GumpButtonType.Reply, 0);
                AddLabel(240, 34, 2100, "Random = " + random);

                string delay = Convert.ToString(m_Crier.Delay);
                AddButton(200, 56, 4005, 4007, 4, GumpButtonType.Reply, 0);
                AddImageTiled(240, 56, 70, 20, 0xBBC);
                AddImageTiled(241, 57, 68, 18, 0x2426);
                AddTextEntry(241, 57, 68, 18, 0x480, 0, delay);
                AddLabel(315, 56, 2100, "Delay");

                AddButton(10, 78, 4005, 4007, 5, GumpButtonType.Reply, 0);
                AddLabel(50, 78, 2100, "Edit News");

                if (crier.Stone == null)
                {
                    AddButton(200, 78, 4005, 4007, 6, GumpButtonType.Reply, 0);
                    AddLabel(240, 78, 2100, "Control Stone = null");
                }
            }
            else
            {
                AddLabel(140, 12, 2100, "TownCrier Gobal Controls");

                string active = Convert.ToString(m_Stone.Active);
                AddButton(10, 34, 4005, 4007, 7, GumpButtonType.Reply, 0);
                AddLabel(50, 34, 2100, "Active = " + active);

                string random = Convert.ToString(m_Stone.Random);
                AddButton(10, 56, 4005, 4007, 8, GumpButtonType.Reply, 0);
                AddLabel(50, 56, 2100, "Random = " + random);

                string delay = Convert.ToString(m_Stone.Delay);
                AddButton(200, 34, 4005, 4007, 9, GumpButtonType.Reply, 0);
                AddImageTiled(240, 34, 70, 20, 0xBBC);
                AddImageTiled(241, 35, 68, 18, 0x2426);
                AddTextEntry(241, 35, 68, 18, 0x480, 0, delay);
                AddLabel(315, 34, 2100, "Delay");

                AddButton(200, 56, 4005, 4007, 10, GumpButtonType.Reply, 0);
                AddLabel(240, 56, 2100, "Edit News");

                AddButton(10, 78, 4005, 4007, 11, GumpButtonType.Reply, 0);
                AddLabel(50, 78, 2100, "Give Control Gem");

                AddButton(200, 78, 4005, 4007, 12, GumpButtonType.Reply, 0);
                AddLabel(240, 78, 2100, "Place TownCrier ( Frozen )");

                AddButton(10, 100, 4005, 4007, 13, GumpButtonType.Reply, 0);
                AddLabel(50, 100, 2100, "Place TownCrier ( Wondering )");
            }
        }