//::///////////////////////////////////////////////
#include "nw_i0_tool"

void main()
{
  object oPC = GetPCSpeaker();
  AssignCommand(OBJECT_SELF,ActionPlayAnimation(ANIMATION_FIREFORGET_DRINK));
  AssignCommand(OBJECT_SELF,ActionPlayAnimation(ANIMATION_LOOPING_PAUSE_DRUNK,1.0f,240.0f));
  AddJournalQuestEntry("cavelings",10,oPC);

  int nNext = 1;
  object oCaveling = GetNearestObjectByTag("NW_GOLFLESH",oPC);

  while (GetIsObjectValid(oCaveling))
  {
    if (GetDistanceBetween(OBJECT_SELF,oCaveling) <= 150.0f)
    {
      ApplyEffectToObject(DURATION_TYPE_PERMANENT,EffectVisualEffect(VFX_DUR_MIND_AFFECTING_DISABLED),oCaveling);
    }
    nNext = nNext + 1;
    oCaveling = GetNearestObjectByTag("NW_GOLFLESH",oPC,nNext);
  }
}
