Initial upload
Initial upload
This commit is contained in:
37
_module/nss/spell_slots_sc.nss
Normal file
37
_module/nss/spell_slots_sc.nss
Normal file
@@ -0,0 +1,37 @@
|
||||
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;
|
||||
}
|
Reference in New Issue
Block a user