예제 #1
0
        public SetChestLocations(BaseTreasureChest Chest)
            : base(550, 30)
        {
            m_Chest = Chest;

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

            AddPage(0);
            AddBackground(29, 20, 239, 369, 9270);
            AddAlphaRegion(40, 30, 216, 347);
            AddBackground(42, 31, 212, 26, 5120);
            AddLabel(80, 34, 50, @"Éditeur de locations");

            AddLabel(132, 355, 2052, @"Ajouter");
            AddButton(110, 359, 1209, 1210, 1, GumpButtonType.Reply, 0);

            if (m_Chest.m_TreasureLocations == null)
            {
                m_Chest.m_TreasureLocations = new ArrayList();
            }

            try
            {
                for (int i = 0; i < m_Chest.m_TreasureLocations.Count; i++)
                {
                    Point3D point = (Point3D)m_Chest.m_TreasureLocations[i];

                    int index = i % 15;

                    if (index == 0)
                    {
                        if (i > 0)
                        {
                            AddButton(234, 360, 2224, 2224, 0, GumpButtonType.Page, i / 15 + 1);
                        }

                        AddPage(i / 15 + 1);

                        if (i > 0)
                        {
                            AddButton(44, 360, 2223, 2223, 0, GumpButtonType.Page, i / 15);
                        }
                    }

                    AddButton(49, 64 + (index * 20), 2223, 2223, i + 2, GumpButtonType.Reply, 0);
                    AddLabel(69, 60 + (index * 20), 2052, point.ToString());
                }
            }
            catch
            {
            }
        }
예제 #2
0
 protected override void OnTarget(Mobile from, object targeted)
 {
     if (targeted is BaseTreasureChest)
     {
         BaseTreasureChest targ = (BaseTreasureChest)targeted;
         targ.Reset(true, false);
     }
     else
     {
         from.SendMessage(256, "Il faut cliquer sur un coffre au trésor !");
     }
 }
예제 #3
0
        protected override void OnTarget(Mobile from, object targeted)
        {
            if (targeted is BaseTreasureChest)
            {
                BaseTreasureChest targ = (BaseTreasureChest)targeted;

                from.SendGump(new SetChestInfo(targ));
                from.SendGump(new SetChestLocations(targ));
            }
            else
            {
                from.SendMessage(256, "Il faut cliquer sur un coffre au trésor !");
            }
        }
예제 #4
0
 public static void FixTreasure(BaseTreasureChest chest)
 {
     if (chest.Level == TreasureLevel.Level2)               //Fix based on skill
     {
         if (chest.MaxLockLevel == 250)
         {
             chest.Level = TreasureLevel.Level8;
         }
         else if (chest.MaxLockLevel == 200)
         {
             chest.Level = TreasureLevel.Level7;
         }
         else if (chest.MaxLockLevel == 150)
         {
             chest.Level = TreasureLevel.Level6;
         }
         else if (chest.MaxLockLevel == 135)
         {
             chest.Level = TreasureLevel.Level5;
         }
         else if (chest.MaxLockLevel == 125)
         {
             chest.Level = TreasureLevel.Level4;
         }
         else if (chest.MaxLockLevel == 105)
         {
             chest.Level = TreasureLevel.Level3;
         }
         else if (chest.MaxLockLevel == 85)
         {
             chest.Level = TreasureLevel.Level2;
         }
         else if (chest.MaxLockLevel == 65)
         {
             chest.Level = TreasureLevel.Level1;
         }
     }
 }
예제 #5
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (from.Region is UOACZRegion)
                {
                    if (targeted is UOACZScavengeContainer || targeted is UOACZScavengeDebris)
                    {
                        UOACZBaseScavengeObject scavengeObject = targeted as UOACZBaseScavengeObject;

                        scavengeObject.RemoveTrap(from);
                    }

                    else
                    {
                        from.SendMessage("That cannot be trapped.");
                    }

                    return;
                }

                if (targeted is Mobile)
                {
                    from.SendLocalizedMessage(502816);                       // You feel that such an action would be inappropriate
                }
                else if (targeted is TrapableContainer)
                {
                    TrapableContainer targ = (TrapableContainer)targeted;

                    from.Direction = from.GetDirectionTo(targ);

                    if (targ.TrapType == TrapType.None)
                    {
                        from.SendLocalizedMessage(502373);                           // That doesn't appear to be trapped
                        return;
                    }

                    from.PlaySound(0x4D3); //0x241

                    if (targ is BaseTreasureChest)
                    {
                        BaseTreasureChest tchest = targ as BaseTreasureChest;

                        double minSkill = 35.0 + ((int)tchest.Level * 10.0); // 45, 55, 65, 75, 85, 95
                        double maxSkill = 60.0 + ((int)tchest.Level * 10.0); // 70, 80, 90, 100, 110, 120

                        // chance to open l5 at gm: 60%
                        // chance to open l6 at gm: 20%

                        if (from.Skills.RemoveTrap.Value < minSkill && (int)tchest.Level == 1)
                        {
                            from.NextSkillTime = Core.TickCount + (int)(SkillCooldown.RemoveTrapCooldown * 1000);

                            from.CheckTargetSkill(SkillName.RemoveTrap, targ, 0, 100, 1.0);
                            from.SendMessage("You fail to safely remove the trap.");

                            return;
                        }

                        else if (from.Skills.RemoveTrap.Value < minSkill)
                        {
                            from.SendMessage("You do not have sufficient skill to attempt the removal of that trap.");
                            return;
                        }

                        from.NextSkillTime = Core.TickCount + (int)(SkillCooldown.RemoveTrapCooldown * 1000);

                        if (from.CheckTargetSkill(SkillName.RemoveTrap, targ, minSkill, maxSkill, 1.0))
                        {
                            RemoveTrap(from, targ);
                        }

                        else
                        {
                            from.SendLocalizedMessage(502372);                           // You fail to disarm the trap... but you don't set it off
                        }
                    }


                    else if (targ is TreasureMapChest)
                    {
                        TreasureMapChest tchest = targ as TreasureMapChest;

                        double minSkill = TreasureMapChest.RemoveTrapSkillRequiredPerLevel[tchest.Level];
                        double maxSkill = TreasureMapChest.RemoveTrapSkillMaxPerLevel[tchest.Level];

                        if (from.Skills.RemoveTrap.Value < minSkill)
                        {
                            from.SendMessage("You do not have sufficient skill to attempt the removal of that trap.");
                            return;
                        }

                        from.NextSkillTime = Core.TickCount + (int)(SkillCooldown.RemoveTrapCooldown * 1000);

                        if (from.CheckTargetSkill(SkillName.RemoveTrap, targ, minSkill, maxSkill, 1.0))
                        {
                            RemoveTrap(from, targ);
                        }

                        else
                        {
                            from.SendLocalizedMessage(502372);                           // You fail to disarm the trap... but you don't set it off
                        }
                    }

                    else if (from.CheckTargetSkill(SkillName.RemoveTrap, targ, targ.TrapPower, targ.TrapPower + 40, 1.0))
                    {
                        RemoveTrap(from, targ);
                        from.NextSkillTime = Core.TickCount + (int)(SkillCooldown.RemoveTrapCooldown * 1000);
                    }

                    else
                    {
                        from.SendLocalizedMessage(502372); // You fail to disarm the trap... but you don't set it off
                        from.NextSkillTime = Core.TickCount + (int)(SkillCooldown.RemoveTrapCooldown * 1000);
                    }
                }

                else
                {
                    from.SendLocalizedMessage(502373);                       // That does'nt appear to be trapped
                }
            }
예제 #6
0
 public AddChestLocationTarget(BaseTreasureChest Chest)
     : base(-1, true, TargetFlags.None)
 {
     m_Chest = Chest;
 }
예제 #7
0
        public SetChestInfo(BaseTreasureChest Chest)
            : base(30, 30)
        {
            m_Chest          = Chest;
            m_StartTrapLevel = Chest.TrapPower;
            m_StartLockLevel = Chest.LockLevel;
            m_StartDelay     = Chest.Delay;

            m_StartGold         = Chest.GoldQuantity;
            m_StartFood         = Chest.FoodQuantity;
            m_StartJunk         = Chest.JunkQuantity;
            m_StartPlate        = Chest.PlateARQuantity;
            m_StartRegs         = Chest.RegsQuantity;
            m_StartChain        = Chest.ChainARQuantity;
            m_StartNecroRegs    = Chest.NecroRegsQuantity;
            m_StartUtility      = Chest.UtilityQuantity;
            m_StartRingAR       = Chest.RingARQuantity;
            m_StartSpecialItems = Chest.SpecialItemsQuantity;
            m_StartScrolls      = Chest.ScrollsQuantity;

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

            AddBackground(29, 20, 239, 392, 9270);
            AddBackground(39, 57, 217, 345, 3500);
            AddBackground(42, 31, 212, 26, 5120);
            AddLabel(85, 33, 50, @"Éditeur d'informations");

            AddLabel(127, 352, 0, @"Sauvegarder");
            AddButton(110, 352, 1209, 1210, 1, GumpButtonType.Reply, 0);

            AddLabel(55, 75, 0, "Lock Level : ");
            AddTextEntry(135, 75, 120, 20, 0, 1, Chest.LockLevelSeed.ToString());

            AddLabel(55, 95, 0, "Delay : ");
            AddTextEntry(135, 95, 120, 20, 0, 2, Chest.Delay.ToString());

            AddLabel(55, 115, 0, "Gold : ");
            AddTextEntry(135, 115, 120, 20, 0, 3, m_StartGold.ToString());

            AddLabel(55, 155, 0, "Food : ");
            AddTextEntry(135, 155, 120, 20, 0, 4, m_StartFood.ToString());

            AddLabel(55, 135, 0, "Junk : ");
            AddTextEntry(135, 135, 120, 20, 0, 5, m_StartJunk.ToString());

            AddLabel(55, 175, 0, "Regs : ");
            AddTextEntry(135, 175, 120, 20, 0, 6, m_StartRegs.ToString());

            AddLabel(55, 215, 0, "Utility : ");
            AddTextEntry(135, 215, 120, 20, 0, 7, m_StartUtility.ToString());

            AddLabel(55, 235, 0, "Scrolls : ");
            AddTextEntry(135, 235, 120, 20, 0, 8, m_StartScrolls.ToString());

            AddLabel(55, 195, 0, "NecroRegs : ");
            AddTextEntry(135, 195, 120, 20, 0, 9, m_StartNecroRegs.ToString());

            AddLabel(55, 255, 0, "SpecialItems : ");
            AddTextEntry(135, 255, 120, 20, 0, 10, m_StartSpecialItems.ToString());

            AddLabel(55, 275, 0, "Sac Item");
            AddButton(135, 275, 1209, 1210, 2, GumpButtonType.Reply, 0);
        }