Direct use of private constants instead of getters.
This commit is contained in:
parent
6eee61d0d8
commit
d265813c40
@ -40,7 +40,7 @@ public class Recipes implements IItemHandler
|
||||
}
|
||||
|
||||
final L2PcInstance activeChar = playable.getActingPlayer();
|
||||
if (activeChar.isInCraftMode())
|
||||
if (activeChar.isCrafting())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_MAY_NOT_ALTER_YOUR_RECIPE_BOOK_WHILE_ENGAGED_IN_MANUFACTURING);
|
||||
return false;
|
||||
|
@ -149,7 +149,7 @@ public final class SocialAction implements IPlayerActionHandler
|
||||
}
|
||||
|
||||
SystemMessage sm;
|
||||
if (player.isInStoreMode() || player.isInCraftMode())
|
||||
if (player.isInStoreMode() || player.isCrafting())
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_PRIVATE_STORE_MODE_OR_IN_A_BATTLE_AND_CANNOT_BE_REQUESTED_FOR_A_COUPLE_ACTION);
|
||||
sm.addPcName(player);
|
||||
@ -228,7 +228,7 @@ public final class SocialAction implements IPlayerActionHandler
|
||||
|
||||
// Checks for partner.
|
||||
final L2PcInstance partner = target.getActingPlayer();
|
||||
if (partner.isInStoreMode() || partner.isInCraftMode())
|
||||
if (partner.isInStoreMode() || partner.isCrafting())
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.C1_IS_IN_PRIVATE_STORE_MODE_OR_IN_A_BATTLE_AND_CANNOT_BE_REQUESTED_FOR_A_COUPLE_ACTION);
|
||||
sm.addPcName(partner);
|
||||
|
@ -530,7 +530,7 @@ public class Q00663_SeductiveWhispers extends Quest
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getSide() == Side.MOON ? "<font color=\"LEVEL\">" + getSide().getName() + ": " + getNumber() + "</font>" : "<font color=\"FF0000\">" + getSide().getName() + ": " + getNumber() + "</font>";
|
||||
return _side == Side.MOON ? "<font color=\"LEVEL\">" + _side.getName() + ": " + _number + "</font>" : "<font color=\"FF0000\">" + _side.getName() + ": " + _number + "</font>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -124,7 +124,7 @@ public final class PacketReader
|
||||
{
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
final int stringLength = _buf.readShortLE();
|
||||
if ((stringLength * 2) > getReadableBytes())
|
||||
if ((stringLength * 2) > _buf.readableBytes())
|
||||
{
|
||||
throw new IndexOutOfBoundsException("readerIndex(" + _buf.readerIndex() + ") + length(" + (stringLength * 2) + ") exceeds writerIndex(" + _buf.writerIndex() + "): " + _buf);
|
||||
}
|
||||
|
@ -199,7 +199,7 @@ public class RecipeController
|
||||
_skillLevel = _player.getSkillLevel(_skillId);
|
||||
_skill = _player.getKnownSkill(_skillId);
|
||||
|
||||
_player.isInCraftMode(true);
|
||||
_player.setIsCrafting(true);
|
||||
|
||||
if (_player.isAlikeDead())
|
||||
{
|
||||
@ -291,7 +291,7 @@ public class RecipeController
|
||||
updateCurMp();
|
||||
updateCurLoad();
|
||||
|
||||
_player.isInCraftMode(false);
|
||||
_player.setIsCrafting(false);
|
||||
_isValid = true;
|
||||
}
|
||||
|
||||
@ -438,7 +438,7 @@ public class RecipeController
|
||||
// update load and mana bar of craft window
|
||||
updateCurMp();
|
||||
_activeMakers.remove(_player.getObjectId());
|
||||
_player.isInCraftMode(false);
|
||||
_player.setIsCrafting(false);
|
||||
_target.sendItemList(false);
|
||||
}
|
||||
|
||||
@ -654,7 +654,7 @@ public class RecipeController
|
||||
private void abort()
|
||||
{
|
||||
updateMakeInfo(false);
|
||||
_player.isInCraftMode(false);
|
||||
_player.setIsCrafting(false);
|
||||
_activeMakers.remove(_player.getObjectId());
|
||||
}
|
||||
|
||||
|
@ -608,7 +608,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!isAutoAttacking())
|
||||
if (!_clientAutoAttacking)
|
||||
{
|
||||
if (_actor.isPlayer() && _actor.hasSummon())
|
||||
{
|
||||
@ -648,7 +648,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
AttackStanceTaskManager.getInstance().addAttackStanceTask(_actor);
|
||||
}
|
||||
}
|
||||
else if (isAutoAttacking())
|
||||
else if (_clientAutoAttacking)
|
||||
{
|
||||
_actor.broadcastPacket(new AutoAttackStop(_actor.getObjectId()));
|
||||
setAutoAttacking(false);
|
||||
@ -680,7 +680,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
*/
|
||||
public void describeStateToPlayer(L2PcInstance player)
|
||||
{
|
||||
if (getActor().isVisibleFor(player))
|
||||
if (_actor.isVisibleFor(player))
|
||||
{
|
||||
if (_clientMoving)
|
||||
{
|
||||
@ -700,7 +700,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
|
||||
public boolean isFollowing()
|
||||
{
|
||||
return (getTarget() instanceof L2Character) && (getIntention() == AI_INTENTION_FOLLOW);
|
||||
return (_target instanceof L2Character) && (_intention == AI_INTENTION_FOLLOW);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -737,7 +737,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
return;
|
||||
}
|
||||
|
||||
final L2Object followTarget = getTarget(); // copy to prevent NPE
|
||||
final L2Object followTarget = _target; // copy to prevent NPE
|
||||
if (followTarget == null)
|
||||
{
|
||||
if (_actor.isSummon())
|
||||
|
@ -75,7 +75,7 @@ public final class L2ControllableMobAI extends L2AttackableAI
|
||||
@Override
|
||||
protected void onEvtThink()
|
||||
{
|
||||
if (isThinking())
|
||||
if (_isThinking)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -84,7 +84,7 @@ public final class L2ControllableMobAI extends L2AttackableAI
|
||||
|
||||
try
|
||||
{
|
||||
switch (getAlternateAI())
|
||||
switch (_alternateAI)
|
||||
{
|
||||
case AI_IDLE:
|
||||
{
|
||||
@ -166,7 +166,7 @@ public final class L2ControllableMobAI extends L2AttackableAI
|
||||
max_range = Math.max(max_range, sk.getCastRange());
|
||||
}
|
||||
|
||||
if (!isNotMoving())
|
||||
if (!_isNotMoving)
|
||||
{
|
||||
moveToPawn(target, max_range);
|
||||
}
|
||||
@ -216,7 +216,7 @@ public final class L2ControllableMobAI extends L2AttackableAI
|
||||
max_range = Math.max(max_range, castRange);
|
||||
}
|
||||
|
||||
if (!isNotMoving())
|
||||
if (!_isNotMoving)
|
||||
{
|
||||
moveToPawn(target, range);
|
||||
}
|
||||
@ -256,7 +256,7 @@ public final class L2ControllableMobAI extends L2AttackableAI
|
||||
max_range = Math.max(max_range, castRange);
|
||||
}
|
||||
|
||||
if (!isNotMoving())
|
||||
if (!_isNotMoving)
|
||||
{
|
||||
moveToPawn(getForcedTarget(), _actor.getPhysicalAttackRange()/* range */);
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
{
|
||||
super.onEvtAttacked(attacker);
|
||||
|
||||
if (isDefending())
|
||||
if (_isDefending)
|
||||
{
|
||||
defendAttack(attacker);
|
||||
}
|
||||
@ -239,7 +239,7 @@ public class L2SummonAI extends L2PlayableAI implements Runnable
|
||||
{
|
||||
super.onEvtEvaded(attacker);
|
||||
|
||||
if (isDefending())
|
||||
if (_isDefending)
|
||||
{
|
||||
defendAttack(attacker);
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ public class HtmCache
|
||||
{
|
||||
LOGGER.info("Html cache start...");
|
||||
parseDir(f);
|
||||
LOGGER.info("Cache[HTML]: " + String.format("%.3f", getMemoryUsage()) + " megabytes on " + getLoadedFiles() + " files loaded");
|
||||
LOGGER.info("Cache[HTML]: " + String.format("%.3f", getMemoryUsage()) + " megabytes on " + _loadedFiles + " files loaded");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -128,11 +128,11 @@ public class Topic
|
||||
public void deleteme(Forum f)
|
||||
{
|
||||
TopicBBSManager.getInstance().delTopic(this);
|
||||
f.rmTopicByID(getID());
|
||||
f.rmTopicByID(_id);
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM topic WHERE topic_id=? AND topic_forum_id=?"))
|
||||
{
|
||||
ps.setInt(1, getID());
|
||||
ps.setInt(1, _id);
|
||||
ps.setInt(2, f.getID());
|
||||
ps.execute();
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public class ClanTable
|
||||
|
||||
public L2Clan getClanByName(String clanName)
|
||||
{
|
||||
return getClans().stream().filter(c -> c.getName().equalsIgnoreCase(clanName)).findFirst().orElse(null);
|
||||
return _clans.values().stream().filter(c -> c.getName().equalsIgnoreCase(clanName)).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -345,7 +345,7 @@ public class ClanTable
|
||||
|
||||
public boolean isAllyExists(String allyName)
|
||||
{
|
||||
for (L2Clan clan : getClans())
|
||||
for (L2Clan clan : _clans.values())
|
||||
{
|
||||
if ((clan.getAllyName() != null) && clan.getAllyName().equalsIgnoreCase(allyName))
|
||||
{
|
||||
|
@ -157,7 +157,7 @@ public final class CrestTable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("INSERT INTO `crests`(`crest_id`, `data`, `type`) VALUES(?, ?, ?)"))
|
||||
{
|
||||
final L2Crest crest = new L2Crest(getNextId(), data, crestType);
|
||||
final L2Crest crest = new L2Crest(_nextId.getAndIncrement(), data, crestType);
|
||||
statement.setInt(1, crest.getId());
|
||||
statement.setBytes(2, crest.getData());
|
||||
statement.setInt(3, crest.getType().getId());
|
||||
|
@ -108,7 +108,7 @@ public final class CastleData implements IGameXmlReader
|
||||
guards.add(new SiegeGuardHolder(castleId, itemId, type, stationary, npcId, npcMaxAmount));
|
||||
}
|
||||
}
|
||||
getSiegeGuards().put(castleId, guards);
|
||||
_siegeGuards.put(castleId, guards);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -258,7 +258,7 @@ public class RecipeData implements IGameXmlReader
|
||||
if ((recipeList == null) || (recipeList.getRecipes().length == 0))
|
||||
{
|
||||
player.sendMessage("No recipe for: " + id);
|
||||
player.isInCraftMode(false);
|
||||
player.setIsCrafting(false);
|
||||
return null;
|
||||
}
|
||||
return recipeList;
|
||||
|
@ -63,7 +63,7 @@ public enum AttributeType
|
||||
*/
|
||||
public AttributeType getOpposite()
|
||||
{
|
||||
return ATTRIBUTE_TYPES[((getClientId() % 2) == 0) ? (getClientId() + 1) : (getClientId() - 1)];
|
||||
return ATTRIBUTE_TYPES[((_clientId % 2) == 0) ? (_clientId + 1) : (_clientId - 1)];
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -137,7 +137,7 @@ public class BitSetIDFactory extends IdFactory
|
||||
*/
|
||||
protected synchronized int usedIdCount()
|
||||
{
|
||||
return size() - FIRST_OID;
|
||||
return _freeIdCount.get() - FIRST_OID;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -68,7 +68,7 @@ public final class CastleManager implements InstanceListManager
|
||||
if (nearestCastle == null)
|
||||
{
|
||||
double distance;
|
||||
for (Castle castle : getCastles())
|
||||
for (Castle castle : _castles.values())
|
||||
{
|
||||
distance = castle.getDistance(obj);
|
||||
if (maxDistance > distance)
|
||||
@ -88,7 +88,7 @@ public final class CastleManager implements InstanceListManager
|
||||
|
||||
public final Castle getCastleByOwner(L2Clan clan)
|
||||
{
|
||||
for (Castle temp : getCastles())
|
||||
for (Castle temp : _castles.values())
|
||||
{
|
||||
if (temp.getOwnerId() == clan.getId())
|
||||
{
|
||||
@ -100,7 +100,7 @@ public final class CastleManager implements InstanceListManager
|
||||
|
||||
public final Castle getCastle(String name)
|
||||
{
|
||||
for (Castle temp : getCastles())
|
||||
for (Castle temp : _castles.values())
|
||||
{
|
||||
if (temp.getName().equalsIgnoreCase(name.trim()))
|
||||
{
|
||||
@ -112,7 +112,7 @@ public final class CastleManager implements InstanceListManager
|
||||
|
||||
public final Castle getCastle(int x, int y, int z)
|
||||
{
|
||||
for (Castle temp : getCastles())
|
||||
for (Castle temp : _castles.values())
|
||||
{
|
||||
if (temp.checkIfInZone(x, y, z))
|
||||
{
|
||||
@ -135,7 +135,7 @@ public final class CastleManager implements InstanceListManager
|
||||
public boolean hasOwnedCastle()
|
||||
{
|
||||
boolean hasOwnedCastle = false;
|
||||
for (Castle castle : getCastles())
|
||||
for (Castle castle : _castles.values())
|
||||
{
|
||||
if (castle.getOwnerId() > 0)
|
||||
{
|
||||
@ -224,7 +224,7 @@ public final class CastleManager implements InstanceListManager
|
||||
final int castleId = rs.getInt("id");
|
||||
_castles.put(castleId, new Castle(castleId));
|
||||
}
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + getCastles().size() + " castles.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + _castles.values().size() + " castles.");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -240,7 +240,7 @@ public final class CastleManager implements InstanceListManager
|
||||
@Override
|
||||
public void activateInstances()
|
||||
{
|
||||
for (Castle castle : getCastles())
|
||||
for (Castle castle : _castles.values())
|
||||
{
|
||||
castle.activateInstance();
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ public final class FortManager implements InstanceListManager
|
||||
Fort nearestFort = getFort(obj);
|
||||
if (nearestFort == null)
|
||||
{
|
||||
for (Fort fort : getForts())
|
||||
for (Fort fort : _forts.values())
|
||||
{
|
||||
final double distance = fort.getDistance(obj);
|
||||
if (maxDistance > distance)
|
||||
@ -62,7 +62,7 @@ public final class FortManager implements InstanceListManager
|
||||
|
||||
public final Fort getFortById(int fortId)
|
||||
{
|
||||
for (Fort f : getForts())
|
||||
for (Fort f : _forts.values())
|
||||
{
|
||||
if (f.getResidenceId() == fortId)
|
||||
{
|
||||
@ -74,7 +74,7 @@ public final class FortManager implements InstanceListManager
|
||||
|
||||
public final Fort getFortByOwner(L2Clan clan)
|
||||
{
|
||||
for (Fort f : getForts())
|
||||
for (Fort f : _forts.values())
|
||||
{
|
||||
if (f.getOwnerClan() == clan)
|
||||
{
|
||||
@ -86,7 +86,7 @@ public final class FortManager implements InstanceListManager
|
||||
|
||||
public final Fort getFort(String name)
|
||||
{
|
||||
for (Fort f : getForts())
|
||||
for (Fort f : _forts.values())
|
||||
{
|
||||
if (f.getName().equalsIgnoreCase(name.trim()))
|
||||
{
|
||||
@ -98,7 +98,7 @@ public final class FortManager implements InstanceListManager
|
||||
|
||||
public final Fort getFort(int x, int y, int z)
|
||||
{
|
||||
for (Fort f : getForts())
|
||||
for (Fort f : _forts.values())
|
||||
{
|
||||
if (f.checkIfInZone(x, y, z))
|
||||
{
|
||||
@ -131,8 +131,8 @@ public final class FortManager implements InstanceListManager
|
||||
_forts.put(fortId, new Fort(fortId));
|
||||
}
|
||||
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + getForts().size() + " fortress");
|
||||
for (Fort fort : getForts())
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + _forts.values().size() + " fortress");
|
||||
for (Fort fort : _forts.values())
|
||||
{
|
||||
fort.getSiege().loadSiegeGuard();
|
||||
}
|
||||
@ -151,7 +151,7 @@ public final class FortManager implements InstanceListManager
|
||||
@Override
|
||||
public void activateInstances()
|
||||
{
|
||||
for (Fort fort : getForts())
|
||||
for (Fort fort : _forts.values())
|
||||
{
|
||||
fort.activateInstance();
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ public final class MailManager
|
||||
public final boolean hasUnreadPost(L2PcInstance player)
|
||||
{
|
||||
final int objectId = player.getObjectId();
|
||||
for (Message msg : getMessages())
|
||||
for (Message msg : _messages.values())
|
||||
{
|
||||
if ((msg != null) && (msg.getReceiverId() == objectId) && msg.isUnread())
|
||||
{
|
||||
@ -115,7 +115,7 @@ public final class MailManager
|
||||
public final int getInboxSize(int objectId)
|
||||
{
|
||||
int size = 0;
|
||||
for (Message msg : getMessages())
|
||||
for (Message msg : _messages.values())
|
||||
{
|
||||
if ((msg != null) && (msg.getReceiverId() == objectId) && !msg.isDeletedByReceiver())
|
||||
{
|
||||
@ -128,7 +128,7 @@ public final class MailManager
|
||||
public final int getOutboxSize(int objectId)
|
||||
{
|
||||
int size = 0;
|
||||
for (Message msg : getMessages())
|
||||
for (Message msg : _messages.values())
|
||||
{
|
||||
if ((msg != null) && (msg.getSenderId() == objectId) && !msg.isDeletedBySender())
|
||||
{
|
||||
@ -141,7 +141,7 @@ public final class MailManager
|
||||
public final List<Message> getInbox(int objectId)
|
||||
{
|
||||
final List<Message> inbox = new LinkedList<>();
|
||||
for (Message msg : getMessages())
|
||||
for (Message msg : _messages.values())
|
||||
{
|
||||
if ((msg != null) && (msg.getReceiverId() == objectId) && !msg.isDeletedByReceiver())
|
||||
{
|
||||
@ -159,7 +159,7 @@ public final class MailManager
|
||||
public int getMailsInProgress(int objectId)
|
||||
{
|
||||
int count = 0;
|
||||
for (Message msg : getMessages())
|
||||
for (Message msg : _messages.values())
|
||||
{
|
||||
if ((msg != null) && (msg.getMailType() == MailType.REGULAR))
|
||||
{
|
||||
@ -179,7 +179,7 @@ public final class MailManager
|
||||
public final List<Message> getOutbox(int objectId)
|
||||
{
|
||||
final List<Message> outbox = new LinkedList<>();
|
||||
for (Message msg : getMessages())
|
||||
for (Message msg : _messages.values())
|
||||
{
|
||||
if ((msg != null) && (msg.getSenderId() == objectId) && !msg.isDeletedBySender())
|
||||
{
|
||||
|
@ -52,17 +52,17 @@ public final class PetitionManager
|
||||
|
||||
public void clearCompletedPetitions()
|
||||
{
|
||||
final int numPetitions = getPendingPetitionCount();
|
||||
final int numPetitions = _pendingPetitions.size();
|
||||
|
||||
getCompletedPetitions().clear();
|
||||
_completedPetitions.clear();
|
||||
LOGGER.info(getClass().getSimpleName() + ": Completed petition data cleared. " + numPetitions + " petition(s) removed.");
|
||||
}
|
||||
|
||||
public void clearPendingPetitions()
|
||||
{
|
||||
final int numPetitions = getPendingPetitionCount();
|
||||
final int numPetitions = _pendingPetitions.size();
|
||||
|
||||
getPendingPetitions().clear();
|
||||
_pendingPetitions.clear();
|
||||
LOGGER.info(getClass().getSimpleName() + ": Pending petition queue cleared. " + numPetitions + " petition(s) removed.");
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ public final class PetitionManager
|
||||
return false;
|
||||
}
|
||||
|
||||
final Petition currPetition = getPendingPetitions().get(petitionId);
|
||||
final Petition currPetition = _pendingPetitions.get(petitionId);
|
||||
|
||||
if (currPetition.getResponder() != null)
|
||||
{
|
||||
@ -103,7 +103,7 @@ public final class PetitionManager
|
||||
|
||||
public boolean cancelActivePetition(L2PcInstance player)
|
||||
{
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if ((currPetition.getPetitioner() != null) && (currPetition.getPetitioner().getObjectId() == player.getObjectId()))
|
||||
{
|
||||
@ -123,7 +123,7 @@ public final class PetitionManager
|
||||
{
|
||||
if (petitioner != null)
|
||||
{
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@ -150,7 +150,7 @@ public final class PetitionManager
|
||||
return false;
|
||||
}
|
||||
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@ -178,7 +178,7 @@ public final class PetitionManager
|
||||
|
||||
public int getPendingPetitionCount()
|
||||
{
|
||||
return getPendingPetitions().size();
|
||||
return _pendingPetitions.size();
|
||||
}
|
||||
|
||||
public int getPlayerTotalPetitionCount(L2PcInstance player)
|
||||
@ -190,7 +190,7 @@ public final class PetitionManager
|
||||
|
||||
int petitionCount = 0;
|
||||
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@ -203,7 +203,7 @@ public final class PetitionManager
|
||||
}
|
||||
}
|
||||
|
||||
for (Petition currPetition : getCompletedPetitions().values())
|
||||
for (Petition currPetition : _completedPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@ -221,7 +221,7 @@ public final class PetitionManager
|
||||
|
||||
public boolean isPetitionInProcess()
|
||||
{
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@ -244,7 +244,7 @@ public final class PetitionManager
|
||||
return false;
|
||||
}
|
||||
|
||||
final Petition currPetition = getPendingPetitions().get(petitionId);
|
||||
final Petition currPetition = _pendingPetitions.get(petitionId);
|
||||
return (currPetition.getState() == PetitionState.IN_PROCESS);
|
||||
}
|
||||
|
||||
@ -252,7 +252,7 @@ public final class PetitionManager
|
||||
{
|
||||
if (player != null)
|
||||
{
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@ -283,7 +283,7 @@ public final class PetitionManager
|
||||
{
|
||||
if (petitioner != null)
|
||||
{
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@ -302,7 +302,7 @@ public final class PetitionManager
|
||||
|
||||
private boolean isValidPetition(int petitionId)
|
||||
{
|
||||
return getPendingPetitions().containsKey(petitionId);
|
||||
return _pendingPetitions.containsKey(petitionId);
|
||||
}
|
||||
|
||||
public boolean rejectPetition(L2PcInstance respondingAdmin, int petitionId)
|
||||
@ -312,7 +312,7 @@ public final class PetitionManager
|
||||
return false;
|
||||
}
|
||||
|
||||
final Petition currPetition = getPendingPetitions().get(petitionId);
|
||||
final Petition currPetition = _pendingPetitions.get(petitionId);
|
||||
|
||||
if (currPetition.getResponder() != null)
|
||||
{
|
||||
@ -330,7 +330,7 @@ public final class PetitionManager
|
||||
|
||||
CreatureSay cs;
|
||||
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@ -363,12 +363,12 @@ public final class PetitionManager
|
||||
|
||||
public void sendPendingPetitionList(L2PcInstance activeChar)
|
||||
{
|
||||
final StringBuilder htmlContent = new StringBuilder(600 + (getPendingPetitionCount() * 300));
|
||||
final StringBuilder htmlContent = new StringBuilder(600 + (_pendingPetitions.size() * 300));
|
||||
htmlContent.append("<html><body><center><table width=270><tr><td width=45><button value=\"Main\" action=\"bypass -h admin_admin\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td width=180><center>Petition Menu</center></td><td width=45><button value=\"Back\" action=\"bypass -h admin_admin7\" width=45 height=21 back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br><table width=\"270\"><tr><td><table width=\"270\"><tr><td><button value=\"Reset\" action=\"bypass -h admin_reset_petitions\" width=\"80\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td><td align=right><button value=\"Refresh\" action=\"bypass -h admin_view_petitions\" width=\"80\" height=\"21\" back=\"L2UI_ct1.button_df\" fore=\"L2UI_ct1.button_df\"></td></tr></table><br></td></tr>");
|
||||
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
if (getPendingPetitionCount() == 0)
|
||||
if (_pendingPetitions.size() == 0)
|
||||
{
|
||||
htmlContent.append("<tr><td>There are no currently pending petitions.</td></tr>");
|
||||
}
|
||||
@ -379,7 +379,7 @@ public final class PetitionManager
|
||||
|
||||
boolean color = true;
|
||||
int petcount = 0;
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@ -419,7 +419,7 @@ public final class PetitionManager
|
||||
// Create a new petition instance and add it to the list of pending petitions.
|
||||
final Petition newPetition = new Petition(petitioner, petitionText, petitionType);
|
||||
final int newPetitionId = newPetition.getId();
|
||||
getPendingPetitions().put(newPetitionId, newPetition);
|
||||
_pendingPetitions.put(newPetitionId, newPetition);
|
||||
|
||||
// Notify all GMs that a new petition has been submitted.
|
||||
final String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ").";
|
||||
@ -440,7 +440,7 @@ public final class PetitionManager
|
||||
return;
|
||||
}
|
||||
|
||||
final Petition currPetition = getPendingPetitions().get(petitionId);
|
||||
final Petition currPetition = _pendingPetitions.get(petitionId);
|
||||
final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm");
|
||||
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage();
|
||||
|
@ -78,7 +78,7 @@ public abstract class AbstractPlayerGroup
|
||||
*/
|
||||
public boolean isLeader(L2PcInstance player)
|
||||
{
|
||||
return getLeaderObjectId() == player.getObjectId();
|
||||
return getLeader().getObjectId() == player.getObjectId();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -171,7 +171,7 @@ public abstract class AbstractPlayerGroup
|
||||
*/
|
||||
public L2PcInstance getRandomPlayer()
|
||||
{
|
||||
return getMembers().get(Rnd.get(getMemberCount()));
|
||||
return getMembers().get(Rnd.get(getMembers().size()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -277,7 +277,7 @@ public final class CharEffectList
|
||||
*/
|
||||
public int getBuffCount()
|
||||
{
|
||||
return _actives != null ? (_buffCount.intValue() - _hiddenBuffs.get()) : 0;
|
||||
return _actives != null ? (_buffCount.get() - _hiddenBuffs.get()) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -287,7 +287,7 @@ public final class CharEffectList
|
||||
*/
|
||||
public int getDanceCount()
|
||||
{
|
||||
return _danceCount.intValue();
|
||||
return _danceCount.get();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -297,7 +297,7 @@ public final class CharEffectList
|
||||
*/
|
||||
public int getTriggeredBuffCount()
|
||||
{
|
||||
return _triggerBuffCount.intValue();
|
||||
return _triggerBuffCount.get();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -307,7 +307,7 @@ public final class CharEffectList
|
||||
*/
|
||||
public int getToggleCount()
|
||||
{
|
||||
return _toggleCount.intValue();
|
||||
return _toggleCount.get();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -317,7 +317,7 @@ public final class CharEffectList
|
||||
*/
|
||||
public int getDebuffCount()
|
||||
{
|
||||
return _debuffCount.intValue();
|
||||
return _debuffCount.get();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -352,7 +352,7 @@ public final class CharEffectList
|
||||
*/
|
||||
public void stopAllToggles()
|
||||
{
|
||||
if (getToggleCount() > 0)
|
||||
if (_toggleCount.get() > 0)
|
||||
{
|
||||
// Ignore necessary toggles.
|
||||
stopEffects(b -> b.getSkill().isToggle() && !b.getSkill().isNecessaryToggle() && !b.getSkill().isIrreplacableBuff(), true, true);
|
||||
@ -361,7 +361,7 @@ public final class CharEffectList
|
||||
|
||||
public void stopAllTogglesOfGroup(int toggleGroup)
|
||||
{
|
||||
if (getToggleCount() > 0)
|
||||
if (_toggleCount.get() > 0)
|
||||
{
|
||||
stopEffects(b -> b.getSkill().isToggle() && (b.getSkill().getToggleGroupId() == toggleGroup), true, true);
|
||||
}
|
||||
@ -508,7 +508,7 @@ public final class CharEffectList
|
||||
*/
|
||||
public void stopEffectsOnAction()
|
||||
{
|
||||
if (_hasBuffsRemovedOnAnyAction.intValue() > 0)
|
||||
if (_hasBuffsRemovedOnAnyAction.get() > 0)
|
||||
{
|
||||
stopEffects(info -> info.getSkill().isRemovedOnAnyActionExceptMove(), true, true);
|
||||
}
|
||||
@ -516,7 +516,7 @@ public final class CharEffectList
|
||||
|
||||
public void stopEffectsOnDamage()
|
||||
{
|
||||
if (_hasBuffsRemovedOnDamage.intValue() > 0)
|
||||
if (_hasBuffsRemovedOnDamage.get() > 0)
|
||||
{
|
||||
stopEffects(info -> info.getSkill().isRemovedOnDamage(), true, true);
|
||||
}
|
||||
@ -535,16 +535,16 @@ public final class CharEffectList
|
||||
{
|
||||
case TRIGGER:
|
||||
{
|
||||
return (getTriggeredBuffCount() > Config.TRIGGERED_BUFFS_MAX_AMOUNT);
|
||||
return (_triggerBuffCount.get() > Config.TRIGGERED_BUFFS_MAX_AMOUNT);
|
||||
}
|
||||
case DANCE:
|
||||
{
|
||||
return (getDanceCount() > Config.DANCES_MAX_AMOUNT);
|
||||
return (_danceCount.get() > Config.DANCES_MAX_AMOUNT);
|
||||
}
|
||||
// case TOGGLE: Do toggles have limit?
|
||||
case DEBUFF:
|
||||
{
|
||||
return (getDebuffCount() > 24);
|
||||
return (_debuffCount.get() > 24);
|
||||
}
|
||||
case BUFF:
|
||||
{
|
||||
@ -1106,7 +1106,7 @@ public final class CharEffectList
|
||||
final Skill skill = info.getSkill();
|
||||
|
||||
// Handle hidden buffs. Check if there was such abnormal before so we can continue.
|
||||
if ((getHiddenBuffsCount() > 0) && _stackedEffects.contains(skill.getAbnormalType()))
|
||||
if ((_hiddenBuffs.get() > 0) && _stackedEffects.contains(skill.getAbnormalType()))
|
||||
{
|
||||
// If incoming buff isnt hidden, remove any hidden buffs with its abnormal type.
|
||||
if (info.isInUse())
|
||||
|
@ -71,7 +71,7 @@ public class CursedWeapon implements INamable
|
||||
private ScheduledFuture<?> _removeTask;
|
||||
|
||||
private int _nbKills = 0;
|
||||
private long _endTime = 0;
|
||||
long _endTime = 0;
|
||||
|
||||
private int _playerId = 0;
|
||||
protected L2PcInstance _player = null;
|
||||
@ -238,7 +238,7 @@ public class CursedWeapon implements INamable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (System.currentTimeMillis() >= getEndTime())
|
||||
if (System.currentTimeMillis() >= _endTime)
|
||||
{
|
||||
endOfLife();
|
||||
}
|
||||
|
@ -110,7 +110,7 @@ public class Fishing
|
||||
|
||||
public synchronized void startFishing()
|
||||
{
|
||||
if (isFishing())
|
||||
if (_isFishing)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -132,7 +132,7 @@ public class Fishing
|
||||
|
||||
if (!canFish())
|
||||
{
|
||||
if (isFishing())
|
||||
if (_isFishing)
|
||||
{
|
||||
_player.sendPacket(SystemMessageId.YOUR_ATTEMPT_AT_FISHING_HAS_BEEN_CANCELLED);
|
||||
}
|
||||
@ -182,7 +182,7 @@ public class Fishing
|
||||
return;
|
||||
}
|
||||
|
||||
if (_player.isInCraftMode() || _player.isInStoreMode())
|
||||
if (_player.isCrafting() || _player.isInStoreMode())
|
||||
{
|
||||
_player.sendPacket(SystemMessageId.YOU_CANNOT_FISH_WHILE_USING_A_RECIPE_BOOK_PRIVATE_WORKSHOP_OR_PRIVATE_STORE);
|
||||
_player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
@ -201,7 +201,7 @@ public class Fishing
|
||||
_baitLocation = calculateBaitLocation();
|
||||
if (!_player.isInsideZone(ZoneId.FISHING) || (_baitLocation == null))
|
||||
{
|
||||
if (isFishing())
|
||||
if (_isFishing)
|
||||
{
|
||||
// _player.sendPacket(SystemMessageId.YOUR_ATTEMPT_AT_FISHING_HAS_BEEN_CANCELLED);
|
||||
_player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
@ -262,7 +262,7 @@ public class Fishing
|
||||
|
||||
private void reelIn(FishingEndReason reason, boolean consumeBait)
|
||||
{
|
||||
if (!isFishing())
|
||||
if (!_isFishing)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -326,7 +326,7 @@ public class Fishing
|
||||
|
||||
public synchronized void stopFishing(FishingEndType endType)
|
||||
{
|
||||
if (isFishing())
|
||||
if (_isFishing)
|
||||
{
|
||||
reelIn(FishingEndReason.STOP, false);
|
||||
_isFishing = false;
|
||||
|
@ -177,7 +177,7 @@ public final class L2ArmorSet
|
||||
public int getLowestSetEnchant(L2PcInstance player)
|
||||
{
|
||||
// Player don't have full set
|
||||
if (getPiecesCount(player, L2ItemInstance::getId) < getMinimumPieces())
|
||||
if (getPiecesCount(player, L2ItemInstance::getId) < _minimumPieces)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
_clanId = clanId;
|
||||
initializePrivs();
|
||||
restore();
|
||||
getWarehouse().restore();
|
||||
_warehouse.restore();
|
||||
|
||||
final ClanRewardBonus availableOnlineBonus = ClanRewardType.MEMBERS_ONLINE.getAvailableBonus(this);
|
||||
if ((_lastMembersOnlineBonus == null) && (availableOnlineBonus != null))
|
||||
@ -241,7 +241,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
public void setNewLeader(L2ClanMember member)
|
||||
{
|
||||
final L2PcInstance newLeader = member.getPlayerInstance();
|
||||
final L2ClanMember exMember = getLeader();
|
||||
final L2ClanMember exMember = _leader;
|
||||
final L2PcInstance exLeader = exMember.getPlayerInstance();
|
||||
|
||||
// Notify to scripts
|
||||
@ -277,7 +277,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
}
|
||||
|
||||
setLeader(member);
|
||||
if (getNewLeaderId() != 0)
|
||||
if (_newLeaderId != 0)
|
||||
{
|
||||
setNewLeaderId(0, true);
|
||||
}
|
||||
@ -329,7 +329,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
{
|
||||
if (_leader == null)
|
||||
{
|
||||
LOGGER.warning("Clan " + getName() + " without clan leader!");
|
||||
LOGGER.warning("Clan " + _name + " without clan leader!");
|
||||
return "";
|
||||
}
|
||||
return _leader.getName();
|
||||
@ -569,7 +569,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
switch (getLevel())
|
||||
switch (_level)
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
@ -607,7 +607,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
case 100:
|
||||
case 200:
|
||||
{
|
||||
switch (getLevel())
|
||||
switch (_level)
|
||||
{
|
||||
case 11:
|
||||
{
|
||||
@ -627,7 +627,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
case 2001:
|
||||
case 2002:
|
||||
{
|
||||
switch (getLevel())
|
||||
switch (_level)
|
||||
{
|
||||
case 9:
|
||||
case 10:
|
||||
@ -881,8 +881,8 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET blood_alliance_count=? WHERE clan_id=?"))
|
||||
{
|
||||
ps.setInt(1, getBloodAllianceCount());
|
||||
ps.setInt(2, getId());
|
||||
ps.setInt(1, _bloodAllianceCount);
|
||||
ps.setInt(2, _clanId);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -925,8 +925,8 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET blood_oath_count=? WHERE clan_id=?"))
|
||||
{
|
||||
ps.setInt(1, getBloodOathCount());
|
||||
ps.setInt(2, getId());
|
||||
ps.setInt(1, _bloodOathCount);
|
||||
ps.setInt(2, _clanId);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -941,8 +941,8 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET reputation_score=? WHERE clan_id=?"))
|
||||
{
|
||||
ps.setInt(1, getReputationScore());
|
||||
ps.setInt(2, getId());
|
||||
ps.setInt(1, _reputationScore);
|
||||
ps.setInt(2, _clanId);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -977,15 +977,15 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET leader_id=?,ally_id=?,ally_name=?,reputation_score=?,ally_penalty_expiry_time=?,ally_penalty_type=?,char_penalty_expiry_time=?,dissolving_expiry_time=?,new_leader_id=? WHERE clan_id=?"))
|
||||
{
|
||||
ps.setInt(1, getLeaderId());
|
||||
ps.setInt(2, getAllyId());
|
||||
ps.setString(3, getAllyName());
|
||||
ps.setInt(4, getReputationScore());
|
||||
ps.setLong(5, getAllyPenaltyExpiryTime());
|
||||
ps.setInt(6, getAllyPenaltyType());
|
||||
ps.setLong(7, getCharPenaltyExpiryTime());
|
||||
ps.setLong(8, getDissolvingExpiryTime());
|
||||
ps.setInt(9, getNewLeaderId());
|
||||
ps.setInt(10, getId());
|
||||
ps.setInt(2, _allyId);
|
||||
ps.setString(3, _allyName);
|
||||
ps.setInt(4, _reputationScore);
|
||||
ps.setLong(5, _allyPenaltyExpiryTime);
|
||||
ps.setInt(6, _allyPenaltyType);
|
||||
ps.setLong(7, _charPenaltyExpiryTime);
|
||||
ps.setLong(8, _dissolvingExpiryTime);
|
||||
ps.setInt(9, _newLeaderId);
|
||||
ps.setInt(10, _clanId);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -1014,19 +1014,19 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(INSERT_CLAN_DATA))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setString(2, getName());
|
||||
ps.setInt(3, getLevel());
|
||||
ps.setInt(4, getCastleId());
|
||||
ps.setInt(5, getBloodAllianceCount());
|
||||
ps.setInt(6, getBloodOathCount());
|
||||
ps.setInt(7, getAllyId());
|
||||
ps.setString(8, getAllyName());
|
||||
ps.setInt(1, _clanId);
|
||||
ps.setString(2, _name);
|
||||
ps.setInt(3, _level);
|
||||
ps.setInt(4, _castleId);
|
||||
ps.setInt(5, _bloodAllianceCount);
|
||||
ps.setInt(6, _bloodOathCount);
|
||||
ps.setInt(7, _allyId);
|
||||
ps.setString(8, _allyName);
|
||||
ps.setInt(9, getLeaderId());
|
||||
ps.setInt(10, getCrestId());
|
||||
ps.setInt(11, getCrestLargeId());
|
||||
ps.setInt(12, getAllyCrestId());
|
||||
ps.setInt(13, getNewLeaderId());
|
||||
ps.setInt(10, _crestId);
|
||||
ps.setInt(11, _crestLargeId);
|
||||
ps.setInt(12, _allyCrestId);
|
||||
ps.setInt(13, _newLeaderId);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -1070,7 +1070,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(SELECT_CLAN_DATA))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanId);
|
||||
try (ResultSet clanData = ps.executeQuery())
|
||||
{
|
||||
if (clanData.next())
|
||||
@ -1083,12 +1083,12 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
setAllyId(clanData.getInt("ally_id"));
|
||||
setAllyName(clanData.getString("ally_name"));
|
||||
setAllyPenaltyExpiryTime(clanData.getLong("ally_penalty_expiry_time"), clanData.getInt("ally_penalty_type"));
|
||||
if (getAllyPenaltyExpiryTime() < System.currentTimeMillis())
|
||||
if (_allyPenaltyExpiryTime < System.currentTimeMillis())
|
||||
{
|
||||
setAllyPenaltyExpiryTime(0, 0);
|
||||
}
|
||||
setCharPenaltyExpiryTime(clanData.getLong("char_penalty_expiry_time"));
|
||||
if ((getCharPenaltyExpiryTime() + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
|
||||
if ((_charPenaltyExpiryTime + (Config.ALT_CLAN_JOIN_DAYS * 86400000)) < System.currentTimeMillis()) // 24*60*60*1000 = 86400000
|
||||
{
|
||||
setCharPenaltyExpiryTime(0);
|
||||
}
|
||||
@ -1108,7 +1108,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
|
||||
try (PreparedStatement select = con.prepareStatement("SELECT char_name,level,classid,charId,title,power_grade,subpledge,apprentice,sponsor,sex,race FROM characters WHERE clanid=?"))
|
||||
{
|
||||
select.setInt(1, getId());
|
||||
select.setInt(1, _clanId);
|
||||
try (ResultSet clanMember = select.executeQuery())
|
||||
{
|
||||
L2ClanMember member = null;
|
||||
@ -1145,7 +1145,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT enabled,notice FROM clan_notices WHERE clan_id=?"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanId);
|
||||
try (ResultSet noticeData = ps.executeQuery())
|
||||
{
|
||||
while (noticeData.next())
|
||||
@ -1176,7 +1176,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_notices (clan_id,notice,enabled) values (?,?,?) ON DUPLICATE KEY UPDATE notice=?,enabled=?"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanId);
|
||||
ps.setString(2, notice);
|
||||
if (enabled)
|
||||
{
|
||||
@ -1236,7 +1236,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
PreparedStatement ps = con.prepareStatement("SELECT skill_id,skill_level,sub_pledge_id FROM clan_skills WHERE clan_id=?"))
|
||||
{
|
||||
// Retrieve all skills of this L2PcInstance from the database
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanId);
|
||||
try (ResultSet rset = ps.executeQuery())
|
||||
{
|
||||
// Go though the recordset of this SQL query
|
||||
@ -1363,7 +1363,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
{
|
||||
ps.setInt(1, newSkill.getLevel());
|
||||
ps.setInt(2, oldSkill.getId());
|
||||
ps.setInt(3, getId());
|
||||
ps.setInt(3, _clanId);
|
||||
ps.execute();
|
||||
}
|
||||
}
|
||||
@ -1371,7 +1371,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
{
|
||||
try (PreparedStatement ps = con.prepareStatement("INSERT INTO clan_skills (clan_id,skill_id,skill_level,skill_name,sub_pledge_id) VALUES (?,?,?,?,?)"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanId);
|
||||
ps.setInt(2, newSkill.getId());
|
||||
ps.setInt(3, newSkill.getLevel());
|
||||
ps.setString(4, newSkill.getName());
|
||||
@ -1611,7 +1611,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getName() + "[" + getId() + "]";
|
||||
return _name + "[" + _clanId + "]";
|
||||
}
|
||||
|
||||
public ItemContainer getWarehouse()
|
||||
@ -1764,7 +1764,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
PreparedStatement ps = con.prepareStatement("SELECT sub_pledge_id,name,leader_id FROM clan_subpledges WHERE clan_id=?"))
|
||||
{
|
||||
// Retrieve all subpledges of this clan from the database
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanId);
|
||||
try (ResultSet rset = ps.executeQuery())
|
||||
{
|
||||
while (rset.next())
|
||||
@ -1854,7 +1854,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
|
||||
// Royal Guard 5000 points per each
|
||||
// Order of Knights 10000 points per each
|
||||
if ((pledgeType != -1) && (((getReputationScore() < Config.ROYAL_GUARD_COST) && (pledgeType < SUBUNIT_KNIGHT1)) || ((getReputationScore() < Config.KNIGHT_UNIT_COST) && (pledgeType > SUBUNIT_ROYAL2))))
|
||||
if ((pledgeType != -1) && (((_reputationScore < Config.ROYAL_GUARD_COST) && (pledgeType < SUBUNIT_KNIGHT1)) || ((_reputationScore < Config.KNIGHT_UNIT_COST) && (pledgeType > SUBUNIT_ROYAL2))))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THE_CLAN_REPUTATION_IS_TOO_LOW);
|
||||
return null;
|
||||
@ -1863,7 +1863,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_subpledges (clan_id,sub_pledge_id,name,leader_id) values (?,?,?,?)"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanId);
|
||||
ps.setInt(2, pledgeType);
|
||||
ps.setString(3, subPledgeName);
|
||||
ps.setInt(4, pledgeType != -1 ? leaderId : 0);
|
||||
@ -1878,11 +1878,11 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
// Order of Knights 10000 points per each
|
||||
if (pledgeType < SUBUNIT_KNIGHT1)
|
||||
{
|
||||
setReputationScore(getReputationScore() - Config.ROYAL_GUARD_COST, true);
|
||||
setReputationScore(_reputationScore - Config.ROYAL_GUARD_COST, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
setReputationScore(getReputationScore() - Config.KNIGHT_UNIT_COST, true);
|
||||
setReputationScore(_reputationScore - Config.KNIGHT_UNIT_COST, true);
|
||||
// TODO: clan lvl9 or more can reinforce knights cheaper if first knight unit already created, use Config.KNIGHT_REINFORCE_COST
|
||||
}
|
||||
}
|
||||
@ -1948,7 +1948,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
{
|
||||
ps.setInt(1, getSubPledge(pledgeType).getLeaderId());
|
||||
ps.setString(2, getSubPledge(pledgeType).getName());
|
||||
ps.setInt(3, getId());
|
||||
ps.setInt(3, _clanId);
|
||||
ps.setInt(4, pledgeType);
|
||||
ps.execute();
|
||||
}
|
||||
@ -1964,7 +1964,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
PreparedStatement ps = con.prepareStatement("SELECT privs,rank,party FROM clan_privs WHERE clan_id=?"))
|
||||
{
|
||||
// Retrieve all skills of this L2PcInstance from the database
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanId);
|
||||
// LOGGER.warning("clanPrivs restore for ClanId : "+getClanId());
|
||||
try (ResultSet rset = ps.executeQuery())
|
||||
{
|
||||
@ -2013,7 +2013,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?"))
|
||||
{
|
||||
// Retrieve all skills of this L2PcInstance from the database
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanId);
|
||||
ps.setInt(2, rank);
|
||||
ps.setInt(3, 0);
|
||||
ps.setInt(4, privs);
|
||||
@ -2025,7 +2025,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
LOGGER.log(Level.WARNING, "Could not store clan privs for rank: " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
for (L2ClanMember cm : getMembers())
|
||||
for (L2ClanMember cm : _members.values())
|
||||
{
|
||||
if (cm.isOnline())
|
||||
{
|
||||
@ -2049,7 +2049,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)"))
|
||||
{
|
||||
// Retrieve all skills of this L2PcInstance from the database
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanId);
|
||||
ps.setInt(2, rank);
|
||||
ps.setInt(3, 0);
|
||||
ps.setInt(4, privs);
|
||||
@ -2089,12 +2089,12 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
|
||||
public synchronized void addReputationScore(int value, boolean save)
|
||||
{
|
||||
setReputationScore(getReputationScore() + value, save);
|
||||
setReputationScore(_reputationScore + value, save);
|
||||
}
|
||||
|
||||
public synchronized void takeReputationScore(int value, boolean save)
|
||||
{
|
||||
setReputationScore(getReputationScore() - value, save);
|
||||
setReputationScore(_reputationScore - value, save);
|
||||
}
|
||||
|
||||
private void setReputationScore(int value, boolean save)
|
||||
@ -2168,7 +2168,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET auction_bid_at=? WHERE clan_id=?"))
|
||||
{
|
||||
ps.setInt(1, id);
|
||||
ps.setInt(2, getId());
|
||||
ps.setInt(2, _clanId);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -2205,7 +2205,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
|
||||
return false;
|
||||
}
|
||||
if (getCharPenaltyExpiryTime() > System.currentTimeMillis())
|
||||
if (_charPenaltyExpiryTime > System.currentTimeMillis())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.AFTER_A_CLAN_MEMBER_IS_DISMISSED_FROM_A_CLAN_THE_CLAN_MUST_WAIT_AT_LEAST_A_DAY_BEFORE_ACCEPTING_A_NEW_MEMBER);
|
||||
return false;
|
||||
@ -2237,7 +2237,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
if (pledgeType == 0)
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_IS_FULL_AND_CANNOT_ACCEPT_ADDITIONAL_CLAN_MEMBERS_AT_THIS_TIME);
|
||||
sm.addString(getName());
|
||||
sm.addString(_name);
|
||||
activeChar.sendPacket(sm);
|
||||
}
|
||||
else
|
||||
@ -2389,22 +2389,22 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
player.sendPacket(SystemMessageId.ONLY_CLAN_LEADERS_MAY_CREATE_ALLIANCES);
|
||||
return;
|
||||
}
|
||||
if (getAllyId() != 0)
|
||||
if (_allyId != 0)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_ALREADY_BELONG_TO_ANOTHER_ALLIANCE);
|
||||
return;
|
||||
}
|
||||
if (getLevel() < 5)
|
||||
if (_level < 5)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLIANCE_YOUR_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
|
||||
return;
|
||||
}
|
||||
if ((getAllyPenaltyExpiryTime() > System.currentTimeMillis()) && (getAllyPenaltyType() == PENALTY_TYPE_DISSOLVE_ALLY))
|
||||
if ((_allyPenaltyExpiryTime > System.currentTimeMillis()) && (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_CANNOT_CREATE_A_NEW_ALLIANCE_WITHIN_1_DAY_OF_DISSOLUTION);
|
||||
return;
|
||||
}
|
||||
if (getDissolvingExpiryTime() > System.currentTimeMillis())
|
||||
if (_dissolvingExpiryTime > System.currentTimeMillis())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_NO_ALLIANCE_CAN_BE_CREATED);
|
||||
return;
|
||||
@ -2425,7 +2425,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
return;
|
||||
}
|
||||
|
||||
setAllyId(getId());
|
||||
setAllyId(_clanId);
|
||||
setAllyName(allyName.trim());
|
||||
setAllyPenaltyExpiryTime(0, 0);
|
||||
updateClanInDB();
|
||||
@ -2438,12 +2438,12 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
|
||||
public void dissolveAlly(L2PcInstance player)
|
||||
{
|
||||
if (getAllyId() == 0)
|
||||
if (_allyId == 0)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOU_ARE_NOT_CURRENTLY_ALLIED_WITH_ANY_CLANS);
|
||||
return;
|
||||
}
|
||||
if (!player.isClanLeader() || (getId() != getAllyId()))
|
||||
if (!player.isClanLeader() || (_clanId != _allyId))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THIS_FEATURE_IS_ONLY_AVAILABLE_TO_ALLIANCE_LEADERS);
|
||||
return;
|
||||
@ -2482,7 +2482,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
player.sendPacket(SystemMessageId.YOU_ARE_NOT_AUTHORIZED_TO_DO_THAT);
|
||||
return false;
|
||||
}
|
||||
if (System.currentTimeMillis() < getDissolvingExpiryTime())
|
||||
if (System.currentTimeMillis() < _dissolvingExpiryTime)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.AS_YOU_ARE_CURRENTLY_SCHEDULE_FOR_CLAN_DISSOLUTION_YOUR_CLAN_LEVEL_CANNOT_BE_INCREASED);
|
||||
return false;
|
||||
@ -2490,7 +2490,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
|
||||
boolean increaseClanLevel = false;
|
||||
|
||||
switch (getLevel())
|
||||
switch (_level)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
@ -2588,9 +2588,9 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
case 5:
|
||||
{
|
||||
// Upgrade to 6
|
||||
if ((getReputationScore() >= Config.CLAN_LEVEL_6_COST) && (getMembersCount() >= Config.CLAN_LEVEL_6_REQUIREMENT))
|
||||
if ((_reputationScore >= Config.CLAN_LEVEL_6_COST) && (_members.size() >= Config.CLAN_LEVEL_6_REQUIREMENT))
|
||||
{
|
||||
setReputationScore(getReputationScore() - Config.CLAN_LEVEL_6_COST, true);
|
||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_6_COST, true);
|
||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||
cr.addInt(Config.CLAN_LEVEL_6_COST);
|
||||
player.sendPacket(cr);
|
||||
@ -2601,9 +2601,9 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
case 6:
|
||||
{
|
||||
// Upgrade to 7
|
||||
if ((getReputationScore() >= Config.CLAN_LEVEL_7_COST) && (getMembersCount() >= Config.CLAN_LEVEL_7_REQUIREMENT))
|
||||
if ((_reputationScore >= Config.CLAN_LEVEL_7_COST) && (_members.size() >= Config.CLAN_LEVEL_7_REQUIREMENT))
|
||||
{
|
||||
setReputationScore(getReputationScore() - Config.CLAN_LEVEL_7_COST, true);
|
||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_7_COST, true);
|
||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||
cr.addInt(Config.CLAN_LEVEL_7_COST);
|
||||
player.sendPacket(cr);
|
||||
@ -2614,9 +2614,9 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
case 7:
|
||||
{
|
||||
// Upgrade to 8
|
||||
if ((getReputationScore() >= Config.CLAN_LEVEL_8_COST) && (getMembersCount() >= Config.CLAN_LEVEL_8_REQUIREMENT))
|
||||
if ((_reputationScore >= Config.CLAN_LEVEL_8_COST) && (_members.size() >= Config.CLAN_LEVEL_8_REQUIREMENT))
|
||||
{
|
||||
setReputationScore(getReputationScore() - Config.CLAN_LEVEL_8_COST, true);
|
||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_8_COST, true);
|
||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||
cr.addInt(Config.CLAN_LEVEL_8_COST);
|
||||
player.sendPacket(cr);
|
||||
@ -2627,12 +2627,12 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
case 8:
|
||||
{
|
||||
// Upgrade to 9
|
||||
if ((getReputationScore() >= Config.CLAN_LEVEL_9_COST) && (player.getInventory().getItemByItemId(9910) != null) && (getMembersCount() >= Config.CLAN_LEVEL_9_REQUIREMENT))
|
||||
if ((_reputationScore >= Config.CLAN_LEVEL_9_COST) && (player.getInventory().getItemByItemId(9910) != null) && (_members.size() >= Config.CLAN_LEVEL_9_REQUIREMENT))
|
||||
{
|
||||
// itemId 9910 == Blood Oath
|
||||
if (player.destroyItemByItemId("ClanLvl", 9910, 150, player.getTarget(), false))
|
||||
{
|
||||
setReputationScore(getReputationScore() - Config.CLAN_LEVEL_9_COST, true);
|
||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_9_COST, true);
|
||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||
cr.addInt(Config.CLAN_LEVEL_9_COST);
|
||||
player.sendPacket(cr);
|
||||
@ -2648,12 +2648,12 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
case 9:
|
||||
{
|
||||
// Upgrade to 10
|
||||
if ((getReputationScore() >= Config.CLAN_LEVEL_10_COST) && (player.getInventory().getItemByItemId(9911) != null) && (getMembersCount() >= Config.CLAN_LEVEL_10_REQUIREMENT))
|
||||
if ((_reputationScore >= Config.CLAN_LEVEL_10_COST) && (player.getInventory().getItemByItemId(9911) != null) && (_members.size() >= Config.CLAN_LEVEL_10_REQUIREMENT))
|
||||
{
|
||||
// itemId 9911 == Blood Alliance
|
||||
if (player.destroyItemByItemId("ClanLvl", 9911, 5, player.getTarget(), false))
|
||||
{
|
||||
setReputationScore(getReputationScore() - Config.CLAN_LEVEL_10_COST, true);
|
||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_10_COST, true);
|
||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||
cr.addInt(Config.CLAN_LEVEL_10_COST);
|
||||
player.sendPacket(cr);
|
||||
@ -2669,9 +2669,9 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
case 10:
|
||||
{
|
||||
// Upgrade to 11
|
||||
if ((getReputationScore() >= Config.CLAN_LEVEL_11_COST) && (getMembersCount() >= Config.CLAN_LEVEL_11_REQUIREMENT))
|
||||
if ((_reputationScore >= Config.CLAN_LEVEL_11_COST) && (_members.size() >= Config.CLAN_LEVEL_11_REQUIREMENT))
|
||||
{
|
||||
setReputationScore(getReputationScore() - Config.CLAN_LEVEL_11_COST, true);
|
||||
setReputationScore(_reputationScore - Config.CLAN_LEVEL_11_COST, true);
|
||||
final SystemMessage cr = SystemMessage.getSystemMessage(SystemMessageId.S1_POINT_S_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION);
|
||||
cr.addInt(Config.CLAN_LEVEL_11_COST);
|
||||
player.sendPacket(cr);
|
||||
@ -2698,7 +2698,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
|
||||
player.sendItemList(false);
|
||||
|
||||
changeLevel(getLevel() + 1);
|
||||
changeLevel(_level + 1);
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanLvlUp(player, this));
|
||||
@ -2711,7 +2711,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET clan_level = ? WHERE clan_id = ?"))
|
||||
{
|
||||
ps.setInt(1, level);
|
||||
ps.setInt(2, getId());
|
||||
ps.setInt(2, _clanId);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -2721,9 +2721,9 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
|
||||
setLevel(level);
|
||||
|
||||
if (getLeader().isOnline())
|
||||
if (_leader.isOnline())
|
||||
{
|
||||
final L2PcInstance leader = getLeader().getPlayerInstance();
|
||||
final L2PcInstance leader = _leader.getPlayerInstance();
|
||||
if (level > 4)
|
||||
{
|
||||
SiegeManager.getInstance().addSiegeSkills(leader);
|
||||
@ -2746,7 +2746,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
*/
|
||||
public void changeClanCrest(int crestId)
|
||||
{
|
||||
if (getCrestId() != 0)
|
||||
if (_crestId != 0)
|
||||
{
|
||||
CrestTable.getInstance().removeCrest(getCrestId());
|
||||
}
|
||||
@ -2757,12 +2757,12 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET crest_id = ? WHERE clan_id = ?"))
|
||||
{
|
||||
ps.setInt(1, crestId);
|
||||
ps.setInt(2, getId());
|
||||
ps.setInt(2, _clanId);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Could not update crest for clan " + getName() + " [" + getId() + "] : " + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, "Could not update crest for clan " + _name + " [" + _clanId + "] : " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
for (L2PcInstance member : getOnlineMembers(0))
|
||||
@ -2779,15 +2779,15 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
public void changeAllyCrest(int crestId, boolean onlyThisClan)
|
||||
{
|
||||
String sqlStatement = "UPDATE clan_data SET ally_crest_id = ? WHERE clan_id = ?";
|
||||
int allyId = getId();
|
||||
int allyId = _clanId;
|
||||
if (!onlyThisClan)
|
||||
{
|
||||
if (getAllyCrestId() != 0)
|
||||
if (_allyCrestId != 0)
|
||||
{
|
||||
CrestTable.getInstance().removeCrest(getAllyCrestId());
|
||||
}
|
||||
sqlStatement = "UPDATE clan_data SET ally_crest_id = ? WHERE ally_id = ?";
|
||||
allyId = getAllyId();
|
||||
allyId = _allyId;
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
@ -2829,7 +2829,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
*/
|
||||
public void changeLargeCrest(int crestId)
|
||||
{
|
||||
if (getCrestLargeId() != 0)
|
||||
if (_crestLargeId != 0)
|
||||
{
|
||||
CrestTable.getInstance().removeCrest(getCrestLargeId());
|
||||
}
|
||||
@ -2840,12 +2840,12 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET crest_large_id = ? WHERE clan_id = ?"))
|
||||
{
|
||||
ps.setInt(1, crestId);
|
||||
ps.setInt(2, getId());
|
||||
ps.setInt(2, _clanId);
|
||||
ps.executeUpdate();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Could not update large crest for clan " + getName() + " [" + getId() + "] : " + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, "Could not update large crest for clan " + _name + " [" + _clanId + "] : " + e.getMessage(), e);
|
||||
}
|
||||
|
||||
for (L2PcInstance member : getOnlineMembers(0))
|
||||
@ -3139,7 +3139,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
getVariables().set("PREVIOUS_HUNTING_POINTS", getHuntingPoints());
|
||||
|
||||
// Reset
|
||||
getMembers().forEach(L2ClanMember::resetBonus);
|
||||
_members.values().forEach(L2ClanMember::resetBonus);
|
||||
getVariables().remove("HUNTING_POINTS");
|
||||
|
||||
// force store
|
||||
@ -3154,7 +3154,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
{
|
||||
if (_vars == null)
|
||||
{
|
||||
_vars = new ClanVariables(getId());
|
||||
_vars = new ClanVariables(_clanId);
|
||||
if (Config.CLAN_VARIABLES_STORE_INTERVAL > 0)
|
||||
{
|
||||
ThreadPool.scheduleAtFixedRate(this::storeVariables, Config.CLAN_VARIABLES_STORE_INTERVAL, Config.CLAN_VARIABLES_STORE_INTERVAL);
|
||||
|
@ -855,7 +855,6 @@ public class L2ClanMember
|
||||
|
||||
private PlayerVariables getVariables()
|
||||
{
|
||||
final L2PcInstance player = getPlayerInstance();
|
||||
return player != null ? player.getVariables() : new PlayerVariables(_objectId);
|
||||
return _player != null ? _player.getVariables() : new PlayerVariables(_objectId);
|
||||
}
|
||||
}
|
||||
|
@ -162,7 +162,7 @@ public class L2CommandChannel extends AbstractPlayerGroup
|
||||
public List<L2PcInstance> getMembers()
|
||||
{
|
||||
final List<L2PcInstance> members = new LinkedList<>();
|
||||
for (L2Party party : getPartys())
|
||||
for (L2Party party : _parties)
|
||||
{
|
||||
members.addAll(party.getMembers());
|
||||
}
|
||||
|
@ -94,42 +94,41 @@ public final class L2Crest implements IIdentifiable
|
||||
public String getClientPath(L2PcInstance activeChar)
|
||||
{
|
||||
String path = null;
|
||||
switch (getType())
|
||||
switch (_type)
|
||||
{
|
||||
case PLEDGE:
|
||||
{
|
||||
activeChar.sendPacket(new PledgeCrest(getId(), getData()));
|
||||
path = "Crest.crest_" + Config.SERVER_ID + "_" + getId();
|
||||
activeChar.sendPacket(new PledgeCrest(_id, _data));
|
||||
path = "Crest.crest_" + Config.SERVER_ID + "_" + _id;
|
||||
break;
|
||||
}
|
||||
case PLEDGE_LARGE:
|
||||
{
|
||||
final byte[] data = getData();
|
||||
if (data != null)
|
||||
if (_data != null)
|
||||
{
|
||||
for (int i = 0; i <= 4; i++)
|
||||
{
|
||||
if (i < 4)
|
||||
{
|
||||
final byte[] fullChunk = new byte[14336];
|
||||
System.arraycopy(data, (14336 * i), fullChunk, 0, 14336);
|
||||
activeChar.sendPacket(new ExPledgeEmblem(getId(), fullChunk, 0, i));
|
||||
System.arraycopy(_data, (14336 * i), fullChunk, 0, 14336);
|
||||
activeChar.sendPacket(new ExPledgeEmblem(_id, fullChunk, 0, i));
|
||||
}
|
||||
else
|
||||
{
|
||||
final byte[] lastChunk = new byte[8320];
|
||||
System.arraycopy(data, (14336 * i), lastChunk, 0, 8320);
|
||||
activeChar.sendPacket(new ExPledgeEmblem(getId(), lastChunk, 0, i));
|
||||
System.arraycopy(_data, (14336 * i), lastChunk, 0, 8320);
|
||||
activeChar.sendPacket(new ExPledgeEmblem(_id, lastChunk, 0, i));
|
||||
}
|
||||
}
|
||||
}
|
||||
path = "Crest.crest_" + Config.SERVER_ID + "_" + getId() + "_l";
|
||||
path = "Crest.crest_" + Config.SERVER_ID + "_" + _id + "_l";
|
||||
break;
|
||||
}
|
||||
case ALLY:
|
||||
{
|
||||
activeChar.sendPacket(new AllyCrest(getId(), getData()));
|
||||
path = "Crest.crest_" + Config.SERVER_ID + "_" + getId();
|
||||
activeChar.sendPacket(new AllyCrest(_id, _data));
|
||||
path = "Crest.crest_" + Config.SERVER_ID + "_" + _id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +52,7 @@ public class L2Mentee
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("SELECT char_name, level, base_class FROM characters WHERE charId = ?"))
|
||||
{
|
||||
statement.setInt(1, getObjectId());
|
||||
statement.setInt(1, _objectId);
|
||||
try (ResultSet rset = statement.executeQuery())
|
||||
{
|
||||
if (rset.next())
|
||||
|
@ -148,15 +148,10 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
@Override
|
||||
public boolean decayMe()
|
||||
{
|
||||
final L2WorldRegion reg = getWorldRegion();
|
||||
synchronized (this)
|
||||
{
|
||||
_isSpawned = false;
|
||||
setWorldRegion(null);
|
||||
}
|
||||
|
||||
L2World.getInstance().removeVisibleObject(this, reg);
|
||||
_isSpawned = false;
|
||||
L2World.getInstance().removeVisibleObject(this, _worldRegion);
|
||||
L2World.getInstance().removeObject(this);
|
||||
setWorldRegion(null);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -180,7 +175,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
L2World.getInstance().addObject(this);
|
||||
|
||||
// Add the L2Object spawn to _visibleObjects and if necessary to _allplayers of its L2WorldRegion
|
||||
getWorldRegion().addVisibleObject(this);
|
||||
_worldRegion.addVisibleObject(this);
|
||||
}
|
||||
|
||||
// this can synchronize on others instances, so it's out of synchronized, to avoid deadlocks
|
||||
@ -242,7 +237,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
|
||||
public final boolean isSpawned()
|
||||
{
|
||||
return getWorldRegion() != null;
|
||||
return _worldRegion != null;
|
||||
}
|
||||
|
||||
public final void setSpawned(boolean value)
|
||||
@ -632,7 +627,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
@Override
|
||||
public Location getLocation()
|
||||
{
|
||||
return new Location(getX(), getY(), getZ(), getHeading());
|
||||
return new Location(_x.get(), _y.get(), _z.get(), _heading.get());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -680,13 +675,12 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
|
||||
if (_isSpawned)
|
||||
{
|
||||
final L2WorldRegion oldRegion = getWorldRegion();
|
||||
final L2WorldRegion newRegion = L2World.getInstance().getRegion(this);
|
||||
if ((newRegion != null) && (newRegion != oldRegion))
|
||||
if ((newRegion != null) && (newRegion != _worldRegion))
|
||||
{
|
||||
if (oldRegion != null)
|
||||
if (_worldRegion != null)
|
||||
{
|
||||
oldRegion.removeVisibleObject(this);
|
||||
_worldRegion.removeVisibleObject(this);
|
||||
}
|
||||
newRegion.addVisibleObject(this);
|
||||
L2World.getInstance().switchRegion(this, newRegion);
|
||||
@ -781,7 +775,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
*/
|
||||
public final double calculateDistance(int x, int y, int z, boolean includeZAxis, boolean squared)
|
||||
{
|
||||
final double distance = Math.pow(x - getX(), 2) + Math.pow(y - getY(), 2) + (includeZAxis ? Math.pow(z - getZ(), 2) : 0);
|
||||
final double distance = Math.pow(x - _x.get(), 2) + Math.pow(y - _y.get(), 2) + (includeZAxis ? Math.pow(z - _z.get(), 2) : 0);
|
||||
return squared ? distance : Math.sqrt(distance);
|
||||
}
|
||||
|
||||
@ -806,7 +800,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
*/
|
||||
public final double calculateDirectionTo(ILocational target)
|
||||
{
|
||||
int heading = Util.calculateHeadingFrom(this, target) - getHeading();
|
||||
int heading = Util.calculateHeadingFrom(this, target) - _heading.get();
|
||||
if (heading < 0)
|
||||
{
|
||||
heading = 65535 + heading;
|
||||
@ -851,7 +845,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
*/
|
||||
public boolean isVisibleFor(L2PcInstance player)
|
||||
{
|
||||
return !isInvisible() || player.canOverrideCond(PcCondOverride.SEE_ALL_PLAYERS);
|
||||
return !_isInvisible || player.canOverrideCond(PcCondOverride.SEE_ALL_PLAYERS);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -880,19 +874,18 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
return false;
|
||||
}
|
||||
|
||||
final L2WorldRegion worldRegion1 = worldObject.getWorldRegion();
|
||||
if (worldRegion1 == null)
|
||||
final L2WorldRegion worldRegion = worldObject.getWorldRegion();
|
||||
if (worldRegion == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final L2WorldRegion worldRegion2 = getWorldRegion();
|
||||
if (worldRegion2 == null)
|
||||
if (_worldRegion == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return worldRegion1.isSurroundingRegion(worldRegion2);
|
||||
return worldRegion.isSurroundingRegion(_worldRegion);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -904,6 +897,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getClass().getSimpleName() + ":" + getName() + "[" + getObjectId() + "]";
|
||||
return getClass().getSimpleName() + ":" + _name + "[" + _objectId + "]";
|
||||
}
|
||||
}
|
||||
|
@ -168,7 +168,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
private L2PcInstance getCheckedRandomMember(int itemId, L2Character target)
|
||||
{
|
||||
final List<L2PcInstance> availableMembers = new ArrayList<>();
|
||||
for (L2PcInstance member : getMembers())
|
||||
for (L2PcInstance member : _members)
|
||||
{
|
||||
if (member.getInventory().validateCapacityByItemId(itemId) && Util.checkIfInRange(Config.ALT_PARTY_RANGE2, target, member, true))
|
||||
{
|
||||
@ -195,7 +195,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
L2PcInstance member;
|
||||
try
|
||||
{
|
||||
member = getMembers().get(_itemLastLoot);
|
||||
member = _members.get(_itemLastLoot);
|
||||
if (member.getInventory().validateCapacityByItemId(ItemId) && Util.checkIfInRange(Config.ALT_PARTY_RANGE2, target, member, true))
|
||||
{
|
||||
return member;
|
||||
@ -260,7 +260,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
*/
|
||||
public void broadcastToPartyMembersNewLeader()
|
||||
{
|
||||
for (L2PcInstance member : getMembers())
|
||||
for (L2PcInstance member : _members)
|
||||
{
|
||||
if (member != null)
|
||||
{
|
||||
@ -279,7 +279,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
*/
|
||||
public void broadcastToPartyMembers(L2PcInstance player, IClientOutgoingPacket msg)
|
||||
{
|
||||
for (L2PcInstance member : getMembers())
|
||||
for (L2PcInstance member : _members)
|
||||
{
|
||||
if ((member != null) && (member.getObjectId() != player.getObjectId()))
|
||||
{
|
||||
@ -294,7 +294,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
*/
|
||||
public void addPartyMember(L2PcInstance player)
|
||||
{
|
||||
if (getMembers().contains(player))
|
||||
if (_members.contains(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -305,14 +305,14 @@ public class L2Party extends AbstractPlayerGroup
|
||||
}
|
||||
|
||||
// add player to party
|
||||
getMembers().add(player);
|
||||
_members.add(player);
|
||||
|
||||
// sends new member party window for all members
|
||||
// we do all actions before adding member to a list, this speeds things up a little
|
||||
player.sendPacket(new PartySmallWindowAll(player, this));
|
||||
|
||||
// sends pets/summons of party members
|
||||
for (L2PcInstance pMember : getMembers())
|
||||
for (L2PcInstance pMember : _members)
|
||||
{
|
||||
if (pMember != null)
|
||||
{
|
||||
@ -333,7 +333,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
msg.addString(player.getName());
|
||||
broadcastPacket(msg);
|
||||
|
||||
getMembers().stream().filter(member -> member != player).forEach(member -> member.sendPacket(new PartySmallWindowAdd(player, this)));
|
||||
_members.stream().filter(member -> member != player).forEach(member -> member.sendPacket(new PartySmallWindowAdd(player, this)));
|
||||
|
||||
// send the position of all party members to the new party member
|
||||
// player.sendPacket(new PartyMemberPosition(this));
|
||||
@ -357,7 +357,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
|
||||
// update partySpelled
|
||||
L2Summon summon;
|
||||
for (L2PcInstance member : getMembers())
|
||||
for (L2PcInstance member : _members)
|
||||
{
|
||||
if (member != null)
|
||||
{
|
||||
@ -439,7 +439,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
sm.addString(target.getName());
|
||||
sm.addSystemString(TACTICAL_SYS_STRINGS[tacticalSignId]);
|
||||
|
||||
getMembers().forEach(m ->
|
||||
_members.forEach(m ->
|
||||
{
|
||||
m.sendPacket(new ExTacticalSign(target, tacticalSignId));
|
||||
m.sendPacket(sm);
|
||||
@ -450,7 +450,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
// Sign already assigned
|
||||
// If the sign is applied on the same target, remove it
|
||||
_tacticalSigns.remove(tacticalSignId);
|
||||
getMembers().forEach(m -> m.sendPacket(new ExTacticalSign(tacticalTarget, 0)));
|
||||
_members.forEach(m -> m.sendPacket(new ExTacticalSign(tacticalTarget, 0)));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -462,7 +462,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
sm.addString(target.getName());
|
||||
sm.addSystemString(TACTICAL_SYS_STRINGS[tacticalSignId]);
|
||||
|
||||
getMembers().forEach(m ->
|
||||
_members.forEach(m ->
|
||||
{
|
||||
m.sendPacket(new ExTacticalSign(tacticalTarget, 0));
|
||||
m.sendPacket(new ExTacticalSign(target, tacticalSignId));
|
||||
@ -502,19 +502,19 @@ public class L2Party extends AbstractPlayerGroup
|
||||
*/
|
||||
public void removePartyMember(L2PcInstance player, MessageType type)
|
||||
{
|
||||
if (getMembers().contains(player))
|
||||
if (_members.contains(player))
|
||||
{
|
||||
final boolean isLeader = isLeader(player);
|
||||
if (!_disbanding)
|
||||
{
|
||||
if ((getMembers().size() == 2) || (isLeader && !Config.ALT_LEAVE_PARTY_LEADER && (type != MessageType.DISCONNECTED)))
|
||||
if ((_members.size() == 2) || (isLeader && !Config.ALT_LEAVE_PARTY_LEADER && (type != MessageType.DISCONNECTED)))
|
||||
{
|
||||
disbandParty();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
getMembers().remove(player);
|
||||
_members.remove(player);
|
||||
recalculatePartyLevel();
|
||||
|
||||
if (player.isInDuel())
|
||||
@ -573,25 +573,25 @@ public class L2Party extends AbstractPlayerGroup
|
||||
{
|
||||
player.sendPacket(ExCloseMPCC.STATIC_PACKET);
|
||||
}
|
||||
if (isLeader && (getMembers().size() > 1) && (Config.ALT_LEAVE_PARTY_LEADER || (type == MessageType.DISCONNECTED)))
|
||||
if (isLeader && (_members.size() > 1) && (Config.ALT_LEAVE_PARTY_LEADER || (type == MessageType.DISCONNECTED)))
|
||||
{
|
||||
msg = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_BECOME_THE_PARTY_LEADER);
|
||||
msg.addString(getLeader().getName());
|
||||
broadcastPacket(msg);
|
||||
broadcastToPartyMembersNewLeader();
|
||||
}
|
||||
else if (getMembers().size() == 1)
|
||||
else if (_members.size() == 1)
|
||||
{
|
||||
if (isInCommandChannel())
|
||||
{
|
||||
// delete the whole command channel when the party who opened the channel is disbanded
|
||||
if (getCommandChannel().getLeader().getObjectId() == getLeader().getObjectId())
|
||||
if (_commandChannel.getLeader().getObjectId() == getLeader().getObjectId())
|
||||
{
|
||||
getCommandChannel().disbandChannel();
|
||||
_commandChannel.disbandChannel();
|
||||
}
|
||||
else
|
||||
{
|
||||
getCommandChannel().removeParty(this);
|
||||
_commandChannel.removeParty(this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -653,7 +653,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
{
|
||||
if ((player != null) && !player.isInDuel())
|
||||
{
|
||||
if (getMembers().contains(player))
|
||||
if (_members.contains(player))
|
||||
{
|
||||
if (isLeader(player))
|
||||
{
|
||||
@ -663,9 +663,9 @@ public class L2Party extends AbstractPlayerGroup
|
||||
{
|
||||
// Swap party members
|
||||
final L2PcInstance temp = getLeader();
|
||||
final int p1 = getMembers().indexOf(player);
|
||||
getMembers().set(0, player);
|
||||
getMembers().set(p1, temp);
|
||||
final int p1 = _members.indexOf(player);
|
||||
_members.set(0, player);
|
||||
_members.set(p1, temp);
|
||||
|
||||
SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_BECOME_THE_PARTY_LEADER);
|
||||
msg.addString(getLeader().getName());
|
||||
@ -694,7 +694,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
*/
|
||||
private L2PcInstance getPlayerByName(String name)
|
||||
{
|
||||
for (L2PcInstance member : getMembers())
|
||||
for (L2PcInstance member : _members)
|
||||
{
|
||||
if (member.getName().equalsIgnoreCase(name))
|
||||
{
|
||||
@ -800,7 +800,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
// Check the number of party members that must be rewarded
|
||||
// (The party member must be in range to receive its reward)
|
||||
final List<L2PcInstance> toReward = new LinkedList<>();
|
||||
for (L2PcInstance member : getMembers())
|
||||
for (L2PcInstance member : _members)
|
||||
{
|
||||
if (Util.checkIfInRange(Config.ALT_PARTY_RANGE2, target, member, true))
|
||||
{
|
||||
@ -930,11 +930,11 @@ public class L2Party extends AbstractPlayerGroup
|
||||
public void recalculatePartyLevel()
|
||||
{
|
||||
int newLevel = 0;
|
||||
for (L2PcInstance member : getMembers())
|
||||
for (L2PcInstance member : _members)
|
||||
{
|
||||
if (member == null)
|
||||
{
|
||||
getMembers().remove(member);
|
||||
_members.remove(member);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -53,12 +53,12 @@ public class L2SiegeClan
|
||||
|
||||
flag.deleteMe();
|
||||
|
||||
return getFlag().remove(flag);
|
||||
return _flags.remove(flag);
|
||||
}
|
||||
|
||||
public void removeFlags()
|
||||
{
|
||||
for (L2Npc flag : getFlag())
|
||||
for (L2Npc flag : _flags)
|
||||
{
|
||||
removeFlag(flag);
|
||||
}
|
||||
|
@ -511,7 +511,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
newlocz = loc.getZ();
|
||||
setLocation(loc);
|
||||
}
|
||||
else if ((getX() == 0) && (getY() == 0))
|
||||
else if ((_location.getX() == 0) && (_location.getY() == 0))
|
||||
{
|
||||
LOGGER.warning("NPC " + npc + " doesn't have spawn location!");
|
||||
return null;
|
||||
@ -519,9 +519,9 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
else
|
||||
{
|
||||
// The L2NpcInstance is spawned at the exact position (Lox, Locy, Locz)
|
||||
newlocx = getX();
|
||||
newlocy = getY();
|
||||
newlocz = getZ();
|
||||
newlocx = _location.getX();
|
||||
newlocy = _location.getY();
|
||||
newlocz = _location.getZ();
|
||||
}
|
||||
|
||||
// If random spawn system is enabled
|
||||
@ -539,16 +539,16 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
}
|
||||
|
||||
// Set is not random walk default value
|
||||
npc.setRandomWalking(getRandomWalking());
|
||||
npc.setRandomWalking(_randomWalk);
|
||||
|
||||
// Set the heading of the L2NpcInstance (random heading if not defined)
|
||||
if (getHeading() == -1)
|
||||
if (_location.getHeading() == -1)
|
||||
{
|
||||
npc.setHeading(Rnd.nextInt(61794));
|
||||
}
|
||||
else
|
||||
{
|
||||
npc.setHeading(getHeading());
|
||||
npc.setHeading(_location.getHeading());
|
||||
}
|
||||
|
||||
// Set custom Npc server side name and title
|
||||
@ -670,7 +670,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "L2Spawn ID: " + getId() + " " + getLocation();
|
||||
return "L2Spawn ID: " + _template.getId() + " " + _location;
|
||||
}
|
||||
|
||||
public final boolean getRandomWalking()
|
||||
|
@ -238,7 +238,7 @@ public final class L2WorldRegion
|
||||
if (object.isPlayable())
|
||||
{
|
||||
// if this is the first player to enter the region, activate self & neighbors
|
||||
if (!isActive() && (!Config.GRIDS_ALWAYS_ON))
|
||||
if (!_active && (!Config.GRIDS_ALWAYS_ON))
|
||||
{
|
||||
startActivation();
|
||||
}
|
||||
|
@ -190,6 +190,6 @@ public class Location implements IPositionable
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "[" + getClass().getSimpleName() + "] X: " + getX() + " Y: " + getY() + " Z: " + getZ() + " Heading: " + _heading;
|
||||
return "[" + getClass().getSimpleName() + "] X: " + _x + " Y: " + _y + " Z: " + _z + " Heading: " + _heading;
|
||||
}
|
||||
}
|
||||
|
@ -136,16 +136,16 @@ public final class MobGroup
|
||||
|
||||
public void spawnGroup(int x, int y, int z)
|
||||
{
|
||||
if (getActiveMobCount() > 0)
|
||||
if (getMobs().size() > 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < getMaxMobCount(); i++)
|
||||
for (int i = 0; i < _maxMobCount; i++)
|
||||
{
|
||||
final L2GroupSpawn spawn = new L2GroupSpawn(getTemplate());
|
||||
final L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate);
|
||||
|
||||
final int signX = (Rnd.nextInt(2) == 0) ? -1 : 1;
|
||||
final int signY = (Rnd.nextInt(2) == 0) ? -1 : 1;
|
||||
@ -200,12 +200,12 @@ public final class MobGroup
|
||||
{
|
||||
removeDead();
|
||||
|
||||
if (getActiveMobCount() == 0)
|
||||
if (getMobs().size() == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
int choice = Rnd.nextInt(getActiveMobCount());
|
||||
int choice = Rnd.nextInt(getMobs().size());
|
||||
for (L2ControllableMobInstance mob : getMobs())
|
||||
{
|
||||
if (--choice == 0)
|
||||
@ -220,7 +220,7 @@ public final class MobGroup
|
||||
{
|
||||
removeDead();
|
||||
|
||||
if (getActiveMobCount() == 0)
|
||||
if (getMobs().size() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public class MobGroupTable
|
||||
|
||||
public MobGroup[] getGroups()
|
||||
{
|
||||
return _groupMap.values().toArray(new MobGroup[getGroupCount()]);
|
||||
return _groupMap.values().toArray(new MobGroup[_groupMap.size()]);
|
||||
}
|
||||
|
||||
public boolean removeGroup(int groupKey)
|
||||
|
@ -67,34 +67,34 @@ public final class Petition
|
||||
{
|
||||
setState(endState);
|
||||
|
||||
if ((getResponder() != null) && getResponder().isOnline())
|
||||
if ((_responder != null) && _responder.isOnline())
|
||||
{
|
||||
if (endState == PetitionState.RESPONDER_REJECT)
|
||||
{
|
||||
getPetitioner().sendMessage("Your petition was rejected. Please try again later.");
|
||||
_petitioner.sendMessage("Your petition was rejected. Please try again later.");
|
||||
}
|
||||
else
|
||||
{
|
||||
// Ending petition consultation with <Player>.
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.PETITION_CONSULTATION_WITH_C1_HAS_ENDED);
|
||||
sm.addString(getPetitioner().getName());
|
||||
getResponder().sendPacket(sm);
|
||||
sm.addString(_petitioner.getName());
|
||||
_responder.sendPacket(sm);
|
||||
|
||||
if (endState == PetitionState.PETITIONER_CANCEL)
|
||||
{
|
||||
// Receipt No. <ID> petition cancelled.
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.RECEIPT_NO_S1_PETITION_CANCELLED);
|
||||
sm.addInt(getId());
|
||||
getResponder().sendPacket(sm);
|
||||
sm.addInt(_id);
|
||||
_responder.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// End petition consultation and inform them, if they are still online. And if petitioner is online, enable Evaluation button
|
||||
if ((getPetitioner() != null) && getPetitioner().isOnline())
|
||||
if ((_petitioner != null) && _petitioner.isOnline())
|
||||
{
|
||||
getPetitioner().sendPacket(SystemMessageId.THIS_ENDS_THE_GM_PETITION_CONSULTATION_NPLEASE_GIVE_US_FEEDBACK_ON_THE_PETITION_SERVICE);
|
||||
getPetitioner().sendPacket(PetitionVotePacket.STATIC_PACKET);
|
||||
_petitioner.sendPacket(SystemMessageId.THIS_ENDS_THE_GM_PETITION_CONSULTATION_NPLEASE_GIVE_US_FEEDBACK_ON_THE_PETITION_SERVICE);
|
||||
_petitioner.sendPacket(PetitionVotePacket.STATIC_PACKET);
|
||||
}
|
||||
|
||||
PetitionManager.getInstance().getCompletedPetitions().put(getId(), this);
|
||||
@ -138,7 +138,7 @@ public final class Petition
|
||||
|
||||
public void sendPetitionerPacket(IClientOutgoingPacket responsePacket)
|
||||
{
|
||||
if ((getPetitioner() == null) || !getPetitioner().isOnline())
|
||||
if ((_petitioner == null) || !_petitioner.isOnline())
|
||||
{
|
||||
// Allows petitioners to see the results of their petition when
|
||||
// they log back into the game.
|
||||
@ -147,18 +147,18 @@ public final class Petition
|
||||
return;
|
||||
}
|
||||
|
||||
getPetitioner().sendPacket(responsePacket);
|
||||
_petitioner.sendPacket(responsePacket);
|
||||
}
|
||||
|
||||
public void sendResponderPacket(IClientOutgoingPacket responsePacket)
|
||||
{
|
||||
if ((getResponder() == null) || !getResponder().isOnline())
|
||||
if ((_responder == null) || !_responder.isOnline())
|
||||
{
|
||||
endPetitionConsultation(PetitionState.RESPONDER_MISSING);
|
||||
return;
|
||||
}
|
||||
|
||||
getResponder().sendPacket(responsePacket);
|
||||
_responder.sendPacket(responsePacket);
|
||||
}
|
||||
|
||||
public void setState(PetitionState state)
|
||||
@ -168,7 +168,7 @@ public final class Petition
|
||||
|
||||
public void setResponder(L2PcInstance respondingAdmin)
|
||||
{
|
||||
if (getResponder() != null)
|
||||
if (_responder != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ public final class TempItem
|
||||
{
|
||||
private final int _itemId;
|
||||
private int _quantity;
|
||||
private final int _referencePrice;
|
||||
private final long _referencePrice;
|
||||
private final String _itemName;
|
||||
|
||||
/**
|
||||
@ -60,7 +60,7 @@ public final class TempItem
|
||||
_quantity = quantity;
|
||||
}
|
||||
|
||||
public int getReferencePrice()
|
||||
public long getReferencePrice()
|
||||
{
|
||||
return _referencePrice;
|
||||
}
|
||||
|
@ -195,7 +195,7 @@ public class TradeList
|
||||
*/
|
||||
public synchronized TradeItem addItem(int objectId, long count, long price)
|
||||
{
|
||||
if (isLocked())
|
||||
if (_locked)
|
||||
{
|
||||
LOGGER.warning(_owner.getName() + ": Attempt to modify locked TradeList!");
|
||||
return null;
|
||||
@ -209,13 +209,13 @@ public class TradeList
|
||||
}
|
||||
|
||||
final L2ItemInstance item = (L2ItemInstance) o;
|
||||
if (!(item.isTradeable() || (getOwner().isGM() && Config.GM_TRADE_RESTRICTED_ITEMS)) || item.isQuestItem())
|
||||
if (!(item.isTradeable() || (_owner.isGM() && Config.GM_TRADE_RESTRICTED_ITEMS)) || item.isQuestItem())
|
||||
{
|
||||
LOGGER.warning(_owner.getName() + ": Attempt to add a restricted item!");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (!getOwner().getInventory().canManipulateWithItemId(item.getId()))
|
||||
if (!_owner.getInventory().canManipulateWithItemId(item.getId()))
|
||||
{
|
||||
LOGGER.warning(_owner.getName() + ": Attempt to add an item that can't manipualte!");
|
||||
return null;
|
||||
@ -265,7 +265,7 @@ public class TradeList
|
||||
*/
|
||||
public synchronized TradeItem addItemByItemId(int itemId, long count, long price)
|
||||
{
|
||||
if (isLocked())
|
||||
if (_locked)
|
||||
{
|
||||
LOGGER.warning(_owner.getName() + ": Attempt to modify locked TradeList!");
|
||||
return null;
|
||||
@ -312,7 +312,7 @@ public class TradeList
|
||||
*/
|
||||
public synchronized TradeItem removeItem(int objectId, int itemId, long count)
|
||||
{
|
||||
if (isLocked())
|
||||
if (_locked)
|
||||
{
|
||||
LOGGER.warning(_owner.getName() + ": Attempt to modify locked TradeList!");
|
||||
return null;
|
||||
@ -607,15 +607,15 @@ public class TradeList
|
||||
boolean success = false;
|
||||
|
||||
// check weight and slots
|
||||
if (!getOwner().getInventory().validateWeight(partnerList.calcItemsWeight()) || !partnerList.getOwner().getInventory().validateWeight(calcItemsWeight()))
|
||||
if ((!_owner.getInventory().validateWeight(partnerList.calcItemsWeight())) || !(partnerList.getOwner().getInventory().validateWeight(calcItemsWeight())))
|
||||
{
|
||||
partnerList.getOwner().sendPacket(SystemMessageId.YOU_HAVE_EXCEEDED_THE_WEIGHT_LIMIT);
|
||||
getOwner().sendPacket(SystemMessageId.YOU_HAVE_EXCEEDED_THE_WEIGHT_LIMIT);
|
||||
_owner.sendPacket(SystemMessageId.YOU_HAVE_EXCEEDED_THE_WEIGHT_LIMIT);
|
||||
}
|
||||
else if (!getOwner().getInventory().validateCapacity(partnerList.countItemsSlots(getOwner())) || !partnerList.getOwner().getInventory().validateCapacity(countItemsSlots(partnerList.getOwner())))
|
||||
else if ((!_owner.getInventory().validateCapacity(partnerList.countItemsSlots(getOwner()))) || (!partnerList.getOwner().getInventory().validateCapacity(countItemsSlots(partnerList.getOwner()))))
|
||||
{
|
||||
partnerList.getOwner().sendPacket(SystemMessageId.YOUR_INVENTORY_IS_FULL);
|
||||
getOwner().sendPacket(SystemMessageId.YOUR_INVENTORY_IS_FULL);
|
||||
_owner.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_FULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -624,7 +624,7 @@ public class TradeList
|
||||
final InventoryUpdate partnerIU = Config.FORCE_INVENTORY_UPDATE ? null : new InventoryUpdate();
|
||||
|
||||
// Transfer items
|
||||
partnerList.TransferItems(getOwner(), partnerIU, ownerIU);
|
||||
partnerList.TransferItems(_owner, partnerIU, ownerIU);
|
||||
TransferItems(partnerList.getOwner(), ownerIU, partnerIU);
|
||||
|
||||
// Send inventory update packet
|
||||
@ -649,7 +649,7 @@ public class TradeList
|
||||
}
|
||||
// Finish the trade
|
||||
partnerList.getOwner().onTradeFinish(success);
|
||||
getOwner().onTradeFinish(success);
|
||||
_owner.onTradeFinish(success);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -705,7 +705,7 @@ public class TradeList
|
||||
// item with this objectId and price not found in tradelist
|
||||
if (!found)
|
||||
{
|
||||
if (isPackaged())
|
||||
if (_packaged)
|
||||
{
|
||||
Util.handleIllegalPlayerAction(player, "[TradeList.privateStoreBuy()] Player " + player.getName() + " tried to cheat the package sell and buy only a part of the package! Ban this player for bot usage!", Config.DEFAULT_PUNISH);
|
||||
return 2;
|
||||
|
@ -212,7 +212,7 @@ public class L2Attackable extends L2Npc
|
||||
@Override
|
||||
public void reduceCurrentHp(double value, L2Character attacker, Skill skill, boolean isDOT, boolean directlyToHp, boolean critical, boolean reflect)
|
||||
{
|
||||
if (isRaid() && !isMinion() && (attacker != null) && (attacker.getParty() != null) && attacker.getParty().isInCommandChannel() && attacker.getParty().getCommandChannel().meetRaidWarCondition(this))
|
||||
if (_isRaid && !isMinion() && (attacker != null) && (attacker.getParty() != null) && attacker.getParty().isInCommandChannel() && attacker.getParty().getCommandChannel().meetRaidWarCondition(this))
|
||||
{
|
||||
if (_firstCommandChannelAttacked == null) // looting right isn't set
|
||||
{
|
||||
@ -243,7 +243,7 @@ public class L2Attackable extends L2Npc
|
||||
addDamage(attacker, (int) value, skill);
|
||||
|
||||
// Check Raidboss attack. Character will be petrified if attacking a raid that's more than 8 levels lower. In retail you deal damage to raid before curse.
|
||||
if (isRaid() && giveRaidCurse() && !Config.RAID_DISABLE_CURSE)
|
||||
if (_isRaid && giveRaidCurse() && !Config.RAID_DISABLE_CURSE)
|
||||
{
|
||||
if (attacker.getLevel() > (getLevel() + 8))
|
||||
{
|
||||
@ -390,7 +390,7 @@ public class L2Attackable extends L2Npc
|
||||
}
|
||||
|
||||
// Calculate raidboss points
|
||||
if (isRaid() && !isRaidMinion())
|
||||
if (_isRaid && !_isRaidMinion)
|
||||
{
|
||||
final L2PcInstance player = (maxDealer != null) && maxDealer.isOnline() ? maxDealer : lastAttacker.getActingPlayer();
|
||||
broadcastPacket(SystemMessage.getSystemMessage(SystemMessageId.CONGRATULATIONS_YOUR_RAID_WAS_SUCCESSFUL));
|
||||
@ -484,7 +484,7 @@ public class L2Attackable extends L2Npc
|
||||
double exp = expSp[0];
|
||||
double sp = expSp[1];
|
||||
|
||||
if (Config.CHAMPION_ENABLE && isChampion())
|
||||
if (Config.CHAMPION_ENABLE && _champion)
|
||||
{
|
||||
exp *= Config.CHAMPION_REWARDS_EXP_SP;
|
||||
sp *= Config.CHAMPION_REWARDS_EXP_SP;
|
||||
@ -493,8 +493,8 @@ public class L2Attackable extends L2Npc
|
||||
exp *= penalty;
|
||||
|
||||
// Check for an over-hit enabled strike
|
||||
final L2Character overhitAttacker = getOverhitAttacker();
|
||||
if (isOverhit() && (overhitAttacker != null) && (overhitAttacker.getActingPlayer() != null) && (attacker == overhitAttacker.getActingPlayer()))
|
||||
final L2Character overhitAttacker = _overhitAttacker;
|
||||
if (_overhit && (overhitAttacker != null) && (overhitAttacker.getActingPlayer() != null) && (attacker == overhitAttacker.getActingPlayer()))
|
||||
{
|
||||
attacker.sendPacket(SystemMessageId.OVER_HIT);
|
||||
exp += calculateOverhitExp(exp);
|
||||
@ -519,7 +519,7 @@ public class L2Attackable extends L2Npc
|
||||
}
|
||||
clan.addHuntingPoints(attacker, this, finalExp);
|
||||
}
|
||||
attacker.updateVitalityPoints(getVitalityPoints(attacker.getLevel(), exp, isRaid()), true, false);
|
||||
attacker.updateVitalityPoints(getVitalityPoints(attacker.getLevel(), exp, _isRaid), true, false);
|
||||
PcCafePointsManager.getInstance().givePcCafePoint(attacker, exp);
|
||||
}
|
||||
}
|
||||
@ -596,7 +596,7 @@ public class L2Attackable extends L2Npc
|
||||
double exp = expSp[0];
|
||||
double sp = expSp[1];
|
||||
|
||||
if (Config.CHAMPION_ENABLE && isChampion())
|
||||
if (Config.CHAMPION_ENABLE && _champion)
|
||||
{
|
||||
exp *= Config.CHAMPION_REWARDS_EXP_SP;
|
||||
sp *= Config.CHAMPION_REWARDS_EXP_SP;
|
||||
@ -607,8 +607,8 @@ public class L2Attackable extends L2Npc
|
||||
|
||||
// Check for an over-hit enabled strike
|
||||
// (When in party, the over-hit exp bonus is given to the whole party and splitted proportionally through the party members)
|
||||
final L2Character overhitAttacker = getOverhitAttacker();
|
||||
if (isOverhit() && (overhitAttacker != null) && (overhitAttacker.getActingPlayer() != null) && (attacker == overhitAttacker.getActingPlayer()))
|
||||
final L2Character overhitAttacker = _overhitAttacker;
|
||||
if (_overhit && (overhitAttacker != null) && (overhitAttacker.getActingPlayer() != null) && (attacker == overhitAttacker.getActingPlayer()))
|
||||
{
|
||||
attacker.sendPacket(SystemMessageId.OVER_HIT);
|
||||
exp += calculateOverhitExp(exp);
|
||||
@ -988,7 +988,7 @@ public class L2Attackable extends L2Npc
|
||||
{
|
||||
final L2Item item = ItemTable.getInstance().getTemplate(drop.getId());
|
||||
// Check if the autoLoot mode is active
|
||||
if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))))
|
||||
if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!_isRaid && Config.AUTO_LOOT) || (_isRaid && Config.AUTO_LOOT_RAIDS))))
|
||||
{
|
||||
// do nothing
|
||||
}
|
||||
@ -1030,7 +1030,7 @@ public class L2Attackable extends L2Npc
|
||||
{
|
||||
final L2Item item = ItemTable.getInstance().getTemplate(drop.getId());
|
||||
// Check if the autoLoot mode is active
|
||||
if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!isRaid() && Config.AUTO_LOOT) || (isRaid() && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS))
|
||||
if (Config.AUTO_LOOT_ITEM_IDS.contains(item.getId()) || isFlying() || (!item.hasExImmediateEffect() && ((!_isRaid && Config.AUTO_LOOT) || (_isRaid && Config.AUTO_LOOT_RAIDS))) || (item.hasExImmediateEffect() && Config.AUTO_LOOT_HERBS))
|
||||
{
|
||||
player.doAutoLoot(this, drop); // Give the item(s) to the L2PcInstance that has killed the L2Attackable
|
||||
}
|
||||
@ -1040,7 +1040,7 @@ public class L2Attackable extends L2Npc
|
||||
}
|
||||
|
||||
// Broadcast message if RaidBoss was defeated
|
||||
if (isRaid() && !isRaidMinion())
|
||||
if (_isRaid && !_isRaidMinion)
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_DIED_AND_DROPPED_S3_S2_S);
|
||||
sm.addString(getName());
|
||||
@ -1052,7 +1052,7 @@ public class L2Attackable extends L2Npc
|
||||
}
|
||||
|
||||
// Apply Special Item drop with random(rnd) quantity(qty) for champions.
|
||||
if (Config.CHAMPION_ENABLE && isChampion() && ((Config.CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE > 0) || (Config.CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE > 0)))
|
||||
if (Config.CHAMPION_ENABLE && _champion && ((Config.CHAMPION_REWARD_LOWER_LVL_ITEM_CHANCE > 0) || (Config.CHAMPION_REWARD_HIGHER_LVL_ITEM_CHANCE > 0)))
|
||||
{
|
||||
int champqty = Rnd.get(Config.CHAMPION_REWARD_QTY);
|
||||
final ItemHolder item = new ItemHolder(Config.CHAMPION_REWARD_ID, ++champqty);
|
||||
@ -1234,7 +1234,7 @@ public class L2Attackable extends L2Npc
|
||||
*/
|
||||
public boolean checkSpoilOwner(L2PcInstance sweeper, boolean sendMessage)
|
||||
{
|
||||
if ((sweeper.getObjectId() != getSpoilerObjectId()) && !sweeper.isInLooterParty(getSpoilerObjectId()))
|
||||
if ((sweeper.getObjectId() != _spoilerObjectId) && !sweeper.isInLooterParty(_spoilerObjectId))
|
||||
{
|
||||
if (sendMessage)
|
||||
{
|
||||
@ -1438,7 +1438,7 @@ public class L2Attackable extends L2Npc
|
||||
public double calculateOverhitExp(double exp)
|
||||
{
|
||||
// Get the percentage based on the total of extra (over-hit) damage done relative to the total (maximum) ammount of HP on the L2Attackable
|
||||
double overhitPercentage = ((getOverhitDamage() * 100) / getMaxHp());
|
||||
double overhitPercentage = ((_overhitDamage * 100) / getMaxHp());
|
||||
|
||||
// Over-hit damage percentages are limited to 25% max
|
||||
if (overhitPercentage > 25)
|
||||
@ -1512,7 +1512,7 @@ public class L2Attackable extends L2Npc
|
||||
if (Config.CHAMPION_ENABLE)
|
||||
{
|
||||
// Set champion on next spawn
|
||||
if (isMonster() && !getTemplate().isUndying() && !isRaid() && !isRaidMinion() && (Config.CHAMPION_FREQUENCY > 0) && (getLevel() >= Config.CHAMP_MIN_LVL) && (getLevel() <= Config.CHAMP_MAX_LVL) && (Config.CHAMPION_ENABLE_IN_INSTANCES || (getInstanceId() == 0)))
|
||||
if (isMonster() && !getTemplate().isUndying() && !_isRaid && !_isRaidMinion && (Config.CHAMPION_FREQUENCY > 0) && (getLevel() >= Config.CHAMP_MIN_LVL) && (getLevel() <= Config.CHAMP_MAX_LVL) && (Config.CHAMPION_ENABLE_IN_INSTANCES || (getInstanceId() == 0)))
|
||||
{
|
||||
if (Rnd.get(100) < Config.CHAMPION_FREQUENCY)
|
||||
{
|
||||
@ -1737,7 +1737,7 @@ public class L2Attackable extends L2Npc
|
||||
*/
|
||||
public boolean useVitalityRate()
|
||||
{
|
||||
return !isChampion() || Config.CHAMPION_ENABLE_VITALITY;
|
||||
return !_champion || Config.CHAMPION_ENABLE_VITALITY;
|
||||
}
|
||||
|
||||
/** Return True if the L2Character is RaidBoss or his minion. */
|
||||
|
@ -499,13 +499,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public double getCollisionRadius()
|
||||
{
|
||||
final double defaultCollisionRadius = getTemplate().getCollisionRadius();
|
||||
final double defaultCollisionRadius = _template.getCollisionRadius();
|
||||
return _transform.map(transform -> transform.getCollisionRadius(this, defaultCollisionRadius)).orElse(defaultCollisionRadius);
|
||||
}
|
||||
|
||||
public double getCollisionHeight()
|
||||
{
|
||||
final double defaultCollisionHeight = getTemplate().getCollisionHeight();
|
||||
final double defaultCollisionHeight = _template.getCollisionHeight();
|
||||
return _transform.map(transform -> transform.getCollisionHeight(this, defaultCollisionHeight)).orElse(defaultCollisionHeight);
|
||||
}
|
||||
|
||||
@ -530,7 +530,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
protected void initCharStatusUpdateValues()
|
||||
{
|
||||
_hpUpdateIncCheck = getMaxHp();
|
||||
_hpUpdateIncCheck = _stat.getMaxHp();
|
||||
_hpUpdateInterval = _hpUpdateIncCheck / MAX_HP_BAR_PX;
|
||||
_hpUpdateDecCheck = _hpUpdateIncCheck - _hpUpdateInterval;
|
||||
}
|
||||
@ -550,9 +550,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Removes itself from the summoned list.
|
||||
if ((getSummoner() != null))
|
||||
if ((_summoner != null))
|
||||
{
|
||||
getSummoner().removeSummonedNpc(getObjectId());
|
||||
_summoner.removeSummonedNpc(getObjectId());
|
||||
}
|
||||
|
||||
// Stop on creature see task and clear the data
|
||||
@ -584,7 +584,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
try
|
||||
{
|
||||
if (!isTeleporting())
|
||||
if (!_isTeleporting)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -649,8 +649,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
*/
|
||||
protected boolean needHpUpdate()
|
||||
{
|
||||
final double currentHp = getCurrentHp();
|
||||
final double maxHp = getMaxHp();
|
||||
final double currentHp = _status.getCurrentHp();
|
||||
final double maxHp = _stat.getMaxHp();
|
||||
|
||||
if ((currentHp <= 1.0) || (maxHp < MAX_HP_BAR_PX))
|
||||
{
|
||||
@ -703,8 +703,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// HP
|
||||
su.addUpdate(StatusUpdateType.MAX_HP, getMaxHp());
|
||||
su.addUpdate(StatusUpdateType.CUR_HP, (int) getCurrentHp());
|
||||
su.addUpdate(StatusUpdateType.MAX_HP, _stat.getMaxHp());
|
||||
su.addUpdate(StatusUpdateType.CUR_HP, (int) _status.getCurrentHp());
|
||||
|
||||
// MP
|
||||
computeStatusUpdate(su, StatusUpdateType.MAX_MP);
|
||||
@ -1053,7 +1053,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
mpConsume = weaponItem.getReducedMpConsume();
|
||||
}
|
||||
mpConsume = isAffected(EffectFlag.CHEAPSHOT) ? 0 : mpConsume;
|
||||
if (getCurrentMp() < mpConsume)
|
||||
if (_status.getCurrentMp() < mpConsume)
|
||||
{
|
||||
// If L2PcInstance doesn't have enough MP, stop the attack
|
||||
ThreadPool.schedule(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), 1000);
|
||||
@ -1065,7 +1065,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
// If L2PcInstance have enough MP, the bow consumes it
|
||||
if (mpConsume > 0)
|
||||
{
|
||||
getStatus().reduceMp(mpConsume);
|
||||
_status.reduceMp(mpConsume);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1073,7 +1073,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
final WeaponType attackType = getAttackType();
|
||||
final boolean isTwoHanded = (weaponItem != null) && (weaponItem.getBodyPart() == L2Item.SLOT_LR_HAND);
|
||||
final int timeAtk = Formulas.calculateTimeBetweenAttacks(getPAtkSpd());
|
||||
final int timeAtk = Formulas.calculateTimeBetweenAttacks(_stat.getPAtkSpd());
|
||||
final int timeToHit = Formulas.calculateTimeToHit(timeAtk, weaponType, isTwoHanded, false);
|
||||
_attackEndTime = System.nanoTime() + (TimeUnit.MILLISECONDS.toNanos(timeAtk));
|
||||
|
||||
@ -1196,12 +1196,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// H5 Changes: without Polearm Mastery (skill 216) max simultaneous attacks is 3 (1 by default + 2 in skill 3599).
|
||||
int attackCountMax = (int) getStat().getValue(Stats.ATTACK_COUNT_MAX, 1);
|
||||
if ((attackCountMax > 1) && !(getStat().getValue(Stats.PHYSICAL_POLEARM_TARGET_SINGLE, 0) > 0))
|
||||
int attackCountMax = (int) _stat.getValue(Stats.ATTACK_COUNT_MAX, 1);
|
||||
if ((attackCountMax > 1) && !(_stat.getValue(Stats.PHYSICAL_POLEARM_TARGET_SINGLE, 0) > 0))
|
||||
{
|
||||
final double headingAngle = Util.convertHeadingToDegree(getHeading());
|
||||
final int maxRadius = getStat().getPhysicalAttackRadius();
|
||||
final int physicalAttackAngle = getStat().getPhysicalAttackAngle();
|
||||
final int maxRadius = _stat.getPhysicalAttackRadius();
|
||||
final int physicalAttackAngle = _stat.getPhysicalAttackAngle();
|
||||
for (L2Character obj : L2World.getInstance().getVisibleObjects(this, L2Character.class, maxRadius))
|
||||
{
|
||||
// Skip main target.
|
||||
@ -1251,7 +1251,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
if (!miss)
|
||||
{
|
||||
shld = Formulas.calcShldUse(this, target);
|
||||
crit = Formulas.calcCrit(getStat().getCriticalHit(), this, target, null);
|
||||
crit = Formulas.calcCrit(_stat.getCriticalHit(), this, target, null);
|
||||
damage = (int) Formulas.calcAutoAttackDamage(this, target, shld, crit, shotConsumed);
|
||||
if (halfDamage)
|
||||
{
|
||||
@ -1294,7 +1294,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Try casting the skill
|
||||
final SkillCaster skillCaster = SkillCaster.castSkill(this, getTarget(), skill, item, castingType, ctrlPressed, shiftPressed);
|
||||
final SkillCaster skillCaster = SkillCaster.castSkill(this, _target, skill, item, castingType, ctrlPressed, shiftPressed);
|
||||
if ((skillCaster == null) && isPlayer())
|
||||
{
|
||||
// Skill casting failed, notify player.
|
||||
@ -1612,7 +1612,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
// killing is only possible one time
|
||||
synchronized (this)
|
||||
{
|
||||
if (isDead())
|
||||
if (_isDead)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -1636,7 +1636,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
stopMove(null);
|
||||
|
||||
// Stop HP/MP/CP Regeneration task
|
||||
getStatus().stopHpMpRegeneration();
|
||||
_status.stopHpMpRegeneration();
|
||||
|
||||
if (isMonster())
|
||||
{
|
||||
@ -1676,9 +1676,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Removes itself from the summoned list.
|
||||
if ((getSummoner() != null))
|
||||
if ((_summoner != null))
|
||||
{
|
||||
getSummoner().removeSummonedNpc(getObjectId());
|
||||
_summoner.removeSummonedNpc(getObjectId());
|
||||
}
|
||||
|
||||
// Remove all effects, do not broadcast changes.
|
||||
@ -1696,26 +1696,26 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
/** Sets HP, MP and CP and revives the L2Character. */
|
||||
public void doRevive()
|
||||
{
|
||||
if (!isDead())
|
||||
if (!_isDead)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (!isTeleporting())
|
||||
if (!_isTeleporting)
|
||||
{
|
||||
setIsPendingRevive(false);
|
||||
setIsDead(false);
|
||||
|
||||
if ((Config.RESPAWN_RESTORE_CP > 0) && (getCurrentCp() < (getMaxCp() * Config.RESPAWN_RESTORE_CP)))
|
||||
if ((Config.RESPAWN_RESTORE_CP > 0) && (_status.getCurrentCp() < (_stat.getMaxCp() * Config.RESPAWN_RESTORE_CP)))
|
||||
{
|
||||
_status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP);
|
||||
_status.setCurrentCp(_stat.getMaxCp() * Config.RESPAWN_RESTORE_CP);
|
||||
}
|
||||
if ((Config.RESPAWN_RESTORE_HP > 0) && (getCurrentHp() < (getMaxHp() * Config.RESPAWN_RESTORE_HP)))
|
||||
if ((Config.RESPAWN_RESTORE_HP > 0) && (_status.getCurrentHp() < (_stat.getMaxHp() * Config.RESPAWN_RESTORE_HP)))
|
||||
{
|
||||
_status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP);
|
||||
_status.setCurrentHp(_stat.getMaxHp() * Config.RESPAWN_RESTORE_HP);
|
||||
}
|
||||
if ((Config.RESPAWN_RESTORE_MP > 0) && (getCurrentMp() < (getMaxMp() * Config.RESPAWN_RESTORE_MP)))
|
||||
if ((Config.RESPAWN_RESTORE_MP > 0) && (_status.getCurrentMp() < (_stat.getMaxMp() * Config.RESPAWN_RESTORE_MP)))
|
||||
{
|
||||
_status.setCurrentMp(getMaxMp() * Config.RESPAWN_RESTORE_MP);
|
||||
_status.setCurrentMp(_stat.getMaxMp() * Config.RESPAWN_RESTORE_MP);
|
||||
}
|
||||
|
||||
// Start broadcast status
|
||||
@ -1855,7 +1855,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
*/
|
||||
public boolean isAttackingDisabled()
|
||||
{
|
||||
return isFlying() || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || isCoreAIDisabled();
|
||||
return _isFlying || hasBlockActions() || isAttackingNow() || isAlikeDead() || isPhysicalAttackMuted() || _AIdisabled;
|
||||
}
|
||||
|
||||
public final boolean isConfused()
|
||||
@ -1915,7 +1915,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
public boolean isMovementDisabled()
|
||||
{
|
||||
// check for isTeleporting to prevent teleport cheating (if appear packet not received)
|
||||
return hasBlockActions() || isRooted() || isOverloaded() || isImmobilized() || isAlikeDead() || isTeleporting();
|
||||
return hasBlockActions() || isRooted() || _isOverloaded || _isImmobilized || isAlikeDead() || _isTeleporting;
|
||||
}
|
||||
|
||||
public final boolean isOverloaded()
|
||||
@ -1934,7 +1934,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public final boolean isPendingRevive()
|
||||
{
|
||||
return isDead() && _isPendingRevive;
|
||||
return _isDead && _isPendingRevive;
|
||||
}
|
||||
|
||||
public final void setIsPendingRevive(boolean value)
|
||||
@ -2023,7 +2023,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
_isRunning = value;
|
||||
if (getRunSpeed() != 0)
|
||||
if (_stat.getRunSpeed() != 0)
|
||||
{
|
||||
broadcastPacket(new ChangeMoveType(this));
|
||||
}
|
||||
@ -2048,7 +2048,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
player.sendPacket(new FakePlayerInfo((L2Npc) this));
|
||||
}
|
||||
else if (getRunSpeed() == 0)
|
||||
else if (_stat.getRunSpeed() == 0)
|
||||
{
|
||||
player.sendPacket(new ServerObjectInfo((L2Npc) this, player));
|
||||
}
|
||||
@ -2379,7 +2379,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (removeEffects)
|
||||
{
|
||||
getEffectList().stopEffects(AbnormalType.STUN);
|
||||
_effectList.stopEffects(AbnormalType.STUN);
|
||||
}
|
||||
|
||||
if (!isPlayer())
|
||||
@ -2402,11 +2402,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (removeEffects)
|
||||
{
|
||||
getEffectList().stopEffects(AbnormalType.TRANSFORM);
|
||||
getEffectList().stopEffects(AbnormalType.CHANGEBODY);
|
||||
_effectList.stopEffects(AbnormalType.TRANSFORM);
|
||||
_effectList.stopEffects(AbnormalType.CHANGEBODY);
|
||||
}
|
||||
|
||||
if (isTransformed())
|
||||
if (_transform.isPresent())
|
||||
{
|
||||
untransform();
|
||||
}
|
||||
@ -2517,7 +2517,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// If this creature was previously moving, but now due to stat change can no longer move, broadcast StopMove packet.
|
||||
if (isMoving() && (getMoveSpeed() <= 0))
|
||||
if (isMoving() && (_stat.getMoveSpeed() <= 0))
|
||||
{
|
||||
stopMove(null);
|
||||
}
|
||||
@ -2585,7 +2585,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
else
|
||||
{
|
||||
su.addUpdate(StatusUpdateType.MAX_CP, getMaxCp());
|
||||
su.addUpdate(StatusUpdateType.MAX_CP, _stat.getMaxCp());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -2597,7 +2597,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
else
|
||||
{
|
||||
su.addUpdate(StatusUpdateType.MAX_HP, getMaxHp());
|
||||
su.addUpdate(StatusUpdateType.MAX_HP, _stat.getMaxHp());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -2609,7 +2609,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
else
|
||||
{
|
||||
su.addUpdate(StatusUpdateType.MAX_CP, getMaxMp());
|
||||
su.addUpdate(StatusUpdateType.MAX_CP, _stat.getMaxMp());
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -2682,7 +2682,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
player.sendPacket(new FakePlayerInfo((L2Npc) this));
|
||||
}
|
||||
else if (getRunSpeed() == 0)
|
||||
else if (_stat.getRunSpeed() == 0)
|
||||
{
|
||||
player.sendPacket(new ServerObjectInfo((L2Npc) this, player));
|
||||
}
|
||||
@ -2924,7 +2924,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
// Z coordinate will follow client values
|
||||
dz = m._zDestination - zPrev;
|
||||
|
||||
final boolean isFloating = isFlying() || isInsideZone(ZoneId.WATER);
|
||||
final boolean isFloating = _isFlying || isInsideZone(ZoneId.WATER);
|
||||
|
||||
double delta = (dx * dx) + (dy * dy);
|
||||
if ((delta < 10000) && ((dz * dz) > 2500) // close enough, allows error between client and server geodata if it cannot be avoided
|
||||
@ -2940,7 +2940,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
double distFraction = Double.MAX_VALUE;
|
||||
if (delta > 1)
|
||||
{
|
||||
final double distPassed = (getMoveSpeed() * (gameTicks - m._moveTimestamp)) / GameTimeController.TICKS_PER_SECOND;
|
||||
final double distPassed = (_stat.getMoveSpeed() * (gameTicks - m._moveTimestamp)) / GameTimeController.TICKS_PER_SECOND;
|
||||
distFraction = distPassed / delta;
|
||||
}
|
||||
|
||||
@ -3147,7 +3147,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
public void moveToLocation(int x, int y, int z, int offset)
|
||||
{
|
||||
// Get the Move Speed of the L2Charcater
|
||||
final double speed = getMoveSpeed();
|
||||
final double speed = _stat.getMoveSpeed();
|
||||
if ((speed <= 0) || isMovementDisabled())
|
||||
{
|
||||
return;
|
||||
@ -3174,7 +3174,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
double dz = (z - curZ);
|
||||
double distance = Math.hypot(dx, dy);
|
||||
|
||||
final boolean verticalMovementOnly = isFlying() && (distance == 0) && (dz != 0);
|
||||
final boolean verticalMovementOnly = _isFlying && (distance == 0) && (dz != 0);
|
||||
if (verticalMovementOnly)
|
||||
{
|
||||
distance = Math.abs(dz);
|
||||
@ -3252,7 +3252,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
m.onGeodataPathIndex = -1; // Initialize not on geodata path
|
||||
m.disregardingGeodata = false;
|
||||
|
||||
if (!isFlying() && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement)
|
||||
if (!_isFlying && !isInsideZone(ZoneId.WATER) && !isVehicle() && !_cursorKeyMovement)
|
||||
{
|
||||
final boolean isInVehicle = isPlayer() && (getActingPlayer().getVehicle() != null);
|
||||
if (isInVehicle)
|
||||
@ -3381,7 +3381,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Apply Z distance for flying or swimming for correct timing calculations
|
||||
if ((isFlying() || isInsideZone(ZoneId.WATER)) && !verticalMovementOnly)
|
||||
if ((_isFlying || isInsideZone(ZoneId.WATER)) && !verticalMovementOnly)
|
||||
{
|
||||
distance = Math.hypot(distance, dz);
|
||||
}
|
||||
@ -3428,7 +3428,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Get the Move Speed of the L2Charcater
|
||||
final double speed = getMoveSpeed();
|
||||
final double speed = _stat.getMoveSpeed();
|
||||
if ((speed <= 0) || isMovementDisabled())
|
||||
{
|
||||
// Cancel the move action
|
||||
@ -3623,7 +3623,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
*/
|
||||
public void onHitTimeNotDual(L2Weapon weapon, Attack attack, int hitTime, int attackTime)
|
||||
{
|
||||
if (isAlikeDead())
|
||||
if (_isDead)
|
||||
{
|
||||
getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
|
||||
return;
|
||||
@ -3652,7 +3652,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public void onFirstHitTimeForDual(L2Weapon weapon, Attack attack, int hitTime, int attackTime, int delayForSecondAttack)
|
||||
{
|
||||
if (isAlikeDead())
|
||||
if (_isDead)
|
||||
{
|
||||
getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
|
||||
return;
|
||||
@ -3682,7 +3682,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public void onSecondHitTimeForDual(L2Weapon weapon, Attack attack, int hitTime1, int hitTime2, int attackTime)
|
||||
{
|
||||
if (isAlikeDead())
|
||||
if (_isDead)
|
||||
{
|
||||
getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
|
||||
return;
|
||||
@ -3970,10 +3970,10 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
// Stop all effects of that skill
|
||||
if (oldSkill.isPassive())
|
||||
{
|
||||
getEffectList().stopSkillEffects(true, oldSkill);
|
||||
_effectList.stopSkillEffects(true, oldSkill);
|
||||
}
|
||||
|
||||
getStat().recalculateStats(true);
|
||||
_stat.recalculateStats(true);
|
||||
}
|
||||
|
||||
if (newSkill.isPassive())
|
||||
@ -4008,7 +4008,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
if (cancelEffect || oldSkill.isToggle() || oldSkill.isPassive())
|
||||
{
|
||||
stopSkillEffects(true, oldSkill.getId());
|
||||
getStat().recalculateStats(true);
|
||||
_stat.recalculateStats(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4105,7 +4105,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
*/
|
||||
public final double getRandomDamageMultiplier()
|
||||
{
|
||||
final int random = (int) getStat().getValue(Stats.RANDOM_DAMAGE);
|
||||
final int random = (int) _stat.getValue(Stats.RANDOM_DAMAGE);
|
||||
return (1 + ((double) Rnd.get(-random, random) / 100));
|
||||
}
|
||||
|
||||
@ -4127,193 +4127,193 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public int getAccuracy()
|
||||
{
|
||||
return getStat().getAccuracy();
|
||||
return _stat.getAccuracy();
|
||||
}
|
||||
|
||||
public int getMagicAccuracy()
|
||||
{
|
||||
return getStat().getMagicAccuracy();
|
||||
return _stat.getMagicAccuracy();
|
||||
}
|
||||
|
||||
public int getMagicEvasionRate()
|
||||
{
|
||||
return getStat().getMagicEvasionRate();
|
||||
return _stat.getMagicEvasionRate();
|
||||
}
|
||||
|
||||
public final double getAttackSpeedMultiplier()
|
||||
{
|
||||
return getStat().getAttackSpeedMultiplier();
|
||||
return _stat.getAttackSpeedMultiplier();
|
||||
}
|
||||
|
||||
public final double getCriticalDmg(int init)
|
||||
{
|
||||
return getStat().getCriticalDmg(init);
|
||||
return _stat.getCriticalDmg(init);
|
||||
}
|
||||
|
||||
public int getCriticalHit()
|
||||
{
|
||||
return getStat().getCriticalHit();
|
||||
return _stat.getCriticalHit();
|
||||
}
|
||||
|
||||
public int getEvasionRate()
|
||||
{
|
||||
return getStat().getEvasionRate();
|
||||
return _stat.getEvasionRate();
|
||||
}
|
||||
|
||||
public final int getMagicalAttackRange(Skill skill)
|
||||
{
|
||||
return getStat().getMagicalAttackRange(skill);
|
||||
return _stat.getMagicalAttackRange(skill);
|
||||
}
|
||||
|
||||
public final int getMaxCp()
|
||||
{
|
||||
return getStat().getMaxCp();
|
||||
return _stat.getMaxCp();
|
||||
}
|
||||
|
||||
public final int getMaxRecoverableCp()
|
||||
{
|
||||
return getStat().getMaxRecoverableCp();
|
||||
return _stat.getMaxRecoverableCp();
|
||||
}
|
||||
|
||||
public int getMAtk()
|
||||
{
|
||||
return getStat().getMAtk();
|
||||
return _stat.getMAtk();
|
||||
}
|
||||
|
||||
public int getMAtkSpd()
|
||||
{
|
||||
return getStat().getMAtkSpd();
|
||||
return _stat.getMAtkSpd();
|
||||
}
|
||||
|
||||
public int getMaxMp()
|
||||
{
|
||||
return getStat().getMaxMp();
|
||||
return _stat.getMaxMp();
|
||||
}
|
||||
|
||||
public int getMaxRecoverableMp()
|
||||
{
|
||||
return getStat().getMaxRecoverableMp();
|
||||
return _stat.getMaxRecoverableMp();
|
||||
}
|
||||
|
||||
public int getMaxHp()
|
||||
{
|
||||
return getStat().getMaxHp();
|
||||
return _stat.getMaxHp();
|
||||
}
|
||||
|
||||
public int getMaxRecoverableHp()
|
||||
{
|
||||
return getStat().getMaxRecoverableHp();
|
||||
return _stat.getMaxRecoverableHp();
|
||||
}
|
||||
|
||||
public final int getMCriticalHit()
|
||||
{
|
||||
return getStat().getMCriticalHit();
|
||||
return _stat.getMCriticalHit();
|
||||
}
|
||||
|
||||
public int getMDef()
|
||||
{
|
||||
return getStat().getMDef();
|
||||
return _stat.getMDef();
|
||||
}
|
||||
|
||||
public int getPAtk()
|
||||
{
|
||||
return getStat().getPAtk();
|
||||
return _stat.getPAtk();
|
||||
}
|
||||
|
||||
public int getPAtkSpd()
|
||||
{
|
||||
return getStat().getPAtkSpd();
|
||||
return _stat.getPAtkSpd();
|
||||
}
|
||||
|
||||
public int getPDef()
|
||||
{
|
||||
return getStat().getPDef();
|
||||
return _stat.getPDef();
|
||||
}
|
||||
|
||||
public final int getPhysicalAttackRange()
|
||||
{
|
||||
return getStat().getPhysicalAttackRange();
|
||||
return _stat.getPhysicalAttackRange();
|
||||
}
|
||||
|
||||
public double getMovementSpeedMultiplier()
|
||||
{
|
||||
return getStat().getMovementSpeedMultiplier();
|
||||
return _stat.getMovementSpeedMultiplier();
|
||||
}
|
||||
|
||||
public double getRunSpeed()
|
||||
{
|
||||
return getStat().getRunSpeed();
|
||||
return _stat.getRunSpeed();
|
||||
}
|
||||
|
||||
public double getWalkSpeed()
|
||||
{
|
||||
return getStat().getWalkSpeed();
|
||||
return _stat.getWalkSpeed();
|
||||
}
|
||||
|
||||
public final double getSwimRunSpeed()
|
||||
{
|
||||
return getStat().getSwimRunSpeed();
|
||||
return _stat.getSwimRunSpeed();
|
||||
}
|
||||
|
||||
public final double getSwimWalkSpeed()
|
||||
{
|
||||
return getStat().getSwimWalkSpeed();
|
||||
return _stat.getSwimWalkSpeed();
|
||||
}
|
||||
|
||||
public double getMoveSpeed()
|
||||
{
|
||||
return getStat().getMoveSpeed();
|
||||
return _stat.getMoveSpeed();
|
||||
}
|
||||
|
||||
public final int getShldDef()
|
||||
{
|
||||
return getStat().getShldDef();
|
||||
return _stat.getShldDef();
|
||||
}
|
||||
|
||||
public int getSTR()
|
||||
{
|
||||
return getStat().getSTR();
|
||||
return _stat.getSTR();
|
||||
}
|
||||
|
||||
public int getDEX()
|
||||
{
|
||||
return getStat().getDEX();
|
||||
return _stat.getDEX();
|
||||
}
|
||||
|
||||
public int getCON()
|
||||
{
|
||||
return getStat().getCON();
|
||||
return _stat.getCON();
|
||||
}
|
||||
|
||||
public int getINT()
|
||||
{
|
||||
return getStat().getINT();
|
||||
return _stat.getINT();
|
||||
}
|
||||
|
||||
public int getWIT()
|
||||
{
|
||||
return getStat().getWIT();
|
||||
return _stat.getWIT();
|
||||
}
|
||||
|
||||
public int getMEN()
|
||||
{
|
||||
return getStat().getMEN();
|
||||
return _stat.getMEN();
|
||||
}
|
||||
|
||||
public int getLUC()
|
||||
{
|
||||
return getStat().getLUC();
|
||||
return _stat.getLUC();
|
||||
}
|
||||
|
||||
public int getCHA()
|
||||
{
|
||||
return getStat().getCHA();
|
||||
return _stat.getCHA();
|
||||
}
|
||||
|
||||
// Status - NEED TO REMOVE ONCE L2CHARTATUS IS COMPLETE
|
||||
public void addStatusListener(L2Character object)
|
||||
{
|
||||
getStatus().addStatusListener(object);
|
||||
_status.addStatusListener(object);
|
||||
}
|
||||
|
||||
public void doAttack(double damage, L2Character target, Skill skill, boolean isDOT, boolean directlyToHp, boolean critical, boolean reflect)
|
||||
@ -4338,7 +4338,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
// RearDamage effect bonus.
|
||||
if (isBehind(target))
|
||||
{
|
||||
damage *= getStat().getValue(Stats.REAR_DAMAGE_RATE, 1);
|
||||
damage *= _stat.getValue(Stats.REAR_DAMAGE_RATE, 1);
|
||||
}
|
||||
|
||||
// Counterattacks happen before damage received.
|
||||
@ -4383,27 +4383,27 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
// Absorb HP from the damage inflicted
|
||||
double absorbPercent = getStat().getValue(Stats.ABSORB_DAMAGE_PERCENT, 0) * target.getStat().getValue(Stats.ABSORB_DAMAGE_DEFENCE, 1);
|
||||
if ((absorbPercent > 0) && (Rnd.nextDouble() < getStat().getValue(Stats.ABSORB_DAMAGE_CHANCE)))
|
||||
if ((absorbPercent > 0) && (Rnd.nextDouble() < _stat.getValue(Stats.ABSORB_DAMAGE_CHANCE)))
|
||||
{
|
||||
int absorbDamage = (int) Math.min(absorbPercent * damage, getMaxRecoverableHp() - getCurrentHp());
|
||||
int absorbDamage = (int) Math.min(absorbPercent * damage, _stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentHp());
|
||||
if (absorbDamage > 0)
|
||||
{
|
||||
setCurrentHp(getCurrentHp() + absorbDamage);
|
||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||
}
|
||||
}
|
||||
|
||||
// Absorb MP from the damage inflicted. Unconfirmed for skill attacks.
|
||||
if (skill == null)
|
||||
{
|
||||
absorbPercent = getStat().getValue(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||
absorbPercent = _stat.getValue(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0);
|
||||
if (absorbPercent > 0)
|
||||
{
|
||||
int absorbDamage = (int) Math.min((absorbPercent / 100.) * damage, getMaxRecoverableMp() - getCurrentMp());
|
||||
int absorbDamage = (int) Math.min((absorbPercent / 100.) * damage, _stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||
absorbDamage = Math.min(absorbDamage, (int) target.getCurrentMp());
|
||||
if (absorbDamage > 0)
|
||||
{
|
||||
setCurrentMp(getCurrentMp() + absorbDamage);
|
||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -4448,7 +4448,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
}
|
||||
|
||||
final double damageCap = getStat().getValue(Stats.DAMAGE_LIMIT);
|
||||
final double damageCap = _stat.getValue(Stats.DAMAGE_LIMIT);
|
||||
if (damageCap > 0)
|
||||
{
|
||||
value = Math.min(value, damageCap);
|
||||
@ -4459,17 +4459,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (attacker.isPlayable())
|
||||
{
|
||||
value *= (100 + getStat().getValue(Stats.PVP_DAMAGE_TAKEN)) / 100;
|
||||
value *= (100 + _stat.getValue(Stats.PVP_DAMAGE_TAKEN)) / 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
value *= (100 + getStat().getValue(Stats.PVE_DAMAGE_TAKEN)) / 100;
|
||||
value *= (100 + _stat.getValue(Stats.PVE_DAMAGE_TAKEN)) / 100;
|
||||
}
|
||||
}
|
||||
|
||||
if (Config.CHAMPION_ENABLE && isChampion() && (Config.CHAMPION_HP != 0))
|
||||
{
|
||||
getStatus().reduceHp(value / Config.CHAMPION_HP, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
||||
_status.reduceHp(value / Config.CHAMPION_HP, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
||||
}
|
||||
else if (isPlayer())
|
||||
{
|
||||
@ -4477,7 +4477,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
else
|
||||
{
|
||||
getStatus().reduceHp(value, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
||||
_status.reduceHp(value, attacker, (skill == null) || !skill.isToggle(), isDOT, false);
|
||||
}
|
||||
|
||||
if (attacker != null)
|
||||
@ -4488,83 +4488,83 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public void reduceCurrentMp(double i)
|
||||
{
|
||||
getStatus().reduceMp(i);
|
||||
_status.reduceMp(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void removeStatusListener(L2Character object)
|
||||
{
|
||||
getStatus().removeStatusListener(object);
|
||||
_status.removeStatusListener(object);
|
||||
}
|
||||
|
||||
protected void stopHpMpRegeneration()
|
||||
{
|
||||
getStatus().stopHpMpRegeneration();
|
||||
_status.stopHpMpRegeneration();
|
||||
}
|
||||
|
||||
public final double getCurrentCp()
|
||||
{
|
||||
return getStatus().getCurrentCp();
|
||||
return _status.getCurrentCp();
|
||||
}
|
||||
|
||||
public final int getCurrentCpPercent()
|
||||
{
|
||||
return (int) ((getCurrentCp() * 100) / getMaxCp());
|
||||
return (int) ((_status.getCurrentCp() * 100) / _stat.getMaxCp());
|
||||
}
|
||||
|
||||
public final void setCurrentCp(double newCp)
|
||||
{
|
||||
getStatus().setCurrentCp(newCp);
|
||||
_status.setCurrentCp(newCp);
|
||||
}
|
||||
|
||||
public final void setCurrentCp(double newCp, boolean broadcast)
|
||||
{
|
||||
getStatus().setCurrentCp(newCp, broadcast);
|
||||
_status.setCurrentCp(newCp, broadcast);
|
||||
}
|
||||
|
||||
public final double getCurrentHp()
|
||||
{
|
||||
return getStatus().getCurrentHp();
|
||||
return _status.getCurrentHp();
|
||||
}
|
||||
|
||||
public final int getCurrentHpPercent()
|
||||
{
|
||||
return (int) ((getCurrentHp() * 100) / getMaxHp());
|
||||
return (int) ((_status.getCurrentHp() * 100) / _stat.getMaxHp());
|
||||
}
|
||||
|
||||
public final void setCurrentHp(double newHp)
|
||||
{
|
||||
getStatus().setCurrentHp(newHp);
|
||||
_status.setCurrentHp(newHp);
|
||||
}
|
||||
|
||||
public final void setCurrentHp(double newHp, boolean broadcast)
|
||||
{
|
||||
getStatus().setCurrentHp(newHp, broadcast);
|
||||
_status.setCurrentHp(newHp, broadcast);
|
||||
}
|
||||
|
||||
public final void setCurrentHpMp(double newHp, double newMp)
|
||||
{
|
||||
getStatus().setCurrentHpMp(newHp, newMp);
|
||||
_status.setCurrentHpMp(newHp, newMp);
|
||||
}
|
||||
|
||||
public final double getCurrentMp()
|
||||
{
|
||||
return getStatus().getCurrentMp();
|
||||
return _status.getCurrentMp();
|
||||
}
|
||||
|
||||
public final int getCurrentMpPercent()
|
||||
{
|
||||
return (int) ((getCurrentMp() * 100) / getMaxMp());
|
||||
return (int) ((_status.getCurrentMp() * 100) / _stat.getMaxMp());
|
||||
}
|
||||
|
||||
public final void setCurrentMp(double newMp)
|
||||
{
|
||||
getStatus().setCurrentMp(newMp);
|
||||
_status.setCurrentMp(newMp);
|
||||
}
|
||||
|
||||
public final void setCurrentMp(double newMp, boolean broadcast)
|
||||
{
|
||||
getStatus().setCurrentMp(newMp, false);
|
||||
_status.setCurrentMp(newMp, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -4577,7 +4577,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
// Weight Limit = (CON Modifier*69000) * Skills
|
||||
// Source http://l2p.bravehost.com/weightlimit.html (May 2007)
|
||||
final double baseLoad = Math.floor(BaseStats.CON.calcBonus(this) * 69000 * Config.ALT_WEIGHT_LIMIT);
|
||||
return (int) getStat().getValue(Stats.WEIGHT_LIMIT, baseLoad);
|
||||
return (int) _stat.getValue(Stats.WEIGHT_LIMIT, baseLoad);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -4586,7 +4586,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (isPlayer() || isPet())
|
||||
{
|
||||
return (int) getStat().getValue(Stats.WEIGHT_PENALTY, 1);
|
||||
return (int) _stat.getValue(Stats.WEIGHT_PENALTY, 1);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -4623,17 +4623,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public AttributeType getAttackElement()
|
||||
{
|
||||
return getStat().getAttackElement();
|
||||
return _stat.getAttackElement();
|
||||
}
|
||||
|
||||
public int getAttackElementValue(AttributeType attackAttribute)
|
||||
{
|
||||
return getStat().getAttackElementValue(attackAttribute);
|
||||
return _stat.getAttackElementValue(attackAttribute);
|
||||
}
|
||||
|
||||
public int getDefenseElementValue(AttributeType defenseAttribute)
|
||||
{
|
||||
return getStat().getDefenseElementValue(defenseAttribute);
|
||||
return _stat.getDefenseElementValue(defenseAttribute);
|
||||
}
|
||||
|
||||
public final void startPhysicalAttackMuted()
|
||||
@ -4852,8 +4852,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
return weapon.getItemType();
|
||||
}
|
||||
|
||||
final WeaponType defaultWeaponType = getTemplate().getBaseAttackType();
|
||||
return getTransformation().map(transform -> transform.getBaseAttackType(this, defaultWeaponType)).orElse(defaultWeaponType);
|
||||
final WeaponType defaultWeaponType = _template.getBaseAttackType();
|
||||
return _transform.map(transform -> transform.getBaseAttackType(this, defaultWeaponType)).orElse(defaultWeaponType);
|
||||
}
|
||||
|
||||
public final boolean isInCategory(CategoryType type)
|
||||
@ -5001,7 +5001,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
filter = filter.and(additionalFilter);
|
||||
}
|
||||
|
||||
return getSkillCasters().stream().filter(filter).collect(Collectors.toList());
|
||||
return _skillCasters.values().stream().filter(filter).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@SafeVarargs
|
||||
@ -5012,7 +5012,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
filter = filter.and(additionalFilter);
|
||||
}
|
||||
|
||||
return getSkillCasters().stream().filter(filter).findAny().orElse(null);
|
||||
return _skillCasters.values().stream().filter(filter).findAny().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -5098,7 +5098,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
public Queue<AbstractEventListener> getListeners(EventType type)
|
||||
{
|
||||
final Queue<AbstractEventListener> objectListenres = super.getListeners(type);
|
||||
final Queue<AbstractEventListener> templateListeners = getTemplate().getListeners(type);
|
||||
final Queue<AbstractEventListener> templateListeners = _template.getListeners(type);
|
||||
final Queue<AbstractEventListener> globalListeners = isNpc() && !isMonster() ? Containers.Npcs().getListeners(type) : isMonster() ? Containers.Monsters().getListeners(type) : isPlayer() ? Containers.Players().getListeners(type) : EmptyQueue.emptyQueue();
|
||||
|
||||
// Attempt to do not create collection
|
||||
@ -5128,7 +5128,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public Race getRace()
|
||||
{
|
||||
return getTemplate().getRace();
|
||||
return _template.getRace();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -5200,7 +5200,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public boolean hasAbnormalType(AbnormalType abnormalType)
|
||||
{
|
||||
return getEffectList().hasAbnormalType(abnormalType);
|
||||
return _effectList.hasAbnormalType(abnormalType);
|
||||
}
|
||||
|
||||
public void addBlockActionsAllowedSkill(int skillId)
|
||||
@ -5267,11 +5267,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public MoveType getMoveType()
|
||||
{
|
||||
if (isMoving() && isRunning())
|
||||
if (isMoving() && _isRunning)
|
||||
{
|
||||
return MoveType.RUNNING;
|
||||
}
|
||||
else if (isMoving() && !isRunning())
|
||||
else if (isMoving() && !_isRunning)
|
||||
{
|
||||
return MoveType.WALKING;
|
||||
}
|
||||
|
@ -372,7 +372,7 @@ public class L2Npc extends L2Character
|
||||
return;
|
||||
}
|
||||
|
||||
if (isFakePlayer())
|
||||
if (_isFakePlayer)
|
||||
{
|
||||
player.sendPacket(new FakePlayerInfo(this));
|
||||
}
|
||||
@ -514,7 +514,7 @@ public class L2Npc extends L2Character
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (isBusy())
|
||||
else if (_isBusy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -745,7 +745,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void showChatWindow(L2PcInstance player, int val)
|
||||
{
|
||||
if (!isTalkable())
|
||||
if (!_isTalkable)
|
||||
{
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
@ -925,7 +925,7 @@ public class L2Npc extends L2Character
|
||||
final L2Weapon weapon = (killer != null) ? killer.getActiveWeaponItem() : null;
|
||||
_killingBlowWeaponId = (weapon != null) ? weapon.getId() : 0;
|
||||
|
||||
if (isFakePlayer() && (killer != null) && killer.isPlayable())
|
||||
if (_isFakePlayer && (killer != null) && killer.isPlayable())
|
||||
{
|
||||
final L2PcInstance player = killer.getActingPlayer();
|
||||
if (isScriptValue(0) && (getReputation() >= 0))
|
||||
@ -999,10 +999,9 @@ public class L2Npc extends L2Character
|
||||
|
||||
DecayTaskManager.getInstance().add(this);
|
||||
|
||||
final L2Spawn spawn = getSpawn();
|
||||
if (spawn != null)
|
||||
if (_spawn != null)
|
||||
{
|
||||
final NpcSpawnTemplate npcTemplate = spawn.getNpcSpawnTemplate();
|
||||
final NpcSpawnTemplate npcTemplate = _spawn.getNpcSpawnTemplate();
|
||||
if (npcTemplate != null)
|
||||
{
|
||||
npcTemplate.notifyNpcDeath(this, killer);
|
||||
@ -1140,7 +1139,7 @@ public class L2Npc extends L2Character
|
||||
@Override
|
||||
public void onDecay()
|
||||
{
|
||||
if (isDecayed())
|
||||
if (_isDecayed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -1228,7 +1227,7 @@ public class L2Npc extends L2Character
|
||||
|
||||
public void endDecayTask()
|
||||
{
|
||||
if (!isDecayed())
|
||||
if (!_isDecayed)
|
||||
{
|
||||
DecayTaskManager.getInstance().cancel(this);
|
||||
onDecay();
|
||||
@ -1299,7 +1298,7 @@ public class L2Npc extends L2Character
|
||||
activeChar.sendMessage("Added NPC: " + getName());
|
||||
}
|
||||
|
||||
if (isFakePlayer())
|
||||
if (_isFakePlayer)
|
||||
{
|
||||
activeChar.sendPacket(new FakePlayerInfo(this));
|
||||
}
|
||||
@ -1318,7 +1317,7 @@ public class L2Npc extends L2Character
|
||||
{
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!isDecayed())
|
||||
if (!_isDecayed)
|
||||
{
|
||||
deleteMe();
|
||||
}
|
||||
@ -1394,7 +1393,7 @@ public class L2Npc extends L2Character
|
||||
@Override
|
||||
public void rechargeShots(boolean physical, boolean magic, boolean fish)
|
||||
{
|
||||
if (isFakePlayer() && Config.FAKE_PLAYER_USE_SHOTS)
|
||||
if (_isFakePlayer && Config.FAKE_PLAYER_USE_SHOTS)
|
||||
{
|
||||
if (physical)
|
||||
{
|
||||
@ -1474,7 +1473,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public boolean staysInSpawnLoc()
|
||||
{
|
||||
return ((getSpawn() != null) && (getSpawn().getX() == getX()) && (getSpawn().getY() == getY()));
|
||||
return ((_spawn != null) && (_spawn.getX() == getX()) && (_spawn.getY() == getY()));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1784,10 +1783,9 @@ public class L2Npc extends L2Character
|
||||
return _params;
|
||||
}
|
||||
|
||||
final L2Spawn spawn = getSpawn();
|
||||
if (spawn != null) // Minions doesn't have L2Spawn object bound
|
||||
if (_spawn != null) // Minions doesn't have L2Spawn object bound
|
||||
{
|
||||
final NpcSpawnTemplate npcSpawnTemplate = spawn.getNpcSpawnTemplate();
|
||||
final NpcSpawnTemplate npcSpawnTemplate = _spawn.getNpcSpawnTemplate();
|
||||
if ((npcSpawnTemplate != null) && (npcSpawnTemplate.getParameters() != null) && !npcSpawnTemplate.getParameters().isEmpty())
|
||||
{
|
||||
final StatsSet params = getTemplate().getParameters();
|
||||
|
@ -118,15 +118,15 @@ public abstract class L2Summon extends L2Playable
|
||||
|
||||
setFollowStatus(true);
|
||||
updateAndBroadcastStatus(0);
|
||||
sendPacket(new RelationChanged(this, getOwner().getRelation(getOwner()), false));
|
||||
sendPacket(new RelationChanged(this, _owner.getRelation(_owner), false));
|
||||
L2World.getInstance().forEachVisibleObjectInRange(getOwner(), L2PcInstance.class, 800, player ->
|
||||
{
|
||||
player.sendPacket(new RelationChanged(this, getOwner().getRelation(player), isAutoAttackable(player)));
|
||||
player.sendPacket(new RelationChanged(this, _owner.getRelation(player), isAutoAttackable(player)));
|
||||
});
|
||||
final L2Party party = getOwner().getParty();
|
||||
final L2Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(getOwner(), new ExPartyPetWindowAdd(this));
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowAdd(this));
|
||||
}
|
||||
setShowSummonAnimation(false); // addVisibleObject created the info packets with summon animation
|
||||
// if someone comes into range now, the animation shouldn't show any more
|
||||
@ -196,7 +196,7 @@ public abstract class L2Summon extends L2Playable
|
||||
{
|
||||
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
||||
{
|
||||
if (player == getOwner())
|
||||
if (player == _owner)
|
||||
{
|
||||
player.sendPacket(new PetInfo(this, 1));
|
||||
return;
|
||||
@ -242,19 +242,19 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public final int getReputation()
|
||||
{
|
||||
return getOwner() != null ? getOwner().getReputation() : 0;
|
||||
return _owner != null ? _owner.getReputation() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final byte getPvpFlag()
|
||||
{
|
||||
return getOwner() != null ? getOwner().getPvpFlag() : 0;
|
||||
return _owner != null ? _owner.getPvpFlag() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Team getTeam()
|
||||
{
|
||||
return getOwner() != null ? getOwner().getTeam() : Team.NONE;
|
||||
return _owner != null ? _owner.getTeam() : Team.NONE;
|
||||
}
|
||||
|
||||
public final L2PcInstance getOwner()
|
||||
@ -313,8 +313,7 @@ public abstract class L2Summon extends L2Playable
|
||||
return false;
|
||||
}
|
||||
|
||||
final L2PcInstance owner = getOwner();
|
||||
if (owner != null)
|
||||
if (_owner != null)
|
||||
{
|
||||
L2World.getInstance().forEachVisibleObject(this, L2Attackable.class, TgMob ->
|
||||
{
|
||||
@ -326,7 +325,7 @@ public abstract class L2Summon extends L2Playable
|
||||
final AggroInfo info = TgMob.getAggroList().get(this);
|
||||
if (info != null)
|
||||
{
|
||||
TgMob.addDamageHate(owner, info.getDamage(), info.getHate());
|
||||
TgMob.addDamageHate(_owner, info.getDamage(), info.getHate());
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -392,7 +391,7 @@ public abstract class L2Summon extends L2Playable
|
||||
// pet will be deleted along with all his items
|
||||
if (getInventory() != null)
|
||||
{
|
||||
getInventory().destroyAllItems("pet deleted", getOwner(), this);
|
||||
getInventory().destroyAllItems("pet deleted", _owner, this);
|
||||
}
|
||||
decayMe();
|
||||
}
|
||||
@ -434,12 +433,12 @@ public abstract class L2Summon extends L2Playable
|
||||
|
||||
if ((getInventory() != null) && (getInventory().getSize() > 0))
|
||||
{
|
||||
getOwner().setPetInvItems(true);
|
||||
_owner.setPetInvItems(true);
|
||||
sendPacket(SystemMessageId.THERE_ARE_ITEMS_IN_YOUR_PET_INVENTORY_RENDERING_YOU_UNABLE_TO_SELL_TRADE_DROP_PET_SUMMONING_ITEMS_PLEASE_EMPTY_YOUR_PET_INVENTORY);
|
||||
}
|
||||
else
|
||||
{
|
||||
getOwner().setPetInvItems(false);
|
||||
_owner.setPetInvItems(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -477,7 +476,7 @@ public abstract class L2Summon extends L2Playable
|
||||
_follow = state;
|
||||
if (_follow)
|
||||
{
|
||||
getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, getOwner());
|
||||
getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, _owner);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -546,7 +545,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public boolean isInvul()
|
||||
{
|
||||
return super.isInvul() || getOwner().isSpawnProtected();
|
||||
return super.isInvul() || _owner.isSpawnProtected();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -591,7 +590,7 @@ public abstract class L2Summon extends L2Playable
|
||||
public boolean useMagic(Skill skill, L2ItemInstance item, boolean forceUse, boolean dontMove)
|
||||
{
|
||||
// Null skill, dead summon or null owner are reasons to prevent casting.
|
||||
if ((skill == null) || isDead() || (getOwner() == null))
|
||||
if ((skill == null) || isDead() || (_owner == null))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -654,7 +653,7 @@ public abstract class L2Summon extends L2Playable
|
||||
if (skill.isBad())
|
||||
{
|
||||
// If L2PcInstance is in Olympiad and the match isn't already start, send a Server->Client packet ActionFailed
|
||||
if (getOwner().isInOlympiadMode() && !getOwner().isOlympiadStart())
|
||||
if (_owner.isInOlympiadMode() && !_owner.isOlympiadStart())
|
||||
{
|
||||
sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
@ -673,7 +672,7 @@ public abstract class L2Summon extends L2Playable
|
||||
|
||||
if (value)
|
||||
{
|
||||
_previousFollowStatus = getFollowStatus();
|
||||
_previousFollowStatus = _follow;
|
||||
// if immobilized temporarily disable follow mode
|
||||
if (_previousFollowStatus)
|
||||
{
|
||||
@ -695,13 +694,13 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void sendDamageMessage(L2Character target, Skill skill, int damage, boolean crit, boolean miss)
|
||||
{
|
||||
if (miss || (getOwner() == null))
|
||||
if (miss || (_owner == null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Prevents the double spam of system messages, if the target is the owning player.
|
||||
if (target.getObjectId() != getOwner().getObjectId())
|
||||
if (target.getObjectId() != _owner.getObjectId())
|
||||
{
|
||||
if (crit)
|
||||
{
|
||||
@ -715,14 +714,14 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
}
|
||||
|
||||
if (getOwner().isInOlympiadMode() && (target instanceof L2PcInstance) && ((L2PcInstance) target).isInOlympiadMode() && (((L2PcInstance) target).getOlympiadGameId() == getOwner().getOlympiadGameId()))
|
||||
if (_owner.isInOlympiadMode() && (target instanceof L2PcInstance) && ((L2PcInstance) target).isInOlympiadMode() && (((L2PcInstance) target).getOlympiadGameId() == _owner.getOlympiadGameId()))
|
||||
{
|
||||
OlympiadGameManager.getInstance().notifyCompetitorDamage(getOwner(), damage);
|
||||
}
|
||||
|
||||
final SystemMessage sm;
|
||||
|
||||
if ((target.isHpBlocked() && !target.isNpc()) || (target.isPlayer() && target.isAffected(EffectFlag.DUELIST_FURY) && !getActingPlayer().isAffected(EffectFlag.FACEOFF)))
|
||||
if ((target.isHpBlocked() && !target.isNpc()) || (target.isPlayer() && target.isAffected(EffectFlag.DUELIST_FURY) && !_owner.isAffected(EffectFlag.FACEOFF)))
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_ATTACK_HAS_BEEN_BLOCKED);
|
||||
}
|
||||
@ -744,7 +743,7 @@ public abstract class L2Summon extends L2Playable
|
||||
{
|
||||
super.reduceCurrentHp(damage, attacker, skill);
|
||||
|
||||
if (!isDead() && !isHpBlocked() && (getOwner() != null) && (attacker != null) && (!getOwner().isAffected(EffectFlag.DUELIST_FURY) || attacker.isAffected(EffectFlag.FACEOFF)))
|
||||
if (!isDead() && !isHpBlocked() && (_owner != null) && (attacker != null) && (!_owner.isAffected(EffectFlag.DUELIST_FURY) || attacker.isAffected(EffectFlag.FACEOFF)))
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_RECEIVED_S3_DAMAGE_FROM_C2);
|
||||
sm.addNpcName(this);
|
||||
@ -757,14 +756,13 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
final L2PcInstance actingPlayer = getActingPlayer();
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !actingPlayer.getAccessLevel().allowPeaceAttack())
|
||||
if ((skill.getTarget(this, false, false, false) == null) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
actingPlayer.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
_owner.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET);
|
||||
|
||||
// Send a Server->Client packet ActionFailed to the L2PcInstance
|
||||
actingPlayer.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
_owner.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -774,18 +772,18 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public boolean isInCombat()
|
||||
{
|
||||
return (getOwner() != null) && getOwner().isInCombat();
|
||||
return (_owner != null) && _owner.isInCombat();
|
||||
}
|
||||
|
||||
@Override
|
||||
public L2PcInstance getActingPlayer()
|
||||
{
|
||||
return getOwner();
|
||||
return _owner;
|
||||
}
|
||||
|
||||
public void updateAndBroadcastStatus(int val)
|
||||
{
|
||||
if (getOwner() == null)
|
||||
if (_owner == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -796,10 +794,10 @@ public abstract class L2Summon extends L2Playable
|
||||
{
|
||||
broadcastNpcInfo(val);
|
||||
}
|
||||
final L2Party party = getOwner().getParty();
|
||||
final L2Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(getOwner(), new ExPartyPetWindowUpdate(this));
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
|
||||
@ -807,7 +805,7 @@ public abstract class L2Summon extends L2Playable
|
||||
{
|
||||
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
||||
{
|
||||
if ((player == getOwner()))
|
||||
if ((player == _owner))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -842,7 +840,7 @@ public abstract class L2Summon extends L2Playable
|
||||
public void sendInfo(L2PcInstance activeChar)
|
||||
{
|
||||
// Check if the L2PcInstance is the owner of the Pet
|
||||
if (activeChar == getOwner())
|
||||
if (activeChar == _owner)
|
||||
{
|
||||
activeChar.sendPacket(new PetInfo(this, isDead() ? 0 : 1));
|
||||
if (isPet())
|
||||
@ -870,7 +868,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return super.toString() + "(" + getId() + ") Owner: " + getOwner();
|
||||
return super.toString() + "(" + getId() + ") Owner: " + _owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -904,7 +902,7 @@ public abstract class L2Summon extends L2Playable
|
||||
*/
|
||||
public void doAttack(L2Object target)
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if (_owner != null)
|
||||
{
|
||||
if (target != null)
|
||||
{
|
||||
@ -912,7 +910,7 @@ public abstract class L2Summon extends L2Playable
|
||||
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
if (target.isFakePlayer())
|
||||
{
|
||||
getOwner().updatePvPStatus();
|
||||
_owner.updatePvPStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -926,12 +924,12 @@ public abstract class L2Summon extends L2Playable
|
||||
*/
|
||||
public final boolean canAttack(L2Object target, boolean ctrlPressed)
|
||||
{
|
||||
if (getOwner() == null)
|
||||
if (_owner == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((target == null) || (this == target) || (getOwner() == target))
|
||||
if ((target == null) || (this == target) || (_owner == target))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -940,7 +938,7 @@ public abstract class L2Summon extends L2Playable
|
||||
final int npcId = getId();
|
||||
if (CommonUtil.contains(PASSIVE_SUMMONS, npcId))
|
||||
{
|
||||
getOwner().sendPacket(ActionFailed.STATIC_PACKET);
|
||||
_owner.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -960,28 +958,28 @@ public abstract class L2Summon extends L2Playable
|
||||
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
}
|
||||
|
||||
if (isPet() && ((getLevel() - getOwner().getLevel()) > 20))
|
||||
if (isPet() && ((getLevel() - _owner.getLevel()) > 20))
|
||||
{
|
||||
sendPacket(SystemMessageId.YOUR_PET_IS_TOO_HIGH_LEVEL_TO_CONTROL);
|
||||
sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getOwner().isInOlympiadMode() && !getOwner().isOlympiadStart())
|
||||
if (_owner.isInOlympiadMode() && !_owner.isOlympiadStart())
|
||||
{
|
||||
// If owner is in Olympiad and the match isn't already start, send a Server->Client packet ActionFailed
|
||||
getOwner().sendPacket(ActionFailed.STATIC_PACKET);
|
||||
_owner.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((target.getActingPlayer() != null) && (getOwner().getSiegeState() > 0) && getOwner().isInsideZone(ZoneId.SIEGE) && (target.getActingPlayer().getSiegeSide() == getOwner().getSiegeSide()))
|
||||
if ((target.getActingPlayer() != null) && (_owner.getSiegeState() > 0) && _owner.isInsideZone(ZoneId.SIEGE) && (target.getActingPlayer().getSiegeSide() == _owner.getSiegeSide()))
|
||||
{
|
||||
sendPacket(SystemMessageId.FORCE_ATTACK_IS_IMPOSSIBLE_AGAINST_A_TEMPORARY_ALLIED_MEMBER_DURING_A_SIEGE);
|
||||
sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!getOwner().getAccessLevel().allowPeaceAttack() && getOwner().isInsidePeaceZone(this, target))
|
||||
if (!_owner.getAccessLevel().allowPeaceAttack() && _owner.isInsidePeaceZone(this, target))
|
||||
{
|
||||
sendPacket(SystemMessageId.YOU_MAY_NOT_ATTACK_THIS_TARGET_IN_A_PEACEFUL_ZONE);
|
||||
return false;
|
||||
@ -994,7 +992,7 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
|
||||
// Summons can attack NPCs even when the owner cannot.
|
||||
if (!target.isAutoAttackable(getOwner()) && !ctrlPressed && !target.isNpc())
|
||||
if (!target.isAutoAttackable(_owner) && !ctrlPressed && !target.isNpc())
|
||||
{
|
||||
setFollowStatus(false);
|
||||
getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, target);
|
||||
@ -1014,18 +1012,18 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void sendPacket(IClientOutgoingPacket... packets)
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if (_owner != null)
|
||||
{
|
||||
getOwner().sendPacket(packets);
|
||||
_owner.sendPacket(packets);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket(SystemMessageId id)
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if (_owner != null)
|
||||
{
|
||||
getOwner().sendPacket(id);
|
||||
_owner.sendPacket(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1041,14 +1039,14 @@ public abstract class L2Summon extends L2Playable
|
||||
L2ItemInstance item;
|
||||
IItemHandler handler;
|
||||
|
||||
if ((getOwner().getAutoSoulShot() == null) || getOwner().getAutoSoulShot().isEmpty())
|
||||
if ((_owner.getAutoSoulShot() == null) || _owner.getAutoSoulShot().isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
for (int itemId : getOwner().getAutoSoulShot())
|
||||
for (int itemId : _owner.getAutoSoulShot())
|
||||
{
|
||||
item = getOwner().getInventory().getItemByItemId(itemId);
|
||||
item = _owner.getInventory().getItemByItemId(itemId);
|
||||
|
||||
if (item != null)
|
||||
{
|
||||
@ -1059,7 +1057,7 @@ public abstract class L2Summon extends L2Playable
|
||||
handler = ItemHandler.getInstance().getHandler(item.getEtcItem());
|
||||
if (handler != null)
|
||||
{
|
||||
handler.useItem(getOwner(), item, false);
|
||||
handler.useItem(_owner, item, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1071,14 +1069,14 @@ public abstract class L2Summon extends L2Playable
|
||||
handler = ItemHandler.getInstance().getHandler(item.getEtcItem());
|
||||
if (handler != null)
|
||||
{
|
||||
handler.useItem(getOwner(), item, false);
|
||||
handler.useItem(_owner, item, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
getOwner().removeAutoSoulShot(itemId);
|
||||
_owner.removeAutoSoulShot(itemId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1086,13 +1084,13 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public int getClanId()
|
||||
{
|
||||
return (getOwner() != null) ? getOwner().getClanId() : 0;
|
||||
return (_owner != null) ? _owner.getClanId() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getAllyId()
|
||||
{
|
||||
return (getOwner() != null) ? getOwner().getAllyId() : 0;
|
||||
return (_owner != null) ? _owner.getAllyId() : 0;
|
||||
}
|
||||
|
||||
public int getFormId()
|
||||
@ -1144,7 +1142,7 @@ public abstract class L2Summon extends L2Playable
|
||||
|
||||
public void sendInventoryUpdate(InventoryUpdate iu)
|
||||
{
|
||||
final L2PcInstance owner = getOwner();
|
||||
final L2PcInstance owner = _owner;
|
||||
if (owner != null)
|
||||
{
|
||||
owner.sendInventoryUpdate(iu);
|
||||
|
@ -74,7 +74,7 @@ public class PcAppearance
|
||||
{
|
||||
if (_visibleName == null)
|
||||
{
|
||||
return getOwner().getName();
|
||||
return _owner.getName();
|
||||
}
|
||||
return _visibleName;
|
||||
}
|
||||
@ -94,7 +94,7 @@ public class PcAppearance
|
||||
{
|
||||
if (_visibleTitle == null)
|
||||
{
|
||||
return getOwner().getTitle();
|
||||
return _owner.getTitle();
|
||||
}
|
||||
return _visibleTitle;
|
||||
}
|
||||
@ -220,27 +220,27 @@ public class PcAppearance
|
||||
|
||||
public int getVisibleClanId()
|
||||
{
|
||||
return _visibleClanId != -1 ? _visibleClanId : getOwner().isCursedWeaponEquipped() ? 0 : getOwner().getClanId();
|
||||
return _visibleClanId != -1 ? _visibleClanId : _owner.isCursedWeaponEquipped() ? 0 : _owner.getClanId();
|
||||
}
|
||||
|
||||
public int getVisibleClanCrestId()
|
||||
{
|
||||
return _visibleClanCrestId != -1 ? _visibleClanCrestId : getOwner().isCursedWeaponEquipped() ? 0 : getOwner().getClanCrestId();
|
||||
return _visibleClanCrestId != -1 ? _visibleClanCrestId : _owner.isCursedWeaponEquipped() ? 0 : _owner.getClanCrestId();
|
||||
}
|
||||
|
||||
public int getVisibleClanLargeCrestId()
|
||||
{
|
||||
return _visibleClanLargeCrestId != -1 ? _visibleClanLargeCrestId : getOwner().isCursedWeaponEquipped() ? 0 : getOwner().getClanCrestLargeId();
|
||||
return _visibleClanLargeCrestId != -1 ? _visibleClanLargeCrestId : _owner.isCursedWeaponEquipped() ? 0 : _owner.getClanCrestLargeId();
|
||||
}
|
||||
|
||||
public int getVisibleAllyId()
|
||||
{
|
||||
return _visibleAllyId != -1 ? _visibleAllyId : getOwner().isCursedWeaponEquipped() ? 0 : getOwner().getAllyId();
|
||||
return _visibleAllyId != -1 ? _visibleAllyId : _owner.isCursedWeaponEquipped() ? 0 : _owner.getAllyId();
|
||||
}
|
||||
|
||||
public int getVisibleAllyCrestId()
|
||||
{
|
||||
return _visibleAllyCrestId != -1 ? _visibleAllyCrestId : getOwner().isCursedWeaponEquipped() ? 0 : getOwner().getAllyCrestId();
|
||||
return _visibleAllyCrestId != -1 ? _visibleAllyCrestId : _owner.isCursedWeaponEquipped() ? 0 : _owner.getAllyCrestId();
|
||||
}
|
||||
|
||||
public void setVisibleClanData(int clanId, int clanCrestId, int clanLargeCrestId, int allyId, int allyCrestId)
|
||||
|
@ -53,7 +53,7 @@ public class L2DecoyInstance extends L2Character
|
||||
_totalLifeTime = totalLifeTime;
|
||||
_timeRemaining = _totalLifeTime;
|
||||
final int skilllevel = getTemplate().getDisplayId() - 13070;
|
||||
_DecoyLifeTask = ThreadPool.scheduleAtFixedRate(new DecoyLifetime(getOwner(), this), 1000, 1000);
|
||||
_DecoyLifeTask = ThreadPool.scheduleAtFixedRate(new DecoyLifetime(_owner, this), 1000, 1000);
|
||||
_HateSpam = ThreadPool.scheduleAtFixedRate(new HateSpam(this, SkillData.getInstance().getSkill(5272, skilllevel)), 2000, 5000);
|
||||
}
|
||||
|
||||
@ -269,18 +269,18 @@ public class L2DecoyInstance extends L2Character
|
||||
@Override
|
||||
public void sendPacket(IClientOutgoingPacket... packets)
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if (_owner != null)
|
||||
{
|
||||
getOwner().sendPacket(packets);
|
||||
_owner.sendPacket(packets);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void sendPacket(SystemMessageId id)
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if (_owner != null)
|
||||
{
|
||||
getOwner().sendPacket(id);
|
||||
_owner.sendPacket(id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
|
||||
public final class L2DoorInstance extends L2Character
|
||||
{
|
||||
private boolean _open = false;
|
||||
boolean _open = false;
|
||||
private boolean _isAttackableDoor = false;
|
||||
private boolean _isInverted = false;
|
||||
private int _meshindex = 1;
|
||||
@ -293,7 +293,7 @@ public final class L2DoorInstance extends L2Character
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (getIsAttackableDoor())
|
||||
else if (_isAttackableDoor)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -369,13 +369,13 @@ public final class L2DoorInstance extends L2Character
|
||||
OnEventTrigger oe = null;
|
||||
if (getEmitter() > 0)
|
||||
{
|
||||
if (isInverted())
|
||||
if (_isInverted)
|
||||
{
|
||||
oe = new OnEventTrigger(getEmitter(), !isOpen());
|
||||
oe = new OnEventTrigger(getEmitter(), !_open);
|
||||
}
|
||||
else
|
||||
{
|
||||
oe = new OnEventTrigger(getEmitter(), isOpen());
|
||||
oe = new OnEventTrigger(getEmitter(), _open);
|
||||
}
|
||||
}
|
||||
|
||||
@ -592,13 +592,13 @@ public final class L2DoorInstance extends L2Character
|
||||
{
|
||||
if (getEmitter() > 0)
|
||||
{
|
||||
if (isInverted())
|
||||
if (_isInverted)
|
||||
{
|
||||
activeChar.sendPacket(new OnEventTrigger(getEmitter(), !isOpen()));
|
||||
activeChar.sendPacket(new OnEventTrigger(getEmitter(), !_open));
|
||||
}
|
||||
else
|
||||
{
|
||||
activeChar.sendPacket(new OnEventTrigger(getEmitter(), isOpen()));
|
||||
activeChar.sendPacket(new OnEventTrigger(getEmitter(), _open));
|
||||
}
|
||||
}
|
||||
activeChar.sendPacket(new StaticObject(this, activeChar.isGM()));
|
||||
@ -649,7 +649,7 @@ public final class L2DoorInstance extends L2Character
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (isOpen())
|
||||
if (_open)
|
||||
{
|
||||
closeMe();
|
||||
}
|
||||
@ -661,8 +661,7 @@ public final class L2DoorInstance extends L2Character
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final boolean open = isOpen();
|
||||
if (open)
|
||||
if (_open)
|
||||
{
|
||||
closeMe();
|
||||
}
|
||||
@ -671,7 +670,7 @@ public final class L2DoorInstance extends L2Character
|
||||
openMe();
|
||||
}
|
||||
|
||||
int delay = open ? getTemplate().getCloseTime() : getTemplate().getOpenTime();
|
||||
int delay = _open ? getTemplate().getCloseTime() : getTemplate().getOpenTime();
|
||||
if (getTemplate().getRandomTime() > 0)
|
||||
{
|
||||
delay += Rnd.get(getTemplate().getRandomTime());
|
||||
|
@ -75,7 +75,7 @@ public class L2MonsterInstance extends L2Attackable
|
||||
}
|
||||
|
||||
// Check if the L2MonsterInstance target is aggressive
|
||||
if (Config.GUARD_ATTACK_AGGRO_MOB && isAggressive() && (attacker instanceof L2GuardInstance))
|
||||
if (Config.GUARD_ATTACK_AGGRO_MOB && getTemplate().isAggressive() && (attacker instanceof L2GuardInstance))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -108,11 +108,11 @@ public class L2MonsterInstance extends L2Attackable
|
||||
{
|
||||
if (!isTeleporting())
|
||||
{
|
||||
if (getLeader() != null)
|
||||
if (_master != null)
|
||||
{
|
||||
setRandomWalking(false);
|
||||
setIsRaidMinion(getLeader().isRaid());
|
||||
getLeader().getMinionList().onMinionSpawn(this);
|
||||
setIsRaidMinion(_master.isRaid());
|
||||
_master.getMinionList().onMinionSpawn(this);
|
||||
}
|
||||
|
||||
startMaintenanceTask();
|
||||
@ -173,9 +173,9 @@ public class L2MonsterInstance extends L2Attackable
|
||||
getMinionList().onMasterDie(true);
|
||||
}
|
||||
|
||||
if (getLeader() != null)
|
||||
if (_master != null)
|
||||
{
|
||||
getLeader().getMinionList().onMinionDie(this, 0);
|
||||
_master.getMinionList().onMinionDie(this, 0);
|
||||
}
|
||||
|
||||
return super.deleteMe();
|
||||
@ -229,7 +229,7 @@ public class L2MonsterInstance extends L2Attackable
|
||||
@Override
|
||||
public boolean isWalker()
|
||||
{
|
||||
return ((getLeader() == null) ? super.isWalker() : getLeader().isWalker());
|
||||
return ((_master == null) ? super.isWalker() : _master.isWalker());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -238,7 +238,7 @@ public class L2MonsterInstance extends L2Attackable
|
||||
@Override
|
||||
public boolean giveRaidCurse()
|
||||
{
|
||||
return (isRaidMinion() && (getLeader() != null)) ? getLeader().giveRaidCurse() : super.giveRaidCurse();
|
||||
return (isRaidMinion() && (_master != null)) ? _master.giveRaidCurse() : super.giveRaidCurse();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -83,8 +83,8 @@ public class L2PetInstance extends L2Summon
|
||||
private static final String RESTORE_SKILL_SAVE = "SELECT petObjItemId,skill_id,skill_level,skill_sub_level,remaining_time,buff_index FROM character_pet_skills_save WHERE petObjItemId=? ORDER BY buff_index ASC";
|
||||
private static final String DELETE_SKILL_SAVE = "DELETE FROM character_pet_skills_save WHERE petObjItemId=?";
|
||||
|
||||
private int _curFed;
|
||||
private final PetInventory _inventory;
|
||||
int _curFed;
|
||||
final PetInventory _inventory;
|
||||
private final int _controlObjectId;
|
||||
private boolean _respawned;
|
||||
private final boolean _mountable;
|
||||
@ -140,9 +140,9 @@ public class L2PetInstance extends L2Summon
|
||||
stopFeed();
|
||||
return;
|
||||
}
|
||||
else if (getCurrentFed() > getFeedConsume())
|
||||
else if (_curFed > getFeedConsume())
|
||||
{
|
||||
setCurrentFed(getCurrentFed() - getFeedConsume());
|
||||
setCurrentFed(_curFed - getFeedConsume());
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -174,7 +174,7 @@ public class L2PetInstance extends L2Summon
|
||||
L2ItemInstance food = null;
|
||||
for (int id : foodIds)
|
||||
{
|
||||
food = getInventory().getItemByItemId(id);
|
||||
food = _inventory.getItemByItemId(id);
|
||||
if (food != null)
|
||||
{
|
||||
break;
|
||||
@ -333,9 +333,9 @@ public class L2PetInstance extends L2Summon
|
||||
@Override
|
||||
public L2ItemInstance getActiveWeaponInstance()
|
||||
{
|
||||
if (getInventory() != null)
|
||||
if (_inventory != null)
|
||||
{
|
||||
return getInventory().getItems(item -> (item.getItemLocation() == ItemLocation.PET_EQUIP) && (item.getItem().getBodyPart() == L2Item.SLOT_R_HAND)).stream().findAny().orElse(null);
|
||||
return _inventory.getItems(item -> (item.getItemLocation() == ItemLocation.PET_EQUIP) && (item.getItem().getBodyPart() == L2Item.SLOT_R_HAND)).stream().findAny().orElse(null);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@ -622,8 +622,8 @@ public class L2PetInstance extends L2Summon
|
||||
}
|
||||
else
|
||||
{
|
||||
final L2ItemInstance item = getInventory().addItem("Pickup", target, getOwner(), this);
|
||||
// sendPacket(new PetItemList(getInventory().getItems()));
|
||||
final L2ItemInstance item = _inventory.addItem("Pickup", target, getOwner(), this);
|
||||
// sendPacket(new PetItemList(_inventory.getItems()));
|
||||
sendPacket(new PetInventoryUpdate(item));
|
||||
}
|
||||
}
|
||||
@ -639,7 +639,7 @@ public class L2PetInstance extends L2Summon
|
||||
@Override
|
||||
public void deleteMe(L2PcInstance owner)
|
||||
{
|
||||
getInventory().transferItemsToOwner();
|
||||
_inventory.transferItemsToOwner();
|
||||
super.deleteMe(owner);
|
||||
destroyControlItem(owner, false); // this should also delete the pet from the db
|
||||
CharSummonTable.getInstance().getPets().remove(getOwner().getObjectId());
|
||||
@ -702,9 +702,9 @@ public class L2PetInstance extends L2Summon
|
||||
*/
|
||||
public L2ItemInstance transferItem(String process, int objectId, long count, Inventory target, L2PcInstance actor, L2Object reference)
|
||||
{
|
||||
final L2ItemInstance oldItem = getInventory().getItemByObjectId(objectId);
|
||||
final L2ItemInstance oldItem = _inventory.getItemByObjectId(objectId);
|
||||
final L2ItemInstance playerOldItem = target.getItemByItemId(oldItem.getId());
|
||||
final L2ItemInstance newItem = getInventory().transferItem(process, objectId, count, target, actor, reference);
|
||||
final L2ItemInstance newItem = _inventory.transferItem(process, objectId, count, target, actor, reference);
|
||||
|
||||
if (newItem == null)
|
||||
{
|
||||
@ -756,11 +756,11 @@ public class L2PetInstance extends L2Summon
|
||||
L2ItemInstance removedItem;
|
||||
if (evolve)
|
||||
{
|
||||
removedItem = owner.getInventory().destroyItem("Evolve", getControlObjectId(), 1, getOwner(), this);
|
||||
removedItem = owner.getInventory().destroyItem("Evolve", _controlObjectId, 1, getOwner(), this);
|
||||
}
|
||||
else
|
||||
{
|
||||
removedItem = owner.getInventory().destroyItem("PetDestroy", getControlObjectId(), 1, getOwner(), this);
|
||||
removedItem = owner.getInventory().destroyItem("PetDestroy", _controlObjectId, 1, getOwner(), this);
|
||||
if (removedItem != null)
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_DISAPPEARED);
|
||||
@ -791,7 +791,7 @@ public class L2PetInstance extends L2Summon
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("DELETE FROM pets WHERE item_obj_id = ?"))
|
||||
{
|
||||
statement.setInt(1, getControlObjectId());
|
||||
statement.setInt(1, _controlObjectId);
|
||||
statement.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -804,7 +804,7 @@ public class L2PetInstance extends L2Summon
|
||||
{
|
||||
try
|
||||
{
|
||||
for (L2ItemInstance item : getInventory().getItems())
|
||||
for (L2ItemInstance item : _inventory.getItems())
|
||||
{
|
||||
dropItemHere(item);
|
||||
}
|
||||
@ -817,7 +817,7 @@ public class L2PetInstance extends L2Summon
|
||||
|
||||
public void dropItemHere(L2ItemInstance dropit, boolean protect)
|
||||
{
|
||||
dropit = getInventory().dropItem("Drop", dropit.getObjectId(), dropit.getCount(), getOwner(), this);
|
||||
dropit = _inventory.dropItem("Drop", dropit.getObjectId(), dropit.getCount(), getOwner(), this);
|
||||
|
||||
if (dropit != null)
|
||||
{
|
||||
@ -921,7 +921,7 @@ public class L2PetInstance extends L2Summon
|
||||
@Override
|
||||
public void storeMe()
|
||||
{
|
||||
if (getControlObjectId() == 0)
|
||||
if (_controlObjectId == 0)
|
||||
{
|
||||
// this is a summon, not a pet, don't store anything
|
||||
return;
|
||||
@ -933,7 +933,7 @@ public class L2PetInstance extends L2Summon
|
||||
}
|
||||
|
||||
String req;
|
||||
if (!isRespawned())
|
||||
if (!_respawned)
|
||||
{
|
||||
req = "INSERT INTO pets (name,level,curHp,curMp,exp,sp,fed,ownerId,restore,item_obj_id) VALUES (?,?,?,?,?,?,?,?,?,?)";
|
||||
}
|
||||
@ -951,10 +951,10 @@ public class L2PetInstance extends L2Summon
|
||||
statement.setDouble(4, getStatus().getCurrentMp());
|
||||
statement.setLong(5, getStat().getExp());
|
||||
statement.setLong(6, getStat().getSp());
|
||||
statement.setInt(7, getCurrentFed());
|
||||
statement.setInt(7, _curFed);
|
||||
statement.setInt(8, getOwner().getObjectId());
|
||||
statement.setString(9, String.valueOf(_restoreSummon)); // True restores pet on login
|
||||
statement.setInt(10, getControlObjectId());
|
||||
statement.setInt(10, _controlObjectId);
|
||||
statement.executeUpdate();
|
||||
|
||||
_respawned = true;
|
||||
@ -997,7 +997,7 @@ public class L2PetInstance extends L2Summon
|
||||
PreparedStatement ps2 = con.prepareStatement(ADD_SKILL_SAVE))
|
||||
{
|
||||
// Delete all current stored effects for summon to avoid dupe
|
||||
ps1.setInt(1, getControlObjectId());
|
||||
ps1.setInt(1, _controlObjectId);
|
||||
ps1.execute();
|
||||
|
||||
int buff_index = 0;
|
||||
@ -1045,7 +1045,7 @@ public class L2PetInstance extends L2Summon
|
||||
continue;
|
||||
}
|
||||
|
||||
ps2.setInt(1, getControlObjectId());
|
||||
ps2.setInt(1, _controlObjectId);
|
||||
ps2.setInt(2, skill.getId());
|
||||
ps2.setInt(3, skill.getLevel());
|
||||
ps2.setInt(4, skill.getSubLevel());
|
||||
@ -1073,7 +1073,7 @@ public class L2PetInstance extends L2Summon
|
||||
{
|
||||
if (!SummonEffectsTable.getInstance().getPetEffects().containsKey(getControlObjectId()))
|
||||
{
|
||||
ps1.setInt(1, getControlObjectId());
|
||||
ps1.setInt(1, _controlObjectId);
|
||||
try (ResultSet rset = ps1.executeQuery())
|
||||
{
|
||||
while (rset.next())
|
||||
@ -1094,7 +1094,7 @@ public class L2PetInstance extends L2Summon
|
||||
}
|
||||
}
|
||||
|
||||
ps2.setInt(1, getControlObjectId());
|
||||
ps2.setInt(1, _controlObjectId);
|
||||
ps2.executeUpdate();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -1147,9 +1147,9 @@ public class L2PetInstance extends L2Summon
|
||||
|
||||
if (!isDead())
|
||||
{
|
||||
if (getInventory() != null)
|
||||
if (_inventory != null)
|
||||
{
|
||||
getInventory().deleteMe();
|
||||
_inventory.deleteMe();
|
||||
}
|
||||
L2World.getInstance().removePet(owner.getObjectId());
|
||||
}
|
||||
@ -1330,7 +1330,7 @@ public class L2PetInstance extends L2Summon
|
||||
@Override
|
||||
public final boolean isHungry()
|
||||
{
|
||||
return getCurrentFed() < ((getPetData().getHungryLimit() / 100f) * getPetLevelData().getPetMaxFeed());
|
||||
return _curFed < ((getPetData().getHungryLimit() / 100f) * getPetLevelData().getPetMaxFeed());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1340,13 +1340,13 @@ public class L2PetInstance extends L2Summon
|
||||
*/
|
||||
public boolean isUncontrollable()
|
||||
{
|
||||
return getCurrentFed() <= 0;
|
||||
return _curFed <= 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getWeapon()
|
||||
{
|
||||
final L2ItemInstance weapon = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
|
||||
final L2ItemInstance weapon = _inventory.getPaperdollItem(Inventory.PAPERDOLL_RHAND);
|
||||
if (weapon != null)
|
||||
{
|
||||
return weapon.getId();
|
||||
@ -1357,7 +1357,7 @@ public class L2PetInstance extends L2Summon
|
||||
@Override
|
||||
public final int getArmor()
|
||||
{
|
||||
final L2ItemInstance weapon = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
|
||||
final L2ItemInstance weapon = _inventory.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
|
||||
if (weapon != null)
|
||||
{
|
||||
return weapon.getId();
|
||||
@ -1367,7 +1367,7 @@ public class L2PetInstance extends L2Summon
|
||||
|
||||
public final int getJewel()
|
||||
{
|
||||
final L2ItemInstance weapon = getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK);
|
||||
final L2ItemInstance weapon = _inventory.getPaperdollItem(Inventory.PAPERDOLL_NECK);
|
||||
if (weapon != null)
|
||||
{
|
||||
return weapon.getId();
|
||||
|
@ -240,7 +240,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
|
||||
final Map<Integer, List<SummonEffect>> servitorEffects = SummonEffectsTable.getInstance().getServitorEffects(getOwner());
|
||||
if (servitorEffects != null)
|
||||
{
|
||||
final List<SummonEffect> effects = servitorEffects.get(getReferenceSkill());
|
||||
final List<SummonEffect> effects = servitorEffects.get(_referenceSkill);
|
||||
if ((effects != null) && !effects.isEmpty())
|
||||
{
|
||||
for (SummonEffect effect : effects)
|
||||
@ -294,7 +294,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
|
||||
// Delete all current stored effects for summon to avoid dupe
|
||||
statement.setInt(1, getOwner().getObjectId());
|
||||
statement.setInt(2, getOwner().getClassIndex());
|
||||
statement.setInt(3, getReferenceSkill());
|
||||
statement.setInt(3, _referenceSkill);
|
||||
statement.execute();
|
||||
|
||||
int buff_index = 0;
|
||||
@ -348,7 +348,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
|
||||
|
||||
ps2.setInt(1, getOwner().getObjectId());
|
||||
ps2.setInt(2, getOwner().getClassIndex());
|
||||
ps2.setInt(3, getReferenceSkill());
|
||||
ps2.setInt(3, _referenceSkill);
|
||||
ps2.setInt(4, skill.getId());
|
||||
ps2.setInt(5, skill.getLevel());
|
||||
ps2.setInt(6, info.getTime());
|
||||
@ -397,7 +397,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
|
||||
{
|
||||
statement.setInt(1, getOwner().getObjectId());
|
||||
statement.setInt(2, getOwner().getClassIndex());
|
||||
statement.setInt(3, getReferenceSkill());
|
||||
statement.setInt(3, _referenceSkill);
|
||||
try (ResultSet rset = statement.executeQuery())
|
||||
{
|
||||
while (rset.next())
|
||||
@ -437,7 +437,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
|
||||
{
|
||||
statement.setInt(1, getOwner().getObjectId());
|
||||
statement.setInt(2, getOwner().getClassIndex());
|
||||
statement.setInt(3, getReferenceSkill());
|
||||
statement.setInt(3, _referenceSkill);
|
||||
statement.executeUpdate();
|
||||
}
|
||||
}
|
||||
@ -554,12 +554,12 @@ public class L2ServitorInstance extends L2Summon implements Runnable
|
||||
_consumeItemIntervalRemaining -= usedtime;
|
||||
|
||||
// check if it is time to consume another item
|
||||
if ((_consumeItemIntervalRemaining <= 0) && (getItemConsume().getCount() > 0) && (getItemConsume().getId() > 0) && !isDead())
|
||||
if ((_consumeItemIntervalRemaining <= 0) && (_itemConsume.getCount() > 0) && (_itemConsume.getId() > 0) && !isDead())
|
||||
{
|
||||
if (destroyItemByItemId("Consume", getItemConsume().getId(), getItemConsume().getCount(), this, false))
|
||||
if (destroyItemByItemId("Consume", _itemConsume.getId(), _itemConsume.getCount(), this, false))
|
||||
{
|
||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.A_SUMMONED_MONSTER_USES_S1);
|
||||
msg.addItemName(getItemConsume().getId());
|
||||
msg.addItemName(_itemConsume.getId());
|
||||
sendPacket(msg);
|
||||
|
||||
// Reset
|
||||
@ -573,7 +573,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
|
||||
}
|
||||
}
|
||||
|
||||
sendPacket(new SetSummonRemainTime(getLifeTime(), _lifeTimeRemaining));
|
||||
sendPacket(new SetSummonRemainTime(_lifeTime, _lifeTimeRemaining));
|
||||
|
||||
// Using same task to check if owner is in visible range
|
||||
if (calculateDistance(getOwner(), true, false) > 2000)
|
||||
|
@ -51,7 +51,7 @@ public class L2ShuttleInstance extends L2Vehicle
|
||||
|
||||
public void closeDoor(int id)
|
||||
{
|
||||
for (L2ShuttleStop stop : getStops())
|
||||
for (L2ShuttleStop stop : _shuttleData.getStops())
|
||||
{
|
||||
if (stop.getId() == id)
|
||||
{
|
||||
@ -63,7 +63,7 @@ public class L2ShuttleInstance extends L2Vehicle
|
||||
|
||||
public void openDoor(int id)
|
||||
{
|
||||
for (L2ShuttleStop stop : getStops())
|
||||
for (L2ShuttleStop stop : _shuttleData.getStops())
|
||||
{
|
||||
if (stop.getId() == id)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ public class ObjectPoly
|
||||
|
||||
public final boolean isMorphed()
|
||||
{
|
||||
return getPolyType() != null;
|
||||
return _polyType != null;
|
||||
}
|
||||
|
||||
public final int getPolyId()
|
||||
|
@ -72,7 +72,7 @@ public class CharStatus
|
||||
*/
|
||||
public final void addStatusListener(L2Character object)
|
||||
{
|
||||
if (object == getActiveChar())
|
||||
if (object == _activeChar)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -136,7 +136,7 @@ public class CharStatus
|
||||
|
||||
public void reduceHp(double value, L2Character attacker, boolean awake, boolean isDOT, boolean isHPConsumption)
|
||||
{
|
||||
final L2Character activeChar = getActiveChar();
|
||||
final L2Character activeChar = _activeChar;
|
||||
if (activeChar.isDead())
|
||||
{
|
||||
return;
|
||||
@ -169,14 +169,14 @@ public class CharStatus
|
||||
}
|
||||
if (Formulas.calcRealTargetBreak())
|
||||
{
|
||||
getActiveChar().getEffectList().stopEffects(AbnormalType.REAL_TARGET);
|
||||
_activeChar.getEffectList().stopEffects(AbnormalType.REAL_TARGET);
|
||||
}
|
||||
}
|
||||
|
||||
if (value > 0)
|
||||
{
|
||||
final double oldHp = getCurrentHp();
|
||||
final double newHp = Math.max(getCurrentHp() - value, activeChar.isUndying() ? 1 : 0);
|
||||
final double oldHp = _currentHp;
|
||||
final double newHp = Math.max(_currentHp - value, activeChar.isUndying() ? 1 : 0);
|
||||
setCurrentHp(newHp);
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnCreatureHpChange(activeChar, oldHp, newHp), activeChar);
|
||||
}
|
||||
@ -189,7 +189,7 @@ public class CharStatus
|
||||
|
||||
public void reduceMp(double value)
|
||||
{
|
||||
setCurrentMp(Math.max(getCurrentMp() - value, 0));
|
||||
setCurrentMp(Math.max(_currentMp - value, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -202,10 +202,10 @@ public class CharStatus
|
||||
*/
|
||||
public final synchronized void startHpMpRegeneration()
|
||||
{
|
||||
if ((_regTask == null) && !getActiveChar().isDead())
|
||||
if ((_regTask == null) && !_activeChar.isDead())
|
||||
{
|
||||
// Get the Regeneration period
|
||||
final int period = Formulas.getRegeneratePeriod(getActiveChar());
|
||||
final int period = Formulas.getRegeneratePeriod(_activeChar);
|
||||
|
||||
// Create the HP/MP/CP Regeneration task
|
||||
_regTask = ThreadPool.scheduleAtFixedRate(this::doRegeneration, period, period);
|
||||
@ -269,12 +269,12 @@ public class CharStatus
|
||||
public boolean setCurrentHp(double newHp, boolean broadcastPacket)
|
||||
{
|
||||
// Get the Max HP of the L2Character
|
||||
final int currentHp = (int) getCurrentHp();
|
||||
final double maxHp = getActiveChar().getStat().getMaxHp();
|
||||
final int currentHp = (int) _currentHp;
|
||||
final double maxHp = _activeChar.getStat().getMaxHp();
|
||||
|
||||
synchronized (this)
|
||||
{
|
||||
if (getActiveChar().isDead())
|
||||
if (_activeChar.isDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -324,7 +324,7 @@ public class CharStatus
|
||||
|
||||
if (broadcastPacket)
|
||||
{
|
||||
getActiveChar().broadcastStatusUpdate();
|
||||
_activeChar.broadcastStatusUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@ -337,7 +337,7 @@ public class CharStatus
|
||||
hpOrMpWasChanged |= setCurrentMp(newMp, false);
|
||||
if (hpOrMpWasChanged)
|
||||
{
|
||||
getActiveChar().broadcastStatusUpdate();
|
||||
_activeChar.broadcastStatusUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@ -360,12 +360,12 @@ public class CharStatus
|
||||
public final boolean setCurrentMp(double newMp, boolean broadcastPacket)
|
||||
{
|
||||
// Get the Max MP of the L2Character
|
||||
final int currentMp = (int) getCurrentMp();
|
||||
final int maxMp = getActiveChar().getStat().getMaxMp();
|
||||
final int currentMp = (int) _currentMp;
|
||||
final int maxMp = _activeChar.getStat().getMaxMp();
|
||||
|
||||
synchronized (this)
|
||||
{
|
||||
if (getActiveChar().isDead())
|
||||
if (_activeChar.isDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -398,7 +398,7 @@ public class CharStatus
|
||||
// Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
|
||||
if (mpWasChanged && broadcastPacket)
|
||||
{
|
||||
getActiveChar().broadcastStatusUpdate();
|
||||
_activeChar.broadcastStatusUpdate();
|
||||
}
|
||||
|
||||
return mpWasChanged;
|
||||
@ -407,10 +407,10 @@ public class CharStatus
|
||||
protected void doRegeneration()
|
||||
{
|
||||
// Modify the current HP/MP of the L2Character and broadcast Server->Client packet StatusUpdate
|
||||
if (!getActiveChar().isDead() && ((getCurrentHp() < getActiveChar().getMaxRecoverableHp()) || (getCurrentMp() < getActiveChar().getMaxRecoverableMp())))
|
||||
if (!_activeChar.isDead() && ((_currentHp < _activeChar.getMaxRecoverableHp()) || (_currentMp < _activeChar.getMaxRecoverableMp())))
|
||||
{
|
||||
final double newHp = getCurrentHp() + getActiveChar().getStat().getValue(Stats.REGENERATE_HP_RATE);
|
||||
final double newMp = getCurrentMp() + getActiveChar().getStat().getValue(Stats.REGENERATE_MP_RATE);
|
||||
final double newHp = _currentHp + _activeChar.getStat().getValue(Stats.REGENERATE_HP_RATE);
|
||||
final double newMp = _currentMp + _activeChar.getStat().getValue(Stats.REGENERATE_MP_RATE);
|
||||
setCurrentHpMp(newHp, newMp);
|
||||
}
|
||||
else
|
||||
|
@ -48,9 +48,9 @@ public class PcStatus extends PlayableStatus
|
||||
@Override
|
||||
public final void reduceCp(int value)
|
||||
{
|
||||
if (getCurrentCp() > value)
|
||||
if (_currentCp > value)
|
||||
{
|
||||
setCurrentCp(getCurrentCp() - value);
|
||||
setCurrentCp(_currentCp - value);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -78,7 +78,7 @@ public class PcStatus extends PlayableStatus
|
||||
}
|
||||
|
||||
// If OFFLINE_MODE_NO_DAMAGE is enabled and player is offline and he is in store/craft mode, no damage is taken.
|
||||
if (Config.OFFLINE_MODE_NO_DAMAGE && (getActiveChar().getClient() != null) && getActiveChar().getClient().isDetached() && ((Config.OFFLINE_TRADE_ENABLE && ((getActiveChar().getPrivateStoreType() == PrivateStoreType.SELL) || (getActiveChar().getPrivateStoreType() == PrivateStoreType.BUY))) || (Config.OFFLINE_CRAFT_ENABLE && (getActiveChar().isInCraftMode() || (getActiveChar().getPrivateStoreType() == PrivateStoreType.MANUFACTURE)))))
|
||||
if (Config.OFFLINE_MODE_NO_DAMAGE && (getActiveChar().getClient() != null) && getActiveChar().getClient().isDetached() && ((Config.OFFLINE_TRADE_ENABLE && ((getActiveChar().getPrivateStoreType() == PrivateStoreType.SELL) || (getActiveChar().getPrivateStoreType() == PrivateStoreType.BUY))) || (Config.OFFLINE_CRAFT_ENABLE && (getActiveChar().isCrafting() || (getActiveChar().getPrivateStoreType() == PrivateStoreType.MANUFACTURE)))))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -100,7 +100,7 @@ public class PcStatus extends PlayableStatus
|
||||
getActiveChar().stopEffectsOnDamage();
|
||||
}
|
||||
// Attacked players in craft/shops stand up.
|
||||
if (getActiveChar().isInCraftMode() || getActiveChar().isInStoreMode())
|
||||
if (getActiveChar().isCrafting() || getActiveChar().isInStoreMode())
|
||||
{
|
||||
getActiveChar().setPrivateStoreType(PrivateStoreType.NONE);
|
||||
getActiveChar().standUp();
|
||||
@ -238,14 +238,14 @@ public class PcStatus extends PlayableStatus
|
||||
|
||||
if (!ignoreCP && (attacker.isPlayable() || attacker.isFakePlayer()))
|
||||
{
|
||||
if (getCurrentCp() >= value)
|
||||
if (_currentCp >= value)
|
||||
{
|
||||
setCurrentCp(getCurrentCp() - value); // Set Cp to diff of Cp vs value
|
||||
setCurrentCp(_currentCp - value); // Set Cp to diff of Cp vs value
|
||||
value = 0; // No need to subtract anything from Hp
|
||||
}
|
||||
else
|
||||
{
|
||||
value -= getCurrentCp(); // Get diff from value vs Cp; will apply diff to Hp
|
||||
value -= _currentCp; // Get diff from value vs Cp; will apply diff to Hp
|
||||
setCurrentCp(0, false); // Set Cp to 0
|
||||
}
|
||||
}
|
||||
@ -337,7 +337,7 @@ public class PcStatus extends PlayableStatus
|
||||
public final void setCurrentCp(double newCp, boolean broadcastPacket)
|
||||
{
|
||||
// Get the Max CP of the L2Character
|
||||
final int currentCp = (int) getCurrentCp();
|
||||
final int currentCp = (int) _currentCp;
|
||||
final int maxCp = getActiveChar().getStat().getMaxCp();
|
||||
|
||||
synchronized (this)
|
||||
@ -388,9 +388,9 @@ public class PcStatus extends PlayableStatus
|
||||
final PcStat charstat = getActiveChar().getStat();
|
||||
|
||||
// Modify the current CP of the L2Character and broadcast Server->Client packet StatusUpdate
|
||||
if (getCurrentCp() < charstat.getMaxRecoverableCp())
|
||||
if (_currentCp < charstat.getMaxRecoverableCp())
|
||||
{
|
||||
setCurrentCp(getCurrentCp() + getActiveChar().getStat().getValue(Stats.REGENERATE_CP_RATE), false);
|
||||
setCurrentCp(_currentCp + getActiveChar().getStat().getValue(Stats.REGENERATE_CP_RATE), false);
|
||||
}
|
||||
|
||||
// Modify the current HP of the L2Character and broadcast Server->Client packet StatusUpdate
|
||||
|
@ -279,7 +279,7 @@ public final class L2NpcTemplate extends L2CharTemplate implements IIdentifiable
|
||||
|
||||
public boolean isType(String type)
|
||||
{
|
||||
return getType().equalsIgnoreCase(type);
|
||||
return _type.equalsIgnoreCase(type);
|
||||
}
|
||||
|
||||
public String getName()
|
||||
|
@ -262,13 +262,13 @@ public final class Transform implements IIdentifiable
|
||||
|
||||
if (creature.isPlayer())
|
||||
{
|
||||
if (getName() != null)
|
||||
if (_name != null)
|
||||
{
|
||||
player.getAppearance().setVisibleName(getName());
|
||||
player.getAppearance().setVisibleName(_name);
|
||||
}
|
||||
if (getTitle() != null)
|
||||
if (_title != null)
|
||||
{
|
||||
player.getAppearance().setVisibleTitle(getTitle());
|
||||
player.getAppearance().setVisibleTitle(_title);
|
||||
}
|
||||
|
||||
if (addSkills)
|
||||
@ -374,11 +374,11 @@ public final class Transform implements IIdentifiable
|
||||
final L2PcInstance player = creature.getActingPlayer();
|
||||
final boolean hasTransformSkills = player.hasTransformSkills();
|
||||
|
||||
if (getName() != null)
|
||||
if (_name != null)
|
||||
{
|
||||
player.getAppearance().setVisibleName(null);
|
||||
}
|
||||
if (getTitle() != null)
|
||||
if (_title != null)
|
||||
{
|
||||
player.getAppearance().setVisibleTitle(null);
|
||||
}
|
||||
|
@ -100,9 +100,9 @@ public final class AutoAnnouncement extends Announcement implements Runnable
|
||||
st.setInt(1, getType().ordinal());
|
||||
st.setString(2, getContent());
|
||||
st.setString(3, getAuthor());
|
||||
st.setLong(4, getInitial());
|
||||
st.setLong(5, getDelay());
|
||||
st.setInt(6, getRepeat());
|
||||
st.setLong(4, _initial);
|
||||
st.setLong(5, _delay);
|
||||
st.setInt(6, _repeat);
|
||||
st.execute();
|
||||
try (ResultSet rset = st.getGeneratedKeys())
|
||||
{
|
||||
@ -129,9 +129,9 @@ public final class AutoAnnouncement extends Announcement implements Runnable
|
||||
st.setInt(1, getType().ordinal());
|
||||
st.setString(2, getContent());
|
||||
st.setString(3, getAuthor());
|
||||
st.setLong(4, getInitial());
|
||||
st.setLong(5, getDelay());
|
||||
st.setLong(6, getRepeat());
|
||||
st.setLong(4, _initial);
|
||||
st.setLong(5, _delay);
|
||||
st.setLong(6, _repeat);
|
||||
st.setLong(7, getId());
|
||||
st.execute();
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ public final class SubClass
|
||||
|
||||
public void incLevel()
|
||||
{
|
||||
if (!_dualClass && (getLevel() == _maxLevel))
|
||||
if (!_dualClass && (_level == _maxLevel))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -151,7 +151,7 @@ public final class SubClass
|
||||
|
||||
public void decLevel()
|
||||
{
|
||||
if (getLevel() == Config.BASE_SUBCLASS_LEVEL)
|
||||
if (_level == Config.BASE_SUBCLASS_LEVEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -69,7 +69,7 @@ public final class Product
|
||||
|
||||
public int getItemId()
|
||||
{
|
||||
return getItem().getId();
|
||||
return _item.getId();
|
||||
}
|
||||
|
||||
public long getPrice()
|
||||
@ -124,7 +124,7 @@ public final class Product
|
||||
}
|
||||
if ((_restockTask == null) || _restockTask.isDone())
|
||||
{
|
||||
_restockTask = ThreadPool.schedule(this::restock, getRestockDelay());
|
||||
_restockTask = ThreadPool.schedule(this::restock, _restockDelay);
|
||||
}
|
||||
final boolean result = _count.addAndGet(-val) >= 0;
|
||||
save();
|
||||
@ -133,7 +133,7 @@ public final class Product
|
||||
|
||||
public boolean hasLimitedStock()
|
||||
{
|
||||
return getMaxCount() > -1;
|
||||
return _maxCount > -1;
|
||||
}
|
||||
|
||||
public void restartRestockTask(long nextRestockTime)
|
||||
@ -151,7 +151,7 @@ public final class Product
|
||||
|
||||
public void restock()
|
||||
{
|
||||
setCount(getMaxCount());
|
||||
setCount(_maxCount);
|
||||
save();
|
||||
}
|
||||
|
||||
@ -161,7 +161,7 @@ public final class Product
|
||||
PreparedStatement statement = con.prepareStatement("INSERT INTO `buylists`(`buylist_id`, `item_id`, `count`, `next_restock_time`) VALUES(?, ?, ?, ?) ON DUPLICATE KEY UPDATE `count` = ?, `next_restock_time` = ?"))
|
||||
{
|
||||
statement.setInt(1, _buyListId);
|
||||
statement.setInt(2, getItemId());
|
||||
statement.setInt(2, _item.getId());
|
||||
statement.setLong(3, getCount());
|
||||
statement.setLong(5, getCount());
|
||||
if ((_restockTask != null) && (_restockTask.getDelay(TimeUnit.MILLISECONDS) > 0))
|
||||
@ -179,7 +179,7 @@ public final class Product
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Failed to save Product buylist_id:" + _buyListId + " item_id:" + getItemId(), e);
|
||||
LOGGER.log(Level.WARNING, "Failed to save Product buylist_id:" + _buyListId + " item_id:" + _item.getId(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -538,9 +538,9 @@ public final class BlockCheckerEngine
|
||||
_redPoints += _numOfBoxes / 2;
|
||||
_bluePoints += _numOfBoxes / 2;
|
||||
|
||||
final int timeLeft = (int) ((getStarterTime() - System.currentTimeMillis()) / 1000);
|
||||
final int timeLeft = (int) ((_startedTime - System.currentTimeMillis()) / 1000);
|
||||
final ExCubeGameChangePoints changePoints = new ExCubeGameChangePoints(timeLeft, getBluePoints(), getRedPoints());
|
||||
getHolder().broadCastPacketToTeam(changePoints);
|
||||
_holder.broadCastPacketToTeam(changePoints);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,7 @@ public final class Castle extends AbstractResidence
|
||||
|
||||
private final List<L2DoorInstance> _doors = new ArrayList<>();
|
||||
private final List<L2Npc> _sideNpcs = new ArrayList<>();
|
||||
private int _ownerId = 0;
|
||||
int _ownerId = 0;
|
||||
private Siege _siege = null;
|
||||
private Calendar _siegeDate;
|
||||
private boolean _isTimeRegistrationOver = true; // true if Castle Lords set the time, or 24h is elapsed after the siege
|
||||
@ -96,12 +96,12 @@ public final class Castle extends AbstractResidence
|
||||
|
||||
public class CastleFunction
|
||||
{
|
||||
private final int _type;
|
||||
final int _type;
|
||||
private int _lvl;
|
||||
protected int _fee;
|
||||
protected int _tempFee;
|
||||
private final long _rate;
|
||||
private long _endDate;
|
||||
final long _rate;
|
||||
long _endDate;
|
||||
protected boolean _inDebt;
|
||||
public boolean _cwh;
|
||||
|
||||
@ -158,7 +158,7 @@ public final class Castle extends AbstractResidence
|
||||
|
||||
private void initializeTask(boolean cwh)
|
||||
{
|
||||
if (getOwnerId() <= 0)
|
||||
if (_ownerId <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -185,29 +185,29 @@ public final class Castle extends AbstractResidence
|
||||
{
|
||||
try
|
||||
{
|
||||
if (getOwnerId() <= 0)
|
||||
if (_ownerId <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ((ClanTable.getInstance().getClan(getOwnerId()).getWarehouse().getAdena() >= _fee) || !_cwh)
|
||||
{
|
||||
int fee = _fee;
|
||||
if (getEndTime() == -1)
|
||||
if (_endDate == -1)
|
||||
{
|
||||
fee = _tempFee;
|
||||
}
|
||||
|
||||
setEndTime(System.currentTimeMillis() + getRate());
|
||||
setEndTime(System.currentTimeMillis() + _rate);
|
||||
dbSave();
|
||||
if (_cwh)
|
||||
{
|
||||
ClanTable.getInstance().getClan(getOwnerId()).getWarehouse().destroyItemByItemId("CS_function_fee", Inventory.ADENA_ID, fee, null, null);
|
||||
}
|
||||
ThreadPool.schedule(new FunctionTask(true), getRate());
|
||||
ThreadPool.schedule(new FunctionTask(true), _rate);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeFunction(getType());
|
||||
removeFunction(_type);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -223,11 +223,11 @@ public final class Castle extends AbstractResidence
|
||||
PreparedStatement ps = con.prepareStatement("REPLACE INTO castle_functions (castle_id, type, lvl, lease, rate, endTime) VALUES (?,?,?,?,?,?)"))
|
||||
{
|
||||
ps.setInt(1, getResidenceId());
|
||||
ps.setInt(2, getType());
|
||||
ps.setInt(3, getLvl());
|
||||
ps.setInt(4, getLease());
|
||||
ps.setLong(5, getRate());
|
||||
ps.setLong(6, getEndTime());
|
||||
ps.setInt(2, _type);
|
||||
ps.setInt(3, _lvl);
|
||||
ps.setInt(4, _fee);
|
||||
ps.setLong(5, _rate);
|
||||
ps.setLong(6, _endDate);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -244,7 +244,7 @@ public final class Castle extends AbstractResidence
|
||||
initResidenceZone();
|
||||
initFunctions();
|
||||
spawnSideNpcs();
|
||||
if (getOwnerId() != 0)
|
||||
if (_ownerId != 0)
|
||||
{
|
||||
loadFunctions();
|
||||
loadDoorUpgrade();
|
||||
@ -287,7 +287,7 @@ public final class Castle extends AbstractResidence
|
||||
public void addToTreasury(long amount)
|
||||
{
|
||||
// check if owned
|
||||
if (getOwnerId() <= 0)
|
||||
if (_ownerId <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -338,7 +338,7 @@ public final class Castle extends AbstractResidence
|
||||
*/
|
||||
public boolean addToTreasuryNoTax(long amount)
|
||||
{
|
||||
if (getOwnerId() <= 0)
|
||||
if (_ownerId <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -364,7 +364,7 @@ public final class Castle extends AbstractResidence
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE castle SET treasury = ? WHERE id = ?"))
|
||||
{
|
||||
ps.setLong(1, getTreasury());
|
||||
ps.setLong(1, _treasury);
|
||||
ps.setInt(2, getResidenceId());
|
||||
ps.execute();
|
||||
}
|
||||
@ -380,7 +380,7 @@ public final class Castle extends AbstractResidence
|
||||
*/
|
||||
public void banishForeigners()
|
||||
{
|
||||
getResidenceZone().banishForeigners(getOwnerId());
|
||||
getResidenceZone().banishForeigners(_ownerId);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -460,7 +460,7 @@ public final class Castle extends AbstractResidence
|
||||
|
||||
public void openCloseDoor(L2PcInstance activeChar, int doorId, boolean open)
|
||||
{
|
||||
if ((activeChar.getClanId() != getOwnerId()) && !activeChar.canOverrideCond(PcCondOverride.CASTLE_CONDITIONS))
|
||||
if ((activeChar.getClanId() != _ownerId) && !activeChar.canOverrideCond(PcCondOverride.CASTLE_CONDITIONS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -481,7 +481,7 @@ public final class Castle extends AbstractResidence
|
||||
|
||||
public void openCloseDoor(L2PcInstance activeChar, String doorName, boolean open)
|
||||
{
|
||||
if ((activeChar.getClanId() != getOwnerId()) && !activeChar.canOverrideCond(PcCondOverride.CASTLE_CONDITIONS))
|
||||
if ((activeChar.getClanId() != _ownerId) && !activeChar.canOverrideCond(PcCondOverride.CASTLE_CONDITIONS))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -516,7 +516,7 @@ public final class Castle extends AbstractResidence
|
||||
public void setOwner(L2Clan clan)
|
||||
{
|
||||
// Remove old owner
|
||||
if ((getOwnerId() > 0) && ((clan == null) || (clan.getId() != getOwnerId())))
|
||||
if ((_ownerId > 0) && ((clan == null) || (clan.getId() != _ownerId)))
|
||||
{
|
||||
final L2Clan oldOwner = ClanTable.getInstance().getClan(getOwnerId()); // Try to find clan instance
|
||||
if (oldOwner != null)
|
||||
@ -877,7 +877,7 @@ public final class Castle extends AbstractResidence
|
||||
try (PreparedStatement ps = con.prepareStatement("UPDATE clan_data SET hasCastle = ? WHERE clan_id = ?"))
|
||||
{
|
||||
ps.setInt(1, getResidenceId());
|
||||
ps.setInt(2, getOwnerId());
|
||||
ps.setInt(2, _ownerId);
|
||||
ps.execute();
|
||||
}
|
||||
|
||||
@ -897,12 +897,12 @@ public final class Castle extends AbstractResidence
|
||||
|
||||
public final L2DoorInstance getDoor(int doorId)
|
||||
{
|
||||
return getDoors().stream().filter(d -> d.getId() == doorId).findFirst().orElse(null);
|
||||
return _doors.stream().filter(d -> d.getId() == doorId).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
public final L2DoorInstance getDoor(String doorName)
|
||||
{
|
||||
return getDoors().stream().filter(d -> d.getTemplate().getName().equals(doorName)).findFirst().orElse(null);
|
||||
return _doors.stream().filter(d -> d.getTemplate().getName().equals(doorName)).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
public final List<L2DoorInstance> getDoors()
|
||||
@ -957,7 +957,7 @@ public final class Castle extends AbstractResidence
|
||||
public final int getTaxPercent(TaxType type)
|
||||
{
|
||||
final int taxPercent;
|
||||
switch (getSide())
|
||||
switch (_castleSide)
|
||||
{
|
||||
case LIGHT:
|
||||
{
|
||||
@ -1036,7 +1036,7 @@ public final class Castle extends AbstractResidence
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE castle SET showNpcCrest = ? WHERE id = ?"))
|
||||
{
|
||||
ps.setString(1, String.valueOf(getShowNpcCrest()));
|
||||
ps.setString(1, String.valueOf(_showNpcCrest));
|
||||
ps.setInt(2, getResidenceId());
|
||||
ps.execute();
|
||||
}
|
||||
@ -1156,7 +1156,7 @@ public final class Castle extends AbstractResidence
|
||||
public void giveResidentialSkills(L2PcInstance player)
|
||||
{
|
||||
super.giveResidentialSkills(player);
|
||||
final Skill skill = getSide() == CastleSide.DARK ? CommonSkill.ABILITY_OF_DARKNESS.getSkill() : CommonSkill.ABILITY_OF_LIGHT.getSkill();
|
||||
final Skill skill = _castleSide == CastleSide.DARK ? CommonSkill.ABILITY_OF_DARKNESS.getSkill() : CommonSkill.ABILITY_OF_LIGHT.getSkill();
|
||||
player.addSkill(skill);
|
||||
}
|
||||
|
||||
|
@ -58,7 +58,7 @@ public final class ClanHall extends AbstractResidence
|
||||
private final ClanHallGrade _grade;
|
||||
private final ClanHallType _type;
|
||||
private final int _minBid;
|
||||
private final int _lease;
|
||||
final int _lease;
|
||||
private final int _deposit;
|
||||
private final List<Integer> _npcs;
|
||||
private final List<L2DoorInstance> _doors;
|
||||
@ -66,8 +66,8 @@ public final class ClanHall extends AbstractResidence
|
||||
private final Location _ownerLocation;
|
||||
private final Location _banishLocation;
|
||||
// Dynamic parameters
|
||||
private L2Clan _owner = null;
|
||||
private long _paidUntil = 0;
|
||||
L2Clan _owner = null;
|
||||
long _paidUntil = 0;
|
||||
protected ScheduledFuture<?> _checkPaymentTask = null;
|
||||
// Other
|
||||
private static final String INSERT_CLANHALL = "INSERT INTO clanhall (id, ownerId, paidUntil) VALUES (?,?,?)";
|
||||
@ -137,7 +137,7 @@ public final class ClanHall extends AbstractResidence
|
||||
PreparedStatement statement = con.prepareStatement(UPDATE_CLANHALL))
|
||||
{
|
||||
statement.setInt(1, getOwnerId());
|
||||
statement.setLong(2, getPaidUntil());
|
||||
statement.setLong(2, _paidUntil);
|
||||
statement.setInt(3, getResidenceId());
|
||||
statement.execute();
|
||||
}
|
||||
@ -159,7 +159,7 @@ public final class ClanHall extends AbstractResidence
|
||||
|
||||
public int getCostFailDay()
|
||||
{
|
||||
final Duration failDay = Duration.between(Instant.ofEpochMilli(getPaidUntil()), Instant.now());
|
||||
final Duration failDay = Duration.between(Instant.ofEpochMilli(_paidUntil), Instant.now());
|
||||
return failDay.isNegative() ? 0 : (int) failDay.toDays();
|
||||
}
|
||||
|
||||
@ -256,13 +256,13 @@ public final class ClanHall extends AbstractResidence
|
||||
_owner = clan;
|
||||
clan.setHideoutId(getResidenceId());
|
||||
clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
|
||||
if (getPaidUntil() == 0)
|
||||
if (_paidUntil == 0)
|
||||
{
|
||||
setPaidUntil(Instant.now().plus(Duration.ofDays(7)).toEpochMilli());
|
||||
}
|
||||
|
||||
final int failDays = getCostFailDay();
|
||||
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(getPaidUntil()).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : getPaidUntil();
|
||||
final long time = failDays > 0 ? (failDays > 8 ? Instant.now().toEpochMilli() : Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(failDays + 1)).toEpochMilli()) : _paidUntil;
|
||||
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), time - System.currentTimeMillis());
|
||||
}
|
||||
else
|
||||
@ -351,29 +351,28 @@ public final class ClanHall extends AbstractResidence
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final L2Clan clan = getOwner();
|
||||
if (clan != null)
|
||||
if (_owner != null)
|
||||
{
|
||||
if (clan.getWarehouse().getAdena() < getLease())
|
||||
if (_owner.getWarehouse().getAdena() < _lease)
|
||||
{
|
||||
if (getCostFailDay() > 8)
|
||||
{
|
||||
setOwner(null);
|
||||
clan.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.THE_CLAN_HALL_FEE_IS_ONE_WEEK_OVERDUE_THEREFORE_THE_CLAN_HALL_OWNERSHIP_HAS_BEEN_REVOKED));
|
||||
_owner.broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.THE_CLAN_HALL_FEE_IS_ONE_WEEK_OVERDUE_THEREFORE_THE_CLAN_HALL_OWNERSHIP_HAS_BEEN_REVOKED));
|
||||
}
|
||||
else
|
||||
{
|
||||
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), 24 * 60 * 60 * 1000); // 1 day
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.PAYMENT_FOR_YOUR_CLAN_HALL_HAS_NOT_BEEN_MADE_PLEASE_MAKE_PAYMENT_TO_YOUR_CLAN_WAREHOUSE_BY_S1_TOMORROW);
|
||||
sm.addInt(getLease());
|
||||
clan.broadcastToOnlineMembers(sm);
|
||||
sm.addInt(_lease);
|
||||
_owner.broadcastToOnlineMembers(sm);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
clan.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, getLease(), null, null);
|
||||
setPaidUntil(Instant.ofEpochMilli(getPaidUntil()).plus(Duration.ofDays(7)).toEpochMilli());
|
||||
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), getPaidUntil() - System.currentTimeMillis());
|
||||
_owner.getWarehouse().destroyItem("Clan Hall Lease", Inventory.ADENA_ID, _lease, null, null);
|
||||
setPaidUntil(Instant.ofEpochMilli(_paidUntil).plus(Duration.ofDays(7)).toEpochMilli());
|
||||
_checkPaymentTask = ThreadPool.schedule(new CheckPaymentTask(), _paidUntil - System.currentTimeMillis());
|
||||
updateDB();
|
||||
}
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ public class Duel
|
||||
private boolean _finished = false;
|
||||
|
||||
private final Map<Integer, PlayerCondition> _playerConditions = new ConcurrentHashMap<>();
|
||||
private Instance _duelInstance;
|
||||
Instance _duelInstance;
|
||||
|
||||
public Duel(L2PcInstance playerA, L2PcInstance playerB, int partyDuel, int duelId)
|
||||
{
|
||||
@ -213,9 +213,9 @@ public class Duel
|
||||
setFinished(true);
|
||||
playKneelAnimation();
|
||||
ThreadPool.schedule(new ScheduleEndDuelTask(_duel, _duel.checkEndDuelCondition()), 5000);
|
||||
if (getDueldInstance() != null)
|
||||
if (_duelInstance != null)
|
||||
{
|
||||
getDueldInstance().destroy();
|
||||
_duelInstance.destroy();
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -674,7 +674,7 @@ public class Duel
|
||||
*/
|
||||
public L2PcInstance getWinner()
|
||||
{
|
||||
if (!getFinished() || (_playerA == null) || (_playerB == null))
|
||||
if (!_finished || (_playerA == null) || (_playerB == null))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@ -695,7 +695,7 @@ public class Duel
|
||||
*/
|
||||
public L2PcInstance getLooser()
|
||||
{
|
||||
if (!getFinished() || (_playerA == null) || (_playerB == null))
|
||||
if (!_finished || (_playerA == null) || (_playerB == null))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
@ -71,7 +71,7 @@ public final class Fort extends AbstractResidence
|
||||
private Calendar _siegeDate;
|
||||
private Calendar _lastOwnedTime;
|
||||
private L2SiegeZone _zone;
|
||||
private L2Clan _fortOwner = null;
|
||||
L2Clan _fortOwner = null;
|
||||
private int _fortType = 0;
|
||||
private int _state = 0;
|
||||
private int _castleId = 0;
|
||||
@ -97,12 +97,12 @@ public final class Fort extends AbstractResidence
|
||||
|
||||
public class FortFunction
|
||||
{
|
||||
private final int _type;
|
||||
final int _type;
|
||||
private int _lvl;
|
||||
protected int _fee;
|
||||
protected int _tempFee;
|
||||
private final long _rate;
|
||||
private long _endDate;
|
||||
final long _rate;
|
||||
long _endDate;
|
||||
protected boolean _inDebt;
|
||||
public boolean _cwh;
|
||||
|
||||
@ -159,7 +159,7 @@ public final class Fort extends AbstractResidence
|
||||
|
||||
private void initializeTask(boolean cwh)
|
||||
{
|
||||
if (getOwnerClan() == null)
|
||||
if (_fortOwner == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -186,24 +186,24 @@ public final class Fort extends AbstractResidence
|
||||
{
|
||||
try
|
||||
{
|
||||
if (getOwnerClan() == null)
|
||||
if (_fortOwner == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if ((getOwnerClan().getWarehouse().getAdena() >= _fee) || !_cwh)
|
||||
if ((_fortOwner.getWarehouse().getAdena() >= _fee) || !_cwh)
|
||||
{
|
||||
final int fee = getEndTime() == -1 ? _tempFee : _fee;
|
||||
setEndTime(System.currentTimeMillis() + getRate());
|
||||
final int fee = _endDate == -1 ? _tempFee : _fee;
|
||||
setEndTime(System.currentTimeMillis() + _rate);
|
||||
dbSave();
|
||||
if (_cwh)
|
||||
{
|
||||
getOwnerClan().getWarehouse().destroyItemByItemId("CS_function_fee", Inventory.ADENA_ID, fee, null, null);
|
||||
_fortOwner.getWarehouse().destroyItemByItemId("CS_function_fee", Inventory.ADENA_ID, fee, null, null);
|
||||
}
|
||||
ThreadPool.schedule(new FunctionTask(true), getRate());
|
||||
ThreadPool.schedule(new FunctionTask(true), _rate);
|
||||
}
|
||||
else
|
||||
{
|
||||
removeFunction(getType());
|
||||
removeFunction(_type);
|
||||
}
|
||||
}
|
||||
catch (Throwable t)
|
||||
@ -218,11 +218,11 @@ public final class Fort extends AbstractResidence
|
||||
PreparedStatement ps = con.prepareStatement("REPLACE INTO fort_functions (fort_id, type, lvl, lease, rate, endTime) VALUES (?,?,?,?,?,?)"))
|
||||
{
|
||||
ps.setInt(1, getResidenceId());
|
||||
ps.setInt(2, getType());
|
||||
ps.setInt(3, getLvl());
|
||||
ps.setInt(4, getLease());
|
||||
ps.setLong(5, getRate());
|
||||
ps.setLong(6, getEndTime());
|
||||
ps.setInt(2, _type);
|
||||
ps.setInt(3, _lvl);
|
||||
ps.setInt(4, _fee);
|
||||
ps.setLong(5, _rate);
|
||||
ps.setLong(6, _endDate);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -237,7 +237,7 @@ public final class Fort extends AbstractResidence
|
||||
super(fortId);
|
||||
load();
|
||||
loadFlagPoles();
|
||||
if (getOwnerClan() != null)
|
||||
if (_fortOwner != null)
|
||||
{
|
||||
setVisibleFlag(true);
|
||||
loadFunctions();
|
||||
@ -250,7 +250,7 @@ public final class Fort extends AbstractResidence
|
||||
initNpcCommanders(); // npc Commanders (not monsters) (Spawned during siege)
|
||||
spawnNpcCommanders(); // spawn npc Commanders
|
||||
initSpecialEnvoys(); // envoys from castles (Spawned after fort taken)
|
||||
if ((getOwnerClan() != null) && (getFortState() == 0))
|
||||
if ((_fortOwner != null) && (_state == 0))
|
||||
{
|
||||
spawnSpecialEnvoys();
|
||||
}
|
||||
@ -277,7 +277,7 @@ public final class Fort extends AbstractResidence
|
||||
*/
|
||||
public void banishForeigners()
|
||||
{
|
||||
getResidenceZone().banishForeigners(getOwnerClan().getId());
|
||||
getResidenceZone().banishForeigners(_fortOwner.getId());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -335,7 +335,7 @@ public final class Fort extends AbstractResidence
|
||||
|
||||
public void openCloseDoor(L2PcInstance activeChar, int doorId, boolean open)
|
||||
{
|
||||
if (activeChar.getClan() != getOwnerClan())
|
||||
if (activeChar.getClan() != _fortOwner)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -378,7 +378,7 @@ public final class Fort extends AbstractResidence
|
||||
sm.addCastleId(getResidenceId());
|
||||
getSiege().announceToPlayer(sm);
|
||||
|
||||
final L2Clan oldowner = getOwnerClan();
|
||||
final L2Clan oldowner = _fortOwner;
|
||||
if ((oldowner != null) && (clan != oldowner))
|
||||
{
|
||||
// Remove points from old owner
|
||||
@ -442,7 +442,7 @@ public final class Fort extends AbstractResidence
|
||||
|
||||
public void removeOwner(boolean updateDB)
|
||||
{
|
||||
final L2Clan clan = getOwnerClan();
|
||||
final L2Clan clan = _fortOwner;
|
||||
if (clan != null)
|
||||
{
|
||||
for (L2PcInstance member : clan.getOnlineMembers(0))
|
||||
@ -506,7 +506,7 @@ public final class Fort extends AbstractResidence
|
||||
*/
|
||||
public void setVisibleFlag(boolean val)
|
||||
{
|
||||
final L2StaticObjectInstance flagPole = getFlagPole();
|
||||
final L2StaticObjectInstance flagPole = _flagPole;
|
||||
if (flagPole != null)
|
||||
{
|
||||
flagPole.setMeshIndex(val ? 1 : 0);
|
||||
@ -781,7 +781,7 @@ public final class Fort extends AbstractResidence
|
||||
|
||||
private void updateOwnerInDB()
|
||||
{
|
||||
final L2Clan clan = getOwnerClan();
|
||||
final L2Clan clan = _fortOwner;
|
||||
int clanId = 0;
|
||||
if (clan != null)
|
||||
{
|
||||
@ -873,7 +873,7 @@ public final class Fort extends AbstractResidence
|
||||
return null;
|
||||
}
|
||||
|
||||
for (L2DoorInstance door : getDoors())
|
||||
for (L2DoorInstance door : _doors)
|
||||
{
|
||||
if (door.getId() == doorId)
|
||||
{
|
||||
@ -1001,8 +1001,8 @@ public final class Fort extends AbstractResidence
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE fort SET state=?,castleId=? WHERE id = ?"))
|
||||
{
|
||||
ps.setInt(1, getFortState());
|
||||
ps.setInt(2, getContractedCastleId());
|
||||
ps.setInt(1, _state);
|
||||
ps.setInt(2, _castleId);
|
||||
ps.setInt(3, getResidenceId());
|
||||
ps.execute();
|
||||
}
|
||||
@ -1068,7 +1068,7 @@ public final class Fort extends AbstractResidence
|
||||
*/
|
||||
public final int getFortSize()
|
||||
{
|
||||
return getFortType() == 0 ? 3 : 5;
|
||||
return _fortType == 0 ? 3 : 5;
|
||||
}
|
||||
|
||||
public void spawnSuspiciousMerchant()
|
||||
|
@ -70,7 +70,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (!isInProgress())
|
||||
if (!_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -101,7 +101,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -115,7 +115,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
else if (_time == 600) // 10min remains
|
||||
{
|
||||
getFort().despawnSuspiciousMerchant();
|
||||
_fort.despawnSuspiciousMerchant();
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.S1_MINUTE_S_UNTIL_THE_FORTRESS_BATTLE_STARTS);
|
||||
sm.addInt(10);
|
||||
announceToPlayer(sm);
|
||||
@ -184,7 +184,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -205,7 +205,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (!isInProgress())
|
||||
if (!_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -228,7 +228,7 @@ public class FortSiege implements Siegable
|
||||
// Fort setting
|
||||
protected Set<L2Spawn> _commanders = ConcurrentHashMap.newKeySet();
|
||||
protected final Fort _fort;
|
||||
private boolean _isInProgress = false;
|
||||
boolean _isInProgress = false;
|
||||
private final Collection<L2Spawn> _siegeGuards = new LinkedList<>();
|
||||
ScheduledFuture<?> _siegeEnd = null;
|
||||
ScheduledFuture<?> _siegeRestore = null;
|
||||
@ -248,7 +248,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void endSiege()
|
||||
{
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
_isInProgress = false; // Flag so that siege instance can be started
|
||||
removeFlags(); // Removes all flags. Note: Remove flag before teleporting players
|
||||
@ -257,22 +257,22 @@ public class FortSiege implements Siegable
|
||||
updatePlayerSiegeStateFlags(true);
|
||||
|
||||
int ownerId = -1;
|
||||
if (getFort().getOwnerClan() != null)
|
||||
if (_fort.getOwnerClan() != null)
|
||||
{
|
||||
ownerId = getFort().getOwnerClan().getId();
|
||||
ownerId = _fort.getOwnerClan().getId();
|
||||
}
|
||||
getFort().getZone().banishForeigners(ownerId);
|
||||
getFort().getZone().setIsActive(false);
|
||||
getFort().getZone().updateZoneStatusForCharactersInside();
|
||||
getFort().getZone().setSiegeInstance(null);
|
||||
_fort.getZone().banishForeigners(ownerId);
|
||||
_fort.getZone().setIsActive(false);
|
||||
_fort.getZone().updateZoneStatusForCharactersInside();
|
||||
_fort.getZone().setSiegeInstance(null);
|
||||
|
||||
saveFortSiege(); // Save fort specific data
|
||||
clearSiegeClan(); // Clear siege clan from db
|
||||
removeCommanders(); // Remove commander from this fort
|
||||
|
||||
getFort().spawnNpcCommanders(); // Spawn NPC commanders
|
||||
_fort.spawnNpcCommanders(); // Spawn NPC commanders
|
||||
unspawnSiegeGuard(); // Remove all spawned siege guard from this fort
|
||||
getFort().resetDoors(); // Respawn door to fort
|
||||
_fort.resetDoors(); // Respawn door to fort
|
||||
|
||||
ThreadPool.schedule(new ScheduleSuspiciousMerchantSpawn(), FortSiegeManager.getInstance().getSuspiciousMerchantRespawnDelay() * 60 * 1000); // Prepare 3hr task for suspicious merchant respawn
|
||||
setSiegeDateTime(true); // store suspicious merchant spawn in DB
|
||||
@ -288,12 +288,12 @@ public class FortSiege implements Siegable
|
||||
_siegeRestore = null;
|
||||
}
|
||||
|
||||
if ((getFort().getOwnerClan() != null) && (getFort().getFlagPole().getMeshIndex() == 0))
|
||||
if ((_fort.getOwnerClan() != null) && (_fort.getFlagPole().getMeshIndex() == 0))
|
||||
{
|
||||
getFort().setVisibleFlag(true);
|
||||
_fort.setVisibleFlag(true);
|
||||
}
|
||||
|
||||
LOGGER.info(getClass().getSimpleName() + ": Siege of " + getFort().getName() + " fort finished.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Siege of " + _fort.getName() + " fort finished.");
|
||||
|
||||
// Notify to scripts.
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnFortSiegeFinish(this), getFort());
|
||||
@ -306,16 +306,16 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void startSiege()
|
||||
{
|
||||
if (!isInProgress())
|
||||
if (!_isInProgress)
|
||||
{
|
||||
if (_siegeStartTask != null) // used admin command "admin_startfortsiege"
|
||||
{
|
||||
_siegeStartTask.cancel(true);
|
||||
getFort().despawnSuspiciousMerchant();
|
||||
_fort.despawnSuspiciousMerchant();
|
||||
}
|
||||
_siegeStartTask = null;
|
||||
|
||||
if (getAttackerClans().isEmpty())
|
||||
if (_attackerClans.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -326,24 +326,24 @@ public class FortSiege implements Siegable
|
||||
updatePlayerSiegeStateFlags(false);
|
||||
teleportPlayer(FortTeleportWhoType.Attacker, TeleportWhereType.TOWN); // Teleport to the closest town
|
||||
|
||||
getFort().despawnNpcCommanders(); // Despawn NPC commanders
|
||||
_fort.despawnNpcCommanders(); // Despawn NPC commanders
|
||||
spawnCommanders(); // Spawn commanders
|
||||
getFort().resetDoors(); // Spawn door
|
||||
_fort.resetDoors(); // Spawn door
|
||||
spawnSiegeGuard(); // Spawn siege guard
|
||||
getFort().setVisibleFlag(false);
|
||||
getFort().getZone().setSiegeInstance(this);
|
||||
getFort().getZone().setIsActive(true);
|
||||
getFort().getZone().updateZoneStatusForCharactersInside();
|
||||
_fort.setVisibleFlag(false);
|
||||
_fort.getZone().setSiegeInstance(this);
|
||||
_fort.getZone().setIsActive(true);
|
||||
_fort.getZone().updateZoneStatusForCharactersInside();
|
||||
|
||||
// Schedule a task to prepare auto siege end
|
||||
_siegeEnd = ThreadPool.schedule(new ScheduleEndSiegeTask(), FortSiegeManager.getInstance().getSiegeLength() * 60 * 1000); // Prepare auto end task
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_FORTRESS_BATTLE_S1_HAS_BEGUN);
|
||||
sm.addCastleId(getFort().getResidenceId());
|
||||
sm.addCastleId(_fort.getResidenceId());
|
||||
announceToPlayer(sm);
|
||||
saveFortSiege();
|
||||
|
||||
LOGGER.info(getClass().getSimpleName() + ": Siege of " + getFort().getName() + " fort started.");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Siege of " + _fort.getName() + " fort started.");
|
||||
|
||||
// Notify to scripts.
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnFortSiegeStart(this), getFort());
|
||||
@ -358,7 +358,7 @@ public class FortSiege implements Siegable
|
||||
{
|
||||
// announce messages only for participants
|
||||
L2Clan clan;
|
||||
for (L2SiegeClan siegeclan : getAttackerClans())
|
||||
for (L2SiegeClan siegeclan : _attackerClans)
|
||||
{
|
||||
clan = ClanTable.getInstance().getClan(siegeclan.getClanId());
|
||||
for (L2PcInstance member : clan.getOnlineMembers(0))
|
||||
@ -369,7 +369,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
}
|
||||
}
|
||||
if (getFort().getOwnerClan() != null)
|
||||
if (_fort.getOwnerClan() != null)
|
||||
{
|
||||
clan = ClanTable.getInstance().getClan(getFort().getOwnerClan().getId());
|
||||
for (L2PcInstance member : clan.getOnlineMembers(0))
|
||||
@ -391,7 +391,7 @@ public class FortSiege implements Siegable
|
||||
public void updatePlayerSiegeStateFlags(boolean clear)
|
||||
{
|
||||
L2Clan clan;
|
||||
for (L2SiegeClan siegeclan : getAttackerClans())
|
||||
for (L2SiegeClan siegeclan : _attackerClans)
|
||||
{
|
||||
clan = ClanTable.getInstance().getClan(siegeclan.getClanId());
|
||||
for (L2PcInstance member : clan.getOnlineMembers(0))
|
||||
@ -411,7 +411,7 @@ public class FortSiege implements Siegable
|
||||
else
|
||||
{
|
||||
member.setSiegeState((byte) 1);
|
||||
member.setSiegeSide(getFort().getResidenceId());
|
||||
member.setSiegeSide(_fort.getResidenceId());
|
||||
if (checkIfInZone(member))
|
||||
{
|
||||
member.setIsInSiege(true);
|
||||
@ -421,7 +421,7 @@ public class FortSiege implements Siegable
|
||||
member.broadcastUserInfo();
|
||||
}
|
||||
}
|
||||
if (getFort().getOwnerClan() != null)
|
||||
if (_fort.getOwnerClan() != null)
|
||||
{
|
||||
clan = ClanTable.getInstance().getClan(getFort().getOwnerClan().getId());
|
||||
for (L2PcInstance member : clan.getOnlineMembers(0))
|
||||
@ -441,7 +441,7 @@ public class FortSiege implements Siegable
|
||||
else
|
||||
{
|
||||
member.setSiegeState((byte) 2);
|
||||
member.setSiegeSide(getFort().getResidenceId());
|
||||
member.setSiegeSide(_fort.getResidenceId());
|
||||
if (checkIfInZone(member))
|
||||
{
|
||||
member.setIsInSiege(true);
|
||||
@ -470,7 +470,7 @@ public class FortSiege implements Siegable
|
||||
*/
|
||||
public boolean checkIfInZone(int x, int y, int z)
|
||||
{
|
||||
return (isInProgress() && (getFort().checkIfInZone(x, y, z))); // Fort zone during siege
|
||||
return (_isInProgress && (_fort.checkIfInZone(x, y, z))); // Fort zone during siege
|
||||
}
|
||||
|
||||
/**
|
||||
@ -490,7 +490,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public boolean checkIsDefender(L2Clan clan)
|
||||
{
|
||||
if ((clan != null) && (getFort().getOwnerClan() == clan))
|
||||
if ((clan != null) && (_fort.getOwnerClan() == clan))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -504,22 +504,22 @@ public class FortSiege implements Siegable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM fortsiege_clans WHERE fort_id=?"))
|
||||
{
|
||||
ps.setInt(1, getFort().getResidenceId());
|
||||
ps.setInt(1, _fort.getResidenceId());
|
||||
ps.execute();
|
||||
|
||||
if (getFort().getOwnerClan() != null)
|
||||
if (_fort.getOwnerClan() != null)
|
||||
{
|
||||
try (PreparedStatement delete = con.prepareStatement("DELETE FROM fortsiege_clans WHERE clan_id=?"))
|
||||
{
|
||||
delete.setInt(1, getFort().getOwnerClan().getId());
|
||||
delete.setInt(1, _fort.getOwnerClan().getId());
|
||||
delete.execute();
|
||||
}
|
||||
}
|
||||
|
||||
getAttackerClans().clear();
|
||||
_attackerClans.clear();
|
||||
|
||||
// if siege is in progress, end siege
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
endSiege();
|
||||
}
|
||||
@ -540,7 +540,7 @@ public class FortSiege implements Siegable
|
||||
/** Set the date for the next siege. */
|
||||
private void clearSiegeDate()
|
||||
{
|
||||
getFort().getSiegeDate().setTimeInMillis(0);
|
||||
_fort.getSiegeDate().setTimeInMillis(0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -550,7 +550,7 @@ public class FortSiege implements Siegable
|
||||
public List<L2PcInstance> getAttackersInZone()
|
||||
{
|
||||
final List<L2PcInstance> players = new LinkedList<>();
|
||||
for (L2SiegeClan siegeclan : getAttackerClans())
|
||||
for (L2SiegeClan siegeclan : _attackerClans)
|
||||
{
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(siegeclan.getClanId());
|
||||
for (L2PcInstance player : clan.getOnlineMembers(0))
|
||||
@ -574,7 +574,7 @@ public class FortSiege implements Siegable
|
||||
*/
|
||||
public List<L2PcInstance> getPlayersInZone()
|
||||
{
|
||||
return getFort().getZone().getPlayersInside();
|
||||
return _fort.getZone().getPlayersInside();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -583,10 +583,10 @@ public class FortSiege implements Siegable
|
||||
public List<L2PcInstance> getOwnersInZone()
|
||||
{
|
||||
final List<L2PcInstance> players = new LinkedList<>();
|
||||
if (getFort().getOwnerClan() != null)
|
||||
if (_fort.getOwnerClan() != null)
|
||||
{
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(getFort().getOwnerClan().getId());
|
||||
if (clan != getFort().getOwnerClan())
|
||||
if (clan != _fort.getOwnerClan())
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@ -614,7 +614,7 @@ public class FortSiege implements Siegable
|
||||
*/
|
||||
public void killedCommander(L2FortCommanderInstance instance)
|
||||
{
|
||||
if ((getFort() != null) && (!_commanders.isEmpty()))
|
||||
if ((_fort != null) && (!_commanders.isEmpty()))
|
||||
{
|
||||
final L2Spawn spawn = instance.getSpawn();
|
||||
if (spawn != null)
|
||||
@ -657,14 +657,14 @@ public class FortSiege implements Siegable
|
||||
if (_commanders.isEmpty())
|
||||
{
|
||||
// spawn fort flags
|
||||
spawnFlag(getFort().getResidenceId());
|
||||
spawnFlag(_fort.getResidenceId());
|
||||
// cancel door/commanders respawn
|
||||
if (_siegeRestore != null)
|
||||
{
|
||||
_siegeRestore.cancel(true);
|
||||
}
|
||||
// open doors in main building
|
||||
for (L2DoorInstance door : getFort().getDoors())
|
||||
for (L2DoorInstance door : _fort.getDoors())
|
||||
{
|
||||
if (door.getIsShowHp())
|
||||
{
|
||||
@ -674,22 +674,22 @@ public class FortSiege implements Siegable
|
||||
// TODO this also opens control room door at big fort
|
||||
door.openMe();
|
||||
}
|
||||
getFort().getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.ALL_BARRACKS_ARE_OCCUPIED));
|
||||
_fort.getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.ALL_BARRACKS_ARE_OCCUPIED));
|
||||
}
|
||||
// schedule restoring doors/commanders respawn
|
||||
else if (_siegeRestore == null)
|
||||
{
|
||||
getFort().getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.THE_BARRACKS_HAVE_BEEN_SEIZED));
|
||||
_fort.getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.THE_BARRACKS_HAVE_BEEN_SEIZED));
|
||||
_siegeRestore = ThreadPool.schedule(new ScheduleSiegeRestore(), FortSiegeManager.getInstance().getCountDownLength() * 60 * 1000);
|
||||
}
|
||||
else
|
||||
{
|
||||
getFort().getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.THE_BARRACKS_HAVE_BEEN_SEIZED));
|
||||
_fort.getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.THE_BARRACKS_HAVE_BEEN_SEIZED));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning(getClass().getSimpleName() + ": FortSiege.killedCommander(): killed commander, but commander not registered for fortress. NpcId: " + instance.getId() + " FortId: " + getFort().getResidenceId());
|
||||
LOGGER.warning(getClass().getSimpleName() + ": FortSiege.killedCommander(): killed commander, but commander not registered for fortress. NpcId: " + instance.getId() + " FortId: " + _fort.getResidenceId());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -705,7 +705,7 @@ public class FortSiege implements Siegable
|
||||
return;
|
||||
}
|
||||
|
||||
for (L2SiegeClan clan : getAttackerClans())
|
||||
for (L2SiegeClan clan : _attackerClans)
|
||||
{
|
||||
if (clan.removeFlag(flag))
|
||||
{
|
||||
@ -734,7 +734,7 @@ public class FortSiege implements Siegable
|
||||
|
||||
if (checkConditions)
|
||||
{
|
||||
if (getFort().getSiege().getAttackerClans().isEmpty() && (player.getInventory().getAdena() < 250000))
|
||||
if (_fort.getSiege().getAttackerClans().isEmpty() && (player.getInventory().getAdena() < 250000))
|
||||
{
|
||||
return 1; // Player don't have enough adena to register
|
||||
}
|
||||
@ -754,7 +754,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
|
||||
saveSiegeClan(player.getClan());
|
||||
if (getAttackerClans().size() == 1)
|
||||
if (_attackerClans.size() == 1)
|
||||
{
|
||||
if (checkConditions)
|
||||
{
|
||||
@ -788,7 +788,7 @@ public class FortSiege implements Siegable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement(query))
|
||||
{
|
||||
statement.setInt(1, getFort().getResidenceId());
|
||||
statement.setInt(1, _fort.getResidenceId());
|
||||
if (clanId != 0)
|
||||
{
|
||||
statement.setInt(2, clanId);
|
||||
@ -796,9 +796,9 @@ public class FortSiege implements Siegable
|
||||
statement.execute();
|
||||
|
||||
loadSiegeClan();
|
||||
if (getAttackerClans().isEmpty())
|
||||
if (_attackerClans.isEmpty())
|
||||
{
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
endSiege();
|
||||
}
|
||||
@ -843,7 +843,7 @@ public class FortSiege implements Siegable
|
||||
else
|
||||
{
|
||||
loadSiegeClan();
|
||||
if (getAttackerClans().isEmpty())
|
||||
if (_attackerClans.isEmpty())
|
||||
{
|
||||
// no attackers - waiting for suspicious merchant spawn
|
||||
ThreadPool.schedule(new ScheduleSuspiciousMerchantSpawn(), delay);
|
||||
@ -875,7 +875,7 @@ public class FortSiege implements Siegable
|
||||
_siegeStartTask = ThreadPool.schedule(new ScheduleStartSiegeTask(60), 0);
|
||||
}
|
||||
|
||||
LOGGER.info(getClass().getSimpleName() + ": Siege of " + getFort().getName() + " fort: " + getFort().getSiegeDate().getTime());
|
||||
LOGGER.info(getClass().getSimpleName() + ": Siege of " + _fort.getName() + " fort: " + _fort.getSiegeDate().getTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -896,9 +896,9 @@ public class FortSiege implements Siegable
|
||||
setSiegeDateTime(false);
|
||||
}
|
||||
|
||||
if (getFort().getOwnerClan() != null)
|
||||
if (_fort.getOwnerClan() != null)
|
||||
{
|
||||
getFort().getOwnerClan().broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.A_FORTRESS_IS_UNDER_ATTACK));
|
||||
_fort.getOwnerClan().broadcastToOnlineMembers(SystemMessage.getSystemMessage(SystemMessageId.A_FORTRESS_IS_UNDER_ATTACK));
|
||||
}
|
||||
|
||||
// Execute siege auto start
|
||||
@ -927,7 +927,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
default:
|
||||
{
|
||||
players = getPlayersInZone();
|
||||
players = _fort.getZone().getPlayersInside();
|
||||
}
|
||||
}
|
||||
|
||||
@ -948,7 +948,7 @@ public class FortSiege implements Siegable
|
||||
*/
|
||||
private void addAttacker(int clanId)
|
||||
{
|
||||
getAttackerClans().add(new L2SiegeClan(clanId, SiegeClanType.ATTACKER)); // Add registered attacker to attacker list
|
||||
_attackerClans.add(new L2SiegeClan(clanId, SiegeClanType.ATTACKER)); // Add registered attacker to attacker list
|
||||
}
|
||||
|
||||
/**
|
||||
@ -991,18 +991,18 @@ public class FortSiege implements Siegable
|
||||
{
|
||||
newDate.add(Calendar.MINUTE, 60);
|
||||
}
|
||||
getFort().setSiegeDate(newDate);
|
||||
_fort.setSiegeDate(newDate);
|
||||
saveSiegeDate();
|
||||
}
|
||||
|
||||
/** Load siege clans. */
|
||||
private void loadSiegeClan()
|
||||
{
|
||||
getAttackerClans().clear();
|
||||
_attackerClans.clear();
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT clan_id FROM fortsiege_clans WHERE fort_id=?"))
|
||||
{
|
||||
ps.setInt(1, getFort().getResidenceId());
|
||||
ps.setInt(1, _fort.getResidenceId());
|
||||
try (ResultSet rs = ps.executeQuery())
|
||||
{
|
||||
while (rs.next())
|
||||
@ -1038,7 +1038,7 @@ public class FortSiege implements Siegable
|
||||
/** Remove all flags. */
|
||||
private void removeFlags()
|
||||
{
|
||||
for (L2SiegeClan sc : getAttackerClans())
|
||||
for (L2SiegeClan sc : _attackerClans)
|
||||
{
|
||||
if (sc != null)
|
||||
{
|
||||
@ -1060,8 +1060,8 @@ public class FortSiege implements Siegable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE fort SET siegeDate = ? WHERE id = ?"))
|
||||
{
|
||||
ps.setLong(1, getSiegeDate().getTimeInMillis());
|
||||
ps.setInt(2, getFort().getResidenceId());
|
||||
ps.setLong(1, _fort.getSiegeDate().getTimeInMillis());
|
||||
ps.setInt(2, _fort.getResidenceId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -1085,7 +1085,7 @@ public class FortSiege implements Siegable
|
||||
PreparedStatement statement = con.prepareStatement("INSERT INTO fortsiege_clans (clan_id,fort_id) values (?,?)"))
|
||||
{
|
||||
statement.setInt(1, clan.getId());
|
||||
statement.setInt(2, getFort().getResidenceId());
|
||||
statement.setInt(2, _fort.getResidenceId());
|
||||
statement.execute();
|
||||
|
||||
addAttacker(clan.getId());
|
||||
@ -1151,7 +1151,7 @@ public class FortSiege implements Siegable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT npcId, x, y, z, heading, respawnDelay FROM fort_siege_guards WHERE fortId = ?"))
|
||||
{
|
||||
final int fortId = getFort().getResidenceId();
|
||||
final int fortId = _fort.getResidenceId();
|
||||
ps.setInt(1, fortId);
|
||||
try (ResultSet rs = ps.executeQuery())
|
||||
{
|
||||
@ -1172,7 +1172,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error loading siege guard for fort " + getFort().getName() + ": " + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error loading siege guard for fort " + _fort.getName() + ": " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1198,7 +1198,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error spawning siege guards for fort " + getFort().getName() + ":" + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error spawning siege guards for fort " + _fort.getName() + ":" + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1217,7 +1217,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error unspawning siege guards for fort " + getFort().getName() + ":" + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error unspawning siege guards for fort " + _fort.getName() + ":" + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1235,7 +1235,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public final L2SiegeClan getAttackerClan(int clanId)
|
||||
{
|
||||
for (L2SiegeClan sc : getAttackerClans())
|
||||
for (L2SiegeClan sc : _attackerClans)
|
||||
{
|
||||
if ((sc != null) && (sc.getClanId() == clanId))
|
||||
{
|
||||
@ -1265,7 +1265,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public final Calendar getSiegeDate()
|
||||
{
|
||||
return getFort().getSiegeDate();
|
||||
return _fort.getSiegeDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -1288,7 +1288,7 @@ public class FortSiege implements Siegable
|
||||
// reload commanders and repair doors
|
||||
removeCommanders();
|
||||
spawnCommanders();
|
||||
getFort().resetDoors();
|
||||
_fort.resetDoors();
|
||||
}
|
||||
|
||||
public Set<L2Spawn> getCommanders()
|
||||
|
@ -92,7 +92,7 @@ public class Siege implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (!isInProgress())
|
||||
if (!_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -160,14 +160,14 @@ public class Siege implements Siegable
|
||||
public void run()
|
||||
{
|
||||
_scheduledStartSiegeTask.cancel(false);
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (!getIsTimeRegistrationOver())
|
||||
if (!_castle.getIsTimeRegistrationOver())
|
||||
{
|
||||
final long regTimeRemaining = getTimeRegistrationOverDate().getTimeInMillis() - Calendar.getInstance().getTimeInMillis();
|
||||
if (regTimeRemaining > 0)
|
||||
@ -186,7 +186,7 @@ public class Siege implements Siegable
|
||||
else if ((timeRemaining <= 86400000) && (timeRemaining > 13600000))
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_REGISTRATION_TERM_FOR_S1_HAS_ENDED);
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
sm.addCastleId(_castle.getResidenceId());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
_isRegistrationOver = true;
|
||||
clearSiegeWaitingClan();
|
||||
@ -228,8 +228,8 @@ public class Siege implements Siegable
|
||||
// Castle setting
|
||||
private final List<L2ControlTowerInstance> _controlTowers = new ArrayList<>();
|
||||
private final List<L2FlameTowerInstance> _flameTowers = new ArrayList<>();
|
||||
private final Castle _castle;
|
||||
private boolean _isInProgress = false;
|
||||
final Castle _castle;
|
||||
boolean _isInProgress = false;
|
||||
private boolean _isNormalSide = true; // true = Atk is Atk, false = Atk is Def
|
||||
protected boolean _isRegistrationOver = false;
|
||||
protected Calendar _siegeEndDate;
|
||||
@ -246,18 +246,18 @@ public class Siege implements Siegable
|
||||
@Override
|
||||
public void endSiege()
|
||||
{
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_S1_SIEGE_HAS_FINISHED);
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
sm.addCastleId(_castle.getResidenceId());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
|
||||
if (getCastle().getOwnerId() > 0)
|
||||
if (_castle.getOwnerId() > 0)
|
||||
{
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(getCastle().getOwnerId());
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.CLAN_S1_IS_VICTORIOUS_OVER_S2_S_CASTLE_SIEGE);
|
||||
sm.addString(clan.getName());
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
sm.addCastleId(_castle.getResidenceId());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
|
||||
if (clan.getId() == _firstOwnerClanId)
|
||||
@ -267,7 +267,7 @@ public class Siege implements Siegable
|
||||
}
|
||||
else
|
||||
{
|
||||
getCastle().setTicketBuyCount(0);
|
||||
_castle.setTicketBuyCount(0);
|
||||
for (L2ClanMember member : clan.getMembers())
|
||||
{
|
||||
if (member != null)
|
||||
@ -284,7 +284,7 @@ public class Siege implements Siegable
|
||||
else
|
||||
{
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_SIEGE_OF_S1_HAS_ENDED_IN_A_DRAW);
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
sm.addCastleId(_castle.getResidenceId());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
}
|
||||
|
||||
@ -322,7 +322,7 @@ public class Siege implements Siegable
|
||||
clan.clearSiegeDeaths();
|
||||
}
|
||||
|
||||
getCastle().updateClansReputation();
|
||||
_castle.updateClansReputation();
|
||||
removeFlags(); // Removes all flags. Note: Remove flag before teleporting players
|
||||
teleportPlayer(SiegeTeleportWhoType.NotOwner, TeleportWhereType.TOWN); // Teleport to the second closest town
|
||||
_isInProgress = false; // Flag so that siege instance can be started
|
||||
@ -331,14 +331,14 @@ public class Siege implements Siegable
|
||||
clearSiegeClan(); // Clear siege clan from db
|
||||
removeTowers(); // Remove all towers from this castle
|
||||
SiegeGuardManager.getInstance().unspawnSiegeGuard(getCastle()); // Remove all spawned siege guard from this castle
|
||||
if (getCastle().getOwnerId() > 0)
|
||||
if (_castle.getOwnerId() > 0)
|
||||
{
|
||||
SiegeGuardManager.getInstance().removeSiegeGuards(getCastle());
|
||||
}
|
||||
getCastle().spawnDoor(); // Respawn door to castle
|
||||
getCastle().getZone().setIsActive(false);
|
||||
getCastle().getZone().updateZoneStatusForCharactersInside();
|
||||
getCastle().getZone().setSiegeInstance(null);
|
||||
_castle.spawnDoor(); // Respawn door to castle
|
||||
_castle.getZone().setIsActive(false);
|
||||
_castle.getZone().updateZoneStatusForCharactersInside();
|
||||
_castle.getZone().setSiegeInstance(null);
|
||||
|
||||
// Notify to scripts.
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnCastleSiegeFinish(this), getCastle());
|
||||
@ -387,9 +387,9 @@ public class Siege implements Siegable
|
||||
*/
|
||||
public void midVictory()
|
||||
{
|
||||
if (isInProgress()) // Siege still in progress
|
||||
if (_isInProgress) // Siege still in progress
|
||||
{
|
||||
if (getCastle().getOwnerId() > 0)
|
||||
if (_castle.getOwnerId() > 0)
|
||||
{
|
||||
SiegeGuardManager.getInstance().removeSiegeGuards(getCastle()); // Remove all merc entry from db
|
||||
}
|
||||
@ -398,13 +398,13 @@ public class Siege implements Siegable
|
||||
(getAttackerClans().size() == 1 // Only 1 attacker
|
||||
))
|
||||
{
|
||||
final L2SiegeClan sc_newowner = getAttackerClan(getCastle().getOwnerId());
|
||||
final L2SiegeClan sc_newowner = getAttackerClan(_castle.getOwnerId());
|
||||
removeAttacker(sc_newowner);
|
||||
addDefender(sc_newowner, SiegeClanType.OWNER);
|
||||
endSiege();
|
||||
return;
|
||||
}
|
||||
if (getCastle().getOwnerId() > 0)
|
||||
if (_castle.getOwnerId() > 0)
|
||||
{
|
||||
final int allyId = ClanTable.getInstance().getClan(getCastle().getOwnerId()).getAllyId();
|
||||
if (getDefenderClans().isEmpty()) // If defender doesn't exist (Pc vs Npc)
|
||||
@ -426,7 +426,7 @@ public class Siege implements Siegable
|
||||
}
|
||||
if (allinsamealliance)
|
||||
{
|
||||
final L2SiegeClan sc_newowner = getAttackerClan(getCastle().getOwnerId());
|
||||
final L2SiegeClan sc_newowner = getAttackerClan(_castle.getOwnerId());
|
||||
removeAttacker(sc_newowner);
|
||||
addDefender(sc_newowner, SiegeClanType.OWNER);
|
||||
endSiege();
|
||||
@ -444,7 +444,7 @@ public class Siege implements Siegable
|
||||
}
|
||||
}
|
||||
|
||||
final L2SiegeClan sc_newowner = getAttackerClan(getCastle().getOwnerId());
|
||||
final L2SiegeClan sc_newowner = getAttackerClan(_castle.getOwnerId());
|
||||
removeAttacker(sc_newowner);
|
||||
addDefender(sc_newowner, SiegeClanType.OWNER);
|
||||
|
||||
@ -462,8 +462,8 @@ public class Siege implements Siegable
|
||||
teleportPlayer(SiegeTeleportWhoType.Spectator, TeleportWhereType.TOWN); // Teleport to the second closest town
|
||||
|
||||
removeDefenderFlags(); // Removes defenders' flags
|
||||
getCastle().removeUpgrade(); // Remove all castle upgrade
|
||||
getCastle().spawnDoor(true); // Respawn door to castle but make them weaker (50% hp)
|
||||
_castle.removeUpgrade(); // Remove all castle upgrade
|
||||
_castle.spawnDoor(true); // Respawn door to castle but make them weaker (50% hp)
|
||||
removeTowers(); // Remove all towers from this castle
|
||||
_controlTowerCount = 0; // Each new siege midvictory CT are completely respawned.
|
||||
spawnControlTower();
|
||||
@ -483,9 +483,9 @@ public class Siege implements Siegable
|
||||
@Override
|
||||
public void startSiege()
|
||||
{
|
||||
if (!isInProgress())
|
||||
if (!_isInProgress)
|
||||
{
|
||||
_firstOwnerClanId = getCastle().getOwnerId();
|
||||
_firstOwnerClanId = _castle.getOwnerId();
|
||||
|
||||
if (getAttackerClans().isEmpty())
|
||||
{
|
||||
@ -500,7 +500,7 @@ public class Siege implements Siegable
|
||||
final L2Clan ownerClan = ClanTable.getInstance().getClan(_firstOwnerClanId);
|
||||
ownerClan.increaseBloodAllianceCount();
|
||||
}
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
sm.addCastleId(_castle.getResidenceId());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
saveCastleSiege();
|
||||
return;
|
||||
@ -515,20 +515,20 @@ public class Siege implements Siegable
|
||||
_controlTowerCount = 0;
|
||||
spawnControlTower(); // Spawn control tower
|
||||
spawnFlameTower(); // Spawn control tower
|
||||
getCastle().spawnDoor(); // Spawn door
|
||||
_castle.spawnDoor(); // Spawn door
|
||||
spawnSiegeGuard(); // Spawn siege guard
|
||||
SiegeGuardManager.getInstance().deleteTickets(getCastle().getResidenceId()); // remove the tickets from the ground
|
||||
getCastle().getZone().setSiegeInstance(this);
|
||||
getCastle().getZone().setIsActive(true);
|
||||
getCastle().getZone().updateZoneStatusForCharactersInside();
|
||||
_castle.getZone().setSiegeInstance(this);
|
||||
_castle.getZone().setIsActive(true);
|
||||
_castle.getZone().updateZoneStatusForCharactersInside();
|
||||
|
||||
// Schedule a task to prepare auto siege end
|
||||
_siegeEndDate = Calendar.getInstance();
|
||||
_siegeEndDate.add(Calendar.MINUTE, SiegeManager.getInstance().getSiegeLength());
|
||||
ThreadPool.schedule(new ScheduleEndSiegeTask(getCastle()), 1000); // Prepare auto end task
|
||||
ThreadPool.schedule(new ScheduleEndSiegeTask(_castle), 1000); // Prepare auto end task
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_S1_SIEGE_HAS_STARTED);
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
sm.addCastleId(_castle.getResidenceId());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
|
||||
// Notify to scripts.
|
||||
@ -589,7 +589,7 @@ public class Siege implements Siegable
|
||||
else
|
||||
{
|
||||
member.setSiegeState((byte) 1);
|
||||
member.setSiegeSide(getCastle().getResidenceId());
|
||||
member.setSiegeSide(_castle.getResidenceId());
|
||||
if (checkIfInZone(member))
|
||||
{
|
||||
member.setIsInSiege(true);
|
||||
@ -649,7 +649,7 @@ public class Siege implements Siegable
|
||||
else
|
||||
{
|
||||
member.setSiegeState((byte) 2);
|
||||
member.setSiegeSide(getCastle().getResidenceId());
|
||||
member.setSiegeSide(_castle.getResidenceId());
|
||||
if (checkIfInZone(member))
|
||||
{
|
||||
member.setIsInSiege(true);
|
||||
@ -723,7 +723,7 @@ public class Siege implements Siegable
|
||||
*/
|
||||
public boolean checkIfInZone(int x, int y, int z)
|
||||
{
|
||||
return (isInProgress() && (getCastle().checkIfInZone(x, y, z))); // Castle zone during siege
|
||||
return (_isInProgress && (_castle.checkIfInZone(x, y, z))); // Castle zone during siege
|
||||
}
|
||||
|
||||
/**
|
||||
@ -763,21 +763,21 @@ public class Siege implements Siegable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("DELETE FROM siege_clans WHERE castle_id=?"))
|
||||
{
|
||||
statement.setInt(1, getCastle().getResidenceId());
|
||||
statement.setInt(1, _castle.getResidenceId());
|
||||
statement.execute();
|
||||
|
||||
if (getCastle().getOwnerId() > 0)
|
||||
if (_castle.getOwnerId() > 0)
|
||||
{
|
||||
try (PreparedStatement delete = con.prepareStatement("DELETE FROM siege_clans WHERE clan_id=?"))
|
||||
{
|
||||
delete.setInt(1, getCastle().getOwnerId());
|
||||
delete.setInt(1, _castle.getOwnerId());
|
||||
delete.execute();
|
||||
}
|
||||
}
|
||||
|
||||
getAttackerClans().clear();
|
||||
getDefenderClans().clear();
|
||||
getDefenderWaitingClans().clear();
|
||||
_defenderWaitingClans.clear();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -791,10 +791,10 @@ public class Siege implements Siegable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("DELETE FROM siege_clans WHERE castle_id=? and type = 2"))
|
||||
{
|
||||
statement.setInt(1, getCastle().getResidenceId());
|
||||
statement.setInt(1, _castle.getResidenceId());
|
||||
statement.execute();
|
||||
|
||||
getDefenderWaitingClans().clear();
|
||||
_defenderWaitingClans.clear();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -821,7 +821,7 @@ public class Siege implements Siegable
|
||||
*/
|
||||
public List<L2PcInstance> getPlayersInZone()
|
||||
{
|
||||
return getCastle().getZone().getPlayersInside();
|
||||
return _castle.getZone().getPlayersInside();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -845,7 +845,7 @@ public class Siege implements Siegable
|
||||
*/
|
||||
public List<L2PcInstance> getSpectatorsInZone()
|
||||
{
|
||||
return getCastle().getZone().getPlayersInside().stream().filter(p -> !p.isInSiege()).collect(Collectors.toList());
|
||||
return _castle.getZone().getPlayersInside().stream().filter(p -> !p.isInSiege()).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
@ -872,7 +872,7 @@ public class Siege implements Siegable
|
||||
*/
|
||||
public void listRegisterClan(L2PcInstance player)
|
||||
{
|
||||
player.sendPacket(new SiegeInfo(getCastle(), player));
|
||||
player.sendPacket(new SiegeInfo(_castle, player));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -892,7 +892,7 @@ public class Siege implements Siegable
|
||||
return;
|
||||
}
|
||||
int allyId = 0;
|
||||
if (getCastle().getOwnerId() != 0)
|
||||
if (_castle.getOwnerId() != 0)
|
||||
{
|
||||
allyId = ClanTable.getInstance().getClan(getCastle().getOwnerId()).getAllyId();
|
||||
}
|
||||
@ -935,9 +935,9 @@ public class Siege implements Siegable
|
||||
|
||||
public void registerDefender(L2PcInstance player, boolean force)
|
||||
{
|
||||
if (getCastle().getOwnerId() <= 0)
|
||||
if (_castle.getOwnerId() <= 0)
|
||||
{
|
||||
player.sendMessage("You cannot register as a defender because " + getCastle().getName() + " is owned by NPC.");
|
||||
player.sendMessage("You cannot register as a defender because " + _castle.getName() + " is owned by NPC.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -975,7 +975,7 @@ public class Siege implements Siegable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("DELETE FROM siege_clans WHERE castle_id=? and clan_id=?"))
|
||||
{
|
||||
statement.setInt(1, getCastle().getResidenceId());
|
||||
statement.setInt(1, _castle.getResidenceId());
|
||||
statement.setInt(2, clanId);
|
||||
statement.execute();
|
||||
|
||||
@ -1019,7 +1019,7 @@ public class Siege implements Siegable
|
||||
{
|
||||
correctSiegeDateTime();
|
||||
|
||||
LOGGER.info("Siege of " + getCastle().getName() + ": " + getCastle().getSiegeDate().getTime());
|
||||
LOGGER.info("Siege of " + _castle.getName() + ": " + _castle.getSiegeDate().getTime());
|
||||
|
||||
loadSiegeClan();
|
||||
|
||||
@ -1028,7 +1028,7 @@ public class Siege implements Siegable
|
||||
{
|
||||
_scheduledStartSiegeTask.cancel(false);
|
||||
}
|
||||
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(getCastle()), 1000);
|
||||
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(_castle), 1000);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1048,12 +1048,12 @@ public class Siege implements Siegable
|
||||
}
|
||||
case NotOwner:
|
||||
{
|
||||
players = getPlayersInZone();
|
||||
players = _castle.getZone().getPlayersInside();
|
||||
final Iterator<L2PcInstance> it = players.iterator();
|
||||
while (it.hasNext())
|
||||
{
|
||||
final L2PcInstance player = it.next();
|
||||
if ((player == null) || player.inObserverMode() || ((player.getClanId() > 0) && (player.getClanId() == getCastle().getOwnerId())))
|
||||
if ((player == null) || player.inObserverMode() || ((player.getClanId() > 0) && (player.getClanId() == _castle.getOwnerId())))
|
||||
{
|
||||
it.remove();
|
||||
}
|
||||
@ -1125,7 +1125,7 @@ public class Siege implements Siegable
|
||||
*/
|
||||
private void addDefenderWaiting(int clanId)
|
||||
{
|
||||
getDefenderWaitingClans().add(new L2SiegeClan(clanId, SiegeClanType.DEFENDER_PENDING)); // Add registered defender to defender list
|
||||
_defenderWaitingClans.add(new L2SiegeClan(clanId, SiegeClanType.DEFENDER_PENDING)); // Add registered defender to defender list
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1135,13 +1135,13 @@ public class Siege implements Siegable
|
||||
*/
|
||||
private boolean checkIfCanRegister(L2PcInstance player, byte typeId)
|
||||
{
|
||||
if (getIsRegistrationOver())
|
||||
if (_isRegistrationOver)
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THE_DEADLINE_TO_REGISTER_FOR_THE_SIEGE_OF_S1_HAS_PASSED);
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
sm.addCastleId(_castle.getResidenceId());
|
||||
player.sendPacket(sm);
|
||||
}
|
||||
else if (isInProgress())
|
||||
else if (_isInProgress)
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THIS_IS_NOT_THE_TIME_FOR_SIEGE_REGISTRATION_AND_SO_REGISTRATION_AND_CANCELLATION_CANNOT_BE_DONE);
|
||||
}
|
||||
@ -1149,7 +1149,7 @@ public class Siege implements Siegable
|
||||
{
|
||||
player.sendPacket(SystemMessageId.ONLY_CLANS_OF_LEVEL_5_OR_ABOVE_MAY_REGISTER_FOR_A_CASTLE_SIEGE);
|
||||
}
|
||||
else if (player.getClan().getId() == getCastle().getOwnerId())
|
||||
else if (player.getClan().getId() == _castle.getOwnerId())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.CASTLE_OWNING_CLANS_ARE_AUTOMATICALLY_REGISTERED_ON_THE_DEFENDING_SIDE);
|
||||
}
|
||||
@ -1243,15 +1243,15 @@ public class Siege implements Siegable
|
||||
{
|
||||
getAttackerClans().clear();
|
||||
getDefenderClans().clear();
|
||||
getDefenderWaitingClans().clear();
|
||||
_defenderWaitingClans.clear();
|
||||
|
||||
// Add castle owner as defender (add owner first so that they are on the top of the defender list)
|
||||
if (getCastle().getOwnerId() > 0)
|
||||
if (_castle.getOwnerId() > 0)
|
||||
{
|
||||
addDefender(getCastle().getOwnerId(), SiegeClanType.OWNER);
|
||||
addDefender(_castle.getOwnerId(), SiegeClanType.OWNER);
|
||||
}
|
||||
|
||||
statement.setInt(1, getCastle().getResidenceId());
|
||||
statement.setInt(1, _castle.getResidenceId());
|
||||
try (ResultSet rs = statement.executeQuery())
|
||||
{
|
||||
int typeId;
|
||||
@ -1333,8 +1333,8 @@ public class Siege implements Siegable
|
||||
setNextSiegeDate(); // Set the next set date for 2 weeks from now
|
||||
// Schedule Time registration end
|
||||
getTimeRegistrationOverDate().setTimeInMillis(Calendar.getInstance().getTimeInMillis());
|
||||
getTimeRegistrationOverDate().add(Calendar.DAY_OF_MONTH, 1);
|
||||
getCastle().setIsTimeRegistrationOver(false);
|
||||
_castle.getTimeRegistrationOverDate().add(Calendar.DAY_OF_MONTH, 1);
|
||||
_castle.setIsTimeRegistrationOver(false);
|
||||
|
||||
saveSiegeDate(); // Save the new date
|
||||
startAutoTask(); // Prepare auto start siege and end registration
|
||||
@ -1346,16 +1346,16 @@ public class Siege implements Siegable
|
||||
if (_scheduledStartSiegeTask != null)
|
||||
{
|
||||
_scheduledStartSiegeTask.cancel(true);
|
||||
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(getCastle()), 1000);
|
||||
_scheduledStartSiegeTask = ThreadPool.schedule(new ScheduleStartSiegeTask(_castle), 1000);
|
||||
}
|
||||
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("UPDATE castle SET siegeDate = ?, regTimeEnd = ?, regTimeOver = ? WHERE id = ?"))
|
||||
{
|
||||
statement.setLong(1, getSiegeDate().getTimeInMillis());
|
||||
statement.setLong(2, getTimeRegistrationOverDate().getTimeInMillis());
|
||||
statement.setString(3, String.valueOf(getIsTimeRegistrationOver()));
|
||||
statement.setInt(4, getCastle().getResidenceId());
|
||||
statement.setLong(1, _castle.getSiegeDate().getTimeInMillis());
|
||||
statement.setLong(2, _castle.getTimeRegistrationOverDate().getTimeInMillis());
|
||||
statement.setString(3, String.valueOf(_castle.getIsTimeRegistrationOver()));
|
||||
statement.setInt(4, _castle.getResidenceId());
|
||||
statement.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@ -1397,7 +1397,7 @@ public class Siege implements Siegable
|
||||
try (PreparedStatement statement = con.prepareStatement("INSERT INTO siege_clans (clan_id,castle_id,type,castle_owner) values (?,?,?,0)"))
|
||||
{
|
||||
statement.setInt(1, clan.getId());
|
||||
statement.setInt(2, getCastle().getResidenceId());
|
||||
statement.setInt(2, _castle.getResidenceId());
|
||||
statement.setInt(3, typeId);
|
||||
statement.execute();
|
||||
}
|
||||
@ -1407,7 +1407,7 @@ public class Siege implements Siegable
|
||||
try (PreparedStatement statement = con.prepareStatement("UPDATE siege_clans SET type = ? WHERE castle_id = ? AND clan_id = ?"))
|
||||
{
|
||||
statement.setInt(1, typeId);
|
||||
statement.setInt(2, getCastle().getResidenceId());
|
||||
statement.setInt(2, _castle.getResidenceId());
|
||||
statement.setInt(3, clan.getId());
|
||||
statement.execute();
|
||||
}
|
||||
@ -1435,7 +1435,7 @@ public class Siege implements Siegable
|
||||
/** Set the date for the next siege. */
|
||||
private void setNextSiegeDate()
|
||||
{
|
||||
final Calendar cal = getCastle().getSiegeDate();
|
||||
final Calendar cal = _castle.getSiegeDate();
|
||||
if (cal.getTimeInMillis() < System.currentTimeMillis())
|
||||
{
|
||||
cal.setTimeInMillis(System.currentTimeMillis());
|
||||
@ -1460,7 +1460,7 @@ public class Siege implements Siegable
|
||||
}
|
||||
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_ANNOUNCED_THE_NEXT_CASTLE_SIEGE_TIME);
|
||||
sm.addCastleId(getCastle().getResidenceId());
|
||||
sm.addCastleId(_castle.getResidenceId());
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
|
||||
_isRegistrationOver = false; // Allow registration for next siege
|
||||
@ -1645,7 +1645,7 @@ public class Siege implements Siegable
|
||||
|
||||
public final L2SiegeClan getDefenderWaitingClan(int clanId)
|
||||
{
|
||||
for (L2SiegeClan sc : getDefenderWaitingClans())
|
||||
for (L2SiegeClan sc : _defenderWaitingClans)
|
||||
{
|
||||
if ((sc != null) && (sc.getClanId() == clanId))
|
||||
{
|
||||
@ -1672,23 +1672,23 @@ public class Siege implements Siegable
|
||||
|
||||
public final boolean getIsTimeRegistrationOver()
|
||||
{
|
||||
return getCastle().getIsTimeRegistrationOver();
|
||||
return _castle.getIsTimeRegistrationOver();
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Calendar getSiegeDate()
|
||||
{
|
||||
return getCastle().getSiegeDate();
|
||||
return _castle.getSiegeDate();
|
||||
}
|
||||
|
||||
public final Calendar getTimeRegistrationOverDate()
|
||||
{
|
||||
return getCastle().getTimeRegistrationOverDate();
|
||||
return _castle.getTimeRegistrationOverDate();
|
||||
}
|
||||
|
||||
public void endTimeRegistration(boolean automatic)
|
||||
{
|
||||
getCastle().setIsTimeRegistrationOver(true);
|
||||
_castle.setIsTimeRegistrationOver(true);
|
||||
if (!automatic)
|
||||
{
|
||||
saveSiegeDate();
|
||||
|
@ -129,7 +129,7 @@ public class EventScheduler
|
||||
run();
|
||||
updateLastRun();
|
||||
|
||||
if (isRepeating())
|
||||
if (_repeat)
|
||||
{
|
||||
ThreadPool.schedule(this::startScheduler, 1000);
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ public abstract class AbstractEventListener implements Comparable<AbstractEventL
|
||||
*/
|
||||
public void unregisterMe()
|
||||
{
|
||||
getContainer().removeListener(this);
|
||||
_container.removeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -36,7 +36,7 @@ public final class MovieHolder
|
||||
_players = players;
|
||||
_movie = movie;
|
||||
|
||||
getPlayers().forEach(p -> p.playMovie(this));
|
||||
_players.forEach(p -> p.playMovie(this));
|
||||
}
|
||||
|
||||
public Movie getMovie()
|
||||
@ -46,16 +46,16 @@ public final class MovieHolder
|
||||
|
||||
public void playerEscapeVote(L2PcInstance player)
|
||||
{
|
||||
if (getVotedPlayers().contains(player) || !getPlayers().contains(player) || !getMovie().isEscapable())
|
||||
if (_votedPlayers.contains(player) || !_players.contains(player) || !_movie.isEscapable())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
getVotedPlayers().add(player);
|
||||
_votedPlayers.add(player);
|
||||
|
||||
if (((getVotedPlayers().size() * 100) / getPlayers().size()) >= 50)
|
||||
if (((_votedPlayers.size() * 100) / _players.size()) >= 50)
|
||||
{
|
||||
getPlayers().forEach(L2PcInstance::stopMovie);
|
||||
_players.forEach(L2PcInstance::stopMovie);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -487,7 +487,7 @@ public final class Instance implements IIdentifiable, INamable
|
||||
final List<SpawnGroup> spawns = getSpawnGroup(name);
|
||||
if (spawns == null)
|
||||
{
|
||||
LOGGER.warning("Spawn group " + name + " doesn't exist for instance " + getName() + " (" + _id + ")!");
|
||||
LOGGER.warning("Spawn group " + name + " doesn't exist for instance " + _template.getName() + " (" + _id + ")!");
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@ -502,7 +502,7 @@ public final class Instance implements IIdentifiable, INamable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning("Unable to spawn group " + name + " inside instance " + getName() + " (" + _id + ")");
|
||||
LOGGER.warning("Unable to spawn group " + name + " inside instance " + _template.getName() + " (" + _id + ")");
|
||||
}
|
||||
return npcs;
|
||||
}
|
||||
@ -516,7 +516,7 @@ public final class Instance implements IIdentifiable, INamable
|
||||
final List<SpawnGroup> spawns = getSpawnGroup(name);
|
||||
if (spawns == null)
|
||||
{
|
||||
LOGGER.warning("Spawn group " + name + " doesn't exist for instance " + getName() + " (" + _id + ")!");
|
||||
LOGGER.warning("Spawn group " + name + " doesn't exist for instance " + _template.getName() + " (" + _id + ")!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -526,7 +526,7 @@ public final class Instance implements IIdentifiable, INamable
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.warning("Unable to spawn group " + name + " inside instance " + getName() + " (" + _id + ")");
|
||||
LOGGER.warning("Unable to spawn group " + name + " inside instance " + _template.getName() + " (" + _id + ")");
|
||||
}
|
||||
}
|
||||
|
||||
@ -810,7 +810,7 @@ public final class Instance implements IIdentifiable, INamable
|
||||
public void setReenterTime(long time)
|
||||
{
|
||||
// Cannot store reenter data for instance without template id.
|
||||
if ((getTemplateId() == -1) && (time > 0))
|
||||
if ((_template.getId() == -1) && (time > 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -824,7 +824,7 @@ public final class Instance implements IIdentifiable, INamable
|
||||
if (player != null)
|
||||
{
|
||||
ps.setInt(1, player.getObjectId());
|
||||
ps.setInt(2, getTemplateId());
|
||||
ps.setInt(2, _template.getId());
|
||||
ps.setLong(3, time);
|
||||
ps.addBatch();
|
||||
}
|
||||
@ -835,11 +835,11 @@ public final class Instance implements IIdentifiable, INamable
|
||||
final SystemMessage msg = SystemMessage.getSystemMessage(SystemMessageId.INSTANT_ZONE_S1_S_ENTRY_HAS_BEEN_RESTRICTED_YOU_CAN_CHECK_THE_NEXT_POSSIBLE_ENTRY_TIME_BY_USING_THE_COMMAND_INSTANCEZONE);
|
||||
if (InstanceManager.getInstance().getInstanceName(getTemplateId()) != null)
|
||||
{
|
||||
msg.addInstanceName(getTemplateId());
|
||||
msg.addInstanceName(_template.getId());
|
||||
}
|
||||
else
|
||||
{
|
||||
msg.addString(getName());
|
||||
msg.addString(_template.getName());
|
||||
}
|
||||
_allowed.forEach(player ->
|
||||
{
|
||||
@ -995,7 +995,7 @@ public final class Instance implements IIdentifiable, INamable
|
||||
removePlayer(player);
|
||||
if (Config.RESTORE_PLAYER_INSTANCE)
|
||||
{
|
||||
player.getVariables().set("INSTANCE_RESTORE", getId());
|
||||
player.getVariables().set("INSTANCE_RESTORE", _id);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1161,6 +1161,6 @@ public final class Instance implements IIdentifiable, INamable
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getName() + "(" + getId() + ")";
|
||||
return _template.getName() + "(" + _id + ")";
|
||||
}
|
||||
}
|
@ -788,6 +788,6 @@ public class InstanceTemplate extends ListenersContainer implements IIdentifiabl
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "ID: " + getId() + " Name: " + getName();
|
||||
return "ID: " + _templateId + " Name: " + _name;
|
||||
}
|
||||
}
|
@ -181,12 +181,12 @@ public final class ItemAuction
|
||||
|
||||
public final long getStartingTimeRemaining()
|
||||
{
|
||||
return Math.max(getEndingTime() - System.currentTimeMillis(), 0);
|
||||
return Math.max(_endingTime - System.currentTimeMillis(), 0);
|
||||
}
|
||||
|
||||
public final long getFinishingTimeRemaining()
|
||||
{
|
||||
return Math.max(getEndingTime() - System.currentTimeMillis(), 0);
|
||||
return Math.max(_endingTime - System.currentTimeMillis(), 0);
|
||||
}
|
||||
|
||||
public final void storeMe()
|
||||
@ -250,7 +250,7 @@ public final class ItemAuction
|
||||
throw new NullPointerException();
|
||||
}
|
||||
|
||||
if (newBid < getAuctionInitBid())
|
||||
if (newBid < _auctionItem.getAuctionInitBid())
|
||||
{
|
||||
player.sendPacket(SystemMessageId.YOUR_BID_PRICE_MUST_BE_HIGHER_THAN_THE_MINIMUM_PRICE_CURRENTLY_BEING_BID);
|
||||
return;
|
||||
@ -340,7 +340,7 @@ public final class ItemAuction
|
||||
_highestBid = bid;
|
||||
}
|
||||
|
||||
if ((getEndingTime() - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
|
||||
if ((_endingTime - System.currentTimeMillis()) <= (1000 * 60 * 10)) // 10 minutes
|
||||
{
|
||||
switch (_auctionEndingExtendState)
|
||||
{
|
||||
|
@ -115,9 +115,9 @@ public class Mail extends ItemContainer
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement statement = con.prepareStatement("SELECT * FROM items WHERE owner_id=? AND loc=? AND loc_data=?"))
|
||||
{
|
||||
statement.setInt(1, getOwnerId());
|
||||
statement.setInt(1, _ownerId);
|
||||
statement.setString(2, getBaseLocation().name());
|
||||
statement.setInt(3, getMessageId());
|
||||
statement.setInt(3, _messageId);
|
||||
try (ResultSet inv = statement.executeQuery())
|
||||
{
|
||||
while (inv.next())
|
||||
|
@ -150,7 +150,7 @@ public class PcInventory extends Inventory
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isDuplicate && (!onlyAvailable || (item.isSellable() && item.isAvailable(getOwner(), false, false))))
|
||||
if (!isDuplicate && (!onlyAvailable || (item.isSellable() && item.isAvailable(_owner, false, false))))
|
||||
{
|
||||
list.add(item);
|
||||
}
|
||||
@ -211,7 +211,7 @@ public class PcInventory extends Inventory
|
||||
{
|
||||
return getItems(i ->
|
||||
{
|
||||
if (!i.isAvailable(getOwner(), allowAdena, allowNonTradeable) || !canManipulateWithItemId(i.getId()))
|
||||
if (!i.isAvailable(_owner, allowAdena, allowNonTradeable) || !canManipulateWithItemId(i.getId()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -232,7 +232,7 @@ public class PcInventory extends Inventory
|
||||
{
|
||||
//@formatter:off
|
||||
return _items.values().stream()
|
||||
.filter(i -> i.isAvailable(getOwner(), false, false))
|
||||
.filter(i -> i.isAvailable(_owner, false, false))
|
||||
.map(tradeList::adjustAvailableItem)
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toCollection(LinkedList::new));
|
||||
@ -689,12 +689,12 @@ public class PcInventory extends Inventory
|
||||
protected boolean removeItem(L2ItemInstance item)
|
||||
{
|
||||
// Removes any reference to the item from Shortcut bar
|
||||
getOwner().removeItemFromShortCut(item.getObjectId());
|
||||
_owner.removeItemFromShortCut(item.getObjectId());
|
||||
|
||||
// Removes active Enchant Scroll
|
||||
if (getOwner().isProcessingItem(item.getObjectId()))
|
||||
if (_owner.isProcessingItem(item.getObjectId()))
|
||||
{
|
||||
getOwner().removeRequestsThatProcessesItem(item.getObjectId());
|
||||
_owner.removeRequestsThatProcessesItem(item.getObjectId());
|
||||
}
|
||||
|
||||
if (item.getId() == ADENA_ID)
|
||||
@ -720,7 +720,7 @@ public class PcInventory extends Inventory
|
||||
public void refreshWeight()
|
||||
{
|
||||
super.refreshWeight();
|
||||
getOwner().refreshOverloaded(true);
|
||||
_owner.refreshOverloaded(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -60,7 +60,7 @@ public class PetInventory extends Inventory
|
||||
protected void refreshWeight()
|
||||
{
|
||||
super.refreshWeight();
|
||||
getOwner().updateAndBroadcastStatus(1);
|
||||
_owner.updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
public boolean validateCapacity(L2ItemInstance item)
|
||||
@ -120,7 +120,7 @@ public class PetInventory extends Inventory
|
||||
{
|
||||
if (item.isEquipped())
|
||||
{
|
||||
if (!item.getItem().checkCondition(getOwner(), getOwner(), false))
|
||||
if (!item.getItem().checkCondition(_owner, _owner, false))
|
||||
{
|
||||
unEquipItemInSlot(item.getLocationSlot());
|
||||
}
|
||||
|
@ -73,6 +73,6 @@ public final class L2Armor extends L2Item
|
||||
@Override
|
||||
public final int getItemMask()
|
||||
{
|
||||
return getItemType().mask();
|
||||
return _type.mask();
|
||||
}
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ public final class L2EtcItem extends L2Item
|
||||
@Override
|
||||
public int getItemMask()
|
||||
{
|
||||
return getItemType().mask();
|
||||
return _type.mask();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -411,11 +411,11 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
case TYPE2_SHIELD_ARMOR:
|
||||
case TYPE2_ACCESSORY:
|
||||
{
|
||||
return _crystalCount + (getCrystalType().getCrystalEnchantBonusArmor() * ((3 * enchantLevel) - 6));
|
||||
return _crystalCount + (_crystalType.getCrystalEnchantBonusArmor() * ((3 * enchantLevel) - 6));
|
||||
}
|
||||
case TYPE2_WEAPON:
|
||||
{
|
||||
return _crystalCount + (getCrystalType().getCrystalEnchantBonusWeapon() * ((2 * enchantLevel) - 3));
|
||||
return _crystalCount + (_crystalType.getCrystalEnchantBonusWeapon() * ((2 * enchantLevel) - 3));
|
||||
}
|
||||
default:
|
||||
{
|
||||
@ -430,11 +430,11 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
case TYPE2_SHIELD_ARMOR:
|
||||
case TYPE2_ACCESSORY:
|
||||
{
|
||||
return _crystalCount + (getCrystalType().getCrystalEnchantBonusArmor() * enchantLevel);
|
||||
return _crystalCount + (_crystalType.getCrystalEnchantBonusArmor() * enchantLevel);
|
||||
}
|
||||
case TYPE2_WEAPON:
|
||||
{
|
||||
return _crystalCount + (getCrystalType().getCrystalEnchantBonusWeapon() * enchantLevel);
|
||||
return _crystalCount + (_crystalType.getCrystalEnchantBonusWeapon() * enchantLevel);
|
||||
}
|
||||
default:
|
||||
{
|
||||
@ -528,7 +528,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
*/
|
||||
public boolean isEquipable()
|
||||
{
|
||||
return (getBodyPart() != 0) && !(getItemType() instanceof EtcItemType);
|
||||
return (_bodyPart != 0) && !(getItemType() instanceof EtcItemType);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -585,7 +585,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
*/
|
||||
public final int isEnchantable()
|
||||
{
|
||||
return Arrays.binarySearch(Config.ENCHANT_BLACKLIST, getId()) < 0 ? _enchantable : 0;
|
||||
return Arrays.binarySearch(Config.ENCHANT_BLACKLIST, _itemId) < 0 ? _enchantable : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -776,7 +776,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
}
|
||||
|
||||
// Don't allow hero equipment and restricted items during Olympiad
|
||||
if ((isOlyRestrictedItem() || isHeroItem()) && (activeChar.isPlayer() && activeChar.getActingPlayer().isInOlympiadMode()))
|
||||
if ((isOlyRestrictedItem() || _heroItem) && (activeChar.isPlayer() && activeChar.getActingPlayer().isInOlympiadMode()))
|
||||
{
|
||||
if (isEquipable())
|
||||
{
|
||||
@ -789,7 +789,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isCocRestrictedItem() && (activeChar.isPlayer() && (activeChar.getActingPlayer().isOnEvent(CeremonyOfChaosEvent.class))))
|
||||
if (_is_coc_restricted && (activeChar.isPlayer() && (activeChar.getActingPlayer().isOnEvent(CeremonyOfChaosEvent.class))))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_USE_THIS_ITEM_IN_THE_TOURNAMENT);
|
||||
return false;
|
||||
|
@ -119,7 +119,7 @@ public final class L2Weapon extends L2Item
|
||||
@Override
|
||||
public int getItemMask()
|
||||
{
|
||||
return getItemType().mask();
|
||||
return _type.mask();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -274,7 +274,7 @@ public class AppearanceStone
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (getType())
|
||||
switch (_type)
|
||||
{
|
||||
case RESTORE:
|
||||
{
|
||||
@ -383,15 +383,15 @@ public class AppearanceStone
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getWeaponType() != WeaponType.NONE)
|
||||
if (_weaponType != WeaponType.NONE)
|
||||
{
|
||||
if (!targetItem.isWeapon() || (targetItem.getItemType() != getWeaponType()))
|
||||
if (!targetItem.isWeapon() || (targetItem.getItemType() != _weaponType))
|
||||
{
|
||||
player.sendPacket(SystemMessageId.THIS_ITEM_CANNOT_BE_USED_AS_AN_APPEARANCE_WEAPON);
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (getHandType())
|
||||
switch (_handType)
|
||||
{
|
||||
case ONE_HANDED:
|
||||
{
|
||||
@ -413,7 +413,7 @@ public class AppearanceStone
|
||||
}
|
||||
}
|
||||
|
||||
switch (getMagicType())
|
||||
switch (_magicType)
|
||||
{
|
||||
case MAGICAL:
|
||||
{
|
||||
@ -435,9 +435,9 @@ public class AppearanceStone
|
||||
}
|
||||
}
|
||||
|
||||
if (getArmorType() != ArmorType.NONE)
|
||||
if (_armorType != ArmorType.NONE)
|
||||
{
|
||||
switch (getArmorType())
|
||||
switch (_armorType)
|
||||
{
|
||||
case SHIELD:
|
||||
{
|
||||
|
@ -321,14 +321,14 @@ public final class L2ItemInstance extends L2Object
|
||||
|
||||
if (Config.LOG_ITEMS)
|
||||
{
|
||||
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (getItem().isEquipable() || (getItem().getId() == ADENA_ID))))
|
||||
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (_item.isEquipable() || (_item.getId() == ADENA_ID))))
|
||||
{
|
||||
if (getEnchantLevel() > 0)
|
||||
if (_enchantLevel > 0)
|
||||
{
|
||||
LOG_ITEMS.info("SETOWNER:" + String.valueOf(process) // in case of null
|
||||
+ ", item " + getObjectId() //
|
||||
+ ":+" + getEnchantLevel() //
|
||||
+ " " + getItem().getName() //
|
||||
+ ":+" + _enchantLevel //
|
||||
+ " " + _item.getName() //
|
||||
+ "(" + _count + "), " //
|
||||
+ String.valueOf(creator) + ", " // in case of null
|
||||
+ String.valueOf(reference)); // in case of null
|
||||
@ -337,7 +337,7 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
LOG_ITEMS.info("SETOWNER:" + String.valueOf(process) // in case of null
|
||||
+ ", item " + getObjectId() //
|
||||
+ ":" + getItem().getName() //
|
||||
+ ":" + _item.getName() //
|
||||
+ "(" + _count + "), " //
|
||||
+ String.valueOf(creator) + ", " // in case of null
|
||||
+ String.valueOf(reference)); // in case of null
|
||||
@ -359,7 +359,7 @@ public final class L2ItemInstance extends L2Object
|
||||
final String targetName = (creator.getTarget() != null ? creator.getTarget().getName() : "no-target");
|
||||
if (Config.GMAUDIT)
|
||||
{
|
||||
GMAudit.auditGMAction(creator.getName() + " [" + creator.getObjectId() + "]", process + "(id: " + getId() + " name: " + getName() + ")", targetName, "L2Object referencing this action is: " + referenceName);
|
||||
GMAudit.auditGMAction(creator.getName() + " [" + creator.getObjectId() + "]", process + "(id: " + _itemId + " name: " + getName() + ")", targetName, "L2Object referencing this action is: " + referenceName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -475,7 +475,7 @@ public final class L2ItemInstance extends L2Object
|
||||
return;
|
||||
}
|
||||
final long old = _count;
|
||||
final long max = getId() == ADENA_ID ? MAX_ADENA : Integer.MAX_VALUE;
|
||||
final long max = _itemId == ADENA_ID ? MAX_ADENA : Integer.MAX_VALUE;
|
||||
|
||||
if ((count > 0) && (_count > (max - count)))
|
||||
{
|
||||
@ -497,12 +497,12 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
if (!Config.LOG_ITEMS_SMALL_LOG || (Config.LOG_ITEMS_SMALL_LOG && (_item.isEquipable() || (_item.getId() == ADENA_ID))))
|
||||
{
|
||||
if (getEnchantLevel() > 0)
|
||||
if (_enchantLevel > 0)
|
||||
{
|
||||
LOG_ITEMS.info("CHANGE:" + String.valueOf(process) // in case of null
|
||||
+ ", item " + getObjectId() //
|
||||
+ ":+" + getEnchantLevel() //
|
||||
+ " " + getItem().getName() //
|
||||
+ ":+" + _enchantLevel //
|
||||
+ " " + _item.getName() //
|
||||
+ "(" + _count + "), PrevCount(" //
|
||||
+ String.valueOf(old) + "), " // in case of null
|
||||
+ String.valueOf(creator) + ", " // in case of null
|
||||
@ -512,7 +512,7 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
LOG_ITEMS.info("CHANGE:" + String.valueOf(process) // in case of null
|
||||
+ ", item " + getObjectId() //
|
||||
+ ":" + getItem().getName() //
|
||||
+ ":" + _item.getName() //
|
||||
+ "(" + _count + "), PrevCount(" //
|
||||
+ String.valueOf(old) + "), " // in case of null
|
||||
+ String.valueOf(creator) + ", " // in case of null
|
||||
@ -535,7 +535,7 @@ public final class L2ItemInstance extends L2Object
|
||||
final String targetName = (creator.getTarget() != null ? creator.getTarget().getName() : "no-target");
|
||||
if (Config.GMAUDIT)
|
||||
{
|
||||
GMAudit.auditGMAction(creator.getName() + " [" + creator.getObjectId() + "]", process + "(id: " + getId() + " objId: " + getObjectId() + " name: " + getName() + " count: " + count + ")", targetName, "L2Object referencing this action is: " + referenceName);
|
||||
GMAudit.auditGMAction(creator.getName() + " [" + creator.getObjectId() + "]", process + "(id: " + _itemId + " objId: " + getObjectId() + " name: " + getName() + " count: " + count + ")", targetName, "L2Object referencing this action is: " + referenceName);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -552,9 +552,9 @@ public final class L2ItemInstance extends L2Object
|
||||
*/
|
||||
public int isEnchantable()
|
||||
{
|
||||
if ((getItemLocation() == ItemLocation.INVENTORY) || (getItemLocation() == ItemLocation.PAPERDOLL))
|
||||
if ((_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.PAPERDOLL))
|
||||
{
|
||||
return getItem().isEnchantable();
|
||||
return _item.isEnchantable();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -649,7 +649,7 @@ public final class L2ItemInstance extends L2Object
|
||||
*/
|
||||
public int getDisplayId()
|
||||
{
|
||||
return getItem().getDisplayId();
|
||||
return _item.getDisplayId();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -723,7 +723,7 @@ public final class L2ItemInstance extends L2Object
|
||||
/**
|
||||
* @return the reference price of the item.
|
||||
*/
|
||||
public int getReferencePrice()
|
||||
public long getReferencePrice()
|
||||
{
|
||||
return _item.getReferencePrice();
|
||||
}
|
||||
@ -873,7 +873,7 @@ public final class L2ItemInstance extends L2Object
|
||||
|
||||
public boolean isOlyRestrictedItem()
|
||||
{
|
||||
return getItem().isOlyRestrictedItem();
|
||||
return _item.isOlyRestrictedItem();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -887,12 +887,12 @@ public final class L2ItemInstance extends L2Object
|
||||
final L2Summon pet = player.getPet();
|
||||
|
||||
return ((!isEquipped()) // Not equipped
|
||||
&& (getItem().getType2() != L2Item.TYPE2_QUEST) // Not Quest Item
|
||||
&& ((getItem().getType2() != L2Item.TYPE2_MONEY) || (getItem().getType1() != L2Item.TYPE1_SHIELD_ARMOR)) // not money, not shield
|
||||
&& (_item.getType2() != L2Item.TYPE2_QUEST) // Not Quest Item
|
||||
&& ((_item.getType2() != L2Item.TYPE2_MONEY) || (_item.getType1() != L2Item.TYPE1_SHIELD_ARMOR)) // not money, not shield
|
||||
&& ((pet == null) || (getObjectId() != pet.getControlObjectId())) // Not Control item of currently summoned pet
|
||||
&& !(player.isProcessingItem(getObjectId())) // Not momentarily used enchant scroll
|
||||
&& (allowAdena || (getId() != ADENA_ID)) // Not Adena
|
||||
&& (!player.isCastingNow(s -> s.getSkill().getItemConsumeId() != getId())) && (allowNonTradeable || (isTradeable() && (!((getItem().getItemType() == EtcItemType.PET_COLLAR) && player.havePetInvItems())))));
|
||||
&& (allowAdena || (_itemId != ADENA_ID)) // Not Adena
|
||||
&& (!player.isCastingNow(s -> s.getSkill().getItemConsumeId() != _itemId)) && (allowNonTradeable || (isTradeable() && (!((_item.getItemType() == EtcItemType.PET_COLLAR) && player.havePetInvItems())))));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -956,7 +956,7 @@ public final class L2ItemInstance extends L2Object
|
||||
// there shall be no previous augmentation..
|
||||
if (_augmentation != null)
|
||||
{
|
||||
LOGGER.info("Warning: Augment set for (" + getObjectId() + ") " + getName() + " owner: " + getOwnerId());
|
||||
LOGGER.info("Warning: Augment set for (" + getObjectId() + ") " + getName() + " owner: " + _ownerId);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -1132,9 +1132,9 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
if (isWeapon())
|
||||
{
|
||||
if (getItem().getAttributes() != null)
|
||||
if (_item.getAttributes() != null)
|
||||
{
|
||||
return getItem().getAttributes().stream().findFirst().orElse(null);
|
||||
return _item.getAttributes().stream().findFirst().orElse(null);
|
||||
}
|
||||
else if (_elementals != null)
|
||||
{
|
||||
@ -1160,9 +1160,9 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
if (isArmor())
|
||||
{
|
||||
if (getItem().getAttributes() != null)
|
||||
if (_item.getAttributes() != null)
|
||||
{
|
||||
final AttributeHolder attribute = getItem().getAttribute(element);
|
||||
final AttributeHolder attribute = _item.getAttribute(element);
|
||||
if (attribute != null)
|
||||
{
|
||||
return attribute.getValue();
|
||||
@ -1404,7 +1404,7 @@ public final class L2ItemInstance extends L2Object
|
||||
player.broadcastUserInfo();
|
||||
}
|
||||
|
||||
if (getItemLocation() != ItemLocation.WAREHOUSE)
|
||||
if (_loc != ItemLocation.WAREHOUSE)
|
||||
{
|
||||
// destroy
|
||||
player.getInventory().destroyItem("L2ItemInstance", this, player, null);
|
||||
@ -1426,7 +1426,7 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
scheduleConsumeManaTask();
|
||||
}
|
||||
if (getItemLocation() != ItemLocation.WAREHOUSE)
|
||||
if (_loc != ItemLocation.WAREHOUSE)
|
||||
{
|
||||
final InventoryUpdate iu = new InventoryUpdate();
|
||||
iu.addModifiedItem(this);
|
||||
@ -1608,11 +1608,11 @@ public final class L2ItemInstance extends L2Object
|
||||
ps.setLong(2, _count);
|
||||
ps.setString(3, _loc.name());
|
||||
ps.setInt(4, _locData);
|
||||
ps.setInt(5, getEnchantLevel());
|
||||
ps.setInt(6, getCustomType1());
|
||||
ps.setInt(7, getCustomType2());
|
||||
ps.setInt(8, getMana());
|
||||
ps.setLong(9, getTime());
|
||||
ps.setInt(5, _enchantLevel);
|
||||
ps.setInt(6, _type1);
|
||||
ps.setInt(7, _type2);
|
||||
ps.setInt(8, _mana);
|
||||
ps.setLong(9, _time);
|
||||
ps.setInt(10, getObjectId());
|
||||
ps.executeUpdate();
|
||||
_existsInDb = true;
|
||||
@ -1644,12 +1644,12 @@ public final class L2ItemInstance extends L2Object
|
||||
ps.setLong(3, _count);
|
||||
ps.setString(4, _loc.name());
|
||||
ps.setInt(5, _locData);
|
||||
ps.setInt(6, getEnchantLevel());
|
||||
ps.setInt(6, _enchantLevel);
|
||||
ps.setInt(7, getObjectId());
|
||||
ps.setInt(8, _type1);
|
||||
ps.setInt(9, _type2);
|
||||
ps.setInt(10, getMana());
|
||||
ps.setLong(11, getTime());
|
||||
ps.setInt(10, _mana);
|
||||
ps.setLong(11, _time);
|
||||
|
||||
ps.executeUpdate();
|
||||
_existsInDb = true;
|
||||
@ -1827,7 +1827,7 @@ public final class L2ItemInstance extends L2Object
|
||||
player.sendInventoryUpdate(iu);
|
||||
}
|
||||
|
||||
if (getItemLocation() != ItemLocation.WAREHOUSE)
|
||||
if (_loc != ItemLocation.WAREHOUSE)
|
||||
{
|
||||
// destroy
|
||||
player.getInventory().destroyItem("L2ItemInstance", this, player, null);
|
||||
@ -1841,7 +1841,7 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
player.getWarehouse().destroyItem("L2ItemInstance", this, player, null);
|
||||
}
|
||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_EXPIRED).addItemName(getId()));
|
||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_EXPIRED).addItemName(_itemId));
|
||||
}
|
||||
}
|
||||
|
||||
@ -1938,32 +1938,32 @@ public final class L2ItemInstance extends L2Object
|
||||
|
||||
public boolean isQuestItem()
|
||||
{
|
||||
return getItem().isQuestItem();
|
||||
return _item.isQuestItem();
|
||||
}
|
||||
|
||||
public boolean isElementable()
|
||||
{
|
||||
if ((getItemLocation() == ItemLocation.INVENTORY) || (getItemLocation() == ItemLocation.PAPERDOLL))
|
||||
if ((_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.PAPERDOLL))
|
||||
{
|
||||
return getItem().isElementable();
|
||||
return _item.isElementable();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isFreightable()
|
||||
{
|
||||
return getItem().isFreightable();
|
||||
return _item.isFreightable();
|
||||
}
|
||||
|
||||
public int useSkillDisTime()
|
||||
{
|
||||
return getItem().useSkillDisTime();
|
||||
return _item.useSkillDisTime();
|
||||
}
|
||||
|
||||
public int getOlyEnchantLevel()
|
||||
{
|
||||
final L2PcInstance player = getActingPlayer();
|
||||
int enchant = getEnchantLevel();
|
||||
int enchant = _enchantLevel;
|
||||
|
||||
if (player == null)
|
||||
{
|
||||
@ -1980,7 +1980,7 @@ public final class L2ItemInstance extends L2Object
|
||||
|
||||
public boolean hasPassiveSkills()
|
||||
{
|
||||
return (getItemType() == EtcItemType.ENCHT_ATTR_RUNE) && (getItemLocation() == ItemLocation.INVENTORY) && (getOwnerId() > 0) && (getItem().getSkills(ItemSkillType.NORMAL) != null);
|
||||
return (_item.getItemType() == EtcItemType.ENCHT_ATTR_RUNE) && (_loc == ItemLocation.INVENTORY) && (_ownerId > 0) && (_item.getSkills(ItemSkillType.NORMAL) != null);
|
||||
}
|
||||
|
||||
public void giveSkillsToOwner()
|
||||
@ -1993,7 +1993,7 @@ public final class L2ItemInstance extends L2Object
|
||||
final L2PcInstance player = getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
getItem().forEachSkill(ItemSkillType.NORMAL, holder ->
|
||||
_item.forEachSkill(ItemSkillType.NORMAL, holder ->
|
||||
{
|
||||
final Skill skill = holder.getSkill();
|
||||
if (skill.isPassive())
|
||||
@ -2014,7 +2014,7 @@ public final class L2ItemInstance extends L2Object
|
||||
final L2PcInstance player = getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
getItem().forEachSkill(ItemSkillType.NORMAL, holder ->
|
||||
_item.forEachSkill(ItemSkillType.NORMAL, holder ->
|
||||
{
|
||||
final Skill skill = holder.getSkill();
|
||||
if (skill.isPassive())
|
||||
@ -2228,7 +2228,15 @@ public final class L2ItemInstance extends L2Object
|
||||
iu.addModifiedItem(this);
|
||||
player.broadcastUserInfo(UserInfoType.APPAREANCE);
|
||||
player.sendInventoryUpdate(iu);
|
||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_BEEN_RESTORED_TO_ITS_PREVIOUS_APPEARANCE_AS_ITS_TEMPORARY_MODIFICATION_HAS_EXPIRED).addItemName(this));
|
||||
|
||||
if (isEnchanted())
|
||||
{
|
||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_S2_HAS_BEEN_RESTORED_TO_ITS_PREVIOUS_APPEARANCE_AS_ITS_TEMPORARY_MODIFICATION_HAS_EXPIRED).addInt(_enchantLevel).addItemName(this));
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_BEEN_RESTORED_TO_ITS_PREVIOUS_APPEARANCE_AS_ITS_TEMPORARY_MODIFICATION_HAS_EXPIRED).addItemName(this));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public final class Participant
|
||||
name = plr.getName();
|
||||
side = olympiadSide;
|
||||
baseClass = plr.getBaseClass();
|
||||
stats = Olympiad.getNobleStats(getObjectId());
|
||||
stats = Olympiad.getNobleStats(objectId);
|
||||
clanName = plr.getClan() != null ? plr.getClan().getName() : "";
|
||||
clanId = plr.getClanId();
|
||||
}
|
||||
|
@ -189,14 +189,14 @@ public class Options
|
||||
}
|
||||
if (hasActiveSkills())
|
||||
{
|
||||
for (SkillHolder holder : getActiveSkills())
|
||||
for (SkillHolder holder : _activeSkill)
|
||||
{
|
||||
addSkill(player, holder.getSkill());
|
||||
}
|
||||
}
|
||||
if (hasPassiveSkills())
|
||||
{
|
||||
for (SkillHolder holder : getPassiveSkills())
|
||||
for (SkillHolder holder : _passiveSkill)
|
||||
{
|
||||
addSkill(player, holder.getSkill());
|
||||
}
|
||||
@ -227,14 +227,14 @@ public class Options
|
||||
}
|
||||
if (hasActiveSkills())
|
||||
{
|
||||
for (SkillHolder holder : getActiveSkills())
|
||||
for (SkillHolder holder : _activeSkill)
|
||||
{
|
||||
player.removeSkill(holder.getSkill(), false, false);
|
||||
}
|
||||
}
|
||||
if (hasPassiveSkills())
|
||||
{
|
||||
for (SkillHolder holder : getPassiveSkills())
|
||||
for (SkillHolder holder : _passiveSkill)
|
||||
{
|
||||
player.removeSkill(holder.getSkill(), false, true);
|
||||
}
|
||||
|
@ -2737,7 +2737,6 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
public String showHtmlFile(L2PcInstance player, String filename, L2Npc npc)
|
||||
{
|
||||
final boolean questwindow = !filename.endsWith(".html");
|
||||
final int questId = getId();
|
||||
|
||||
// Create handler to file linked to the quest
|
||||
String content = getHtm(player, filename);
|
||||
@ -2750,9 +2749,9 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
content = content.replaceAll("%objectId%", String.valueOf(npc.getObjectId()));
|
||||
}
|
||||
|
||||
if (questwindow && (questId > 0) && (questId < 20000) && (questId != 999))
|
||||
if (questwindow && (_questId > 0) && (_questId < 20000) && (_questId != 999))
|
||||
{
|
||||
final NpcQuestHtmlMessage npcReply = new NpcQuestHtmlMessage(npc != null ? npc.getObjectId() : 0, questId);
|
||||
final NpcQuestHtmlMessage npcReply = new NpcQuestHtmlMessage(npc != null ? npc.getObjectId() : 0, _questId);
|
||||
npcReply.setHtml(content);
|
||||
npcReply.replace("%playername%", player.getName());
|
||||
player.sendPacket(npcReply);
|
||||
@ -2940,7 +2939,7 @@ public class Quest extends AbstractScript implements IIdentifiable
|
||||
{
|
||||
if (activeChar.getQuestState(getName()) != null)
|
||||
{
|
||||
final ExQuestNpcLogList packet = new ExQuestNpcLogList(getId());
|
||||
final ExQuestNpcLogList packet = new ExQuestNpcLogList(_questId);
|
||||
getNpcLogList(activeChar).forEach(packet::add);
|
||||
activeChar.sendPacket(packet);
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ public final class QuestState
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, _player.getName() + ", " + getQuestName() + " cond [" + val + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, _player.getName() + ", " + _questName + " cond [" + val + "] is not an integer. Value stored, but no packet was sent: " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -449,7 +449,7 @@ public final class QuestState
|
||||
}
|
||||
catch (NumberFormatException nfe)
|
||||
{
|
||||
LOGGER.log(Level.INFO, "Quest " + getQuestName() + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
|
||||
LOGGER.log(Level.INFO, "Quest " + _questName + ", method getInt(" + var + "), tried to parse a non-integer value (" + variable + "). Char Id: " + _player.getObjectId(), nfe);
|
||||
}
|
||||
|
||||
return varint;
|
||||
@ -755,7 +755,7 @@ public final class QuestState
|
||||
Quest.deleteQuestInDb(this, repeatable);
|
||||
if (repeatable)
|
||||
{
|
||||
_player.delQuestState(getQuestName());
|
||||
_player.delQuestState(_questName);
|
||||
_player.sendPacket(new QuestList(_player));
|
||||
}
|
||||
else
|
||||
|
@ -33,18 +33,18 @@ public class QuestTimer
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (!getIsActive())
|
||||
if (!_isActive)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (!getIsRepeating())
|
||||
if (!_isRepeating)
|
||||
{
|
||||
cancelAndRemove();
|
||||
}
|
||||
getQuest().notifyEvent(getName(), getNpc(), getPlayer());
|
||||
_quest.notifyEvent(_name, _npc, _player);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@ -53,13 +53,13 @@ public class QuestTimer
|
||||
}
|
||||
}
|
||||
|
||||
private boolean _isActive = true;
|
||||
private final String _name;
|
||||
private final Quest _quest;
|
||||
private final L2Npc _npc;
|
||||
private final L2PcInstance _player;
|
||||
private final boolean _isRepeating;
|
||||
private final ScheduledFuture<?> _schedular;
|
||||
boolean _isActive = true;
|
||||
final String _name;
|
||||
final Quest _quest;
|
||||
final L2Npc _npc;
|
||||
final L2PcInstance _player;
|
||||
final boolean _isRepeating;
|
||||
private final ScheduledFuture<?> _scheduler;
|
||||
|
||||
public QuestTimer(Quest quest, String name, long time, L2Npc npc, L2PcInstance player, boolean repeating)
|
||||
{
|
||||
@ -68,7 +68,7 @@ public class QuestTimer
|
||||
_player = player;
|
||||
_npc = npc;
|
||||
_isRepeating = repeating;
|
||||
_schedular = repeating ? ThreadPool.scheduleAtFixedRate(new ScheduleTimerTask(), time, time) : ThreadPool.schedule(new ScheduleTimerTask(), time);
|
||||
_scheduler = repeating ? ThreadPool.scheduleAtFixedRate(new ScheduleTimerTask(), time, time) : ThreadPool.schedule(new ScheduleTimerTask(), time);
|
||||
}
|
||||
|
||||
public QuestTimer(Quest quest, String name, long time, L2Npc npc, L2PcInstance player)
|
||||
@ -87,9 +87,9 @@ public class QuestTimer
|
||||
public void cancel()
|
||||
{
|
||||
_isActive = false;
|
||||
if (_schedular != null)
|
||||
if (_scheduler != null)
|
||||
{
|
||||
_schedular.cancel(false);
|
||||
_scheduler.cancel(false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ public class QuestTimer
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ((quest != _quest) || !name.equalsIgnoreCase(getName()))
|
||||
if ((quest != _quest) || !name.equalsIgnoreCase(_name))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM residence_functions WHERE residenceId = ?"))
|
||||
{
|
||||
ps.setInt(1, getResidenceId());
|
||||
ps.setInt(1, _residenceId);
|
||||
try (ResultSet rs = ps.executeQuery())
|
||||
{
|
||||
while (rs.next())
|
||||
@ -152,7 +152,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Failed to initialize functions for residence: " + getResidenceId(), e);
|
||||
LOGGER.log(Level.WARNING, "Failed to initialize functions for residence: " + _residenceId, e);
|
||||
}
|
||||
}
|
||||
|
||||
@ -173,7 +173,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
|
||||
ps.setInt(1, func.getId());
|
||||
ps.setInt(2, func.getLevel());
|
||||
ps.setLong(3, func.getExpiration());
|
||||
ps.setInt(4, getResidenceId());
|
||||
ps.setInt(4, _residenceId);
|
||||
|
||||
ps.setInt(5, func.getLevel());
|
||||
ps.setLong(6, func.getExpiration());
|
||||
@ -181,7 +181,7 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Failed to add function: " + func.getId() + " for residence: " + getResidenceId(), e);
|
||||
LOGGER.log(Level.WARNING, "Failed to add function: " + func.getId() + " for residence: " + _residenceId, e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -202,13 +202,13 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM residence_functions WHERE residenceId = ? and id = ?"))
|
||||
{
|
||||
ps.setInt(1, getResidenceId());
|
||||
ps.setInt(1, _residenceId);
|
||||
ps.setInt(2, func.getId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Failed to remove function: " + func.getId() + " residence: " + getResidenceId(), e);
|
||||
LOGGER.log(Level.WARNING, "Failed to remove function: " + func.getId() + " residence: " + _residenceId, e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -225,12 +225,12 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM residence_functions WHERE residenceId = ?"))
|
||||
{
|
||||
ps.setInt(1, getResidenceId());
|
||||
ps.setInt(1, _residenceId);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Failed to remove functions for residence: " + getResidenceId(), e);
|
||||
LOGGER.log(Level.WARNING, "Failed to remove functions for residence: " + _residenceId, e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
@ -313,6 +313,6 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getName() + " (" + getResidenceId() + ")";
|
||||
return _name + " (" + _residenceId + ")";
|
||||
}
|
||||
}
|
||||
|
@ -333,7 +333,7 @@ public final class BuffInfo
|
||||
}
|
||||
|
||||
// Call on start.
|
||||
effect.onStart(getEffector(), getEffected(), getSkill());
|
||||
effect.onStart(_effector, _effected, _skill);
|
||||
|
||||
// If it's a continuous effect, if has ticks schedule a task with period, otherwise schedule a simple task to end it.
|
||||
if (effect.getTicks() > 0)
|
||||
@ -360,7 +360,7 @@ public final class BuffInfo
|
||||
if (_isInUse)
|
||||
{
|
||||
// Callback for on action time event.
|
||||
continueForever = effect.onActionTime(getEffector(), getEffected(), getSkill());
|
||||
continueForever = effect.onActionTime(_effector, _effected, _skill);
|
||||
}
|
||||
|
||||
if (!continueForever && _skill.isToggle())
|
||||
@ -369,7 +369,7 @@ public final class BuffInfo
|
||||
if (task != null)
|
||||
{
|
||||
task.getScheduledFuture().cancel(true); // Don't allow to finish current run.
|
||||
_effected.getEffectList().stopSkillEffects(true, getSkill()); // Remove the buff from the effect list.
|
||||
_effected.getEffectList().stopSkillEffects(true, _skill); // Remove the buff from the effect list.
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -391,7 +391,7 @@ public final class BuffInfo
|
||||
// Instant effects shouldn't call onExit(..).
|
||||
if (!effect.isInstant())
|
||||
{
|
||||
effect.onExit(getEffector(), getEffected(), getSkill());
|
||||
effect.onExit(_effector, _effected, _skill);
|
||||
}
|
||||
}
|
||||
|
||||
@ -403,7 +403,7 @@ public final class BuffInfo
|
||||
{
|
||||
smId = SystemMessageId.S1_HAS_BEEN_ABORTED;
|
||||
}
|
||||
else if (isRemoved())
|
||||
else if (_isRemoved)
|
||||
{
|
||||
smId = SystemMessageId.THE_EFFECT_OF_S1_HAS_BEEN_REMOVED;
|
||||
}
|
||||
|
@ -240,15 +240,15 @@ public final class Skill implements IIdentifiable
|
||||
_subordinationAbnormalType = set.getEnum("subordinationAbnormalType", AbnormalType.class, AbnormalType.NONE);
|
||||
|
||||
int abnormalTime = set.getInt("abnormalTime", 0);
|
||||
if (Config.ENABLE_MODIFY_SKILL_DURATION && Config.SKILL_DURATION_LIST.containsKey(getId()))
|
||||
if (Config.ENABLE_MODIFY_SKILL_DURATION && Config.SKILL_DURATION_LIST.containsKey(_id))
|
||||
{
|
||||
if ((getLevel() < 100) || (getLevel() > 140))
|
||||
if ((_level < 100) || (_level > 140))
|
||||
{
|
||||
abnormalTime = Config.SKILL_DURATION_LIST.get(getId());
|
||||
abnormalTime = Config.SKILL_DURATION_LIST.get(_id);
|
||||
}
|
||||
else if ((getLevel() >= 100) && (getLevel() < 140))
|
||||
else if ((_level >= 100) && (_level < 140))
|
||||
{
|
||||
abnormalTime += Config.SKILL_DURATION_LIST.get(getId());
|
||||
abnormalTime += Config.SKILL_DURATION_LIST.get(_id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -441,7 +441,7 @@ public final class Skill implements IIdentifiable
|
||||
}
|
||||
|
||||
_magicCriticalRate = set.getDouble("magicCriticalRate", 0);
|
||||
_buffType = isTriggeredSkill() ? SkillBuffType.TRIGGER : isToggle() ? SkillBuffType.TOGGLE : isDance() ? SkillBuffType.DANCE : isDebuff() ? SkillBuffType.DEBUFF : !isHealingPotionSkill() ? SkillBuffType.BUFF : SkillBuffType.NONE;
|
||||
_buffType = _isTriggeredSkill ? SkillBuffType.TRIGGER : isToggle() ? SkillBuffType.TOGGLE : isDance() ? SkillBuffType.DANCE : _isDebuff ? SkillBuffType.DEBUFF : !isHealingPotionSkill() ? SkillBuffType.BUFF : SkillBuffType.NONE;
|
||||
_displayInList = set.getBoolean("displayInList", true);
|
||||
}
|
||||
|
||||
@ -1054,7 +1054,7 @@ public final class Skill implements IIdentifiable
|
||||
*/
|
||||
public boolean isHealingPotionSkill()
|
||||
{
|
||||
return getAbnormalType() == AbnormalType.HP_RECOVER;
|
||||
return _abnormalType == AbnormalType.HP_RECOVER;
|
||||
}
|
||||
|
||||
public int getMaxSoulConsumeCount()
|
||||
@ -1064,7 +1064,7 @@ public final class Skill implements IIdentifiable
|
||||
|
||||
public boolean isStayAfterDeath()
|
||||
{
|
||||
return _stayAfterDeath || isIrreplacableBuff() || isNecessaryToggle();
|
||||
return _stayAfterDeath || _irreplacableBuff || _isNecessaryToggle;
|
||||
}
|
||||
|
||||
public boolean isBad()
|
||||
@ -1333,7 +1333,7 @@ public final class Skill implements IIdentifiable
|
||||
return;
|
||||
}
|
||||
|
||||
if (effected.isIgnoringSkillEffects(getId(), getLevel()))
|
||||
if (effected.isIgnoringSkillEffects(_id, _level))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -1357,7 +1357,7 @@ public final class Skill implements IIdentifiable
|
||||
if (addContinuousEffects)
|
||||
{
|
||||
// Aura skills reset the abnormal time.
|
||||
final BuffInfo existingInfo = _operateType.isAura() ? effected.getEffectList().getBuffInfoBySkillId(getId()) : null;
|
||||
final BuffInfo existingInfo = _operateType.isAura() ? effected.getEffectList().getBuffInfoBySkillId(_id) : null;
|
||||
if (existingInfo != null)
|
||||
{
|
||||
existingInfo.resetAbnormalTime(info.getAbnormalTime());
|
||||
@ -1368,19 +1368,19 @@ public final class Skill implements IIdentifiable
|
||||
}
|
||||
|
||||
// Check for mesmerizing debuffs and increase resist level.
|
||||
if (isDebuff() && (getBasicProperty() != BasicProperty.NONE) && effected.hasBasicPropertyResist())
|
||||
if (_isDebuff && (_basicProperty != BasicProperty.NONE) && effected.hasBasicPropertyResist())
|
||||
{
|
||||
final BasicPropertyResist resist = effected.getBasicPropertyResist(getBasicProperty());
|
||||
final BasicPropertyResist resist = effected.getBasicPropertyResist(_basicProperty);
|
||||
resist.increaseResistLevel();
|
||||
}
|
||||
}
|
||||
|
||||
// Support for buff sharing feature including healing herbs.
|
||||
if (isSharedWithSummon() && effected.isPlayer() && effected.hasServitors() && !isTransformation())
|
||||
if (_isSharedWithSummon && effected.isPlayer() && effected.hasServitors() && !isTransformation())
|
||||
{
|
||||
if ((addContinuousEffects && isContinuous() && !isDebuff()) || isRecoveryHerb())
|
||||
if ((addContinuousEffects && isContinuous() && !_isDebuff) || _isRecoveryHerb)
|
||||
{
|
||||
effected.getServitors().values().forEach(s -> applyEffects(effector, s, isRecoveryHerb(), 0));
|
||||
effected.getServitors().values().forEach(s -> applyEffects(effector, s, _isRecoveryHerb, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1400,7 +1400,7 @@ public final class Skill implements IIdentifiable
|
||||
if (addContinuousEffects)
|
||||
{
|
||||
// Aura skills reset the abnormal time.
|
||||
final BuffInfo existingInfo = _operateType.isAura() ? effector.getEffectList().getBuffInfoBySkillId(getId()) : null;
|
||||
final BuffInfo existingInfo = _operateType.isAura() ? effector.getEffectList().getBuffInfoBySkillId(_id) : null;
|
||||
if (existingInfo != null)
|
||||
{
|
||||
existingInfo.resetAbnormalTime(info.getAbnormalTime());
|
||||
@ -1413,7 +1413,7 @@ public final class Skill implements IIdentifiable
|
||||
|
||||
// Support for buff sharing feature.
|
||||
// Avoiding Servitor Share since it's implementation already "shares" the effect.
|
||||
if (addContinuousEffects && isSharedWithSummon() && info.getEffected().isPlayer() && isContinuous() && !isDebuff() && info.getEffected().hasServitors())
|
||||
if (addContinuousEffects && _isSharedWithSummon && info.getEffected().isPlayer() && isContinuous() && !_isDebuff && info.getEffected().hasServitors())
|
||||
{
|
||||
info.getEffected().getServitors().values().forEach(s -> applyEffects(effector, s, false, 0));
|
||||
}
|
||||
@ -1498,9 +1498,9 @@ public final class Skill implements IIdentifiable
|
||||
// Self Effect
|
||||
if (hasEffects(EffectScope.SELF))
|
||||
{
|
||||
if (caster.isAffectedBySkill(getId()))
|
||||
if (caster.isAffectedBySkill(_id))
|
||||
{
|
||||
caster.stopSkillEffects(true, getId());
|
||||
caster.stopSkillEffects(true, _id);
|
||||
}
|
||||
applyEffects(caster, caster, true, false, true, 0, item);
|
||||
}
|
||||
@ -1517,7 +1517,7 @@ public final class Skill implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
if (isSuicideAttack())
|
||||
if (_isSuicideAttack)
|
||||
{
|
||||
caster.doDie(caster);
|
||||
}
|
||||
@ -1571,7 +1571,7 @@ public final class Skill implements IIdentifiable
|
||||
*/
|
||||
public boolean canBeStolen()
|
||||
{
|
||||
return !isPassive() && !isToggle() && !isDebuff() && !isIrreplacableBuff() && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && canBeDispelled();
|
||||
return !isPassive() && !isToggle() && !_isDebuff && !_irreplacableBuff && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && _canBeDispelled;
|
||||
}
|
||||
|
||||
public boolean isClanSkill()
|
||||
@ -1733,20 +1733,20 @@ public final class Skill implements IIdentifiable
|
||||
public Skill getAttachedSkill(L2Character activeChar)
|
||||
{
|
||||
// If character is double casting, return double cast skill.
|
||||
if ((getDoubleCastSkill() > 0) && activeChar.isAffected(EffectFlag.DOUBLE_CAST))
|
||||
if ((_doubleCastSkill > 0) && activeChar.isAffected(EffectFlag.DOUBLE_CAST))
|
||||
{
|
||||
return SkillData.getInstance().getSkill(getDoubleCastSkill(), getLevel(), getSubLevel());
|
||||
}
|
||||
|
||||
// Default toggle group ID, assume nothing attached.
|
||||
if ((getAttachToggleGroupId() <= 0) || (getAttachSkills() == null))
|
||||
if ((_attachToggleGroupId <= 0) || (_attachSkills == null))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
//@formatter:off
|
||||
final int toggleSkillId = activeChar.getEffectList().getEffects().stream()
|
||||
.filter(info -> info.getSkill().getToggleGroupId() == getAttachToggleGroupId())
|
||||
.filter(info -> info.getSkill().getToggleGroupId() == _attachToggleGroupId)
|
||||
.mapToInt(info -> info.getSkill().getId())
|
||||
.findAny().orElse(0);
|
||||
//@formatter:on
|
||||
@ -1757,7 +1757,7 @@ public final class Skill implements IIdentifiable
|
||||
return null;
|
||||
}
|
||||
|
||||
final AttachSkillHolder attachedSkill = getAttachSkills().stream().filter(ash -> ash.getRequiredSkillId() == toggleSkillId).findAny().orElse(null);
|
||||
final AttachSkillHolder attachedSkill = _attachSkills.stream().filter(ash -> ash.getRequiredSkillId() == toggleSkillId).findAny().orElse(null);
|
||||
|
||||
// No attached skills for this toggle found.
|
||||
if (attachedSkill == null)
|
||||
|
@ -99,7 +99,7 @@ public class SkillChannelizer implements Runnable
|
||||
{
|
||||
for (L2Character chars : _channelized)
|
||||
{
|
||||
chars.getSkillChannelized().removeChannelizer(_skill.getChannelingSkillId(), getChannelizer());
|
||||
chars.getSkillChannelized().removeChannelizer(_skill.getChannelingSkillId(), _channelizer);
|
||||
}
|
||||
_channelized = null;
|
||||
}
|
||||
@ -160,7 +160,7 @@ public class SkillChannelizer implements Runnable
|
||||
if (o.isCharacter())
|
||||
{
|
||||
targetList.add((L2Character) o);
|
||||
((L2Character) o).getSkillChannelized().addChannelizer(skill.getChannelingSkillId(), getChannelizer());
|
||||
((L2Character) o).getSkillChannelized().addChannelizer(skill.getChannelingSkillId(), _channelizer);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -198,13 +198,13 @@ public class SkillChannelizer implements Runnable
|
||||
}
|
||||
|
||||
// Update PvP status
|
||||
if (character.isPlayable() && getChannelizer().isPlayer())
|
||||
if (character.isPlayable() && _channelizer.isPlayer())
|
||||
{
|
||||
((L2PcInstance) getChannelizer()).updatePvPStatus(character);
|
||||
((L2PcInstance) _channelizer).updatePvPStatus(character);
|
||||
}
|
||||
|
||||
// Be warned, this method has the possibility to call doDie->abortCast->stopChanneling method. Variable cache above try"+ +" is used in this case to avoid NPEs.
|
||||
channeledSkill.applyEffects(getChannelizer(), character);
|
||||
channeledSkill.applyEffects(_channelizer, character);
|
||||
|
||||
// Reduce shots.
|
||||
if (skill.useSpiritShot())
|
||||
|
@ -145,7 +145,7 @@ public final class TeleportHolder
|
||||
// Build html
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
final StringBuilder sb_f = new StringBuilder();
|
||||
for (TeleportLocation loc : getLocations())
|
||||
for (TeleportLocation loc : _teleportData)
|
||||
{
|
||||
String finalName = loc.getName();
|
||||
String confirmDesc = loc.getName();
|
||||
|
@ -191,7 +191,7 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.info(getClass().getSimpleName() + ": Unknown parameter - " + name + " in zone: " + getId());
|
||||
LOGGER.info(getClass().getSimpleName() + ": Unknown parameter - " + name + " in zone: " + _id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -205,7 +205,7 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
final Instance world = character.getInstanceWorld();
|
||||
if (world != null)
|
||||
{
|
||||
if (world.getTemplateId() != getInstanceTemplateId())
|
||||
if (world.getTemplateId() != _instanceTemplateId)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -214,7 +214,7 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else if (getInstanceTemplateId() > 0)
|
||||
else if (_instanceTemplateId > 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -402,12 +402,12 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
|
||||
public double getDistanceToZone(int x, int y)
|
||||
{
|
||||
return getZone().getDistanceToZone(x, y);
|
||||
return _zone.getDistanceToZone(x, y);
|
||||
}
|
||||
|
||||
public double getDistanceToZone(L2Object object)
|
||||
{
|
||||
return getZone().getDistanceToZone(object.getX(), object.getY());
|
||||
return _zone.getDistanceToZone(object.getX(), object.getY());
|
||||
}
|
||||
|
||||
public void revalidateInZone(L2Character character)
|
||||
@ -572,7 +572,7 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
|
||||
public void visualizeZone(int z)
|
||||
{
|
||||
getZone().visualizeZone(z);
|
||||
_zone.visualizeZone(z);
|
||||
}
|
||||
|
||||
public void setEnabled(boolean state)
|
||||
@ -605,10 +605,10 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
{
|
||||
if (_enabledInInstance != null)
|
||||
{
|
||||
return _enabledInInstance.getOrDefault(instanceId, isEnabled());
|
||||
return _enabledInInstance.getOrDefault(instanceId, _enabled);
|
||||
}
|
||||
|
||||
return isEnabled();
|
||||
return _enabled;
|
||||
}
|
||||
|
||||
public void oustAllPlayers()
|
||||
@ -633,7 +633,7 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
return;
|
||||
}
|
||||
|
||||
for (L2Character character : getCharactersInside())
|
||||
for (L2Character character : _characterList.values())
|
||||
{
|
||||
if ((character != null) && character.isPlayer())
|
||||
{
|
||||
|
@ -63,7 +63,7 @@ public class ZoneRegion
|
||||
return;
|
||||
}
|
||||
|
||||
for (L2ZoneType z : getZones().values())
|
||||
for (L2ZoneType z : _zones.values())
|
||||
{
|
||||
z.revalidateInZone(character);
|
||||
}
|
||||
@ -71,7 +71,7 @@ public class ZoneRegion
|
||||
|
||||
public void removeFromZones(L2Character character)
|
||||
{
|
||||
for (L2ZoneType z : getZones().values())
|
||||
for (L2ZoneType z : _zones.values())
|
||||
{
|
||||
z.removeCharacter(character);
|
||||
}
|
||||
@ -85,7 +85,7 @@ public class ZoneRegion
|
||||
final int left = x + range;
|
||||
final int right = x - range;
|
||||
|
||||
for (L2ZoneType e : getZones().values())
|
||||
for (L2ZoneType e : _zones.values())
|
||||
{
|
||||
if (e instanceof L2PeaceZone)
|
||||
{
|
||||
@ -120,7 +120,7 @@ public class ZoneRegion
|
||||
|
||||
public void onDeath(L2Character character)
|
||||
{
|
||||
for (L2ZoneType z : getZones().values())
|
||||
for (L2ZoneType z : _zones.values())
|
||||
{
|
||||
if (z.isInsideZone(character))
|
||||
{
|
||||
@ -131,7 +131,7 @@ public class ZoneRegion
|
||||
|
||||
public void onRevive(L2Character character)
|
||||
{
|
||||
for (L2ZoneType z : getZones().values())
|
||||
for (L2ZoneType z : _zones.values())
|
||||
{
|
||||
if (z.isInsideZone(character))
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ import com.l2jmobius.gameserver.network.serverpackets.EtcStatusUpdate;
|
||||
*/
|
||||
public final class L2EffectZone extends L2ZoneType
|
||||
{
|
||||
private int _chance;
|
||||
int _chance;
|
||||
private int _initialDelay;
|
||||
private int _reuse;
|
||||
protected boolean _bypassConditions;
|
||||
@ -257,7 +257,7 @@ public final class L2EffectZone extends L2ZoneType
|
||||
{
|
||||
getCharactersInside().forEach(character ->
|
||||
{
|
||||
if ((character != null) && !character.isDead() && (Rnd.get(100) < getChance()))
|
||||
if ((character != null) && !character.isDead() && (Rnd.get(100) < _chance))
|
||||
{
|
||||
for (Entry<Integer, Integer> e : _skills.entrySet())
|
||||
{
|
||||
|
@ -99,7 +99,7 @@ public class L2NoRestartZone extends L2ZoneType
|
||||
return;
|
||||
}
|
||||
|
||||
if (((System.currentTimeMillis() - player.getLastAccess()) > getRestartTime()) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > getRestartAllowedTime()))
|
||||
if (((System.currentTimeMillis() - player.getLastAccess()) > _restartTime) && ((System.currentTimeMillis() - GameServer.dateTimeServerStarted.getTimeInMillis()) > _restartAllowedTime))
|
||||
{
|
||||
player.teleToLocation(TeleportWhereType.TOWN);
|
||||
}
|
||||
|
@ -252,7 +252,7 @@ public final class L2GameClient extends ChannelInboundHandler<L2GameClient>
|
||||
_channel.writeAndFlush(packet);
|
||||
|
||||
// Run packet implementation.
|
||||
packet.runImpl(getActiveChar());
|
||||
packet.runImpl(_activeChar);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -533,7 +533,7 @@ public final class L2GameClient extends ChannelInboundHandler<L2GameClient>
|
||||
// exploit prevention, should not happens in normal way
|
||||
if (player.isOnlineInt() == 1)
|
||||
{
|
||||
LOGGER.severe("Attempt of double login: " + player.getName() + "(" + objectId + ") " + getAccountName());
|
||||
LOGGER.severe("Attempt of double login: " + player.getName() + "(" + objectId + ") " + _accountName);
|
||||
}
|
||||
Disconnection.of(player).defaultSequence(false);
|
||||
return null;
|
||||
@ -603,11 +603,11 @@ public final class L2GameClient extends ChannelInboundHandler<L2GameClient>
|
||||
}
|
||||
case AUTHENTICATED:
|
||||
{
|
||||
return "[Account: " + getAccountName() + " - IP: " + (address == null ? "disconnected" : address.getHostAddress()) + "]";
|
||||
return "[Account: " + _accountName + " - IP: " + (address == null ? "disconnected" : address.getHostAddress()) + "]";
|
||||
}
|
||||
case IN_GAME:
|
||||
{
|
||||
return "[Character: " + (getActiveChar() == null ? "disconnected" : getActiveChar().getName() + "[" + getActiveChar().getObjectId() + "]") + " - Account: " + getAccountName() + " - IP: " + (address == null ? "disconnected" : address.getHostAddress()) + "]";
|
||||
return "[Character: " + (_activeChar == null ? "disconnected" : _activeChar.getName() + "[" + _activeChar.getObjectId() + "]") + " - Account: " + _accountName + " - IP: " + (address == null ? "disconnected" : address.getHostAddress()) + "]";
|
||||
}
|
||||
default:
|
||||
{
|
||||
|
@ -56,7 +56,7 @@ public final class RequestRecipeItemMakeSelf implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (activeChar.isInCraftMode())
|
||||
if (activeChar.isCrafting())
|
||||
{
|
||||
activeChar.sendMessage("You are currently in Craft Mode.");
|
||||
return;
|
||||
|
@ -79,7 +79,7 @@ public final class RequestRecipeShopMakeItem implements IClientIncomingPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (activeChar.isInCraftMode() || manufacturer.isInCraftMode())
|
||||
if (activeChar.isCrafting() || manufacturer.isCrafting())
|
||||
{
|
||||
activeChar.sendMessage("You are currently in Craft Mode.");
|
||||
return;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user