mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-04-20 13:35:43 +00:00
Add more structs, and more script functions.
This commit is contained in:
parent
70e2f8bdb6
commit
b861f5cc56
@ -39,6 +39,19 @@ namespace game
|
|||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Scr_AddInt(game::scriptInstance_t inst, int value)
|
||||||
|
{
|
||||||
|
static const auto call_addr = SELECT(0x0, 0x69A610);
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push value;
|
||||||
|
mov eax, inst;
|
||||||
|
call call_addr;
|
||||||
|
add esp, 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
float Scr_GetFloat(game::scriptInstance_t inst, unsigned int arg_index)
|
float Scr_GetFloat(game::scriptInstance_t inst, unsigned int arg_index)
|
||||||
{
|
{
|
||||||
static const auto call_addr = SELECT(0x0, 0x699E90);
|
static const auto call_addr = SELECT(0x0, 0x699E90);
|
||||||
@ -49,12 +62,25 @@ namespace game
|
|||||||
mov ecx, arg_index;
|
mov ecx, arg_index;
|
||||||
mov eax, inst;
|
mov eax, inst;
|
||||||
call call_addr;
|
call call_addr;
|
||||||
mov answer, eax;
|
movss answer, xmm0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Scr_AddFloat(game::scriptInstance_t inst, float value)
|
||||||
|
{
|
||||||
|
static const auto call_addr = SELECT(0x0, 0x69A670);
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push value;
|
||||||
|
mov eax, inst;
|
||||||
|
call call_addr;
|
||||||
|
add esp, 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char* Scr_GetString(game::scriptInstance_t inst, unsigned int arg_index)
|
char* Scr_GetString(game::scriptInstance_t inst, unsigned int arg_index)
|
||||||
{
|
{
|
||||||
static const auto call_addr = SELECT(0x0, 0x699F30);
|
static const auto call_addr = SELECT(0x0, 0x699F30);
|
||||||
@ -62,8 +88,8 @@ namespace game
|
|||||||
|
|
||||||
__asm
|
__asm
|
||||||
{
|
{
|
||||||
mov ecx, arg_index;
|
mov esi, inst;
|
||||||
mov eax, inst;
|
mov eax, arg_index;
|
||||||
call call_addr;
|
call call_addr;
|
||||||
mov answer, eax;
|
mov answer, eax;
|
||||||
}
|
}
|
||||||
@ -71,6 +97,114 @@ namespace game
|
|||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Scr_AddString(game::scriptInstance_t inst, const char* string)
|
||||||
|
{
|
||||||
|
static const auto call_addr = SELECT(0x0, 0x69A7E0);
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push string;
|
||||||
|
mov eax, inst;
|
||||||
|
call call_addr;
|
||||||
|
add esp, 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* Scr_GetIString(game::scriptInstance_t inst, unsigned int arg_index)
|
||||||
|
{
|
||||||
|
static const auto call_addr = SELECT(0x0, 0x69A1A0); //Scr_GetConstIString
|
||||||
|
|
||||||
|
unsigned short id;
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov eax, arg_index;
|
||||||
|
call call_addr;
|
||||||
|
mov id, eax;
|
||||||
|
}
|
||||||
|
|
||||||
|
return SL_ConvertToString(inst, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scr_AddIString(game::scriptInstance_t inst, const char* string)
|
||||||
|
{
|
||||||
|
static const auto call_addr = SELECT(0x0, 0x69A860);
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov esi, string;
|
||||||
|
call call_addr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned short Scr_GetConstString(game::scriptInstance_t inst, unsigned int arg_index)
|
||||||
|
{
|
||||||
|
static const auto call_addr = SELECT(0x0, 0x699F30);
|
||||||
|
|
||||||
|
unsigned short answer;
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push arg_index;
|
||||||
|
mov eax, inst;
|
||||||
|
call call_addr;
|
||||||
|
mov answer, eax;
|
||||||
|
add esp, 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
return answer;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scr_AddConstString(game::scriptInstance_t inst, unsigned short id)
|
||||||
|
{
|
||||||
|
static const auto call_addr = SELECT(0x0, 0x69A8D0);
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov esi, id;
|
||||||
|
mov eax, inst;
|
||||||
|
call call_addr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scr_GetVector(game::scriptInstance_t inst, unsigned int arg_index, float* value)
|
||||||
|
{
|
||||||
|
static const auto call_addr = SELECT(0x0, 0x69A220);
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push arg_index;
|
||||||
|
mov ecx, value;
|
||||||
|
mov eax, inst;
|
||||||
|
call call_addr;
|
||||||
|
add esp, 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scr_AddVector(game::scriptInstance_t inst, float* value)
|
||||||
|
{
|
||||||
|
static const auto call_addr = SELECT(0x0, 0x69A940);
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
push value;
|
||||||
|
mov eax, inst;
|
||||||
|
call call_addr;
|
||||||
|
add esp, 4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Scr_AddUndefined(game::scriptInstance_t inst)
|
||||||
|
{
|
||||||
|
static const auto call_addr = SELECT(0x0, 0x69A720);
|
||||||
|
|
||||||
|
__asm
|
||||||
|
{
|
||||||
|
mov eax, inst;
|
||||||
|
call call_addr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gentity_s* Scr_GetEntity(unsigned int arg_index)
|
gentity_s* Scr_GetEntity(unsigned int arg_index)
|
||||||
{
|
{
|
||||||
static const auto call_addr = SELECT(0x0, 0x546E30);
|
static const auto call_addr = SELECT(0x0, 0x546E30);
|
||||||
@ -98,6 +232,12 @@ namespace game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int Scr_GetEntityId@<eax>(int entNum@<eax>, scriptInstance_t inst, classNum_e classnum, unsigned __int16 clientnum)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//Only supports getting the first argument as a path node
|
||||||
pathnode_t* Scr_GetPathnode(scriptInstance_t inst)
|
pathnode_t* Scr_GetPathnode(scriptInstance_t inst)
|
||||||
{
|
{
|
||||||
static const auto call_addr = SELECT(0x0, 0x559E20);
|
static const auto call_addr = SELECT(0x0, 0x559E20);
|
||||||
@ -113,6 +253,13 @@ namespace game
|
|||||||
return answer;
|
return answer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Scr_AddPathnode(scriptInstance_t inst, pathnode_t* node)
|
||||||
|
{
|
||||||
|
int entnum = node - (*gameWorldCurrent)->path.nodes;
|
||||||
|
int entid = Scr_GetEntityId(entnum >> 7, SCRIPTINSTANCE_SERVER, CLASS_NUM_PATHNODE, 0);
|
||||||
|
Scr_AddEntityNum(SCRIPTINSTANCE_SERVER, entid);
|
||||||
|
}
|
||||||
|
|
||||||
void Scr_MakeArray(scriptInstance_t inst)
|
void Scr_MakeArray(scriptInstance_t inst)
|
||||||
{
|
{
|
||||||
static const auto call_addr = SELECT(0x0, 0x69A9D0);
|
static const auto call_addr = SELECT(0x0, 0x69A9D0);
|
||||||
|
@ -28,6 +28,28 @@ namespace game
|
|||||||
dvar_s* Dvar_RegisterInt(const char* name, int value, int min, int max, DvarFlags flags, const char* desc);
|
dvar_s* Dvar_RegisterInt(const char* name, int value, int min, int max, DvarFlags flags, const char* desc);
|
||||||
dvar_s* Dvar_RegisterString(const char* name, const char* value, DvarFlags flags, const char* desc);
|
dvar_s* Dvar_RegisterString(const char* name, const char* value, DvarFlags flags, const char* desc);
|
||||||
|
|
||||||
|
int Scr_GetInt(game::scriptInstance_t inst, unsigned int arg_index);
|
||||||
|
void Scr_AddInt(game::scriptInstance_t inst, int value);
|
||||||
|
float Scr_GetFloat(game::scriptInstance_t inst, unsigned int arg_index);
|
||||||
|
void Scr_AddFloat(game::scriptInstance_t inst, float value);
|
||||||
|
char* Scr_GetString(game::scriptInstance_t inst, unsigned int arg_index);
|
||||||
|
void Scr_AddString(game::scriptInstance_t inst, const char* string);
|
||||||
|
const char* Scr_GetIString(game::scriptInstance_t inst, unsigned int arg_index);
|
||||||
|
void Scr_AddIString(game::scriptInstance_t inst, const char* string);
|
||||||
|
unsigned short Scr_GetConstString(game::scriptInstance_t inst, unsigned int arg_index);
|
||||||
|
void Scr_AddConstString(game::scriptInstance_t inst, unsigned short id);
|
||||||
|
void Scr_GetVector(game::scriptInstance_t inst, unsigned int arg_index, float* value);
|
||||||
|
void Scr_AddVector(game::scriptInstance_t inst, float* value);
|
||||||
|
void Scr_AddUndefined(game::scriptInstance_t inst);
|
||||||
|
gentity_s* Scr_GetEntity(unsigned int arg_index);
|
||||||
|
void Scr_AddEntity(game::scriptInstance_t inst, gentity_s* ent);
|
||||||
|
int Scr_GetEntityId(int entNum, scriptInstance_t inst, classNum_e classnum, unsigned __int16 clientnum);
|
||||||
|
pathnode_t* Scr_GetPathnode(scriptInstance_t inst);
|
||||||
|
void Scr_AddPathnode(scriptInstance_t inst, pathnode_t* node);
|
||||||
|
void Scr_MakeArray(scriptInstance_t inst);
|
||||||
|
void Scr_AddArrayStringIndexed(scriptInstance_t inst, unsigned short id);
|
||||||
|
const char* SL_ConvertToString(scriptInstance_t inst, unsigned short id);
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class symbol
|
class symbol
|
||||||
{
|
{
|
||||||
|
@ -1502,4 +1502,51 @@ namespace game
|
|||||||
unsigned __int8 negotiationLink;
|
unsigned __int8 negotiationLink;
|
||||||
unsigned __int8 ubBadPlaceCount[4];
|
unsigned __int8 ubBadPlaceCount[4];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct pathbasenode_t
|
||||||
|
{
|
||||||
|
float vOrigin[3];
|
||||||
|
unsigned int type;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct pathnode_tree_nodes_t
|
||||||
|
{
|
||||||
|
int nodeCount;
|
||||||
|
unsigned __int16* nodes;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
union __declspec(align(4)) pathnode_tree_info_t
|
||||||
|
{
|
||||||
|
pathnode_tree_t* child[2];
|
||||||
|
pathnode_tree_nodes_t s[8];
|
||||||
|
};
|
||||||
|
|
||||||
|
struct pathnode_tree_t
|
||||||
|
{
|
||||||
|
int axis;
|
||||||
|
float dist;
|
||||||
|
pathnode_tree_info_t u;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct PathData
|
||||||
|
{
|
||||||
|
unsigned int nodeCount;
|
||||||
|
pathnode_t* nodes;
|
||||||
|
pathbasenode_t* basenodes;
|
||||||
|
unsigned int chainNodeCount;
|
||||||
|
unsigned __int16* chainNodeForNode;
|
||||||
|
unsigned __int16* nodeForChainNode;
|
||||||
|
int visBytes;
|
||||||
|
unsigned __int8* pathVis;
|
||||||
|
int nodeTreeCount;
|
||||||
|
pathnode_tree_t* nodeTree;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct __declspec(align(4)) GameWorldSp
|
||||||
|
{
|
||||||
|
const char* name;
|
||||||
|
PathData path;
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
@ -17,6 +17,8 @@ namespace game
|
|||||||
WEAK symbol<cmd_function_s*> cmd_functions{ 0x0, 0x1F416F4 };
|
WEAK symbol<cmd_function_s*> cmd_functions{ 0x0, 0x1F416F4 };
|
||||||
WEAK symbol<CmdArgs> cmd_args{ 0x0, 0x1F41670 };
|
WEAK symbol<CmdArgs> cmd_args{ 0x0, 0x1F41670 };
|
||||||
|
|
||||||
|
WEAK symbol<GameWorldSp*> gameWorldCurrent{0x0, 0x8E1D80 };
|
||||||
|
|
||||||
namespace plutonium
|
namespace plutonium
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user