Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Energy weapon flag #14

Closed
FakelsHub opened this issue Jul 18, 2019 · 7 comments
Closed

Energy weapon flag #14

FakelsHub opened this issue Jul 18, 2019 · 7 comments

Comments

@FakelsHub
Copy link
Collaborator

FakelsHub commented Jul 18, 2019

Имеется один свободный бит для указания того, что оружие будет принудительно использовать навык Энергетического оружия.

0х0018 Weapon Flags (флаги оружия):
0x00000100 – Big Gun (оружие относится к классу Big Guns)
0x00000200 – 2Hnd (оружие относится к классу двуручных)
0x00000400 – Energy Gun

Вставить хак в: 0x47831E

@NovaRain
Copy link

Well, the issue on NMA can be solved by hook script.

@FakelsHub
Copy link
Collaborator Author

FakelsHub commented Jul 19, 2019

through the script, your crutch turns out to be bad, imagine that there are two hooks for damage calculate. therefore, your crutch must always perform last !

@FakelsHub
Copy link
Collaborator Author

may need to add one additional hook "attack" start/end еvent
I have long wanted to introduce it but something constantly distracted me from adding it.

@NovaRain
Copy link

NovaRain commented Jul 19, 2019

may need to add one additional hook "attack" start/end еvent
I have long wanted to introduce it but something constantly distracted me from adding it.

Doesn't AfterHitHook get triggered right before an attack?

EDIT: about the EW flag, is this code OK?

static const DWORD item_w_skill_break = 0x478332;
static void __declspec(naked) item_w_skill_hook() {
    __asm {
        mov  eax, [esp + 4];
        test byte ptr [eax + 0x19], 4;
        jnz  energy;
        xor  eax, eax;
        jmp  item_w_damage_type_;
energy:
        add  esp, 4;
        jmp  item_w_skill_break;
    }
}

HookCall(0x47831E, item_w_skill_hook);

@FakelsHub
Copy link
Collaborator Author

FakelsHub commented Jul 19, 2019

HOOK_AFTERHITROLL - executed after HOOK_TOHIT

static void __declspec(naked) item_w_skill_hook() {
    __asm {
        mov  edx, [esp + 4]; // item proto
        test byte ptr [edx + 0x19], 4; // weapon.flags_ext
        jnz  energy;
        mov  edx, ebx;
        jmp  item_w_damage_type_
energy:
        inc  eax; // DMG_laser  
        retn;
    }
}

@NovaRain
Copy link

NovaRain commented Jul 19, 2019

Isn't 0x19 weapon.Weapon (part of flags_ext)?

@FakelsHub
Copy link
Collaborator Author

да

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants