L L4D2node

CTerrorPlayer::UpdateZombieSounds

0x009f79f0 · 1539 bytes · __thiscall

_ZN13CTerrorPlayer18UpdateZombieSoundsEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::UpdateZombieSounds() */

void __thiscall CTerrorPlayer::UpdateZombieSounds(CTerrorPlayer *this)

{
  uint uVar1;
  CountdownTimer *this_00;
  uint uVar2;
  float fVar3;
  char cVar4;
  int iVar5;
  int *piVar6;
  undefined4 uVar7;
  undefined *puVar8;
  longdouble lVar9;
  longdouble lVar10;
  float fVar11;
  char *pcVar12;
  undefined4 uVar13;
  float local_24;
  
  iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  if (iVar5 != 3) {
    return;
  }
  cVar4 = (**(code **)(*(int *)this + 300))(this);
  if (cVar4 == '\0') {
    return;
  }
  cVar4 = (**(code **)(*(int *)this + 0x558))(this);
  if (cVar4 != '\0') {
    return;
  }
  iVar5 = *(int *)(this + 0x2e88);
  lVar9 = (longdouble)CountdownTimer::Now();
  if ((float)lVar9 < *(float *)(this + 0x30a0)) goto LAB_009f7a5f;
  this_00 = (CountdownTimer *)(this + 0x308c);
  lVar9 = (longdouble)CountdownTimer::Now();
  if ((float)lVar9 < *(float *)(this + 0x3094)) goto LAB_009f7a5f;
  uVar1 = iVar5 - 1;
  uVar7 = (**(code **)(*(int *)this + 0x544))(this);
  switch(uVar7) {
  default:
    if (uVar1 < 2) {
      Vocalize(this,"PlayerZombie.Rage",0.0,0.0);
    }
    else {
      pcVar12 = "PlayerZombie.Breathe";
LAB_009f7b4c:
      Vocalize(this,pcVar12,0.0,0.0);
    }
  case 3:
  case 5:
    uVar13 = 0x40c00000;
    uVar7 = 0x40800000;
LAB_009f7b63:
    lVar9 = (longdouble)RandomFloat(uVar7,uVar13);
    local_24 = (float)lVar9;
    break;
  case 1:
    uVar1 = *(uint *)(this + 0x33c0);
    if ((((uVar1 != 0xffffffff) &&
         (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
        (*(uint *)(puVar8 + 8) == uVar1 >> 0xc)) && (*(int *)(puVar8 + 4) != 0)) {
      lVar9 = (longdouble)RandomFloat(0x3f800000,0x40000000);
      Vocalize(this,"SmokerZombie.Attack",0.0,0.0);
      CountdownTimer::Start(this_00,(float)lVar9);
      goto LAB_009f7a5f;
    }
    lVar9 = (longdouble)RandomFloat(0x40800000,0x40c00000);
    local_24 = (float)lVar9;
    Vocalize(this,"SmokerZombie.Breathe",local_24,local_24);
    break;
  case 2:
    if (1 < uVar1) {
      lVar9 = (longdouble)RandomFloat(0x40000000,0x40400000);
      local_24 = (float)lVar9;
      Vocalize(this,"BoomerZombie.Groan",local_24,local_24);
      break;
    }
    Vocalize(this,"BoomerZombie.Voice",0.0,0.0);
    uVar13 = 0x40000000;
    uVar7 = 0x3f800000;
    goto LAB_009f7b63;
  case 4:
    if (iVar5 == 2) goto LAB_009f7a5f;
    lVar9 = (longdouble)RandomFloat(0x40400000,0x40a00000);
    local_24 = (float)lVar9;
    fVar11 = local_24;
    if (iVar5 != 0) {
      fVar11 = 0.0;
    }
    Vocalize(this,"SpitterZombie.Voice",local_24,fVar11);
    break;
  case 6:
    uVar1 = *(uint *)(this + 0x3e44);
    if (((uVar1 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar8 + 8) == uVar1 >> 0xc && (*(int *)(puVar8 + 4) != 0)))) goto LAB_009f7a5f;
    lVar9 = (longdouble)RandomFloat(0x40400000,0x40a00000);
    local_24 = (float)lVar9;
    fVar11 = local_24;
    if (iVar5 != 0) {
      fVar11 = 0.0;
    }
    Vocalize(this,"ChargerZombie.Voice",local_24,fVar11);
    break;
  case 8:
    cVar4 = (**(code **)(*(int *)this + 0x7e8))(this);
    if ((cVar4 != '\0') ||
       ((((uVar2 = *(uint *)(this + 0x30bc), uVar2 != 0xffffffff &&
          (puVar8 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar8 + 8) == uVar2 >> 0xc)) &&
        ((piVar6 = *(int **)(puVar8 + 4), piVar6 != (int *)0x0 &&
         (cVar4 = (**(code **)(*piVar6 + 0x354))(piVar6), cVar4 != '\0')))))) goto LAB_009f7a5f;
    if (((byte)this[0x153] & 8) != 0) {
      lVar9 = (longdouble)RandomFloat(0x40400000,0x40a00000);
      CountdownTimer::Start(this_00,(float)lVar9);
      fVar3 = *(float *)(this + 0x3094);
      lVar9 = (longdouble)CountdownTimer::Now();
      fVar11 = *(float *)(this + 0x3094);
      lVar10 = (longdouble)CountdownTimer::Now();
      Vocalize(this,"HulkZombie.PainFire",fVar11 - (float)lVar10,fVar3 - (float)lVar9);
      goto LAB_009f7a5f;
    }
    iVar5 = RandomInt(0,100);
    if (uVar1 < 2) {
      pcVar12 = "HulkZombie.Yell";
      goto LAB_009f7b4c;
    }
    if (0x18 < iVar5) {
      Vocalize(this,"HulkZombie.Breathe",0.0,0.0);
      uVar13 = 0x40000000;
      uVar7 = 0x3f800000;
      goto LAB_009f7b63;
    }
    lVar9 = (longdouble)RandomFloat(0x3f800000,0x40000000);
    local_24 = (float)lVar9;
    Vocalize(this,"HulkZombie.Growl",local_24,local_24);
  }
  CountdownTimer::Start(this_00,local_24);
LAB_009f7a5f:
  iVar5 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  if (((iVar5 != 3) || (iVar5 = (**(code **)(*(int *)this + 0x544))(this), iVar5 != 8)) &&
     ((lVar9 = (longdouble)CountdownTimer::Now(), *(float *)(this + 0x30a0) <= (float)lVar9 &&
      ((piVar6 = (int *)CCSPlayer::GetActiveCSWeapon((CCSPlayer *)this), piVar6 != (int *)0x0 &&
       (cVar4 = (**(code **)(*piVar6 + 0x610))(piVar6), cVar4 != '\0')))))) {
    iVar5 = (**(code **)(*(int *)this + 0x544))(this);
    if (iVar5 == 2) {
      Vocalize(this,"BoomerZombie.Attack",0.0,0.0);
    }
    else if (iVar5 == 3) {
      Vocalize(this,"PlayerZombie.Attack",0.0,0.0);
    }
    else if (iVar5 == 1) {
      Vocalize(this,"SmokerZombie.Attack",0.0,0.0);
    }
  }
  return;
}

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)