Exemplo n.º 1
0
 public void Setup()
 {
     tagWrapper = new Mock <ITagWrapper>();
     tagWrapper.Setup(e => e.WrapInTag("Enchant [Item Name]", TagType.Info)).Returns("message");
     GlobalReference.GlobalValues.TagWrapper = tagWrapper.Object;
     command = new Enchant();
 }
Exemplo n.º 2
0
        private void GetProvidersAndLanguages()
        {
            Enchant enchant = new Enchant();

            enchant.Open();
            Logger.Info("[Spellcheck] Found Enchant version: {0}", enchant.Version);

            providers = enchant.GetProviders();
            Logger.Info("[Spellcheck] Found {0} providers: {1}", providers.Length, string.Join(",", providers));

            string[]  langTags = enchant.GetLanguages();
            ArrayList langs    = new ArrayList();

            foreach (string langTag in langTags)
            {
                SpellLanguage language = new SpellLanguage(langTag);
                if (!langs.Contains(language))
                {
                    langs.Add(language);
                }
            }
            langs.Sort();
            languages = (SpellLanguage[])langs.ToArray(typeof(SpellLanguage));
            Logger.Info("[Spellcheck] Found {0} languages: {1}", languages.Length, GetLanguageIDsAsString(languages));

            enchant.Close();
        }
Exemplo n.º 3
0
        public override bool ProcessKeyboard(Keyboard info)
        {
            foreach (var keybinding in IndexedKeybindings)
            {
                if (info.IsKeyPressed(keybinding.Key))
                {
                    var itemPreviewWindow = UserInterfaceManager.Get <ItemPreviewWindow>();
                    itemPreviewWindow.
                    SetObjectForPreview(InventoryManager.GetSlot <ISlot>(Game.GameSession.Player.Inventory, keybinding.ObjectId).Item.FirstOrDefault().ObjectId);
                    return(true);
                }
            }

            if (info.IsKeyPressed(KeybindingManager.GetKeybinding <IKeybinding>(Keybindings.Back)))
            {
                this.FullTransition(UserInterfaceManager.Get <GameWindow>());
                return(true);
            }

            if (info.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.E)) // REWORK
            {
                Equip();
            }

            if (info.IsKeyPressed(Microsoft.Xna.Framework.Input.Keys.U))
            {
                Enchant.EnchantSteel(Game.GameSession.Player.Inventory.CurrentWeapon);
            }

            return(false);
        }
Exemplo n.º 4
0
 public Enchant(Enchant enchant)
 {
     enchantType    = enchant.enchantType;
     effectValue    = enchant.effectValue;
     effectDuration = enchant.effectDuration;
     strength       = 1;
 }
Exemplo n.º 5
0
    public void Hide_AllScreen()
    {
        Teleport.SetActive(false);
        P_Screen.SetActive(false);
        BackVillage.SetActive(false);
        BackManu.SetActive(false);
        Exit.SetActive(false);
        SeveGame.SetActive(false);
        EndStage.SetActive(false);
        Status.SetActive(false);
        Npc.SetActive(false);
        Die.SetActive(false);
        Setting.SetActive(false);
        Tooltip.SetActive(false);
        BuySell.SetActive(false);
        Enchant.SetActive(false);
        HelpKey.SetActive(false);
        AdminScreen.SetActive(false);
        Sell.SetActive(false);
        Buy.SetActive(false);
        EndButtom.SetActive(false);
        inventory.SetActive(false);

        if (Application.loadedLevelName == "Village")
        {
            ButtomBackVillage.SetActive(false);
        }
        else
        {
            ButtomBackVillage.SetActive(true);
        }
    }
Exemplo n.º 6
0
 public static void ClearLowData()
 {
     charLowData              = null;
     itemLowData              = null;
     stringLowData            = null;
     resourceLowData          = null;
     partnerLowData           = null;
     monsterLowData           = null;
     npcLowData               = null;
     nonInteractiveNpcLowData = null;
     NewbieData               = null;
     skillLowData             = null;
     dungeonData              = null;
     etcData              = null;
     levelLowData         = null;
     mailLowData          = null;
     questLowData         = null;
     enchantLowData       = null;
     missionLowData       = null;
     mapLowData           = null;
     partnerLvLowData     = null;
     shopLowData          = null;
     priceLowData         = null;
     vipLowData           = null;
     iconLowData          = null;
     FormulaLowData       = null;
     guildLowData         = null;
     gatchaRewardLowData  = null;
     loadingLowData       = null;
     titleLowData         = null;
     welfareLowData       = null;
     achievementLowData   = null;
     activeLowData        = null;
     pvpAutoRewardLowData = null;
 }
Exemplo n.º 7
0
        private static Enchant SelectEnchant(List <Enchant> enchants, Random rnd)
        {
            int w = rnd.Next(0, enchants.Sum(e => e.Weight) / 2);

            foreach (Enchant enchant in enchants.OrderBy(e => e.Weight))
            {
                w -= enchant.Weight;
                if (w < 0)
                {
                    if (enchant.Id == (int)EnchantingType.SilkTouch)
                    {
                        Log.Error("Got silk!");
                    }
                    return(enchant);
                }
            }

            Enchant last = enchants.LastOrDefault();

            if (last != null && last.Id == (int)EnchantingType.SilkTouch)
            {
                Log.Error("Got silk!");
            }
            return(last);
        }
Exemplo n.º 8
0
 public override bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot)
 {
     if (slot == ItemSlot.OffHand || slot == ItemSlot.Ranged)
     {
         return(false);
     }
     return(base.EnchantFitsInSlot(enchant, character, slot));
 }
Exemplo n.º 9
0
 public static ISimpleTask BuffRandomMinion(EntityType type, Enchant buff, params RelaCondition[] list)
 {
     return(Create(
                new IncludeTask(type),
                new FilterStackTask(EntityType.SOURCE, list),
                new RandomTask(1, EntityType.STACK),
                new BuffTask(buff, EntityType.STACK)));
 }
Exemplo n.º 10
0
        internal override IFFFile Get()
        {
            var item = new Enchant();

            item.Header.Active = Reader().ReadUInt32();
            item.Header.ID     = Reader().ReadUInt32();
            Value = Reader().ReadInt64();
            return(item);
        }
Exemplo n.º 11
0
 public override bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot)
 {
     // Filters out Non-Shield Offhand Enchants and Ranged Enchants
     if ((slot == ItemSlot.OffHand && enchant.Slot != ItemSlot.OffHand) || slot == ItemSlot.Ranged)
     {
         return(false);
     }
     return(base.EnchantFitsInSlot(enchant, character, slot));
 }
Exemplo n.º 12
0
 private void listView1_SelectedIndexChanged(object sender, EventArgs e)
 {
     if (listView1.SelectedIndices.Count > 0)
     {
         Enchant enchant = listView1.SelectedItems[0].Tag as Enchant;
         EnchantName.Text     = enchant.Name;
         Stats.SelectedObject = enchant.Stats;
     }
 }
Exemplo n.º 13
0
        public void Setup()
        {
            GlobalReference.GlobalValues = new GlobalValues();

            tagWrapper = new Mock <ITagWrapper>();
            tagWrapper.Setup(e => e.WrapInTag(It.IsAny <string>(), TagType.Info)).Returns((string x, TagType y) => (x));
            GlobalReference.GlobalValues.TagWrapper = tagWrapper.Object;
            command = new Enchant();
        }
    public WeaponItem(string id, string name, string description, string icon, int max_c, float weight, int bprice, int sprice, bool sellable, bool usable, WeaponType type, int atk, SuitEffectInfo set) :
        base(id, name, description, icon, max_c, weight, bprice, sprice, sellable, usable)
    {
        /*Debug.Log(icon);
        *  if (icon.Contains("Icon/Item/Weapon/Halberd/"))
        *  {
        *   StringBuilder sb = new StringBuilder(icon);
        *   sb.Replace("Icon/Item/Weapon/Halberd/", "");
        *   icon = sb.ToString();
        *  }
        *  else if(icon.Contains("Icon/Item/Weapon/Spear/"))
        *  {
        *   StringBuilder sb = new StringBuilder(icon);
        *   sb.Replace("Icon/Item/Weapon/Spear/", "");
        *   icon = sb.ToString();
        *  }
        *  else if(icon.Contains("Icon/Item/Weapon/Sword/"))
        *  {
        *   StringBuilder sb = new StringBuilder(icon);
        *   sb.Replace("Icon/Item/Weapon/Sword/", "");
        *   icon = sb.ToString();
        *  }
        *  else if(icon.Contains("Icon/Item/Weapon/Blade/"))
        *  {
        *   StringBuilder sb = new StringBuilder(icon);
        *   sb.Replace("Icon/Item/Weapon/Blade/", "");
        *   icon = sb.ToString();
        *  }
        *  else if(icon.Contains("Icon/Item/Weapon/Shield/"))
        *  {
        *   StringBuilder sb = new StringBuilder(icon);
        *   sb.Replace("Icon/Item/Weapon/Shield/", "");
        *   icon = sb.ToString();
        *  }
        *  Debug.Log(icon);*/
        switch (type)
        {
        case WeaponType.Halberd: type_name = "戟"; /*Icon = "Icon/Item/Weapon/Halberd/" + icon;*/ break;

        case WeaponType.Spear: type_name = "长枪"; /*Icon = "Icon/Item/Weapon/Spear/" + icon;*/ break;

        case WeaponType.Sword: type_name = "单剑"; /*Icon = "Icon/Item/Weapon/Sword/" + icon;*/ break;

        case WeaponType.Blade: type_name = "单刀"; /*Icon = "Icon/Item/Weapon/Blade/" + icon;*/ break;

        default: type_name = "匕首"; /*Icon = "Icon/Item/Weapon/Shield/" + icon;*/ break;
        }
        weaponType    = type;
        ATK           = atk;
        ItemType      = ItemType.Weapon;
        ItemTypeName  = "武器";
        IsEqu         = false;
        MaterialsList = null;
        enchant       = null;
        suitEffect    = set;
        StackAble     = false;
    }
 private void UseEnchants()
 {
     foreach (var Enchant in Enchants)
     {
         if (Enchant.IsKnown())
         {
             Enchant.Spell.Launch();
             break;
         }
     }
 }
Exemplo n.º 16
0
        private void item_Clicked(object sender, MouseButtonEventArgs e)
        {
            if (!_buildingListItems && IsEnchantList)
            {
                FrameworkElement fe       = sender as FrameworkElement;
                ItemListItem     listItem = fe.DataContext as ItemListItem;

                int     selectedEnchantId = -1;
                Enchant selectedEnchant   = Character.GetEnchantBySlot(Slot);
                if (selectedEnchant != null)
                {
                    selectedEnchantId = selectedEnchant.Id;
                }

                if (listItem.EnchantId == selectedEnchantId)
                {
                    this.Close();
                }
            }
            if (!_buildingListItems && IsTinkeringList)
            {
                FrameworkElement fe       = sender as FrameworkElement;
                ItemListItem     listItem = fe.DataContext as ItemListItem;

                int       selectedTinkeringId = -1;
                Tinkering selectedTinkering   = Character.GetTinkeringBySlot(Slot);
                if (selectedTinkering != null)
                {
                    selectedTinkeringId = selectedTinkering.Id;
                }

                if (listItem.TinkeringId == selectedTinkeringId)
                {
                    this.Close();
                }
            }
            if (!_buildingListItems && IsReforgeList)
            {
                FrameworkElement fe       = sender as FrameworkElement;
                ItemListItem     listItem = fe.DataContext as ItemListItem;

                int       selectedReforgeId = -1;
                Reforging selectedReforging = Character.GetReforgingBySlot(Slot);
                if (selectedReforging != null)
                {
                    selectedReforgeId = selectedReforging.Id;
                }

                if (listItem.ReforgeId == selectedReforgeId)
                {
                    this.Close();
                }
            }
        }
Exemplo n.º 17
0
        public AutoSave(Context context)
            : base(context)
        {
            smash   = context.Combo.Smash;
            enchant = context.Combo.Enchant;

            minHpPercentForSave = rootMenu.CreateSlider("Min. HP% for save with enchant", 0, 0, 50)
                                  .SetTooltip("Uses enchant + smash for save")
                                  .SetAbilityImage(AbilityId.item_ultimate_scepter);

            myFountain = EntityManager.GetEntities <Unit>().FirstOrDefault(x => x.Name == fountainName &&
                                                                           x.IsAlly(localHero));
        }
Exemplo n.º 18
0
 private void LoadListView()
 {
     for (int i = 0; i < _Enchants.Count; i++)
     {
         Enchant currentEnchant = _Enchants[i];
         if (string.IsNullOrEmpty(Filter.Text) || currentEnchant.Name.ToLower().Contains(Filter.Text.ToLower()))
         {
             ListViewItem lvi = new ListViewItem(currentEnchant.Name, listView1.Groups[currentEnchant.Slot.ToString()]);
             lvi.Tag = currentEnchant;
             listView1.Items.Add(lvi);
         }
     }
     listView1.Sort();
 }
Exemplo n.º 19
0
        public Combo(Context context)
        {
            this.context = context;

            localHero  = context.LocalHero;
            ComboItems = context.RootMenu.CreateItemToggler("Items", items)
                         .SetTooltip("Select combo items");

            Smash     = new Smash(localHero.GetAbilityById(AbilityId.earth_spirit_boulder_smash));
            Roll      = new Roll(localHero.GetAbilityById(AbilityId.earth_spirit_rolling_boulder));
            Grip      = new Grip(localHero.GetAbilityById(AbilityId.earth_spirit_geomagnetic_grip));
            Stone     = new Stone(localHero.GetAbilityById(AbilityId.earth_spirit_stone_caller));
            Enchant   = new Enchant(localHero.GetAbilityById(AbilityId.earth_spirit_petrify));
            Magnetize = new Magnetize(localHero.GetAbilityById(AbilityId.earth_spirit_magnetize));
        }
Exemplo n.º 20
0
        public override bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot)
        {
            // Filters out Non-Shield Offhand Enchants and Ranged Enchants
            if ((slot == ItemSlot.OffHand && enchant.Slot != ItemSlot.OffHand) || slot == ItemSlot.Ranged)
            {
                return(false);
            }
            // Filters out Death Knight and Two-Hander Enchants
            if (enchant.Name.StartsWith("Rune of the") || enchant.Slot == ItemSlot.TwoHand)
            {
                return(false);
            }

            return(base.EnchantFitsInSlot(enchant, character, slot));
        }
Exemplo n.º 21
0
    // Start the process of setting enchants to item
    public void SetEnchants()
    {
        int errorCount = 0;

        if (maxEnchants != 0)
        {
            for (int i = 0; i < maxEnchants; i++)
            {
                bool runAgain = true;
                while (runAgain)
                {
                    errorCount++;
                    if (errorCount > 1000)
                    {
                        Debug.Log("ERROR :: Error Finding Enchant");
                        runAgain = false;
                    }
                    enchants[i] = new Enchant(itemType);

                    if (i == 0)
                    {
                        e_type = 0;
                        enchants[i].GetNewEnchant(this, itemLevel, false);
                        e_type = -1;
                    }
                    else if (type_Damage > 0)
                    {
                        enchants[i].GetNewEnchant(this, itemLevel, true);
                    }
                    else
                    {
                        enchants[i].GetNewEnchant(this, itemLevel);
                    }

                    if (IsOkToProceedWithEnchant(enchants[i]))
                    {
                        runAgain = false;
                        ApplyEnchant(i);
                    }
                }
            }
            SetEnchantedName();
            ConsolidateEnchants();
            RejectPoorEnchants();
            GetBonusDamage();
        }
    }
    public ArmorItem(string id, string name, string description, string icon, int max_c, float weight, int bprice, int sprice, bool sellable, bool usable, ArmorType type, int def, SuitEffectInfo set) :
        base(id, name, description, icon, max_c, weight, bprice, sprice, sellable, usable)
    {
        /*if(icon.Contains("Icon/Item/Armor/Clothes/"))
         * {
         *  StringBuilder sb = new StringBuilder(icon);
         *  sb.Replace("Icon/Item/Armor/Clothes/", "");
         *  icon = sb.ToString();
         * }
         * else if(icon.Contains("Icon/Item/Armor/Helmet/"))
         * {
         *  StringBuilder sb = new StringBuilder(icon);
         *  sb.Replace("Icon/Item/Armor/Helmet/", "");
         *  icon = sb.ToString();
         * }
         * else if(icon.Contains("Icon/Item/Armor/WristBand/"))
         * {
         *  StringBuilder sb = new StringBuilder(icon);
         *  sb.Replace("Icon/Item/Armor/WristBand/", "");
         *  icon = sb.ToString();
         * }
         * else if(icon.Contains("Icon/Item/Armor/Shoes/"))
         * {
         *  StringBuilder sb = new StringBuilder(icon);
         *  sb.Replace("Icon/Item/Armor/Shoes/", "");
         *  icon = sb.ToString();
         * }*/
        switch (type)
        {
        case ArmorType.Clothes: type_name = "衣服"; /*Icon = "Icon/Item/Armor/Clothes/" + icon*/; break;

        case ArmorType.Helmet: type_name = "头饰"; /*Icon = "Icon/Item/Armor/Helmet/" + icon*/; break;

        case ArmorType.WristBand: type_name = "护腕"; /*Icon = "Icon/Item/Armor/WristBand/" + icon*/; break;

        case ArmorType.Shoes: type_name = "鞋履"; /*Icon = "Icon/Item/Armor/Shoes/" + icon*/; break;
        }
        this.armorType = type;
        DEF            = def;
        ItemType       = ItemType.Armor;
        ItemTypeName   = "防具";
        IsEqu          = false;
        enchant        = null;
        StackAble      = false;
        suitEffect     = set;
    }
        public AutoPushInTowerDirection(Context context)
            : base(context)
        {
            smash   = context.Combo.Smash;
            enchant = context.Combo.Enchant;

            featureMenu = rootMenu.CreateMenu("Auto push under towers")
                          .SetAbilityImage(AbilityId.earth_spirit_boulder_smash);

            modeSelector = featureMenu.CreateSelector("Mode",
                                                      new string[3] {
                "Off", "On", "Also with agha"
            })
                           .SetTooltip("Auto use smash for push under tower");

            additionalRange = featureMenu.CreateSlider("Additional range around tower", 0, -500, 1000);
        }
        public AutoPushInAlliesDirection(Context context)
            : base(context)
        {
            smash   = context.Combo.Smash;
            enchant = context.Combo.Enchant;

            featureMenu = rootMenu.CreateMenu("Auto push under allies")
                          .SetAbilityImage(AbilityId.earth_spirit_boulder_smash);

            modeSelector = featureMenu.CreateSelector("Mode",
                                                      new string[3] {
                "Off", "On", "Also with agha"
            })
                           .SetTooltip("Auto use smash for push in allies");

            minAllyHpPercent = featureMenu.CreateSlider("Min. ally hp %", 20, 0, 80);
        }
Exemplo n.º 25
0
    // Apply the enchants to the name
    public void SetEnchantedName()
    {
        // If there are no damage enchants, only put the first enchants name
        if (type_Damage == 0)
        {
            itemName = itemName + " Of " + enchants[0].GetEnchantName();
        }
        // If there is only one damage enchant, Set the damage enchant, and then the first other stats name if not damage
        else if (type_Damage == 1)
        {
            foreach (Enchant e in enchants)
            {
                if (e.type == Enchant.EnchantTypes.Damage_T1 || e.type == Enchant.EnchantTypes.Damage_T2 || e.type == Enchant.EnchantTypes.Damage_T3)
                {
                    itemName = itemName + " Of " + e.GetEnchantName(true) + " " + enchants[0].GetEnchantName();
                }
            }
        }
        else if (type_Damage == 2)
        {
            Enchant first  = null;
            Enchant second = null;

            foreach (Enchant e in enchants)
            {
                if (e.type == Enchant.EnchantTypes.Damage_T1 || e.type == Enchant.EnchantTypes.Damage_T2 || e.type == Enchant.EnchantTypes.Damage_T3)
                {
                    second = e;
                }
            }

            foreach (Enchant e in enchants)
            {
                if (e.type == Enchant.EnchantTypes.Damage_T1 || e.type == Enchant.EnchantTypes.Damage_T2 || e.type == Enchant.EnchantTypes.Damage_T3)
                {
                    if (second != e)
                    {
                        first = e;
                    }
                }
            }

            itemName = itemName + " Of " + first.GetEnchantName(true) + " " + second.GetEnchantName();
        }
    }
Exemplo n.º 26
0
        private void iq_Closed(object sender, EventArgs e)
        {
            IncreaseQuota iq = sender as IncreaseQuota;

            if (iq == null || iq.DialogResult.GetValueOrDefault(false))
            {
                Calculations.RegisterModel(typeof(Rawr.Bear.CalculationsBear));
                Calculations.RegisterModel(typeof(Rawr.Cat.CalculationsCat));
                Calculations.RegisterModel(typeof(Rawr.DPSDK.CalculationsDPSDK));
                Calculations.RegisterModel(typeof(Rawr.DPSWarr.CalculationsDPSWarr));
                Calculations.RegisterModel(typeof(Rawr.Elemental.CalculationsElemental));
                Calculations.RegisterModel(typeof(Rawr.Enhance.CalculationsEnhance));
                Calculations.RegisterModel(typeof(Rawr.Healadin.CalculationsHealadin));
                Calculations.RegisterModel(typeof(Rawr.HealPriest.CalculationsHealPriest));
                Calculations.RegisterModel(typeof(Rawr.Hunter.CalculationsHunter));
                Calculations.RegisterModel(typeof(Rawr.Mage.CalculationsMage));
                Calculations.RegisterModel(typeof(Rawr.Moonkin.CalculationsMoonkin));
                Calculations.RegisterModel(typeof(Rawr.ProtPaladin.CalculationsProtPaladin));
                Calculations.RegisterModel(typeof(Rawr.ProtWarr.CalculationsProtWarr));
                Calculations.RegisterModel(typeof(Rawr.RestoSham.CalculationsRestoSham));
                Calculations.RegisterModel(typeof(Rawr.Retribution.CalculationsRetribution));
                Calculations.RegisterModel(typeof(Rawr.Rogue.CalculationsRogue));
                Calculations.RegisterModel(typeof(Rawr.ShadowPriest.CalculationsShadowPriest));
                Calculations.RegisterModel(typeof(Rawr.TankDK.CalculationsTankDK));
                Calculations.RegisterModel(typeof(Rawr.Tree.CalculationsTree));
                Calculations.RegisterModel(typeof(Rawr.Warlock.CalculationsWarlock));

                string[] files = new List <string>(Classes.Keys).ToArray();

                Buff.LoadDefaultBuffs(null, 85);
                Enchant.LoadDefaultEnchants();
                Tinkering.LoadDefaultTinkerings();

                FileUtils f = new FileUtils(files, progressUpdated);
                f.DownloadIfNotExists(new EventHandler(filesLoaded));
            }
            else
            {
                new Base.ErrorBox("Not Enough Storage Space",
                                  "Rawr will not work if you do not allow it to increase its available "
                                  + "storage size. Please refresh this page and accept to continue.").Show();
            }
        }
Exemplo n.º 27
0
    // Consolidates enchants
    public void ConsolidateEnchants()
    {
        Enchant a = null;
        Enchant b = null;

        for (int i = 0; i < maxEnchants; i++)
        {
            for (int j = 0; j < maxEnchants; j++)
            {
                a = enchants[i];
                b = enchants[j];

                if (i != j)
                {
                    if ((a.GetEnchantName() == b.GetEnchantName() && (!a.consolidated && !b.consolidated)) ||
                        (a.GetEnchantName() == b.GetEnchantName() && (!a.consolidated && b.consolidated && !b.rejected)) ||
                        (a.GetEnchantName() == b.GetEnchantName() && (a.consolidated && !b.consolidated && !a.rejected)))
                    {
                        if (b.consolidated)
                        {
                            enchants[j].SetBonusStatText((a.power + b.power).ToString() + " " + a.GetEnchantName());
                            enchants[j].power        = a.power + b.power;
                            enchants[j].consolidated = true;
                            enchants[i].power        = 0;
                            enchants[i].consolidated = true;
                            enchants[i].SetBonusStatText("");
                            enchants[i].rejected = true;
                        }
                        else
                        {
                            enchants[i].SetBonusStatText((a.power + b.power).ToString() + " " + a.GetEnchantName());
                            enchants[i].power        = a.power + b.power;
                            enchants[i].consolidated = true;
                            enchants[j].power        = 0;
                            enchants[j].consolidated = true;
                            enchants[j].SetBonusStatText("");
                            enchants[j].rejected = true;
                        }
                    }
                }
            }
        }
    }
Exemplo n.º 28
0
 public override bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot)
 {
     if (slot == ItemSlot.Ranged)
     {
         return(false);
     }
     if (slot == ItemSlot.OffHand)
     {
         if (enchant.ShieldsOnly)
         {
             return(false);
         }
         if (enchant.Slot == ItemSlot.OneHand || enchant.Slot == ItemSlot.MainHand)
         {
             return(false);
         }
     }
     return(base.EnchantFitsInSlot(enchant, character, slot));
 }
Exemplo n.º 29
0
        /// <summary>
        /// Returns the current success chance.
        /// </summary>
        /// <returns></returns>
        private float GetChance()
        {
            var item2       = this.GetItem2();
            var optionSetId = this.GetOptionSetId(item2);
            var chance      = 0f;

            // Get chance
            if (optionSetId != 0)
            {
                var powder        = this.GetMagicPowder(this.Creature1);
                var optionSetData = AuraData.OptionSetDb.Find(optionSetId);

                if (powder != null && optionSetData != null)
                {
                    chance = Enchant.GetChance(this.Creature2, powder, SkillId.Enchant, optionSetData);
                }
            }

            return(chance);
        }
Exemplo n.º 30
0
    public JewelryItem(string id, string name, string description, string icon, int max_c, float weight, int bprice, int sprice, bool sellable, bool usable, JewelryType type, PowerUps add, SuitEffectInfo set) :
        base(id, name, description, icon, max_c, weight, bprice, sprice, sellable, usable)
    {
        /*if(icon.Contains("Icon/Item/Jewelry/Necklace/"))
         * {
         *  StringBuilder sb = new StringBuilder(icon);
         *  sb.Replace("Icon/Item/Jewelry/Necklace/", "");
         *  icon = sb.ToString();
         * }
         * else if(icon.Contains("Icon/Item/Jewelry/Belt/"))
         * {
         *  StringBuilder sb = new StringBuilder(icon);
         *  sb.Replace("Icon/Item/Jewelry/Belt/", "");
         *  icon = sb.ToString();
         * }
         * else if(icon.Contains("Icon/Item/Jewelry/Ring/"))
         * {
         *  StringBuilder sb = new StringBuilder(icon);
         *  sb.Replace("Icon/Item/Jewelry/Ring/", "");
         *  icon = sb.ToString();
         * }*/
        switch (type)
        {
        case JewelryType.Necklace: type_name = "项链"; /*Icon = "Icon/Item/Jewelry/Necklace/" + icon;*/ break;

        case JewelryType.Belt: type_name = "腰饰"; /*Icon = "Icon/Item/Jewelry/Belt/" + icon;*/ break;

        case JewelryType.Ring: type_name = "戒指"; /*Icon = "Icon/Item/Jewelry/Ring/" + icon;*/ break;
        }
        this.jewelry_Type = type;
        if (add != null)
        {
            power_Add = add.Clone();
        }
        ItemType     = ItemType.Jewelry;
        ItemTypeName = "首饰";
        IsEqu        = false;
        enchant      = null;
        StackAble    = false;
        suitEffect   = set;
    }
Exemplo n.º 31
0
 public override bool IsEnchantRelevant(Enchant enchant, Character character)
 {
     if (enchant == null || character == null) { return false; }
     return
         IsEnchantAllowedForClass(enchant, character.Class) &&
         IsProfEnchantRelevant(enchant, character) &&
         (HasWantedStats(enchant.Stats) ||
             (HasSurvivabilityStats(enchant.Stats) && !HasIgnoreStats(enchant.Stats)));
 }
Exemplo n.º 32
0
 /// <summary>
 /// Checks if the enchant has relevant stats as defined by the model. If not, it will hide the enchant as unnecessary.
 /// <para>If you have the option set to Hide Enchants based on Professions, it will also make that check.</para>
 /// </summary>
 /// <param name="enchant">The Enchant to check</param>
 /// <returns>Whether the Enchant should be hidden, based on Stats. If the option is set, also Professions.</returns>
 public virtual bool IsEnchantRelevant(Enchant enchant, Character character) {
     try {
         bool _class = IsEnchantAllowedForClass(enchant, character.Class);
         bool _prof = IsProfEnchantRelevant(enchant, character);
         bool _relicFilter = true;
         if (enchant.Slot == ItemSlot.Ranged) {
             _relicFilter = (character.Class == CharacterClass.Warrior
                          || character.Class == CharacterClass.Hunter
                          || character.Class == CharacterClass.Rogue);
         }
         bool _relStats = HasRelevantStats(enchant.Stats);
         //
         return _class && _prof && _relicFilter && _relStats;
     } catch {
         return false;
     }
 }
Exemplo n.º 33
0
 public virtual bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot)
 {
     return enchant.FitsInSlot(slot);
 }
Exemplo n.º 34
0
 public override bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot) {
     if (enchant == null) { return false; }
     // Hide the ranged weapon enchants. None of them apply to melee damage at all.
     if (enchant.Slot == ItemSlot.Ranged) { return false; }
     // Disallow Shield enchants, all shield enchants are ItemSlot.OffHand and nothing else is according to Astry
     if (enchant.Slot == ItemSlot.OffHand) { return false; }
     // Allow offhand Enchants for two-handers if toon has Titan's Grip
     // If not, turn off all enchants for the offhand
     if (character != null
         && character.WarriorTalents.TitansGrip > 0
         && enchant.Slot == ItemSlot.TwoHand
         && slot == ItemSlot.OffHand) {
         return true;
     } else  if (character != null
         && character.WarriorTalents.SingleMindedFury > 0
         && enchant.Slot == ItemSlot.OneHand
         && slot == ItemSlot.OffHand) {
         return true;
     } else if (character != null
         && character.WarriorTalents.TitansGrip == 0
         && (enchant.Slot == ItemSlot.TwoHand || enchant.Slot == ItemSlot.OneHand)
         && slot == ItemSlot.OffHand) {
         return false;
     }
     // If all the above is ok, return base version
     return enchant.FitsInSlot(slot);
 }
Exemplo n.º 35
0
		int m_ws; // only text in this language is checked.

		/// <summary>
		/// Make one
		/// </summary>
		/// <param name="tss"></param>
		/// <param name="dict"></param>
		/// <param name="ws"></param>
		public SpellCheckMethod(ITsString tss, Enchant.Dictionary dict, int ws, ILgCharacterPropertyEngine cpe)
		{
			m_tss = tss;
			m_text = tss.Text;
			if (m_text == null)
				m_text = "";
			m_cch = m_text.Length;
			m_cpe = cpe;
			m_dict = dict;
			m_ws = ws;
		}
Exemplo n.º 36
0
        public static void CreateSuffixSeries(Level lvl, string name, Tendency tend, Enchant ench1, int factorStart1, int factorEnd1,
            Enchant ench2 = 0, int factorStart2 = 0, int factorEnd2 = 0,
            Enchant ench3 = 0, int factorStart3 = 0, int factorEnd3 = 0)
        {
            int progression1 = (factorEnd1 - factorStart1) / 10;
            int progression2 = (factorEnd2 - factorStart2) / 10;
            int progression3 = (factorEnd3 - factorStart3) / 10;

            int enchant1 = (int)ench1;
            int enchant2 = (int)ench2;
            int enchant3 = (int)ench3;

            int level = (int)lvl;
            int tendency = (int)tend;

            LegacyToolBox.AppendMessage(string.Format("creating suffix {0}+{1}+{2} of level {3} tendency {4}", enchant1, enchant2, enchant3, level, tendency));

            int maxid = (from d in LegacyToolBox.Data.ItemRandomSuffix select d.ID).Max() + 1;

            item_suffix suffixDb = new item_suffix();
            suffixDb.Level = level;
            suffixDb.Suffix = -maxid;
            suffixDb.Tendency = tendency;

            int p = 0;
            ItemRandomSuffix suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank1 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank2 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank3 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank4 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank5 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank6 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank7 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank8 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank9 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            ++p;
            ++maxid;
            suffixDb.Rank10 = -maxid;
            suffix = CreateSuffix(maxid, name,
                enchant1, enchant1 == 0 ? 0 : factorStart1 + progression1 * p,
                enchant2, enchant2 == 0 ? 0 : factorStart2 + progression2 * p,
                enchant3, enchant3 == 0 ? 0 : factorStart3 + progression3 * p);
            LegacyToolBox.Data.ItemRandomSuffix.Add(suffix);
            DB.LEGACY.item_suffix.Add(suffixDb);
            DB.LSave();
        }
Exemplo n.º 37
0
 public void SetEnchantBySlot(ItemSlot slot, Enchant enchant)
 {
     switch (slot)
     {
         case Rawr.ItemSlot.Head:
             HeadEnchant = enchant;
             break;
         case Rawr.ItemSlot.Shoulders:
             ShouldersEnchant = enchant;
             break;
         case Rawr.ItemSlot.Back:
             BackEnchant = enchant;
             break;
         case Rawr.ItemSlot.Chest:
             ChestEnchant = enchant;
             break;
         case Rawr.ItemSlot.Wrist:
             WristEnchant = enchant;
             break;
         case Rawr.ItemSlot.Hands:
             HandsEnchant = enchant;
             break;
         case Rawr.ItemSlot.Legs:
             LegsEnchant = enchant;
             break;
         case Rawr.ItemSlot.Feet:
             FeetEnchant = enchant;
             break;
         case Rawr.ItemSlot.Finger:
             Finger1Enchant = enchant;
             break;
         case Rawr.ItemSlot.MainHand:
         case Rawr.ItemSlot.OneHand:
         case Rawr.ItemSlot.TwoHand:
             MainHandEnchant = enchant;
             break;
         case Rawr.ItemSlot.OffHand:
             OffHandEnchant = enchant;
             break;
         case Rawr.ItemSlot.Ranged:
             RangedEnchant = enchant;
             break;
     }
 }
Exemplo n.º 38
0
		public BadSpellingMatcher(int ws, Enchant.Dictionary dict)
		{
			m_ws = ws;
			m_dict = dict;
		}
Exemplo n.º 39
0
 public ItemAvailability GetItemAvailability(Enchant enchant)
 {
     string id = (-1 * (enchant.Id + ((int)AvailableItemIDModifiers.Enchants * (int)enchant.Slot))).ToString(System.Globalization.CultureInfo.InvariantCulture);
     return GetItemAvailability(id, string.Format("{0}.0", enchant.Id), id);
 }
Exemplo n.º 40
0
 public void ToggleItemAvailability(Enchant enchant)
 {
     string id = (-1 * (enchant.Id + ((int)AvailableItemIDModifiers.Enchants * (int)enchant.Slot))).ToString(System.Globalization.CultureInfo.InvariantCulture);
     ItemAvailability newItemAvailability = ItemAvailability.NotAvailable;
     // all enabled toggle
     if (_availableItems.Contains(id)) {
         while (_availableItems.Contains(id)) { _availableItems.Remove(id); }
         newItemAvailability = ItemAvailability.NotAvailable;
     } else {
         _availableItems.Add(id);
         newItemAvailability = ItemAvailability.Available;
     }
     OnAvailableItemsChanged(id, newItemAvailability);
 }
Exemplo n.º 41
0
        public bool IsEnchantAllowedForClass(Enchant enchant, CharacterClass characterClass)
        {
            if (enchant.Name.StartsWith("Rune of ", StringComparison.Ordinal) && (characterClass != CharacterClass.DeathKnight))
                return false;

            return true;
        }
Exemplo n.º 42
0
 public static bool IsItemEligibleForEnchant(Enchant enchant, Item item)
 {
     if (Instance != null)
         return Instance.IsItemEligibleForEnchant(enchant, item);
     return false;
 }
Exemplo n.º 43
0
 public override bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot)
 {
     // Filters out Non-Shield Offhand Enchants and Ranged Enchants
     if ((slot == ItemSlot.OffHand && enchant.Slot != ItemSlot.OffHand) || slot == ItemSlot.Ranged) return false;
     return base.EnchantFitsInSlot(enchant, character, slot);
 }
Exemplo n.º 44
0
 /// <summary>
 /// Hide an enchant that is tie to a profession when:
 /// <para>- You have the Option active in the General Settings</para>
 /// <para>- You do not have the profession</para>
 /// <para>Otherwise, this function returns true so that non-profession enchants are not affected.</para>
 /// <para>NOTE: There is no reason to override this function</para>
 /// </summary>
 /// <param name="enchant">The Enchant to check</param>
 /// <returns>Whether the Enchant should be hidden, defaults to true unless specific conditions are met.</returns>
 public virtual bool IsProfEnchantRelevant(Enchant enchant, Character character) {
     try {
         #region Enchants related to Professions to Hide/Show
         string name = enchant.Name;
         if (Rawr.Properties.GeneralSettings.Default.HideProfEnchants) {
             if (!character.HasProfession(Profession.Enchanting)) 
             {
                 if (enchant.Slot == ItemSlot.Finger)
                 {
                     return false;
                 }
             }
             if (!character.HasProfession(Profession.Engineering))
             {
                 if (name.Contains("Frag Belt") ||
                     name.Contains("Mind Amplification Dish")   ||
                     name.Contains("Flexweave Underlay")        ||
                     name.Contains("Hyperspeed Accelerators")   ||
                     name.Contains("Reticulated Armor Webbing") ||
                     name.Contains("Nitro Boosts") ||
                     name.Contains("Springy Arachnoweave") ||
                     name.Contains("Hand-Mounted") ||
                     name.Contains("Grounded Plasma Shield") ||
                     name.Contains("Quickflip Deflection Plates") ||
                     name.Contains("Spinal Healing Injector") ||
                     name.Contains("Synapse Springs") ||
                     name.Contains("Tazik Shocker") ||
                     name.Contains("Z50 Mana Gulper")
                     )
                 {
                     return false;
                 }
             }
             if (!character.HasProfession(Profession.Inscription))
             {
                 if ((name.Contains("Master's") && !name.Contains("Spellthread")) ||
                     name.Contains("Felfire Inscription") ||
                     name.Contains("Inscription of the Earth Prince") ||
                     name.Contains("Lionsmane Inscription") ||
                     name.Contains("Swiftsteel Inscription"))
                 {
                     return false;
                 }
             }
             if (!character.HasProfession(Profession.Leatherworking))
             {
                 if (name.Contains("Fur Lining") ||
                     name.Contains("Nerubian Leg Reinforcements") ||
                     name.Contains("Draconic Embossment") ||
                     name.Contains("Charscale Leg Reinforcements") ||
                     name.Contains("Dragonbone Leg Reinforcements") ||
                     name.Contains("Drakehide Leg Reinforcements"))
                 {
                     return false;
                 }
             }
             if (!character.HasProfession(Profession.Tailoring))
             {
                 if (name.Contains("Embroidery")
                     || name.Contains("Sanctified Spellthread")
                     || name.Contains("Master's Spellthread"))
                 {
                     return false;
                 }
             }
         }
         #endregion
         return true;
     } catch (Exception) { return true; }
 }
Exemplo n.º 45
0
 public void SetEnchantBySlot(CharacterSlot slot, Enchant enchant)
 {
     int i = (int)slot;
     if (i < 0 || i >= SlotCount) return;
     ItemInstance item = this[slot];
     if ((object)item != null) item.Enchant = enchant;
     OnCalculationsInvalidated();
 }
Exemplo n.º 46
0
 public virtual bool IsItemEligibleForEnchant(Enchant enchant, Item item)
 {
     bool eligibleForEnchant = false;
     if (enchant.Slot == ItemSlot.OneHand)
     {
         eligibleForEnchant = (item.Slot == ItemSlot.OneHand ||
                             (item.Slot == ItemSlot.OffHand &&
                                 item.Type != ItemType.Shield &&
                                 item.Type != ItemType.None) ||
                             item.Slot == ItemSlot.MainHand ||
                             item.Slot == ItemSlot.TwoHand);
     }
     else if (enchant.Slot == ItemSlot.OffHand)
     {
         eligibleForEnchant = (item.Type == ItemType.Shield || (item.Type == ItemType.None && enchant.Id == 4091));
     }
     else
     {
         eligibleForEnchant = (enchant.Slot == item.Slot);
     }
     return eligibleForEnchant;
 }
Exemplo n.º 47
0
 public static bool EnchantFitsInSlot(Enchant item, Character character, ItemSlot slot)
 {
     if (Instance != null)
         return Instance.EnchantFitsInSlot(item, character, slot);
     return false;
 }
 public override bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot)
 {
     if (slot == ItemSlot.Ranged) return false;
     if (slot == ItemSlot.OffHand) return (enchant.Id == 4091);
     return base.EnchantFitsInSlot(enchant, character, slot);
 }
Exemplo n.º 49
0
 public static bool IsEnchantRelevant(Enchant enchant, Character character)
 {
     if (Instance != null)
         return Instance.IsEnchantRelevant(enchant, character);
     return false;
 }
Exemplo n.º 50
0
 public override bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot)
 {
     if (slot == ItemSlot.Ranged) return false;
     if (slot == ItemSlot.OffHand)
     {
         if (enchant.ShieldsOnly) return false;
         if (enchant.Slot == ItemSlot.OneHand || enchant.Slot == ItemSlot.MainHand) return false;
     }
     return base.EnchantFitsInSlot(enchant, character, slot);
 }
Exemplo n.º 51
0
        public override bool IsEnchantRelevant(Enchant enchant, Character character)
        {
            // First we let the normal rules (profession, class, relevant stats) decide
            bool relevant = base.IsEnchantRelevant(enchant, character);

            // Next we use our special stat relevancy filtering.
            if (relevant)
                relevant = HasPrimaryStats(enchant.Stats) || (HasSecondaryStats(enchant.Stats) && !HasUnwantedStats(enchant.Stats));

            return relevant;
        }
Exemplo n.º 52
0
        public override bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot) {
            // Filters out Non-Shield Offhand Enchants and Ranged Enchants
            if ((slot == ItemSlot.OffHand && enchant.Slot != ItemSlot.OffHand) || slot == ItemSlot.Ranged) return false;
            // Filters out Death Knight and Two-Hander Enchants
            if (enchant.Name.StartsWith("Rune of the") || enchant.Slot == ItemSlot.TwoHand) return false;

            return base.EnchantFitsInSlot(enchant, character, slot);
        }
Exemplo n.º 53
0
 public ItemInstance GetItemInstance(Item item, int randomSuffixId, Enchant enchant, bool blacksmithingSocket)
 {
     return GetItemInstance(item, randomSuffixId, enchant, null, null, blacksmithingSocket);
 }
Exemplo n.º 54
0
 public ItemInstance GetItemInstance(Item item, int randomSuffixId, Enchant enchant, Reforging reforging, Tinkering tinkering, bool blacksmithingSocket)
 {
     if (item == null) return null;
     Item gem1 = null;
     Item gem2 = null;
     Item gem3 = null;
     bool cog1used = false;
     switch (item.SocketColor1)
     {
         case ItemSlot.Meta: gem1 = MetaGem; break;
         case ItemSlot.Red: gem1 = RedGem; break;
         case ItemSlot.Yellow: gem1 = YellowGem; break;
         case ItemSlot.Blue: gem1 = BlueGem; break;
         case ItemSlot.Prismatic: gem1 = PrismaticGem; break;
         case ItemSlot.Cogwheel: gem1 = Cogwheel; cog1used = true; break;
         case ItemSlot.Hydraulic: gem1 = Hydraulic; break;
         case ItemSlot.None: 
             if (blacksmithingSocket)
             {
                 gem1 = PrismaticGem;
                 blacksmithingSocket = false;
             }
             break;
     }
     switch (item.SocketColor2)
     {
         case ItemSlot.Meta: gem2 = MetaGem; break;
         case ItemSlot.Red: gem2 = RedGem; break;
         case ItemSlot.Yellow: gem2 = YellowGem; break;
         case ItemSlot.Blue: gem2 = BlueGem; break;
         case ItemSlot.Prismatic: gem2 = PrismaticGem; break;
         case ItemSlot.Cogwheel: if (cog1used) { gem2 = Cogwheel2; } else { gem2 = Cogwheel; cog1used = true; } break;
         case ItemSlot.Hydraulic: gem2 = Hydraulic; break;
         case ItemSlot.None:
             if (blacksmithingSocket)
             {
                 gem2 = PrismaticGem;
                 blacksmithingSocket = false;
             }
             break;
     }
     switch (item.SocketColor3)
     {
         case ItemSlot.Meta: gem3 = MetaGem; break;
         case ItemSlot.Red: gem3 = RedGem; break;
         case ItemSlot.Yellow: gem3 = YellowGem; break;
         case ItemSlot.Blue: gem3 = BlueGem; break;
         case ItemSlot.Prismatic: gem3 = PrismaticGem; break;
         case ItemSlot.Cogwheel: if (cog1used) { gem3 = Cogwheel2; } else { gem3 = Cogwheel; cog1used = true; } break;
         case ItemSlot.Hydraulic: gem3 = Hydraulic; break;
         case ItemSlot.None:
             if (blacksmithingSocket)
             {
                 gem3 = PrismaticGem;
                 blacksmithingSocket = false;
             }
             break;
     }
     return new ItemInstance(item, randomSuffixId, gem1, gem2, gem3, enchant, reforging, tinkering);
 }
Exemplo n.º 55
0
 public override bool EnchantFitsInSlot(Enchant enchant, Character character, ItemSlot slot)
 {
     // No enchants allowed on our ranged slot
     if (slot == ItemSlot.Ranged) return false;
     // Make an exception for enchant 4091 - Enchant Off-Hand - Superior Intellect
     if (slot == ItemSlot.OffHand && enchant.Id == 4091) return true;
     // No other enchants allowed on our offhands
     if (slot == ItemSlot.OffHand) return false;
     // Otherwise, return the base value
     return base.EnchantFitsInSlot(enchant, character, slot);
 }