Exemple #1
0
        public static void KnifeChangerThread()
        {
            bool shouldReloadModelIndex = true;

            RuntimeGlobals.selectedKnifeModelIndex = 0;
            int selectedKnifeIndex = 0;

            while (true)
            {
                if (!Globals.KnifeChangerEnabled)
                {
                    Thread.Sleep(Globals.IdleWait);
                    shouldReloadModelIndex = true;
                    continue;
                }
                if (!EngineDLL.InGame)
                {
                    Thread.Sleep(Globals.IdleWait);
                    shouldReloadModelIndex = true;
                    continue;
                }

                if (shouldReloadModelIndex || selectedKnifeIndex != (int)Constants.KnifeList[Globals.SelectedKnife].itemDefinitionIndex)
                {
                    RuntimeGlobals.selectedKnifeModelIndex = EngineDLL.GetModelIndexByName(Constants.KnifeList[Globals.SelectedKnife].modelName);
                    selectedKnifeIndex     = (int)Constants.KnifeList[Globals.SelectedKnife].itemDefinitionIndex;
                    shouldReloadModelIndex = false;
                }

                for (var i = 0; i < 12; i++)
                {
                    CBaseCombatWeapon currentWeapon = weaponList[i];

                    if (currentWeapon.IsKnife())
                    {
                        currentWeapon.ItemDefinitionIndex = (int)Constants.KnifeList[Globals.SelectedKnife].itemDefinitionIndex;
                        currentWeapon.EntityQuality       = 3;
                        currentWeapon.ModelIndex          = RuntimeGlobals.selectedKnifeModelIndex;
                        currentWeapon.ViewModelIndex      = RuntimeGlobals.selectedKnifeModelIndex;
                    }
                }

                for (int i = 0; i < 10; i++) //Seems to be making it more stable
                {
                    if (weaponList.ActiveWeapon.IsKnife())
                    {
                        weaponList.ActiveWeapon.ViewModelEntityModelIndex = RuntimeGlobals.selectedKnifeModelIndex;
                    }
                }

                Thread.Sleep(Globals.UsageDelay);
            }
        }
Exemple #2
0
        public static void SkinChangerThread()
        {
            int lastLoadedModelIndexForSkin = 0;

            while (true)
            {
                if (!Globals.SkinChangerEnabled)
                {
                    Thread.Sleep(Globals.IdleWait);
                    continue;
                }
                if (!EngineDLL.InGame)
                {
                    Thread.Sleep(Globals.IdleWait);
                    continue;
                }

                bool anythingChanged = false;
                for (var i = 0; i < 8; i++)
                {
                    CBaseCombatWeapon currentWeapon = weaponList[i];

                    bool contin   = false;
                    Skin selected = null;
                    try
                    {
                        foreach (Skin s in Globals.LoadedPresets)
                        {
                            if (Convert.ToInt32(s.WeaponID) == currentWeapon.ItemDefinitionIndex)
                            {
                                contin   = true;
                                selected = s;
                                break;
                            }
                        }
                    }
                    catch { continue; }

                    if (!contin)
                    {
                        continue;
                    }
                    if (currentWeapon.IsKnife())
                    {
                        if (selected.WeaponID == (int)Constants.KnifeList[Globals.SelectedKnife].itemDefinitionIndex)
                        {
                            if ((currentWeapon.PaintKit != selected.PaintKit || lastLoadedModelIndexForSkin != RuntimeGlobals.selectedKnifeModelIndex))
                            {
                                currentWeapon.ItemIDHigh    = -1;
                                currentWeapon.PaintKit      = selected.PaintKit;
                                currentWeapon.Wear          = 0.0001f;
                                lastLoadedModelIndexForSkin = RuntimeGlobals.selectedKnifeModelIndex;

                                if (!Globals.ManualLoadEnabled)
                                {
                                    EngineDLL.ForceReload = -1;
                                }
                                anythingChanged = true;
                            }
                        }
                        continue;
                    }

                    if (currentWeapon.PaintKit != selected.PaintKit &&
                        currentWeapon.ItemDefinitionIndex == selected.WeaponID)
                    {
                        currentWeapon.ItemIDHigh = -1;
                        currentWeapon.PaintKit   = selected.PaintKit;
                        if (selected.Seed != -1)
                        {
                            currentWeapon.Seed = selected.Seed;
                        }
                        currentWeapon.Wear      = selected.Wear;
                        currentWeapon.AccountID = currentWeapon.XuIDLow;
                        if (selected.CustomName != null && selected.CustomName != "")
                        {
                            currentWeapon.CustomName = selected.CustomName;
                        }

                        if (!Globals.ManualLoadEnabled)
                        {
                            EngineDLL.ForceReload = -1;
                        }
                        anythingChanged = true;
                    }
                }
                if (Globals.ManualLoadEnabled && (GetAsyncKeyState((int)Keys.P) & 0x8000) > 0)
                {
                    EngineDLL.ForceReload = -1;
                }

                Thread.Sleep(TimeSpan.FromMilliseconds(0.1));
            }
        }
Exemple #3
0
        public static void KnifeChangerAnimationFixThread()
        {
            bool shouldReloadModelIndex = true;
            int  butterflyModelIndex    = 0;
            int  falchionModelIndex     = 0;
            int  cssModelIndex          = 0;
            int  pushModelIndex         = 0;
            int  bowieModelIndex        = 0;
            int  ursusModelIndex        = 0;
            int  cordModelIndex         = 0;
            int  canisModelIndex        = 0;
            int  outdoorModelIndex      = 0;
            int  skeletonModelIndex     = 0;
            int  stilettoModelIndex     = 0;
            int  widowmakerModelIndex   = 0;

            while (true)
            {
                if (!Globals.KnifeChangerEnabled || !Globals.KnifeChangerAnimFixEnabled)
                {
                    Thread.Sleep(Globals.IdleWait);
                    shouldReloadModelIndex = true;
                    continue;
                }
                if (!EngineDLL.InGame)
                {
                    Thread.Sleep(Globals.IdleWait);
                    shouldReloadModelIndex = true;
                    continue;
                }

                if (shouldReloadModelIndex)
                {
                    butterflyModelIndex    = EngineDLL.GetModelIndexByName("models/weapons/v_knife_butterfly.mdl");
                    falchionModelIndex     = EngineDLL.GetModelIndexByName("models/weapons/v_knife_falchion_advanced.mdl");
                    cssModelIndex          = EngineDLL.GetModelIndexByName("models/weapons/v_knife_css.mdl");
                    pushModelIndex         = EngineDLL.GetModelIndexByName("models/weapons/v_knife_push.mdl");
                    bowieModelIndex        = EngineDLL.GetModelIndexByName("models/weapons/v_knife_survival_bowie.mdl");
                    ursusModelIndex        = EngineDLL.GetModelIndexByName("models/weapons/v_knife_ursus.mdl");
                    cordModelIndex         = EngineDLL.GetModelIndexByName("models/weapons/v_knife_cord.mdl");
                    canisModelIndex        = EngineDLL.GetModelIndexByName("models/weapons/v_knife_canis.mdl");
                    outdoorModelIndex      = EngineDLL.GetModelIndexByName("models/weapons/v_knife_outdoor.mdl");
                    skeletonModelIndex     = EngineDLL.GetModelIndexByName("models/weapons/v_knife_skeleton.mdl");
                    stilettoModelIndex     = EngineDLL.GetModelIndexByName("models/weapons/v_knife_stiletto.mdl");
                    widowmakerModelIndex   = EngineDLL.GetModelIndexByName("models/weapons/v_knife_widowmaker.mdl");
                    shouldReloadModelIndex = false;
                }

                CBaseCombatWeapon currentWeapon = weaponList.ActiveWeapon;

                if (currentWeapon.ViewModelEntityModelIndex == butterflyModelIndex)
                {
                    switch (currentWeapon.Sequence)
                    {
                    case (int)Sequence.SEQUENCE_DEFAULT_DRAW:
                        currentWeapon.Sequence = RandomSequence((int)Sequence.SEQUENCE_BUTTERFLY_DRAW, (int)Sequence.SEQUENCE_BUTTERFLY_DRAW2);
                        break;

                    case (int)Sequence.SEQUENCE_DEFAULT_LOOKAT01:
                        currentWeapon.Sequence = RandomSequence((int)Sequence.SEQUENCE_BUTTERFLY_LOOKAT01, (int)Sequence.SEQUENCE_BUTTERFLY_LOOKAT03);
                        break;
                    }
                }
                else if (currentWeapon.ViewModelEntityModelIndex == falchionModelIndex)
                {
                    switch (currentWeapon.Sequence)
                    {
                    case (int)Sequence.SEQUENCE_DEFAULT_IDLE2:
                        currentWeapon.Sequence = (int)Sequence.SEQUENCE_FALCHION_IDLE1;
                        break;

                    case (int)Sequence.SEQUENCE_DEFAULT_HEAVY_MISS1:
                        currentWeapon.Sequence = RandomSequence((int)Sequence.SEQUENCE_FALCHION_HEAVY_MISS1, (int)Sequence.SEQUENCE_FALCHION_HEAVY_MISS1_NOFLIP);
                        break;

                    case (int)Sequence.SEQUENCE_DEFAULT_LOOKAT01:
                        currentWeapon.Sequence = RandomSequence((int)Sequence.SEQUENCE_FALCHION_LOOKAT01, (int)Sequence.SEQUENCE_FALCHION_LOOKAT02);
                        break;
                    }
                }
                else if (currentWeapon.ViewModelEntityModelIndex == cssModelIndex)
                {
                    switch (currentWeapon.Sequence)
                    {
                    case (int)Sequence.SEQUENCE_DEFAULT_LOOKAT01:
                        currentWeapon.Sequence = RandomSequence((int)Sequence.SEQUENCE_CSS_LOOKAT01, (int)Sequence.SEQUENCE_CSS_LOOKAT02);
                        break;
                    }
                }
                else if (currentWeapon.ViewModelEntityModelIndex == pushModelIndex)
                {
                    switch (currentWeapon.Sequence)
                    {
                    case (int)Sequence.SEQUENCE_DEFAULT_IDLE2:
                        currentWeapon.Sequence = (int)Sequence.SEQUENCE_DAGGERS_IDLE1;
                        break;

                    case (int)Sequence.SEQUENCE_DEFAULT_LIGHT_MISS1:
                    case (int)Sequence.SEQUENCE_DEFAULT_LIGHT_MISS2:
                        currentWeapon.Sequence = RandomSequence((int)Sequence.SEQUENCE_DAGGERS_LIGHT_MISS1, (int)Sequence.SEQUENCE_DAGGERS_LIGHT_MISS5);
                        break;

                    case (int)Sequence.SEQUENCE_DEFAULT_HEAVY_MISS1:
                        currentWeapon.Sequence = RandomSequence((int)Sequence.SEQUENCE_DAGGERS_HEAVY_MISS2, (int)Sequence.SEQUENCE_DAGGERS_HEAVY_MISS1);
                        break;
                    }
                }
                else if (currentWeapon.ViewModelEntityModelIndex == bowieModelIndex)
                {
                    switch (currentWeapon.Sequence)
                    {
                    case (int)Sequence.SEQUENCE_DEFAULT_IDLE2:
                        currentWeapon.Sequence = (int)Sequence.SEQUENCE_BOWIE_IDLE1;
                        break;
                    }
                }
                else if (currentWeapon.ViewModelEntityModelIndex == ursusModelIndex ||
                         currentWeapon.ViewModelEntityModelIndex == cordModelIndex ||
                         currentWeapon.ViewModelEntityModelIndex == canisModelIndex ||
                         currentWeapon.ViewModelEntityModelIndex == outdoorModelIndex ||
                         currentWeapon.ViewModelEntityModelIndex == skeletonModelIndex)
                {
                    switch (currentWeapon.Sequence)
                    {
                    case (int)Sequence.SEQUENCE_DEFAULT_DRAW:
                        currentWeapon.Sequence = RandomSequence((int)Sequence.SEQUENCE_BUTTERFLY_DRAW, (int)Sequence.SEQUENCE_BUTTERFLY_DRAW2);
                        break;

                    case (int)Sequence.SEQUENCE_DEFAULT_LOOKAT01:
                        currentWeapon.Sequence = RandomSequence((int)Sequence.SEQUENCE_BUTTERFLY_LOOKAT01, 14);
                        break;
                    }
                }
                else if (currentWeapon.ViewModelEntityModelIndex == stilettoModelIndex)
                {
                    switch (currentWeapon.Sequence)
                    {
                    case (int)Sequence.SEQUENCE_DEFAULT_LOOKAT01:
                        currentWeapon.Sequence = RandomSequence(12, 13);
                        break;
                    }
                }
                else if (currentWeapon.ViewModelEntityModelIndex == widowmakerModelIndex)
                {
                    switch (currentWeapon.Sequence)
                    {
                    case (int)Sequence.SEQUENCE_DEFAULT_LOOKAT01:
                        currentWeapon.Sequence = RandomSequence(14, 15);
                        break;
                    }
                }

                Thread.Sleep(TimeSpan.FromMilliseconds(0.1));
            }
        }