Zone related changes.
This commit is contained in:
@@ -426,7 +426,11 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
try
|
||||
{
|
||||
final L2RespawnZone zone = ZoneManager.getInstance().getZone(activeChar, L2RespawnZone.class);
|
||||
return zone != null ? getRestartRegion(activeChar, zone.getRespawnPoint((L2PcInstance) activeChar)).getSpawnLoc() : getMapRegion(activeChar).getSpawnLoc();
|
||||
if (zone != null)
|
||||
{
|
||||
return getRestartRegion(activeChar, zone.getRespawnPoint((L2PcInstance) activeChar)).getSpawnLoc();
|
||||
}
|
||||
return getMapRegion(activeChar).getSpawnLoc();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@@ -391,7 +391,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
case PVP:
|
||||
{
|
||||
if ((instance != null) && instance.isPvPInstance())
|
||||
if ((instance != null) && instance.isPvP())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -399,7 +399,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
case PEACE:
|
||||
{
|
||||
if ((instance != null) && instance.isPvPInstance())
|
||||
if ((instance != null) && instance.isPvP())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -4936,7 +4936,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (InstanceManager.getInstance().getInstance(getInstanceId()).isPvPInstance())
|
||||
if (InstanceManager.getInstance().getInstance(getInstanceId()).isPvP())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -6713,6 +6713,20 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
return getTemplate().getRace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final void setXYZ(int newX, int newY, int newZ)
|
||||
{
|
||||
final ZoneRegion oldZoneRegion = ZoneManager.getInstance().getRegion(this);
|
||||
final ZoneRegion newZoneRegion = ZoneManager.getInstance().getRegion(newX, newY);
|
||||
if (oldZoneRegion != newZoneRegion)
|
||||
{
|
||||
oldZoneRegion.removeFromZones(this);
|
||||
newZoneRegion.revalidateZones(this);
|
||||
}
|
||||
|
||||
super.setXYZ(newX, newY, newZ);
|
||||
}
|
||||
|
||||
public boolean isInDuel()
|
||||
{
|
||||
return false;
|
||||
|
@@ -1347,9 +1347,6 @@ public class L2Npc extends L2Character
|
||||
|
||||
ZoneManager.getInstance().getRegion(this).removeFromZones(this);
|
||||
|
||||
// Remove L2Object object from _allObjects of L2World
|
||||
// L2World.getInstance().removeObject(this);
|
||||
|
||||
return super.deleteMe();
|
||||
}
|
||||
|
||||
|
@@ -28,10 +28,6 @@ import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
|
||||
*/
|
||||
public abstract class L2Tower extends L2Npc
|
||||
{
|
||||
/**
|
||||
* Creates an abstract Tower.
|
||||
* @param template the tower template
|
||||
*/
|
||||
public L2Tower(L2NpcTemplate template)
|
||||
{
|
||||
super(template);
|
||||
|
@@ -405,9 +405,6 @@ public abstract class L2Vehicle extends L2Character
|
||||
|
||||
oldZoneRegion.removeFromZones(this);
|
||||
|
||||
// Remove L2Object object from _allObjects of L2World
|
||||
// L2World.getInstance().removeObject(this);
|
||||
|
||||
return super.deleteMe();
|
||||
}
|
||||
|
||||
|
@@ -270,7 +270,7 @@ public class TvTEvent
|
||||
{
|
||||
_TvTEventInstance = InstanceManager.getInstance().createDynamicInstance(Config.TVT_EVENT_INSTANCE_FILE);
|
||||
InstanceManager.getInstance().getInstance(_TvTEventInstance).setAllowSummon(false);
|
||||
InstanceManager.getInstance().getInstance(_TvTEventInstance).setPvPInstance(true);
|
||||
InstanceManager.getInstance().getInstance(_TvTEventInstance).setIsPvP(true);
|
||||
InstanceManager.getInstance().getInstance(_TvTEventInstance).setEmptyDestroyTime((Config.TVT_EVENT_START_LEAVE_TELEPORT_DELAY * 1000) + 60000L);
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@@ -86,7 +86,7 @@ public final class Instance
|
||||
private long _lastLeft = -1;
|
||||
private long _instanceStartTime = -1;
|
||||
private long _instanceEndTime = -1;
|
||||
private boolean _isPvPInstance = false;
|
||||
private boolean _isPvP = false;
|
||||
private boolean _showTimer = false;
|
||||
private boolean _isTimerIncrease = true;
|
||||
private String _timerText = "";
|
||||
@@ -171,18 +171,18 @@ public final class Instance
|
||||
* Returns true if entire instance is PvP zone
|
||||
* @return
|
||||
*/
|
||||
public boolean isPvPInstance()
|
||||
public boolean isPvP()
|
||||
{
|
||||
return _isPvPInstance;
|
||||
return _isPvP;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets PvP zone status of the instance
|
||||
* @param b
|
||||
* @param value
|
||||
*/
|
||||
public void setPvPInstance(boolean b)
|
||||
public void setIsPvP(boolean value)
|
||||
{
|
||||
_isPvPInstance = b;
|
||||
_isPvP = value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -573,7 +573,7 @@ public final class Instance
|
||||
a = n.getAttributes().getNamedItem("val");
|
||||
if (a != null)
|
||||
{
|
||||
setPvPInstance(Boolean.parseBoolean(a.getNodeValue()));
|
||||
setIsPvP(Boolean.parseBoolean(a.getNodeValue()));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@@ -198,7 +198,7 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
*/
|
||||
private boolean isAffected(L2Character character)
|
||||
{
|
||||
// Check instance Template Id
|
||||
// Check instance
|
||||
if (_instanceTemplateId > 0)
|
||||
{
|
||||
final InstanceWorld world = InstanceManager.getInstance().getWorld(character.getInstanceId());
|
||||
@@ -208,7 +208,14 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
}
|
||||
}
|
||||
|
||||
if ((character.getLevel() < _minLvl) || (character.getLevel() > _maxLvl) || !character.isInstanceTypes(_target))
|
||||
// Check lvl
|
||||
if ((character.getLevel() < _minLvl) || (character.getLevel() > _maxLvl))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// check obj class
|
||||
if (!character.isInstanceTypes(_target))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user