Files
HeroesStone_PRC8/_module/nss/spelloverride.nss
Jaysyn904 1eefc84201 Initial Commit
Initial Commit.
2025-09-14 15:40:46 -04:00

34 lines
1.1 KiB
Plaintext

#include "prc_x2_itemprop"
#include "prc_inc_spells"
void main()
{
float fLvl;
object oItem = PRCGetSpellCastItem();
int nSpell = PRCGetSpellId();
int nLvl = StringToInt(Get2DAString("spells","innate",nSpell));
if (nLvl==0) fLvl = 0.5;
else fLvl = IntToFloat(nLvl);
fLvl = GetLocalFloat(oItem,"CurrentLvl")-fLvl;
if (GetTag(oItem)=="storering")
{
int nIPCast = IPGetIPConstCastSpellFromSpellID(nSpell);
itemproperty ipTest = ItemPropertyCastSpell(nIPCast,IP_CONST_CASTSPELL_NUMUSES_0_CHARGES_PER_USE);
SetItemCharges(oItem,3);
itemproperty ipTmp = GetFirstItemProperty(oItem);
while (GetIsItemPropertyValid(ipTmp))
{
if (GetItemPropertyType(ipTmp) == GetItemPropertyType(ipTest))
if (GetItemPropertySubType(ipTmp) == GetItemPropertySubType(ipTest))
{
RemoveItemProperty(oItem,ipTmp);
SetLocalFloat(oItem,"CurrentLvl",fLvl);
return;
}
ipTmp = GetNextItemProperty(oItem);
}
}
}