[]
public static final int PERIOD_COMP_RECRUITING = 0;	 
public static final int PERIOD_COMPETITION = 1;		 
public static final int PERIOD_COMP_RESULTS = 2;	 Wv
public static final int PERIOD_SEAL_VALIDATION = 3;	 L

sIĥ͂܂ j18:00
public static final int PERIOD_START_HOUR = 18;	 18:00
public static final int PERIOD_START_MINS = 00;	
public static final int PERIOD_START_DAY = Calendar.MONDAY;	2

// The quest event and seal validation periods last for approximately one week
// with a 1 hour "interval" period sandwiched between them.
public static final int PERIOD_MINOR_LENGTH = 3600000;		1 -- ԂƏWv
public static final int PERIOD_MAJOR_LENGTH = 604800000 - PERIOD_MINOR_LENGTH;

	̌j܂ŁAƉ߂
	private final int getDaysToPeriodChange() 
    {
		int numDays = _calendar.get(Calendar.DAY_OF_WEEK) - PERIOD_START_DAY;

		if (numDays < 0) 
			return 0 - numDays;
        
        return 7 - numDays;


		ΐ؋y	݂̗j
		PQRSTUV	_calendar.get(Calendar.DAY_OF_WEEK)
		QQQQQQQ	PERIOD_START_DAY
		-1OPQRST	numDays
		@OPQRST	numDays
		PVUTSRQ	(7 - numDays)  return
	}

    protected void setCalendarForNextPeriodChange() 
    {
        // Calculate the number of days until the next period
        // A period starts at 18:00 pm (local time), like on official servers.
        switch (getCurrentPeriod())
        {
        	ԁEL
            case PERIOD_SEAL_VALIDATION:
            case PERIOD_COMPETITION:
                int daysToChange = getDaysToPeriodChange();	̃sIh͉ォH
                
				ΐ؋y	݂̗j
				VUTSRQP	daysToChange

				_calendar Ɏ̃sIhiԁEWvԁj̎n܂Zbg
                ݎjłPWFOOȑOȂÂPWFOOZbg
                ݎjłPWFOOȌȂȀŤĵPWFOOZbg oO
                ȊO̗jȀŤĵPWFOOZbg oO

				ǈā
				OcaɃZ[u`calendar` ߂Ă΁APɃZbg

                if (daysToChange == 7)
                	if (_calendar.get(Calendar.HOUR_OF_DAY) < PERIOD_START_HOUR)
                		daysToChange = 0;
                	else if (_calendar.get(Calendar.HOUR_OF_DAY) == PERIOD_START_HOUR && _calendar.get(Calendar.MINUTE) < PERIOD_START_MINS)
                		daysToChange = 0;
                
                // Otherwise...
                if (daysToChange > 0)
                    _calendar.add(Calendar.DATE, daysToChange);
                
                _calendar.set(Calendar.HOUR_OF_DAY, PERIOD_START_HOUR);
                _calendar.set(Calendar.MINUTE, PERIOD_START_MINS);
                break;

			ԁEWv
            case PERIOD_COMP_RECRUITING:
            case PERIOD_COMP_RESULTS:
				PԌZbg
                _calendar.add(Calendar.MILLISECOND, PERIOD_MINOR_LENGTH);
                break;
        }
    }
    
	protected class SevenSignsPeriodChange implements Runnable
	{
        public void run() 
        {
            /* 
             * Remember the period check here refers to the period just ENDED!
             */
            final int periodEnded = getCurrentPeriod();
            ----------------
            _activePeriod++;
            ----------------
            
	        switch (periodEnded) 
	        { 
	        	ԏI  ԊJn
	            case PERIOD_COMP_RECRUITING: // Initialization
                    
                    // Start the Festival of Darkness cycle.
                    SevenSignsFestival.getInstance().startFestivalManager();                
                    
                    // Send message that Competition has begun.
                    sendMessageToAll(SystemMessage.QUEST_EVENT_PERIOD_BEGUN);
	                break;
	                
	            ԏI  WvԊJn
	            case PERIOD_COMPETITION: // Results Calculation
                    
	                // Send message that Competition has ended.
	                sendMessageToAll(SystemMessage.QUEST_EVENT_PERIOD_ENDED);
	                
	                int compWinner = getCabalHighestScore();				
	                
	                // Schedule a stop of the festival engine.
	                SevenSignsFestival.getInstance().getFestivalManagerSchedule().cancel(false);
	                
                    calcNewSealOwners();
                    
                    switch (compWinner)
                    {
                    	case CABAL_DAWN:
                    		sendMessageToAll(SystemMessage.DAWN_WON);
                    		break;
                    	case CABAL_DUSK:
                    		sendMessageToAll(SystemMessage.DUSK_WON);
                    		break;
                    }

                    _previousWinner = compWinner;
	                break;
	                
	            WvԏI  LԊJn
	            case PERIOD_COMP_RESULTS: // Seal Validation
                    
                    // Perform initial Seal Validation set up.
                    initializeSeals();
                    
                    // Send message that Seal Validation has begun.
                    sendMessageToAll(SystemMessage.SEAL_VALIDATION_PERIOD_BEGUN);
                    
                    _log.info("SevenSigns: The " + getCabalName(_previousWinner) + " have won the competition with " + getCurrentScore(_previousWinner) + " points!");
	                break;			

	            LԏI  ԊJn
	            case PERIOD_SEAL_VALIDATION: // Reset for New Cycle
                    
	                // Ensure a cycle restart when this period ends.
                    _activePeriod = PERIOD_COMP_RECRUITING;

	                // Send message that Seal Validation has ended.
	                sendMessageToAll(SystemMessage.SEAL_VALIDATION_PERIOD_ENDED);
	                
	                // Reset all data
	                resetPlayerData();
	                resetSeals();

                    // Reset all Festival-related data and remove any unused blood offerings.
                    // NOTE: A full update of Festival data in the database is also performed.
                    SevenSignsFestival.getInstance().resetFestivalData(false);
	                
	                _dawnStoneScore = 0;
	                _duskStoneScore = 0;
	                
	                _dawnFestivalScore = 0;
	                _duskFestivalScore = 0;
	                
	                _currentCycle++;
	                break;
	        }
	    	// [L2J_JP ADD START]
	        removeNecropolisAndCatacomb();
	        spawnNecropolisAndCatacomb();
	    	// [L2J_JP ADD END]

	        // Make sure all Seven Signs data is saved for future use.
	        saveSevenSignsData(null, true);
	        
            teleLosingCabalFromDungeons(getCabalShortName(getCabalHighestScore()));

            SignsSky ss = new SignsSky();
	        
	        for (L2PcInstance player : L2World.getInstance().getAllPlayers())
	            player.sendPacket(ss);
	        
            spawnSevenSignsNPC();

            _log.info("SevenSigns: The " + getCurrentPeriodName() + " period has begun!");
	        
            ̃sIh̓vZ
            setCalendarForNextPeriodChange();
            
            ̃sIhփ^C}[Zbg
	        SevenSignsPeriodChange sspc = new SevenSignsPeriodChange();
	        ThreadPoolManager.getInstance().scheduleGeneral(sspc, getMilliToPeriodChange());
	    }
	}
------------------------------------------------------------------------------------------------------
fobOFJ_[\
		System.out.println("SevenSigns._calendar="
    +        _calendar.get(Calendar.YEAR)
    + "/" + (_calendar.get(Calendar.MONTH) + 1)
    + "/" +  _calendar.get(Calendar.DATE)
    + " " +  _calendar.get(Calendar.HOUR_OF_DAY)
    + ":" +  _calendar.get(Calendar.MINUTE)
    + ":" +  _calendar.get(Calendar.SECOND));

		SimpleDateFormat dfm = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss (E)");
		System.out.println("SevenSigns._calendar=" + dfm.format(_calendar.getTime().getTime()));

		System.exit(0);
------------------------------------------------------------------------------------------------------
