コード例 #1
0
        private static void GetHigh(Skill skill)
        {
            var rng = Random.Range(0, 100);

            SkillEventHandler.Do(x =>
            {
                Function.Call(Hash.SET_TIME_SCALE, rng < 80 ? 0.4f : 0.2f);
                Function.Call(Hash.SET_TIMECYCLE_MODIFIER, rng < 80 ? "phone_cam6" : "phone_cam7");
                var slowTime = skill.GetIntParam("Slow Time");
                if (rng > 80)
                {
                    RPG.Notify(Notification.Danger("Unlucky, what a hit! HP Lost"));
                    if (Game.Player.Character.Health > 10)
                    {
                        Game.Player.Character.Health -= 10;
                    }
                    else
                    {
                        Game.Player.Character.Health = 5;
                    }
                }
                SkillEventHandler.Wait(slowTime);
                Function.Call(Hash.SET_TIME_SCALE, 1f);
                Function.Call(Hash.SET_TIMECYCLE_MODIFIER, "");
            });
        }
コード例 #2
0
        private static void BlazedOffGlory(Skill skill)
        {
            SkillEventHandler.Do(x =>
            {
                Function.Call(Hash.SET_TIMECYCLE_MODIFIER, "phone_cam1");
                var blazeTime  = skill.GetIntParam("Blaze Time");
                var damageBuff = skill.GetFloatParam("Damage Buff");

                //set damage to +damageBuff
                Function.Call(Hash.SET_PLAYER_WEAPON_DAMAGE_MODIFIER, Game.Player, 0.5f * (1 + damageBuff));

                SkillEventHandler.Wait(blazeTime);

                //set damage to default
                Function.Call(Hash.SET_PLAYER_WEAPON_DAMAGE_MODIFIER, Game.Player, 0.5f);

                Function.Call(Hash.SET_TIMECYCLE_MODIFIER, "");
            });
        }
コード例 #3
0
        static SkillRepository()
        {
            Skills = new List <Skill>();

            //Get High
            Skills.Add(new Skill("Get High", "Time seems to move slower...What's the worst that could happen?", 100)
                       .WithAction(GetHigh)
                       .WithModTree(GetHighTree())
                       .WithParam("Slow Time", 5000, o => (o.GetFloatParam("Slow Time") / 1000).ToString("0.0") + "s")
                       .WithVisibleParam("Cooldown", o => ((float)o.CoolDownMs / 1000).ToString("0.0") + "s")
                       .WithMods(Mod("Slow I", 50), Mod("Slow II", 100))
                       .WithCooldown(30000));
            //.WithStartingUnlocked()

            //Toughen Up
            Skills.Add(new Skill("Toughen Up", "Hard times call for tough measures. Suit up with some armor.", 100)
            {
                CoolDownMs = 30000
            }
                       .WithAction(o =>
            {
                Game.Player.Character.Armor += o.GetIntParam("Armor Amount");
            })
                       .WithModTree(ToughenUpTree())
                       .WithParam("Armor Amount", 10, o => ("+" + o.GetIntParam("Armor Amount") + " Armor"))
                       .WithVisibleParam("Cooldown", o => ((float)o.CoolDownMs / 1000).ToString("0.0") + "s")
                       .WithMods(Mod("Increased Armor", 100), Mod("Swift Change", 200))
                       );

            //Blazed Off Glory
            Skills.Add(new Skill("Blazed Off Glory", "This narcotic makes people go wild. Luckily in a good way.", 100)
            {
                CoolDownMs = 30000
            }
                       .WithAction(BlazedOffGlory)
                       .WithModTree(BlazedOffGloryTree())
                       .WithParam("Blaze Time", 15000, o => (o.GetFloatParam("Blaze Time") / 1000).ToString("0.0") + "s")
                       .WithParam("Damage Buff", 0.5f, o => ("+" + (o.GetFloatParam("Damage Buff") * 100).ToString("0.0") + "% damage"))
                       .WithVisibleParam("Cooldown", o => ((float)o.CoolDownMs / 1000).ToString("0.0") + "s")
                       .WithMods(Mod("Two Puffs", 100), Mod("Lethal Dose", 200))
                       .WithCooldown(120000));

            //Reject Nonsense
            Skills.Add(new Skill("Reject Nonsense", "Nearby enemies fly into the air.", 100)
            {
                CoolDownMs = 30000
            }
                       .WithAction(o =>
            {
                var radius        = o.GetFloatParam("Radius");
                var knockupHeight = o.GetFloatParam("Knockup Height");
                var nearbyPeds    = World.GetNearbyPeds(Game.Player.Character, radius);
                foreach (var ped in nearbyPeds)
                {
                    if (ped.RelationshipGroup != Game.Player.Character.RelationshipGroup)
                    {
                        ped.ApplyForce(new Vector3(0, 0, knockupHeight));
                    }
                }
            })
                       .WithModTree(RejectNonsenseTree())
                       .WithParam("Knockup Height", 15, o => (o.GetFloatParam("Knockup Height")) + "m")
                       .WithParam("Radius", 5, o => (o.GetFloatParam("Radius")) + "m")
                       .WithVisibleParam("Cooldown", o => ((float)o.CoolDownMs / 1000).ToString("0.0") + "s")
                       .WithMods(Mod("Reach For The Stars", 100), Mod("Knocked Up", 200))
                       );

            //Rampage
            Skills.Add(new Skill("Rampage", "Explosive ammo, melee and super jump. Go wild.", 100)
            {
                CoolDownMs = 30000
            }
                       .WithAction(o =>
            {
                SkillEventHandler.Do(x =>
                {
                    var ramgpageTime  = o.GetIntParam("Rampage Time");
                    RPG.ExplosiveHits = true;
                    RPG.SuperJump     = true;
                    SkillEventHandler.Wait(ramgpageTime);
                    RPG.ExplosiveHits = false;
                    RPG.SuperJump     = false;
                });
            })
                       .WithModTree(RampageTree())
                       .WithParam("Rampage Time", 5000, o => (o.GetFloatParam("Rampage Time") / 1000).ToString("0.0") + "s")
                       .WithVisibleParam("Cooldown", o => ((float)o.CoolDownMs / 1000).ToString("0.0") + "s")
                       .WithMods(Mod("Rampage I", 100), Mod("Rampage II", 200))
                       );

            //Reinforcements
            Skills.Add(new Skill("Reinforcements", "Summon backup to assist you.", 100)
            {
                CoolDownMs = 30000
            }
                       .WithAction(Reinforcement)
                       .WithModTree(ReinforcementTree())
                       .WithParam("Crew Size", 1, o => (o.GetIntParam("Crew Size")).ToString() + " members")
                       .WithParam("Member HP", 20, o => (o.GetIntParam("Member HP")).ToString())
                       .WithParam("Weapon", WeaponHash.Pistol.ToString(), o => (o.GetStringParam("Weapon").ToString()))
                       .WithVisibleParam("Cooldown", o => ((float)o.CoolDownMs / 1000).ToString("0.0") + "s")
                       .WithMods(Mod("Additional Flyers", 200), Mod("Fund Kevlar", 200), Mod("Fund Weapons", 200))
                       .WithCooldown(120000)
                       );


            //Get Hammered
            Skills.Add(new Skill("Get Hammered", "Black out and stuff happens...", 2500)
            {
                CoolDownMs = 120000
            }
                       .WithAction(o =>
            {
                SkillEventHandler.Do(x =>
                {
                    Game.Player.Character.IsInvincible = true;
                    Game.FadeScreenOut(1000);
                    SkillEventHandler.Wait(1000);
                    var nearbyPeds = World.GetNearbyPeds(Game.Player.Character, 100);
                    foreach (var ped in nearbyPeds)
                    {
                        if (ped.RelationshipGroup != Game.Player.Character.RelationshipGroup)
                        {
                            ped.Health -= 100;
                            ped.Armor  -= 100;
                        }
                    }
                    Game.Player.Character.IsInvincible = false;
                    SkillEventHandler.Wait(1000);
                    Game.FadeScreenIn(1000);
                });
            })
                       .WithVisibleParam("Cooldown", o => ((float)o.CoolDownMs / 1000).ToString("0.0") + "s"));
        }