- Katılım
- 21 Kasım 2023
- Mesajlar
- 125
Kod:
void CGameServerDlg::TempleEventTimer()
{
uint32 nHour = g_localTime.tm_hour;
uint32 nMinute = g_localTime.tm_min;
if (m_nTempleEventRemainSeconds > 0)
m_nTempleEventRemainSeconds--;
if (pTempleEvent.ActiveEvent == -1)
{
for (int i = 0; i < CHAOS_EVENT_COUNT; i++)
{
if (nHour == m_nChaosTime && nMinute == 0)
{
pTempleEvent.ActiveEvent = TEMPLE_EVENT_CHAOS;
pTempleEvent.ZoneID = ZONE_CHAOS_DUNGEON;
m_nTempleEventRemainSeconds = 600; // 10 minutes
TempleEventStart();
break;
}
}
for (int i = 0; i < BORDER_DEFENSE_WAR_EVENT_COUNT; i++)
{
if (nHour == m_nBorderDefenseWarTime && nMinute == 0)
{
pTempleEvent.ActiveEvent = TEMPLE_EVENT_BORDER_DEFENCE_WAR;
pTempleEvent.ZoneID = ZONE_BORDER_DEFENSE_WAR;
m_nTempleEventRemainSeconds = 600; // 10 minutes
TempleEventStart();
break;
}
}
}
else if (pTempleEvent.ActiveEvent != -1)
{
if (pTempleEvent.ActiveEvent == TEMPLE_EVENT_CHAOS)
{
for(int i = 0; i < CHAOS_EVENT_COUNT; i++)
{
if (nHour == m_nChaosTime
&& nMinute == 11
&& !pTempleEvent.isActive) {
m_nTempleEventRemainSeconds = 0;
pTempleEvent.LastEventRoom = 1;
pTempleEvent.isActive = true;
TempleEventStart(); // Set RemainSeconds to zero
TempleEventTeleportUsers();
TempleEventSummonChaosCubes();
break;
}
else if (nHour == m_nChaosTime
&& nMinute == 12
&& !pTempleEvent.isAttackable) {
pTempleEvent.isAttackable = true;
break;
}
else if (nHour == m_nChaosTime
&& nMinute == 32
&& pTempleEvent.isActive) {
TempleEventFinish();
break;
}
}
}
else if (pTempleEvent.ActiveEvent == TEMPLE_EVENT_BORDER_DEFENCE_WAR)
{
for(int i = 0; i < BORDER_DEFENSE_WAR_EVENT_COUNT; i++)
{
if (nHour == m_nBorderDefenseWarTime
&& nMinute == 42
&& !pTempleEvent.isActive)
{
m_nTempleEventRemainSeconds = 0;
pTempleEvent.LastEventRoom = 1;
pTempleEvent.isActive = true;
TempleEventStart(); // Set RemainSeconds to zero
TempleEventTeleportUsers();
break;
}
else if (nHour == (m_nBorderDefenseWarTime + 1)
&& nMinute == 2
&& pTempleEvent.isActive)
{
TempleEventFinish();
break;
}
}
}
}
}
View hidden content is available for registered users!