Пример #1
0
        public MonsterContractGump(Mobile from, MonsterContract parentMC) : base(0, 0)
        {
            if (from != null)
            {
                from.CloseGump(typeof(MonsterContractGump));
            }

            if (parentMC != null)
            {
                MCparent = parentMC;

                this.Closable   = true;
                this.Disposable = true;
                this.Dragable   = true;
                this.Resizable  = false;

                this.AddPage(0);
                this.AddBackground(0, 0, 300, 170, 5170);
                this.AddLabel(40, 40, 0, @"Contract For: " + parentMC.AmountToKill + " " + MonsterContractType.Get[parentMC.Monster].Name);
                this.AddLabel(40, 60, 0, @"Quantity Killed: " + parentMC.AmountKilled);
                this.AddLabel(40, 80, 0, @"Reward: " + parentMC.Reward);
                if (parentMC.AmountKilled != parentMC.AmountToKill)
                {
                    this.AddButton(90, 110, 2061, 2062, 1, GumpButtonType.Reply, 0);
                    this.AddLabel(104, 108, 0, @"Corpse");
                }
                else
                {
                    this.AddButton(90, 110, 2061, 2062, 2, GumpButtonType.Reply, 0);
                    this.AddLabel(104, 108, 0, @"Reward");
                }
            }
        }
        public override void OnResponse(NetState state, RelayInfo info)
        {
            if (info.ButtonID > 0)
            {
                if (info.ButtonID >= 200)                 // Add Corpse
                {
                    m.SendMessage("Choose the corpse to add.");
                    m.Target = new MonsterCorpseBookTarget(b, info.ButtonID % 100);
                }
                else if (info.ButtonID >= 100)                   // One removes the deed book.
                {
                    MonsterContractEntry MCE = b.Entries[info.ButtonID % 100] as MonsterContractEntry;
                    MonsterContract      MC  = new MonsterContract(MCE.Monster, MCE.AmountKilled, MCE.AmountToKill, MCE.Reward);
                    m.AddToBackpack(MC);
                    b.Entries.RemoveAt(info.ButtonID % 100);
                }

                m.SendGump(new MonsterContractBookGump((PlayerMobile)m, b));                     //#01
            }
        }
Пример #3
0
 public MonsterCorpseTarget(MonsterContract parentMC) : base(-1, true, TargetFlags.None)
 {
     MCparent = parentMC;
 }