X2CastOnItemWasAllowed(object)

This function return TRUE if the last casted spell can be cast to any item.

int X2CastOnItemWasAllowed(
    object oItem
);

Parameters

oItem

Unused parameter, function don't take it into an account. Feel free to pass there any object, even OBJECT_INVALID.


Description

This function return TRUE if the last casted spell can be cast to any item. Returns FALSE if the spell was cast on an item but is prevented from being cast there by its corresponding entry in des_crft_spells.2da.

It should be called in spell scripts because this functions count with last casted spell so anywhere else, the result could be wrong.



Remarks

oItem parameter is unused.

Also this function uses 2da lookup.


Requirements

#include "x2_inc_spellhook"


Version

???

See Also

functions:  GetSpellId | X2PreSpellCastCode | Get2daString
categories:  Get Data Functions | Spells Functions


author: ShaDoOoW, editor: Mistress