28 lines
1.1 KiB
Plaintext
28 lines
1.1 KiB
Plaintext
#include "x4_inc_functions"
|
|
void main()
|
|
{
|
|
object oPC = GetExitingObject();
|
|
AssignCommand(oPC, RestoreCameraFacing());
|
|
|
|
//compare the time of entering the estate with the time of leaving to determine if buffs are applicable
|
|
int nEnterTime = GetLocalInt(oPC, "TimeEntered");
|
|
int nTimeResting = CurrentDateTime() - nEnterTime;
|
|
effect eBuff;
|
|
if (nTimeResting >= 2) //2 hours required for buffs
|
|
{
|
|
//remove the earlier instance of this buff and reapply it
|
|
effect eEffect = GetFirstEffect(oPC);
|
|
while (GetIsEffectValid(eEffect))
|
|
{
|
|
if (GetLocalString(GetEffectCreator(eEffect), "House") != "") RemoveEffect(oPC, eEffect);
|
|
eEffect = GetNextEffect(oPC);
|
|
}
|
|
|
|
eBuff = EffectSavingThrowIncrease(SAVING_THROW_ALL, 1);
|
|
eBuff = EffectLinkEffects(eBuff, EffectTemporaryHitpoints(GetMaxHitPoints(oPC)/10));
|
|
eBuff = EffectLinkEffects(eBuff, EffectACIncrease(1));
|
|
eBuff = SupernaturalEffect(eBuff);
|
|
AssignCommand(OBJECT_SELF, ApplyEffectToObject(DURATION_TYPE_TEMPORARY, eBuff, oPC, 3600.0)); //1 real-time hour buff
|
|
}
|
|
}
|