PoA_PRC8/_module/nss/clone_hb.nss
Jaysyn904 8d97886c3f Changed folder name.
Changed folder name.
2022-10-07 21:08:37 -04:00

42 lines
1.8 KiB
Plaintext

void main()
{
// Check if the copy is dead yet
if(GetIsDead(OBJECT_SELF))
{
object oItem;
int nSlot;
//Copy is dead so clean it out. and run the death script.
AssignCommand(OBJECT_SELF, SetIsDestroyable(TRUE));
for(nSlot=0; nSlot<=17; nSlot++)
{
oItem=GetItemInSlot(nSlot, OBJECT_SELF);
if (GetIsObjectValid(oItem)) DestroyObject(oItem, 0.0);
}
oItem=GetFirstItemInInventory(OBJECT_SELF);
while (GetIsObjectValid(oItem))
{
DestroyObject(oItem);
oItem = GetNextItemInInventory(OBJECT_SELF);
}
ExecuteScript("nw_c2_default7", OBJECT_SELF);
DestroyObject(OBJECT_SELF, 0.0);
}
else
{
DelayCommand(0.2,ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectConcealment(99,MISS_CHANCE_TYPE_VS_MELEE), OBJECT_SELF));
DelayCommand(0.4,ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectConcealment(99,MISS_CHANCE_TYPE_NORMAL), OBJECT_SELF));
DelayCommand(0.6,ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectConcealment(99,MISS_CHANCE_TYPE_VS_RANGED), OBJECT_SELF));
// copy is still alive, so do a combat round and reschedule this script
ExecuteScript("nw_c2_default5", OBJECT_SELF);
object oAttack = GetAttackTarget(OBJECT_SELF);
AssignCommand(OBJECT_SELF,ActionUseFeat(FEAT_IMPROVED_DISARM,oAttack));
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectConcealment(99,MISS_CHANCE_TYPE_VS_MELEE), OBJECT_SELF);
// combat rounds are 6 seconds long
DelayCommand(6.0, ExecuteScript("clone_hb", OBJECT_SELF));
DelayCommand(5.9,AssignCommand(OBJECT_SELF, ActionEquipMostDamagingMelee(oAttack,FALSE)));
DelayCommand(5.8,AssignCommand(OBJECT_SELF, ActionEquipMostDamagingMelee(oAttack,TRUE)));
}
}