LoD_PRC8/_module/nss/capture.nss
Jaysyn904 94990edc60 Initial Upload
Initial Upload
2023-09-21 21:20:34 -04:00

25 lines
1.0 KiB
Plaintext

void main()
{
object oPC = GetLocalObject(OBJECT_SELF, "oPC");
string sName = GetName(OBJECT_SELF);
if (GetLocalInt(OBJECT_SELF, "IsDm")){return;}
if (GetIsPC(OBJECT_SELF)){
if (GetCommandable(OBJECT_SELF)){
AssignCommand(OBJECT_SELF, ClearAllActions());
AssignCommand(OBJECT_SELF,ActionJumpToLocation(GetLocation(oPC)));
ApplyEffectToObject( DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_GOOD_HELP),OBJECT_SELF,2.0f);
DelayCommand(0.2, SetCommandable(FALSE, OBJECT_SELF));
AssignCommand(OBJECT_SELF, ActionPlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, 36000.0));
FloatingTextStringOnCreature("Captured " + sName,oPC,FALSE);
FloatingTextStringOnCreature("Captured " + sName,OBJECT_SELF,FALSE);
SetLocalInt(OBJECT_SELF,"captured",TRUE);
}
else
{
ExecuteScript("free", OBJECT_SELF);
FloatingTextStringOnCreature("Freed " + sName,oPC,FALSE);
}
}
return;
}