48 lines
1.4 KiB
Plaintext
48 lines
1.4 KiB
Plaintext
//This is the default header for most items converted to the new
|
|
//tagbased system.
|
|
//Remember to create 2 scripts, one using the template, and name this
|
|
//script ac_"tagnameofitemgoeshere" (without the "")
|
|
|
|
#include "x2_inc_switches"
|
|
void main()
|
|
{
|
|
// Check if we have the correct event firing the script
|
|
if (GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) return;
|
|
|
|
//Define Variables
|
|
|
|
object oItem=GetItemActivated();
|
|
object oActivator=GetItemActivator();
|
|
object oPlayer = GetItemActivator();
|
|
object target = GetItemActivatedTarget();
|
|
string tag = GetTag(oItem);
|
|
|
|
//You main script function goes under this line.
|
|
object oPC;
|
|
|
|
// Check if item target is valid.
|
|
|
|
if (GetIsObjectValid(GetItemActivatedTarget()))
|
|
{
|
|
return;
|
|
}
|
|
|
|
// Next, do a Fly/Land animation and send the PC over to whereever
|
|
// was clicked with the activated item.
|
|
|
|
effect eFly;
|
|
location lTarget;
|
|
oPC = GetItemActivator();
|
|
|
|
lTarget = GetItemActivatedTargetLocation();
|
|
eFly = EffectDisappearAppear(lTarget);
|
|
|
|
// Cutscene effects! Totally unnecessary, really, but cute.
|
|
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);
|
|
|
|
}
|