GetBaseItemType

From NWN Lexicon



Contents

[edit] GetBaseItemType(object)

Determines the basic template for the item specified.

int GetBaseItemType(
    object oItem
);

[edit] Parameters

oItem

Item to be analyzed.


[edit] Description

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



[edit] Remarks

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

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


[edit] Version

1.22

[edit] 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!!");
    }
}

[edit] See Also

functions: 

GetLastWeaponUsed

constants: 

BASE_ITEM_* Constants

events: 

OnUnAcquireItem Event



 author: Jody Fletcher, editor: Jasperre
 

Personal tools
Categories