Skip to content

Check for status: disarmed, knockdown and other disables to trigger surrendering

Hey, is there a more elegant way to check if someone has been disarmed than to check if there are weapons in his hands (would probably need to make sure that I don't use this script with monks etc.)? Also is there a way to check if a creature was knocked down? GetHasFeatEffect() doesn't seem to work with it. Maybe a CONSTANT of the prone animation? Any other tips?



#include "x0_i0_match"

int IsDisabled(object oNPC)
{
if (GetHasEffect(EFFECT_TYPE_DAZED, oNPC) || GetHasEffect(EFFECT_TYPE_CHARMED, oNPC) || GetHasEffect(EFFECT_TYPE_DOMINATED, oNPC) || GetHasEffect(EFFECT_TYPE_STUNNED, oNPC)
|| GetHasEffect(EFFECT_TYPE_FRIGHTENED, oNPC) || GetHasEffect(EFFECT_TYPE_ENTANGLE, oNPC) || GetHasEffect(EFFECT_TYPE_BLINDNESS, oNPC) || GetHasEffect(EFFECT_TYPE_PARALYZE, oNPC)
|| GetHasFeatEffect(FEAT_IMPROVED_KNOCKDOWN, oNPC))

{return TRUE;}

else
{return FALSE;}
}


void main()
{
ExecuteScript("nw_ch_ac6", OBJECT_SELF);




// * generic surrender should only fire once

if( (GetIsDead(OBJECT_SELF) == FALSE) && (GetLocalInt(OBJECT_SELF,"Generic_Surrender") == 0)
&& ( (GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, OBJECT_SELF) == OBJECT_INVALID) && (GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, OBJECT_SELF) == OBJECT_INVALID)) || (IsDisabled(OBJECT_SELF) == 1) )

{
SetLocalInt(OBJECT_SELF, "Generic_Surrender",1);

SurrenderToEnemies();
ClearAllActions();
ActionSpeakString("I Give up!");
}

}

Sign In or Register to comment.