PRC8/nwn/nwnprc/trunk/newspellbook/moi_mld_lghtgnhn.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

42 lines
1.9 KiB
Plaintext

/*
Lightning Gauntlets Hands Bind
Your lightning gauntlets settle firmly around your hands. When you grip a weapon, electricity courses up its length and crackles at its tip. A lingering scent of ozone clings to you.
You can add the electricity damage dealt by lightning gauntlets to one attack per round made with a handheld weapon.
*/
#include "moi_inc_moifunc"
void main()
{
int nEvent = GetRunningEvent();
object oMeldshaper = OBJECT_SELF;
object oItem;
int nEssentia = GetEssentiaInvested(oMeldshaper, MELD_LIGHTNING_GAUNTLETS);
// We aren't being called from any event, instead from EvalPRCFeats
if(nEvent == FALSE)
{
if(!TakeMoveAction(oMeldshaper)) return;
oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oMeldshaper);
IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), 60.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING);
AddEventScript(oItem, EVENT_ITEM_ONHIT, "moi_mld_lghtgnhn", TRUE, FALSE);
}
else if(nEvent == EVENT_ITEM_ONHIT)
{
oItem = GetSpellCastItem();
object oTarget = PRCGetSpellTargetObject();
if(DEBUG) DoDebug("moi_mld_lghtgnhn: OnHit:\n"
+ "oMeldshaper = " + DebugObject2Str(oMeldshaper) + "\n"
+ "oItem = " + DebugObject2Str(oItem) + "\n"
+ "oTarget = " + DebugObject2Str(oTarget) + "\n"
);
ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectDamage(d6(nEssentia+1), DAMAGE_TYPE_ELECTRICAL), oTarget);
// Remove the temporary OnHitCastSpell: Unique
RemoveEventScript(oItem, EVENT_ITEM_ONHIT, "moi_mld_lghtgnhn", TRUE, FALSE);
RemoveSpecificProperty(oItem, ITEM_PROPERTY_ONHITCASTSPELL, IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 0, 1, "", 1, DURATION_TYPE_TEMPORARY);
}// end if - Running OnHit event
}