
function handleExperienceMessage(%task, %type, %param, %xp)
{
   if (%task.isMarkedComplete() == true)
   {
      tsModifyResource($Resource::Experience, %xp, true);

      %object = %param.getId(0);
      SendProductionToClient(%object, %xp@" experience");
   }
}

function BuildGazeboXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 5);
}
function BuildChurchXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 5);
}
function BuildBarbershopXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 5);
}
function BuildGranaryXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 5);
}

function BuildHotelXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 10);
}

function BuildBlackSmithXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 8);
}

function BuildRanchXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 5);
}

function BuildSaloonXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 5);
}

function BuildGeneralStoreXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 5);
}

function BuildSheriffsOfficeXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 8);
}

function BuildTowerTrisXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 4);
}

function BuildWindMillXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 5);
}

function BuildTownhallXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 15);
}

function BuildOuthouseXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 3);
}
function BuildFountainXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 3);
}
function BuildTownbellXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 3);
}
function BuildStatueXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 3);
}
function BuildWelcomesignXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 3);
}
function BuildCemeteryXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 5);
}
function BuildFlowerpotXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 3);
}
function BuildWaterTowerXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 4);
}
function BuildTradingpostXP::onMessage(%this, %type, %param)
{
   Parent::onMessage(%this, %type, %param);
   handleExperienceMessage(%this, %type, %param, 5);
}