WitchAttack::OnStart
0x00a3c610 · 775 bytes · __thiscall
_ZN11WitchAttack7OnStartEP8InfectedP6ActionIS0_E
Decompiled
undefined (3 params)
/* WitchAttack::OnStart(Infected*, Action<Infected>*) */
WitchAttack * __thiscall WitchAttack::OnStart(WitchAttack *this,Infected *param_1,Action *param_2)
{
uint uVar1;
char cVar2;
CTerrorPlayer *this_00;
int iVar3;
int *piVar4;
undefined4 uVar5;
char *pcVar6;
undefined *puVar7;
CTerrorPlayer *pCVar8;
longdouble lVar9;
CAI_Concept local_4c [8];
undefined4 local_44;
undefined4 local_40;
AI_CriteriaSet local_3c [44];
uVar1 = *(uint *)(param_2 + 0x1da8);
if ((((uVar1 == 0xffffffff) ||
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
(*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) ||
(pCVar8 = *(CTerrorPlayer **)(puVar7 + 4), pCVar8 == (CTerrorPlayer *)0x0)) {
this_00 = (CTerrorPlayer *)GetVictim((WitchAttack *)param_1);
if (((this_00 == (CTerrorPlayer *)0x0) ||
(cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), cVar2 == '\0')) ||
((iVar3 = CTerrorPlayer::GetOtherResponsibleForMovement(this_00), pCVar8 = this_00,
iVar3 != 0 &&
((this_00 = (CTerrorPlayer *)CTerrorPlayer::GetOtherResponsibleForMovement(this_00),
this_00 == (CTerrorPlayer *)0x0 ||
(cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00), pCVar8 = this_00, cVar2 == '\0'))
)))) {
pCVar8 = (CTerrorPlayer *)0x0;
}
Witch::SetHarasser((Witch *)param_2,(CBaseEntity *)this_00);
}
else {
cVar2 = (**(code **)(*(int *)pCVar8 + 0x16c))(pCVar8);
if (cVar2 == '\0') {
pCVar8 = (CTerrorPlayer *)0x0;
}
}
piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x594))(param_2);
(**(code **)(*piVar4 + 0x10c))(piVar4,2);
(**(code **)(*piVar4 + 0xec))(piVar4,0);
CBaseEntity::EmitSound((CBaseEntity *)param_2,"WitchZombie.Scream",0.0,(float *)0x0);
lVar9 = (longdouble)CountdownTimer::Now();
if ((float)lVar9 + 1.0 != *(float *)(param_1 + 0x4854)) {
(**(code **)(*(int *)(param_1 + 0x484c) + 4))(param_1 + 0x484c,param_1 + 0x4854);
*(float *)(param_1 + 0x4854) = (float)lVar9 + 1.0;
}
if (*(float *)(param_1 + 0x4850) != 1.0) {
(**(code **)(*(int *)(param_1 + 0x484c) + 4))(param_1 + 0x484c,param_1 + 0x4850);
*(undefined4 *)(param_1 + 0x4850) = 0x3f800000;
}
lVar9 = (longdouble)IntervalTimer::Now();
if ((float)lVar9 != *(float *)(param_1 + 0x485c)) {
(**(code **)(*(int *)(param_1 + 0x4858) + 4))(param_1 + 0x4858,param_1 + 0x485c);
*(float *)(param_1 + 0x485c) = (float)lVar9;
}
uVar5 = CBaseFlex::FindFlexController((CBaseFlex *)param_2,"bite");
CBaseFlex::SetFlexWeight((CBaseFlex *)param_2,uVar5,0x3f800000);
AI_CriteriaSet::AI_CriteriaSet(local_3c);
if (pCVar8 != (CTerrorPlayer *)0x0) {
/* try { // try from 00a3c815 to 00a3c8d4 has its CatchHandler @ 00a3c924 */
pcVar6 = (char *)SurvivorCharacterName(*(int *)(pCVar8 + 0x2ba0));
AI_CriteriaSet::AppendCriteria(local_3c,"witch_aggro_on",pcVar6,1.0);
}
local_44 = 0;
local_40 = 0xffffffff;
CAI_Concept::CAI_Concept(local_4c,"WitchStartAttack");
CResponseQueue::Add((CResponseQueue *)g_ResponseQueueManager._12_4_,local_4c,local_3c,0.0,
(CFollowupTargetSpec_t *)&local_44,(CBaseEntity *)param_2);
if (((byte)param_2[0x1c75] & 0x10) != 0) {
CDirector::OnMapInvokedPanicEvent(TheDirector,0,2);
}
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
AI_CriteriaSet::~AI_CriteriaSet(local_3c);
return this;
}
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.