示例#1
0
        // Token: 0x06000041 RID: 65 RVA: 0x000048C0 File Offset: 0x00002AC0
        protected override void ActivateLocally(Character character, object[] _infos)
        {
            float        num    = 15f;
            object       value  = At.GetValue(typeof(Effect), this, "m_parentStatusEffect");
            StatusEffect parent = value as StatusEffect;
            bool         flag   = parent != null;

            if (flag)
            {
                float            num2   = num - parent.RemainingLifespan;
                float            damage = Radiating.AmpDamage(parent.SourceCharacter, 15f * Convert.ToSingle(Math.Exp((double)(-(double)num2 / 10f))) / Radiating.normalize(), DamageType.Types.Electric);
                List <Character> list   = new List <Character>();
                CharacterManager.Instance.FindCharactersInRange(character.CenterPosition, 10f, ref list);
                IEnumerable <Character> source = list;

                foreach (Character character2 in source.Where(x => x.Faction != parent.SourceCharacter.Faction))
                {
                    bool flag2 = !character2.Invincible;
                    if (flag2)
                    {
                        DamageList damageList = new DamageList(DamageType.Types.Electric, damage);
                        character2.Stats.GetMitigatedDamage(null, ref damageList);
                        character2.Stats.ReceiveDamage(damageList.TotalDamage);
                    }
                }
            }
            else
            {
                Debug.Log("Radiating Effect had not parent Status Effect");
            }
        }
        public static void Postfix(CharacterEquipment __instance, ref float __result)
        {
            Character character = At.GetValue(typeof(CharacterEquipment), __instance, "m_character") as Character;
            bool      flag      = character != null && SkillRequirements.CanAddProtectionToImpactResistance(character);

            if (flag)
            {
                __result += __instance.GetEquipmentDamageProtection(DamageType.Types.Physical);
            }
        }
        public static void Postfix(CharacterStats __instance, float _staminaConsumed)
        {
            Character character = (Character)At.GetValue(typeof(CharacterStats), __instance, "m_character");
            bool      flag      = character != null && character.Inventory.SkillKnowledge.IsItemLearned(2502002) && (character.StatusEffectMngr.HasStatusEffect("Bless") || character.StatusEffectMngr.HasStatusEffect("Bless Amplified"));

            if (flag)
            {
                character.StatusEffectMngr.AddStatusEffectBuildUp(Templar.Instance.burstOfDivinityInstance, _staminaConsumed * Templar.GetFreeCastBuildup(character), character);
            }
        }
            public static void Postfix()
            {
                var dict = (Dictionary <int, Enchantment>)At.GetValue(typeof(ResourcesPrefabManager), ResourcesPrefabManager.Instance, "ENCHANTMENT_PREFABS");

                m_cachedEnchantments = new Dictionary <string, Enchantment>();
                foreach (var entry in dict)
                {
                    m_cachedEnchantments.Add($"{entry.Value.Name} ({entry.Key})", entry.Value);
                }
            }
        public static bool Prefix(Character __instance, ref bool _active)
        {
            bool isAI = __instance.IsAI;
            bool result;

            if (isAI)
            {
                result = true;
            }
            else
            {
                bool flag = !__instance.IsPhotonPlayerLocal || __instance.Sheathing || __instance.PreparingToSleep || __instance.Dodging || __instance.CurrentSpellCast == Character.SpellCastType.Flamethrower || __instance.CurrentSpellCast == Character.SpellCastType.PushKick;
                if (flag)
                {
                    result = true;
                }
                else
                {
                    bool flag2 = !_active || (__instance.InLocomotion && __instance.NextIsLocomotion);
                    if (flag2)
                    {
                        result = true;
                    }
                    else
                    {
                        bool flag3 = __instance.ShieldEquipped || __instance.CurrentWeapon == null || !SkillRequirements.CanParryCancelnimations(__instance);
                        if (flag3)
                        {
                            result = true;
                        }
                        else
                        {
                            int  num   = (int)At.GetValue(typeof(Character), __instance, "m_dodgeAllowedInAction");
                            bool flag4 = num > 0 && __instance.NextAtkAllowed > 0;
                            if (flag4)
                            {
                                __instance.photonView.RPC("SendBlockStateTrivial", 0, new object[]
                                {
                                    true
                                });
                                __instance.StealthInput(false);
                                result = false;
                            }
                            else
                            {
                                result = true;
                            }
                        }
                    }
                }
            }
            return(result);
        }
示例#6
0
 // Token: 0x0600000C RID: 12 RVA: 0x00002B54 File Offset: 0x00000D54
 private void OnSceneLoaded()
 {
     foreach (GameObject gameObject in Resources.FindObjectsOfTypeAll <GameObject>().Where(delegate(GameObject x)
     {
         bool result;
         if (x.name == "HumanSNPC_Blacksmith")
         {
             Merchant componentInChildren = x.GetComponentInChildren <Merchant>();
             result = ((((componentInChildren != null) ? componentInChildren.ShopName : null) ?? "") == "Vyzyrinthrix the Blacksmith");
         }
         else
         {
             result = false;
         }
         return(result);
     }))
     {
         GuaranteedDrop[] componentsInChildren = gameObject.GetComponentsInChildren <GuaranteedDrop>();
         GuaranteedDrop   guaranteedDrop;
         if (componentsInChildren == null)
         {
             guaranteedDrop = null;
         }
         else
         {
             guaranteedDrop = componentsInChildren.FirstOrDefault((GuaranteedDrop table) => table.ItemGenatorName == "Recipes");
         }
         GuaranteedDrop guaranteedDrop2 = guaranteedDrop;
         bool           flag            = guaranteedDrop2 != null;
         if (flag)
         {
             List <BasicItemDrop> list = At.GetValue(typeof(GuaranteedDrop), guaranteedDrop2, "m_itemDrops") as List <BasicItemDrop>;
             bool flag2 = list != null;
             if (flag2)
             {
                 foreach (Item droppedItem in new Item[]
                 {
                     this.blessedLongswordRecipeInstance,
                     this.divineLongswordRecipeInstance
                 })
                 {
                     list.Add(new BasicItemDrop
                     {
                         DroppedItem  = droppedItem,
                         MaxDropCount = 1,
                         MinDropCount = 1
                     });
                 }
             }
         }
     }
 }
        public static void Postfix(CharacterEquipment __instance, ref float __result, ref DamageType.Types _type)
        {
            Character character = At.GetValue(typeof(CharacterEquipment), __instance, "m_character") as Character;
            bool      flag      = character != null;

            if (flag)
            {
                bool flag2 = (SkillRequirements.CanAddProtectionToPhysicalResistance(character) && _type == DamageType.Types.Physical) || SkillRequirements.CanAddProtectionToAnyDamageResistance(character);
                if (flag2)
                {
                    __result += __instance.GetEquipmentDamageProtection(DamageType.Types.Physical);
                }
            }
        }
示例#8
0
        public void ApplyToCharacter(Character character)
        {
            // set faction
            character.ChangeFaction(Faction);

            // gear
            TryEquip(character, Weapon);
            TryEquip(character, Shield);

            // AI
            var ai = character.GetComponent <CharacterAI>();

            foreach (var state in ai.AiStates)
            {
                if (state is AISCombat aisCombat)
                {
                    aisCombat.CanDodge = CanDodge;
                    aisCombat.CanBlock = CanBlock;
                }
            }

            // stats
            var stats = character.GetComponent <CharacterStats>();

            var m_maxHealthStat = (Stat)At.GetValue(typeof(CharacterStats), stats, "m_maxHealthStat");

            m_maxHealthStat.AddStack(new StatStack(StatSourceID, Health - 100), false);

            var m_impactResistance = (Stat)At.GetValue(typeof(CharacterStats), stats, "m_impactResistance");

            m_impactResistance.AddStack(new StatStack(StatSourceID, ImpactResist), false);

            var m_damageProtection = (Stat[])At.GetValue(typeof(CharacterStats), stats, "m_damageProtection");

            m_damageProtection[0].AddStack(new StatStack(StatSourceID, Protection), false);

            var m_damageResistance = (Stat[])At.GetValue(typeof(CharacterStats), stats, "m_damageResistance");

            for (int i = 0; i < 6; i++)
            {
                m_damageResistance[i].AddStack(new StatStack(StatSourceID, Damage_Resists[i]), false);
            }

            var m_damageTypesModifier = (Stat[])At.GetValue(typeof(CharacterStats), stats, "m_damageTypesModifier");

            for (int i = 0; i < 6; i++)
            {
                m_damageTypesModifier[i].AddStack(new StatStack(StatSourceID, Damage_Bonus[i]), false);
            }
        }
示例#9
0
        public static bool Prefix(SkillTreeSlotDisplay __instance, SkillTreeSlotDisplay _slotToLink)
        {
            RectTransform rectTransform = At.GetValue(typeof(SkillTreeSlotDisplay), __instance, "m_link") as RectTransform;
            bool          flag          = rectTransform != null;

            if (flag)
            {
                rectTransform.gameObject.SetActive(true);
                Rect rect = rectTransform.rect;
                rect.height             = Vector2.Distance(_slotToLink.RectTransform.anchoredPosition, __instance.RectTransform.anchoredPosition);
                rectTransform.sizeDelta = rect.size;
                Vector2 vector = _slotToLink.RectTransform.anchoredPosition - __instance.RectTransform.anchoredPosition;
                float   num    = Mathf.Atan2(vector.y, vector.x) * 57.29578f;
                rectTransform.rotation = Quaternion.Euler(0f, 0f, num - 90f);
            }
            return(false);
        }
示例#10
0
        public static void Prefix(CharacterEquipment __instance, out Tuple <float?, Stat, Character> __state)
        {
            __state = null;
            Character character = At.GetValue(typeof(CharacterEquipment), __instance, "m_character") as Character;
            bool      flag      = character != null && SkillRequirements.CanReduceMoveSpeedArmorPenalty(character);

            if (flag)
            {
                CharacterStats stats = character.Stats;
                Stat           stat  = At.GetValue(typeof(CharacterStats), stats, "m_equipementPenalties") as Stat;
                bool           flag2 = stat != null;
                if (flag2)
                {
                    __state = new Tuple <float?, Stat, Character>(new float?(stat.CurrentValue), stat, character);
                    At.SetValue <float>(__state.Item1.Value * JuggernautFormulas.GetUnyieldingMovementSpeedForgivenes(character), typeof(Stat), stat, "m_currentValue");
                }
            }
        }
        public static void Postfix(CharacterStats __instance, ref float _amount, ref Tuple <Character, float, int, StatusEffect> __state)
        {
            bool flag = __state != null;

            if (flag)
            {
                _amount = __state.Item2;
                for (int i = 0; i < __state.Item3; i++)
                {
                    __state.Item4.RemoveOldestStack();
                }
            }
            Character character = (Character)At.GetValue(typeof(CharacterStats), __instance, "m_character");
            bool      flag2     = character != null && character.Inventory.SkillKnowledge.IsItemLearned(2502002) && (character.StatusEffectMngr.HasStatusEffect("Bless") || character.StatusEffectMngr.HasStatusEffect("Bless Amplified"));

            if (flag2)
            {
                character.Stats.AffectStamina(_amount * 1f);
            }
        }
示例#12
0
 // Token: 0x0600000B RID: 11 RVA: 0x00002574 File Offset: 0x00000774
 private void OnSceneLoaded()
 {
     foreach (GameObject gameObject in from x in Resources.FindObjectsOfTypeAll <GameObject>()
              where x.name == "UNPC_LaineAberforthA" || x.name == "HumanSNPC_CounterAlchemist"
              select x)
     {
         GuaranteedDrop[] componentsInChildren = gameObject.GetComponentsInChildren <GuaranteedDrop>();
         GuaranteedDrop   guaranteedDrop;
         if (componentsInChildren == null)
         {
             guaranteedDrop = null;
         }
         else
         {
             guaranteedDrop = componentsInChildren.FirstOrDefault((GuaranteedDrop table) => table.ItemGenatorName == "Recipes");
         }
         GuaranteedDrop guaranteedDrop2 = guaranteedDrop;
         bool           flag            = guaranteedDrop2 != null;
         if (flag)
         {
             List <BasicItemDrop> list = At.GetValue(typeof(GuaranteedDrop), guaranteedDrop2, "m_itemDrops") as List <BasicItemDrop>;
             bool flag2 = list != null;
             if (flag2)
             {
                 foreach (Item droppedItem in new Item[]
                 {
                     this.runicScrollRecipeInstance
                 })
                 {
                     list.Add(new BasicItemDrop
                     {
                         DroppedItem  = droppedItem,
                         MaxDropCount = 1,
                         MinDropCount = 1
                     });
                 }
             }
         }
     }
 }
        public static void Postfix(CharacterStats __instance, ref DamageList _damages)
        {
            Character character = At.GetValue(typeof(CharacterStats), __instance, "m_character") as Character;
            bool      flag      = character != null;

            if (flag)
            {
                bool flag2 = SkillRequirements.CanAddBonusRageDamage(character);
                if (flag2)
                {
                    _damages *= 1f + JuggernautFormulas.GetRuthlessDamageBonus(character);
                }
                bool flag3 = SkillRequirements.CanConvertToRawDamage(character);
                if (flag3)
                {
                    float totalDamage            = _damages.TotalDamage;
                    float ruthlessRawDamageRatio = JuggernautFormulas.GetRuthlessRawDamageRatio(character);
                    _damages *= 1f - ruthlessRawDamageRatio;
                    _damages.Add(new DamageType(DamageType.Types.Raw, totalDamage * ruthlessRawDamageRatio));
                }
            }
        }
        public static void Prefix(CharacterStats __instance, ref float _amount, out Tuple <Character, float, int, StatusEffect> __state)
        {
            __state = null;
            Character character = At.GetValue(typeof(CharacterStats), __instance, "m_character") as Character;
            bool      flag      = character != null && character.StatusEffectMngr != null;

            if (flag)
            {
                StatusEffect statusEffectOfName = character.StatusEffectMngr.GetStatusEffectOfName(Templar.Instance.burstOfDivinityInstance.IdentifierName);
                bool         flag2 = statusEffectOfName != null;
                if (flag2)
                {
                    int  num   = statusEffectOfName.StackCount;
                    bool flag3 = num > 0;
                    if (flag3)
                    {
                        num = Math.Min(Convert.ToInt32(Math.Ceiling((double)(_amount / 7f))), num);
                        float item = _amount;
                        __state = new Tuple <Character, float, int, StatusEffect>(character, item, num, statusEffectOfName);
                        _amount = Mathf.Max(0f, _amount - (float)num * 7f);
                    }
                }
            }
        }
示例#15
0
        private void WindowFunction(int id)
        {
            GUI.DragWindow(new Rect(0, 0, m_rect.width - 35, 23));
            if (GUI.Button(new Rect(m_rect.width - 30, 2, 30, 20), "X"))
            {
                ShowMenu = false;
                return;
            }

            GUILayout.BeginArea(new Rect(5, 20, m_rect.width - 10, m_rect.height - 15));

            GUILayout.Space(20);

            if (SelectedEnchant != null)
            {
                if (GUILayout.Button("< Back to Enchantments"))
                {
                    SelectedEnchant = null;
                }
                GUILayout.Label("Selected Enchant: <b><color=orange>" + SelectedEnchant.Name + "</color></b>");
            }

            GUILayout.BeginHorizontal();
            GUILayout.Label("Selected Slot: " + SelectedSlot.ToString(), GUILayout.Width(m_rect.width - 70));
            if (GUILayout.Button("<", GUILayout.Width(25)))
            {
                SetEnum(ref SelectedSlot, -1);
            }
            if (GUILayout.Button(">", GUILayout.Width(25)))
            {
                SetEnum(ref SelectedSlot, 1);
            }
            GUILayout.EndHorizontal();

            var character = CharacterManager.Instance.GetFirstLocalCharacter();

            if (character)
            {
                var equipment = (Equipment)character.Inventory.GetEquippedItem(SelectedSlot);

                if (equipment)
                {
                    GUILayout.Label("<b>Equipped:</b> <color=orange>" + equipment.Name + "</color>");

                    if (equipment.IsEnchanted)
                    {
                        GUI.color = Color.red;
                        var enchant = equipment.GetComponentInChildren <Enchantment>();
                        if (GUILayout.Button("Remove Enchantment (" + enchant.Name + ")"))
                        {
                            enchant.UnapplyEnchantment();
                            var ids = (List <int>)At.GetValue(typeof(Equipment), equipment, "m_enchantmentIDs");
                            ids.Clear();
                            At.Call(typeof(Equipment), equipment, "RefreshEnchantmentModifiers", null, new object[0]);
                        }
                    }
                    else if (SelectedEnchant != null)
                    {
                        GUI.color = Color.green;
                        if (GUILayout.Button("Apply Selected Enchant"))
                        {
                            equipment.AddEnchantment(SelectedEnchant.PresetID, false);
                        }
                    }
                    GUI.color = Color.white;
                }
                else
                {
                    GUI.color = Color.red;
                    GUILayout.Label("No item equipped in " + SelectedSlot.ToString() + " slot!");
                }
            }
            GUI.color = Color.white;

            if (SelectedEnchant == null)
            {
                GUILayout.Label("Enter an Enchantment ID to search for...");
                SearchText = GUILayout.TextField(SearchText);

                GUILayout.BeginVertical(GUI.skin.box);
                scroll = GUILayout.BeginScrollView(scroll);
                var search = SearchText.ToLower();
                foreach (var entry in m_cachedEnchantments)
                {
                    if (search == "" || entry.Key.ToLower().Contains(search))
                    {
                        if (GUILayout.Button(entry.Key))
                        {
                            SelectedEnchant = entry.Value;
                        }
                    }
                }
                GUILayout.EndScrollView();
                GUILayout.EndVertical();
            }

            GUILayout.EndArea();
        }
        public static bool Prefix(StatusEffectManager __instance, ref StatusEffect _statusEffect)
        {
            StatusEffect statusEffect  = _statusEffect;
            IList <Tag>  inheritedTags = statusEffect.InheritedTags;
            Character    character     = null;
            bool         flag;

            if (statusEffect != null && statusEffect.HasMatch(TagSourceManager.Boon))
            {
                character = (At.GetValue(typeof(StatusEffectManager), __instance, "m_character") as Character);
                flag      = (character != null);
            }
            else
            {
                flag = false;
            }
            bool flag2 = flag;

            if (flag2)
            {
                bool?flag3 = null;
                bool flag4 = SkillRequirements.ShouldPurgeAllExceptRageGivenEnraged(character) && (SkillRequirements.Enraged(character) || SkillRequirements.IsRageEffect(statusEffect));
                if (flag4)
                {
                    flag3 = new bool?(false);
                }
                bool flag5 = SkillRequirements.ShouldPurgeOnlyRageGivenDisciplined(character) && (SkillRequirements.Disciplined(character) || SkillRequirements.IsDisciplineEffect(statusEffect));
                if (flag5)
                {
                    flag3 = new bool?(true);
                }
                bool flag6 = flag3 != null;
                if (flag6)
                {
                    bool?flag8;
                    foreach (StatusEffect statusEffect2 in __instance.Statuses)
                    {
                        bool flag9;
                        if (statusEffect2.HasMatch(TagSourceManager.Boon))
                        {
                            bool flag7 = SkillRequirements.IsRageEffect(statusEffect2);
                            flag8 = flag3;
                            flag9 = (flag7 == flag8.GetValueOrDefault() & flag8 != null);
                        }
                        else
                        {
                            flag9 = false;
                        }
                        bool flag10 = flag9;
                        if (flag10)
                        {
                            statusEffect2.IncreaseAge(Convert.ToInt32(statusEffect2.RemainingLifespan));
                        }
                    }
                    bool flag11 = SkillRequirements.IsRageEffect(statusEffect);
                    flag8 = flag3;
                    bool flag12 = flag11 == flag8.GetValueOrDefault() & flag8 != null;
                    if (flag12)
                    {
                        return(false);
                    }
                }
            }
            return(true);
        }
示例#17
0
        // Token: 0x06000006 RID: 6 RVA: 0x000022B4 File Offset: 0x000004B4
        public static void SetupTrainerClientSide(GameObject juggernautGameObject, int trainerViewID)
        {
            GameObject gameObject = new GameObject("UNPC_The Juggernaut");

            gameObject.transform.position             = JuggernautTrainer.TrainerLocation;
            juggernautGameObject.transform.parent     = gameObject.transform;
            juggernautGameObject.transform.position   = gameObject.transform.position;
            juggernautGameObject.transform.rotation   = Quaternion.Euler(0f, 220.5518f, 0f);
            juggernautGameObject.transform.localScale = new Vector3(1.15f, 1.15f, 1.15f);
            UnityEngine.Object.DestroyImmediate(juggernautGameObject.GetComponent <StartingEquipment>());
            Character component = juggernautGameObject.GetComponent <Character>();

            component.Stats.enabled = false;
            Weapon currentWeapon = component.CurrentWeapon;
            bool   flag          = currentWeapon != null && currentWeapon.TwoHanded;

            if (flag)
            {
                component.LeftHandEquipment = component.CurrentWeapon;
                component.LeftHandChanged();
            }
            component.Sheathed = false;
            GameObject gameObject2 = UnityEngine.Object.Instantiate(Resources.Load("editor/templates/TrainerTemplate")) as GameObject;

            gameObject2.transform.parent   = juggernautGameObject.transform;
            gameObject2.transform.position = juggernautGameObject.transform.position;
            gameObject2.transform.rotation = juggernautGameObject.transform.rotation;
            DialogueActor componentInChildren = gameObject2.GetComponentInChildren <DialogueActor>();

            componentInChildren.SetName("The Juggernaut");
            Trainer componentInChildren2 = gameObject2.GetComponentInChildren <Trainer>();

            At.SetValue <UID>(JuggernautMod.juggernautTreeInstance.UID, typeof(Trainer), componentInChildren2, "m_skillTreeUID");
            DialogueTreeController componentInChildren3 = gameObject2.GetComponentInChildren <DialogueTreeController>();
            Graph graph = componentInChildren3.graph;
            List <DialogueTree.ActorParameter> list = At.GetValue(typeof(DialogueTree), graph as DialogueTree, "_actorParameters") as List <DialogueTree.ActorParameter>;

            list[0].actor = componentInChildren;
            list[0].name  = componentInChildren.name;
            List <Node>      list2            = At.GetValue(typeof(Graph), graph, "_nodes") as List <Node>;
            StatementNodeExt statementNodeExt = graph.AddNode <StatementNodeExt>();

            statementNodeExt.statement = new Statement("What do you want, peasant?");
            statementNodeExt.SetActorName(componentInChildren.name);
            MultipleChoiceNodeExt multipleChoiceNodeExt = graph.AddNode <MultipleChoiceNodeExt>();

            multipleChoiceNodeExt.availableChoices.Add(new MultipleChoiceNodeExt.Choice
            {
                statement = new Statement
                {
                    text = "I wish to become a legend like you!"
                }
            });
            multipleChoiceNodeExt.availableChoices.Add(new MultipleChoiceNodeExt.Choice
            {
                statement = new Statement
                {
                    text = "Who are you?"
                }
            });
            ActionNode actionNode = list2[1] as ActionNode;

            (actionNode.action as TrainDialogueAction).Trainer = new BBParameter <Trainer>(componentInChildren2);
            StatementNodeExt statementNodeExt2 = graph.AddNode <StatementNodeExt>();

            statementNodeExt2.statement = new Statement("Hah! Like you don't know... Everyone knows me, I'm a living legend known as \"The Juggernaut\"!");
            statementNodeExt2.SetActorName(componentInChildren.name);
            list2.Clear();
            list2.Add(statementNodeExt);
            list2.Add(multipleChoiceNodeExt);
            list2.Add(actionNode);
            list2.Add(statementNodeExt2);
            graph.primeNode = statementNodeExt;
            graph.ConnectNodes(statementNodeExt, multipleChoiceNodeExt, -1, -1);
            graph.ConnectNodes(multipleChoiceNodeExt, actionNode, 0, -1);
            graph.ConnectNodes(multipleChoiceNodeExt, statementNodeExt2, 1, -1);
            graph.ConnectNodes(statementNodeExt2, statementNodeExt, -1, -1);
            gameObject.SetActive(true);
        }
示例#18
0
        // Token: 0x06000007 RID: 7 RVA: 0x0000225C File Offset: 0x0000045C
        public static bool AdaptGrip(Character __instance, ref int _type, ref int _id)
        {
            Weapon weapon = (__instance != null) ? __instance.CurrentWeapon : null;
            bool   flag   = weapon == null;
            bool   result;

            if (flag)
            {
                result = false;
            }
            else
            {
                bool flag2 = _type == 2502;
                if (flag2)
                {
                    MeleeSkill meleeSkill = At.GetValue(typeof(Character), __instance, "m_lastUsedSkill") as MeleeSkill;
                    bool       flag3      = meleeSkill != null && meleeSkill.ActivateEffectAnimType == Character.SpellCastType.WeaponSkill1;
                    if (flag3)
                    {
                        bool flag4 = meleeSkill.RequiredWeaponTypes[0] != weapon.Type;
                        if (flag4)
                        {
                            CustomWeaponBehaviour.ChangeGrip(__instance, meleeSkill.RequiredWeaponTypes[0]);
                            return(true);
                        }
                    }
                }
                bool flag5 = weapon.HasTag(CustomWeaponBehaviour.FinesseTag);
                if (flag5)
                {
                    bool flag6 = _type == 1 && !BehaviourManager.IsComboAttack(__instance, _type, _id);
                    if (flag6)
                    {
                        CustomWeaponBehaviour.ChangeGrip(__instance, Weapon.WeaponType.Axe_1H);
                        return(true);
                    }
                }
                bool flag7 = BehaviourManager.IsHalfHandedMode(weapon);
                if (flag7)
                {
                    bool flag8 = _type == 1 && !BehaviourManager.IsComboAttack(__instance, _type, _id);
                    if (flag8)
                    {
                        CustomWeaponBehaviour.ChangeGrip(__instance, Weapon.WeaponType.Spear_2H);
                        return(true);
                    }
                }
                bool flag9 = BehaviourManager.IsBastardMode(weapon);
                if (flag9)
                {
                    Weapon.WeaponType?bastardType = BehaviourManager.GetBastardType(weapon.Type);
                    Weapon.WeaponType valueOrDefault;
                    bool flag10;
                    if (bastardType != null)
                    {
                        valueOrDefault = bastardType.GetValueOrDefault();
                        flag10         = true;
                    }
                    else
                    {
                        flag10 = false;
                    }
                    bool flag11 = flag10;
                    if (flag11)
                    {
                        bool flag12 = _type != 2502;
                        if (flag12)
                        {
                            CustomWeaponBehaviour.ChangeGrip(__instance, valueOrDefault);
                            return(true);
                        }
                    }
                }
                result = false;
            }
            return(result);
        }