GetBaseItemType

From NWN Lexicon
Jump to: navigation, search



GetBaseItemType(object)

Determines the basic template for the item specified.

int GetBaseItemType(
    object oItem
);

Parameters

oItem

Item to be analyzed.


Description

Get the base item type (BASE_ITEM_*) of oItem.
Returns BASE_ITEM_INVALID if oItem is an invalid item.



Remarks

the BASE_ITEM_* constants are from the baseitems.2da file, and are merely the line number.

Note that a few are invalid - see the 2da, but noting that BASE_ITEM_SCROLL doesn't exist, instead, it is BASE_ITEM_SPELLSCROLL.


Version

1.22

Example

// If the item of tag "ITEM" in our possession is a shortsword, say so!
 
void main()
{
    // Get item
    object oItem = GetItemPossessedBy(OBJECT_SELF, "ITEM");
    if(GetBaseItemType(oItem) == BASE_ITEM_SHORTSWORD)
    {
        SpeakString("I've got a great shortsword!!");
    }
}

See Also

functions: 

GetLastWeaponUsed

constants: 

BASE_ITEM_* Constants

events: 

OnUnAcquireItem Event



 author: Jody Fletcher, editor: Jasperre