From NWN Lexicon
Jump to navigationJump to search

IPGetItemHasItemOnHitPropertySubType(object, int)

Checks if an item has a specified onhit subtype itemproperty.

int IPGetItemHasItemOnHitPropertySubType(
    object oTarget,
    int nSubType



Item to check whether has the subtype on hit property.


Subtype to check for.


Returns TRUE if an item has ITEM_PROPERTY_ON_HIT and the specified nSubType

possible values for nSubType can be taken from IPRP_ONHIT.2da
popular ones:
5 - Daze 19 - ItemPoison 24 - Vorpal


Returns TRUE if the item has the specified OnHit property subtype, otherwise it returns FALSE, including on error.

I recommend using this program to view your .2da files, the NWN Explorer, which can be downloaded here:


If you have HotU installed, you should always open the HotU data. If you don't have HotU, but you do have SoU, you should always open the SoU data. Otherwise, you must use the NWN data. First, check if the patch has the IPRP_ONHIT.2da file in it (open your data's patch section, open the file called patch.bif or something similar (e.g. xp2patch.bif), game data, and that is where you should find it. If it isn't there, it means it hasn't been updated in a patch, and you should look in the data section mentioned before.

Following the above procedure will ensure that you ALWAYS view the more recent version of the .2da file, provided that your patch of NWN is up-to-date.

Please note that older versions of the NWN Explorer might not look in the patch files, so it is recommended that you download the latest version.


#include " x2_inc_itemprop "




<nowiki>#include "x2_inc_itemprop"
//Return TRUE in a conversation if the PC speaker's equipped
//weapon has the OnHit - Vorpal property.

int StartingConditional()
object oPC=GetPCSpeaker();

object oItem=GetItemInSlot(INVENTORY_SLOT_RIGHTHAND, oPC);

if (!GetIsObjectValid(oItem)) return FALSE;

return IPGetItemHasItemOnHitPropertySubType(oItem, 24);

See Also



 author: Lilac Soul