Initial upload
Initial upload. PRC8 has been added. Module compiles, PRC's default AI & treasure scripts have been integrated. Started work on top hak for SLA / Ability / Scripting modifications.
This commit is contained in:
45
_module/nss/nw_c2_dimdoor.nss
Normal file
45
_module/nss/nw_c2_dimdoor.nss
Normal file
@@ -0,0 +1,45 @@
|
||||
//::///////////////////////////////////////////////
|
||||
//:: NW_C2_DIMDOOR.nss
|
||||
//:: Copyright (c) 2001 Bioware Corp.
|
||||
//:://////////////////////////////////////////////
|
||||
/*
|
||||
Creature randomly hops around
|
||||
to enemies during combat.
|
||||
*/
|
||||
//:://////////////////////////////////////////////
|
||||
//:: Created By: Brent
|
||||
//:: Created On: January 2002
|
||||
//:://////////////////////////////////////////////
|
||||
|
||||
#include "NW_I0_GENERIC"
|
||||
#include "jw_privates_inc"
|
||||
|
||||
void JumpToWeakestEnemy(object oTarget)
|
||||
{
|
||||
SetVictim(OBJECT_INVALID);
|
||||
object oTargetVictim = ChooseTarget();
|
||||
// * won't jump if closer than 4 meters to victim
|
||||
if ((GetDistanceToObject(oTargetVictim) > 4.0) && (GetObjectSeen(oTargetVictim) == TRUE))
|
||||
{
|
||||
ClearAllActions();
|
||||
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD);
|
||||
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
|
||||
|
||||
// SpeakString("Jump to " + GetName(oTargetVictim));
|
||||
DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF));
|
||||
DelayCommand(0.3,ActionJumpToObject(oTargetVictim));
|
||||
DelayCommand(0.5,ActionAttack(oTargetVictim));
|
||||
}
|
||||
}
|
||||
void main()
|
||||
{
|
||||
// * During Combat try teleporting around
|
||||
if (GetUserDefinedEventNumber() == 1003)
|
||||
{
|
||||
// * if random OR heavily wounded then teleport to next enemy
|
||||
if ((Random(100) < 50) || ( (GetCurrentHitPoints() / GetMaxHitPoints()) * 100 < 50) )
|
||||
{
|
||||
JumpToWeakestEnemy(GetNearestCreature(CREATURE_TYPE_REPUTATION, REPUTATION_TYPE_ENEMY));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user