Witch::Event_Killed
0x00a49060 · 1095 bytes · __thiscall
_ZN5Witch12Event_KilledERK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* Witch::Event_Killed(CTakeDamageInfo const&) */
void __thiscall Witch::Event_Killed(Witch *this,CTakeDamageInfo *param_1)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
Witch WVar7;
uint uVar8;
int iVar9;
code *pcVar10;
int iVar11;
int *piVar12;
undefined4 uVar13;
int iVar14;
undefined *puVar15;
CBaseEntity *this_00;
bool bVar16;
undefined4 *puVar17;
int in_GS_OFFSET;
bool bVar18;
byte bVar19;
Witch *local_130;
undefined4 local_12c;
CAI_Concept local_128 [8];
char local_120 [4];
undefined4 local_11c [63];
int local_20;
bVar19 = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
Infected::Event_Killed((Infected *)this,param_1);
local_130 = this;
local_12c = 7;
ForEachPlayer<ZombieDeath>((ZombieDeath *)&local_130);
uVar8 = *(uint *)(param_1 + 0x34);
if ((((uVar8 == 0xffffffff) ||
(puVar15 = g_pEntityList + (uVar8 & 0xfff) * 0x10, puVar15 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar15 + 8) != uVar8 >> 0xc)) || (*(int *)(puVar15 + 4) == 0)) {
this_00 = (CBaseEntity *)0x0;
LAB_00a490d7:
iVar14 = -1;
}
else {
this_00 = (CBaseEntity *)
__dynamic_cast(*(int *)(puVar15 + 4),&CBaseEntity::typeinfo,&CTerrorPlayer::typeinfo,0
);
if (this_00 == (CBaseEntity *)0x0) goto LAB_00a490d7;
iVar14 = (**(code **)(*engine + 0x40))(engine,*(undefined4 *)(this_00 + 0x30));
}
piVar12 = gameeventmanager;
iVar9 = *(int *)(this + 0x1dc0);
if (iVar9 < 1) {
LAB_00a49110:
bVar16 = false;
}
else {
if (iVar14 != **(int **)(this + 0x1db4)) {
iVar11 = 0;
do {
iVar11 = iVar11 + 1;
if (iVar11 == iVar9) goto LAB_00a49110;
} while (iVar14 != (*(int **)(this + 0x1db4))[iVar11]);
if (iVar11 < 0) goto LAB_00a49110;
}
bVar16 = false;
if (iVar9 == 1) {
bVar16 = *(float *)(gpGlobals + 0xc) <= *(float *)(this + 0x1db0) + 0.1 &&
*(float *)(this + 0x1db0) + 0.1 != *(float *)(gpGlobals + 0xc);
}
}
bVar18 = false;
if ((*(uint *)(this + 0x1dc8) != 0) && (this_00 != (CBaseEntity *)0x0)) {
bVar18 = (*(uint *)(this + 0x1dc8) & 0x3f9ffffb) == 0;
}
*(undefined4 *)(this + 0x1dc8) = 0;
piVar12 = (int *)(**(code **)(*piVar12 + 0x1c))(piVar12,"witch_killed",0,0);
if (piVar12 != (int *)0x0) {
(**(code **)(*piVar12 + 0x30))(piVar12,"userid",iVar14);
if (*(int *)(this + 0x30) == 0) {
iVar14 = 0;
}
else {
iVar14 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
(**(code **)(*piVar12 + 0x30))(piVar12,"witchid",iVar14);
(**(code **)(*piVar12 + 0x2c))(piVar12,"oneshot",bVar16);
(**(code **)(*piVar12 + 0x2c))(piVar12,"melee_only",bVar18);
pcVar10 = *(code **)(*piVar12 + 0x2c);
iVar14 = CBaseEntity::GetGender((CBaseEntity *)this);
(*pcVar10)(piVar12,"bride",iVar14 == 0x13);
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar12,0);
}
if (this_00 != (CBaseEntity *)0x0) {
WVar7 = this[0x14d];
local_120[0] = '\0';
local_120[1] = '\0';
local_120[2] = '\0';
local_120[3] = '\0';
puVar17 = local_11c;
for (iVar14 = 0x3f; iVar14 != 0; iVar14 = iVar14 + -1) {
*puVar17 = 0;
puVar17 = puVar17 + (uint)bVar19 * -2 + 1;
}
if (((byte)WVar7 & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
fVar1 = *(float *)(this_00 + 0x2e0);
puVar15 = &DAT_00cbe2d5;
fVar2 = *(float *)(this_00 + 0x2e4);
fVar3 = *(float *)(this + 0x2e0);
if (bVar16 == false) {
puVar15 = &DAT_00c09604;
}
fVar4 = *(float *)(this + 0x2e4);
fVar5 = *(float *)(this_00 + 0x2e8);
fVar6 = *(float *)(this + 0x2e8);
uVar13 = (**(code **)(*(int *)this + 0x544))(this);
uVar13 = ZombieClassName(uVar13);
V_snprintf(local_120,0x100,"SubjectIsA:%s,Distance:%f,OneShot:%s",uVar13,
(double)SQRT((fVar2 - fVar4) * (fVar2 - fVar4) + (fVar1 - fVar3) * (fVar1 - fVar3) +
(fVar5 - fVar6) * (fVar5 - fVar6)),puVar15);
pcVar10 = *(code **)(*(int *)this_00 + 0x7b4);
CAI_Concept::CAI_Concept(local_128,"KilledZombie");
(*pcVar10)(this_00,local_128,1,local_120,0,0,0);
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.