Exemple #1
0
        public static void Initialize()
        {
            try
            {
                StringList = new Ultima.StringList("enu");
            }
            catch (Exception e) { Server.Diagnostics.ExceptionLogging.LogException(e); }

            CommandSystem.Register("GetOPLString", AccessLevel.Administrator, e =>
            {
                e.Mobile.BeginTarget(-1, false, TargetFlags.None, (m, targeted) =>
                {
                    if (targeted is Item)
                    {
                        Console.WriteLine(GetItemName((Item)targeted));
                        e.Mobile.SendMessage(GetItemName((Item)targeted));
                    }
                });
            });

            Categories = new List <SearchCategory>();

            if (Contexts == null)
            {
                Contexts = new Dictionary <PlayerMobile, SearchCriteria>();
            }

            Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
            {
                SearchCategory price = new SearchCategory(Category.PriceRange);
                Categories.Add(price);

                SearchCriteriaCategory.AllCategories.ToList().ForEach(x =>
                {
                    SearchCategory cat = new SearchCategory(x.Category);

                    x.Criteria.ToList().ForEach(y =>
                    {
                        if (y.PropCliloc != 0)
                        {
                            cat.Register(y.Object, y.Cliloc, y.PropCliloc);
                        }
                        else
                        {
                            cat.Register(y.Object, y.Cliloc);
                        }
                    });

                    Categories.Add(cat);
                });

                SearchCategory sort = new SearchCategory(Category.Sort);
                Categories.Add(sort);
            });

            Keywords = new Dictionary <string, Type>();

            Keywords["power scroll"] = typeof(PowerScroll);
            Keywords["stat scroll"]  = typeof(StatCapScroll);
        }
Exemple #2
0
        public static void Initialize()
        {
            try
            {
                StringList = new Ultima.StringList("enu");
            }
            catch { }

            CommandSystem.Register("GetOPLString", AccessLevel.Administrator, e =>
            {
                e.Mobile.BeginTarget(-1, false, TargetFlags.None, (m, targeted) =>
                {
                    if (targeted is Item)
                    {
                        Console.WriteLine(GetItemName((Item)targeted));
                        e.Mobile.SendMessage(GetItemName((Item)targeted));
                    }
                });
            });

            Categories = new List <SearchCategory>();
            Contexts   = new Dictionary <PlayerMobile, SearchCriteria>();

            Timer.DelayCall(TimeSpan.FromSeconds(1), () =>
            {
                SearchCategory price         = new SearchCategory(Category.PriceRange);
                SearchCategory equipment     = new SearchCategory(Category.Equipment);
                SearchCategory misc          = new SearchCategory(Category.Misc);
                SearchCategory combat        = new SearchCategory(Category.Combat);
                SearchCategory casting       = new SearchCategory(Category.Casting);
                SearchCategory damagetype    = new SearchCategory(Category.DamageType);
                SearchCategory hitspell      = new SearchCategory(Category.HitSpell);
                SearchCategory hitarea       = new SearchCategory(Category.HitArea);
                SearchCategory resists       = new SearchCategory(Category.Resists);
                SearchCategory stats         = new SearchCategory(Category.Stats);
                SearchCategory slayer1       = new SearchCategory(Category.Slayer1);
                SearchCategory slayer2       = new SearchCategory(Category.Slayer2);
                SearchCategory slayer3       = new SearchCategory(Category.Slayer3);
                SearchCategory requiredskill = new SearchCategory(Category.RequiredSkill);
                SearchCategory skill1        = new SearchCategory(Category.Skill1);
                SearchCategory skill2        = new SearchCategory(Category.Skill2);
                SearchCategory skill3        = new SearchCategory(Category.Skill3);
                SearchCategory skill4        = new SearchCategory(Category.Skill4);
                SearchCategory skill5        = new SearchCategory(Category.Skill5);
                SearchCategory skill6        = new SearchCategory(Category.Skill6);
                SearchCategory sort          = new SearchCategory(Category.Sort);

                object[] enums = new object[15];
                int[] labels   = new int[15];
                int index      = 0;

                foreach (int i in Enum.GetValues(typeof(Misc)))
                {
                    enums[index]  = (Misc)i;
                    labels[index] = i;
                    index++;
                }

                misc.Register(enums, labels);
                misc.Register(new object[] { AosAttribute.EnhancePotions, AosArmorAttribute.LowerStatReq, AosAttribute.Luck, AosAttribute.ReflectPhysical, AosArmorAttribute.SelfRepair });
                misc.Register(new object[] { "ArtifactRarity" }, new int[] { 1154693 });

                equipment.Register(new object[] { Layer.Shoes, Layer.Pants, Layer.Shirt, Layer.Helm, Layer.Gloves, Layer.Ring, Layer.Talisman, Layer.Neck, Layer.Waist, Layer.InnerTorso,
                                                  Layer.Bracelet, Layer.MiddleTorso, Layer.Earrings, Layer.Arms, Layer.Cloak, Layer.OuterTorso, Layer.OuterLegs },
                                   new int[] { 1154602, 1154603, 1154604, 1154605, 1154606, 1154607, 1154608, 1154609, 1154611, 1154612, 1154613, 1154616, 1154617, 1154618, 1154619, 1154621, 1154622 });

                combat.Register(new object[] { AosAttribute.WeaponDamage, AosAttribute.DefendChance, AosAttribute.AttackChance, AosAttribute.WeaponSpeed, AosArmorAttribute.SoulCharge,
                                               AosWeaponAttribute.UseBestSkill, AosWeaponAttribute.ReactiveParalyze, /*TODO: Assassin Honed*/ "SearingWeapon", AosWeaponAttribute.BloodDrinker, AosWeaponAttribute.BattleLust,
                                               AosAttribute.BalancedWeapon, SAAbsorptionAttribute.CastingFocus, SAAbsorptionAttribute.EaterFire, SAAbsorptionAttribute.EaterCold,
                                               SAAbsorptionAttribute.EaterPoison, SAAbsorptionAttribute.EaterEnergy, SAAbsorptionAttribute.EaterDamage });

                casting.Register(new object[] { SAAbsorptionAttribute.ResonanceFire, SAAbsorptionAttribute.ResonanceCold, SAAbsorptionAttribute.ResonancePoison, SAAbsorptionAttribute.ResonanceEnergy,
                                                SAAbsorptionAttribute.ResonanceKinetic, AosAttribute.SpellDamage, SAAbsorptionAttribute.CastingFocus, AosAttribute.CastRecovery, AosAttribute.CastSpeed,
                                                AosAttribute.LowerManaCost, AosAttribute.LowerRegCost, AosWeaponAttribute.MageWeapon, AosArmorAttribute.MageArmor, AosAttribute.SpellChanneling });

                damagetype.Register(new object[] { AosElementAttribute.Physical, AosElementAttribute.Fire, AosElementAttribute.Cold, AosElementAttribute.Poison, AosElementAttribute.Energy },
                                    new int[] { 1151800, 1151801, 1151802, 1151803, 1151804 });

                hitspell.Register(new object[] { AosWeaponAttribute.HitDispel, AosWeaponAttribute.HitFireball, AosWeaponAttribute.HitHarm, AosWeaponAttribute.HitCurse, AosWeaponAttribute.HitLeechHits,
                                                 AosWeaponAttribute.HitLightning, "WeaponVelocity", AosWeaponAttribute.HitLowerAttack, AosWeaponAttribute.HitLowerDefend, AosWeaponAttribute.HitMagicArrow,
                                                 AosWeaponAttribute.HitLeechMana, AosWeaponAttribute.HitLeechStam, AosWeaponAttribute.HitFatigue, AosWeaponAttribute.HitManaDrain, AosWeaponAttribute.SplinteringWeapon /*TODO: Bane*/ });

                hitarea.Register(new object[] { AosWeaponAttribute.HitColdArea, AosWeaponAttribute.HitEnergyArea, AosWeaponAttribute.HitFireArea, AosWeaponAttribute.HitPhysicalArea, AosWeaponAttribute.HitPoisonArea });

                resists.Register(new object[] { AosElementAttribute.Physical, AosElementAttribute.Fire, AosElementAttribute.Cold, AosElementAttribute.Poison, AosElementAttribute.Energy });

                stats.Register(new object[] { AosAttribute.BonusStr, AosAttribute.BonusDex, AosAttribute.BonusInt, AosAttribute.BonusHits, AosAttribute.BonusStam, AosAttribute.BonusMana, AosAttribute.RegenHits, AosAttribute.RegenStam, AosAttribute.RegenMana });

                slayer1.Register(new object[] { SlayerName.ReptilianDeath, SlayerName.DragonSlaying, SlayerName.LizardmanSlaughter, SlayerName.Ophidian, SlayerName.SnakesBane, SlayerName.ArachnidDoom, SlayerName.ScorpionsBane, SlayerName.SpidersDeath, SlayerName.Terathan });

                slayer2.Register(new object[] { SlayerName.Repond, TalismanSlayerName.Bear, TalismanSlayerName.Beetle, TalismanSlayerName.Bird, TalismanSlayerName.Bovine, TalismanSlayerName.Flame, TalismanSlayerName.Goblin, TalismanSlayerName.Ice,
                                                TalismanSlayerName.Mage, SlayerName.OgreTrashing, SlayerName.OrcSlaying, SlayerName.TrollSlaughter, TalismanSlayerName.Vermin, TalismanSlayerName.Undead });
                slayer3.Register(new object[] { SlayerName.Exorcism, SlayerName.GargoylesFoe, SlayerName.Fey, SlayerName.ElementalBan, SlayerName.Vacuum, SlayerName.BloodDrinking, SlayerName.EarthShatter, SlayerName.FlameDousing, SlayerName.ElementalHealth, SlayerName.SummerWind, SlayerName.WaterDissipation });

                requiredskill.Register(new object[] { SkillName.Swords, SkillName.Macing, SkillName.Fencing, SkillName.Archery, SkillName.Throwing });

                skill1.Register(new object[] { SkillName.Swords, SkillName.Fencing, SkillName.Macing, SkillName.Magery, SkillName.Musicianship });
                skill2.Register(new object[] { SkillName.Wrestling, SkillName.Tactics, SkillName.AnimalTaming, SkillName.Provocation, SkillName.SpiritSpeak });
                skill3.Register(new object[] { SkillName.Stealth, SkillName.Parry, SkillName.Meditation, SkillName.AnimalLore, SkillName.Discordance, SkillName.Focus });
                skill4.Register(new object[] { SkillName.Stealing, SkillName.Anatomy, SkillName.EvalInt, SkillName.Veterinary, SkillName.Necromancy, SkillName.Bushido, SkillName.Mysticism });
                skill5.Register(new object[] { SkillName.Healing, SkillName.MagicResist, SkillName.Peacemaking, SkillName.Archery, SkillName.Chivalry, SkillName.Ninjitsu, SkillName.Throwing });
                skill6.Register(new object[] { SkillName.Lumberjacking, SkillName.Snooping, SkillName.Mining });

                Categories.Add(price);
                Categories.Add(misc);
                Categories.Add(equipment);
                Categories.Add(combat);
                Categories.Add(casting);
                Categories.Add(damagetype);
                Categories.Add(hitspell);
                Categories.Add(hitarea);
                Categories.Add(resists);
                Categories.Add(stats);
                Categories.Add(slayer1);
                Categories.Add(slayer2);
                Categories.Add(slayer3);
                Categories.Add(requiredskill);
                Categories.Add(skill1);
                Categories.Add(skill2);
                Categories.Add(skill3);
                Categories.Add(skill4);
                Categories.Add(skill5);
                Categories.Add(skill6);
                Categories.Add(sort);
            });

            Keywords = new Dictionary <string, Type>();

            Keywords["power scroll"] = typeof(PowerScroll);
            Keywords["stat scroll"]  = typeof(StatCapScroll);
        }