//69_onactivateitem
//Place this script in the OnActivateItem event in the
//module's properties, used in conjuntion with the henchman bleeding
//option in 69_hen_death
//69MEH69 Sep2004
#include "69_hench_lib"
void main()
{
 object oPC = GetItemActivator();
 object oTarget = GetItemActivatedTarget();
 string sTag = GetTag(oTarget);
 object oItem = GetItemActivated();
 string sItem = GetTag(oItem);
 object oArea = GetArea(oTarget);

 if(sItem == "HenchmanHealKit")
 {
  if(GetIsHenchmanDying(oTarget))
  {
   SendMessageToPC(oPC, "Healing Kit Used");
   ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_HEALING_S, FALSE), oTarget);
   SetLocalInt(oArea, "nCHP" +sTag, 2);
  }
  else
   SendMessageToPC(oPC, "This henchman is not dying");
 }

 if(sItem == "HenchmanLevelupTool")
 {
  if(HenchmanCheck69(oTarget, oPC))
  {
   int nHenchXP = GetLocalInt(oTarget, "HENCH_XP");
   SetLocalInt(oTarget, "HENCH_XP", nHenchXP + 2000);
   nHenchXP = GetLocalInt(oTarget, "HENCH_XP");
   string sHenchXP = IntToString(nHenchXP);
   string sHenchName = GetName(oTarget);
   SendMessageToPC(oPC, sHenchName + " received 2000 experience points.");
   SendMessageToPC(oPC, sHenchName + " has " + sHenchXP + " experience points.");
   if(HenchXPCheck69(oTarget))
   {
     LevelUpHenchman69(oTarget, oPC);
   }
  }
  else
   SendMessageToPC(oPC, "This is not your henchman.");
 }
}