111 lines
3.5 KiB
Plaintext
111 lines
3.5 KiB
Plaintext
//::///////////////////////////////////////////////
|
|
//:: Etherealness
|
|
//:: x0_s0_ether.nss
|
|
//:: Copyright (c) 2001 Bioware Corp.
|
|
|
|
|
|
#include "x2_inc_spellhook"
|
|
|
|
|
|
//Spell duration (in rounds)
|
|
int nDuration = 5;
|
|
//Spell Time Lock duration (in seconds, use float values)
|
|
float iLockTimer = 120.0;
|
|
//Defining time variables
|
|
float f120togo = ( 120 - iLockTimer ) * -1;
|
|
float f60togo = ( 60 - iLockTimer ) * -1;
|
|
float f10togo = ( 10 - iLockTimer ) * -1;
|
|
|
|
//Checking spell's caster
|
|
object oTarget = GetSpellTargetObject();
|
|
//Checking if he used GS recently
|
|
int iTimer = GetLocalInt(oTarget, "GSTimer");
|
|
void main()
|
|
{
|
|
if (iTimer == 0)
|
|
{
|
|
SetLocalInt(oTarget, "GSTimer", 1);
|
|
//Change: Checking target's area
|
|
object oArea = GetArea(oTarget);
|
|
//Declaring other major variables
|
|
effect eVis = EffectVisualEffect(VFX_DUR_SANCTUARY);
|
|
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
|
effect eSanc = EffectEthereal();
|
|
|
|
effect eLink = EffectLinkEffects(eVis, eSanc);
|
|
eLink = EffectLinkEffects(eLink, eDur);
|
|
|
|
//Enter Metamagic conditions
|
|
int nMetaMagic = GetMetaMagicFeat();
|
|
if (nMetaMagic == METAMAGIC_EXTEND)
|
|
{
|
|
nDuration = nDuration *2; //Duration is +100%
|
|
}
|
|
//Fire cast spell at event for the specified target
|
|
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ETHEREALNESS, FALSE));
|
|
//Apply the VFX impact and effects
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, RoundsToSeconds(nDuration));
|
|
//Send message to DMs about spell usage
|
|
//SendMessageToAllDMs("Player "+ObjectToString(oTarget)+" has just cast Greater Sanctuary. He is currently in "+ObjectToString(oArea)+".");
|
|
SendMessageToPC(oTarget, "Time: " +FloatToString(iLockTimer, 3, 1)+" seconds till next cast.");
|
|
DelayCommand(f120togo, SendMessageToPC(oTarget, "You have two minutes left."));
|
|
DelayCommand(f60togo, SendMessageToPC(oTarget, "You have one minute left."));
|
|
DelayCommand(f10togo, SendMessageToPC(oTarget, "You have 10 seconds left."));
|
|
DelayCommand(iLockTimer, SendMessageToPC(oTarget, "Greater Sanctuary is once again available for use."));
|
|
DelayCommand(iLockTimer, SetLocalInt(oTarget, "GSTimer", 0));
|
|
}
|
|
else
|
|
{
|
|
SendMessageToPC(oTarget, "You have used Greater Sanctuary too recently, the effect has been cancelled");
|
|
}
|
|
}
|
|
|
|
|
|
/*void main()
|
|
{
|
|
|
|
/*
|
|
Spellcast Hook Code
|
|
Added 2003-06-20 by Georg
|
|
If you want to make changes to all spells,
|
|
check x2_inc_spellhook.nss to find out more
|
|
|
|
|
|
|
|
if (!X2PreSpellCastCode())
|
|
{
|
|
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
|
|
return;
|
|
}
|
|
|
|
// End of Spell Cast Hook
|
|
|
|
|
|
//Declare major variables
|
|
object oTarget = GetSpellTargetObject();
|
|
effect eVis = EffectVisualEffect(VFX_DUR_SANCTUARY);
|
|
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
|
|
effect eSanc = EffectEthereal();
|
|
|
|
effect eLink = EffectLinkEffects(eVis, eSanc);
|
|
eLink = EffectLinkEffects(eLink, eDur);
|
|
|
|
int nDuration = GetCasterLevel(OBJECT_SELF);
|
|
//Enter Metamagic conditions
|
|
int nMetaMagic = GetMetaMagicFeat();
|
|
if (nMetaMagic == METAMAGIC_EXTEND)
|
|
{
|
|
nDuration = nDuration *2; //Duration is +100%
|
|
}
|
|
if (nDuration > 12){
|
|
nDuration = 12;
|
|
}
|
|
//Fire cast spell at event for the specified target
|
|
SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ETHEREALNESS, FALSE));
|
|
//Apply the VFX impact and effects
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration));
|
|
} */
|
|
|
|
|
|
|