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

49 lines
1.9 KiB
Plaintext

#include "prc_sp_func"
void main()
{
int nEvent = GetRunningEvent();
object oInitiator = OBJECT_SELF;
object oItem;
// We aren't being called from any event, perform setup
if(nEvent == FALSE)
{
oItem = GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oInitiator);
// Has to be a melee weapon
if(GetWeaponRanged(oItem))
{
FloatingTextStringOnCreature("You must use a melee weapon for this ability", oInitiator, FALSE);
return;
}
if(GetLocalInt(oInitiator, "JPM_Quickening_Strike_Expended"))
{
FloatingTextStringOnCreature("*Quickening Strike Already Expended*", oInitiator, FALSE);
return;
}
// Expend class ability
SetLocalInt(oInitiator, "JPM_Quickening_Strike_Expended", TRUE);
FloatingTextStringOnCreature("* Quickening Strike Expended *", oInitiator, FALSE);
// The OnHit
IPSafeAddItemProperty(oItem, ItemPropertyOnHitCastSpell(IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 1), 12.0, X2_IP_ADDPROP_POLICY_KEEP_EXISTING, FALSE, FALSE);
AddEventScript(oItem, EVENT_ITEM_ONHIT, "tob_jpm_qukstr", TRUE, FALSE);
}
// We're being called from the OnHit eventhook, so deal the damage
else if(nEvent == EVENT_ITEM_ONHIT)
{
oItem = GetSpellCastItem();
//Add autoquicken II feat for 6 seconds
itemproperty ipAutoQuicken = ItemPropertyBonusFeat(IP_CONST_JPM_AUTO_QUICKEN);
FloatingTextStringOnCreature("* Quickening Strike Hit *", oInitiator, FALSE);
AddItemProperty(DURATION_TYPE_TEMPORARY, ipAutoQuicken, oItem, 6.0f);
// Cleaning
RemoveSpecificProperty(oItem, ITEM_PROPERTY_ONHITCASTSPELL, IP_CONST_ONHIT_CASTSPELL_ONHIT_UNIQUEPOWER, 0, 1, "", -1, DURATION_TYPE_TEMPORARY);
RemoveEventScript(oItem, EVENT_ITEM_ONHIT, "tob_jpm_qukstr", TRUE, FALSE);
}
}