Seen 3 Days Ago
Posted 3 Weeks Ago
4 posts
1.3 Years
OUTDATED Surviving poison outside of battle with 1hp

This no longer works, but Lunos has found a fix further down - go check it out!



With just a few steps your pokemon should survive poison on the overworld now with 1hp, like in later gens.

Open the file /src/field_poison.c
Spoiler:

Find the following function:
s32 DoPoisonFieldEffect(void)
Simply add:
u32 numSurvived = 0;
Then find this code inside:
if(hp == 0 || --hp == 0)
and change the whole if-statement to:
if (hp == 1 || --hp == 1)
{
	u32 status = STATUS1_NONE;
	SetMonData(pokemon, MON_DATA_STATUS, &status);
	numSurvived++;
	ScriptContext1_SetupScript(EventScript_PoisonSurvial);
}
Last in this file add the following after the for-loop:
if (numSurvived != 0)
{
	return FLDPSN_NONE;
}


Next open /data/event_scripts.s and add the following to the end of the file:
Spoiler:

EventScript_PoisonSurvial::
	msgbox Text_PoisonSurvial, MSGBOX_SIGN
Text_PoisonSurvial:
	.string "Poison survived with 1hp…$"


Thats it, everything should be done.