73 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			73 lines
		
	
	
		
			2.3 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
///::///////////////////////////////////////////////
 | 
						|
//:: Improved Invisibility
 | 
						|
//:: NW_S0_ImprInvis.nss
 | 
						|
//:: Copyright (c) 2001 Bioware Corp.
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
/*
 | 
						|
    Target creature can attack and cast spells while
 | 
						|
    invisible
 | 
						|
*/
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
//:: Created By: Preston Watamaniuk
 | 
						|
//:: Created On: Jan 7, 2002
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
//:: Modified By: Gazman
 | 
						|
//:: Modified on: Dec 25, 2003
 | 
						|
//:: Modified for Forgotten Worlds PW
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
 | 
						|
 | 
						|
#include "x2_inc_spellhook"
 | 
						|
 | 
						|
void main()
 | 
						|
{
 | 
						|
 | 
						|
/*
 | 
						|
  Spellcast Hook Code
 | 
						|
  Added 2003-06-23 by GeorgZ
 | 
						|
  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 eImpact = EffectVisualEffect(VFX_IMP_HEAD_MIND);
 | 
						|
    effect eVis = EffectVisualEffect(VFX_DUR_INVISIBILITY);
 | 
						|
    effect eInvis = EffectInvisibility(INVISIBILITY_TYPE_NORMAL);
 | 
						|
    effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
 | 
						|
    effect eCover = EffectConcealment(50);
 | 
						|
    effect eLink = EffectLinkEffects(eDur, eInvis);
 | 
						|
    // Removed the Link between the effects that cancel with attack and the effects that
 | 
						|
    // should remain for duration
 | 
						|
    effect eLink2 = EffectLinkEffects(eVis, eDur);
 | 
						|
    eLink2 = EffectLinkEffects(eLink2, eCover);
 | 
						|
 | 
						|
    //Fire cast spell at event for the specified target
 | 
						|
    SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_IMPROVED_INVISIBILITY, FALSE));
 | 
						|
    int nDuration = GetCasterLevel(OBJECT_SELF);
 | 
						|
    int nMetaMagic = GetMetaMagicFeat();
 | 
						|
    //Enter Metamagic conditions
 | 
						|
    if (nMetaMagic == METAMAGIC_EXTEND)
 | 
						|
    {
 | 
						|
        nDuration = nDuration *2; //Duration is +100%
 | 
						|
    }
 | 
						|
    //Apply the VFX impact and effects for Invisibility
 | 
						|
    ApplyEffectToObject(DURATION_TYPE_INSTANT, eImpact, oTarget);
 | 
						|
 | 
						|
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, TurnsToSeconds(nDuration));
 | 
						|
 | 
						|
    // Applying Concealment effect
 | 
						|
    ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink2, oTarget, TurnsToSeconds(nDuration));
 | 
						|
}
 | 
						|
 |