I have it on a trigger. So if they get close to the altar (about 7 meters) it fires off.
The script isn’t finished yet but here’s what I have. Right now it will always return a 0 so I am testing each implementation there before moving it to the right spot. I will try this though
#include "rest_inc"
void main()
{
object oPC = GetEnteringObject();
if (GetIsPC(oPC) == TRUE)
{
//This is a PC\
string sDeity = GetDeity(oPC);
string sShrine = GetTag(OBJECT_SELF);
int iDuration = 2880; /*24 Hours Game time = 48 mins real time */
int iPC = GetLocalInt(oPC, sShrine);
SendMessageToPC (oPC, "Entered Hold area at: " + IntToString(iPC));
if (GetMinuteTimeZero() <= GetLocalInt(oPC, sShrine) + iDuration) // i_TI_LastRest is 0 when the player enters the module
{
// Nothing will happen
SendMessageToPC (oPC, "MinZero Start: " + IntToString(iPC));
SendMessageToPC (oPC, "MinZero: " + IntToString(GetMinuteTimeZero()) + " HourZero: " + IntToString(GetHourTimeZero()));
SendMessageToPC (oPC, "You must wait " + IntToString(iDuration - (GetMinuteTimeZero() - iPC)) + " minutes(s) before this happens again.");
}
else
{
// Get the gods list
// 0 = Dp Nothing
// 1 = Heal
// 2 = Buff
// 3 = hurt
// 4 = Debuff
int iVi = GetLocalInt(OBJECT_SELF,"iVild");
int iAr = GetLocalInt(OBJECT_SELF,"iArawin");
int iGo = GetLocalInt(OBJECT_SELF,"iGofannon");
int iBr = GetLocalInt(OBJECT_SELF,"iBreve");
int iCe = GetLocalInt(OBJECT_SELF,"iCeridwen");
int iRi = GetLocalInt(OBJECT_SELF,"iRigia");
int iFl = GetLocalInt(OBJECT_SELF,"iFaithless");
int iLevel = GetLevelByPosition(1,oPC) + GetLevelByPosition(2,oPC) + GetLevelByPosition(3,oPC);
int iRoll = Random(4)+1;
effect eVis;
object oDeity;
// Check if since the last bump more than <iDuration> mins have passed.
SetLocalInt (oPC, sShrine, GetMinuteTimeZero());
if (sDeity == "Faithless")
{
switch (iFl)
{
case 1: //Heal
SendMessageToPC (oPC, "You feel the glory of " + sDeity + " flow through you.");
eVis = EffectVisualEffect(VFX_DUR_AURA_PULSE_CYAN_WHITE,FALSE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVis,oPC,3.0);
if (iRoll <3)
{
eVis = EffectHeal(iLevel*(iRoll+1));
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oPC,0.5);
}
break;
case 2: //Buff
SendMessageToPC (oPC, "You feel the glory of " + sDeity + " flow through you.");
eVis = EffectVisualEffect(VFX_DUR_AURA_PULSE_CYAN_WHITE,FALSE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVis,oPC,3.0);
if (iRoll <3)
{
eVis = EffectSavingThrowIncrease(SAVING_THROW_ALL,iRoll,SAVING_THROW_TYPE_ALL);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVis,oPC,300.0);
}
case 3: //Hurt
SendMessageToPC (oPC, "You feel the disaproval of " + sDeity + " wash over you.");
eVis = EffectVisualEffect(VFX_DUR_AURA_PULSE_CYAN_BLACK,FALSE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVis,oPC,3.0);
if (iRoll <3)
{
eVis = EffectDamage(iLevel*(iRoll+1),DAMAGE_TYPE_DIVINE);
ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oPC,0.5);
}
break;
case 4: //Debuff
break;
default: //Do Nothing
eVis = EffectVisualEffect(VFX_DUR_AURA_PULSE_CYAN_RED,FALSE);
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVis,oPC,3.0);
oDeity = GetObjectByTag("DeityTheSisters");
eVis = EffectDamage(iLevel*(iRoll+1),DAMAGE_TYPE_DIVINE);
//ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oPC,0.5);
//AssignCommand(oDeity,ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oPC,0.5));
//AssignCommand(oDeity,ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oPC,0.5)));
ActionDoCommand(ApplyEffectToObject(DURATION_TYPE_INSTANT,eVis,oPC,0.5));
SendMessageToPC (oPC, "DEBUG: Nothing happens.");
SendMessageToPC (oPC, "DEBUG: oDeity is: " + GetName(oDeity));
break;
}
}
}
}
//Not a PC so go away I guess
}