L L4D2node

CTerrorPlayer::EmitInfectedPainSound

0x009a1850 · 723 bytes · __thiscall

_ZN13CTerrorPlayer21EmitInfectedPainSoundERK15CTakeDamageInfo

Decompiled

undefined (2 params)

/* CTerrorPlayer::EmitInfectedPainSound(CTakeDamageInfo const&) */

void __thiscall CTerrorPlayer::EmitInfectedPainSound(CTerrorPlayer *this,CTakeDamageInfo *param_1)

{
  char cVar1;
  longdouble lVar2;
  
  lVar2 = (longdouble)CountdownTimer::Now();
  if (*(float *)(this + 0x30ac) <= (float)lVar2) {
    lVar2 = (longdouble)CountdownTimer::Now();
    if ((float)lVar2 + 0.7 != *(float *)(this + 0x30ac)) {
      (**(code **)(*(int *)(this + 0x30a4) + 4))(this + 0x30a4,this + 0x30ac);
      *(float *)(this + 0x30ac) = (float)lVar2 + 0.7;
    }
    if (*(float *)(this + 0x30a8) != 0.7) {
      (**(code **)(*(int *)(this + 0x30a4) + 4))(this + 0x30a4,this + 0x30a8);
      *(undefined4 *)(this + 0x30a8) = 0x3f333333;
    }
    switch(*(undefined4 *)(this + 0x2ba4)) {
    case 1:
      if (((byte)param_1[0x48] & 0x82) == 0) {
        Vocalize(this,"SmokerZombie.Pain",0.0,0.0);
      }
      else {
        Vocalize(this,"SmokerZombie.PainShort",0.0,0.0);
      }
      break;
    case 2:
      if (((byte)param_1[0x48] & 0x82) == 0) {
        Vocalize(this,"BoomerZombie.Pain",0.0,0.0);
      }
      else {
        Vocalize(this,"BoomerZombie.PainShort",0.0,0.0);
      }
      break;
    case 3:
      if (((byte)param_1[0x48] & 0x82) == 0) {
        Vocalize(this,"HunterZombie.Pain",0.0,0.0);
      }
      else {
        Vocalize(this,"HunterZombie.PainShort",0.0,0.0);
      }
      break;
    case 4:
      if (((byte)param_1[0x48] & 0x82) == 0) {
        Vocalize(this,"SpitterZombie.Pain",0.0,0.0);
      }
      else {
        Vocalize(this,"SpitterZombie.PainShort",0.0,0.0);
      }
      break;
    case 5:
      if (((byte)param_1[0x48] & 0x82) == 0) {
        Vocalize(this,"JockeyZombie.Pain",0.0,0.0);
      }
      else {
        Vocalize(this,"JockeyZombie.PainShort",0.0,0.0);
      }
      break;
    case 6:
      Vocalize(this,"ChargerZombie.Pain",0.0,0.0);
      break;
    case 8:
      cVar1 = (**(code **)(*(int *)this + 0x7e8))(this);
      if (cVar1 == '\0') {
        Vocalize(this,"HulkZombie.Pain",0.7,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)