CHulkSlayerAwardTemplate::FireGameEvent
0x00857130 · 766 bytes · __thiscall
_ZN24CHulkSlayerAwardTemplate13FireGameEventEP10IGameEvent
Decompiled
undefined (2 params)
/* CHulkSlayerAwardTemplate::FireGameEvent(IGameEvent*) */
void __thiscall
CHulkSlayerAwardTemplate::FireGameEvent(CHulkSlayerAwardTemplate *this,IGameEvent *param_1)
{
char *pcVar1;
CBaseEntity *pCVar2;
int iVar3;
CBaseEntity *pCVar4;
CBaseEntity *pCVar5;
int iVar6;
pcVar1 = (char *)(**(code **)(*(int *)param_1 + 8))(param_1);
if (((pcVar1 != (char *)0x0) &&
(pCVar2 = (CBaseEntity *)CAwardTemplate::GetOwner((CAwardTemplate *)this),
pCVar2 != (CBaseEntity *)0x0)) && (iVar3 = CBaseEntity::GetTeamNumber(pCVar2), iVar3 == 2)) {
if ((pcVar1 != "player_hurt") && (iVar3 = _V_stricmp(pcVar1,"player_hurt"), iVar3 != 0)) {
if ((pcVar1 != "player_incapacitated") &&
(iVar3 = _V_stricmp(pcVar1,"player_incapacitated"), iVar3 != 0)) {
if ((pcVar1 != "player_spawn") && (iVar3 = _V_stricmp(pcVar1,"player_spawn"), iVar3 != 0)) {
return;
}
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar2 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
if (pCVar2 == (CBaseEntity *)0x0) {
return;
}
if ((*(int *)(pCVar2 + 0x30) != 0) &&
(0x1ff < *(int *)(pCVar2 + 0x30) - *(int *)(gpGlobals + 0x58))) {
return;
}
iVar3 = CBaseEntity::GetTeamNumber(pCVar2);
if (iVar3 != 3) {
return;
}
iVar3 = (**(code **)(*(int *)pCVar2 + 0x544))(pCVar2);
if (iVar3 != 8) {
return;
}
if (*(int *)(pCVar2 + 0x30) == 0) {
iVar3 = 0;
}
else {
iVar3 = *(int *)(pCVar2 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
}
*(undefined4 *)(this + iVar3 * 4 + 0x10) = 0;
return;
}
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
if (pCVar2 != pCVar5) {
return;
}
if (pCVar4 == (CBaseEntity *)0x0) {
return;
}
iVar3 = CBaseEntity::GetTeamNumber(pCVar4);
if (iVar3 != 3) {
return;
}
iVar3 = (**(code **)(*(int *)pCVar4 + 0x544))(pCVar4);
if (iVar3 != 8) {
return;
}
iVar3 = (**(code **)(*(int *)pCVar4 + 0x1fc))(pCVar4);
if (*(int *)(pCVar4 + 0x30) == 0) {
iVar6 = 0;
}
else {
iVar6 = *(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
if (0x1f < iVar6) {
return;
}
}
if ((float)*(int *)(this + iVar6 * 4 + 0x10) / (float)iVar3 < 0.8) {
return;
}
(**(code **)(*(int *)this + 0x14))(this,0x11,0);
return;
}
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"userid",0);
pCVar4 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"attacker",0);
pCVar5 = (CBaseEntity *)UTIL_PlayerByUserId(iVar3);
if ((((pCVar2 == pCVar5) && (pCVar4 != (CBaseEntity *)0x0)) &&
(iVar3 = CBaseEntity::GetTeamNumber(pCVar4), iVar3 == 3)) &&
((iVar3 = (**(code **)(*(int *)pCVar4 + 0x544))(pCVar4), iVar3 == 8 &&
(iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"type",0), iVar3 != 0x20000)))) {
iVar3 = (**(code **)(*(int *)param_1 + 0x1c))(param_1,"dmg_health",0);
if (*(int *)(pCVar4 + 0x30) == 0) {
iVar6 = 0;
}
else {
iVar6 = *(int *)(pCVar4 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
if (0x1f < iVar6) {
return;
}
}
*(int *)(this + iVar6 * 4 + 0x10) = *(int *)(this + iVar6 * 4 + 0x10) + iVar3;
}
}
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.