#include "inc_arenapc"

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

    while (iLevelUp < iPCLevel)
    {
        if (iLevelUp > 5 && iLevelUp < 9) iLevelUp = LevelUpHenchman(oCreature, CLASS_TYPE_PALE_MASTER, TRUE);
        else if (iLevelUp > 9 && iLevelUp < 12) iLevelUp = LevelUpHenchman(oCreature, CLASS_TYPE_PALE_MASTER, TRUE);
        else if (iLevelUp > 12 && iLevelUp < 15) iLevelUp = LevelUpHenchman(oCreature, CLASS_TYPE_PALE_MASTER, TRUE);
        else if (iLevelUp > 15 && iLevelUp < 18) iLevelUp = LevelUpHenchman(oCreature, CLASS_TYPE_PALE_MASTER, TRUE);
        else if (iLevelUp == 19) iLevelUp = LevelUpHenchman(oCreature, CLASS_TYPE_PALE_MASTER, TRUE);
        else iLevelUp = LevelUpHenchman(oCreature, CLASS_TYPE_WIZARD, TRUE, GetCreatureStartingPackage(oCreature));
    }

    EquipNPC(oCreature, iLevelUp);

        SendMessageToPC(oPC, GetName(oCreature) + "'s level = Wizard " + IntToString(GetLevelByClass(CLASS_TYPE_WIZARD, oCreature)) + ", Pale Master " + IntToString(GetLevelByClass(CLASS_TYPE_PALE_MASTER, oCreature)));
}

