RoT2_PRC8/_module/nss/aw_dimdoor.nss
Jaysyn904 499aba4eb3 Initial upload
Initial upload
2023-09-25 18:13:22 -04:00

25 lines
876 B
Plaintext

void JumpToWeakestEnemy(object oTarget)
{
object oTargetVictim = GetFactionMostDamagedMember(oTarget);
if ((GetDistanceToObject(oTargetVictim) > 4.0) && (GetObjectSeen(oTargetVictim) == TRUE))
{
ClearAllActions();
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF));
DelayCommand(0.3,ActionJumpToObject(oTargetVictim));
DelayCommand(0.1,ActionAttack(oTargetVictim));
}
}
void main()
{
if (GetUserDefinedEventNumber() == 1003)
{
if ((Random(100) < 50) || ( (GetCurrentHitPoints() / GetMaxHitPoints()) * 100 < 50) )
{
JumpToWeakestEnemy(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY));
}
}
}