Initial upload.

Adding base PRC 4.19a files to repository.
This commit is contained in:
Jaysyn904
2022-10-07 13:51:24 -04:00
parent 646eb01834
commit 1662218bb4
22441 changed files with 1274376 additions and 0 deletions

34
trunk/smp/1.nss Normal file
View File

@@ -0,0 +1,34 @@
void WrapperDelayRemoval(float fDuration);
void CheckAndRemove(int nSpellId, int nTimesCast, object oTarget);
void main() // This would be the spell script.
{
float fDuration = 4.0; // fDuration = the duration of the tempoary effect
WrapperDelayRemoval(fDuration);// Put this at the end of all spell scripts with polymorph in
}
void WrapperDelayRemoval(float fDuration)
{
int nSpell = GetSpellId();
int nCastTimes = GetLocalInt(OBJECT_SELF, "TIMES_CAST" + IntToString(nSpell));
nCastTimes++; // Add one to cast times
SetLocalInt(OBJECT_SELF, "TIMES_CAST" + IntToString(nSpell), nCastTimes);
DelayCommand(fDuration, CheckAndRemove(nSpell, nCastTimes, OBJECT_SELF));
}
void CheckAndRemove(int nSpellId, int nTimesCast, object oTarget)
{
if(GetHasSpellEffect(nSpellId, oTarget) &&
GetLocalInt(oTarget, "TIMES_CAST" + IntToString(nSpellId)) == nTimesCast)
{
effect eCheck = GetFirstEffect(oTarget);
while(GetIsEffectValid(eCheck))
{
if(GetEffectSpellId(eCheck) == nSpellId)
{
RemoveEffect(oTarget, eCheck);
}
eCheck = GetNextEffect(oTarget);
}
}
}