Project update.

This commit is contained in:
MobiusDev
2015-12-31 23:53:41 +00:00
parent e0d681a17e
commit ad2bcd79be
4084 changed files with 83696 additions and 86998 deletions

View File

@ -0,0 +1,95 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager.tasks;
import java.util.Calendar;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
/**
* Four Sepulchers change attack time task.
* @author xban1x
*/
public final class FourSepulchersChangeAttackTimeTask implements Runnable
{
@Override
public void run()
{
final FourSepulchersManager manager = FourSepulchersManager.getInstance();
manager.setIsEntryTime(false);
manager.setIsWarmUpTime(false);
manager.setIsAttackTime(true);
manager.setIsCoolDownTime(false);
manager.locationShadowSpawns();
manager.spawnMysteriousBox(31921);
manager.spawnMysteriousBox(31922);
manager.spawnMysteriousBox(31923);
manager.spawnMysteriousBox(31924);
if (!manager.isFirstTimeRun())
{
manager.setWarmUpTimeEnd(Calendar.getInstance().getTimeInMillis());
}
long interval = 0;
// say task
if (manager.isFirstTimeRun())
{
for (double min = Calendar.getInstance().get(Calendar.MINUTE); min < manager.getCycleMin(); min++)
{
// looking for next shout time....
if ((min % 5) == 0)// check if min can be divided by 5
{
final Calendar inter = Calendar.getInstance();
inter.set(Calendar.MINUTE, (int) min);
ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersManagerSayTask(), inter.getTimeInMillis() - Calendar.getInstance().getTimeInMillis());
break;
}
}
}
else
{
ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersManagerSayTask(), 5 * 60400);
}
// searching time when attack time will be ended:
// counting difference between time when attack time ends and
// current time
// and then launching change time task
if (manager.isFirstTimeRun())
{
interval = manager.getAttackTimeEnd() - Calendar.getInstance().getTimeInMillis();
}
else
{
interval = Config.FS_TIME_ATTACK * 60000L;
}
manager.setChangeCoolDownTimeTask(ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeCoolDownTimeTask(), interval));
final ScheduledFuture<?> changeAttackTimeTask = manager.getChangeAttackTimeTask();
if (changeAttackTimeTask != null)
{
changeAttackTimeTask.cancel(true);
manager.setChangeAttackTimeTask(null);
}
}
}

View File

@ -0,0 +1,66 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager.tasks;
import java.util.Calendar;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
/**
* Four Sepulchers change cool down time task.
* @author xban1x
*/
public final class FourSepulchersChangeCoolDownTimeTask implements Runnable
{
@Override
public void run()
{
final FourSepulchersManager manager = FourSepulchersManager.getInstance();
manager.setIsEntryTime(false);
manager.setIsWarmUpTime(false);
manager.setIsAttackTime(false);
manager.setIsCoolDownTime(true);
manager.clean();
final Calendar time = Calendar.getInstance();
// one hour = 55th min to 55 min of next hour, so we check for this,
// also check for first launch
if (!manager.isFirstTimeRun() && (Calendar.getInstance().get(Calendar.MINUTE) > manager.getCycleMin()))
{
time.set(Calendar.HOUR, Calendar.getInstance().get(Calendar.HOUR) + 1);
}
time.set(Calendar.MINUTE, manager.getCycleMin());
if (manager.isFirstTimeRun())
{
manager.setIsFirstTimeRun(false);
}
final long interval = time.getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
manager.setChangeEntryTimeTask(ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeEntryTimeTask(), interval));
final ScheduledFuture<?> changeCoolDownTimeTask = manager.getChangeCoolDownTimeTask();
if (changeCoolDownTimeTask != null)
{
changeCoolDownTimeTask.cancel(true);
manager.setChangeCoolDownTimeTask(null);
}
}
}

View File

@ -0,0 +1,68 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager.tasks;
import java.util.Calendar;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
/**
* Four Sepulchers change entry time task.
* @author xban1x
*/
public final class FourSepulchersChangeEntryTimeTask implements Runnable
{
@Override
public void run()
{
final FourSepulchersManager manager = FourSepulchersManager.getInstance();
manager.setIsEntryTime(true);
manager.setIsWarmUpTime(false);
manager.setIsAttackTime(false);
manager.setIsCoolDownTime(false);
long interval = 0;
// if this is first launch - search time whFourSepulchersManager_inEntryTime = true;naFourSepulchersManager_inEntryTime = true;maen entry time will be
// ended:
// counting difference between time when entry time ends and current
// time
// and then launching change time task
if (manager.isFirstTimeRun())
{
interval = manager.getEntrytTimeEnd() - Calendar.getInstance().getTimeInMillis();
}
else
{
interval = Config.FS_TIME_ENTRY * 60000L; // else use stupid
// method
}
// launching saying process...
ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersManagerSayTask(), 0);
manager.setChangeWarmUpTimeTask(ThreadPoolManager.getInstance().scheduleEffect(new FourSepulchersChangeWarmUpTimeTask(), interval));
final ScheduledFuture<?> changeEntryTimeTask = manager.getChangeEntryTimeTask();
if (changeEntryTimeTask != null)
{
changeEntryTimeTask.cancel(true);
manager.setChangeEntryTimeTask(null);
}
}
}

View File

@ -0,0 +1,64 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager.tasks;
import java.util.Calendar;
import java.util.concurrent.ScheduledFuture;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
/**
* Four Sepulchers change warm up time task.
* @author xban1x
*/
public final class FourSepulchersChangeWarmUpTimeTask implements Runnable
{
@Override
public void run()
{
final FourSepulchersManager manager = FourSepulchersManager.getInstance();
manager.setIsEntryTime(true);
manager.setIsWarmUpTime(false);
manager.setIsAttackTime(false);
manager.setIsCoolDownTime(false);
long interval = 0;
// searching time when warmup time will be ended:
// counting difference between time when warmup time ends and
// current time
// and then launching change time task
if (manager.isFirstTimeRun())
{
interval = manager.getWarmUpTimeEnd() - Calendar.getInstance().getTimeInMillis();
}
else
{
interval = Config.FS_TIME_WARMUP * 60000L;
}
manager.setChangeAttackTimeTask(ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersChangeAttackTimeTask(), interval));
final ScheduledFuture<?> changeWarmUpTimeTask = manager.getChangeWarmUpTimeTask();
if (changeWarmUpTimeTask != null)
{
changeWarmUpTimeTask.cancel(true);
manager.setChangeWarmUpTimeTask(null);
}
}
}

View File

@ -0,0 +1,59 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager.tasks;
import java.util.Calendar;
import com.l2jmobius.Config;
import com.l2jmobius.gameserver.ThreadPoolManager;
import com.l2jmobius.gameserver.instancemanager.FourSepulchersManager;
/**
* Four Sepulchers manager say task.
* @author xban1x
*/
public final class FourSepulchersManagerSayTask implements Runnable
{
@Override
public void run()
{
if (FourSepulchersManager.getInstance().isAttackTime())
{
final Calendar tmp = Calendar.getInstance();
tmp.setTimeInMillis(Calendar.getInstance().getTimeInMillis() - FourSepulchersManager.getInstance().getWarmUpTimeEnd());
if ((tmp.get(Calendar.MINUTE) + 5) < Config.FS_TIME_ATTACK)
{
FourSepulchersManager.getInstance().managerSay((byte) tmp.get(Calendar.MINUTE)); // byte
// because
// minute
// cannot be
// more than
// 59
ThreadPoolManager.getInstance().scheduleGeneral(new FourSepulchersManagerSayTask(), 5 * 60000);
}
// attack time ending chat
else if ((tmp.get(Calendar.MINUTE) + 5) >= Config.FS_TIME_ATTACK)
{
FourSepulchersManager.getInstance().managerSay((byte) 90); // sending a unique id :D
}
}
else if (FourSepulchersManager.getInstance().isEntryTime())
{
FourSepulchersManager.getInstance().managerSay((byte) 0);
}
}
}

View File

@ -0,0 +1,32 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager.tasks;
import com.l2jmobius.gameserver.instancemanager.GrandBossManager;
/**
* @author xban1x
*/
public class GrandBossManagerStoreTask implements Runnable
{
@Override
public void run()
{
GrandBossManager.getInstance().storeMe();
}
}

View File

@ -0,0 +1,86 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager.tasks;
import java.util.logging.Level;
import java.util.logging.Logger;
import com.l2jmobius.gameserver.instancemanager.MailManager;
import com.l2jmobius.gameserver.model.L2World;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
import com.l2jmobius.gameserver.model.entity.Message;
import com.l2jmobius.gameserver.network.SystemMessageId;
import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
/**
* Message deletion task.
* @author xban1x
*/
public final class MessageDeletionTask implements Runnable
{
private static final Logger _log = Logger.getLogger(MessageDeletionTask.class.getName());
final int _msgId;
public MessageDeletionTask(int msgId)
{
_msgId = msgId;
}
@Override
public void run()
{
final Message msg = MailManager.getInstance().getMessage(_msgId);
if (msg == null)
{
return;
}
if (msg.hasAttachments())
{
try
{
final L2PcInstance sender = L2World.getInstance().getPlayer(msg.getSenderId());
if (sender != null)
{
msg.getAttachments().returnToWh(sender.getWarehouse());
sender.sendPacket(SystemMessageId.THE_MAIL_WAS_RETURNED_DUE_TO_THE_EXCEEDED_WAITING_TIME);
}
else
{
msg.getAttachments().returnToWh(null);
}
msg.getAttachments().deleteMe();
msg.removeAttachments();
final L2PcInstance receiver = L2World.getInstance().getPlayer(msg.getReceiverId());
if (receiver != null)
{
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_MAIL_WAS_RETURNED_DUE_TO_THE_EXCEEDED_WAITING_TIME);
// sm.addString(msg.getReceiverName());
receiver.sendPacket(sm);
}
}
catch (Exception e)
{
_log.log(Level.WARNING, getClass().getSimpleName() + ": Error returning items:" + e.getMessage(), e);
}
}
MailManager.getInstance().deleteMessageInDb(msg.getId());
}
}

View File

@ -0,0 +1,39 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager.tasks;
import com.l2jmobius.gameserver.instancemanager.HandysBlockCheckerManager;
/**
* Handys Block Checker penalty remove.
* @author xban1x
*/
public final class PenaltyRemoveTask implements Runnable
{
private final int _objectId;
public PenaltyRemoveTask(int id)
{
_objectId = id;
}
@Override
public void run()
{
HandysBlockCheckerManager.getInstance().removePenalty(_objectId);
}
}

View File

@ -0,0 +1,45 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager.tasks;
import com.l2jmobius.gameserver.instancemanager.WalkingManager;
import com.l2jmobius.gameserver.model.actor.L2Npc;
/**
* Task which starts npc movement.
* @author xban1x
*/
public final class StartMovingTask implements Runnable
{
final L2Npc _npc;
final String _routeName;
public StartMovingTask(L2Npc npc, String routeName)
{
_npc = npc;
_routeName = routeName;
}
@Override
public void run()
{
if (_npc != null)
{
WalkingManager.getInstance().startMoving(_npc, _routeName);
}
}
}

View File

@ -0,0 +1,34 @@
/*
* This file is part of the L2J Mobius project.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.l2jmobius.gameserver.instancemanager.tasks;
import com.l2jmobius.gameserver.instancemanager.GraciaSeedsManager;
/**
* Task which updates Seed of Destruction state.
* @author xban1x
*/
public final class UpdateSoDStateTask implements Runnable
{
@Override
public void run()
{
final GraciaSeedsManager manager = GraciaSeedsManager.getInstance();
manager.setSoDState(1, true);
manager.updateSodState();
}
}