ZombieBotBody::OnInjured
0x00a4c140 · 1506 bytes · __thiscall
_ZN13ZombieBotBody9OnInjuredERK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* ZombieBotBody::OnInjured(CTakeDamageInfo const&) */
void __thiscall ZombieBotBody::OnInjured(ZombieBotBody *this,CTakeDamageInfo *param_1)
{
float fVar1;
uint uVar2;
code *pcVar3;
CBaseEntity *this_00;
int *piVar4;
char cVar5;
CBaseAnimating *this_01;
int *piVar6;
int iVar7;
undefined4 uVar8;
undefined *puVar9;
int *piVar10;
longdouble lVar11;
undefined4 local_20;
if ((*(uint *)(param_1 + 0x48) & 8) == 0) {
if ((*(uint *)(param_1 + 0x48) & 2) != 0) {
CBaseEntity::EmitSound
(*(CBaseEntity **)(this + 0x14),"Zombie.BulletImpact",&g_InfectedBulletImpact,0.0,
(float *)0x0);
cVar5 = *(char *)(*(int *)(this + 0x14) + 0x104);
goto joined_r0x00a4c1d1;
}
}
else {
this_01 = *(CBaseAnimating **)(this + 0x14);
if (((byte)this_01[0x153] & 8) == 0) {
local_20 = 0;
uVar2 = *(uint *)(param_1 + 0x34);
if (((uVar2 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar9 + 8) == uVar2 >> 0xc)) {
local_20 = *(undefined4 *)(puVar9 + 4);
}
(**(code **)(*(int *)this_01 + 0x564))(this_01,0x461c3c00,local_20);
cVar5 = UTIL_IsLowViolence();
if (cVar5 == '\0') {
CBaseEntity::EmitSound
(*(CBaseEntity **)(this + 0x14),"Zombie.IgniteScream",&g_InfectedIgniteScream,0.0,
(float *)0x0);
}
this_01 = *(CBaseAnimating **)(this + 0x14);
}
CBaseAnimating::Scorch(this_01,5,0x4b);
}
cVar5 = *(char *)(*(int *)(this + 0x14) + 0x104);
joined_r0x00a4c1d1:
if (cVar5 == '\0') {
lVar11 = (longdouble)CountdownTimer::Now();
if ((*(float *)(this + 0x88) <= (float)lVar11) && (((byte)param_1[0x48] & 8) == 0)) {
fVar1 = *(float *)(ZombieVocalizeShotInterval._28_4_ + 0x2c);
lVar11 = (longdouble)CountdownTimer::Now();
if ((float)lVar11 + fVar1 != *(float *)(this + 0x88)) {
(**(code **)(*(int *)(this + 0x80) + 4))(this + 0x80,this + 0x88);
*(float *)(this + 0x88) = (float)lVar11 + fVar1;
}
if (fVar1 != *(float *)(this + 0x84)) {
(**(code **)(*(int *)(this + 0x80) + 4))(this + 0x80,this + 0x84);
*(float *)(this + 0x84) = fVar1;
}
CBaseEntity::EmitSound
(*(CBaseEntity **)(this + 0x14),"Zombie.Shot",&g_ZombieShot,0.0,(float *)0x0);
}
uVar2 = *(uint *)(param_1 + 0x34);
if (((uVar2 != 0xffffffff) &&
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 != (undefined *)0xfffffffc)) &&
((*(uint *)(puVar9 + 8) == uVar2 >> 0xc &&
((this_00 = *(CBaseEntity **)(puVar9 + 4), this_00 != (CBaseEntity *)0x0 &&
(cVar5 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar5 != '\0')))))) {
iVar7 = CBaseEntity::GetTeamNumber(this_00);
cVar5 = IsASurvivorTeam(iVar7);
if (cVar5 != '\0') {
*(float *)(this_00 + 0x3abc) = *(float *)(this_00 + 0x3abc) + *(float *)(param_1 + 0x3c);
}
}
piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"infected_hurt",0,&g_InfectedHurtEvent);
if (piVar6 != (int *)0x0) {
uVar2 = *(uint *)(param_1 + 0x34);
if ((((uVar2 == 0xffffffff) ||
(puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar9 + 8) != uVar2 >> 0xc)) ||
((piVar4 = *(int **)(puVar9 + 4), piVar4 == (int *)0x0 ||
(cVar5 = (**(code **)(*piVar4 + 0x16c))(piVar4), cVar5 == '\0')))) {
(**(code **)(*piVar6 + 0x30))(piVar6,"attacker",0);
}
else {
cVar5 = (**(code **)(*piVar4 + 0x16c))(piVar4);
piVar10 = (int *)0x0;
if (cVar5 != '\0') {
piVar10 = piVar4;
}
pcVar3 = *(code **)(*piVar6 + 0x30);
uVar8 = (**(code **)(*engine + 0x40))(engine,piVar10[0xc]);
(*pcVar3)(piVar6,"attacker",uVar8);
}
if (((byte)param_1[0x48] & 0x48) == 0) {
(**(code **)(*piVar6 + 0x30))
(piVar6,"hitgroup",*(undefined4 *)(*(int *)(this + 0x14) + 0x1838));
}
else {
(**(code **)(*piVar6 + 0x30))(piVar6,"hitgroup",0);
}
if (*(int *)(*(int *)(this + 0x14) + 0x30) == 0) {
iVar7 = 0;
}
else {
iVar7 = *(int *)(*(int *)(this + 0x14) + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
(**(code **)(*piVar6 + 0x30))(piVar6,"entityid",iVar7);
(**(code **)(*piVar6 + 0x30))(piVar6,"amount",(int)*(float *)(param_1 + 0x3c));
(**(code **)(*piVar6 + 0x30))(piVar6,"type",*(undefined4 *)(param_1 + 0x48));
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
}
if ((((byte)param_1[0x48] & 8) != 0) &&
(piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))
(gameeventmanager,"zombie_ignited",0,0), piVar6 != (int *)0x0)) {
uVar2 = *(uint *)(param_1 + 0x34);
if ((uVar2 == 0xffffffff) ||
((((puVar9 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar9 == (undefined *)0xfffffffc ||
(*(uint *)(puVar9 + 8) != uVar2 >> 0xc)) ||
(piVar4 = *(int **)(puVar9 + 4), piVar4 == (int *)0x0)) ||
(cVar5 = (**(code **)(*piVar4 + 0x16c))(piVar4), cVar5 == '\0')))) {
(**(code **)(*piVar6 + 0x30))(piVar6,"userid",0);
}
else {
cVar5 = (**(code **)(*piVar4 + 0x16c))(piVar4);
piVar10 = (int *)0x0;
if (cVar5 != '\0') {
piVar10 = piVar4;
}
pcVar3 = *(code **)(*piVar6 + 0x30);
uVar8 = (**(code **)(*engine + 0x40))(engine,piVar10[0xc]);
(*pcVar3)(piVar6,"userid",uVar8);
}
pcVar3 = *(code **)(*piVar6 + 0x30);
uVar8 = CBaseEntity::GetGender(*(CBaseEntity **)(this + 0x14));
(*pcVar3)(piVar6,"gender",uVar8);
if (*(int *)(*(int *)(this + 0x14) + 0x30) == 0) {
iVar7 = 0;
}
else {
iVar7 = *(int *)(*(int *)(this + 0x14) + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
(**(code **)(*piVar6 + 0x30))(piVar6,"entityid",iVar7);
(**(code **)(*piVar6 + 0x3c))(piVar6,"victimname","Infected");
(**(code **)(*piVar6 + 0x2c))(piVar6,"fire_ammo",*(uint *)(param_1 + 0x48) >> 1 & 1);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
return;
}
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.