#include "inc_arenapc"

void main()
{
    object oPC = GetPCSpeaker();
    object oCreature = ArenaSummon("cs1_arcanearcher");
    int iPCLevel = GetLevelByPosition(1, oPC) + GetLevelByPosition(2, oPC) + GetLevelByPosition(3, oPC);
    int iLevelUp = 1;

    while (iLevelUp < iPCLevel)
    {
        if (iLevelUp == 1 || iLevelUp == 4 || iLevelUp == 6) iLevelUp = LevelUpHenchman(oCreature, CLASS_TYPE_WIZARD, TRUE, PACKAGE_WIZARDGENERALIST);
        else if (iLevelUp > 7 && iLevelUp < 18) iLevelUp = LevelUpHenchman(oCreature, CLASS_TYPE_ARCANE_ARCHER, TRUE, PACKAGE_ARCANE_ARCHER);
        else iLevelUp = LevelUpHenchman(oCreature, CLASS_TYPE_RANGER, TRUE, GetCreatureStartingPackage(oCreature));
    }

    EquipNPC(oCreature, iLevelUp);

    SendMessageToPC(oPC, GetName(oCreature) + "'s level = Ranger " + IntToString(GetLevelByClass(CLASS_TYPE_RANGER, oCreature)) + ", Wizard " + IntToString(GetLevelByClass(CLASS_TYPE_WIZARD, oCreature)) + ", Arcane Archer " + IntToString(GetLevelByClass(CLASS_TYPE_ARCANE_ARCHER, oCreature)));
}

