{
isInDefense = true;
}
if((clan == null || clan.getHasCastle() == 0) && !isInDefense)
{
sendPacket(Msg.ActionFail, new Die(activeChar));
return;
}
Castle castle = activeChar.getCastle();
loc = MapRegion.getTeleToCastle(activeChar);
if(castle.getFunction(ResidenceFunction.RESTORE_EXP) != null)
{
activeChar.restoreExp(castle.getFunction(ResidenceFunction.RESTORE_EXP).getLevel());
}
break;
case TO_FORTRESS:
isInDefense = false;
if(siege != null && siege.checkIsDefender(clan))
{
isInDefense = true;
}
if((clan == null || clan.getHasFortress() == 0) && !isInDefense)
{
sendPacket(Msg.ActionFail, new Die(activeChar));
return;
}
Fortress fort = activeChar.getFortress();
loc = MapRegion.getTeleToFortress(activeChar);
if(fort.getFunction(ResidenceFunction.RESTORE_EXP) != null)
{
activeChar.restoreExp(fort.getFunction(ResidenceFunction.RESTORE_EXP).getLevel());
}
break;
case TO_SIEGEHQ:
SiegeClan siegeClan = null;
if(siege != null)
{
siegeClan = siege.getAttackerClan(clan);
}
else if(TerritorySiege.checkIfInZone(activeChar))
{
siegeClan = TerritorySiege.getSiegeClan(clan);
}
if(siegeClan == null || siegeClan.getHeadquarter() == null)
{
sendPacket(Msg.IF_A_BASE_CAMP_DOES_NOT_EXIST_RESURRECTION_IS_NOT_POSSIBLE, new Die(activeChar));
return;
}
loc = MapRegion.getTeleToHeadquarter(activeChar);
break;
case AGATHION: