UW2_PRC8/_module/nss/spell_slots_sc.nss
Jaysyn904 5197ad9a4d Initial upload
Initial upload
2023-09-25 20:24:01 -04:00

38 lines
765 B
Plaintext

int GetBonusSpellCount(object oItem);
int StartingConditional()
{
int i = FALSE;
object o = GetPCSpeaker();
int nSlot = GetLocalInt(o, "CRAFT_SLOT");
object oCraft = GetItemInSlot(nSlot, o);
int nSpells = GetBonusSpellCount(oCraft);
if(nSpells >=4)
{
i = TRUE; //If the item has too many Bonus Spell Slots show this line
}
return i;
}
///////////////////////////////////////////////////////////////////////
//PROTOTYPE DEFINED
int GetBonusSpellCount(object oItem)
{
int n = 0;
int a = ITEM_PROPERTY_BONUS_SPELL_SLOT_OF_LEVEL_N;
itemproperty ip = GetFirstItemProperty(oItem);
while(GetIsItemPropertyValid(ip))
{
if(GetItemPropertyType(ip) == a)
{ n += 1; }
ip = GetNextItemProperty(oItem);
}
return n;
}