Addition of Corroded Fields timed hunting zone.

Thanks to manax182.
This commit is contained in:
MobiusDevelopment
2021-06-29 23:23:36 +00:00
parent e5fb85bbf2
commit 2185cd4bdd
24 changed files with 341 additions and 17 deletions

View File

@@ -20,11 +20,14 @@ import java.util.concurrent.ScheduledFuture;
import org.l2jmobius.commons.concurrent.ThreadPool;
import org.l2jmobius.commons.util.Rnd;
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
import org.l2jmobius.gameserver.enums.TeleportWhereType;
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
import org.l2jmobius.gameserver.model.WorldObject;
import org.l2jmobius.gameserver.model.actor.Npc;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
import org.l2jmobius.gameserver.model.holders.SkillHolder;
import org.l2jmobius.gameserver.model.holders.TimedHuntingZoneHolder;
import org.l2jmobius.gameserver.model.instancezone.Instance;
import org.l2jmobius.gameserver.network.NpcStringId;
import org.l2jmobius.gameserver.network.serverpackets.ExSendUIEvent;
@@ -33,7 +36,7 @@ import org.l2jmobius.gameserver.network.serverpackets.huntingzones.TimedHuntingZ
import instances.AbstractInstance;
/**
* Written by Berezkin Nikolay, on 21.04.2021
* @author Berezkin Nikolay, Mobius
*/
public class TranscendentZone extends AbstractInstance
{
@@ -69,7 +72,36 @@ public class TranscendentZone extends AbstractInstance
{
if (event.startsWith("ENTER"))
{
enterInstance(player, npc, Integer.parseInt(event.split(" ")[1]));
final int zoneId = Integer.parseInt(event.split(" ")[1]);
final TimedHuntingZoneHolder huntingZone = TimedHuntingZoneData.getInstance().getHuntingZone(zoneId);
if (huntingZone == null)
{
return null;
}
if (huntingZone.isSoloInstance())
{
enterInstance(player, npc, huntingZone.getInstanceId());
}
else
{
Instance world = null;
for (Instance instance : InstanceManager.getInstance().getInstances())
{
if (instance.getTemplateId() == huntingZone.getInstanceId())
{
world = instance;
break;
}
}
if (world == null)
{
world = InstanceManager.getInstance().createInstance(huntingZone.getInstanceId(), player);
}
player.teleToLocation(huntingZone.getEnterLocation(), world);
}
}
else if (event.startsWith("FINISH"))
{

View File

@@ -14675,6 +14675,7 @@ public class PlayerInstance extends Playable
abortCast();
stopMove(null);
teleToLocation(MapRegionManager.getInstance().getTeleToLocation(this, TeleportWhereType.TOWN));
setInstance(null);
}
}
}, 60000, 60000);

View File

@@ -148,7 +148,7 @@ public class ExTimedHuntingZoneEnter implements IClientIncomingPacket
}
else // Transcendent zones.
{
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + instanceId, null, player);
QuestManager.getInstance().getQuest("TranscendentZone").notifyEvent("ENTER " + _zoneId, null, player);
}
}
else