Ejemplo n.º 1
0
            private static void Postfix(SpellTelekinesis spellTelekinesis, HandleRagdoll __instance)
            {
                try
                {
                    var ragdollPart = __instance.ragdollPart;
                    if (spellTelekinesis.spellCaster.spellInstance.id == "DarkChains")
                    {
                        try
                        {
                            if (ragdollPart.ragdoll.creature.gameObject.GetComponent <FrozenCreature>() != null)
                            {
                                ragdollPart.characterJoint.breakForce = 20000;
                            }
                        }
                        catch (Exception exception)
                        {
                            Debug.Log(exception.Message);
                        }
                    }

                    try
                    {
                        Object.Destroy(ragdollPart.gameObject.GetComponent <FrozenRagdollPart>());
                    }
                    catch (Exception exception)
                    {
                        Debug.Log(exception.Message);
                    }
                }
                catch (Exception exception)
                {
                    __instance.GetComponentInParent <Rigidbody>().isKinematic = false;
                    Debug.Log(exception.Message);
                }
            }
Ejemplo n.º 2
0
            private static void Postfix(SpellTelekinesis spellTelekinesis, ref bool throwing,
                                        HandleRagdoll __instance)
            {
                try
                {
                    if (!throwing && spellTelekinesis.spellCaster.spellInstance.id == "DarkChains")
                    {
                        var ragdollPart = __instance.ragdollPart;
                        ragdollPart.ResetCharJointBreakForce();
                        if (ragdollPart.gameObject.GetComponent <FrozenRagdollPart>() == null)
                        {
                            var frozenRagdollPart = ragdollPart.gameObject.AddComponent <FrozenRagdollPart>();

                            frozenRagdollPart.Init(__instance);
                        }

                        try
                        {
                            var creature = ragdollPart.ragdoll.creature;
                            if (creature.gameObject.GetComponent <FrozenCreature>() == null)
                            {
                                creature.gameObject.AddComponent <FrozenCreature>();
                            }
                        }
                        catch (Exception exception)
                        {
                            Debug.Log(exception.Message);
                        }
                    }
                }
                catch (Exception exception)
                {
                    if (!throwing && spellTelekinesis.spellCaster.spellInstance.id == "DarkChains")
                    {
                        __instance.GetComponentInParent <Rigidbody>().isKinematic = true;
                    }

                    Debug.Log(exception.Message);
                }
            }