WoR_PRC8/_module/nss/movetocaverns.nss
Jaysyn904 b5e28e52f4 Initial commit
Initial commit [1.18]
2025-04-03 11:49:34 -04:00

63 lines
1.4 KiB
Plaintext

/* 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;
location lTarget;
oTarget = GetWaypointByTag("WP_CavernsofDarkness_1");
lTarget = GetLocation(oTarget);
//only do the jump if the location is valid.
//though not flawless, we just check if it is in a valid area.
//the script will stop if the location isn't valid - meaning that
//nothing put after the teleport will fire either.
//the current location won't be stored, either
if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return;
AssignCommand(oPC, ClearAllActions());
AssignCommand(oPC, ActionJumpToLocation(lTarget));
object oSpawn;
effect eEffect;
oTarget = oPC;
eEffect = EffectDazed();
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect, oTarget, 8.0f);
eEffect = EffectDamage(200, DAMAGE_TYPE_BLUDGEONING, DAMAGE_POWER_NORMAL);
AssignCommand(oPC, ActionPlayAnimation(ANIMATION_LOOPING_DEAD_FRONT, 1.0f, 6.0f));
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oPC);
oTarget = GetWaypointByTag("WP_CavernsofDarkness_1");
lTarget = GetLocation(oTarget);
oSpawn = CreateObject(OBJECT_TYPE_CREATURE, "drowguard", lTarget);
oTarget = GetObjectByTag("drowguard");
eEffect = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget);
}