RoT2_PRC8/_module/nss/cb_yield.nss
Jaysyn904 499aba4eb3 Initial upload
Initial upload
2023-09-25 18:13:22 -04:00

30 lines
417 B
Plaintext

int nUser=GetUserDefinedEventNumber();
void main()
{
switch (nUser)
{
case 1006: //on damaged
int nowHP=GetCurrentHitPoints(OBJECT_SELF);
int fullHP=GetMaxHitPoints(OBJECT_SELF);
if ((nowHP * 3) <= fullHP) //less than 1/3 HP
{
//surrender
SurrenderToEnemies();
object oPC=GetLastDamager();
ClearAllActions();
AssignCommand(oPC, ClearAllActions());
ActionStartConversation(oPC, "conv_orcyield");
}
break;
}
}