Rune_PRC8/_module/nss/xix_hit.nss
Jaysyn904 d1c309ae63 Initial commit
Initial commit
2024-09-13 09:10:39 -04:00

77 lines
2.3 KiB
Plaintext

#include "NW_I0_SPELLS"
#include "prc_inc_spells"
void DoFreeze(object oTarget, object oCaster)
{
effect eImp = EffectVisualEffect(VFX_IMP_FROST_S);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eImp,oTarget);
// Slow effect
effect eVis = EffectVisualEffect(VFX_DUR_ICESKIN);
effect eSlow = EffectSlow();
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_NEGATIVE);
effect eLink = EffectLinkEffects(eSlow,eVis);
eLink = EffectLinkEffects(eLink,eDur);
int nDC = 10 + GetHitDice(oCaster) /2 + GetAbilityModifier(ABILITY_CHARISMA);
if ( !PRCMySavingThrow(SAVING_THROW_FORT,oTarget,nDC,SAVING_THROW_TYPE_COLD,oCaster) )
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eLink,oTarget,RoundsToSeconds(10));
}
}
void DoAbilityDamage(object oTarget, object oCaster)
{
// Con Damage
int nDam = 4;
int nType = ABILITY_CONSTITUTION;
effect eDam = EffectAbilityDecrease(nType,nDam);
eDam = SupernaturalEffect(eDam);
eDam = ExtraordinaryEffect(eDam);
int bKillEm = FALSE;
if ( !GetIsPC(oTarget) || GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES
|| GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT )
bKillEm = TRUE;
ApplyEffectToObject(DURATION_TYPE_PERMANENT,eDam,oTarget);
if ( GetIsImmune(oTarget,IMMUNITY_TYPE_ABILITY_DECREASE) )
return;
effect eHeal = EffectHeal(20);
effect eHealVis = EffectVisualEffect(VFX_IMP_HEALING_M);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eHeal,oCaster);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eHealVis,oCaster);
int nCon = GetAbilityScore(oTarget,ABILITY_CONSTITUTION);
if ( ( nCon - nDam ) < 3 && bKillEm )
{
effect eVis2 = EffectVisualEffect(VFX_IMP_DEATH);
effect eHP = EffectDamage( 9999 , DAMAGE_TYPE_MAGICAL , DAMAGE_POWER_PLUS_TWENTY);
effect eDeath = EffectDeath();
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eDeath,oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eHP,oTarget);
}
}
void main()
{
object oTarget = PRCGetSpellTargetObject();
object oCaster = OBJECT_SELF;
/* int bIsPoisoned = GetLocalInt(oTarget,"IsPoisoned");
if ( bIsPoisoned )
return; */
DoFreeze(oTarget,oCaster);
DelayCommand(0.1,DoAbilityDamage(oTarget,oCaster));
}