30 lines
417 B
Plaintext
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;
|
|
}
|
|
}
|