Beispiel #1
0
        private static GameObject DesignThornAttack()
        {
            GameObject gameObject = RRRLateLoadPrefabs.Clone("gd_king_shoot", MobNames.Groot.ToString() + "_shoot", true, true);

            ItemDrop.ItemData.SharedData shared = ((ItemDrop.ItemData)((ItemDrop)gameObject.GetComponent <ItemDrop>()).m_itemData).m_shared;
            shared.m_aiAttackRangeMin            = 2.0f;
            shared.m_dodgeable                   = true;
            shared.m_blockable                   = true;
            shared.m_damages.m_poison            = Groot.ShootDmgPoison;
            shared.m_damages.m_pierce            = Groot.ShootDmgPierce;
            shared.m_damages.m_chop              = 0;
            shared.m_damages.m_pickaxe           = 0;
            shared.m_attack.m_attackAnimation    = "shoot";
            shared.m_attack.m_projectileVel      = (float)20.0;
            shared.m_attack.m_attackHeight       = (float)1.200000011920929;
            shared.m_attack.m_attackRange        = (float)2.15000009536743;
            shared.m_attack.m_attackAngle        = (float)2.0;
            shared.m_attack.m_attackRayWidth     = (float)1.0;
            shared.m_attack.m_projectileBursts   = (int)1;
            shared.m_attack.m_projectileAccuracy = (float)1.0;
            shared.m_attack.m_burstInterval      = (float)0.5;
            shared.m_aiAttackInterval            = (float)7.0;
            shared.m_aiAttackRange               = (float)25.0;
            shared.m_aiAttackRangeMin            = (float)1.0;
            shared.m_startEffect                 = ObjectDB.instance.GetItemPrefab("gd_king_shoot").GetComponent <ItemDrop>().m_itemData.m_shared.m_startEffect;
            return(gameObject);
        }
Beispiel #2
0
        private static GameObject DesignSquitoSting()
        {
            GameObject gameObject = RRRLateLoadPrefabs.Clone("Deathsquito_sting", "miniSting", true, true);

            ItemDrop.ItemData.SharedData shared =
                ((ItemDrop.ItemData)((ItemDrop)gameObject.GetComponent <ItemDrop>()).m_itemData).m_shared;
            shared.m_damages.m_pierce = MiniSquito.MeleeDmgPierce;
            shared.m_secondaryAttack  = shared.m_attack;

            return(gameObject);
        }
Beispiel #3
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);
        }
Beispiel #4
0
        private static GameObject DesignSkellyShield()
        {
            GameObject gameObject = RRRLateLoadPrefabs.Clone("ShieldWood", "skellyShield", true, true);

            Transform transform = gameObject.transform;

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

            ItemDrop.ItemData.SharedData shared = ((ItemDrop.ItemData)((ItemDrop)gameObject.GetComponent <ItemDrop>()).m_itemData).m_shared;
            shared.m_blockPower      = 7;
            shared.m_deflectionForce = 7;

            return(gameObject);
        }
Beispiel #5
0
        private static GameObject DesignPunch(Character component)
        {
            GameObject gameObject = RRRLateLoadPrefabs.Clone("troll_punch", MobNames.Groot.ToString() + "_punch", true, true);

            ItemDrop.ItemData.SharedData shared = ((ItemDrop.ItemData)((ItemDrop)gameObject.GetComponent <ItemDrop>()).m_itemData).m_shared;
            shared.m_damages.m_blunt          = Groot.MeleeDmgBlunt;
            shared.m_damages.m_chop           = 0;
            shared.m_damages.m_pickaxe        = 0;
            shared.m_attack.m_attackRange     = 2.5f;
            shared.m_attack.m_attackAnimation = "punch";
            shared.m_aiAttackInterval         = 3.0f;
            shared.m_aiAttackRange            = 2.5f;

            return(gameObject);
        }
Beispiel #6
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);
        }
Beispiel #7
0
 private void LateLoadPrefabs()
 {
     if (!Util.IsGameInMainScene())
     {
         return;
     }
     AsheBow.Get();
     AsheBow2.Get();
     AsheBow3.Get();
     AsheBow4.Get();
     AsheKnife.Get();
     Fireball.Get(RRRLateLoadPrefabs.Clone("RRR_NPC", "NPCclone", true, true));
     AxeJump.Get(RRRLateLoadPrefabs.Clone("RRR_NPC", "NPCclone2", true, true), "AxeBlackMetal");
     Groot.LateLoadGroot(RRRLateLoadPrefabs.Clone(Groot.OriginalName, MobNames.Groot.ToString(), true, false));
     Ashe.LateLoadAshe(RRRLateLoadPrefabs.Clone(Ashe.OriginalName, MobNames.Ashe.ToString(), true, false));
     MiniSkelly.LateLoadMiniSkelly(RRRLateLoadPrefabs.Clone(MiniSkelly.OriginalName, MobNames.MiniSkelly.ToString(), true, false));
     MiniSquito.LateLoadMiniSquito(RRRLateLoadPrefabs.Clone(MiniSquito.OriginalName, MobNames.MiniSquito.ToString(), true, false));
     Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly());
 }
Beispiel #8
0
        private static GameObject DesignSkellySword()
        {
            GameObject gameObject = RRRLateLoadPrefabs.Clone("skeleton_sword", "skellySword", true, true);

            Transform transform = gameObject.transform;

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

            ItemDrop.ItemData.SharedData shared = ((ItemDrop.ItemData)((ItemDrop)gameObject.GetComponent <ItemDrop>()).m_itemData).m_shared;
            shared.m_attackForce                  = 5f;
            shared.m_attack.m_speedFactor         = 0.35f;
            shared.m_attack.m_speedFactorRotation = 0.35f;
            shared.m_attack.m_attackHitNoise      = 20;
            shared.m_attack.m_attackStartNoise    = 5;
            shared.m_attack.m_attackHeight        = 0.9f;
            shared.m_attack.m_attackRange         = 1.5f;
            shared.m_damages.m_slash              = MiniSkelly.MeleeDmgSlash;
            shared.m_secondaryAttack              = shared.m_attack;

            return(gameObject);
        }
Beispiel #9
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);
        }
Beispiel #10
0
        internal static void LateLoadMiniSquito(GameObject clone)
        {
            Character component  = (Character)clone.GetComponent <Character>();
            BaseAI    component2 = (BaseAI)clone.GetComponent <BaseAI>();

            component.m_name = "Squito";
            Character character1 = component;

            character1.m_health = 5;
            Character character2 = component;

            character2.m_acceleration = (float)(character2.m_acceleration * 0.75);
            Character character3 = component;

            character3.m_speed = (float)(character3.m_speed * 0.75);
            Character character4 = component;

            character4.m_walkSpeed = (float)(character4.m_walkSpeed * 0.75);
            Character character5 = component;

            character5.m_runSpeed = (float)(character5.m_runSpeed * 0.75);
            Character character6 = component;

            character6.m_flySlowSpeed = (float)(character6.m_flySlowSpeed * 0.75);
            Character character7 = component;

            character7.m_flyFastSpeed = (float)(character7.m_flyFastSpeed * 1.25);

            Rigidbody rigidbody = clone.GetComponent <Rigidbody>();

            rigidbody.mass = 3f;

            Humanoid humanoid = (Humanoid)component;

            Character.Faction nFaction = Character.Faction.Players;
            humanoid.m_faction      = nFaction;
            humanoid.m_defaultItems = new GameObject[1]
            {
                DesignSquitoSting()
            };


            MonsterAI monsterAI = (MonsterAI)clone.GetComponent <BaseAI>();

            monsterAI.m_viewRange              = (int)15;
            monsterAI.m_deathMessage           = "Friendly Squito Down!";
            monsterAI.m_enableHuntPlayer       = false;
            monsterAI.m_circulateWhileCharging = false;
            monsterAI.m_flyAltitudeMin         = 0.4f;

            Tameable   tameable   = (Tameable)clone.AddComponent <Tameable>();
            GameObject wolfObject = (GameObject)RRRLateLoadPrefabs.Clone("Wolf", "tameClone2", true, true);
            Tameable   wolfTame   = (Tameable)wolfObject.GetComponent <Tameable>();

            tameable.m_fedDuration = wolfTame.m_fedDuration;
            tameable.m_tamingTime  = wolfTame.m_tamingTime;
            tameable.m_commandable = true;
            tameable.m_tamedEffect = new EffectList();

            CharacterDrop characterDrop = (CharacterDrop)clone.GetComponent <CharacterDrop>();

            characterDrop.m_drops.Clear();

            MiniSquito.DesignAppearance(clone);
        }
Beispiel #11
0
        internal static void LateLoadMiniSkelly(GameObject clone)
        {
            Character component  = (Character)clone.GetComponent <Character>();
            BaseAI    component2 = (BaseAI)clone.GetComponent <BaseAI>();

            component.m_name = "Skeleton";
            Character character1 = component;

            character1.m_health = 20;
            Character character2 = component;

            character2.m_acceleration = (float)(character2.m_acceleration * 1.75);
            Character character3 = component;

            character3.m_speed = (float)(character3.m_speed * 3.5);
            Character character4 = component;

            character4.m_walkSpeed = (float)(character4.m_walkSpeed * 2);
            Character character5 = component;

            character5.m_runSpeed = (float)(character5.m_runSpeed * 2.5);

            Rigidbody rigidbody = clone.GetComponent <Rigidbody>();

            rigidbody.mass = 0.5f;

            Humanoid humanoid = (Humanoid)component;

            Character.Faction nFaction = Character.Faction.Players;
            humanoid.m_faction      = nFaction;
            humanoid.m_defaultItems = new GameObject[1]
            {
                DesignSkellySword()
            };

            humanoid.m_randomShield = new GameObject[1]
            {
                DesignSkellyShield()
            };
            humanoid.m_randomWeapon = null;

            MonsterAI monsterAI = (MonsterAI)clone.GetComponent <BaseAI>();

            monsterAI.m_viewRange              = (int)15;
            monsterAI.m_deathMessage           = "Friendly Skelly Down!";
            monsterAI.m_enableHuntPlayer       = false;
            monsterAI.m_circulateWhileCharging = false;

            Tameable   tameable   = (Tameable)clone.AddComponent <Tameable>();
            GameObject wolfObject = (GameObject)RRRLateLoadPrefabs.Clone("Wolf", "tameClone", true, true);
            Tameable   wolfTame   = (Tameable)wolfObject.GetComponent <Tameable>();

            tameable.m_fedDuration = wolfTame.m_fedDuration;
            tameable.m_tamingTime  = wolfTame.m_tamingTime;
            tameable.m_commandable = true;

            CharacterDrop characterDrop = (CharacterDrop)clone.GetComponent <CharacterDrop>();

            characterDrop.m_drops.Clear();

            MiniSkelly.DesignAppearance(clone);
        }
Beispiel #12
0
        internal static void LateLoadGroot(GameObject clone)
        {
            Character component  = (Character)clone.GetComponent <Character>();
            BaseAI    component2 = (BaseAI)clone.GetComponent <BaseAI>();

            component.m_name = "Groot";
            Character character1 = component;

            character1.m_health = 400;
            Character character2 = component;

            character2.m_acceleration = (float)(character2.m_acceleration * 0.8);
            Character character3 = component;

            character3.m_speed = (float)(character3.m_speed * 0.8);
            Character character4 = component;

            character4.m_walkSpeed = (float)(character4.m_walkSpeed * 0.8);
            Character character5 = component;

            character5.m_runSpeed = (float)(character5.m_runSpeed * 0.7);

            Rigidbody rigidbody = clone.GetComponent <Rigidbody>();

            rigidbody.mass = 50;

            Humanoid humanoid = (Humanoid)component;

            humanoid.m_defaultItems = (GameObject[])new GameObject[2]
            {
                Groot.DesignThornAttack(),
                    Groot.DesignPunch(component)
            };
            Character.Faction nFaction = Character.Faction.Players;
            humanoid.m_faction            = nFaction;
            humanoid.m_randomSets         = null;
            humanoid.m_boss               = false;
            humanoid.m_bossEvent          = null;
            humanoid.m_defeatSetGlobalKey = null;

            MonsterAI monsterAI = (MonsterAI)clone.GetComponent <BaseAI>();

            Pathfinding.AgentType npath = Pathfinding.AgentType.HorseSize;
            monsterAI.m_pathAgentType    = npath;
            monsterAI.m_viewRange        = (int)30;
            monsterAI.m_spawnMessage     = "I am Groot";
            monsterAI.m_deathMessage     = "Groot sad";
            monsterAI.m_enableHuntPlayer = false;

            Tameable   tameable   = (Tameable)clone.AddComponent <Tameable>();
            GameObject wolfObject = (GameObject)RRRLateLoadPrefabs.Clone("Wolf", "wolfClone", true, true);
            Tameable   wolfTame   = (Tameable)wolfObject.GetComponent <Tameable>();

            tameable.m_fedDuration = wolfTame.m_fedDuration;
            tameable.m_tamingTime  = wolfTame.m_tamingTime;
            tameable.m_commandable = true;
            tameable.m_tamedEffect = new EffectList();

            FootStep   footStep   = (FootStep)clone.GetComponent <FootStep>();
            GameObject greyObject = (GameObject)RRRLateLoadPrefabs.Clone("Greydwarf_Elite", "grayClone", true, true);
            FootStep   greyStep   = (FootStep)greyObject.GetComponent <FootStep>();

            footStep.m_effects = greyStep.m_effects;

            CharacterDrop characterDrop = (CharacterDrop)clone.GetComponent <CharacterDrop>();

            characterDrop.m_drops.Clear();
            CharacterDrop.Drop drop = new CharacterDrop.Drop()
            {
                m_prefab = ZNetScene.instance.GetPrefab("Wood")
            };
            characterDrop.m_drops.Add(drop);

            GameObject bruteDeath = RRRLateLoadPrefabs.Clone("sfx_greydwarf_elite_death", "vfx_" + clone.name + "_death", true, false);

            humanoid.m_deathEffects.m_effectPrefabs[0].m_prefab = bruteDeath;

            GameObject clone1 = RRRLateLoadPrefabs.Clone("Greydwarf_elite_ragdoll", clone.name + "_ragdoll", true, false);

            ((EffectList.EffectData)((EffectList)component.m_deathEffects).m_effectPrefabs[1]).m_prefab = (GameObject)clone1;

            Groot.DesignAppearance(clone);
        }
Beispiel #13
0
        internal static void LateLoadDwarf(GameObject clone)
        {
            for (int index = 0; index < clone.transform.childCount; ++index)
            {
                GameObject.Destroy(clone.transform.GetChild(index).gameObject);
            }
            GameObject prefab = ZNetScene.instance.GetPrefab("Haldor");
            GameObject eyePos = (GameObject)null;

            for (int index = 0; index < prefab.transform.childCount; ++index)
            {
                GameObject gameObject = GameObject.Instantiate <GameObject>(prefab.transform.GetChild(index).gameObject, clone.transform);
                gameObject.name = gameObject.name.TrimCloneTag();
                if (gameObject.name == "EyePos")
                {
                    eyePos = gameObject;
                }
                if (gameObject.name == "Pipe")
                {
                    GameObject.Destroy(gameObject);
                }
            }

            VisEquipment component1 = clone.GetComponent <VisEquipment>();

            component1.m_bodyModel          = clone.transform.Find("Haldor/HaldorTheTrader/Haldor").GetComponent <SkinnedMeshRenderer>();
            component1.m_leftHand           = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/Spine0/Spine1/Spine2/Shoulder.l/Upperarm.l/Underarm.l/Wrist.l/Shoulder.l.016/Shoulder.l.017/Shoulder.l.018").GetComponent <Transform>();
            component1.m_rightHand          = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/Spine0/Spine1/Spine2/Shoulder.r/Upperarm.r/Underarm.r/Wrist.r/Middle1.r").GetComponent <Transform>();
            component1.m_helmet             = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/Spine0/Spine1/Spine2/Head/Jaw").GetComponent <Transform>();
            component1.m_backShield         = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/Spine0/Spine1/Spine2/Shoulder.r/Upperarm.r/Underarm.r/Wrist.r/Pipe.001").GetComponent <Transform>();
            component1.m_backMelee          = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/Spine0/Spine1/Spine2/Shoulder.r/Upperarm.r/Underarm.r/Wrist.r/Pipe.001").GetComponent <Transform>();
            component1.m_backTwohandedMelee = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/Spine0/Spine1/Spine2/Shoulder.r/Upperarm.r/Underarm.r/Wrist.r/Pipe.001").GetComponent <Transform>();
            component1.m_backBow            = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/Spine0/Spine1/Spine2/Shoulder.r/Upperarm.r/Underarm.r/Wrist.r/Pipe.001").GetComponent <Transform>();
            component1.m_backTool           = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/Spine0/Spine1/Spine2/Shoulder.r/Upperarm.r/Underarm.r/Wrist.r/Pipe.001").GetComponent <Transform>();
            component1.m_backAtgeir         = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/Spine0/Spine1/Spine2/Shoulder.r/Upperarm.r/Underarm.r/Wrist.r/Pipe.001").GetComponent <Transform>();

            /*
             * component1.m_clothColliders = new CapsuleCollider[5]
             * {
             *   clone.transform.Find("Visual/Armature/Hips/ClothCollider").GetComponent<CapsuleCollider>(),
             *   clone.transform.Find("Visual/Armature/Hips/LeftUpLeg/ClothCollider").GetComponent<CapsuleCollider>(),
             *   clone.transform.Find("Visual/Armature/Hips/RightUpLeg/ClothCollider").GetComponent<CapsuleCollider>(),
             *   clone.transform.Find("Visual/Armature/Hips/Spine/Spine1/ClothCollider (3)").GetComponent<CapsuleCollider>(),
             *   clone.transform.Find("Visual/Armature/Hips/Spine/Spine1/Spine2/ClothCollider (4)").GetComponent<CapsuleCollider>()
             * };
             */

            component1.m_models   = prefab.GetComponent <VisEquipment>().m_models;
            component1.m_isPlayer = true;

            /*
             * CapsuleCollider component2 = clone.GetComponent<CapsuleCollider>();
             * component2.center = prefab.GetComponent<CapsuleCollider>().center;
             * component2.radius = prefab.GetComponent<CapsuleCollider>().radius;
             * component2.height = prefab.GetComponent<CapsuleCollider>().height;
             */
            //clone.GetComponent<Rigidbody>().interpolation = prefab.GetComponent<Rigidbody>().interpolation;
            ZSyncAnimation component3 = clone.GetComponent <ZSyncAnimation>();
            ZSyncAnimation component4 = prefab.GetComponent <ZSyncAnimation>();

            component3.m_syncBools  = new List <string>((IEnumerable <string>)component4.m_syncBools);
            component3.m_syncFloats = new List <string>((IEnumerable <string>)component4.m_syncFloats);
            component3.m_syncInts   = new List <string>((IEnumerable <string>)component4.m_syncInts);
            FootStep component5 = clone.GetComponent <FootStep>();
            FootStep component6 = prefab.GetComponent <FootStep>();

            component5.m_footstepCullDistance = component6.m_footstepCullDistance;
            component5.m_effects.Clear();
            foreach (FootStep.StepEffect effect in component6.m_effects)
            {
                component5.m_effects.Add(effect);
            }
            component5.m_feet[0] = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/UpperLeg.l/LowerLeg.l/Foot.l/Foot2.l");
            component5.m_feet[1] = clone.transform.Find("Haldor/HaldorTheTrader/Armature/Root/Hip/UpperLeg.r/LowerLeg.r/Foot.r/Foot2.r");

            GameObject playerPrefab = RRRLateLoadPrefabs.Clone("Player", "newPlays", true, true);
            Humanoid   component11  = clone.GetComponent <Humanoid>();
            Humanoid   component21  = playerPrefab.GetComponent <Humanoid>();

            component11.m_eye              = eyePos.transform;
            component11.m_crouchSpeed      = component21.m_crouchSpeed;
            component11.m_walkSpeed        = component21.m_walkSpeed;
            component11.m_speed            = component21.m_speed;
            component11.m_turnSpeed        = component21.m_turnSpeed;
            component11.m_runSpeed         = component21.m_runSpeed;
            component11.m_runTurnSpeed     = component21.m_runTurnSpeed;
            component11.m_acceleration     = component21.m_acceleration;
            component11.m_jumpForce        = component21.m_jumpForce;
            component11.m_jumpForceForward = component21.m_jumpForceForward;
            component11.m_swimDepth        = component21.m_swimDepth;
            component11.m_swimSpeed        = component21.m_swimSpeed;

            /*
             * component11.m_damageModifiers = component21.m_damageModifiers.Clone();
             * component11.m_defaultItems = new GameObject[0];
             * component11.m_randomWeapon = new GameObject[0];
             * component11.m_randomArmor = new GameObject[0];
             * component11.m_randomShield = new GameObject[0];
             * component11.m_randomSets = new Humanoid.ItemSet[0];
             */

            Character component  = (Character)clone.GetComponent <Character>();
            BaseAI    component2 = (BaseAI)clone.GetComponent <BaseAI>();

            component.m_name = "Dwarf";
            Character character1 = component;

            character1.m_health = 100;

            /*
             * Character character2 = component;
             * character2.m_acceleration = (float)(character2.m_acceleration * 0.8);
             * Character character3 = component;
             * character3.m_speed = (float)(character3.m_speed * 0.8);
             * Character character4 = component;
             * character4.m_walkSpeed = (float)(character4.m_walkSpeed * 0.8);
             * Character character5 = component;
             * character5.m_runSpeed = (float)(character5.m_runSpeed * 0.7);
             */
            Humanoid humanoid = (Humanoid)component;

            humanoid.m_defaultItems = (GameObject[])new GameObject[1]
            {
                RRRLateLoadPrefabs.Clone("SwordIron", "SwordIron2", true, true)
                //Dwarf.DesignAxeAttack(),
                //Dwarf.DesignAxeAttack2()
            };
            Character.Faction nFaction = Character.Faction.Players;
            humanoid.m_faction    = nFaction;
            humanoid.m_randomSets = null;

            MonsterAI monsterAI = clone.GetComponent <MonsterAI>();

            monsterAI.m_viewRange        = (int)25;
            monsterAI.m_spawnMessage     = "Dwarf, ready!";
            monsterAI.m_deathMessage     = "Oww!";
            monsterAI.m_enableHuntPlayer = false;

            Tameable   tameable   = (Tameable)clone.AddComponent <Tameable>();
            GameObject wolfObject = (GameObject)RRRLateLoadPrefabs.Clone("Wolf", "wolfClone9000", true, true);
            Tameable   wolfTame   = (Tameable)wolfObject.GetComponent <Tameable>();

            tameable.m_fedDuration = wolfTame.m_fedDuration;
            tameable.m_tamingTime  = wolfTame.m_tamingTime;
            tameable.m_commandable = true;

            FootStep   footStep   = (FootStep)clone.AddComponent <FootStep>();
            GameObject greyObject = (GameObject)RRRLateLoadPrefabs.Clone("Player", "playClone", true, true);
            FootStep   greyStep   = (FootStep)greyObject.GetComponent <FootStep>();

            footStep = greyStep;

            CharacterDrop characterDrop = (CharacterDrop)clone.AddComponent <CharacterDrop>();

            characterDrop.m_drops.Clear();
            CharacterDrop.Drop drop = new CharacterDrop.Drop()
            {
                m_prefab = ZNetScene.instance.GetPrefab("Coins")
            };
            characterDrop.m_drops.Add(drop);

            //Dwarf.DesignAppearance(clone);
        }
Beispiel #14
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);
        }
Beispiel #15
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);
        }