Exemplo n.º 1
0
        public static GameObject Get(
            //string ownerName = "RRRN_Ashe",
            string weaponName     = "BowHuntsman",
            string projectileName = "bow_projectile_frost"
            )
        {
            //Increase scale of bows

            bool       alreadyExisted = false;
            GameObject clone          = RRRLateLoadPrefabs.CloneRepeatable(ref alreadyExisted, weaponName, "AsheBow", regOdb: true);

            if (alreadyExisted)
            {
                return(clone);
            }

            Transform transform = clone.transform;

            transform.localScale = new Vector3(1.1f, 1.1f, 1.1f);

            ItemDrop component = clone.GetComponent <ItemDrop>();

            if ((UnityEngine.Object)component == (UnityEngine.Object)null)
            {
                throw new NullReferenceException("No ItemDrop component in prefab: " + weaponName);
            }
            ItemDrop.ItemData.SharedData shared = component.m_itemData.m_shared;

            shared.m_name          = "Ashe Bow";
            shared.m_description   = "Ashe's Mighty Volley Attack";
            shared.m_useDurability = false;
            shared.m_ammoType      = "";

            shared.m_damages.m_frost  = 12f;
            shared.m_damages.m_pierce = 15f;

            shared.m_aiAttackRange    = 40f;
            shared.m_aiAttackRangeMin = 10f;
            shared.m_aiAttackMaxAngle = 10f;
            shared.m_aiAttackInterval = 20f;

            shared.m_attackForce                    = 15f;
            shared.m_attack.m_projectileVel         = 40f;
            shared.m_attack.m_projectileAccuracy    = 75f;
            shared.m_attack.m_projectileAccuracyMin = 100f;
            shared.m_attack.m_projectiles           = 3;
            shared.m_attack.m_attackProjectile      = ZNetScene.instance.GetPrefab(projectileName);

            return(clone);
        }
Exemplo n.º 2
0
        public static GameObject Get(
            //string ownerName = "RRRN_Ashe",
            string weapoName = "KnifeChitin"
            )
        {
            bool       alreadyExisted = false;
            GameObject clone          = RRRLateLoadPrefabs.CloneRepeatable(ref alreadyExisted, weapoName, "AsheKnife", regOdb: true);

            if (alreadyExisted)
            {
                return(clone);
            }

            ItemDrop component = clone.GetComponent <ItemDrop>();

            if ((UnityEngine.Object)component == (UnityEngine.Object)null)
            {
                throw new NullReferenceException("No ItemDrop component in prefab: " + weapoName);
            }

            ItemDrop.ItemData.SharedData shared = component.m_itemData.m_shared;

            shared.m_name          = "Ashe Knife";
            shared.m_description   = "Ashe's Mighty Knife";
            shared.m_useDurability = false;

            shared.m_damages.m_frost  = 5;
            shared.m_damages.m_pierce = 4;
            shared.m_damages.m_slash  = 4;

            shared.m_aiAttackRangeMin = 0f;
            shared.m_aiAttackRange    = 1.5f;
            shared.m_aiAttackInterval = 0.8f;

            /*
             * GameObject freezingVFX = RRRLateLoadPrefabs.Clone("vfx_Freezing", "newFreeze", true, true);
             * //GameObject arrowSFX = RRRLateLoadPrefabs.Clone("sfx_arrow_hit", "newHit", true, true);
             * //ZSFX zSFX = arrowSFX.GetComponent<ZSFX>();
             * //EffectList effectDatas = new EffectList(); // RRRLateLoadPrefabs.Clone("skeleton_sword", "newEffects", true, true).GetComponent<EffectList>();
             * //effectDatas.m_effectPrefabs[0].m_prefab = freezingVFX;
             * //effectDatas.m_effectPrefabs[1].m_prefab = arrowSFX;
             * shared.m_hitEffect.m_effectPrefabs[0].m_prefab = freezingVFX;
             */
            return(clone);
        }
Exemplo n.º 3
0
        public static GameObject Get(
            //string ownerName = "RRRN_Ashe",
            string weaponName     = "BowHuntsman",
            string projectileName = "bow_projectile_frost"
            )
        {
            bool       alreadyExisted = false;
            GameObject clone          = RRRLateLoadPrefabs.CloneRepeatable(ref alreadyExisted, weaponName, "AsheBow4", regOdb: true);

            if (alreadyExisted)
            {
                return(clone);
            }

            Transform transform = clone.transform;

            transform.localScale = new Vector3(1.1f, 1.1f, 1.1f);

            ItemDrop component = clone.GetComponent <ItemDrop>();

            if ((UnityEngine.Object)component == (UnityEngine.Object)null)
            {
                throw new NullReferenceException("No ItemDrop component in prefab: " + weaponName);
            }
            ItemDrop.ItemData.SharedData shared = component.m_itemData.m_shared;

            shared.m_name          = "Ashe Bow";
            shared.m_description   = "Ashe's Mighty Ultimate!";
            shared.m_useDurability = false;
            shared.m_ammoType      = "";
            shared.m_attackForce   = 2f;

            shared.m_damages.m_frost  = 60f;
            shared.m_damages.m_pierce = 0;

            shared.m_aiAttackRange    = 50f;
            shared.m_aiAttackRangeMin = 16f;
            shared.m_aiAttackInterval = 40f;
            //shared.m_aiAttackInterval = 8f;
            shared.m_aiAttackMaxAngle = 13f;

            shared.m_attack.m_projectileVel = 4f;

            GameObject ulty       = RRRLateLoadPrefabs.Clone("bow_projectile_frost", "newFrosty", true, true);
            Projectile projectile = ulty.GetComponent <Projectile>();

            projectile.m_gravity = 0f;
            projectile.m_aoe     = 1.5f;
            projectile.m_hitEffects.m_effectPrefabs[0].m_scale = true;
            projectile.m_hitEffects.m_effectPrefabs[1].m_scale = true;


            GameObject boom = RRRLateLoadPrefabs.Clone("sfx_ice_destroyed", "newIce", true, true);
            ZSFX       zSFX = boom.GetComponent <ZSFX>();

            zSFX.m_minVol   = 20f;
            zSFX.m_maxVol   = 25f;
            zSFX.m_minPitch = 1.3f;
            zSFX.m_maxPitch = 1.5f;
            zSFX.m_useCustomReverbDistance = true;
            zSFX.m_customReverbDistance    = 50f;
            projectile.m_hitEffects.m_effectPrefabs[0].m_prefab = boom;

            shared.m_attack.m_attackProjectile = ulty;

            Transform transformProj = ulty.transform;

            transformProj.localScale = new Vector3(3.5f, 3.5f, 2f);

            return(clone);
        }
Exemplo n.º 4
0
        public static GameObject Get(
            GameObject owner,
            string weaponName = "BowHuntsman",
            //string animationName = "spear_throw"
            string projectileName = "GoblinShaman_projectile_fireball"
            )
        {
            bool       alreadyExisted = false;
            GameObject clone          = RRRLateLoadPrefabs.CloneRepeatable(ref alreadyExisted, weaponName, "Fireball", regOdb: true);

            if (alreadyExisted)
            {
                return(clone);
            }

            /*
             * Transform transform = clone.transform;
             * transform.localScale = new Vector3(1.1f, 1.1f, 1.1f);
             */
            ItemDrop component = clone.GetComponent <ItemDrop>();

            if ((UnityEngine.Object)component == (UnityEngine.Object)null)
            {
                throw new NullReferenceException("No ItemDrop component in prefab: " + weaponName);
            }
            ItemDrop.ItemData.SharedData shared = component.m_itemData.m_shared;

            shared.m_name          = "Fireball Bow";
            shared.m_description   = "A bow that shoots fireballs";
            shared.m_useDurability = false;
            shared.m_dodgeable     = true;
            shared.m_blockable     = true;
            shared.m_attackForce   = 2f;
            shared.m_ammoType      = "";

            /*
             * shared.m_attack.m_attackType = Attack.AttackType.Projectile;
             * shared.m_itemType = ItemDrop.ItemData.ItemType.Bow;
             * shared.m_animationState = ItemDrop.ItemData.AnimationState.Bow;
             */
            shared.m_skillType = Skills.SkillType.FireMagic;

            //shared.m_aiAttackRange = 40f;
            shared.m_aiAttackRangeMin = 0f;
            shared.m_aiAttackInterval = 4f;
            //shared.m_holdAnimationState = "";
            shared.m_damages.m_fire = 30f;
            //shared.m_attack.m_attackAnimation = "unarmed_punch0";
            GameObject ulty = RRRLateLoadPrefabs.Clone("bow_projectile", "newFire", true, true);

            Projectile projectile = ulty.GetComponent <Projectile>();

            projectile.m_gravity = 0f;
            projectile.m_aoe     = 1.5f;

            for (int index = 0; index < ulty.transform.childCount; ++index)
            {
                GameObject.Destroy(ulty.transform.GetChild(index).gameObject);
            }
            GameObject prefab = ZNetScene.instance.GetPrefab(projectileName);

            for (int index = 0; index < prefab.transform.childCount; ++index)
            {
                GameObject gameObject = UnityEngine.Object.Instantiate <GameObject>(prefab.transform.GetChild(index).gameObject, ulty.transform);
                gameObject.name = gameObject.name.TrimCloneTag();
            }

            shared.m_attack.m_attackProjectile = ulty;

            return(clone);
        }
Exemplo n.º 5
0
        public static GameObject Get(
            GameObject owner,
            string weaponName
            )
        {
            //Fix showing up as Knife in NPC's hand

            bool       alreadyExisted = false;
            GameObject clone          = RRRLateLoadPrefabs.CloneRepeatable(ref alreadyExisted, weaponName, "AxeJump", regOdb: true);

            if (alreadyExisted)
            {
                return(clone);
            }

            ItemDrop component = clone.GetComponent <ItemDrop>();

            if ((UnityEngine.Object)component == (UnityEngine.Object)null)
            {
                throw new NullReferenceException("No ItemDrop component in prefab: " + weaponName);
            }

            /*
             * for (int index = 0; index < clone.transform.childCount; ++index)
             * {
             *  UnityEngine.Object.Destroy(clone.transform.GetChild(index).gameObject);
             * }
             * GameObject prefab = ZNetScene.instance.GetPrefab("AxeBlackMetal");
             * for (int index = 0; index < prefab.transform.childCount; ++index)
             * {
             *  UnityEngine.Object gameObject = UnityEngine.Object.Instantiate<GameObject>(prefab.transform.GetChild(index).gameObject, clone.transform);
             *  gameObject.name = gameObject.name.TrimCloneTag();
             * }
             */
            /*
             * Transform transform = clone.transform;
             * transform.localScale = new Vector3(1.1f, 1.1f, 1.1f);
             *
             * ZSyncTransform zSync = clone.GetComponent<ZSyncTransform>();
             * zSync = prefab.GetComponent<ZSyncTransform>();
             * ZNetView zNet = clone.GetComponent<ZNetView>();
             * zNet = prefab.GetComponent<ZNetView>();
             * Rigidbody rigidbody = clone.GetComponent<Rigidbody>();
             * rigidbody = prefab.GetComponent<Rigidbody>();
             */

            ItemDrop.ItemData.SharedData shared = component.m_itemData.m_shared;

            if (!shared.m_attack.m_attackOriginJoint.IsNullOrWhiteSpace() && Utils.FindChild(owner.transform, shared.m_attack.m_attackOriginJoint) == null)
            {
                shared.m_attack.m_attackOriginJoint = "";
            }

            shared.m_name           = "Axe Jump";
            shared.m_description    = "jump with an axe";
            shared.m_useDurability  = false;
            shared.m_skillType      = Skills.SkillType.Axes;
            shared.m_animationState = ItemDrop.ItemData.AnimationState.OneHanded;

            shared.m_attackForce   = 50;
            shared.m_backstabBonus = 3;

            shared.m_damages.m_pierce = 0;
            shared.m_damages.m_slash  = 30;
            shared.m_damages.m_chop   = 40;

            shared.m_aiAttackRange    = 5f;
            shared.m_aiAttackRangeMin = 0f;
            shared.m_aiAttackInterval = 4f;

            shared.m_attack.m_attackAnimation = "knife_secondary";

            return(clone);
        }