Hello i have one question ,how i must change this code to set next siege date after 2 or 3 days ?
I want to have siege every 2-3 days but i don't know what to change , can anyone help me ?
private void setNextSiegeDate()
{
while (getCastle().getSiegeDate().getTimeInMillis() < Calendar.getInstance().getTimeInMillis())
{
if (getCastle().getSiegeDate().get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY && getCastle().getSiegeDate().get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY)
getCastle().getSiegeDate().set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
// from CT2.3 Castle sieges are on Sunday, but if server admins allow to set day of the siege
// than sieges can occur on Saturdays as well
if (getCastle().getSiegeDate().get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY && !Config.CL_SET_SIEGE_TIME_LIST.contains("day"))
getCastle().getSiegeDate().set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
// set the next siege day to the next weekend
getCastle().getSiegeDate().add(Calendar.DAY_OF_MONTH, 7);
}
if (!SevenSigns.getInstance().isDateInSealValidPeriod(getCastle().getSiegeDate()))
getCastle().getSiegeDate().add(Calendar.DAY_OF_MONTH, 7);
SystemMessage sm = new SystemMessage(SystemMessageId.S1_ANNOUNCED_SIEGE_TIME);
sm.addString(getCastle().getName());
Announcements.getInstance().announceToAll(sm);
_isRegistrationOver = false; // Allow registration for next siege
}
My initial plan was to port the Homunculus system from Live 502 to ClassicAden 502. But, when the interface for Homunculus is enabled, it has some hardcoded function that tries to load the dat files which leads to a crash since those files dont exist in ClassicAden. I was hoping to do some injection hoping, forcing the client to load the files.
Question
dsadas
Hello i have one question ,how i must change this code to set next siege date after 2 or 3 days ?
I want to have siege every 2-3 days but i don't know what to change , can anyone help me ?
private void setNextSiegeDate() { while (getCastle().getSiegeDate().getTimeInMillis() < Calendar.getInstance().getTimeInMillis()) { if (getCastle().getSiegeDate().get(Calendar.DAY_OF_WEEK) != Calendar.SATURDAY && getCastle().getSiegeDate().get(Calendar.DAY_OF_WEEK) != Calendar.SUNDAY) getCastle().getSiegeDate().set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY); // from CT2.3 Castle sieges are on Sunday, but if server admins allow to set day of the siege // than sieges can occur on Saturdays as well if (getCastle().getSiegeDate().get(Calendar.DAY_OF_WEEK) == Calendar.SATURDAY && !Config.CL_SET_SIEGE_TIME_LIST.contains("day")) getCastle().getSiegeDate().set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY); // set the next siege day to the next weekend getCastle().getSiegeDate().add(Calendar.DAY_OF_MONTH, 7); } if (!SevenSigns.getInstance().isDateInSealValidPeriod(getCastle().getSiegeDate())) getCastle().getSiegeDate().add(Calendar.DAY_OF_MONTH, 7); SystemMessage sm = new SystemMessage(SystemMessageId.S1_ANNOUNCED_SIEGE_TIME); sm.addString(getCastle().getName()); Announcements.getInstance().announceToAll(sm); _isRegistrationOver = false; // Allow registration for next siege }3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now