mirror of
https://github.com/qwertyuiop3/Storm.git
synced 2024-12-22 22:57:23 +08:00
shotgun seeds (dumped from aw. noop), mindamage (almost)
This commit is contained in:
parent
9e8f4ae26e
commit
3dab45c4aa
109
Copy_Command.hpp
109
Copy_Command.hpp
@ -33,7 +33,9 @@ void* Original_Copy_Command_Caller;
|
|||||||
|
|
||||||
void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structure* Command)
|
void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structure* Command)
|
||||||
{
|
{
|
||||||
Extended_Command_Structure* Extended_Command = &Extended_Commands[Command->Command_Number % 150];
|
Command->Frame_Number = Command->Command_Number % 150;
|
||||||
|
|
||||||
|
Extended_Command_Structure* Extended_Command = &Extended_Commands[Command->Frame_Number];
|
||||||
|
|
||||||
Extended_Command->Extra_Commands = 0;
|
Extended_Command->Extra_Commands = 0;
|
||||||
|
|
||||||
@ -292,7 +294,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
|
|||||||
{
|
{
|
||||||
if (Identifier == 277)
|
if (Identifier == 277)
|
||||||
{
|
{
|
||||||
if (*(float*)((unsigned __int32)Entity + 4844) == 1)
|
//if (*(float*)((unsigned __int32)Entity + 4844) == 1)
|
||||||
{
|
{
|
||||||
Sorted_Target_List.push_back(Target);
|
Sorted_Target_List.push_back(Target);
|
||||||
}
|
}
|
||||||
@ -366,7 +368,7 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
|
|||||||
|
|
||||||
__int8 Forced = 0;
|
__int8 Forced = 0;
|
||||||
|
|
||||||
if (Is_Melee + Healing != 0)
|
if (Is_Melee + Healing != 0) //zero clip?
|
||||||
{
|
{
|
||||||
if ((Target->Identifier ^ 72) % 348 >= 72)
|
if ((Target->Identifier ^ 72) % 348 >= 72)
|
||||||
{
|
{
|
||||||
@ -409,11 +411,13 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
|
|||||||
|
|
||||||
*(__int32*)((unsigned __int32)Weapon + 3248) = 0;
|
*(__int32*)((unsigned __int32)Weapon + 3248) = 0;
|
||||||
|
|
||||||
Perform_Trace_Target = (void*)((unsigned __int32)Target->Self ^ 1);
|
Perform_Trace_Target = Target->Self;
|
||||||
|
|
||||||
|
Perform_Trace_Damage = 0;
|
||||||
|
|
||||||
Perform_Shove_Trace((unsigned __int32)Client_Module + 3220512)(Weapon, Direction);
|
Perform_Shove_Trace((unsigned __int32)Client_Module + 3220512)(Weapon, Direction);
|
||||||
|
|
||||||
if (Perform_Trace_Target == Target->Self)
|
if (Perform_Trace_Damage == 1)
|
||||||
{
|
{
|
||||||
Command->Tick_Number = Target->Tick_Number;
|
Command->Tick_Number = Target->Tick_Number;
|
||||||
|
|
||||||
@ -465,14 +469,56 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
|
|||||||
{
|
{
|
||||||
__int8 Can_Attack = (*(float*)((unsigned __int32)Weapon + 2400) <= Global_Variables->Current_Time) * (*(__int32*)((unsigned __int32)Weapon + 2436) > 0 - Is_Melee * 2) * (*(float*)((unsigned __int32)Local_Player + 3872) <= Global_Variables->Current_Time);
|
__int8 Can_Attack = (*(float*)((unsigned __int32)Weapon + 2400) <= Global_Variables->Current_Time) * (*(__int32*)((unsigned __int32)Weapon + 2436) > 0 - Is_Melee * 2) * (*(float*)((unsigned __int32)Local_Player + 3872) <= Global_Variables->Current_Time);
|
||||||
|
|
||||||
if (Can_Attack == 1)
|
if ((Can_Attack == 0) + (Weapon_Identifier == 96) + Healing == 0)
|
||||||
{
|
|
||||||
if (Weapon_Identifier != 96)
|
|
||||||
{
|
{
|
||||||
Target_Structure* Aim_Target = nullptr;
|
Target_Structure* Aim_Target = nullptr;
|
||||||
|
|
||||||
if (Is_Melee + Healing == 0)
|
if (Is_Melee == 0)
|
||||||
{
|
{
|
||||||
|
__int8 Compensate_Burst = 0;
|
||||||
|
|
||||||
|
if (Weapon_Identifier == 153)
|
||||||
|
{
|
||||||
|
if (*(float*)((unsigned __int32)Weapon + 3392) + *(float*)((unsigned __int32)Weapon + 3396) != 0)
|
||||||
|
{
|
||||||
|
Compensate_Burst = 1;
|
||||||
|
|
||||||
|
Command->Buttons |= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Weapon_Identifier == 2)
|
||||||
|
{
|
||||||
|
Command->Command_Number = -2134739495;
|
||||||
|
|
||||||
|
Command->Random_Seed = 11144000;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Weapon_Identifier == 148)
|
||||||
|
{
|
||||||
|
Command->Command_Number = -2139542887;
|
||||||
|
|
||||||
|
Command->Random_Seed = 1246243990;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ((163 - Weapon_Identifier ^ Weapon_Identifier - 162) == 1)
|
||||||
|
{
|
||||||
|
Command->Command_Number = -2139097805;
|
||||||
|
|
||||||
|
Command->Random_Seed = 494641349;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
using Update_Spread_Type = void(__thiscall*)(void* Weapon);
|
||||||
|
|
||||||
|
if (Compensate_Burst == 0)
|
||||||
|
{
|
||||||
|
Update_Spread_Type((unsigned __int32)Client_Module + 3197648)(Weapon);
|
||||||
|
}
|
||||||
|
|
||||||
Target_Number = 0;
|
Target_Number = 0;
|
||||||
|
|
||||||
Aim_Traverse_Sorted_Target_List_Label:
|
Aim_Traverse_Sorted_Target_List_Label:
|
||||||
@ -493,16 +539,25 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
|
|||||||
|
|
||||||
__int32 Bullets = *(__int32*)((unsigned __int32)Weapon_Data + 2520);
|
__int32 Bullets = *(__int32*)((unsigned __int32)Weapon_Data + 2520);
|
||||||
|
|
||||||
|
if (Interface_Penetration_Damage.Floating_Point == 0)
|
||||||
|
{
|
||||||
*(__int32*)((unsigned __int32)Weapon_Data + 2520) = 1;
|
*(__int32*)((unsigned __int32)Weapon_Data + 2520) = 1;
|
||||||
|
}
|
||||||
|
|
||||||
Perform_Trace_Target = (void*)((unsigned __int32)Target->Self ^ 1);
|
Perform_Trace_Target = Target->Self;
|
||||||
|
|
||||||
|
Perform_Trace_Damage = 0;
|
||||||
|
|
||||||
void* Previous_Audio_Device = *(void**)((unsigned __int32)Engine_Module + 5050008);
|
void* Previous_Audio_Device = *(void**)((unsigned __int32)Engine_Module + 5050008);
|
||||||
|
|
||||||
*(void**)((unsigned __int32)Engine_Module + 5050008) = nullptr;
|
*(void**)((unsigned __int32)Engine_Module + 5050008) = nullptr;
|
||||||
|
|
||||||
|
*(__int32*)((unsigned __int32)Client_Module + 7075944) = Command->Random_Seed;
|
||||||
|
|
||||||
*(__int32*)((unsigned __int32)Client_Module + 7683464) = 1;
|
*(__int32*)((unsigned __int32)Client_Module + 7683464) = 1;
|
||||||
|
|
||||||
|
*(__int32*)((unsigned __int32)Client_Module + 7689576) = 0;
|
||||||
|
|
||||||
*(__int32*)((unsigned __int32)Client_Module + 8175320) = 0;
|
*(__int32*)((unsigned __int32)Client_Module + 8175320) = 0;
|
||||||
|
|
||||||
*(__int32*)((unsigned __int32)Client_Module + 8175392) = 0;
|
*(__int32*)((unsigned __int32)Client_Module + 8175392) = 0;
|
||||||
@ -515,13 +570,19 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
|
|||||||
|
|
||||||
*(__int32*)((unsigned __int32)Client_Module + 8175320) = 1;
|
*(__int32*)((unsigned __int32)Client_Module + 8175320) = 1;
|
||||||
|
|
||||||
|
*(__int32*)((unsigned __int32)Client_Module + 7689576) = 1;
|
||||||
|
|
||||||
*(__int32*)((unsigned __int32)Client_Module + 7683464) = 0;
|
*(__int32*)((unsigned __int32)Client_Module + 7683464) = 0;
|
||||||
|
|
||||||
*(void**)((unsigned __int32)Engine_Module + 5050008) = Previous_Audio_Device;
|
*(void**)((unsigned __int32)Engine_Module + 5050008) = Previous_Audio_Device;
|
||||||
|
|
||||||
*(__int32*)((unsigned __int32)Weapon_Data + 2520) = Bullets;
|
*(__int32*)((unsigned __int32)Weapon_Data + 2520) = Bullets;
|
||||||
|
|
||||||
return Perform_Trace_Target == Target->Self;
|
Perform_Trace_Target = nullptr;
|
||||||
|
|
||||||
|
wprintf(L"%f\n", Perform_Trace_Damage);
|
||||||
|
|
||||||
|
return (Perform_Trace_Damage >= Interface_Penetration_Damage.Floating_Point) * (Perform_Trace_Damage != 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
static std::unordered_map<__int32, __int32> Hitboxes =
|
static std::unordered_map<__int32, __int32> Hitboxes =
|
||||||
@ -591,13 +652,13 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Perform_Trace(Angles) == 1)
|
if (Perform_Trace(Command->Angles) == 1)
|
||||||
{
|
{
|
||||||
Command->Tick_Number = Target->Tick_Number;
|
Command->Tick_Number = Target->Tick_Number;
|
||||||
|
|
||||||
Byte_Manager::Copy_Bytes(0, Command->Angles, sizeof(Angles), Angles);
|
//Byte_Manager::Copy_Bytes(0, Command->Angles, sizeof(Angles), Angles);
|
||||||
|
|
||||||
Command->Buttons |= 1;
|
//Command->Buttons |= 1;
|
||||||
|
|
||||||
*(float*)((unsigned __int32)Target->Self + 16) = Get_Target_Time(Target);
|
*(float*)((unsigned __int32)Target->Self + 16) = Get_Target_Time(Target);
|
||||||
|
|
||||||
@ -617,18 +678,6 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__int8 Compensate_Burst = 0;
|
|
||||||
|
|
||||||
if (Weapon_Identifier == 153)
|
|
||||||
{
|
|
||||||
if (*(float*)((unsigned __int32)Weapon + 3392) + *(float*)((unsigned __int32)Weapon + 3396) != 0)
|
|
||||||
{
|
|
||||||
Compensate_Burst = 1;
|
|
||||||
|
|
||||||
Command->Buttons |= 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((Command->Buttons & 1) == 1)
|
if ((Command->Buttons & 1) == 1)
|
||||||
{
|
{
|
||||||
if (Shove_Target != nullptr)
|
if (Shove_Target != nullptr)
|
||||||
@ -647,13 +696,6 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
|
|||||||
|
|
||||||
using Random_Type = float(__cdecl*)(char* Name, float Minimum, float Maximum, void* Unknown_Parameter);
|
using Random_Type = float(__cdecl*)(char* Name, float Minimum, float Maximum, void* Unknown_Parameter);
|
||||||
|
|
||||||
using Update_Spread_Type = void(__thiscall*)(void* Weapon);
|
|
||||||
|
|
||||||
if (Compensate_Burst == 0)
|
|
||||||
{
|
|
||||||
Update_Spread_Type((unsigned __int32)Client_Module + 3197648)(Weapon);
|
|
||||||
}
|
|
||||||
|
|
||||||
float Maximum_Spread = *(float*)((unsigned __int32)Weapon + 3340);
|
float Maximum_Spread = *(float*)((unsigned __int32)Weapon + 3340);
|
||||||
|
|
||||||
float* Recoil = (float*)((unsigned __int32)Local_Player + 4612);
|
float* Recoil = (float*)((unsigned __int32)Local_Player + 4612);
|
||||||
@ -668,7 +710,6 @@ void __thiscall Redirected_Copy_Command(void* Unknown_Parameter, Command_Structu
|
|||||||
Block_Buttons = 2048;
|
Block_Buttons = 2048;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (Block_Buttons == 2049)
|
if (Block_Buttons == 2049)
|
||||||
{
|
{
|
||||||
|
@ -181,6 +181,14 @@ __int32 __stdcall DllMain(HMODULE This_Module, unsigned __int32 Call_Reason, voi
|
|||||||
|
|
||||||
Client_Module = GetModuleHandleW(L"client.dll");
|
Client_Module = GetModuleHandleW(L"client.dll");
|
||||||
|
|
||||||
|
//DEBUG
|
||||||
|
{
|
||||||
|
*(__int32*)((unsigned __int32)Client_Module + 0x7B25A8 + 0x14) &= ~0xA;
|
||||||
|
*(__int32*)((unsigned __int32)Client_Module + 0x782838 + 0x14) &= ~0xA;
|
||||||
|
*(__int32*)((unsigned __int32)Client_Module + 0x7803D8 + 0x14) &= ~0xA;
|
||||||
|
*(__int32*)((unsigned __int32)Engine_Module + 0x679538 + 0x14) &= ~0xA;
|
||||||
|
}
|
||||||
|
|
||||||
_putws(L"[ + ] Events");
|
_putws(L"[ + ] Events");
|
||||||
{
|
{
|
||||||
Redirection_Manager::Redirect_Function(Original_Post_Network_Data_Received_Caller, 0, (void*)((unsigned __int32)Client_Module + 1555264), 1, (void*)Redirected_Post_Network_Data_Received);
|
Redirection_Manager::Redirect_Function(Original_Post_Network_Data_Received_Caller, 0, (void*)((unsigned __int32)Client_Module + 1555264), 1, (void*)Redirected_Post_Network_Data_Received);
|
||||||
|
@ -42,6 +42,8 @@ __int32 Get_Identifier(void* Entity, __int8 Raw, __int8 Equipment)
|
|||||||
|
|
||||||
if (Identifier == 13)
|
if (Identifier == 13)
|
||||||
{
|
{
|
||||||
|
*(__int32*)((unsigned __int32)Entity + 228) = 1;
|
||||||
|
|
||||||
Valid = *(__int8*)((unsigned __int32)Entity + 324) == 5;
|
Valid = *(__int8*)((unsigned __int32)Entity + 324) == 5;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -79,7 +79,7 @@ void __thiscall Redirected_Paint(void* Panel)
|
|||||||
{
|
{
|
||||||
Target_Structure* Target = &Sorted_Target_List.at(Target_Number);
|
Target_Structure* Target = &Sorted_Target_List.at(Target_Number);
|
||||||
|
|
||||||
float Bounds[4] = { FLT_MAX, FLT_MIN, FLT_MAX, FLT_MIN };
|
float Bounds[4] = { __builtin_inff(), -__builtin_inff(), __builtin_inff(), -__builtin_inff()};
|
||||||
|
|
||||||
auto Get_Bounds = [&]() -> __int8
|
auto Get_Bounds = [&]() -> __int8
|
||||||
{
|
{
|
||||||
|
@ -2,9 +2,11 @@ void __thiscall Perform_Shove_Trace(void* Stack)
|
|||||||
{
|
{
|
||||||
void* Entity = *(void**)((unsigned __int32)Stack - 276);
|
void* Entity = *(void**)((unsigned __int32)Stack - 276);
|
||||||
|
|
||||||
if (Entity == (void*)((unsigned __int32)Perform_Trace_Target ^ 1))
|
if (Entity == Perform_Trace_Target)
|
||||||
{
|
{
|
||||||
Perform_Trace_Target = Entity;
|
Perform_Trace_Target = nullptr;
|
||||||
|
|
||||||
|
Perform_Trace_Damage = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,24 +1,5 @@
|
|||||||
void* Perform_Trace_Target;
|
void* Perform_Trace_Target;
|
||||||
|
|
||||||
__declspec(noinline) float Calculate_Damage(void* Weapon_Data, float Distance)
|
|
||||||
{
|
|
||||||
static void* Calculate_Damage = (void*)((unsigned __int32)GetModuleHandleW(L"server.dll") + 3950416);
|
|
||||||
|
|
||||||
float Damage;
|
|
||||||
|
|
||||||
asm("pushl %esi");
|
|
||||||
asm("movl %0, %%esi" : : "m"(Weapon_Data));
|
|
||||||
asm("subl $16, %esp");
|
|
||||||
asm("movss %0, %%xmm0" : : "m"(Distance) : "esp");
|
|
||||||
asm("movdqu %xmm0, (%esp)");
|
|
||||||
asm("calll *%0" : : "m"(Calculate_Damage));
|
|
||||||
asm("movd %%xmm0, %0" : "=m"(Damage));
|
|
||||||
asm("addl $16, %esp");
|
|
||||||
asm("popl %esi");
|
|
||||||
|
|
||||||
return Damage;
|
|
||||||
}
|
|
||||||
|
|
||||||
float Vector_Normalize(float* Vector)
|
float Vector_Normalize(float* Vector)
|
||||||
{
|
{
|
||||||
using Vector_Normalize_Type = float(__thiscall*)(float* Vector);
|
using Vector_Normalize_Type = float(__thiscall*)(float* Vector);
|
||||||
@ -33,6 +14,8 @@ void Angle_Vectors(float* Angles, float* Forward, float* Right, float* Up)
|
|||||||
Angle_Vectors_Type((unsigned __int32)Client_Module + 3539376)(Angles, Forward, Right, Up);
|
Angle_Vectors_Type((unsigned __int32)Client_Module + 3539376)(Angles, Forward, Right, Up);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
float Perform_Trace_Damage;
|
||||||
|
|
||||||
void __thiscall Perform_Trace(void* Stack)
|
void __thiscall Perform_Trace(void* Stack)
|
||||||
{
|
{
|
||||||
void* Entity = *(void**)((unsigned __int32)Stack + 312);
|
void* Entity = *(void**)((unsigned __int32)Stack + 312);
|
||||||
@ -50,7 +33,7 @@ void __thiscall Perform_Trace(void* Stack)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Entity == (void*)((unsigned __int32)Perform_Trace_Target ^ 1))
|
if (Entity == Perform_Trace_Target)
|
||||||
{
|
{
|
||||||
__int32 Group = *(__int32*)((unsigned __int32)Stack + 304);
|
__int32 Group = *(__int32*)((unsigned __int32)Stack + 304);
|
||||||
|
|
||||||
@ -62,15 +45,42 @@ void __thiscall Perform_Trace(void* Stack)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float* End = (float*)((unsigned __int32)Stack + 248);
|
|
||||||
|
|
||||||
void* Trace_Information = *(void**)((unsigned __int32)Stack + 36);
|
void* Trace_Information = *(void**)((unsigned __int32)Stack + 36);
|
||||||
|
|
||||||
if (Interface_Penetration_Damage.Integer != 0) //that's very cutted version of actual function [*::TraceAttack]
|
void* Weapon_Data = *(void**)((unsigned __int32)Trace_Information + 4);
|
||||||
|
|
||||||
|
float* End = (float*)((unsigned __int32)Stack + 248);
|
||||||
|
|
||||||
|
__int32 Upgrade_Type = (*(__int32*)((unsigned __int32)Trace_Information + 36) & 255) % 5;
|
||||||
|
|
||||||
|
__int32 Gender = *(__int32*)((unsigned __int32)Entity + 52);
|
||||||
|
|
||||||
|
auto Compute_Damage = [&]() -> void
|
||||||
|
{
|
||||||
|
if (Interface_Penetration_Damage.Integer == 0)
|
||||||
|
{
|
||||||
|
Perform_Trace_Damage = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
float* Start = (float*)((unsigned __int32)Stack + 236);
|
float* Start = (float*)((unsigned __int32)Stack + 236);
|
||||||
|
|
||||||
float Damage = Calculate_Damage(*(void**)((unsigned __int32)Trace_Information + 4), __builtin_sqrtf(__builtin_powf(End[0] - Start[0], 2) + __builtin_powf(End[1] - Start[1], 2) + __builtin_powf(End[2] - Start[2], 2)));
|
float Distance = __builtin_sqrtf(__builtin_powf(End[0] - Start[0], 2) + __builtin_powf(End[1] - Start[1], 2) + __builtin_powf(End[2] - Start[2], 2));
|
||||||
|
|
||||||
|
float Damage;
|
||||||
|
|
||||||
|
static void* Calculate_Damage = (void*)((unsigned __int32)GetModuleHandleW(L"server.dll") + 3950416);
|
||||||
|
{
|
||||||
|
asm("pushal"); //temporary. just in case
|
||||||
|
asm("movl %0, %%esi" : : "m"(Weapon_Data) : "esi");
|
||||||
|
asm("subl $16, %esp");
|
||||||
|
asm("movss %0, %%xmm0" : : "m"(Distance) : "esp");
|
||||||
|
asm("movdqu %xmm0, (%esp)");
|
||||||
|
asm("calll *%0" : : "m"(Calculate_Damage));
|
||||||
|
asm("movd %%xmm0, %0" : "=m"(Damage));
|
||||||
|
asm("addl $16, %esp");
|
||||||
|
asm("popal");
|
||||||
|
}
|
||||||
|
|
||||||
__int32 Identifier = Get_Identifier(Entity, 1, 0);
|
__int32 Identifier = Get_Identifier(Entity, 1, 0);
|
||||||
|
|
||||||
@ -78,68 +88,186 @@ void __thiscall Perform_Trace(void* Stack)
|
|||||||
{
|
{
|
||||||
using Get_Difficulty_Type = __int32(__cdecl*)();
|
using Get_Difficulty_Type = __int32(__cdecl*)();
|
||||||
|
|
||||||
//z_non_head_damage_factor_* (non-replicated unfortunately)
|
float Multipliers[3] = { 0.8f, 0.7f, 0.6f };
|
||||||
//assuming "z_use_next_difficulty_damage_factor" is "1" and "maxplayers" is not "1"
|
|
||||||
float Multipliers[4] = { 0.8f, 0.7f, 0.6f, 1.f };
|
|
||||||
|
|
||||||
Damage *= Multipliers[Get_Difficulty_Type((unsigned __int32)Client_Module + 2650448)()];
|
Damage *= Multipliers[Get_Difficulty_Type((unsigned __int32)Client_Module + 2650448)()];
|
||||||
};
|
};
|
||||||
|
|
||||||
if (Identifier == 277) //special scaling used by witches
|
__int32 Bullet_Type = *(__int32*)((unsigned __int32)Weapon_Data + 2128);
|
||||||
|
|
||||||
|
__int8 Is_Shotgun = (Bullet_Type ^ 12) % 7 == 4;
|
||||||
|
|
||||||
|
//should make sure it's not mutation8, mutation12, realism
|
||||||
|
auto Apply_Shotgun_Scaling = [&]() -> void
|
||||||
{
|
{
|
||||||
|
if (Is_Shotgun == 1)
|
||||||
|
{
|
||||||
|
using Compute_Bounds_Type = void(__thiscall*)(void* Collision, float* Start, float* Bounds);
|
||||||
|
|
||||||
|
using Get_Center_Type = float*(__thiscall*)(void* Entity);
|
||||||
|
|
||||||
|
void* Local_Player = *(void**)Trace_Information;
|
||||||
|
|
||||||
|
float Bounds[3];
|
||||||
|
|
||||||
|
Compute_Bounds_Type((unsigned __int32)Client_Module + 878528)((void*)((unsigned __int32)Entity + 540), Get_Center_Type((unsigned __int32)Client_Module + 114400)(Local_Player), Bounds);
|
||||||
|
|
||||||
|
using Calculate_Distance_Type = float(__thiscall*)(void* Collision, float* Bounds);
|
||||||
|
|
||||||
|
float Distance = Calculate_Distance_Type((unsigned __int32)Client_Module + 878608)((void*)((unsigned __int32)Local_Player + 540), Bounds);
|
||||||
|
|
||||||
|
if (Distance < 100)
|
||||||
|
{
|
||||||
|
Damage += (4.f * Damage) * __builtin_powf(1.f - Distance / 100.f, 2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (Identifier == 277)
|
||||||
|
{
|
||||||
|
//nb_delete_all;z_spawn witch
|
||||||
if (Group != 1)
|
if (Group != 1)
|
||||||
{
|
{
|
||||||
Apply_Difficulty_Scaling();
|
Apply_Difficulty_Scaling();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Apply_Shotgun_Scaling();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Identifier == 264) //special scaling used by common infected
|
if (Identifier == 264)
|
||||||
{
|
{
|
||||||
if (Identifier * Group == 264) //these are killed instantly on headshot
|
//nb_delete_all;ent_create commentary_zombie_spawner; ent_fire commentary_zombie_spawner spawnzombie common_male_fallen_survivor; ent_fire commentary_zombie_spawner kill
|
||||||
|
//id: 14
|
||||||
|
//nb_delete_all;ent_create commentary_zombie_spawner; ent_fire commentary_zombie_spawner spawnzombie common_male_jimmy; ent_fire commentary_zombie_spawner kill
|
||||||
|
//id: 17
|
||||||
|
if (Bullet_Type == 6)
|
||||||
{
|
{
|
||||||
Damage = FLT_MAX;
|
Damage = __builtin_inff();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Upgrade_Type == 1)
|
||||||
|
{
|
||||||
|
Damage = __builtin_inff();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Apply_Shotgun_Scaling();
|
||||||
|
|
||||||
|
__int8 Is_Sniper_Rifle = Bullet_Type == 9 || Bullet_Type == 10;
|
||||||
|
|
||||||
|
if (Group == 1)
|
||||||
|
{
|
||||||
|
if (Gender == 14)
|
||||||
|
{
|
||||||
|
auto Is_Neutral = [&]() -> __int8
|
||||||
|
{
|
||||||
|
__int32 Sequence_Activity = *(__int32*)((unsigned __int32)Entity + 4688);
|
||||||
|
|
||||||
|
unsigned __int32 Absolute_Sequence_Activity = Sequence_Activity - 563;
|
||||||
|
|
||||||
|
if (Absolute_Sequence_Activity <= 29)
|
||||||
|
{
|
||||||
|
return (536870929 & (1 << (Absolute_Sequence_Activity & 31))) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (Sequence_Activity == 600) + (Sequence_Activity == 648);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (Is_Neutral() == 1)
|
||||||
|
{
|
||||||
|
Damage = __builtin_inff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Gender != 17)
|
||||||
|
{
|
||||||
|
Damage = __builtin_inff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
if (Is_Shotgun * (Group == 3) == 1)
|
||||||
|
{
|
||||||
|
Damage = __builtin_inff();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Apply_Difficulty_Scaling();
|
Apply_Difficulty_Scaling();
|
||||||
|
|
||||||
//tbi: some guns are using special scaling (e.g. deagle)
|
if (Bullet_Type == 2 || Is_Sniper_Rifle == 1)
|
||||||
|
{
|
||||||
|
if (Gender == 14)
|
||||||
|
{
|
||||||
|
Damage = 450;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Damage = __builtin_inff();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else //special scaling used by non-common infected
|
else
|
||||||
{
|
{
|
||||||
if (*(__int32*)((unsigned __int32)Trace_Information + 36) != -2139094974) //explosives are doing "radial" damage instead
|
if (Bullet_Type >= 6)
|
||||||
{
|
{
|
||||||
if (Identifier != 276) //tanks aren't scaled
|
if ((Bullet_Type - 3) % 4 > 1)
|
||||||
{
|
{
|
||||||
Damage *= 1.f + 3.f * (Group == 1) + 0.25f * (Group == 3) - 0.25f * (Group == 7); //or: 0.25f * ((Group == 3) + -(Group == 7))
|
Damage = __builtin_inff();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Identifier != 13)
|
||||||
|
{
|
||||||
|
//nb_delete_all;z_spawn tank
|
||||||
|
if (Identifier + Bullet_Type == 284)
|
||||||
|
{
|
||||||
|
Damage *= 0.85f;
|
||||||
|
}
|
||||||
|
|
||||||
if (Identifier * Group == 270) //killed instantly on **hooked** headshot
|
if (Upgrade_Type != 1)
|
||||||
|
{
|
||||||
|
if (Identifier != 276)
|
||||||
|
{
|
||||||
|
Damage *= 1.f + 3.f * (Group == 1) + 0.25f * ((Group == 3) + -(Group == 7));
|
||||||
|
|
||||||
|
if (Identifier * Group == 270)
|
||||||
{
|
{
|
||||||
if (*(void**)((unsigned __int32)Entity + 8040) != INVALID_HANDLE_VALUE)
|
if (*(void**)((unsigned __int32)Entity + 8040) != INVALID_HANDLE_VALUE)
|
||||||
{
|
{
|
||||||
Damage = FLT_MAX;
|
Damage = __builtin_inff();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Damage = (__int32)(Damage + 1.f * (Damage < 1)); //rounding isn't applied to common infected or witches. make sure damage isn't zero before rounding
|
Damage = (__int32)(Damage + 1.f * (Damage < 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//actual shotgun multiplications (z_shotgun_bonus_damage_multiplier, z_shotgun_bonus_damage_range) would require extraneous tracing... so they're not here for moment
|
if (Is_Shotgun * Upgrade_Type == 1)
|
||||||
}
|
|
||||||
|
|
||||||
wprintf(L"hitgroup %d -> damage %f\n", Group, Damage); //compared to 'picker' output (along with nb_stop 1), since it's unfinished feature
|
|
||||||
|
|
||||||
if (Damage < Interface_Penetration_Damage.Floating_Point)
|
|
||||||
{
|
{
|
||||||
return;
|
Damage *= *(__int32*)((unsigned __int32)Weapon_Data + 2520);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((*(__int32*)((unsigned __int32)Trace_Information + 36) & 255) + *(__int32*)((unsigned __int32)Entity + 52) == 17)
|
wprintf(L"[%d] type %d, %d\n", Group, Bullet_Type, Upgrade_Type);
|
||||||
|
|
||||||
|
Perform_Trace_Damage += Damage;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (Upgrade_Type + Gender == 17)
|
||||||
{
|
{
|
||||||
float Inflictor_Direction[3];
|
float Inflictor_Direction[3];
|
||||||
|
|
||||||
@ -169,12 +297,12 @@ void __thiscall Perform_Trace(void* Stack)
|
|||||||
|
|
||||||
if (Inflictor_Direction[0] * Victim_Direction[0] + Inflictor_Direction[1] * Victim_Direction[1] + Inflictor_Direction[2] * Victim_Direction[2] >= 0)
|
if (Inflictor_Direction[0] * Victim_Direction[0] + Inflictor_Direction[1] * Victim_Direction[1] + Inflictor_Direction[2] * Victim_Direction[2] >= 0)
|
||||||
{
|
{
|
||||||
Perform_Trace_Target = Entity;
|
Compute_Damage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Perform_Trace_Target = Entity;
|
Compute_Damage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,9 @@ struct Command_Structure
|
|||||||
|
|
||||||
float Angles[3];
|
float Angles[3];
|
||||||
|
|
||||||
float Move[3];
|
float Move[2];
|
||||||
|
|
||||||
|
__int32 Frame_Number;
|
||||||
|
|
||||||
__int32 Buttons;
|
__int32 Buttons;
|
||||||
|
|
||||||
@ -28,7 +30,7 @@ void* Original_Run_Command_Caller;
|
|||||||
|
|
||||||
void __thiscall Redirected_Run_Command(void* Prediction, void* Player, Command_Structure* Command, void* Unknown_Parameter)
|
void __thiscall Redirected_Run_Command(void* Prediction, void* Player, Command_Structure* Command, void* Unknown_Parameter)
|
||||||
{
|
{
|
||||||
Extended_Command_Structure* Extended_Command = &Extended_Commands[Command->Command_Number % 150];
|
Extended_Command_Structure* Extended_Command = &Extended_Commands[Command->Frame_Number];
|
||||||
|
|
||||||
*(__int32*)((unsigned __int32)Player + 5324) -= Extended_Command->Extra_Commands;
|
*(__int32*)((unsigned __int32)Player + 5324) -= Extended_Command->Extra_Commands;
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@ void* Original_Spawn_Grenade_Caller;
|
|||||||
|
|
||||||
void __thiscall Redirected_Spawn_Grenade(void* Entity)
|
void __thiscall Redirected_Spawn_Grenade(void* Entity)
|
||||||
{
|
{
|
||||||
*(__int32*)((unsigned __int32)Entity + 228) = 3;
|
|
||||||
|
|
||||||
using Set_Size_Type = void(__thiscall*)(void* Entity, float* Minimum, float* Maximum);
|
using Set_Size_Type = void(__thiscall*)(void* Entity, float* Minimum, float* Maximum);
|
||||||
|
|
||||||
float Minimum[3] =
|
float Minimum[3] =
|
||||||
|
@ -24,12 +24,12 @@ void __cdecl Redirected_Update_Animations()
|
|||||||
|
|
||||||
if ((*(__int8*)((unsigned __int32)Animation_List + 8 * Entity_Number + 4) & 1) != 0)
|
if ((*(__int8*)((unsigned __int32)Animation_List + 8 * Entity_Number + 4) & 1) != 0)
|
||||||
{
|
{
|
||||||
|
using Update_Animation_Type = void(__thiscall**)(void* Entity);
|
||||||
|
|
||||||
void* Entity = *(void**)((unsigned __int32)Animation_List + 8 * Entity_Number);
|
void* Entity = *(void**)((unsigned __int32)Animation_List + 8 * Entity_Number);
|
||||||
|
|
||||||
*(float*)((unsigned __int32)Entity + 328) = Update_Animation_Time - Global_Variables->Frame_Time;
|
*(float*)((unsigned __int32)Entity + 328) = Update_Animation_Time - Global_Variables->Frame_Time;
|
||||||
|
|
||||||
using Update_Animation_Type = void(__thiscall**)(void* Entity);
|
|
||||||
|
|
||||||
(*Update_Animation_Type(*(unsigned __int32*)Entity + 808))(Entity);
|
(*Update_Animation_Type(*(unsigned __int32*)Entity + 808))(Entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user