public static void SetupSummon() { var summon = ResourcesPrefabManager.Instance.GetItemPrefab(8890103) as Skill; // destroy the existing skills, but keep the rest (VFX / Sound). GameObject.DestroyImmediate(summon.transform.Find("Lightning").gameObject); GameObject.DestroyImmediate(summon.transform.Find("SummonSoul").gameObject); var effects = new GameObject("Effects"); effects.transform.parent = summon.transform; effects.AddComponent <SummonSkeleton>(); // setup custom blade visuals try { var blade = ResourcesPrefabManager.Instance.GetItemPrefab(2598500) as Weapon; var bladeVisuals = CustomItemVisuals.GetOrAddVisualLink(blade).ItemVisuals; if (bladeVisuals.transform.Find("Weapon3DVisual").GetComponent <MeshRenderer>() is MeshRenderer mesh) { mesh.material.color = new Color(-0.5f, 1.5f, -0.5f); } } catch { } //// make sure the config is applied from the save //SummonManager.Skeleton.Health = NecromancerMod.settings.Summon_MaxHealth; //SummonManager.Skeleton.HealthRegen = NecromancerMod.settings.Summon_HealthLoss; //SummonManager.Ghost.Health = NecromancerMod.settings.StrongSummon_MaxHealth; //SummonManager.Ghost.HealthRegen = NecromancerMod.settings.StrongSummon_HealthLoss; }
//public static float LifeSpan = 40f; #region Plague Aura Skill Setup // this also sets up the PlagueTendrils effect. public static void SetupPlagueAura() { // 8890107 var plagueSkill = ResourcesPrefabManager.Instance.GetItemPrefab(8890107) as Skill; // destroy wind altar condition Destroy(plagueSkill.transform.Find("AdditionalActivationConditions").gameObject); // setup skill plagueSkill.CastSheathRequired = -1; plagueSkill.RequiredItems = new Skill.ItemRequired[0]; // get the Summon component, change to custom activation fx var effects = plagueSkill.transform.Find("Effects").gameObject; var origSummon = effects.GetComponent <Summon>(); var plagueAuraComp = effects.AddComponent <PlagueAura>(); At.InheritBaseValues(plagueAuraComp, origSummon); Destroy(origSummon); // ======== set summoned prefab to our custom activated item (loaded with sideloader) ======== var plagueStone = ResourcesPrefabManager.Instance.GetItemPrefab(8999050); plagueAuraComp.SummonedPrefab = plagueStone.transform; var ephemeral = plagueStone.GetComponent <Ephemeral>(); ephemeral.LifeSpan = NecromancyBase.settings.PlagueAura_SigilLifespan; //// setup custom visuals //var origVisuals = plagueStone.GetComponent<Item>().VisualPrefab; //origVisuals.gameObject.SetActive(false); //var newVisuals = Instantiate(origVisuals.gameObject); //DontDestroyOnLoad(newVisuals); //origVisuals.gameObject.SetActive(true); var newVisuals = CustomItemVisuals.GetOrAddVisualLink(plagueStone).ItemVisuals; var magiccircle = newVisuals.transform.Find("mdl_fx_magicCircle"); // destroy rotating bolt fx Destroy(magiccircle.transform.Find("FX_Bolt").gameObject); // setup the clouds if (newVisuals.transform.Find("mdl_itm_firestone") is Transform t) { t.parent = magiccircle; Destroy(t.Find("FX_Bolt").gameObject); var ps = t.Find("smoke_desu").GetComponent <ParticleSystem>(); var m = ps.main; m.startColor = Color.green; t.Find("smoke_desu").position += Vector3.down * 3.2f; } // setup the Plague Tendrils effect (from inside that class) PlagueTendrils.SetupPlagueTendrils(effects); }
public static void OnPacksLoaded() { // setup custom mana projectile var manaArrow = ResourcesPrefabManager.Instance.GetItemPrefab(ManaArrowID) as Ammunition; // set empty equipped visuals (hide quiver) var vLink = CustomItemVisuals.GetOrAddVisualLink(manaArrow); vLink.ItemSpecialVisuals = new GameObject("ManaQuiverDummy").transform; GameObject.DontDestroyOnLoad(vLink.ItemSpecialVisuals.gameObject); // custom arrow ProjectileItem component (determines the ammunition behaviour as projectile) var origProjFX = manaArrow.ProjectileFXPrefab.gameObject; origProjFX.SetActive(false); manaArrow.ProjectileFXPrefab = GameObject.Instantiate(origProjFX).transform; origProjFX.SetActive(true); GameObject.DontDestroyOnLoad(manaArrow.ProjectileFXPrefab.gameObject); var projItem = manaArrow.ProjectileFXPrefab.GetComponent <ProjectileItem>(); projItem.CollisionBehavior = ProjectileItem.CollisionBehaviorTypes.Destroyed; projItem.EphemeralProjectile = true; projItem.m_itemID = ManaArrowID; projItem.m_item = ResourcesPrefabManager.Instance.GetItemPrefab(ManaArrowID); var raycast = projItem.GetComponent <RaycastProjectile>(); raycast.ProjectileVisualsToDisable = projItem.gameObject; raycast.ImpactSoundMaterial = EquipmentSoundMaterials.Goo; // yield the OnPacksLoaded call (and wait a second just in case) so we can be sure other mods have loaded. ManaBowPlugin.Instance.StartCoroutine(LateFix()); }
public static void SetupManaArrow() { Debug.Log("Setting up mana arrow"); // setup custom mana projectile var manaArrow = ResourcesPrefabManager.Instance.GetItemPrefab(ManaArrowID) as Ammunition; // set empty equipped visuals (hide quiver) var vLink = CustomItemVisuals.GetOrAddVisualLink(manaArrow); vLink.ItemSpecialVisuals = new GameObject("ManaQuiverDummy").transform; GameObject.DontDestroyOnLoad(vLink.ItemSpecialVisuals.gameObject); // custom arrow ProjectileItem component (determines the ammunition behaviour as projectile) var origProjFX = manaArrow.ProjectileFXPrefab.gameObject; origProjFX.SetActive(false); manaArrow.ProjectileFXPrefab = GameObject.Instantiate(origProjFX).transform; origProjFX.SetActive(true); GameObject.DontDestroyOnLoad(manaArrow.ProjectileFXPrefab.gameObject); var projItem = manaArrow.ProjectileFXPrefab.GetComponent <ProjectileItem>(); projItem.CollisionBehavior = ProjectileItem.CollisionBehaviorTypes.Destroyed; projItem.EphemeralProjectile = true; At.SetField(projItem, "m_itemID", ManaArrowID); At.SetField(projItem, "m_item", ResourcesPrefabManager.Instance.GetItemPrefab(ManaArrowID)); var raycast = projItem.GetComponent <RaycastProjectile>(); raycast.ProjectileVisualsToDisable = projItem.gameObject; raycast.ImpactSoundMaterial = EquipmentSoundMaterials.Goo; }