Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

Autor Topic: Fix Custom RF Gloves (Season 9)  (Visto 853 veces)

0 Miembros and 1 Guest are viewing this topic.

Online djagripnos on: October 09, 2018, 02:11:09 AM

Note : Custom Gloves Effects are not included in this released. I use a different Custom Effect System in S9, not time to release it now:P
So, missing visual effect is expected. You may need to code custom effects by yourself. Cheer!


DllMain Hook
Citar
    HookThis((DWORD)&VicRFGloves_4, HOOK_RF_GLOVES_4);
    HookThis((DWORD)&VicRFGloves_3, HOOK_RF_GLOVES_3);
    HookThis((DWORD)&VicRFGloves_2, HOOK_RF_GLOVES_2);
    HookThis((DWORD)&VicRFGloves_1, HOOK_RF_GLOVES_1);


CustomRFWeaponsFix


Citar
/-------------------------------------------
//Fix Added Custom RF Weapons
//By Vic
//-------------------------------------------

#define HOOK_RF_GLOVES_1 0x005999CA
#define JMPBACK_RF_GLOVES_1 0x005999D2
#define HOOK_RF_GLOVES_2 0x00521C96
#define JMPBACK_RF_GLOVES_2 0x00521C9C
#define HOOK_RF_GLOVES_3 0x00586BDA
#define JMPBACK_RF_GLOVES_3 0x00586BE0
#define HOOK_RF_GLOVES_4 0x00612D02
#define JMPBACK_RF_GLOVES_4 0x00612D08

#define CUSTOM_RF_WEAPONS_MAX 4
#define CUSTOM_RF_WEAPONS_LR_GAP 100
DWORD VIC_CUSTOM_RF_WEAPONS[CUSTOM_RF_WEAPONS_MAX] = { 46,52,53,56 };
DWORD VIC_CUSTOM_RF_WEAPONS_R[CUSTOM_RF_WEAPONS_MAX] = { 146,152,153,156 };
DWORD VIC_CUSTOM_RF_WEAPONS_L[CUSTOM_RF_WEAPONS_MAX] = { 246,252,253,256 };

BOOL VicIsCustomRFWeapons(DWORD idx)
{
    if (idx > 1272)
        idx -= 1272;
    for (int i = 0; i < CUSTOM_RF_WEAPONS_MAX; i++)
        if (VIC_CUSTOM_RF_WEAPONS == idx)
            return TRUE;
    return FALSE;
}

BOOL VicIsCustomRFWeapons2(DWORD idx)
{
    if (idx > 1272)
        idx -= 1272;
    for (int i = 0; i < CUSTOM_RF_WEAPONS_MAX; i++)
        if (VIC_CUSTOM_RF_WEAPONS_L == idx || VIC_CUSTOM_RF_WEAPONS_R == idx)
            return TRUE;
    return FALSE;
}

DWORD vRFTemp1;
void __declspec(naked) VicRFGloves_1()
{
    _asm
    {
        mov eax, [ebp - 0x1C];
        mov vRFTemp1, eax;
    }
   
    if (VicIsCustomRFWeapons(vRFTemp1))
    {
        _asm
        {
            mov edx, 0x005999DE;
            jmp edx;
        }
    }

    _asm
    {
        push[ebp - 0x1C];
        mov ecx, 0x012767A0;
        mov edx, JMPBACK_RF_GLOVES_1;
        jmp edx;
    }
}

void __declspec(naked) VicRFGloves_2(DWORD a1, DWORD mIdx, DWORD slot)
{
    if (slot == 0 || slot == 1)
    {
        if (VicIsCustomRFWeapons(mIdx))
        {
            mIdx += CUSTOM_RF_WEAPONS_GAP*(slot+1);
        }
    }
       
    _asm
    {
        push slot;
        push mIdx;
        mov edx, JMPBACK_RF_GLOVES_2;
        jmp edx;
    }
}

DWORD vRFTemp3;
void __declspec(naked) VicRFGloves_3()
{
    _asm
    {
        mov vRFTemp3, eax;
    }
   
    if (VicIsCustomRFWeapons(vRFTemp3))
    {
        _asm
        {
            mov edx, 0x00586BEC;
            jmp edx;
        }
    }
   
    _asm
    {
        mov eax, [ebp - 0x00000348];
        movsx eax, word ptr[eax];
        push eax;
        mov ecx, 0x012767A0;
        mov edx, JMPBACK_RF_GLOVES_3;
        jmp edx;
    }
}

void __declspec(naked) VicRFGloves_4(DWORD a1, DWORD mIdx)
{
    if (VicIsCustomRFWeapons2(mIdx))
    {
        _asm
        {
            mov edx, 0x00612D19;
            jmp edx;
        }
    }
    _asm
    {
        push mIdx;
        push a1;
        mov edx, JMPBACK_RF_GLOVES_4;
        jmp edx;
    }
}


Remember to add L/R RF Gloves bmd in item.bmd




Credits:
MeWZ
« Ultima edicion: January 17, 2019, 06:45:09 AM by Gaboo; »

Gracias:


Offline baolove000 #1 on: October 04, 2019, 03:22:00 AM

can u help me how to use this code, i wanna to fix my item

Solo usuarios registrados pueden comentar y agradecer, Logueate o Registrate

 

Related Topics

  Subject / Started by Replies Last post
8 Replies
1989 Views
Last post January 02, 2019, 06:22:32 PM
by djagripnos
14 Replies
2835 Views
Last post April 23, 2020, 03:11:44 AM
by erickmalfoy
9 Replies
518 Views
Last post March 05, 2020, 02:15:02 PM
by takumi12
6 Replies
331 Views
Last post October 07, 2019, 01:22:57 AM
by baolove000
17 Replies
779 Views
Last post April 26, 2020, 09:18:36 AM
by reveage