| 19 |
|
uint16_t ONICALL bsl_getkills(void* dontuse0, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret) |
| 20 |
|
{ |
| 21 |
|
|
| 22 |
< |
//void* GS = (short int**)(ONgGameState); |
| 22 |
> |
int index; |
| 23 |
> |
if (numargs == 0) index = 0; |
| 24 |
> |
else index = args[0].value_int32; |
| 25 |
> |
int* killcount = ONgGameState + index * 0x16A0 + 0x1260 + 0x1670; |
| 26 |
> |
ret->value_int32 = *killcount; |
| 27 |
> |
ret->type = sl_int32; |
| 28 |
> |
return 0; |
| 29 |
|
|
| 30 |
< |
//if (numargs < 2) |
| 25 |
< |
// return 1; |
| 26 |
< |
|
| 27 |
< |
//fix the AC struct :( |
| 28 |
< |
//ret->value_int32 = ((ActiveCharacter *)(ONgGameState+0xB6268))->NumberOfKills; |
| 29 |
< |
//short int index =; |
| 30 |
< |
//char temp_bitset[2]; |
| 31 |
< |
int index2; |
| 32 |
< |
if (numargs == 0) index2 = 0; |
| 33 |
< |
else index2 = args[0].value_int32; |
| 34 |
< |
char* active_index = ONgGameState + index2 * 0x16A0 + 0x1260 + 2; |
| 35 |
< |
//index = *(*()+ 0x1260 +2); |
| 36 |
< |
//ret->value_int32 = *((signed int*)(ONgGameState)) +0xB6268+(*(((signed int*)(ONgGameState)) + 0xAC)+2)*0x2838+0x1670; |
| 37 |
< |
//ret->value_int32 = *(int*)(ONgGameState +0xB6268 + index2 * 0x2838 + 0x1670); |
| 38 |
< |
|
| 39 |
< |
//TODO: Clean up this mess... |
| 40 |
< |
// ret->value_int32 = *active_index; |
| 41 |
< |
|
| 42 |
< |
ret->value_int32 = ((uint32_t*)(ONgGameState +0xB6268+(int)(*active_index)*0x2838+0x1670)); |
| 30 |
> |
} |
| 31 |
|
|
| 32 |
+ |
uint16_t ONICALL bsl_getdamage(void* dontuse0, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret) |
| 33 |
+ |
{ |
| 34 |
+ |
|
| 35 |
+ |
int index; |
| 36 |
+ |
if (numargs == 0) index = 0; |
| 37 |
+ |
else index = args[0].value_int32; |
| 38 |
+ |
int* killcount = ONgGameState + index * 0x16A0 + 0x1260 + 0x1674; |
| 39 |
+ |
ret->value_int32 = *killcount; |
| 40 |
|
ret->type = sl_int32; |
| 41 |
|
return 0; |
| 46 |
– |
} |
| 42 |
|
|
| 43 |
+ |
} |
| 44 |
|
|
| 45 |
|
uint16_t ONICALL bsl_mul(void* dontuse0, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret) |
| 46 |
|
{ |
| 101 |
|
if (numargs < 2) |
| 102 |
|
return 1; |
| 103 |
|
|
| 108 |
– |
|
| 109 |
– |
<<<<<<< .mine |
| 104 |
|
char output[255]; |
| 105 |
|
char temp[255]; |
| 106 |
|
int i = 1; |
| 159 |
|
|
| 160 |
|
SLrScript_Command_Register_ReturnType("sprintf", "sprintf", "str1:format str2:value [str3:...]", sl_str32, bsl_sprintf); |
| 161 |
|
|
| 162 |
< |
SLrScript_Command_Register_ReturnType("getkills","Gets the number of kills", "[n1:int]", sl_int32, bsl_getkills); |
| 163 |
< |
|
| 162 |
> |
SLrScript_Command_Register_ReturnType("chr_getkills","Gets the number of kills a character has", "[chrindex:int]", sl_int32, bsl_getkills); |
| 163 |
> |
SLrScript_Command_Register_ReturnType("chr_getdamage","Gets the amount of damage a character has caused", "[chrindex:int]", sl_int32, bsl_getdamage); |
| 164 |
|
|
| 165 |
|
dsfmt_gv_init_gen_rand((uint32_t)time(NULL)); |
| 166 |
|
SLrScript_Command_Register_ReturnType("int32rand", "Returns a pseudo-random number between two numbers (inclusive).", "start:int end:int", sl_int32, bsl_int32rand); |
| 167 |
< |
>>>>>>> .r440 |
| 167 |
> |
|
| 168 |
|
} |