56 lines
1.2 KiB
Plaintext
56 lines
1.2 KiB
Plaintext
#include "nw_i0_generic"
|
|
/* Script generated by
|
|
Lilac Soul's NWN Script Generator, v. 1.5
|
|
|
|
For download info, please visit:
|
|
http://www.lilacsoul.revility.com */
|
|
|
|
//Can go OnDamaged, OnDisturbed, OnSpellCastAt, creature heartbeats, etc.
|
|
void main()
|
|
{
|
|
|
|
object oPC = GetLastHostileActor();
|
|
|
|
if (!GetIsPC(oPC)) return;
|
|
|
|
if (d100()>20)
|
|
return;
|
|
|
|
object oTarget;
|
|
oTarget = OBJECT_SELF;
|
|
|
|
//Visual effects can't be applied to waypoints, so if it is a WP
|
|
//apply to the WP's location instead
|
|
|
|
int nInt;
|
|
nInt = GetObjectType(oTarget);
|
|
|
|
if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HORRID_WILTING), oTarget);
|
|
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_HORRID_WILTING), GetLocation(oTarget));
|
|
|
|
oTarget = oPC;
|
|
|
|
effect eEffect;
|
|
eEffect = EffectAbilityDecrease(ABILITY_STRENGTH, 2);
|
|
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 60.0f);
|
|
|
|
object oSpawn;
|
|
location lTarget;
|
|
oTarget = GetWaypointByTag("dtree");
|
|
|
|
lTarget = GetLocation(oTarget);
|
|
|
|
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "creature001", lTarget);
|
|
|
|
oTarget = oSpawn;
|
|
|
|
SetIsTemporaryEnemy(oPC, oTarget);
|
|
|
|
AssignCommand(oTarget, ActionAttack(oPC));
|
|
|
|
AssignCommand(oTarget, DetermineCombatRound(oPC));
|
|
|
|
}
|
|
|