40 lines
1.3 KiB
Plaintext
40 lines
1.3 KiB
Plaintext
////////////////////////////////////////////////////////////////////////////////
|
|
// Sentinel Column Heartbeat
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
#include "x0_i0_spells"
|
|
void main()
|
|
{
|
|
object oMe=OBJECT_SELF;
|
|
int nC=1;
|
|
object oPC=GetNearestObject(OBJECT_TYPE_CREATURE,oMe,nC);
|
|
float fDist=GetDistanceBetween(oMe,oPC);
|
|
effect eBeam=EffectBeam(VFX_BEAM_BLACK,oMe,BODY_NODE_CHEST);
|
|
effect eVis=EffectVisualEffect(VFX_DUR_ULTRAVISION);
|
|
int bInvis;
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eVis,oMe,5.8);
|
|
while(oPC!=OBJECT_INVALID&&fDist<=10.0)
|
|
{ // check nearby targets
|
|
bInvis=FALSE;
|
|
if (GetHasSpellEffect(SPELL_IMPROVED_INVISIBILITY, oPC) == TRUE)
|
|
{
|
|
RemoveAnySpellEffects(SPELL_IMPROVED_INVISIBILITY, oPC);
|
|
bInvis=TRUE;
|
|
}
|
|
else
|
|
if (GetHasSpellEffect(SPELL_INVISIBILITY, oPC) == TRUE)
|
|
{
|
|
RemoveAnySpellEffects(SPELL_INVISIBILITY, oPC);
|
|
bInvis=TRUE;
|
|
}
|
|
if (bInvis==TRUE)
|
|
{ // beam effect
|
|
ApplyEffectToObject(DURATION_TYPE_TEMPORARY,eBeam,oPC,3.0);
|
|
SendMessageToPC(oPC,"Something in the area dispelled your invisibility.");
|
|
} // beam effect
|
|
nC++;
|
|
oPC=GetNearestObject(OBJECT_TYPE_CREATURE,oMe,nC);
|
|
fDist=GetDistanceBetween(oMe,oPC);
|
|
} // check nearby targets
|
|
|
|
}
|