PoA_PRC8/_module/nss/ww_aura1.nss
Jaysyn904 bfbbd2f1ac Major update
Added several new undead models & facelifted overrides for other models.  Added dozens of new undead creatures from Libris Mortis & the monster manuals.  Added CODI Core AI.  Added NESS spawner system.  Added randomized respawning trap system.  Added undead feeding system.  Greatly revamped Catacombs & Halls of the Dead.  Updated nimtools.  Full compile.  Updated release archive.
2024-04-07 01:06:57 -04:00

71 lines
1.8 KiB
Plaintext

#include "prc_inc_racial"
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;
}
void main()
{
object oTarget = GetEnteringObject();
object oCaster = GetAreaOfEffectCreator();
if ( oTarget == oCaster )
return;
effect eCold = EffectDamage(d10(2),DAMAGE_TYPE_COLD);
effect eVis = EffectVisualEffect(VFX_IMP_FROST_S);
effect eRegen = EffectRegenerate(10,6.0);
effect eTurn = EffectTurnResistanceIncrease(6);
effect eVis2 = EffectVisualEffect(VFX_IMP_SUPER_HEROISM);
if ( GetIsEnemy(oTarget, oCaster) )
{
ApplyEffectToObject(DURATION_TYPE_INSTANT,eCold,oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oTarget);
}
// check for fire and cold properties on hide to determine
// if creature is cold subtype
if ( IsColdSubType(oTarget) )
{
if ( MyPRCGetRacialType(oTarget) == RACIAL_TYPE_UNDEAD )
eRegen = EffectLinkEffects(eRegen,eTurn);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis2,oTarget);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eRegen,oTarget,6.0);
}
}