Initial Upload
Initial Upload
This commit is contained in:
24
_module/nss/magicportal.nss
Normal file
24
_module/nss/magicportal.nss
Normal file
@@ -0,0 +1,24 @@
|
||||
//:: 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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user