Files
PRC8/nwn/nwnprc/trunk/scripts/prc_shadowlord.nss
Jaysyn904 c437270cd1 2026/05/28 Afternoon update
Updated damagtypes.2da for CEP3 reserved rows.
Added and setup Darkvision icon.
Added and setup Ultravision icon.
Added spell icon for Thicket of Blades.
Fixed Blacklight, Cloud of the Archeai, Darkness, Deeper Darkness, Damning Darkness, Utterdark, Grasping Shadows, Dawn and Dusk and Child of Shadow and Light for Telflammar Shadowlord's Shadow Blur and Shadow Sight abilities.
Updated Blacklight's TLK entry.
Created a constant for Shadow Discorporation.
Fixed Shadow Time never ending on the targets.
Updated prc_inc_combat to use monk iterative progression if warranted.
Updated PRCGetIsRealSpellKnownByClass() to handle Sublime Chord better. (@Lightbeard)
Added class heartbeat script for Shadowlord to handle Shadow Blur and Shadow Sight.
Added ShadowlordEffects() to prc_inc_spells.
Added constants for new damagetypes.
Completely rewrote Verminlord's Vermin Domination.
Fixed duration for Empathic Feedback.
Fixed Morality Undone to not break characters over a server reset.
2026-05-28 16:27:19 -04:00

108 lines
3.2 KiB
Plaintext

//::////////////////////////////////////////////////////////
//::
//:: prc_shadolord.nss
//::
//:: Handles Shadow Sight & Shadow Blur
//::
//::////////////////////////////////////////////////////////
//::
//:: Created by: Jaysyn
//:: Date: 2026-05-28 13:54:50
//::
//::////////////////////////////////////////////////////////
//::
//:: Shadow Sight - Gains Darkvision and Ultravision in
//:: darkness.
//::
//:: Shadow Blur - In darkness gains the benefit of Blur
//;: spell (20% concealment at night or in
//:: a Darkness spell).
//::
//:: Shadow Discorporation - When reduced to 0 or fewer HP,
//:: (NOT IMPLEMENTED) has a chance to teleport away.
//::
//::////////////////////////////////////////////////////////
#include "prc_feat_const"
#include "prc_class_const"
#include "prc_spell_const"
#include "prc_alterations"
void Discorp(object oPC,int iEquip)
{
object oItem ;
if (iEquip==2)
{
oItem=GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
if ( GetLocalInt(oItem,"ShaDiscorp")) return;
AddItemProperty(DURATION_TYPE_TEMPORARY,ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER,1),oItem,9999.0);
SetLocalInt(oItem,"ShaDiscorp",1);
}
else if (iEquip==1)
{
oItem=GetItemLastUnequipped();
if (!GetLocalInt(oItem,"ShaDiscorp")) return;
RemoveSpecificProperty(oItem,ITEM_PROPERTY_ONHITCASTSPELL,IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER,0,1,"",-1,DURATION_TYPE_TEMPORARY);
DeleteLocalInt(oItem,"ShaDiscorp");
}
else
{
oItem=GetItemInSlot(INVENTORY_SLOT_CHEST,oPC);
if ( !GetLocalInt(oItem,"ShaDiscorp"))
{
AddItemProperty(DURATION_TYPE_TEMPORARY,ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER,1),oItem,9999.0);
SetLocalInt(oItem,"ShaDiscorp",1);
}
}
}
void main()
{
//:: Declare main variables.
object oPC = OBJECT_SELF;
object oSkin = GetPCSkin(oPC);
object oArea = GetArea(oPC);
int iShadow = GetLevelByClass(CLASS_TYPE_SHADOWLORD, oPC);
int nNight = !GetIsDay();
int nTopside = GetIsAreaAboveGround(oArea);
int nOutside = !GetIsAreaInterior(oArea);
effect eLink;
effect eVis;
if (iShadow && nNight && nTopside && nOutside)
{
//:: Create visual feedback effect link
eVis = EffectVisualEffect(VFX_DUR_ULTRAVISION);
eVis = EffectLinkEffects(eVis, EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE));
eVis = EffectLinkEffects(eVis, EffectVisualEffect(VFX_DUR_MAGICAL_SIGHT));
eVis = EffectLinkEffects(eVis, EffectIcon(EFFECT_ICON_ULTRAVISION));
//:: Link Ultravision and visual feedback into base effect
eLink = EffectLinkEffects(eLink, EffectUltravision());
eLink = EffectLinkEffects(eLink, eVis);
if(DEBUG) DoDebug("prc_shadowlord >> Setting up Ultravision");
if (iShadow > 1)
{
//;: Add concealment for level 2+ Shadowlords
eLink = EffectLinkEffects(eLink, EffectConcealment(20));
if(DEBUG) DoDebug("prc_shadowlord >> Setting up Concealment");
}
SPApplyEffectToObject(DURATION_TYPE_TEMPORARY, eLink, oPC, 6.0f);
}
//:: Shadow Discorporation was never finished
/* int bDiscor= GetHasFeat(FEAT_SHADOWDISCOPOR, oPC) ? 1 : 0;
if (GetLocalInt(oPC,"ONENTER")) return;
if (bDiscor>0) Discorp(oPC,GetLocalInt(oPC,"ONEQUIP")); */
}