Shargast_PRC8/_module/Chapter 2/nss/bootsofleaping.nss
Jaysyn904 66a0a3e043 Initial commit
Initial commit.
2024-08-03 14:13:18 -04:00

52 lines
1.2 KiB
Plaintext

/*Based on Fly to Location script
by Gaia_Werewolf//edited by ffbj
This script is used on an item with the "Unique Item" spell property. */
#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
if (!nEvent == X2_ITEM_EVENT_ACTIVATE)
return;
// Check if item target is valid.
object oPC;
oPC = GetItemActivator();
object oArea;
oArea = GetArea(oPC);
if(GetLocalInt(oPC, "Mounted") == 1)
{
SendMessageToPC(oPC, "You must Dismount to use this item.");
return;
}
{
if (GetIsObjectValid(GetItemActivatedTarget()))
return;
if(GetLocalInt(oArea, "NO_ITEM_USE") == 1)
{
SendMessageToPC(oPC, "This item is not usuable here.");
return;
}
effect eFly;
location nDestination;
nDestination = GetItemActivatedTargetLocation();
eFly = EffectDisappearAppear(nDestination);
// Cutscene effects! Totally unnecessary, but eh.
DelayCommand(2.0, FadeToBlack(oPC, FADE_SPEED_FASTEST));
DelayCommand(4.5, FadeFromBlack(oPC, FADE_SPEED_FASTEST));
// Duration MUST be 3.0 or higher. Higher for busy areas.
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFly, oPC, 3.5);
}
}