L L4D2node

CAI_Expresser::SpeakRawSentence

0x005d2c40 · 867 bytes · __cdecl

_ZN13CAI_Expresser16SpeakRawSentenceEPKcff12soundlevel_tP11CBaseEntity

Decompiled

undefined (5 params)

/* CAI_Expresser::SpeakRawSentence(char const*, float, float, soundlevel_t, CBaseEntity*) */

int CAI_Expresser::SpeakRawSentence
              (int param_1,char *param_2,float param_3,undefined4 param_4,int param_5)

{
  code *pcVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  undefined *puVar5;
  int *piVar6;
  int *piVar7;
  longdouble lVar8;
  float local_50;
  Vector local_48 [12];
  undefined **local_3c [11];
  
  piVar6 = (int *)&stack0xffffff74;
  if (param_2 == (char *)0x0) {
LAB_005d2fc7:
    iVar3 = -1;
  }
  else {
    if (*param_2 == '!') {
      iVar3 = SENTENCEG_Lookup(param_2);
      if (iVar3 == -1) goto LAB_005d2fc7;
      uVar2 = *(uint *)(param_1 + 0x40);
      piVar7 = (int *)0x0;
      if (((uVar2 != 0xffffffff) &&
          (puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar5 + 8) == uVar2 >> 0xc)) {
        piVar7 = *(int **)(puVar5 + 4);
      }
      (**(code **)(*piVar7 + 0x28c))();
      CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
      local_3c[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 005d2e27 to 005d2e2b has its CatchHandler @ 005d2fd1 */
      CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_3c,local_48);
      local_3c[0] = &PTR__CPASAttenuationFilter_00c08ec8;
      local_50 = 4.0;
      if (0x32 < param_5) {
        local_50 = 20.0 / (float)(param_5 + -0x32);
      }
                    /* try { // try from 005d2e56 to 005d2e7b has its CatchHandler @ 005d2ff1 */
      (**(code **)(*piVar7 + 0x28c))();
      piVar6 = (int *)&stack0xffffff6c;
      CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_3c,local_48,local_50);
                    /* try { // try from 005d2e99 to 005d2f43 has its CatchHandler @ 005d2fe6 */
      (**(code **)(*random_valve + 8))();
      CBaseEntity::EmitSentenceByIndex();
      local_3c[0] = &PTR__CPASFilter_00bfaf28;
      CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
    }
    else {
      (**(code **)(*random_valve + 8))();
      iVar3 = SENTENCEG_PlayRndSz();
    }
    iVar4 = *engine;
    *piVar6 = (int)engine;
    piVar6[1] = iVar3;
    pcVar1 = *(code **)(iVar4 + 0x90);
    piVar6[-1] = 0x5d2cfb;
    lVar8 = (longdouble)(*pcVar1)();
    uVar2 = *(uint *)(param_1 + 0x40);
    iVar4 = 0;
    if (((uVar2 != 0xffffffff) &&
        (puVar5 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar5 + 8) == uVar2 >> 0xc)) {
      iVar4 = *(int *)(puVar5 + 4);
    }
    *(double *)(piVar6 + 6) = (double)(float)lVar8;
    *(double *)(piVar6 + 4) = (double)param_3;
    piVar6[1] = iVar4;
    piVar6[2] = (int)"SpeakRawSentence( %s, %f) %f\n";
    piVar6[3] = (int)param_2;
    *piVar6 = param_1;
    piVar6[-1] = 0x5d2d68;
    SpeechMsg((CAI_Expresser *)*piVar6,(CBaseEntity *)piVar6[1],(char *)piVar6[2]);
    iVar4 = *engine;
    *piVar6 = (int)engine;
    piVar6[1] = iVar3;
    pcVar1 = *(code **)(iVar4 + 0x90);
    piVar6[-1] = 0x5d2d7c;
    lVar8 = (longdouble)(*pcVar1)();
    *piVar6 = param_1;
    piVar6[2] = (int)param_3;
    piVar6[1] = (int)(float)lVar8;
    piVar6[-1] = 0x5d2d9d;
    NoteSpeaking((CAI_Expresser *)*piVar6,(float)piVar6[1],(float)piVar6[2]);
  }
  return iVar3;
}

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)