#include "inc_misc_tools"
void PHB (object oPC);

void NotifyOfNewPlayer(object oEntering);

void main()
    {
    object oPC = GetEnteringObject();
	
    AddJournalQuestEntry("JRNL_XPCHART", 1, oPC, FALSE, FALSE, FALSE);
    AddJournalQuestEntry("JRNL_LA_BUYOFF", 1, oPC, FALSE, FALSE, FALSE);
	AddJournalQuestEntry("JRNL_PRC8", 1, oPC, FALSE, FALSE, FALSE);
	

    if (!GetXP(oPC))
        {
        StartingGold(oPC);
        }
    PHB(oPC);
    NotifyOfNewPlayer(oPC);
    }

void PHB (object oPC)
    {
    string sString;
    int i;
    for (i = 0; i<=13; i+=1)
        {
        sString = "Category" + Convert(i);
        AddJournalQuestEntry(sString,1,oPC,FALSE);
        }
    }

void NotifyOfNewPlayer(object oEntering)
    {
    object oPC = GetFirstPC();
    while(GetIsObjectValid(oPC))
        {
        if (oPC == GetFactionLeader(oPC))
            {
            if (oPC != oEntering)
                FloatingTextStringOnCreature(GetName(oEntering) + " is available. Level:" +IntToString(GetHitDice(oEntering)) ,oPC,FALSE);
            }
        if (GetIsDM(oPC))
            AssignCommand(oPC, PlaySound("as_cv_bell1"));
        oPC = GetNextPC();
        }
    SendMessageToAllDMs("A new player, "+GetName(oEntering)+" is in " + GetName(GetArea(oEntering)));
    }
