#include "x2_inc_switches"
void main()
{
int nEvent = GetUserDefinedItemEventNumber();
if (nEvent == X2_ITEM_EVENT_ACTIVATE)
{
object oTarget = GetItemActivatedTarget();
//Check to make sure the target is dead first
//Fire cast spell at event for the specified target
if (GetIsObjectValid(oTarget))
{
if (GetIsDead(oTarget))
{
//Declare major variables
int nHealed = GetMaxHitPoints(oTarget);
effect eRaise = EffectResurrection();
effect eHeal = EffectHeal(nHealed + 10);
effect eVis = EffectVisualEffect(VFX_IMP_RAISE_DEAD);
//Apply the heal, raise dead and VFX impact effect
ApplyEffectToObject(DURATION_TYPE_INSTANT, eRaise, oTarget);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eHeal, oTarget);
ApplyEffectAtLocation(DURATION_TYPE_INSTANT, eVis, GetLocation(oTarget));
}
}
}
}