LoD_PRC8/_module/nss/magicportal.nss
Jaysyn904 94990edc60 Initial Upload
Initial Upload
2023-09-21 21:20:34 -04:00

25 lines
1.1 KiB
Plaintext

//:: Activate Item script
//:: Created by: Helge "DarkFame" Ingvoldstad
//::
//:: Purpose: Checks if the portal scroll is casted.
//::
//:: Installation: In the Toolset select Edit->Module Properties->Events. And add this code to the "OnActivateItem" event.
void main()
{
ExecuteScript("dmfi_activate", GetItemActivator());
// variable init
object oItem = GetItemActivated(); // gets which item activated
object oPC = GetItemActivator(); // gets item activator
string sItemTag = GetTag(oItem); // gets tag of activated item
if (sItemTag == "magicalportal") { // checks if it's the town portal scroll that was used
location lLoc = GetItemActivatedTargetLocation(); // sets the location the scroll was casted at
// Effects start
effect eVis = EffectVisualEffect(VFX_FNF_SUMMON_UNDEAD, FALSE);
ApplyEffectAtLocation(DURATION_TYPE_TEMPORARY, eVis, lLoc, 6.0);
// Effects stop
CreateObject(OBJECT_TYPE_PLACEABLE,"magicalportal",lLoc,TRUE); // creates the actual portal
SetLocalLocation(oPC, "Owner", GetItemActivatedTargetLocation()); // stores the location variable in the PC itself
}
}