/* Fly to Location script by Gaia_Werewolf This script is used on an item with the "Unique Item" spell property. */ void main() { object oPC = GetItemActivator(); if (GetIsAreaInterior(GetArea(oPC)) == TRUE) { SendMessageToPC(oPC, "It is too cramped in here to fly."); return; } if (GetItemActivatedTarget() == oPC) { AssignCommand(oPC, ActionStartConversation(oPC, "flytoarea", TRUE, FALSE)); return; } // Check if item target is valid. if (GetIsObjectValid(GetItemActivatedTarget())) { SendMessageToPC(oPC, "Invalid Target"); return;} // Next, do a Fly/Land animation and send the PC over to whereever // was clicked with the activated item. effect eFly; location lTarget; lTarget = GetItemActivatedTargetLocation(); eFly = EffectDisappearAppear(lTarget); // Cutscene effects! Totally unnecessary, but eh. DelayCommand(2.5, FadeToBlack(oPC, FADE_SPEED_FASTEST)); DelayCommand(4.2, FadeFromBlack(oPC, FADE_SPEED_FASTEST)); // Duration MUST be 3.0 or higher. Higher for busy areas. ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eFly, oPC, 4.0); }