Files
PRC8/nwn/nwnprc/trunk/psionics/psi_pow_metaclaw.nss
Jaysyn904 ce7d550670 2025/12/06 Update
Added Inscribe Epic Runes.
Added Great Intelligence and Inscribe Epic Runes as Runecaster epic bons feats.
Changed Runecaster epic bonus feat progression to 1 every 4 levels past 10th.
Bardic PrCs should be able to take Lingering Song & Extra Music as general feats.
Forsakers can't use psionics, invocations, spellfire, shadowcasting, truenaming, binding, soulmelds or Supernatural Martial Maneuvers.
Fixed elven courtblade / ambidexterity bug.
Added more guardrails to prevent self-damage from onHit spells during PerformAttack().
Updated GetProperTarget()
Removed ableist slur.
RHD casters should work with JPM now.
Reworked Blood in the Water's effect icon.
Fixed Seize Item's VFX.
RHD casters should be able to enter Dragon Disciple.
Sharp Note doesn't step on Dragonfire Inspiration anymore.
2025-12-06 22:55:23 -05:00

202 lines
7.5 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
----------------
Metaphysical Claw
psi_pow_metaclaw
----------------
29/10/05 by Stratovarius
*/ /** @file
Metaphysical Claw
Psychometabolism
Level: Psychic warrior 1
Manifesting Time: 1 standard action
Range: Personal
Target: You
Duration: 1 min./level
Power Points: 1
Metapsionics: Extend
If you have a claw attack (either from an actual natural weapon or from an
effect such as claws of the beast) or a bite attack (which could be a
natural bite attack or one you gain by means of the power bite of the wolf),
you can use this power to provide your natural weapons a +1 enhancement
bonus on attack rolls and damage rolls.
Augment: If you spend 4 additional power points, this powers duration
increases to 1 hour per level.
In addition, for every 4 additional power points you spend, this
power improves the natural weapons enhancement bonus on attack
rolls and damage rolls by 1.
*/
#include "psi_inc_psifunc"
#include "psi_inc_pwresist"
#include "psi_spellhook"
#include "prc_alterations"
// Cleanup function for Metaphysical Claw virtual enhancements
void MetaphysicalClawCleanup(object oManifester, object oTarget, int nSpellID, int nBeatsRemaining)
{
if(!((nBeatsRemaining-- == 0) ||
PRCGetDelayedSpellEffectsExpired(nSpellID, oTarget, oManifester) ||
PRCGetHasEffect(EFFECT_TYPE_POLYMORPH, oTarget))
)
{
// Schedule next check
DelayCommand(6.0f, MetaphysicalClawCleanup(oManifester, oTarget, nSpellID, nBeatsRemaining));
}
// Power expired - clean up variables
else
{
DeleteLocalInt(oTarget, "PRC_NAT_WEAPON_ENHANCE");
DeleteLocalFloat(oTarget, "PRC_NAT_WEAPON_ENH_DUR");
}
}
void main()
{
if (!PsiPrePowerCastCode())
{
return;
}
object oManifester = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
struct manifestation manif =
EvaluateManifestation(oManifester, oTarget,
PowerAugmentationProfile(4,
4, PRC_UNLIMITED_AUGMENTATION
),
METAPSIONIC_EXTEND
);
if(manif.bCanManifest)
{
int nBonus = 1 + manif.nTimesAugOptUsed_1;
object oLClaw = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oTarget);
object oRClaw = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oTarget);
object oBite = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eVis = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
itemproperty ipBonus = ItemPropertyEnhancementBonus(nBonus);
float fDuration = (manif.nTimesAugOptUsed_1 == 0 ? 60.0f : HoursToSeconds(1)) * manif.nManifesterLevel;
if(manif.bExtend) fDuration *= 2;
// Check for natural weapons - both physical and virtual
int bHasNaturalWeapon = FALSE;
int bHasVirtualWeapon = FALSE;
// Check physical slots
if(GetIsObjectValid(oLClaw) || GetIsObjectValid(oRClaw) || GetIsObjectValid(oBite))
{
bHasNaturalWeapon = TRUE;
}
// ALWAYS check for virtual secondary weapons
if(array_exists(oTarget, ARRAY_NAT_SEC_WEAP_RESREF))
{
bHasVirtualWeapon = TRUE;
bHasNaturalWeapon = TRUE;
}
// Must have a natural attack
if(!bHasNaturalWeapon)
{
FloatingTextStrRefOnCreature(16826656, oManifester, FALSE);
return;
}
// Apply enhancement to physical weapons
if(GetIsObjectValid(oLClaw))
AddItemProperty(DURATION_TYPE_TEMPORARY, ipBonus, oLClaw, fDuration);
if(GetIsObjectValid(oRClaw))
AddItemProperty(DURATION_TYPE_TEMPORARY, ipBonus, oRClaw, fDuration);
if(GetIsObjectValid(oBite))
AddItemProperty(DURATION_TYPE_TEMPORARY, ipBonus, oBite, fDuration);
// Apply enhancement to virtual weapons
if(bHasVirtualWeapon)
{
// Store enhancement on the creature for the virtual weapon system
SetLocalInt(oTarget, "PRC_NAT_WEAPON_ENHANCE", nBonus);
SetLocalFloat(oTarget, "PRC_NAT_WEAPON_ENH_DUR", fDuration);
// Start cleanup monitor - similar to Bite of the Wolf
DelayCommand(6.0f,
MetaphysicalClawCleanup(oManifester, oTarget, manif.nSpellID, FloatToInt(fDuration) / 6));
}
// Do VFX
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(2.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDur, oTarget, fDuration);
}
}
/*void main()
{
Spellcast Hook Code
Added 2004-11-02 by Stratovarius
If you want to make changes to all powers,
check psi_spellhook to find out more
*/
/* if (!PsiPrePowerCastCode())
{
// If code within the PrePowerCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
object oManifester = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
struct manifestation manif =
EvaluateManifestation(oManifester, oTarget,
PowerAugmentationProfile(4,
4, PRC_UNLIMITED_AUGMENTATION
),
METAPSIONIC_EXTEND
);
if(manif.bCanManifest)
{
int nBonus = 1 + manif.nTimesAugOptUsed_1;
object oLClaw = GetItemInSlot(INVENTORY_SLOT_CWEAPON_L, oTarget);
object oRClaw = GetItemInSlot(INVENTORY_SLOT_CWEAPON_R, oTarget);
object oBite = GetItemInSlot(INVENTORY_SLOT_CWEAPON_B, oTarget);
effect eDur = EffectVisualEffect(VFX_DUR_CESSATE_POSITIVE);
effect eVis = EffectVisualEffect(VFX_IMP_PULSE_NEGATIVE);
itemproperty ipBonus = ItemPropertyEnhancementBonus(nBonus);
float fDuration = (manif.nTimesAugOptUsed_1 == 0 ? 60.0f : HoursToSeconds(1)) * manif.nManifesterLevel;
if(manif.bExtend) fDuration *= 2;
// Must have a natural attack
if(!(GetIsObjectValid(oLClaw) || GetIsObjectValid(oRClaw) || GetIsObjectValid(oBite)))
{
// "Target does not posses a natural attack!"
FloatingTextStrRefOnCreature(16826656, oManifester, FALSE);
return;
}
// Add the enhancement bonus
AddItemProperty(DURATION_TYPE_TEMPORARY, ipBonus, oLClaw, fDuration);
AddItemProperty(DURATION_TYPE_TEMPORARY, ipBonus, oRClaw, fDuration);
AddItemProperty(DURATION_TYPE_TEMPORARY, ipBonus, oBite, fDuration);
// Do VFX
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
DelayCommand(1.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
DelayCommand(2.0, SPApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget));
SPApplyEffectToObject(DURATION_TYPE_INSTANT, eDur, oTarget, fDuration);
}// end if - Successfull manifestation
} */