RATDOG/_module/nss/fireonheartbeat.nss
Jaysyn904 0f13e6c538 Initial module commit
Initial module commit.
2021-08-29 23:34:48 -04:00

33 lines
1016 B
Plaintext

/* Script generated by
Lilac Soul's NWN Script Generator, v. 2.1
For download info, please visit:
http://nwvault.ign.com/View.php?view=Other.Detail&id=4683&id=625 */
//Goes on creature's OnHeartbeat. Fires when not fighting or talking.
void main()
{
object oPC = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_IS_PC, OBJECT_SELF, 1, CREATURE_TYPE_PERCEPTION, PERCEPTION_SEEN);
if (IsInConversation(OBJECT_SELF) || GetIsInCombat()) return;
effect eEffect;
eEffect = EffectDamage(3, DAMAGE_TYPE_FIRE, DAMAGE_POWER_ENERGY);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
object oTarget;
oTarget = oPC;
//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_IMP_FLAME_M), oTarget);
else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_FLAME_M), GetLocation(oTarget));
}