generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit.
This commit is contained in:
33
_module/nss/spelloverride.nss
Normal file
33
_module/nss/spelloverride.nss
Normal file
@@ -0,0 +1,33 @@
|
||||
#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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user