// v2.0.0 -
//::////////////////////////////////////////////////////////////////////////////
//:: FileName:  hark_d_cost_max
//::////////////////////////////////////////////////////////////////////////////
/*
   Text appears if the PC has enough gold to level the henchman to the highest
  level currently allowed. Assumes GetCanLevel has already been checked.
*/
//::////////////////////////////////////////////////////////////////////////////
#include "hark_i0_generic"
//::////////////////////////////////////////////////////////////////////////////
int StartingConditional()
{
  int LVL_LAG = GetLocalInt(GetObjectByTag(HS_VARS_OBJ), HS_VAR_LVL_LAG);
  int LVL_MAX = GetLocalInt(GetObjectByTag(HS_VARS_OBJ), HS_VAR_LVL_MAX);
  int nHitDie = GetHitDice(GetRealMaster()) - LVL_LAG;
  if (nHitDie > LVL_MAX) { nHitDie = LVL_MAX; }
  if (nHitDie < 1) { nHitDie = 1; }
  int nCost = GetLocalInt(GetObjectByTag(HS_VARS_OBJ), HS_VAR_CST_LVL);
  if (nCost < 1) { nCost = 1; }
  int nHireCost = nCost * nHitDie;
  if (GetGold(GetRealMaster()) >= nHireCost)
    {
     SetCustomToken(3726, IntToString(nHireCost));
     SetLocalInt(OBJECT_SELF, "HireCost", nHireCost);
     return TRUE;
    }
  return FALSE;
}
//::////////////////////////////////////////////////////////////////////////////
