示例#1
0
文件: Primed.cs 项目: Slvr11/Primed
    public Primed()
    {
        GSCFunctions.PreCacheItem("uav_strike_missile_mp");
        PlayerConnected += Prime_PlayerConnected;

        OnInterval(100, () =>
        {
            if (IntroCompleters.Count == SpawnedPlayers.Count && SpawnedPlayers.Count > 1)
            {
                startHUD();
                return(false);
            }
            return(true);
        });
    }
示例#2
0
 public Glowstick()
 {
     GSCFunctions.PreCacheItem("lightstick_mp");
     fx_glowstickGlow = GSCFunctions.LoadFX("misc/glow_stick_glow_green");
     PlayerConnected += OnPlayerConnected;
 }
示例#3
0
        public ball()
        {
            string gametype = GSCFunctions.GetDvar("g_gametype");

            if (gametype != "ctf")
            {
                Log.Write(LogLevel.Info, "Gametype must be set to CTF for Uplink. Restarting...");
                GSCFunctions.SetDvar("g_gametype", "ctf");
                Utilities.ExecuteCommand("map_restart");
                return;
            }

            GSCFunctions.PreCacheItem(ballWeapon);
            GSCFunctions.PreCacheShader("waypoint_defend");
            GSCFunctions.PreCacheShader("waypoint_target");
            GSCFunctions.PreCacheShader("waypoint_kill");
            GSCFunctions.PreCacheShader("waypoint_targetneutral");
            GSCFunctions.PreCacheShader("equipment_emp_grenade");

            ballGlow      = GSCFunctions.LoadFX("misc/aircraft_light_wingtip_green");
            ballSiteFX    = GSCFunctions.LoadFX("misc/ui_flagbase_gold");
            alliesSiteFX  = GSCFunctions.LoadFX("misc/ui_flagbase_red");
            axisSiteFX    = GSCFunctions.LoadFX("misc/ui_flagbase_silver");
            ballContrail  = GSCFunctions.LoadFX("misc/light_semtex_geotrail");
            ballExplodeFX = GSCFunctions.LoadFX("explosions/emp_grenade");

            GSCFunctions.SetDevDvarIfUninitialized("scr_ball_scorelimit", 10);
            //GSCFunctions.SetDevDvarIfUninitialized("scr_ball_halftime", 0);
            //GSCFunctions.SetDevDvarIfUninitialized("scr_ball_overtime", 0);
            StartAsync(setGameScoreLimit());
            StartAsync(setGameHalftimeSetting());
            Log.Debug(isHalftime.ToString());

            //Delete flags
            Entity obj = GSCFunctions.GetEnt("ctf_zone_axis", "targetname");

            axisSite = obj.Origin;
            //obj.Delete();
            axisFlagBase = Entity.GetEntity(obj.EntRef);
            Entity flag = GSCFunctions.GetEnt("ctf_flag_axis", "targetname");

            //flag.Delete();
            axisFlag = Entity.GetEntity(flag.EntRef);
            Entity trig = GSCFunctions.GetEnt("ctf_trig_axis", "targetname");

            axisFlagTrig = Entity.GetEntity(trig.EntRef);
            obj          = GSCFunctions.GetEnt("ctf_zone_allies", "targetname");
            alliesSite   = obj.Origin;
            //obj.Delete();
            alliesFlagBase = Entity.GetEntity(obj.EntRef);
            flag           = GSCFunctions.GetEnt("ctf_flag_allies", "targetname");
            //flag.Delete();
            alliesFlag     = Entity.GetEntity(flag.EntRef);
            trig           = GSCFunctions.GetEnt("ctf_trig_allies", "targetname");
            alliesFlagTrig = Entity.GetEntity(trig.EntRef);

            StartAsync(getFlagTriggers());

            //Teleport flags under map and hide them
            axisFlagBase.Origin -= new Vector3(0, 0, 1000);
            axisFlagBase.Hide();
            axisFlag.Origin -= new Vector3(0, 0, 1000);
            axisFlag.Hide();
            axisFlagTrig.Origin   -= new Vector3(0, 0, 1000);
            alliesFlagBase.Origin -= new Vector3(0, 0, 1000);
            alliesFlagBase.Hide();
            alliesFlag.Origin -= new Vector3(0, 0, 1000);
            alliesFlag.Hide();
            alliesFlagTrig.Origin -= new Vector3(0, 0, 1000);

            //Init stations and ball locations
            site = GSCFunctions.GetEnt("sab_bomb", "targetname").Origin;
            spawnBall(site);
            StartAsync(spawnStations(alliesSite, axisSite));

            OnNotify("game_ended", (reason) =>
            {
                gameEnded = true;

                if ((int)GSCFunctions.GetMatchData("alliesScore") == 1)
                {
                    //GSCFunctions.SetDvar("scr_ball_halftime", 0);//Reset dvar if it's set
                    GSCFunctions.SetMatchData("alliesScore", 0);
                }

                if ((string)reason == "halftime")
                {
                    //GSCFunctions.SetDvar("scr_ball_halftime", 1);
                    GSCFunctions.SetMatchData("alliesScore", 1);
                }
            });
            OnNotify("prematch_over", () => prematchOver = true);

            //Set ball throw time
            GSCFunctions.SetDvar("perk_weapRateMultiplier", 0.3f);

            PlayerConnected += onPlayerConnect;
            Notified        += onNotify;

            StartAsync(initGameHud());
        }
示例#4
0
        public Class1()
        {
            Utilities.PrintToConsole(string.Format("Plugin loaded at {0}", GSCFunctions.GetTime()));
            //GSCFunctions.PreCacheString("Test String");
            //GSCFunctions.PreCacheStatusIcon("cardicon_iwlogo");
            //GSCFunctions.PreCacheMenu("kickplayer");
            //GSCFunctions.PreCacheMenu("elevator_floor_selector");
            //GSCFunctions.PreCacheShader("faction_128_gign");

            //Marshal.WriteInt32(new IntPtr(0x0585AE0C), 24);
            //Marshal.WriteInt32(new IntPtr(0x0585AE1C), 24);

            //working guns
            GSCFunctions.PreCacheItem("at4_mp");
            GSCFunctions.PreCacheItem("airdrop_mega_marker_mp");
            GSCFunctions.PreCacheItem("throwingknife_rhand_mp");
            GSCFunctions.PreCacheItem("iw5_mk12spr_mp");
            GSCFunctions.PreCacheItem("lightstick_mp");
            GSCFunctions.PreCacheItem("killstreak_double_uav_mp");
            GSCFunctions.PreCacheItem("strike_marker_mp");
            GSCFunctions.PreCacheItem("killstreak_helicopter_minigun_mp");
            GSCFunctions.PreCacheItem("airdrop_juggernaut_def_mp");
            GSCFunctions.PreCacheItem("uav_strike_missile_mp");
            GSCFunctions.PreCacheItem("uav_strike_projectile_mp");
            GSCFunctions.PreCacheItem("iw5_xm25_mp");
            GSCFunctions.PreCacheItem("iw5_riotshield_mp");
            GSCFunctions.PreCacheItem("harrier_missile_mp");

            //turret-only
            GSCFunctions.PreCacheTurret("manned_minigun_turret_mp");
            GSCFunctions.PreCacheTurret("manned_gl_turret_mp");
            GSCFunctions.PreCacheItem("remote_uav_weapon_mp");
            GSCFunctions.PreCacheItem("aamissile_projectile_mp");

            //Hacking in all fx
            //smoke

            /*
             * string[] smoke_fx;
             * smoke_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\smoke");
             * for (int i = 0; i < smoke_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("smoke/" + smoke_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] prop_fx;
             * prop_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\props");
             * for (int i = 0; i < prop_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("props/" + prop_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] dust_fx;
             * dust_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\dust");
             * for (int i = 0; i < dust_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("dust/" + dust_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] exp_fx;
             * exp_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\explosions");
             * for (int i = 0; i < exp_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("explosions/" + exp_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] impact_fx;
             * impact_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\impacts");
             * for (int i = 0; i < 100; i++)
             * {
             *  GSCFunctions.LoadFX("impacts/" + impact_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] shellejects_fx;
             * shellejects_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\shellejects");
             * for (int i = 0; i < shellejects_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("shellejects/" + shellejects_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             * string[] fire_fx;
             * fire_fx = Directory.GetFiles(@"H:\USBFORMAT\MW3 GSCs\devraw\fx\fire");
             * for (int i = 0; i < fire_fx.Length; i++)
             * {
             *  GSCFunctions.LoadFX("fire/" + fire_fx[i].Split('\\')[6].Replace(".FXE", ""));
             * }
             */
            GSCFunctions.LoadFX("fire/jet_afterburner_harrier");
            GSCFunctions.LoadFX("smoke/jet_contrail");
            GSCFunctions.LoadFX("misc/aircraft_light_red_blink");
            GSCFunctions.LoadFX("misc/aircraft_light_wingtip_red");
            GSCFunctions.LoadFX("misc/aircraft_light_wingtip_green");

            _airdropCollision = GSCFunctions.GetEnt("care_package", "targetname");
            _airdropCollision = GSCFunctions.GetEnt(_airdropCollision.Target, "targetname");

            GSCFunctions.PreCacheMpAnim("viewmodel_airdrop_marker_sprint_loop");
            //GSCFunctions.PreCacheMpAnim("viewmodel_claymore_idle");

            string[] testAnims = new string[] { "pb_crouch_grenade_idle",
                                                "pb_crouch_stickgrenade_idle",
                                                "pb_crouch_grenade_pullpin",
                                                "pb_crouch_alert",
                                                "pb_crouch_ads",
                                                "pb_crouch_alert_pistol",
                                                "pb_crouch_ads_pistol",
                                                "pb_crouch_alert_unarmed",
                                                "pb_crouch_alert_akimbo",
                                                "pb_crouch_alert_shield",
                                                "pb_chicken_dance",
                                                "pb_chicken_dance_crouch",
                                                "pb_crouch_bombplant",
                                                "pb_crouch_remotecontroller",
                                                "pb_hold_idle",
                                                "pb_crouch_hold_idle",
                                                "pb_crouch_alert_RPG",
                                                "pb_crouch_ads_RPG" };

            //foreach (string anim in testAnims)
            //GSCFunctions.PreCacheMpAnim(anim);

            fx_eyes = GSCFunctions.LoadFX("misc/aircraft_light_wingtip_red");

            PlayerConnected += OnPlayerConnected;

            //GSCFunctions.SetDvar("scr_diehard", 2);
            GSCFunctions.SetDevDvar("developer", 2);
            GSCFunctions.SetDevDvar("developer_script", 1);
            GSCFunctions.SetDvarIfUninitialized("scr_showNotifyMessages", 1);
            GSCFunctions.SetDvar("scr_game_playerwaittime", 0);
            GSCFunctions.SetDvar("scr_game_matchstarttime", 0);

            Notified += new Action <int, string, Parameter[]>((ent, message, parameters) =>
            {
                //if (message == "trigger") return;
                if (GSCFunctions.GetDvarInt("scr_showNotifyMessages") == 0)
                {
                    return;
                }
                if (parameters.Length > 0)
                {
                    foreach (string p in parameters)
                    {
                        Utilities.PrintToConsole(ent.ToString() + ": " + message + ":" + p);
                    }
                }
                else
                {
                    Utilities.PrintToConsole(string.Format("{0} Notified " + message, ent));
                }
            });

            level = Entity.GetEntity(2046);

            /*
             * GSCFunctions.SetSunlight(new Vector3(0, 0, 1));
             * GSCFunctions.VisionSetNaked("cobra_sunset3");
             * for (int i = 18; i < 2000; i++)
             * {
             *  Entity ent = GSCFunctions.GetEntByNum(i);
             *  if (ent == null) continue;
             *  string entModel = ent.Model;
             *
             *  if (entModel == "vehicle_hummer_destructible")
             *      ent.SetModel("com_satellite_dish_big");
             *  else if (ent.TargetName == "explodable_barrel")
             *  {
             *      Entity col = GSCFunctions.GetEnt(ent.Target, "targetname");
             *      if (col != null) col.Delete();
             *      ent.Delete();
             *  }
             *  else if (ent.TargetName == "animated_model")
             *  {
             *      ent.ScriptModelClearAnim();
             *      ent.Delete();
             *      Entity placeholder = GSCFunctions.Spawn("script_model", Vector3.Zero);
             *  }
             * }
             */
            //StartAsync(testFunc());
            //StartAsync(dumpHud());
        }