NWNDS/nwn_dark_sun/air_cleric.nss

25 lines
730 B
Plaintext
Raw Normal View History

// Use x2_it_example as a base for building more complicated items, that is items
// that will fire a script on more than one event
#include "x2_inc_switches"
void main()
{
int nEvent =GetUserDefinedItemEventNumber();
object oPC;
object oItem;
// * This code runs when the item is equipped
// * Note that this event fires PCs only
if (nEvent ==X2_ITEM_EVENT_EQUIP)
{
oPC = GetPCItemLastEquippedBy();
oItem = GetPCItemLastEquipped();
// If the don't have air domain, unequip the item
if(!GetHasFeat(FEAT_AIR_DOMAIN_POWER, oPC))
{
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oPC, ActionUnequipItem(oItem));
}
}
}