L L4D2node

CTerrorPlayer::OnZombieStateAlert

0x009a2010 · 604 bytes · __thiscall

_ZN13CTerrorPlayer18OnZombieStateAlertEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::OnZombieStateAlert() */

void __thiscall CTerrorPlayer::OnZombieStateAlert(CTerrorPlayer *this)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  longdouble lVar4;
  
  if (*(int *)(ZombieStateDebug._28_4_ + 0x30) != 0) {
    uVar3 = (**(code **)(*(int *)this + 0xb8))(this);
    DevMsg("STATE: Player %s going Alert.\n",uVar3);
  }
  (**(code **)(*(int *)this + 0x81c))(this);
  iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
  if ((iVar2 == 3) && (iVar2 = (**(code **)(*(int *)this + 0x544))(this), iVar2 == 8)) {
    cVar1 = (**(code **)(*(int *)this + 0x7e8))(this);
    if ((cVar1 == '\0') && (((byte)this[0x153] & 8) == 0)) {
      lVar4 = (longdouble)RandomFloat(0x40400000,0x40a00000);
      Vocalize(this,"HulkZombie.Yell",(float)lVar4,0.0);
      return;
    }
  }
  else {
    iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
    if ((iVar2 == 3) && (iVar2 = (**(code **)(*(int *)this + 0x544))(this), iVar2 == 1)) {
      lVar4 = (longdouble)RandomFloat(0x40400000,0x40a00000);
      Vocalize(this,"SmokerZombie.Recognize",(float)lVar4,0.0);
      return;
    }
    iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
    if ((iVar2 == 3) && (iVar2 = (**(code **)(*(int *)this + 0x544))(this), iVar2 == 6)) {
      lVar4 = (longdouble)RandomFloat(0x40400000,0x40a00000);
      Vocalize(this,"ChargerZombie.Recognize",(float)lVar4,0.0);
      return;
    }
    iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
    if ((iVar2 == 3) && (iVar2 = (**(code **)(*(int *)this + 0x544))(this), iVar2 == 4)) {
      lVar4 = (longdouble)RandomFloat(0x40400000,0x40a00000);
      Vocalize(this,"SpitterZombie.Recognize",(float)lVar4,0.0);
    }
    else {
      iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
      if ((iVar2 == 3) && (iVar2 = (**(code **)(*(int *)this + 0x544))(this), iVar2 == 2)) {
        lVar4 = (longdouble)RandomFloat(0x40400000,0x40a00000);
        Vocalize(this,"BoomerZombie.Rage",(float)lVar4,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)