Index: Daodan/src/Daodan_BSL.c
===================================================================
--- Daodan/src/Daodan_BSL.c	(revision 468)
+++ Daodan/src/Daodan_BSL.c	(revision 470)
@@ -117,4 +117,16 @@
 	return 0;
 }
+
+uint16_t ONICALL bsl_returnoffset(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret)
+{
+	//int offset = 140;
+	//if (== 1) offset = 148;
+	//else index = args[0].value_int32;
+	int* killcount = ONgGameState + args[0].value_int32;
+	ret->value_int32 = *killcount;
+	ret->type = sl_int32;
+	return 0;
+}
+
 
 uint16_t ONICALL bsl_powerup(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret)
@@ -199,4 +211,25 @@
 }
 
+uint16_t ONICALL bsl_regen(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret)
+{
+	int index;
+	if (numargs == 0) index = 0;
+	else if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].value_str32);
+	else index = args[0].value_int32;
+	Character* Chr = ONgGameState + 0x1260 ;
+	int* health = (int*)&Chr[index] + 0x144;
+
+	ret->value_int32 = *health;
+	ret->type = sl_int32;
+
+	if (numargs >= 2) {
+		*health = args[1].value_int32;
+	}
+	ret->value_int32 = *health;
+	ret->type = sl_int32;
+	return 0;
+}
+
+
 uint16_t ONICALL bsl_maxhealth(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret)
 {
@@ -222,5 +255,6 @@
 uint16_t ONICALL bsl_getattacker(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret)
 {
-	//broken...not only does it sometimes blam, but it returns a string when i want an int so i can study it :<
+	//broken
+	
 	int index;
 	if (numargs == 0) index = 0;
@@ -309,4 +343,166 @@
 	return 0;
 }
+typedef struct {
+char Name[16];
+int Bit;
+} KeyBit;
+
+KeyBit Actions1[32] = {
+	{"Escape", Action_Escape},
+	{"Console", Action_Console},
+	{"PauseScreen", Action_PauseScreen},
+	{"Cutscene1", Action_Cutscene_1                },
+	{"Cutscene2", Action_Cutscene_2                },
+	{"F4", Action_F4                      },
+	{"F5", Action_F5                        },
+	{"F6", Action_F6                       },
+	{"F7", Action_F7                        },
+	{"F8", Action_F8                        },
+	{"StartRecorn", Action_StartRecord        },       
+	{"StopRecord", Action_StopRecord            },    
+	{"PlayRecord", Action_PlayRecord              },  
+	{"F12", Action_F12                       },
+	{"Unknown1", Action_Unknown1               },  
+	{"LookMode", Action_LookMode           },
+	{"Screenshot", Action_Screenshot         },     
+	{"Unknown2", Action_Unknown2              },
+	{"Unknown3", Action_Unknown3              },   
+	{"Unknown4", Action_Unknown4                },
+	{"Unknown5", Action_Unknown5                },
+	{"Forward", Action_Forward                 },
+	{"Backward", Action_Backward                },
+	{"TurnLeft", Action_TurnLeft                },
+	{"TurnRight", Action_TurnRight               },
+	{"StepLeft", Action_StepLeft                },
+	{"StepRight", Action_StepRight               },
+	{"Jump", Action_Jump                    },
+	{"Crouch", Action_Crouch                  },
+	{"Punch",Action_Punch                   },
+	{"Kick", Action_Kick                    },
+	{"Block", Action_Block                   }
+};
+
+KeyBit Actions2[9] = {
+	{"Walk", Action2_Walk},
+	{"Action", Action2_Action},
+	{"Hypo", Action2_Hypo},
+	{"Reload", Action2_Reload                },
+	{"Swap", Action2_Swap                },
+	{"Drop", Action2_Drop                     },
+	{"Fire1", Action2_Fire1                       },
+	{"Fire2", Action2_Fire2                       },
+	{"Fire3", Action2_Fire3                       }
+};
+uint16_t ONICALL bsl_holdkey(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret)
+	{
+		int index;
+		if (numargs < 4) index = 0;
+		else	if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].value_str32);
+		else index = args[0].value_int32;
+
+		Character* Chr = ONgGameState + 0x1260;
+	ActiveCharacter* Active = (ActiveCharacter*)ONrGetActiveCharacter(&Chr[index]);
+	if ((int)Active == 0) return 1;
+	int i = 2;
+	int j = 0;
+	int Input1 = 0;
+	int Input2 = 0;
+	for(i = 1; i < numargs; i++) {
+		for(j = 0; j < 32; j++) {
+			if(strcmp(args[i].value_str32, Actions1[j].Name)) Input1 = Input1 | Actions1[j].Bit;
+			DDrConsole_PrintF("Testing %s against %s 0x%x", args[i].value_str32, Actions1[j].Name, Actions1[j].Bit);
+		}
+		for(j = 0; j < 9; j++) {
+			if(!strcmp(args[i].value_str32, Actions2[j].Name)) Input2 = Input2 | Actions2[j].Bit;
+	
+		}
+		}
+	for(i = 0; i < numargs; i++) {
+		DDrConsole_PrintF("%s", args[i].value_str32);
+	}
+//	if
+	return 0;
+}
+	
+uint16_t ONICALL bsl_isheld(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret)
+	{
+//		int index;
+//		if (numargs < 4) index = 0;
+//		else	if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].value_str32);
+//		else index = args[0].value_int32;
+
+//		Character* Chr = ONgGameState + 0x1260;
+//	ActiveCharacter* Active = (ActiveCharacter*)ONrGetActiveCharacter(&Chr[index]);
+//	if ((int)Active == 0) return 1;
+	int i = 2;
+	int j = 0;
+	int Input1 = 0;
+	int Input2 = 0;
+	for(i = 0; i < numargs; i++) {
+		for(j = 0; j < 32; j++) {
+			//DDrConsole_PrintF("Testing %s against %s 0x%x", args[i].value_str32, Actions1[j].Name, Actions1[j].Bit);
+			if(!strcmp(args[i].value_str32, Actions1[j].Name)) {
+				Input1 = Input1 | Actions1[j].Bit;
+				//DDrConsole_PrintF("Success!");
+			}
+			
+		}
+		for(j = 0; j < 9; j++) {
+			if(!strcmp(args[i].value_str32, Actions2[j].Name)) Input2 = Input2 | Actions2[j].Bit;
+	
+		}
+		}
+	//DDrConsole_PrintF("Testing: 0x%x Input: 0x%x",Input1, *(int*)(ONgGameState + 0xB8 + 0x10));
+	ret->value_int32 = 0;
+	ret->type = sl_int32;
+	if ( ((*(int*)(ONgGameState + 0xB8 + 0x10) & Input1) == Input1)  && ((*(int*)(ONgGameState + 0xB8 + 0x14) & Input2) == Input2)) ret->value_int32 = 1;
+	return 0;
+}
+
+uint16_t ONICALL bsl_waitforkey(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret)
+	{
+//		int index;
+//		if (numargs < 4) index = 0;
+//		else	if (args[0].type == sl_str32) index = DDrGetCharacterIndexFromName(args[0].value_str32);
+//		else index = args[0].value_int32;
+
+//		Character* Chr = ONgGameState + 0x1260;
+//	ActiveCharacter* Active = (ActiveCharacter*)ONrGetActiveCharacter(&Chr[index]);
+//	if ((int)Active == 0) return 1;
+	int i = 2;
+	int j = 0;
+	int Input1 = 0;
+	int Input2 = 0;
+	for(i = 0; i < numargs; i++) {
+		for(j = 0; j < 32; j++) {
+			//DDrConsole_PrintF("Testing %s against %s 0x%x", args[i].value_str32, Actions1[j].Name, Actions1[j].Bit);
+			if(!strcmp(args[i].value_str32, Actions1[j].Name)) {
+				Input1 = Input1 | Actions1[j].Bit;
+				//DDrConsole_PrintF("Success!");
+			}
+			
+		}
+		for(j = 0; j < 9; j++) {
+			if(!strcmp(args[i].value_str32, Actions2[j].Name)) Input2 = Input2 | Actions2[j].Bit;
+	
+		}
+		}
+	//DDrConsole_PrintF("Waiting...");
+	if ( ((*(int*)(ONgGameState + 0xB8 + 0x10) & Input1) == Input1)  && ((*(int*)(ONgGameState + 0xB8 + 0x14) & Input2) == Input2)) {
+	}
+	else {
+	//else (int)*ret = 1;
+	*dontuse2 = 1;
+	*dontuse1 = 1;
+	}
+/*
+	__asm__(
+		"movl 0x10(%esp), %edx\n\t"
+		"movl    $1,(%eax)\n\t"
+		);
+	//ret->type = sl_void
+*/	return 0;
+}
+
 /*
 uint16_t ONICALL bsl_sprintf(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret)
@@ -328,6 +524,4 @@
 uint16_t ONICALL bsl_sprintf(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], void* dontuse1, void* dontuse2, sl_arg* ret)
 {
-	DDrConsole_PrintF("%d", numargs);
-	
 	if (numargs < 1 || args[0].type != sl_str32)
 	{
@@ -481,6 +675,15 @@
 void SLrDaodan_Initalize()
 {
+
+	//const char regen_patch[] = {0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90};
+	//DDrPatch_Const(OniExe + 0x0011BB6D, regen_patch);
+	
+	//This one should work but doesn't.
+	//const char regen_patch[] ={0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x8B, 0x86, 0x44};
+	//DDrPatch_Const(OniExe + 0x0011BB64, regen_patch);
+
 	SLrConfig();
 	
+
 	SLrScript_Command_Register_ReturnType("int32mul", "Multiplies two numbers", "n1:int n2:int", sl_int32, bsl_int32mul);
 	SLrScript_Command_Register_ReturnType("mul", "Multiplies two numbers", "[int1:int|float1:float] [int2:int|float2:float]", sl_float, bsl_mul);
@@ -497,6 +700,11 @@
 	SLrScript_Command_Register_ReturnType("d_getindex","Converts a character's name to its index", "script_id:int", sl_int32, bsl_nametoindex);
 	SLrScript_Command_Register_ReturnType("d_health","Gets or sets a character's health", "[ai_name:str | script_id:int] [newhealth:int]", sl_str32, bsl_health);
+	SLrScript_Command_Register_ReturnType("d_regen","Gets or sets a character's health", "[ai_name:str | script_id:int] [newhealth:int]", sl_str32, bsl_regen);
 	SLrScript_Command_Register_ReturnType("d_maxhealth","Gets or sets a character's maximum health", "[ai_name:str | script_id:int] [newmaxhealth:int] [scalehealth:bool]", sl_str32, bsl_maxhealth);
 	SLrScript_Command_Register_ReturnType("d_powerup","Gets or sets a character's powerups", "ai_name:str|script_id:int powerup:str", sl_int32, bsl_powerup);
+	SLrScript_Command_Register_ReturnType("d_holdkey","Makes an AI hold a key", "[ai_name:string | script_id:int] keys", sl_int32, bsl_holdkey);
+	SLrScript_Command_Register_ReturnType("d_isheld","Checks for a held key", "keys", sl_int32, bsl_isheld);
+	SLrScript_Command_Register_Void("d_waitforkey","Waits for a keypress.", "keys", bsl_waitforkey);
+
 	//broken. sometimes crashes, and sometimes returns a string... : /
 	SLrScript_Command_Register_ReturnType("d_getattacker","Gets the last person to hurt a character", "[ai_name:string | script_id:int]", sl_int32, bsl_getattacker);
@@ -505,7 +713,8 @@
 
 	SLrScript_Command_Register_ReturnType("sprintf", "C-style sprintf.", "format:string arg1 arg2 ...", sl_str32, bsl_sprintf);
-	SLrScript_Command_Register_ReturnType("dprintcolor", "prints to console in color", "text:string [color: r b g] [color: r b g]", sl_void, bsl_dprintcolored);
 	
 	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);
+	
+	//SLrScript_Command_Register_ReturnType("d_offset", "a test", "thing:int", sl_int32, bsl_returnoffset);
 }
 
Index: Daodan/src/Oni_Character.h
===================================================================
--- Daodan/src/Oni_Character.h	(revision 468)
+++ Daodan/src/Oni_Character.h	(revision 470)
@@ -207,5 +207,6 @@
 	int16_t field_1C;	
 	int16_t field_1E;
-	int16_t hasLSI;
+	char hasLSI;
+	char field_1B5;
 	int16_t	field_1B6;
 	int16_t ShieldUsed;				//Bullet shield given for the char to use
@@ -228,5 +229,5 @@
 	Vector3 field_B8;
 	Vector3 AccelerateWith;
-	int16_t field_D0;
+	int32_t field_D0;
 	Vector3 field_D4;
 	int32_t field_E0;
@@ -234,13 +235,14 @@
 	int32_t field_E8;
 	int32_t field_EC;
-	int32_t field_F0;
-	int32_t field_F4;
-	int16_t IsInAir;
+	float SomePhyPosY;
+	int16_t field_F4;
+	int16_t IsInAirTimer;
 	Vector3 FallingVelocity;
 	Vector3 JumpVelocity;
-	int16_t field_110;
+	char StartJumpPending;
+	char field_111;
 	int16_t field_112;
-	int32_t field_114;
-	int32_t field_118;
+	Vector3 field_114;
+	int32_t LastDamageSourceCharacter;
 	int32_t field_11C;
 	int32_t field_120;
@@ -582,4 +584,15 @@
 //int16_t ONICALL ONrGameState_GetPlayerCharacter();
 
+//probably need to name these better.
+#define char_unkillable        (1 <<  5)
+#define char_superammo         (1 <<  6)
+#define char_unstoppable       (1 <<  8)
+#define char_deathlock         (1 << 10)
+#define char_dontaim           (1 << 13)
+#define char_nocollision       (1 << 17)
+#define char_noshadow          (1 << 24)
+#define char_invincible        (1 << 25)
+#define char_bossshield        (1 << 30)
+#define char_weaponimmune      (1 << 31)
 
 #endif
