PRC8/nwn/nwnprc/trunk/newspellbook/true_utr_sezitem.nss
Jaysyn904 6ec137a24e Updated AMS marker feats
Updated AMS marker feats.  Removed arcane & divine marker feats.  Updated Dread Necromancer for epic progression. Updated weapon baseitem models.  Updated new weapons for crafting & npc equip.
 Updated prefix.  Updated release archive.
2024-02-11 14:01:05 -05:00

82 lines
2.6 KiB
Plaintext

/*
----------------
Seize Item
true_utr_sezitem
----------------
17/8/06 by Stratovarius
*/ /** @file
Seize Item
Level: Crafted Tool 5
Range: 30 feet
Target: One Object
Duration: Instantaneous
Spell Resistance: Yes
Metautterances: None
You speak a word to make an object your own, forcing it out of the hands of its owner, if necessary.
This utterance brings an object within range to your hand. If it is possessed by another creature,
you must make a disarm attempt to gain the item.
*/
#include "true_inc_trufunc"
#include "true_utterhook"
//#include "prc_alterations"
void main()
{
/*
Spellcast Hook Code
Added 2006-7-19 by Stratovarius
If you want to make changes to all utterances
check true_utterhook to find out more
*/
if (!TruePreUtterCastCode())
{
// If code within the PreUtterCastHook (i.e. UMD) reports FALSE, do not run this spell
return;
}
// End of Spell Cast Hook
object oTrueSpeaker = OBJECT_SELF;
object oTarget = PRCGetSpellTargetObject();
oTarget = CraftedToolTarget(oTrueSpeaker, oTarget);
struct utterance utter = EvaluateUtterance(oTrueSpeaker, oTarget, METAUTTERANCE_NONE, LEXICON_CRAFTED_TOOL);
if(utter.bCanUtter)
{
// This is done so Speak Unto the Masses can read it out of the structure
utter.nPen = GetTrueSpeakPenetration(oTrueSpeaker);
int nSRCheck = PRCDoResistSpell(oTrueSpeaker, GetItemPossessor(oTarget), utter.nPen);
// If there is no possessor
if (GetItemPossessor(oTarget) == OBJECT_INVALID)
{
// Copy it
CopyItem(oTarget, oTrueSpeaker, FALSE);
MyDestroyObject(oTarget); // Make sure the item does get destroyed
}
else if (!nSRCheck) // There is a possessor, so roll SR
{
int nDisarmDC = GetLevelByClass(CLASS_TYPE_TRUENAMER, oTrueSpeaker) + GetAbilityModifier(ABILITY_INTELLIGENCE, oTrueSpeaker) + d20();
int nOppose = GetAttackBonus(oTrueSpeaker, GetItemPossessor(oTarget), oTarget) + d20();
if (nDisarmDC >= nOppose && GetIsCreatureDisarmable(GetItemPossessor(oTarget)) && !GetPRCSwitch(PRC_PNP_DISARM))
{
// Copy it
CopyItem(oTarget, oTrueSpeaker, FALSE);
MyDestroyObject(oTarget); // Make sure the item does get destroyed
}
}
// Impact Effects
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_DUR_FLOATING_DISK), GetLocation(oTarget));
}// end if - Successful utterance
}