Posted December 03, 2016
I have a script for a custom passive feat. It is supposed to start passive regeneration of 1 hit point every 18 seconds. However instead of healing one hit point every 18 seconds it heals the 1st hit point after 18 seconds and then the next one second later. Then it waits another 18 seconds for the next and 1 second for the next. Here is a copy of the script:
void main()
{
object oPC = GetLastPCRested();
object oTarget = OBJECT_SELF;
int iSWhisp = GetLevelByClass(64, OBJECT_SELF);
int iSWarr = GetLevelByClass(67,OBJECT_SELF);
int iCaster = iSWhisp+iSWarr;
int iBonus;
float fDur = 18.0f;
if (iCaster >=14)
{
iBonus = 2;
}
else
{
iBonus = 1;
}
effect eEff = EffectRegenerate(iBonus, fDur);
effect eEff1 = EffectImmunity(IMMUNITY_TYPE_FEAR);
effect eEffect1 = EffectLinkEffects(eEff,eEff1);
if (iCaster >= 7)
{
eEffect1 = SupernaturalEffect(eEffect1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect1, oTarget, HoursToSeconds(72));
SetEffectSpellId(eEffect1, 71639);
return;
}
else
{
eEff1 = SupernaturalEffect(eEff1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEff1, oTarget, HoursToSeconds(72));
SetEffectSpellId(eEff1, 71639);
return;
}
}
Can anyone tell me why it is behaving like this and how I can get it to heal only once every 18 seconds?
Thank you in advance.
void main()
{
object oPC = GetLastPCRested();
object oTarget = OBJECT_SELF;
int iSWhisp = GetLevelByClass(64, OBJECT_SELF);
int iSWarr = GetLevelByClass(67,OBJECT_SELF);
int iCaster = iSWhisp+iSWarr;
int iBonus;
float fDur = 18.0f;
if (iCaster >=14)
{
iBonus = 2;
}
else
{
iBonus = 1;
}
effect eEff = EffectRegenerate(iBonus, fDur);
effect eEff1 = EffectImmunity(IMMUNITY_TYPE_FEAR);
effect eEffect1 = EffectLinkEffects(eEff,eEff1);
if (iCaster >= 7)
{
eEffect1 = SupernaturalEffect(eEffect1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEffect1, oTarget, HoursToSeconds(72));
SetEffectSpellId(eEffect1, 71639);
return;
}
else
{
eEff1 = SupernaturalEffect(eEff1);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eEff1, oTarget, HoursToSeconds(72));
SetEffectSpellId(eEff1, 71639);
return;
}
}
Can anyone tell me why it is behaving like this and how I can get it to heal only once every 18 seconds?
Thank you in advance.
No posts in this topic were marked as the solution yet. If you can help, add your reply