L L4D2node

Witch::Spawn

0x00a48bb0 · 435 bytes · __thiscall

_ZN5Witch5SpawnEv

Decompiled

undefined (1 param)

/* Witch::Spawn() */

void __thiscall Witch::Spawn(Witch *this)

{
  undefined4 uVar1;
  int *piVar2;
  int iVar3;
  
  if (((byte)this[0x1c75] & 0x10) == 0) {
    (**(code **)(*(int *)this + 0x70))(this,*WitchModels);
  }
  else {
    (**(code **)(*(int *)this + 0x70))(this,"models/infected/witch_bride.mdl");
  }
  Infected::Spawn((Infected *)this);
  iVar3 = (int)*(float *)(ZombieWitchHealth._28_4_ + 0x2c);
  if (iVar3 != *(int *)(this + 0x100)) {
    (**(code **)(*(int *)this + 0x214))(this,this + 0x100);
    uVar1 = ZombieWitchHealth._28_4_;
    *(int *)(this + 0x100) = iVar3;
    iVar3 = (int)*(float *)(uVar1 + 0x2c);
  }
  if (*(int *)(this + 0xfc) != iVar3) {
    (**(code **)(*(int *)this + 0x20c))(this,this + 0xfc);
    *(int *)(this + 0xfc) = iVar3;
  }
  CBaseEntity::RemoveFlag((CBaseEntity *)this,0x10000);
  if (TheDirector != (Infected *)0x0) {
    CDirector::OnWitchAdded(TheDirector);
  }
  piVar2 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"witch_spawn",0,0);
  if (piVar2 != (int *)0x0) {
    if (*(int *)(this + 0x30) == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    (**(code **)(*piVar2 + 0x30))(piVar2,"witchid",iVar3);
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar2,0);
  }
  ACT_TERROR_WITCH_COVER_EYES_BEGIN =
       ActivityList_RegisterPrivateActivity("ACT_TERROR_WITCH_COVER_EYES_BEGIN");
  ACT_TERROR_WITCH_COVER_EYES_LOOP =
       ActivityList_RegisterPrivateActivity("ACT_TERROR_WITCH_COVER_EYES_LOOP");
  ACT_TERROR_WITCH_COVER_EYES_END =
       ActivityList_RegisterPrivateActivity("ACT_TERROR_WITCH_COVER_EYES_END");
  ACT_TERROR_WITCH_COVER_EARS_BEGIN =
       ActivityList_RegisterPrivateActivity("ACT_TERROR_WITCH_COVER_EARS_BEGIN");
  ACT_TERROR_WITCH_COVER_EARS_LOOP =
       ActivityList_RegisterPrivateActivity("ACT_TERROR_WITCH_COVER_EARS_LOOP");
  ACT_TERROR_WITCH_COVER_EARS_END =
       ActivityList_RegisterPrivateActivity("ACT_TERROR_WITCH_COVER_EARS_END");
  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)