Amon_PRC8/_module/nss/enterinc.nss

49 lines
919 B
Plaintext
Raw Normal View History

2025-04-03 19:00:46 -04:00
void DecrementTalentIndex(int iIndex, object oPC)
{
int iDecrementIndex;
talent tSpell;
talent tFeat;
tSpell = TalentSpell(iIndex);
tFeat = TalentFeat(iIndex);
if (GetIsTalentValid(tSpell))
{
if (GetHasSpell(GetIdFromTalent(tSpell), oPC))
{
for (iDecrementIndex = 1; iDecrementIndex < 20; iDecrementIndex++)
{
DecrementRemainingSpellUses(oPC, GetIdFromTalent(tSpell));
if(!GetHasSpell(GetIdFromTalent(tSpell), oPC))
iDecrementIndex=20;
}
}
}
if (GetIsTalentValid(tFeat))
{
if (GetHasFeat(GetIdFromTalent(tFeat), oPC))
{
for (iDecrementIndex = 1; iDecrementIndex < 20; iDecrementIndex++)
{
DecrementRemainingFeatUses(oPC, GetIdFromTalent(tFeat));
if(!GetHasFeat(GetIdFromTalent(tFeat), oPC))
iDecrementIndex=20;
}
}
}
}
void KillSpells(object oPC, location oPCLoc)
{
int iIndex;
for (iIndex = 1; iIndex < 1000; iIndex++)
{
DecrementTalentIndex(iIndex, oPC);
}
DecrementRemainingSpellUses(oPC,SPELL_ALL_SPELLS);
}