Initial upload
Initial upload
This commit is contained in:
29
_module/nss/cb_yield.nss
Normal file
29
_module/nss/cb_yield.nss
Normal file
@@ -0,0 +1,29 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user