Updated AMS marker feats. Removed arcane & divine marker feats. Updated Dread Necromancer for epic progression. Updated weapon baseitem models. Updated new weapons for crafting & npc equip. Updated prefix. Updated release archive.
		
			
				
	
	
		
			70 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			70 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| /*
 | |
|     nw_s0_sanctuary
 | |
| 
 | |
|     Makes the target creature invisible to hostile
 | |
|     creatures unless they make a Will Save to ignore
 | |
|     the Sanctuary Effect
 | |
| 
 | |
|     By: Preston Watamaniuk
 | |
|     Created: Jan 7, 2002
 | |
|     Modified: Jun 29, 2006
 | |
| 
 | |
|     Flaming_Sword: added greater sanctuary
 | |
|         cleaned up
 | |
| */
 | |
| 
 | |
| #include "prc_sp_func"
 | |
| #include "prc_inc_teleport"
 | |
| #include "prc_add_spell_dc"
 | |
| 
 | |
| //Implements the spell impact, put code here
 | |
| //  if called in many places, return TRUE if
 | |
| //  stored charges should be decreased
 | |
| //  eg. touch attack hits
 | |
| //
 | |
| //  Variables passed may be changed if necessary
 | |
| int DoSpell(object oCaster, object oTarget, int nCasterLevel, int nEvent)
 | |
| {
 | |
|     int nSpellID = PRCGetSpellId();
 | |
|     int bSanc = (nSpellID == SPELL_SANCTUARY);
 | |
|     effect eSanc = bSanc ? EffectSanctuary((PRCGetSaveDC(oTarget,oCaster))) : EffectEthereal();
 | |
|     effect eLink = EffectLinkEffects(EffectVisualEffect(VFX_DUR_SANCTUARY), eSanc);
 | |
|     eLink = EffectLinkEffects(eLink, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE));
 | |
|     float fDuration = bSanc ? RoundsToSeconds(nCasterLevel) : TurnsToSeconds(nCasterLevel);
 | |
|     int nMetaMagic = PRCGetMetaMagicFeat();
 | |
|     if (CheckMetaMagic(nMetaMagic, METAMAGIC_EXTEND))
 | |
|         fDuration *= 2; //Duration is +100%
 | |
|     SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, nSpellID, FALSE));
 | |
|     if(bSanc || GetCanTeleport(oTarget, GetLocation(oTarget), FALSE, TRUE))
 | |
|         SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oTarget, fDuration,TRUE,-1,nCasterLevel);
 | |
| 
 | |
|     return TRUE;    //return TRUE if spell charges should be decremented
 | |
| }
 | |
| 
 | |
| void main()
 | |
| {
 | |
|     object oCaster = OBJECT_SELF;
 | |
|     int nCasterLevel = PRCGetCasterLevel(oCaster);
 | |
|     PRCSetSchool(GetSpellSchool(PRCGetSpellId()));
 | |
|     if (!X2PreSpellCastCode()) return;
 | |
|     object oTarget = PRCGetSpellTargetObject();
 | |
|     int nEvent = GetLocalInt(oCaster, PRC_SPELL_EVENT); //use bitwise & to extract flags
 | |
|     if(!nEvent) //normal cast
 | |
|     {
 | |
|         if(GetLocalInt(oCaster, PRC_SPELL_HOLD) && oCaster == oTarget)
 | |
|         {   //holding the charge, casting spell on self
 | |
|             SetLocalSpellVariables(oCaster, 1);   //change 1 to number of charges
 | |
|             return;
 | |
|         }
 | |
|         DoSpell(oCaster, oTarget, nCasterLevel, nEvent);
 | |
|     }
 | |
|     else
 | |
|     {
 | |
|         if(nEvent & PRC_SPELL_EVENT_ATTACK)
 | |
|         {
 | |
|             if(DoSpell(oCaster, oTarget, nCasterLevel, nEvent))
 | |
|                 DecrementSpellCharges(oCaster);
 | |
|         }
 | |
|     }
 | |
|     PRCSetSchool();
 | |
| } |