81 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			81 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| //::///////////////////////////////////////////////
 | |
| //:: Wall of Fire: On Enter
 | |
| //:: NW_S0_WallFireA.nss
 | |
| //:: Copyright (c) 2001 Bioware Corp.
 | |
| //:://////////////////////////////////////////////
 | |
| /*
 | |
|     Person within the AoE take 4d6 fire damage
 | |
|     per round.
 | |
| */
 | |
| //:://////////////////////////////////////////////
 | |
| //:: Created By: Preston Watamaniuk
 | |
| //:: Created On: May 17, 2001
 | |
| //:://////////////////////////////////////////////
 | |
| 
 | |
| #include "ke_spell_factor"
 | |
| 
 | |
| #include "X0_I0_SPELLS"
 | |
| #include "x2_inc_spellhook"
 | |
| 
 | |
| void main()
 | |
| {
 | |
| 
 | |
|     //Declare major variables
 | |
|     int nMetaMagic = GetMetaMagicFeat();
 | |
|     int nCasterLevel = 8;
 | |
|     int nDamage;
 | |
|     effect eDam;
 | |
|     object oTarget;
 | |
|     //Declare and assign personal impact visual effect.
 | |
|     effect eVis = EffectVisualEffect(VFX_IMP_FLAME_M);
 | |
|     //Capture the first target object in the shape.
 | |
|     oTarget = GetEnteringObject();
 | |
|     if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, GetAreaOfEffectCreator()))
 | |
|     {
 | |
|         //Fire cast spell at event for the specified target
 | |
|         SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, SPELL_WALL_OF_FIRE));
 | |
|         //Make SR check, and appropriate saving throw(s).
 | |
|         if(!MyResistSpell(GetAreaOfEffectCreator(), oTarget))
 | |
|         {
 | |
|             //Roll damage.
 | |
|             nDamage = (d8(nCasterLevel)+40);
 | |
|             //Enter Metamagic conditions
 | |
|                 if (nMetaMagic == METAMAGIC_MAXIMIZE)
 | |
|                 {
 | |
|                    (8*(nCasterLevel)+40);
 | |
|                 }
 | |
|                 if (nMetaMagic == METAMAGIC_EMPOWER)
 | |
|                 {
 | |
|                      nDamage = nDamage + (nDamage/2); //Damage/Healing is +50%
 | |
|                 }
 | |
|             // nDamage = GetReflexAdjustedDamage(nDamage, oTarget, GetSpellSaveDC(), SAVING_THROW_TYPE_FIRE);
 | |
| 
 | |
|             //starting the grand circus of importing and converting back and forth //
 | |
| 
 | |
|                 float fDamage = IntToFloat(nDamage);
 | |
| 
 | |
|                 // multiplaying damage with fFactor //
 | |
| 
 | |
|                 float fFactor = CalculateFactor();
 | |
| 
 | |
|                 fDamage = fDamage * fFactor;
 | |
| 
 | |
|                 // converting the float damage back to INT damage so we can use it again //
 | |
| 
 | |
|                 int nDamage2 = FloatToInt(fDamage);
 | |
| 
 | |
|                // Done and remember to change nDamage with nDamage2 below :) //
 | |
| 
 | |
| 
 | |
| 
 | |
|             if(nDamage > 0)
 | |
|             {
 | |
|                 // Apply effects to the currently selected target.
 | |
|                 eDam = EffectDamage(nDamage2, DAMAGE_TYPE_FIRE);
 | |
|                 ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget);
 | |
|                 ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
 | |
|             }
 | |
|         }
 | |
|     }
 | |
| }
 |