HiddenTradition_PRC8/_module/nss/ro_slaad_invoke.nss
2024-06-20 15:47:42 -04:00

43 lines
1018 B
Plaintext

#include "nw_i0_generic"
/* Script generated by
Lilac Soul's NWN Script Generator, v. 1.6
For download info, please visit:
http://www.lilacsoul.revility.com */
//Put this OnEnter
void main()
{
object oPC = GetEnteringObject();
if (!GetIsPC(oPC)) return;
object oTarget;
object oSpawn;
location lTarget;
oTarget = GetWaypointByTag("WP_SLAAD_LK");
lTarget = GetLocation(oTarget);
//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(oSpawn);
if (nInt != OBJECT_TYPE_WAYPOINT) DelayCommand(0.5, ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_GATE), oTarget));
else DelayCommand(0.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SUMMON_GATE), GetLocation(oTarget)));
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "nw_slaadred", lTarget);
SetIsTemporaryEnemy(oPC, oSpawn);
AssignCommand(oSpawn, ActionAttack(oPC));
AssignCommand(oSpawn, DetermineCombatRound(oPC));
}