Changeset 484 for Daodan/src/Daodan_BSL.c
- Timestamp:
- Dec 11, 2009, 9:58:07 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/Daodan_BSL.c
r481 r484 7 7 8 8 #include "Daodan_BSL.h" 9 #include "Flatline_BSL.h" 9 10 #include "Daodan_Utility.h" 10 11 #include "Daodan_Patch.h" … … 17 18 #include "Daodan_Character.h" 18 19 20 21 19 22 uint16_t ONICALL bsl_int32mul(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) 20 23 { … … 50 53 return 0; 51 54 } 52 53 55 uint16_t ONICALL bsl_div(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) 54 56 { … … 218 220 else index = args[0].value_int32; 219 221 Character* Chr = ONgGameState + 0x1260 ; 220 int* health = (int)&Chr[index] + 0x144; 221 222 int* health = (int*)Chr[index].ScriptNoPath; 223 224 /* 225 DDrConsole_PrintF("Character %s", Chr[index].Name); 226 DDrConsole_PrintF("Spawn %s", Chr[index].ScriptSpawn); 227 DDrConsole_PrintF("Death %s", Chr[index].ScriptDie); 228 DDrConsole_PrintF("Aware %s", Chr[index].ScriptAware); 229 DDrConsole_PrintF("Alarm %s", Chr[index].ScriptAlarm); 230 DDrConsole_PrintF("Hurt %s", Chr[index].ScriptHurt); 231 DDrConsole_PrintF("Defeat %s", Chr[index].ScriptDefeat); 232 DDrConsole_PrintF("NoAmmo %s", Chr[index].ScriptNoAmmo); 233 DDrConsole_PrintF("NoPath %s", Chr[index].ScriptNoPath); 234 */ 222 235 ret->value_int32 = *health; 223 236 ret->type = sl_int32; … … 743 756 { 744 757 745 //const char regen_patch[] = {0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; 746 //DDrPatch_Const(OniExe + 0x0011BB6D, regen_patch); 747 748 //This one should work but doesn't. 749 //const char regen_patch[] ={0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x8B, 0x86, 0x44}; 750 //DDrPatch_Const(OniExe + 0x0011BB64, regen_patch); 758 759 //Calculating the value of the needed offset is much more reliable when the compiler does it for you. 760 761 //TODO: fix moonshadow. 762 Character * Chr = 0; 763 char NoPath = (char)(0x100 - (int)(Chr->ScriptNoPath)); 764 const char regen_patch[] = 765 {0x90, 0x90, 0x90, 0x90, 0x90, // mov al, _WPgRegenerationCheat 766 0x90, 0x90, // test al, al 767 0x90, 0x90, // jz short loc_51BB98 768 0x8B, 0x86, NoPath}; 769 DDrPatch_Const(OniExe + 0x0011BB64, regen_patch); 751 770 752 771 SLrConfig(); … … 783 802 SLrScript_Command_Register_ReturnType("sprintf", "C-style sprintf.", "format:string arg1 arg2 ...", sl_str32, bsl_sprintf); 784 803 785 SLrScript_Command_Register_ReturnType("d_dprint", "prints to console in color", "text:string [color: r b g] [color: r b g]", sl_void, bsl_dprintcolored); 786 787 //SLrScript_Command_Register_ReturnType("d_offset", "a test", "thing:int", sl_int32, bsl_returnoffset); 804 SLrScript_Command_Register_ReturnType("st", "prints to console in color", "text:string [color: r b g] [color: r b g]", sl_void, bsl_dprintcolored); 805 806 //Flatline 807 SLrFlatline_Initialize(); 808 788 809 } 789 810
Note:
See TracChangeset
for help on using the changeset viewer.