Enable re-entry at Training Zone instance.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<instance id="224" maxWorlds="80" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
|
<instance id="224" maxWorlds="80" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/instance.xsd">
|
||||||
<time duration="60" empty="0" />
|
<time duration="60" empty="5" />
|
||||||
<locations>
|
<locations>
|
||||||
<enter type="FIXED">
|
<enter type="FIXED">
|
||||||
<location x="-49550" y="17189" z="-3016" />
|
<location x="-49550" y="17189" z="-3016" />
|
||||||
|
@@ -20,7 +20,6 @@ import java.util.Arrays;
|
|||||||
|
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.enums.ChatType;
|
import org.l2jmobius.gameserver.enums.ChatType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.InstanceManager;
|
|
||||||
import org.l2jmobius.gameserver.model.Location;
|
import org.l2jmobius.gameserver.model.Location;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.WorldObject;
|
import org.l2jmobius.gameserver.model.WorldObject;
|
||||||
@@ -175,28 +174,7 @@ public class TrainingZone extends AbstractInstance
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (huntingZone.isSoloInstance())
|
enterInstance(player, npc, huntingZone.getInstanceId());
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
switch (event)
|
switch (event)
|
||||||
{
|
{
|
||||||
@@ -822,8 +800,8 @@ public class TrainingZone extends AbstractInstance
|
|||||||
@Override
|
@Override
|
||||||
public void onInstanceEnter(Player player, Instance instance)
|
public void onInstanceEnter(Player player, Instance instance)
|
||||||
{
|
{
|
||||||
startEvent(player);
|
instance.setParameter("BATTLEZONE", false);
|
||||||
player.getInstanceWorld().setDuration(60);
|
player.sendPacket(new ExSendUIEvent(player, false, false, (int) (instance.getRemainingTime() / 1000), 0, NpcStringId.TIME_LEFT));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -879,14 +857,6 @@ public class TrainingZone extends AbstractInstance
|
|||||||
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
player.sendPacket(new TimedHuntingZoneExit(player.getVariables().getInt(PlayerVariables.LAST_HUNTING_ZONE_ID, 0)));
|
||||||
removeBuffs(player);
|
removeBuffs(player);
|
||||||
instance.getParameters().remove("TRAINIG_AREA_TELEPORT");
|
instance.getParameters().remove("TRAINIG_AREA_TELEPORT");
|
||||||
instance.finishInstance();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startEvent(Player player)
|
|
||||||
{
|
|
||||||
final Instance instance = player.getInstanceWorld();
|
|
||||||
instance.setParameter("BATTLEZONE", false);
|
|
||||||
player.sendPacket(new ExSendUIEvent(player, false, false, Math.min(3600, (int) (instance.getRemainingTime() / 1000)), 0, NpcStringId.TIME_LEFT));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeBuffs(Creature ch)
|
private void removeBuffs(Creature ch)
|
||||||
|
Reference in New Issue
Block a user