Archetype::Equipment struct update
Locked
FLHook Development
-
Well, I reversed some more of the Archetype::Equipment struct and thought I’d share. I also figured out how the ammo entries are stored.
struct Equipment { uint iVFTable; uint i2; uint iEquipID; char *szName; uint i5; uint iIDSName; uint iIDSInfo; float fMaxHP; float fMass; uint iDunno; float fExplosionResistance; uint iArray[12]; float fVolume; uint iArray2[6]; float fChildImpulse; float fParentImpulse; float fHullDamage; //Only for ammo entries uint iArray3[4]; float fMuzzleVelocity; uint iAmmoArchID; // 39 uint iArray4[67]; uint iGunTypeFlags; uint iDunno2; uint iGunType; uint iArray5[50]; // uint i[152]; };
So now you might be wondering how to get an ammo entry, since there doesn’t seem to be any function that returns it. The ammo entries are right before the gun entries in memory, so you’d do something like this.
Archetype::Equipment *gunEquip, *ammo; const char *szNick = "missile01_mark01"; uint iGunID; iGunID = CreateID(szNick); gunEquip = Archetype::GetEquipment(iGunID); ammo = (Archetype::Equipment*)(((char*)gunEquip) - 408); float fMissileDamage = ammo->fHullDamage; ```EDIT: Apparently you can get ammo entries just by feeding the iAmmoArchID into GetEquipment, so that pointer manipulation isn't necessary. All you need to do to get ammo is``` ammo = Archetype::GetEquipment(gunEquip->iAmmoArchID);