Files
PRC8/nwn/nwnprc/trunk/psionics/psi_pow_metaweap.nss
Jaysyn904 80070703b4 2025/11/20 Update
Updated epic swashbucker tlk.
Added notes on Martial Study.
Updated Shadow Servant to scale with Shadow Master level, per PnP.
Made Disciple of Baalzebul's CHA boost intrinsic.
Swarm of Arrows is an Eldritch Knight epic bonus feat.
Epic eldritch theurge is 11th level, not 21st level.
Updated Shadowdancer weapon proficiencies.
WP: Scythe was a usable feat for Warblade.
Gaseous Form added to iprp_spells.
Set Favoured Soul's Regen X Wounds spells to the correct spell level.
Updated Twinfiend to not suck.
Tweaked GetMaxPossibleHP for Undead & Constructs.
Updated PRCIsFlying() for newer CEP2 wings.
More fixes and updated for NUI levelup menu. (@Rakiov)
Added support for de-leveling AMS classes (@Rakiov)
Zakya Rakshasa have a claw & bite attack.
Added check to end grapples after target death.
Removed debug message in GetHighestSpellAvailableByDescriptor()
Monsters won't summon uncontrolled undead.
Added Signal Event to Luminous Armor.
Corrected Signal Event on Shield of Faith.
2025-11-20 21:36:52 -05:00

135 lines
4.7 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.

/** @file psi_pow_metaweap
Metaphysical Weapon
Metacreativity
Level: Psychic warrior 1
Manifesting Time: 1 standard action
Range: Touch
Target: Weapon touched
Duration: 1 min./level
Saving Throw: None
Power Resistance: No
Power Points: 1
Metapsionics: Extend
Metaphysical weapon gives a weapon a +1 enhancement bonus on attack rolls
and damage rolls.
Alternatively, you can affect up to 99 arrows, bolts, or bullets. The
projectiles must be of the same type, and they have to be together (in the
same stack).
You cant manifest this power on most natural weapons, including a psychic
warriors claw strike. This power does work on a weapon brought into being
by the graft weapon power.
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 weapons enhancement bonus on attack rolls and
damage rolls by 1.
@author Stratovarius
@date Created: Oct 29, 2005
@date Modified: Jul 3, 2006
*/
#include "psi_inc_psifunc"
#include "psi_inc_pwresist"
#include "psi_spellhook"
#include "prc_sp_func"
int DoPower(object oManifester, object oTarget, struct manifestation manif)
{
int nBonus = 1 + manif.nTimesAugOptUsed_1;
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;
// Determine if we targeted a weapon or a creature
if(GetObjectType(oTarget) == OBJECT_TYPE_CREATURE)
{
// It's a creature, target their primary weapon
oTarget = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oTarget);
}
// Validate that the target is a weapon or ammunition
int bIsWeapon = GetWeaponRanged(oTarget) || IPGetIsMeleeWeapon(oTarget);
int nBase = GetBaseItemType(oTarget);
int bIsAmmo = nBase == BASE_ITEM_ARROW || nBase == BASE_ITEM_BOLT || nBase == BASE_ITEM_BULLET;
if (!(bIsWeapon || bIsAmmo))
{
oTarget = OBJECT_INVALID;
}
/* // Make sure the target is either weapon or ammo
if(!(GetWeaponRanged(oTarget) || IPGetIsMeleeWeapon(oTarget) ||
GetBaseItemType(oTarget) == BASE_ITEM_ARROW ||
GetBaseItemType(oTarget) == BASE_ITEM_BOLT ||
GetBaseItemType(oTarget) == BASE_ITEM_BULLET
) )
oTarget = OBJECT_INVALID; */
// Make sure we have a valid target
if(!GetIsObjectValid(oTarget))
{
// "Target is not a weapon!"
FloatingTextStrRefOnCreature(16826667, oManifester, FALSE);
return TRUE;
}
// Add the enhancement bonus
AddItemProperty(DURATION_TYPE_TEMPORARY, ipBonus, oTarget, 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);
return TRUE; //Held charge is used if at least 1 touch from twinned power hits
}
void main()
{
if(!PsiPrePowerCastCode()) return;
object oManifester = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
struct manifestation manif;
int nEvent = GetLocalInt(oManifester, PRC_SPELL_EVENT); //use bitwise & to extract flags
if(!nEvent) //normal cast
{
manif =
EvaluateManifestation(oManifester, oTarget,
PowerAugmentationProfile(4,
4, PRC_UNLIMITED_AUGMENTATION
),
METAPSIONIC_EXTEND
);
if(manif.bCanManifest)
{
if(GetLocalInt(oManifester, PRC_SPELL_HOLD) && oManifester == oTarget)
{ //holding the charge, manifesting power on self
SetLocalSpellVariables(oManifester, 1); //change 1 to number of charges
SetLocalManifestation(oManifester, PRC_POWER_HOLD_MANIFESTATION, manif);
return;
}
DoPower(oManifester, oTarget, manif);
}
}
else
{
if(nEvent & PRC_SPELL_EVENT_ATTACK)
{
manif = GetLocalManifestation(oManifester, PRC_POWER_HOLD_MANIFESTATION);
if(DoPower(oManifester, oTarget, manif))
DecrementSpellCharges(oManifester);
}
}
}