Zone related changes.
This commit is contained in:
@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
public String getClosestTownName(L2Character activeChar)
|
||||
{
|
||||
final L2MapRegion region = getMapRegion(activeChar);
|
||||
|
||||
if (region == null)
|
||||
{
|
||||
return "Aden Castle Town";
|
||||
}
|
||||
|
||||
return region.getTown();
|
||||
return region == null ? "Aden Castle Town" : region.getTown();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
{
|
||||
try
|
||||
{
|
||||
final L2PcInstance player = ((L2PcInstance) activeChar);
|
||||
final L2PcInstance player = (L2PcInstance) activeChar;
|
||||
final L2MapRegion region = _regions.get(point);
|
||||
|
||||
if (region.getBannedRace().containsKey(player.getRace()))
|
||||
|
@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
}
|
||||
if (checkId(zoneId))
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
}
|
||||
|
||||
if ((zoneName != null) && !zoneName.isEmpty())
|
||||
@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2ArenaZone) temp);
|
||||
return (L2ArenaZone) temp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2OlympiadStadiumZone) temp);
|
||||
return (L2OlympiadStadiumZone) temp;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc
|
||||
public boolean canBeAttacked()
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress());
|
||||
return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoAttackable(L2Character attacker)
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan()));
|
||||
return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc
|
||||
// Set the target of the L2PcInstance player
|
||||
player.setTarget(this);
|
||||
}
|
||||
else if (interact)
|
||||
else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
if (isInsideZone(character))
|
||||
{
|
||||
// If the character can't be affected by this zone return
|
||||
if (_checkAffected)
|
||||
if (_checkAffected && !isAffected(character))
|
||||
{
|
||||
if (!isAffected(character))
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (_characterList.putIfAbsent(character.getObjectId(), character) == null)
|
||||
|
@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
public String getClosestTownName(L2Character activeChar)
|
||||
{
|
||||
final L2MapRegion region = getMapRegion(activeChar);
|
||||
|
||||
if (region == null)
|
||||
{
|
||||
return "Aden Castle Town";
|
||||
}
|
||||
|
||||
return region.getTown();
|
||||
return region == null ? "Aden Castle Town" : region.getTown();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
{
|
||||
try
|
||||
{
|
||||
final L2PcInstance player = ((L2PcInstance) activeChar);
|
||||
final L2PcInstance player = (L2PcInstance) activeChar;
|
||||
final L2MapRegion region = _regions.get(point);
|
||||
|
||||
if (region.getBannedRace().containsKey(player.getRace()))
|
||||
|
@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
}
|
||||
if (checkId(zoneId))
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
}
|
||||
|
||||
if ((zoneName != null) && !zoneName.isEmpty())
|
||||
@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2ArenaZone) temp);
|
||||
return (L2ArenaZone) temp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2OlympiadStadiumZone) temp);
|
||||
return (L2OlympiadStadiumZone) temp;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc
|
||||
public boolean canBeAttacked()
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress());
|
||||
return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoAttackable(L2Character attacker)
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan()));
|
||||
return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc
|
||||
// Set the target of the L2PcInstance player
|
||||
player.setTarget(this);
|
||||
}
|
||||
else if (interact)
|
||||
else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
if (isInsideZone(character))
|
||||
{
|
||||
// If the character can't be affected by this zone return
|
||||
if (_checkAffected)
|
||||
if (_checkAffected && !isAffected(character))
|
||||
{
|
||||
if (!isAffected(character))
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (_characterList.putIfAbsent(character.getObjectId(), character) == null)
|
||||
|
@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
public String getClosestTownName(L2Character activeChar)
|
||||
{
|
||||
final L2MapRegion region = getMapRegion(activeChar);
|
||||
|
||||
if (region == null)
|
||||
{
|
||||
return "Aden Castle Town";
|
||||
}
|
||||
|
||||
return region.getTown();
|
||||
return region == null ? "Aden Castle Town" : region.getTown();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
{
|
||||
try
|
||||
{
|
||||
final L2PcInstance player = ((L2PcInstance) activeChar);
|
||||
final L2PcInstance player = (L2PcInstance) activeChar;
|
||||
final L2MapRegion region = _regions.get(point);
|
||||
|
||||
if (region.getBannedRace().containsKey(player.getRace()))
|
||||
|
@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
}
|
||||
if (checkId(zoneId))
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
}
|
||||
|
||||
if ((zoneName != null) && !zoneName.isEmpty())
|
||||
@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2ArenaZone) temp);
|
||||
return (L2ArenaZone) temp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2OlympiadStadiumZone) temp);
|
||||
return (L2OlympiadStadiumZone) temp;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc
|
||||
public boolean canBeAttacked()
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress());
|
||||
return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoAttackable(L2Character attacker)
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan()));
|
||||
return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc
|
||||
// Set the target of the L2PcInstance player
|
||||
player.setTarget(this);
|
||||
}
|
||||
else if (interact)
|
||||
else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
if (isInsideZone(character))
|
||||
{
|
||||
// If the character can't be affected by this zone return
|
||||
if (_checkAffected)
|
||||
if (_checkAffected && !isAffected(character))
|
||||
{
|
||||
if (!isAffected(character))
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (_characterList.putIfAbsent(character.getObjectId(), character) == null)
|
||||
|
@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
public String getClosestTownName(L2Character activeChar)
|
||||
{
|
||||
final L2MapRegion region = getMapRegion(activeChar);
|
||||
|
||||
if (region == null)
|
||||
{
|
||||
return "Aden Castle Town";
|
||||
}
|
||||
|
||||
return region.getTown();
|
||||
return region == null ? "Aden Castle Town" : region.getTown();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
{
|
||||
try
|
||||
{
|
||||
final L2PcInstance player = ((L2PcInstance) activeChar);
|
||||
final L2PcInstance player = (L2PcInstance) activeChar;
|
||||
final L2MapRegion region = _regions.get(point);
|
||||
|
||||
if (region.getBannedRace().containsKey(player.getRace()))
|
||||
|
@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
}
|
||||
if (checkId(zoneId))
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
}
|
||||
|
||||
if ((zoneName != null) && !zoneName.isEmpty())
|
||||
@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2ArenaZone) temp);
|
||||
return (L2ArenaZone) temp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2OlympiadStadiumZone) temp);
|
||||
return (L2OlympiadStadiumZone) temp;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc
|
||||
public boolean canBeAttacked()
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress());
|
||||
return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoAttackable(L2Character attacker)
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan()));
|
||||
return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc
|
||||
// Set the target of the L2PcInstance player
|
||||
player.setTarget(this);
|
||||
}
|
||||
else if (interact)
|
||||
else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
if (isInsideZone(character))
|
||||
{
|
||||
// If the character can't be affected by this zone return
|
||||
if (_checkAffected)
|
||||
if (_checkAffected && !isAffected(character))
|
||||
{
|
||||
if (!isAffected(character))
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (_characterList.putIfAbsent(character.getObjectId(), character) == null)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
public String getClosestTownName(L2Character activeChar)
|
||||
{
|
||||
final L2MapRegion region = getMapRegion(activeChar);
|
||||
|
||||
if (region == null)
|
||||
{
|
||||
return "Aden Castle Town";
|
||||
}
|
||||
|
||||
return region.getTown();
|
||||
return region == null ? "Aden Castle Town" : region.getTown();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
{
|
||||
try
|
||||
{
|
||||
final L2PcInstance player = ((L2PcInstance) activeChar);
|
||||
final L2PcInstance player = (L2PcInstance) activeChar;
|
||||
final L2MapRegion region = _regions.get(point);
|
||||
|
||||
if (region.getBannedRace().containsKey(player.getRace()))
|
||||
|
@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
}
|
||||
if (checkId(zoneId))
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
}
|
||||
|
||||
if ((zoneName != null) && !zoneName.isEmpty())
|
||||
@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2ArenaZone) temp);
|
||||
return (L2ArenaZone) temp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2OlympiadStadiumZone) temp);
|
||||
return (L2OlympiadStadiumZone) temp;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc
|
||||
public boolean canBeAttacked()
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress());
|
||||
return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoAttackable(L2Character attacker)
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan()));
|
||||
return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc
|
||||
// Set the target of the L2PcInstance player
|
||||
player.setTarget(this);
|
||||
}
|
||||
else if (interact)
|
||||
else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
if (isInsideZone(character))
|
||||
{
|
||||
// If the character can't be affected by this zone return
|
||||
if (_checkAffected)
|
||||
if (_checkAffected && !isAffected(character))
|
||||
{
|
||||
if (!isAffected(character))
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (_characterList.putIfAbsent(character.getObjectId(), character) == null)
|
||||
|
@ -213,13 +213,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
public String getClosestTownName(L2Character activeChar)
|
||||
{
|
||||
final L2MapRegion region = getMapRegion(activeChar);
|
||||
|
||||
if (region == null)
|
||||
{
|
||||
return "Aden Castle Town";
|
||||
}
|
||||
|
||||
return region.getTown();
|
||||
return region == null ? "Aden Castle Town" : region.getTown();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -419,7 +413,7 @@ public final class MapRegionManager implements IGameXmlReader
|
||||
{
|
||||
try
|
||||
{
|
||||
final L2PcInstance player = ((L2PcInstance) activeChar);
|
||||
final L2PcInstance player = (L2PcInstance) activeChar;
|
||||
final L2MapRegion region = _regions.get(point);
|
||||
|
||||
if (region.getBannedRace().containsKey(player.getRace()))
|
||||
|
@ -357,7 +357,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
}
|
||||
if (checkId(zoneId))
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
LOGGER.config(getClass().getSimpleName() + ": Caution: Zone (" + zoneId + ") from file: " + f.getName() + " overrides previos definition.");
|
||||
}
|
||||
|
||||
if ((zoneName != null) && !zoneName.isEmpty())
|
||||
@ -669,7 +669,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2ArenaZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2ArenaZone) temp);
|
||||
return (L2ArenaZone) temp;
|
||||
}
|
||||
}
|
||||
|
||||
@ -692,7 +692,7 @@ public final class ZoneManager implements IGameXmlReader
|
||||
{
|
||||
if ((temp instanceof L2OlympiadStadiumZone) && temp.isCharacterInZone(character))
|
||||
{
|
||||
return ((L2OlympiadStadiumZone) temp);
|
||||
return (L2OlympiadStadiumZone) temp;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
@ -38,14 +38,14 @@ public abstract class L2Tower extends L2Npc
|
||||
public boolean canBeAttacked()
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress());
|
||||
return (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAutoAttackable(L2Character attacker)
|
||||
{
|
||||
// Attackable during siege by attacker only
|
||||
return ((attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(attacker.getClan()));
|
||||
return (attacker != null) && attacker.isPlayer() && (getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress() && getCastle().getSiege().checkIsAttacker(((L2PcInstance) attacker).getClan());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,13 +61,10 @@ public abstract class L2Tower extends L2Npc
|
||||
// Set the target of the L2PcInstance player
|
||||
player.setTarget(this);
|
||||
}
|
||||
else if (interact)
|
||||
else if (interact && isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
if (isAutoAttackable(player) && (Math.abs(player.getZ() - getZ()) < 100) && GeoEngine.getInstance().canSeeTarget(player, this))
|
||||
{
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Notify the L2PcInstance AI with AI_INTENTION_INTERACT
|
||||
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
|
||||
}
|
||||
// Send a Server->Client ActionFailed to the L2PcInstance in order to avoid that the client wait another packet
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
@ -416,12 +416,9 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
if (isInsideZone(character))
|
||||
{
|
||||
// If the character can't be affected by this zone return
|
||||
if (_checkAffected)
|
||||
if (_checkAffected && !isAffected(character))
|
||||
{
|
||||
if (!isAffected(character))
|
||||
{
|
||||
return;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (_characterList.putIfAbsent(character.getObjectId(), character) == null)
|
||||
|
Reference in New Issue
Block a user