86 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			86 lines
		
	
	
		
			2.7 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
//::///////////////////////////////////////////////
 | 
						|
//:: Greater Ruin
 | 
						|
//:: X2_S2_Ruin
 | 
						|
//:: Copyright (c) 2003 Bioware Corp.
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
/*
 | 
						|
// The caster deals 35d6 damage to a single target
 | 
						|
   fort save for half damage
 | 
						|
*/
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
//:: Created By: Andrew Nobbs
 | 
						|
//:: Created On: Nov 18, 2002
 | 
						|
//:://////////////////////////////////////////////
 | 
						|
 | 
						|
#include "ke_spell_factor"
 | 
						|
 | 
						|
#include "x2_I0_SPELLS"
 | 
						|
#include "x2_inc_spellhook"
 | 
						|
#include "x0_I0_SPELLS"
 | 
						|
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();
 | 
						|
 | 
						|
 | 
						|
    float fDist = GetDistanceBetween(OBJECT_SELF, oTarget);
 | 
						|
    float fDelay = fDist/(3.0 * log(fDist) + 2.0);
 | 
						|
 | 
						|
    int nSpellDC = GetEpicSpellSaveDC(OBJECT_SELF);
 | 
						|
 | 
						|
    if (spellsIsTarget(oTarget, SPELL_TARGET_STANDARDHOSTILE, OBJECT_SELF))
 | 
						|
    {
 | 
						|
        //Fire cast spell at event for the specified target
 | 
						|
        SignalEvent(oTarget, EventSpellCastAt(OBJECT_SELF, GetSpellId()));
 | 
						|
        //Roll damage
 | 
						|
        int nDam = d6(80);
 | 
						|
        //Set damage effect
 | 
						|
 | 
						|
        if (MySavingThrow(SAVING_THROW_FORT,oTarget,nSpellDC,SAVING_THROW_TYPE_SPELL,OBJECT_SELF) != 0 )
 | 
						|
        {
 | 
						|
            nDam /=1;
 | 
						|
        }
 | 
						|
 | 
						|
                //starting the grand circus of importing and converting back and forth //
 | 
						|
 | 
						|
                float fDamage = IntToFloat(nDam);
 | 
						|
 | 
						|
                // 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 nDam2 = FloatToInt(fDamage);
 | 
						|
 | 
						|
                // Done and remember to change nDamage with nDamage2 below :) //
 | 
						|
 | 
						|
 | 
						|
        effect eDam = EffectDamage(nDam2, DAMAGE_TYPE_POSITIVE, DAMAGE_POWER_PLUS_TWENTY);
 | 
						|
        ApplyEffectAtLocation (DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_SCREEN_SHAKE), GetLocation(oTarget));
 | 
						|
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(487), oTarget);
 | 
						|
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_BLOOD_CRT_RED), oTarget);
 | 
						|
        ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_COM_CHUNK_BONE_MEDIUM), oTarget);
 | 
						|
        DelayCommand(fDelay, ApplyEffectToObject(DURATION_TYPE_INSTANT, eDam, oTarget));
 | 
						|
    }
 | 
						|
}
 |