// v2.2.0 - New script for new Corpse code.
//::////////////////////////////////////////////////////////////////////////////
//:: FileName:  hark_onply_acq
//::////////////////////////////////////////////////////////////////////////////
/*
   This will need to be added to the On Player Aquire Item Event Hook of your
  module. The easiest way to do this is to add the following block of code to
  either the preEvent or postEvent hook located in the "hc_inc_on_acq" script.

  It should look something like this.

int preEvent()
{
  object oItem = GetModuleItemAcquired();
  string sTag = GetTag(oItem);
  if (GetIsObjectValid(oItem) && sTag == "hark_o0_corp_tok")
    { ExecuteScript("hark_onply_acq", GetModuleItemAcquiredBy()); }
  return 1;
}

*/
//::////////////////////////////////////////////////////////////////////////////
#include "hark_i0_henlvl"
//://///////////////////////////////////////////////////////////////////////////
void main()
{
  if (!GetLocalInt(GetObjectByTag(HS_VARS_OBJ), HS_VAR_DROP_DC)) { return; }
  object oTok = GetModuleItemAcquired();
  object oPoss = GetItemPossessor(oTok);
  object oPC = GetModuleItemAcquiredBy();
  object oOwner = GetLocalObject(oTok, "Owner");
  object oCorpse = GetLocalObject(oOwner, HS_HEN_D_CORPSE);
  if (GetTag(oTok) != HS_CORP_TOK) { return; }
  Debug("Name of item lost: " + GetName(oTok));
  Debug("Name of item possessor: " + GetName(oPoss));
  Debug("Name of item dropper: " + GetName(oPC));
  Debug("Name of item owner: " + GetName(oOwner));
  // Remove the Corpse to simulate it was picked up.
  if (GetIsObjectValid(oOwner) && GetIsObjectValid(oPoss) && GetIsObjectValid(oCorpse))
    { HenchRemoveCorpse(oOwner, oCorpse); }
}
//://///////////////////////////////////////////////////////////////////////////
