PRC8/trunk/smp/phs_s_mazed.nss
Jaysyn904 1662218bb4 Initial upload.
Adding base PRC 4.19a files to repository.
2022-10-07 13:51:24 -04:00

45 lines
1.3 KiB
Plaintext

/*:://////////////////////////////////////////////
//:: Spell Name Maze : Jump Out
//:: Spell FileName PHS_S_MazeC
//:://////////////////////////////////////////////
//:: Spell Effects Applied / Notes
//:://////////////////////////////////////////////
Jump Mazed Out
This is executed on the (N)PC and jumps them out of the area.
This is also used for Imprisonment removal VIA. freedom.
//:://////////////////////////////////////////////
//:: Created By: Jasperre
//::////////////////////////////////////////////*/
#include "PHS_INC_SPELLS"
void main()
{
// Delcare Major Variables
object oTarget = OBJECT_SELF;
// Imprisonment or Maze?
if(GetHasSpellEffect(PHS_SPELL_IMPRISONMENT, oTarget))
{
SendMessageToPC(oTarget, "You are released from your prison!");
}
else
{
SendMessageToPC(oTarget, "You see the maze's exit!");
}
// - Move them back to thier location
location lMoveTo = GetLocalLocation(oTarget, PHS_S_MAZEPRISON_LOCATION);
object oMoveToArea = GetLocalObject(oTarget, PHS_S_MAZEPRISON_OLD_AREA);
// Debug check...
if(GetIsObjectValid(oMoveToArea) &&
GetAreaFromLocation(lMoveTo) == oMoveToArea)
{
// Set NPCs to commandable
SetCommandable(TRUE, oTarget);
ClearAllActions();
JumpToLocation(lMoveTo);
}
}