68 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			68 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| //::///////////////////////////////////////////////
 | |
| //:: Electric Jolt
 | |
| //:: [x0_s0_ElecJolt.nss]
 | |
| //:: Copyright (c) 2002 Bioware Corp.
 | |
| //:://////////////////////////////////////////////
 | |
| /*
 | |
| 1d3 points of electrical damage to one target.
 | |
| */
 | |
| //:://////////////////////////////////////////////
 | |
| //:: Created By: Brent
 | |
| //:: Created On: July 17 2002
 | |
| //:://////////////////////////////////////////////
 | |
| 
 | |
| #include "X0_I0_SPELLS"
 | |
| #include "x2_inc_spellhook"
 | |
| 
 | |
| 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();
 | |
|     int nCasterLevel = GetCasterLevel(OBJECT_SELF);
 | |
|     int nDamage;
 | |
| 
 | |
|       if (nCasterLevel > 20)
 | |
|         {
 | |
|             nCasterLevel = 20;
 | |
|         }
 | |
| 
 | |
|     effect eVis = EffectVisualEffect(VFX_IMP_LIGHTNING_S);
 | |
|     if(!GetIsReactionTypeFriendly(oTarget))
 | |
|     {
 | |
|         //Fire cast spell at event for the specified target
 | |
|         SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_ELECTRIC_JOLT));
 | |
|         //Make SR Check
 | |
|         if(!MyResistSpell(OBJECT_SELF, oTarget))
 | |
|         {
 | |
|             //Set damage effect
 | |
|              effect eBad = EffectDamage(MaximizeOrEmpower(4, nCasterLevel, GetMetaMagicFeat()), DAMAGE_TYPE_ELECTRICAL);
 | |
|             //Apply the VFX impact and damage effect
 | |
|             ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
 | |
|             ApplyEffectToObject(DURATION_TYPE_INSTANT, eBad, oTarget);
 | |
|         }
 | |
|     }
 | |
| }
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 |