/*
// Do a Fortitude Save check for the given DC
// - oCreature
// - nDC: Difficulty check
// - nSaveType: SAVING_THROW_TYPE_*
// - oSaveVersus
// Returns: 0 if the saving throw roll failed
// Returns: 1 if the saving throw roll succeeded
// Returns: 2 if the target was immune to the save type specified
// Note: If used within an Area of Effect Object Script (On Enter, OnExit, OnHeartbeat), you MUST pass
// GetAreaOfEffectCreator() into oSaveVersus!!
int FortitudeSave(object oCreature, int nDC, int nSaveType=SAVING_THROW_TYPE_NONE, object oSaveVersus=OBJECT_SELF)
*/
I need to use FortitudeSave() in two circumstances: onhitcast and onareaheartbeat.
How should I do for the first case? This way?
object oTarget = GetSpellTargetObject();
int iCheck = FortitudeSave(oTarget, 35, SAVING_THROW_TYPE_DISEASE);
if(iCheck == 0) DoAction();
And for the second? Like this?
object oTarget = GetFirstObjectInArea();
int iCheck;
while (GetIsObjectValid(oTarget))
{
if(GetIsPC(oTarget)
{
iCheck = FortitudeSave(oTarget, 35, SAVING_THROW_TYPE_DISEASE, GetAreaOfEffectCreator());
if(iCheck == 0) DoAction();
}
oTarget = GetNextObjectInArea();
}