CHolidayGift::Create
0x008d15b0 · 807 bytes · __cdecl
_ZN12CHolidayGift6CreateERK6VectorRK6QAngleS5_S2_P20CBaseCombatCharacter
Decompiled
undefined (5 params)
/* CHolidayGift::Create(Vector const&, QAngle const&, QAngle const&, Vector const&,
CBaseCombatCharacter*) */
CBaseEntity *
CHolidayGift::Create
(Vector *param_1,QAngle *param_2,QAngle *param_3,Vector *param_4,
CBaseCombatCharacter *param_5)
{
CBaseEdict *this;
CBaseEntity *this_00;
int iVar1;
uint uVar2;
longdouble lVar3;
float fVar4;
float local_4c;
float local_48;
float local_44;
float local_40;
float local_3c;
float local_38;
float local_34;
float local_30;
float local_2c;
float local_28;
float local_24;
float local_20;
this_00 = (CBaseEntity *)
CBaseEntity::Create("holiday_gift",param_1,param_2,(CBaseEntity *)param_5);
if (this_00 != (CBaseEntity *)0x0) {
uVar2 = *(uint *)(this_00 + 0x148) | 0x40000000;
if (*(uint *)(this_00 + 0x148) != uVar2) {
if (this_00[0x6c] == (CBaseEntity)0x0) {
this = *(CBaseEdict **)(this_00 + 0x30);
if (this != (CBaseEdict *)0x0) {
*(uint *)this = *(uint *)this | 0x101;
iVar1 = CBaseEdict::GetChangeAccessor(this);
*(undefined2 *)(iVar1 + 2) = 0;
}
}
else {
this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
}
*(uint *)(this_00 + 0x148) = uVar2;
}
AngleVectors(param_3,(Vector *)0x0,(Vector *)&local_4c,(Vector *)&local_40);
local_34 = 0.0;
local_30 = 0.0;
local_2c = 0.0;
lVar3 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0,0x3e800000);
fVar4 = (float)lVar3;
local_30 = local_3c * fVar4 + local_30;
local_2c = local_38 * fVar4 + local_2c;
local_34 = fVar4 * local_40 + local_34;
lVar3 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0xbe800000,0x3e800000);
fVar4 = (float)lVar3;
local_30 = local_48 * fVar4 + local_30;
local_2c = local_44 * fVar4 + local_2c;
local_34 = fVar4 * local_4c + local_34;
VectorNormalize((Vector *)&local_34);
lVar3 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0x42c80000,0x43160000);
fVar4 = (float)lVar3;
local_30 = local_30 * fVar4 + *(float *)(param_4 + 4);
local_2c = local_2c * fVar4 + *(float *)(param_4 + 8);
local_34 = fVar4 * local_34 + *(float *)param_4;
fVar4 = SQRT(local_30 * local_30 + local_34 * local_34 + local_2c * local_2c);
if (300.0 < fVar4) {
fVar4 = 300.0 / fVar4;
local_34 = local_34 * fVar4;
local_30 = local_30 * fVar4;
local_2c = local_2c * fVar4;
}
CBaseEntity::SetMoveType(this_00,5,0);
local_24 = local_30 + local_30;
local_28 = local_34 + local_34;
local_20 = local_2c + local_2c + 200.0;
CBaseEntity::SetAbsVelocity(this_00,(Vector *)&local_28);
local_28 = 0.0;
local_24 = 0.0;
local_20 = 0.0;
CBaseEntity::SetAbsAngles(this_00,(QAngle *)&local_28);
CBaseAnimating::UseClientSideAnimation((CBaseAnimating *)this_00);
iVar1 = CBaseAnimating::LookupSequence((CBaseAnimating *)this_00,"idle");
CBaseAnimating::ResetSequence((CBaseAnimating *)this_00,iVar1);
CBaseEntity::EmitSound(this_00,"Christmas.GiftDrop",0.0,(float *)0x0);
CGlowProperty::SetGlowColorOverride((CGlowProperty *)(this_00 + 0x1f0),0xff00c000);
CGlowProperty::SetGlowState((CGlowProperty *)(this_00 + 0x1f0),3);
CItem::ActivateWhenAtRest((CItem *)this_00);
}
return this_00;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.