L L4D2node

HunterLungeAtVictim::OnStart

0x00aa0690 · 1571 bytes · __thiscall

_ZN19HunterLungeAtVictim7OnStartEP6HunterP6ActionIS0_E

Decompiled

undefined (3 params)

/* HunterLungeAtVictim::OnStart(Hunter*, Action<Hunter>*) */

HunterLungeAtVictim * __thiscall
HunterLungeAtVictim::OnStart(HunterLungeAtVictim *this,Hunter *param_1,Action *param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float fVar5;
  code *pcVar6;
  char cVar7;
  int iVar8;
  uint uVar9;
  int *piVar10;
  undefined *puVar11;
  CBaseEntity *pCVar12;
  CBaseEntity *pCVar13;
  longdouble lVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  double dVar18;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  uVar9 = *(uint *)(param_1 + 0x34);
  if ((((uVar9 != 0xffffffff) &&
       (puVar11 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
      (*(uint *)(puVar11 + 8) == uVar9 >> 0xc)) && (*(int *)(puVar11 + 4) != 0)) {
    iVar8 = GetDifficulty();
    if (iVar8 == 1) {
      lVar14 = (longdouble)RandomFloat(0x3dcccccd);
      fVar16 = (float)lVar14;
      lVar14 = (longdouble)CountdownTimer::Now();
      if ((float)lVar14 + fVar16 != *(float *)(param_1 + 0x50)) {
        (**(code **)(*(int *)(param_1 + 0x48) + 4))(param_1 + 0x48);
        *(float *)(param_1 + 0x50) = (float)lVar14 + fVar16;
      }
      if (fVar16 != *(float *)(param_1 + 0x4c)) {
        (**(code **)(*(int *)(param_1 + 0x48) + 4))(param_1 + 0x48);
        *(float *)(param_1 + 0x4c) = fVar16;
      }
    }
    else if (iVar8 < 2) {
      if (iVar8 == 0) {
        lVar14 = (longdouble)RandomFloat(0x3e4ccccd);
        fVar16 = (float)lVar14;
        lVar14 = (longdouble)CountdownTimer::Now();
        if ((float)lVar14 + fVar16 != *(float *)(param_1 + 0x50)) {
          (**(code **)(*(int *)(param_1 + 0x48) + 4))(param_1 + 0x48);
          *(float *)(param_1 + 0x50) = (float)lVar14 + fVar16;
        }
        if (fVar16 != *(float *)(param_1 + 0x4c)) {
          (**(code **)(*(int *)(param_1 + 0x48) + 4))(param_1 + 0x48);
          *(float *)(param_1 + 0x4c) = fVar16;
        }
      }
    }
    else if (iVar8 < 4) {
      lVar14 = (longdouble)CountdownTimer::Now();
      if ((float)lVar14 + 0.1 != *(float *)(param_1 + 0x50)) {
        (**(code **)(*(int *)(param_1 + 0x48) + 4))(param_1 + 0x48);
        *(float *)(param_1 + 0x50) = (float)lVar14 + 0.1;
      }
      if (*(float *)(param_1 + 0x4c) != 0.1) {
        (**(code **)(*(int *)(param_1 + 0x48) + 4))(param_1 + 0x48);
        *(undefined4 *)(param_1 + 0x4c) = 0x3dcccccd;
      }
    }
    uVar9 = *(uint *)(param_1 + 0x34);
    pCVar12 = (CBaseEntity *)0x0;
    if (((uVar9 != 0xffffffff) &&
        (puVar11 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar11 + 8) == uVar9 >> 0xc)) {
      pCVar12 = *(CBaseEntity **)(puVar11 + 4);
    }
    if (((byte)pCVar12[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar12);
    }
    if (((byte)param_2[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
    }
    pCVar13 = (CBaseEntity *)0x0;
    fVar15 = SQRT((*(float *)(param_2 + 0x2e4) - *(float *)(pCVar12 + 0x2e4)) *
                  (*(float *)(param_2 + 0x2e4) - *(float *)(pCVar12 + 0x2e4)) +
                  (*(float *)(param_2 + 0x2e0) - *(float *)(pCVar12 + 0x2e0)) *
                  (*(float *)(param_2 + 0x2e0) - *(float *)(pCVar12 + 0x2e0)) +
                  (*(float *)(param_2 + 0x2e8) - *(float *)(pCVar12 + 0x2e8)) *
                  (*(float *)(param_2 + 0x2e8) - *(float *)(pCVar12 + 0x2e8)));
    fVar16 = *(float *)(HunterPounceLoftRate._28_4_ + 0x2c) * fVar15;
    fVar17 = fVar15 * 0.002;
    if (*(float *)(HunterPounceMaxLoftAngle._28_4_ + 0x2c) <= fVar16) {
      fVar16 = *(float *)(HunterPounceMaxLoftAngle._28_4_ + 0x2c);
    }
    uVar9 = *(uint *)(param_1 + 0x34);
    if (uVar9 != 0xffffffff) {
      puVar11 = g_pEntityList + (uVar9 & 0xfff) * 0x10;
      if ((puVar11 != (undefined *)0xfffffffc) && (*(uint *)(puVar11 + 8) == uVar9 >> 0xc)) {
        pCVar13 = *(CBaseEntity **)(puVar11 + 4);
      }
    }
    if (((byte)pCVar13[0x14d] & 0x10) != 0) {
      CBaseEntity::CalcAbsoluteVelocity(pCVar13);
      uVar9 = *(uint *)(param_1 + 0x34);
    }
    fVar1 = *(float *)(pCVar13 + 0x274);
    fVar2 = *(float *)(pCVar13 + 0x278);
    fVar3 = *(float *)(pCVar13 + 0x27c);
    pCVar12 = (CBaseEntity *)0x0;
    if (((uVar9 != 0xffffffff) &&
        (puVar11 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar11 + 8) == uVar9 >> 0xc)) {
      pCVar12 = *(CBaseEntity **)(puVar11 + 4);
    }
    if (((byte)pCVar12[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar12);
    }
    fVar4 = *(float *)(pCVar12 + 0x2e8);
    fVar5 = *(float *)(pCVar12 + 0x2e0);
    pCVar13 = (CBaseEntity *)0x0;
    *(float *)(param_1 + 0x3c) = fVar2 * fVar17 + *(float *)(pCVar12 + 0x2e4);
    *(float *)(param_1 + 0x40) = fVar17 * fVar3 + fVar4;
    *(float *)(param_1 + 0x38) = fVar1 * fVar17 + fVar5;
    piVar10 = (int *)(**(code **)(*(int *)param_2 + 0x9b4))(param_2);
    pcVar6 = *(code **)(*piVar10 + 0xc0);
    dVar18 = tan((double)(fVar16 * 0.017453292));
    uVar9 = *(uint *)(param_1 + 0x34);
    if (((uVar9 != 0xffffffff) &&
        (puVar11 = g_pEntityList + (uVar9 & 0xfff) * 0x10, puVar11 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar11 + 8) == uVar9 >> 0xc)) {
      pCVar13 = *(CBaseEntity **)(puVar11 + 4);
    }
    if (((byte)pCVar13[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(pCVar13);
    }
    local_28 = fVar1 * fVar17 + *(float *)(pCVar13 + 0x2e0);
    local_24 = fVar2 * fVar17 + *(float *)(pCVar13 + 0x2e4);
    local_20 = (float)(dVar18 * (double)fVar15) + *(float *)(pCVar13 + 0x2e8);
    (*pcVar6)(piVar10,(Vector *)&local_28,3,0x3f800000,0,"Pounce loft angle",1,0x3e800000);
    cVar7 = INextBot::IsDebugging((INextBot *)(param_2 + 0x4028),1);
    if (cVar7 != '\0') {
      local_28 = 0.0;
      local_24 = 1.0;
      local_20 = 0.0;
      local_34 = 0x3f800000;
      local_30 = 0;
      local_2c = 0;
      NDebugOverlay::Circle
                ((Vector *)(param_1 + 0x38),(Vector *)&local_34,(Vector *)&local_28,5.0,0xff,100,0,
                 0xff,true,10.0);
    }
    param_1[0x45] = (Hunter)0x1;
    param_1[0x44] = (Hunter)0x0;
    *(undefined4 *)this = 0;
    *(undefined4 *)(this + 4) = 0;
    *(undefined4 *)(this + 8) = 0;
    return this;
  }
  *(undefined4 *)this = 3;
  *(undefined4 *)(this + 4) = 0;
  *(char **)(this + 8) = "No victim";
  return this;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)