PRC8/nwn/trunk/smp/phs_s_phasedoorc.nss
Jaysyn904 5914ed2ab5 Updated Release Archive
Updated Release Archive.  Fixed Mage-killer prereqs.  Removed old LETO & ConvoCC related files.  Added organized spell scroll store.  Fixed Gloura spellbook. Various TLK fixes.  Reorganized Repo.  Removed invalid user folders. Added DocGen back in.
2023-08-22 10:00:21 -04:00

62 lines
2.1 KiB
Plaintext

/*:://////////////////////////////////////////////
//:: Spell Name Phase Door: Heartbeat
//:: Spell FileName PHS_S_PhaseDoorC
//:://////////////////////////////////////////////
//:: Spell Effects Applied / Notes
//:://////////////////////////////////////////////
Uses a creature who invisiblieses themselves.
Each creature (an entrance, point 1, and an exit, point 2) will be created.
A power will remove the invisibility off it. They should have a visual
from the spell. The invisiblity will be applied as thier own (undispellable)
effect.
Click on one for conversation, it takes you to the other.
One of the creatures is the "master" of the two, and is set to the caster.
Thats all, else, if one exsists and one doesn't, they both go.
//:://////////////////////////////////////////////
//:: Created By: Jasperre
//::////////////////////////////////////////////*/
#include "PHS_INC_SPELLS"
void main()
{
// Check Master and charges and other destination in HB
object oSelf = OBJECT_SELF;
int nCharges = GetLocalInt(oSelf, "PHS_PHASE_DOOR_CHARGES");
// Get master/spell on us
object oMaster = PHS_FirstCasterOfSpellEffect(PHS_SPELL_PHASE_DOOR, oSelf);
// Get destination
object oDestination = GetLocalObject(oSelf, "PHS_PHASE_DOOR_TARGET");
// Check all validity
if(!GetIsObjectValid(oMaster) || !GetIsObjectValid(oDestination) ||
nCharges <= 0)
{
// We go!
effect eUnsummon = EffectVisualEffect(VFX_IMP_UNSUMMON);
PHS_ApplyLocationVFX(GetLocation(oSelf), eUnsummon);
// Go
PHS_CompletelyDestroyObject(oSelf);
}
else
{
// Will maybe make ourselves invisible
if(!PHS_GetHasEffect(EFFECT_TYPE_INVISIBILITY, oSelf))
{
// Reduce the local on us by 1
if(PHS_IncreaseStoredInteger(oSelf, "PHS_SPELL_PHASE_DOOR_INVIS_ROUNDS", -1) <= 0)
{
effect eInvis = EffectInvisibility(INVISIBILITY_TYPE_NORMAL);
eInvis = SupernaturalEffect(eInvis);
// Apply the invisbility.
PHS_ApplyPermanent(oSelf, eInvis);
}
}
}
}