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

70 lines
2.0 KiB
Plaintext

int IsColdSubType( object oTarget )
{
object oHide = GetItemInSlot(INVENTORY_SLOT_CARMOUR,oTarget);
if ( !GetIsObjectValid( oHide ) )
return FALSE;
int bCold = FALSE;
int bFire = FALSE;
int nIPType;
int nIPSubType;
itemproperty ipIP = GetFirstItemProperty(oHide);
while ( GetIsItemPropertyValid(ipIP) )
{
nIPType = GetItemPropertyType(ipIP);
nIPSubType = GetItemPropertySubType(ipIP);
if ( nIPType == ITEM_PROPERTY_DAMAGE_VULNERABILITY &&
nIPSubType == 10 ) // fire vuln
bFire = TRUE;
if ( nIPType == ITEM_PROPERTY_IMMUNITY_DAMAGE_TYPE &&
nIPSubType == 7 ) // cold immunity
bCold = TRUE;
if ( bFire && bCold )
return TRUE;
ipIP = GetNextItemProperty(oHide);
}
return FALSE;
}
#include "prc_inc_spells"
void main()
{
object oCaster = GetAreaOfEffectCreator();
effect eCold;
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
effect eRegen = EffectRegenerate(10,5.5);
effect eTurn = EffectTurnResistanceIncrease(6);
effect eVis2 = EffectVisualEffect(VFX_IMP_SUPER_HEROISM);
object oTarget = GetFirstInPersistentObject();
while ( GetIsObjectValid(oTarget ) )
{
if ( oTarget != oCaster )
{
if ( GetIsEnemy(oTarget,oCaster))
{
eCold = EffectDamage(d10(2),DAMAGE_TYPE_COLD);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eCold,oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget);
}
if ( IsColdSubType(oTarget) )
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eRegen,oTarget,6.0);
if ( MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD )
{
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eTurn,oTarget,6.0);
}
}
}
oTarget = GetNextInPersistentObject();
}
}