diff --git a/Mod Sources/TSExtension/TSExtension.suo b/Mod Sources/TSExtension/TSExtension.suo index 20ab5cb..5b52ddb 100644 Binary files a/Mod Sources/TSExtension/TSExtension.suo and b/Mod Sources/TSExtension/TSExtension.suo differ diff --git a/Mod Sources/TSExtension/TSExtension/include/DXAPI/ShapeBase.h b/Mod Sources/TSExtension/TSExtension/include/DXAPI/ShapeBase.h index 107d457..ed9d2b4 100644 --- a/Mod Sources/TSExtension/TSExtension/include/DXAPI/ShapeBase.h +++ b/Mod Sources/TSExtension/TSExtension/include/DXAPI/ShapeBase.h @@ -8,8 +8,10 @@ namespace DX { public: ShapeBase(unsigned int obj); - + float &cloak_level; + bool &cloaked; //! Heat Level float &heat_level; + void setMaskBits(int value); }; } // End NameSpace DX \ No newline at end of file diff --git a/Mod Sources/TSExtension/TSExtension/include/DXConCmds.h b/Mod Sources/TSExtension/TSExtension/include/DXConCmds.h index 33ce4c8..a951e9c 100644 --- a/Mod Sources/TSExtension/TSExtension/include/DXConCmds.h +++ b/Mod Sources/TSExtension/TSExtension/include/DXConCmds.h @@ -14,6 +14,7 @@ #include void serverProcessReplacement(unsigned int timeDelta) ; +bool conShapeBaseSetCloakValue(Linker::SimObject *obj, S32 argc, const char* argv[]); const char* congetServPAddr(Linker::SimObject *obj, S32 argc, const char *argv[]); // Returns the address of an object in memory const char* conGetAddress(Linker::SimObject *obj, S32 argc, const char *argv[]); diff --git a/Mod Sources/TSExtension/TSExtension/source/DXAPI/ShapeBase.cpp b/Mod Sources/TSExtension/TSExtension/source/DXAPI/ShapeBase.cpp index 6b17d7e..05bfc33 100644 --- a/Mod Sources/TSExtension/TSExtension/source/DXAPI/ShapeBase.cpp +++ b/Mod Sources/TSExtension/TSExtension/source/DXAPI/ShapeBase.cpp @@ -1,9 +1,21 @@ #include - +#define CloakMask 0x40 namespace DX { ShapeBase::ShapeBase(unsigned int obj) : GameBase(obj), - heat_level(*(float*)(obj + 1972)) + heat_level(*(float*)(obj + 1972)), cloak_level(*(float*)(obj+0x810)), cloaked(*(bool*)(obj+0x80D)) { } + void ShapeBase::setMaskBits(int value){ + unsigned int addr=this->base_pointer_value; + unsigned int bits=value; + unsigned int funcaddr=0x585BE0; + __asm { + mov eax,bits + push eax + mov ecx,addr + mov eax,funcaddr + call eax + }; + } } \ No newline at end of file diff --git a/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp b/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp index 06fb5a7..18e29f1 100644 --- a/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp +++ b/Mod Sources/TSExtension/TSExtension/source/DXConCmds.cpp @@ -42,7 +42,18 @@ const char *conGetAddress(Linker::SimObject *obj, S32 argc, const char *argv[]) sprintf(result, "%x", obj); return result; } +bool conShapeBaseSetCloakValue(Linker::SimObject *obj, S32 argc, const char* argv[]) +{ + DX::ShapeBase operand = DX::ShapeBase((unsigned int)obj); + operand.cloaked=dAtob(argv[2]); + if (operand.cloaked==true) { + operand.cloak_level=atof(argv[3]); + } else { + operand.cloak_level=atof(argv[3]); + } + operand.setMaskBits(0x40); +} bool conPlayerGetJumpingState(Linker::SimObject *obj, S32 argc, const char* argv[]) { DX::Player operand = DX::Player((unsigned int)obj); diff --git a/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp b/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp index 1348061..45a4b51 100644 --- a/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp +++ b/Mod Sources/TSExtension/TSExtension/source/dllmain.cpp @@ -34,7 +34,7 @@ extern "C" Con::addMethodB("Player", "isjumping", &conPlayerGetJumpingState,"Returns whether or not the player is jumping", 2, 2); Con::addMethodB("Player", "isjetting", &conPlayerGetJettingState,"Returns whether or not the player is jetting", 2, 2); Con::addMethodB("GameConnection", "setheat", &conGameConnectionSetHeatLevel,"Sets the heat level", 3, 3); - + Con::addMethodB("ShapeBase","setcloakvalue",&conShapeBaseSetCloakValue,"Sets the cloak value ex: setcloakvalue(1,0.5)",3,4); Con::addMethodB("GrenadeProjectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5); Con::addMethodB("GameBase","setProcessTicks",&conSetProcessTicks,"Sets the flag for processing ticks or not", 3, 3); Con::addMethodB("Projectile", "explode", &conProjectileExplode,"Explodes the given projectile", 5, 5);