Direct use of private constants instead of getters.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public class RecipeController
|
||||
_skillLevel = _player.getSkillLevel(_skillId);
|
||||
_skill = _player.getKnownSkill(_skillId);
|
||||
|
||||
_player.isInCraftMode(true);
|
||||
_player.setIsCrafting(true);
|
||||
|
||||
if (_player.isAlikeDead())
|
||||
{
|
||||
@@ -290,7 +290,7 @@ public class RecipeController
|
||||
updateCurMp();
|
||||
updateCurLoad();
|
||||
|
||||
_player.isInCraftMode(false);
|
||||
_player.setIsCrafting(false);
|
||||
_isValid = true;
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ public class RecipeController
|
||||
updateCurMp();
|
||||
updateCurLoad();
|
||||
_activeMakers.remove(_player.getObjectId());
|
||||
_player.isInCraftMode(false);
|
||||
_player.setIsCrafting(false);
|
||||
_target.sendPacket(new ItemList(_target, false));
|
||||
}
|
||||
|
||||
@@ -641,7 +641,7 @@ public class RecipeController
|
||||
private void abort()
|
||||
{
|
||||
updateMakeInfo(false);
|
||||
_player.isInCraftMode(false);
|
||||
_player.setIsCrafting(false);
|
||||
_activeMakers.remove(_player.getObjectId());
|
||||
}
|
||||
|
||||
|
||||
@@ -204,7 +204,7 @@ public class SevenSigns
|
||||
private boolean isNextPeriodChangeInPast()
|
||||
{
|
||||
final Calendar lastPeriodChange = Calendar.getInstance();
|
||||
switch (getCurrentPeriod())
|
||||
switch (_activePeriod)
|
||||
{
|
||||
case PERIOD_SEAL_VALIDATION:
|
||||
case PERIOD_COMPETITION:
|
||||
@@ -516,7 +516,7 @@ public class SevenSigns
|
||||
{
|
||||
// Calculate the number of days until the next period
|
||||
// A period starts at 18:00 pm (local time), like on official servers.
|
||||
switch (getCurrentPeriod())
|
||||
switch (_activePeriod)
|
||||
{
|
||||
case PERIOD_SEAL_VALIDATION:
|
||||
case PERIOD_COMPETITION:
|
||||
@@ -620,7 +620,7 @@ public class SevenSigns
|
||||
tillDate += ((2 * PERIOD_MAJOR_LENGTH) + (2 * PERIOD_MINOR_LENGTH));
|
||||
}
|
||||
|
||||
switch (getCurrentPeriod())
|
||||
switch (_activePeriod)
|
||||
{
|
||||
case PERIOD_COMP_RECRUITING:
|
||||
{
|
||||
@@ -1208,7 +1208,7 @@ public class SevenSigns
|
||||
{
|
||||
SystemMessage sm = null;
|
||||
|
||||
switch (getCurrentPeriod())
|
||||
switch (_activePeriod)
|
||||
{
|
||||
case PERIOD_COMP_RECRUITING:
|
||||
{
|
||||
@@ -1531,7 +1531,7 @@ public class SevenSigns
|
||||
public void run()
|
||||
{
|
||||
// Remember the period check here refers to the period just ENDED!
|
||||
final int periodEnded = getCurrentPeriod();
|
||||
final int periodEnded = _activePeriod;
|
||||
_activePeriod++;
|
||||
|
||||
switch (periodEnded)
|
||||
|
||||
@@ -2017,7 +2017,7 @@ public class SevenSignsFestival implements SpawnListener
|
||||
*/
|
||||
public final L2DarknessFestival getFestivalInstance(int oracle, int festivalId)
|
||||
{
|
||||
if (!isFestivalInitialized())
|
||||
if (!_festivalInitialized)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -740,7 +740,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!isAutoAttacking())
|
||||
if (!_clientAutoAttacking)
|
||||
{
|
||||
if (_actor.isPlayer() && _actor.hasSummon())
|
||||
{
|
||||
@@ -775,7 +775,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);
|
||||
@@ -809,7 +809,7 @@ public abstract class AbstractAI implements Ctrl
|
||||
*/
|
||||
public void describeStateToPlayer(L2PcInstance player)
|
||||
{
|
||||
if (getActor().isVisibleFor(player) && _clientMoving)
|
||||
if (_actor.isVisibleFor(player) && _clientMoving)
|
||||
{
|
||||
if ((_clientMovingToPawnOffset != 0) && (_followTarget != null))
|
||||
{
|
||||
|
||||
+5
-5
@@ -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:
|
||||
{
|
||||
@@ -170,7 +170,7 @@ public final class L2ControllableMobAI extends L2AttackableAI
|
||||
max_range = Math.max(max_range, sk.getCastRange());
|
||||
}
|
||||
|
||||
if (!isNotMoving())
|
||||
if (!_isNotMoving)
|
||||
{
|
||||
moveToPawn(getAttackTarget(), max_range);
|
||||
}
|
||||
@@ -217,7 +217,7 @@ public final class L2ControllableMobAI extends L2AttackableAI
|
||||
max_range = Math.max(max_range, castRange);
|
||||
}
|
||||
|
||||
if (!isNotMoving())
|
||||
if (!_isNotMoving)
|
||||
{
|
||||
moveToPawn(target, range);
|
||||
}
|
||||
@@ -257,7 +257,7 @@ public final class L2ControllableMobAI extends L2AttackableAI
|
||||
max_range = Math.max(max_range, castRange);
|
||||
}
|
||||
|
||||
if (!isNotMoving())
|
||||
if (!_isNotMoving)
|
||||
{
|
||||
moveToPawn(getForcedTarget(), _actor.getPhysicalAttackRange()/* range */);
|
||||
}
|
||||
|
||||
+1
-1
@@ -61,7 +61,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();
|
||||
}
|
||||
|
||||
+2
-2
@@ -135,7 +135,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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -355,7 +355,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))
|
||||
{
|
||||
|
||||
+1
-1
@@ -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());
|
||||
|
||||
+1
-1
@@ -255,7 +255,7 @@ public class RecipeData implements IGameXmlReader
|
||||
if ((recipeList == null) || (recipeList.getRecipes().length == 0))
|
||||
{
|
||||
player.sendMessage(getClass().getSimpleName() + ": No recipe for: " + id);
|
||||
player.isInCraftMode(false);
|
||||
player.setIsCrafting(false);
|
||||
return null;
|
||||
}
|
||||
return recipeList;
|
||||
|
||||
+3
-3
@@ -257,17 +257,17 @@ public class MerchantPriceConfigTable implements InstanceListManager
|
||||
|
||||
public boolean hasCastle()
|
||||
{
|
||||
return getCastle() != null;
|
||||
return _castle != null;
|
||||
}
|
||||
|
||||
public double getCastleTaxRate()
|
||||
{
|
||||
return hasCastle() ? getCastle().getTaxRate() : 0.0;
|
||||
return hasCastle() ? _castle.getTaxRate() : 0.0;
|
||||
}
|
||||
|
||||
public int getTotalTax()
|
||||
{
|
||||
return hasCastle() ? (getCastle().getTaxPercent() + getBaseTax()) : getBaseTax();
|
||||
return hasCastle() ? (_castle.getTaxPercent() + _baseTax) : _baseTax;
|
||||
}
|
||||
|
||||
public double getTotalTaxRate()
|
||||
|
||||
+1
-1
@@ -137,7 +137,7 @@ public class BitSetIDFactory extends IdFactory
|
||||
*/
|
||||
protected synchronized int usedIdCount()
|
||||
{
|
||||
return size() - FIRST_OID;
|
||||
return _freeIdCount.get() - FIRST_OID;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-3
@@ -91,7 +91,7 @@ public final class CHSiegeManager
|
||||
|
||||
public SiegableHall getSiegableHall(int clanHall)
|
||||
{
|
||||
return getConquerableHalls().get(clanHall);
|
||||
return _siegableHalls.get(clanHall);
|
||||
}
|
||||
|
||||
public final SiegableHall getNearbyClanHall(L2Character activeChar)
|
||||
@@ -173,7 +173,7 @@ public final class CHSiegeManager
|
||||
|
||||
public final boolean isClanParticipating(L2Clan clan)
|
||||
{
|
||||
for (SiegableHall hall : getConquerableHalls().values())
|
||||
for (SiegableHall hall : _siegableHalls.values())
|
||||
{
|
||||
if ((hall.getSiege() != null) && hall.getSiege().checkIsAttacker(clan))
|
||||
{
|
||||
@@ -185,7 +185,7 @@ public final class CHSiegeManager
|
||||
|
||||
public final void onServerShutDown()
|
||||
{
|
||||
for (SiegableHall hall : getConquerableHalls().values())
|
||||
for (SiegableHall hall : _siegableHalls.values())
|
||||
{
|
||||
// Rainbow springs has his own attackers table
|
||||
if ((hall.getId() == 62) || (hall.getSiege() == null))
|
||||
|
||||
+2
-2
@@ -99,8 +99,8 @@ public final class ClanHallManager
|
||||
ClanHallAuctionManager.getInstance().initNPC(id);
|
||||
}
|
||||
}
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + getClanHalls().size() + " clan halls");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + getFreeClanHalls().size() + " free clan halls");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + _clanHall.size() + " clan halls");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + _freeClanHall.size() + " free clan halls");
|
||||
_loaded = true;
|
||||
}
|
||||
catch (Exception e)
|
||||
|
||||
+7
-7
@@ -57,9 +57,9 @@ public final class CoupleManager
|
||||
{
|
||||
while (rs.next())
|
||||
{
|
||||
getCouples().add(new Couple(rs.getInt("id")));
|
||||
_couples.add(new Couple(rs.getInt("id")));
|
||||
}
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + getCouples().size() + " couples(s)");
|
||||
LOGGER.info(getClass().getSimpleName() + ": Loaded: " + _couples.size() + " couples(s)");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -70,7 +70,7 @@ public final class CoupleManager
|
||||
public final Couple getCouple(int coupleId)
|
||||
{
|
||||
final int index = getCoupleIndex(coupleId);
|
||||
return index >= 0 ? getCouples().get(index) : null;
|
||||
return index >= 0 ? _couples.get(index) : null;
|
||||
}
|
||||
|
||||
public void createCouple(L2PcInstance player1, L2PcInstance player2)
|
||||
@@ -84,7 +84,7 @@ public final class CoupleManager
|
||||
final int player2id = player2.getObjectId();
|
||||
|
||||
final Couple couple = new Couple(player1, player2);
|
||||
getCouples().add(couple);
|
||||
_couples.add(couple);
|
||||
player1.setPartnerId(player2id);
|
||||
player2.setPartnerId(player1id);
|
||||
player1.setCoupleId(couple.getId());
|
||||
@@ -94,7 +94,7 @@ public final class CoupleManager
|
||||
public void deleteCouple(int coupleId)
|
||||
{
|
||||
final int index = getCoupleIndex(coupleId);
|
||||
final Couple couple = getCouples().get(index);
|
||||
final Couple couple = _couples.get(index);
|
||||
if (couple == null)
|
||||
{
|
||||
return;
|
||||
@@ -114,13 +114,13 @@ public final class CoupleManager
|
||||
player2.setCoupleId(0);
|
||||
}
|
||||
couple.divorce();
|
||||
getCouples().remove(index);
|
||||
_couples.remove(index);
|
||||
}
|
||||
|
||||
public final int getCoupleIndex(int coupleId)
|
||||
{
|
||||
int i = 0;
|
||||
for (Couple temp : getCouples())
|
||||
for (Couple temp : _couples)
|
||||
{
|
||||
if ((temp != null) && (temp.getId() == coupleId))
|
||||
{
|
||||
|
||||
+6
-6
@@ -49,7 +49,7 @@ public final class FortSiegeGuardManager
|
||||
{
|
||||
try
|
||||
{
|
||||
final List<L2Spawn> monsterList = _siegeGuards.get(getFort().getResidenceId());
|
||||
final List<L2Spawn> monsterList = _siegeGuards.get(_fort.getResidenceId());
|
||||
if (monsterList != null)
|
||||
{
|
||||
for (L2Spawn spawnDat : monsterList)
|
||||
@@ -68,7 +68,7 @@ public final class FortSiegeGuardManager
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error spawning siege guards for fort " + getFort().getName() + ":" + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, "Error spawning siege guards for fort " + _fort.getName() + ":" + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ public final class FortSiegeGuardManager
|
||||
{
|
||||
try
|
||||
{
|
||||
final List<L2Spawn> monsterList = _siegeGuards.get(getFort().getResidenceId());
|
||||
final List<L2Spawn> monsterList = _siegeGuards.get(_fort.getResidenceId());
|
||||
if (monsterList != null)
|
||||
{
|
||||
for (L2Spawn spawnDat : monsterList)
|
||||
@@ -94,7 +94,7 @@ public final class FortSiegeGuardManager
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error unspawning siege guards for fort " + getFort().getName() + ":" + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, "Error unspawning siege guards for fort " + _fort.getName() + ":" + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public final class FortSiegeGuardManager
|
||||
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())
|
||||
{
|
||||
@@ -130,7 +130,7 @@ public final class FortSiegeGuardManager
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Error loading siege guard for fort " + getFort().getName() + ": " + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, "Error loading siege guard for fort " + _fort.getName() + ": " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -961,7 +961,7 @@ public final class FourSepulchersManager
|
||||
}
|
||||
}
|
||||
|
||||
if (!isEntryTime())
|
||||
if (!_inEntryTime)
|
||||
{
|
||||
showHtmlFile(player, npcId + "-NE.htm", npc, null);
|
||||
return;
|
||||
@@ -1065,7 +1065,7 @@ public final class FourSepulchersManager
|
||||
|
||||
public void spawnMysteriousBox(int npcId)
|
||||
{
|
||||
if (!isAttackTime())
|
||||
if (!_inAttackTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1080,7 +1080,7 @@ public final class FourSepulchersManager
|
||||
|
||||
public void spawnMonster(int npcId)
|
||||
{
|
||||
if (!isAttackTime())
|
||||
if (!_inAttackTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1232,7 +1232,7 @@ public final class FourSepulchersManager
|
||||
|
||||
public void spawnKeyBox(L2Npc activeChar)
|
||||
{
|
||||
if (!isAttackTime())
|
||||
if (!_inAttackTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1253,7 +1253,7 @@ public final class FourSepulchersManager
|
||||
|
||||
public void spawnExecutionerOfHalisha(L2Npc activeChar)
|
||||
{
|
||||
if (!isAttackTime())
|
||||
if (!_inAttackTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1274,7 +1274,7 @@ public final class FourSepulchersManager
|
||||
|
||||
public void spawnArchonOfHalisha(int npcId)
|
||||
{
|
||||
if (!isAttackTime() || _archonSpawned.get(npcId))
|
||||
if (!_inAttackTime || _archonSpawned.get(npcId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1301,7 +1301,7 @@ public final class FourSepulchersManager
|
||||
|
||||
public void spawnEmperorsGraveNpc(int npcId)
|
||||
{
|
||||
if (!isAttackTime())
|
||||
if (!_inAttackTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1342,7 +1342,7 @@ public final class FourSepulchersManager
|
||||
|
||||
public void spawnShadow(int npcId)
|
||||
{
|
||||
if (!isAttackTime())
|
||||
if (!_inAttackTime)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
+5
-5
@@ -100,7 +100,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())
|
||||
{
|
||||
@@ -113,7 +113,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())
|
||||
{
|
||||
@@ -126,7 +126,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())
|
||||
{
|
||||
@@ -139,7 +139,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())
|
||||
{
|
||||
@@ -152,7 +152,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())
|
||||
{
|
||||
|
||||
+23
-23
@@ -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)
|
||||
{
|
||||
@@ -239,14 +239,14 @@ public final class PetitionManager
|
||||
|
||||
public boolean isPetitionInProcess(int petitionId)
|
||||
{
|
||||
return isValidPetition(petitionId) && (getPendingPetitions().get(petitionId).getState() == PetitionState.IN_PROCESS);
|
||||
return isValidPetition(petitionId) && (_pendingPetitions.get(petitionId).getState() == PetitionState.IN_PROCESS);
|
||||
}
|
||||
|
||||
public boolean isPlayerInConsultation(L2PcInstance player)
|
||||
{
|
||||
if (player != null)
|
||||
{
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if ((currPetition == null) || (currPetition.getState() != PetitionState.IN_PROCESS))
|
||||
{
|
||||
@@ -271,7 +271,7 @@ public final class PetitionManager
|
||||
{
|
||||
if (petitioner != null)
|
||||
{
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@@ -290,7 +290,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)
|
||||
@@ -300,7 +300,7 @@ public final class PetitionManager
|
||||
return false;
|
||||
}
|
||||
|
||||
final Petition currPetition = getPendingPetitions().get(petitionId);
|
||||
final Petition currPetition = _pendingPetitions.get(petitionId);
|
||||
|
||||
if (currPetition.getResponder() != null)
|
||||
{
|
||||
@@ -318,7 +318,7 @@ public final class PetitionManager
|
||||
|
||||
CreatureSay cs;
|
||||
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@@ -351,12 +351,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>");
|
||||
}
|
||||
@@ -367,7 +367,7 @@ public final class PetitionManager
|
||||
|
||||
boolean color = true;
|
||||
int petcount = 0;
|
||||
for (Petition currPetition : getPendingPetitions().values())
|
||||
for (Petition currPetition : _pendingPetitions.values())
|
||||
{
|
||||
if (currPetition == null)
|
||||
{
|
||||
@@ -407,7 +407,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 + ").";
|
||||
@@ -423,7 +423,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();
|
||||
|
||||
+9
-9
@@ -127,12 +127,12 @@ public final class SiegeGuardManager
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("Delete From castle_siege_guards Where castleId = ? And isHired = 1"))
|
||||
{
|
||||
ps.setInt(1, getCastle().getResidenceId());
|
||||
ps.setInt(1, _castle.getResidenceId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error deleting hired siege guard for castle " + getCastle().getName() + ": " + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error deleting hired siege guard for castle " + _castle.getName() + ": " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -145,7 +145,7 @@ public final class SiegeGuardManager
|
||||
{
|
||||
int hiredCount = 0;
|
||||
final int hiredMax = MercTicketManager.getInstance().getMaxAllowedMerc(_castle.getResidenceId());
|
||||
final boolean isHired = getCastle().getOwnerId() > 0;
|
||||
final boolean isHired = _castle.getOwnerId() > 0;
|
||||
loadSiegeGuard();
|
||||
for (L2Spawn spawn : _siegeGuardSpawn)
|
||||
{
|
||||
@@ -165,7 +165,7 @@ public final class SiegeGuardManager
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Error spawning siege guards for castle " + getCastle().getName(), e);
|
||||
LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Error spawning siege guards for castle " + _castle.getName(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,8 +194,8 @@ public final class SiegeGuardManager
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM castle_siege_guards Where castleId = ? And isHired = ?"))
|
||||
{
|
||||
ps.setInt(1, getCastle().getResidenceId());
|
||||
ps.setInt(2, getCastle().getOwnerId() > 0 ? 1 : 0);
|
||||
ps.setInt(1, _castle.getResidenceId());
|
||||
ps.setInt(2, _castle.getOwnerId() > 0 ? 1 : 0);
|
||||
try (ResultSet rs = ps.executeQuery())
|
||||
{
|
||||
while (rs.next())
|
||||
@@ -215,7 +215,7 @@ public final class SiegeGuardManager
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error loading siege guard for castle " + getCastle().getName() + ": " + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error loading siege guard for castle " + _castle.getName() + ": " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -233,7 +233,7 @@ public final class SiegeGuardManager
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("Insert Into castle_siege_guards (castleId, npcId, x, y, z, heading, respawnDelay, isHired) Values (?, ?, ?, ?, ?, ?, ?, ?)"))
|
||||
{
|
||||
ps.setInt(1, getCastle().getResidenceId());
|
||||
ps.setInt(1, _castle.getResidenceId());
|
||||
ps.setInt(2, npcId);
|
||||
ps.setInt(3, x);
|
||||
ps.setInt(4, y);
|
||||
@@ -245,7 +245,7 @@ public final class SiegeGuardManager
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error adding siege guard for castle " + getCastle().getName() + ": " + e.getMessage(), e);
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Error adding siege guard for castle " + _castle.getName() + ": " + e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ public final class SoDManager
|
||||
_SoDLastStateChangeDate = Calendar.getInstance();
|
||||
loadData();
|
||||
handleSodStages();
|
||||
LOGGER.info("Seed of Destruction Manager: Loaded. Current stage is: " + getSoDState());
|
||||
LOGGER.info("Seed of Destruction Manager: Loaded. Current stage is: " + _SoDState);
|
||||
}
|
||||
|
||||
public void saveData(byte seedType)
|
||||
|
||||
+4
-4
@@ -95,7 +95,7 @@ public final class TerritoryWarManager implements Siegable
|
||||
protected Calendar _startTWDate = Calendar.getInstance();
|
||||
protected boolean _isRegistrationOver = true;
|
||||
protected boolean _isTWChannelOpen = false;
|
||||
private boolean _isTWInProgress = false;
|
||||
boolean _isTWInProgress = false;
|
||||
protected ScheduledFuture<?> _scheduledStartTWTask = null;
|
||||
protected ScheduledFuture<?> _scheduledEndTWTask = null;
|
||||
protected ScheduledFuture<?> _scheduledRewardOnlineTask = null;
|
||||
@@ -376,7 +376,7 @@ public final class TerritoryWarManager implements Siegable
|
||||
ward._npcId = territoryId;
|
||||
ret = spawnNPC(36491 + territoryId, ward.getLocation());
|
||||
ward.setNPC(ret);
|
||||
if (!isTWInProgress() && !SPAWN_WARDS_WHEN_TW_IS_NOT_IN_PROGRESS)
|
||||
if (!_isTWInProgress && !SPAWN_WARDS_WHEN_TW_IS_NOT_IN_PROGRESS)
|
||||
{
|
||||
ret.decayMe();
|
||||
}
|
||||
@@ -548,7 +548,7 @@ public final class TerritoryWarManager implements Siegable
|
||||
if (twWard.playerId == player.getObjectId())
|
||||
{
|
||||
twWard.dropIt();
|
||||
if (isTWInProgress())
|
||||
if (_isTWInProgress)
|
||||
{
|
||||
if (isKilled)
|
||||
{
|
||||
@@ -1236,7 +1236,7 @@ public final class TerritoryWarManager implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (isTWInProgress())
|
||||
if (_isTWInProgress)
|
||||
{
|
||||
for (L2PcInstance player : L2World.getInstance().getPlayers())
|
||||
{
|
||||
|
||||
+19
-19
@@ -94,9 +94,9 @@ public class Lottery
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(UPDATE_PRICE))
|
||||
{
|
||||
ps.setLong(1, getPrize());
|
||||
ps.setLong(2, getPrize());
|
||||
ps.setInt(3, getId());
|
||||
ps.setLong(1, _prize);
|
||||
ps.setLong(2, _prize);
|
||||
ps.setInt(3, _number);
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
@@ -172,7 +172,7 @@ public class Lottery
|
||||
_isSellingTickets = true;
|
||||
_isStarted = true;
|
||||
|
||||
Broadcast.toAllOnlinePlayers("Lottery tickets are now available for Lucky Lottery #" + getId() + ".");
|
||||
Broadcast.toAllOnlinePlayers("Lottery tickets are now available for Lucky Lottery #" + _number + ".");
|
||||
final Calendar finishtime = Calendar.getInstance();
|
||||
finishtime.setTimeInMillis(_enddate);
|
||||
finishtime.set(Calendar.MINUTE, 0);
|
||||
@@ -198,10 +198,10 @@ public class Lottery
|
||||
PreparedStatement ps = con.prepareStatement(INSERT_LOTTERY))
|
||||
{
|
||||
ps.setInt(1, 1);
|
||||
ps.setInt(2, getId());
|
||||
ps.setLong(3, getEndDate());
|
||||
ps.setLong(4, getPrize());
|
||||
ps.setLong(5, getPrize());
|
||||
ps.setInt(2, _number);
|
||||
ps.setLong(3, _enddate);
|
||||
ps.setLong(4, _prize);
|
||||
ps.setLong(5, _prize);
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
@@ -284,7 +284,7 @@ public class Lottery
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(SELECT_LOTTERY_ITEM))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _number);
|
||||
try (ResultSet rset = ps.executeQuery())
|
||||
{
|
||||
while (rset.next())
|
||||
@@ -350,49 +350,49 @@ public class Lottery
|
||||
|
||||
if (count1 > 0)
|
||||
{
|
||||
prize1 = (long) (((getPrize() - prize4) * Config.ALT_LOTTERY_5_NUMBER_RATE) / count1);
|
||||
prize1 = (long) (((_prize - prize4) * Config.ALT_LOTTERY_5_NUMBER_RATE) / count1);
|
||||
}
|
||||
|
||||
if (count2 > 0)
|
||||
{
|
||||
prize2 = (long) (((getPrize() - prize4) * Config.ALT_LOTTERY_4_NUMBER_RATE) / count2);
|
||||
prize2 = (long) (((_prize - prize4) * Config.ALT_LOTTERY_4_NUMBER_RATE) / count2);
|
||||
}
|
||||
|
||||
if (count3 > 0)
|
||||
{
|
||||
prize3 = (long) (((getPrize() - prize4) * Config.ALT_LOTTERY_3_NUMBER_RATE) / count3);
|
||||
prize3 = (long) (((_prize - prize4) * Config.ALT_LOTTERY_3_NUMBER_RATE) / count3);
|
||||
}
|
||||
|
||||
final long newprize = getPrize() - (prize1 + prize2 + prize3 + prize4);
|
||||
final long newprize = _prize - (prize1 + prize2 + prize3 + prize4);
|
||||
SystemMessage sm;
|
||||
if (count1 > 0)
|
||||
{
|
||||
// There are winners.
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_PRIZE_AMOUNT_FOR_THE_WINNER_OF_LOTTERY_S1_IS_S2_ADENA_WE_HAVE_S3_FIRST_PRIZE_WINNERS);
|
||||
sm.addInt(getId());
|
||||
sm.addLong(getPrize());
|
||||
sm.addInt(_number);
|
||||
sm.addLong(_prize);
|
||||
sm.addLong(count1);
|
||||
}
|
||||
else
|
||||
{
|
||||
// There are no winners.
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.THE_PRIZE_AMOUNT_FOR_LUCKY_LOTTERY_S1_IS_S2_ADENA_THERE_WAS_NO_FIRST_PRIZE_WINNER_IN_THIS_DRAWING_THEREFORE_THE_JACKPOT_WILL_BE_ADDED_TO_THE_NEXT_DRAWING);
|
||||
sm.addInt(getId());
|
||||
sm.addLong(getPrize());
|
||||
sm.addInt(_number);
|
||||
sm.addLong(_prize);
|
||||
}
|
||||
Broadcast.toAllOnlinePlayers(sm);
|
||||
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(UPDATE_LOTTERY))
|
||||
{
|
||||
ps.setLong(1, getPrize());
|
||||
ps.setLong(1, _prize);
|
||||
ps.setLong(2, newprize);
|
||||
ps.setInt(3, enchant);
|
||||
ps.setInt(4, type2);
|
||||
ps.setLong(5, prize1);
|
||||
ps.setLong(6, prize2);
|
||||
ps.setLong(7, prize3);
|
||||
ps.setInt(8, getId());
|
||||
ps.setInt(8, _number);
|
||||
ps.execute();
|
||||
}
|
||||
catch (SQLException e)
|
||||
|
||||
+2
-2
@@ -77,7 +77,7 @@ public abstract class AbstractPlayerGroup
|
||||
*/
|
||||
public boolean isLeader(L2PcInstance player)
|
||||
{
|
||||
return getLeaderObjectId() == player.getObjectId();
|
||||
return getLeader().getObjectId() == player.getObjectId();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,7 +154,7 @@ public abstract class AbstractPlayerGroup
|
||||
*/
|
||||
public L2PcInstance getRandomPlayer()
|
||||
{
|
||||
return getMembers().get(Rnd.get(getMemberCount()));
|
||||
return getMembers().get(Rnd.get(getMembers().size()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+78
-78
@@ -174,27 +174,27 @@ public final class CharEffectList
|
||||
final List<BuffInfo> buffs = new ArrayList<>();
|
||||
if (hasBuffs())
|
||||
{
|
||||
buffs.addAll(getBuffs());
|
||||
buffs.addAll(_buffs);
|
||||
}
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
buffs.addAll(getTriggered());
|
||||
buffs.addAll(_triggered);
|
||||
}
|
||||
|
||||
if (hasDances())
|
||||
{
|
||||
buffs.addAll(getDances());
|
||||
buffs.addAll(_dances);
|
||||
}
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
buffs.addAll(getToggles());
|
||||
buffs.addAll(_toggles);
|
||||
}
|
||||
|
||||
if (hasDebuffs())
|
||||
{
|
||||
buffs.addAll(getDebuffs());
|
||||
buffs.addAll(_debuffs);
|
||||
}
|
||||
return buffs;
|
||||
}
|
||||
@@ -214,27 +214,27 @@ public final class CharEffectList
|
||||
final Queue<BuffInfo> effects;
|
||||
if (skill.isPassive())
|
||||
{
|
||||
effects = getPassives();
|
||||
effects = _passives;
|
||||
}
|
||||
else if (skill.isDebuff())
|
||||
{
|
||||
effects = getDebuffs();
|
||||
effects = _debuffs;
|
||||
}
|
||||
else if (skill.isTriggeredSkill())
|
||||
{
|
||||
effects = getTriggered();
|
||||
effects = _triggered;
|
||||
}
|
||||
else if (skill.isDance())
|
||||
{
|
||||
effects = getDances();
|
||||
effects = _dances;
|
||||
}
|
||||
else if (skill.isToggle())
|
||||
{
|
||||
effects = getToggles();
|
||||
effects = _toggles;
|
||||
}
|
||||
else
|
||||
{
|
||||
effects = getBuffs();
|
||||
effects = _buffs;
|
||||
}
|
||||
return effects;
|
||||
}
|
||||
@@ -250,7 +250,7 @@ public final class CharEffectList
|
||||
{
|
||||
if (hasBuffs())
|
||||
{
|
||||
for (BuffInfo info : getBuffs())
|
||||
for (BuffInfo info : _buffs)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
@@ -267,7 +267,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
for (BuffInfo info : getTriggered())
|
||||
for (BuffInfo info : _triggered)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
@@ -284,7 +284,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasDances())
|
||||
{
|
||||
for (BuffInfo info : getDances())
|
||||
for (BuffInfo info : _dances)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
@@ -301,7 +301,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
for (BuffInfo info : getToggles())
|
||||
for (BuffInfo info : _toggles)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
@@ -318,7 +318,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasDebuffs())
|
||||
{
|
||||
for (BuffInfo info : getDebuffs())
|
||||
for (BuffInfo info : _debuffs)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
@@ -357,32 +357,32 @@ public final class CharEffectList
|
||||
BuffInfo info = null;
|
||||
if (hasBuffs())
|
||||
{
|
||||
info = getBuffs().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
info = _buffs.stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
if (hasTriggered() && (info == null))
|
||||
{
|
||||
info = getTriggered().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
info = _triggered.stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
if (hasDances() && (info == null))
|
||||
{
|
||||
info = getDances().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
info = _dances.stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
if (hasToggles() && (info == null))
|
||||
{
|
||||
info = getToggles().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
info = _toggles.stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
if (hasDebuffs() && (info == null))
|
||||
{
|
||||
info = getDebuffs().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
info = _debuffs.stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
if (hasPassives() && (info == null))
|
||||
{
|
||||
info = getPassives().stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
info = _passives.stream().filter(b -> b.getSkill().getId() == skillId).findFirst().orElse(null);
|
||||
}
|
||||
return info;
|
||||
}
|
||||
@@ -486,7 +486,7 @@ public final class CharEffectList
|
||||
*/
|
||||
public int getBuffCount()
|
||||
{
|
||||
return hasBuffs() ? getBuffs().size() - _hiddenBuffs.get() - (getShortBuff() != null ? 1 : 0) : 0;
|
||||
return hasBuffs() ? _buffs.size() - _hiddenBuffs.get() - (_shortBuff != null ? 1 : 0) : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -496,7 +496,7 @@ public final class CharEffectList
|
||||
*/
|
||||
public int getDanceCount()
|
||||
{
|
||||
return hasDances() ? getDances().size() : 0;
|
||||
return hasDances() ? _dances.size() : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -506,7 +506,7 @@ public final class CharEffectList
|
||||
*/
|
||||
public int getTriggeredBuffCount()
|
||||
{
|
||||
return hasTriggered() ? getTriggered().size() : 0;
|
||||
return hasTriggered() ? _triggered.size() : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -568,7 +568,7 @@ public final class CharEffectList
|
||||
// If it's an herb that ends, check if there are hidden buffs.
|
||||
if (info.getSkill().isAbnormalInstant() && hasBuffs())
|
||||
{
|
||||
for (BuffInfo buff : getBuffs())
|
||||
for (BuffInfo buff : _buffs)
|
||||
{
|
||||
if ((buff != null) && (buff.getSkill().getAbnormalType() == info.getSkill().getAbnormalType()) && !buff.isInUse())
|
||||
{
|
||||
@@ -626,31 +626,31 @@ public final class CharEffectList
|
||||
boolean update = false;
|
||||
if (hasBuffs())
|
||||
{
|
||||
getBuffs().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getBuffs()));
|
||||
_buffs.stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, _buffs));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
getTriggered().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getTriggered()));
|
||||
_triggered.stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, _triggered));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasDebuffs())
|
||||
{
|
||||
getDebuffs().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getDebuffs()));
|
||||
_debuffs.stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, _debuffs));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasDances())
|
||||
{
|
||||
getDances().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getDances()));
|
||||
_dances.stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, _dances));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
getToggles().stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, getToggles()));
|
||||
_toggles.stream().filter(info -> !info.getSkill().isStayAfterDeath()).forEach(info -> stopAndRemove(info, _toggles));
|
||||
update = true;
|
||||
}
|
||||
|
||||
@@ -666,31 +666,31 @@ public final class CharEffectList
|
||||
boolean update = false;
|
||||
if (hasBuffs())
|
||||
{
|
||||
getBuffs().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getBuffs()));
|
||||
_buffs.stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, _buffs));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
getTriggered().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getTriggered()));
|
||||
_triggered.stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, _triggered));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasDebuffs())
|
||||
{
|
||||
getDebuffs().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getDebuffs()));
|
||||
_debuffs.stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, _debuffs));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasDances())
|
||||
{
|
||||
getDances().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getDances()));
|
||||
_dances.stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, _dances));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
getToggles().stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, getToggles()));
|
||||
_toggles.stream().filter(info -> !info.getSkill().isStayOnSubclassChange()).forEach(info -> stopAndRemove(info, _toggles));
|
||||
update = true;
|
||||
}
|
||||
|
||||
@@ -707,12 +707,12 @@ public final class CharEffectList
|
||||
{
|
||||
if (hasBuffs())
|
||||
{
|
||||
getBuffs().forEach(b -> stopAndRemove(b, getBuffs()));
|
||||
_buffs.forEach(b -> stopAndRemove(b, _buffs));
|
||||
}
|
||||
|
||||
if (triggered && hasTriggered())
|
||||
{
|
||||
getTriggered().forEach(b -> stopAndRemove(b, getTriggered()));
|
||||
_triggered.forEach(b -> stopAndRemove(b, _triggered));
|
||||
}
|
||||
|
||||
// Update effect flags and icons.
|
||||
@@ -738,7 +738,7 @@ public final class CharEffectList
|
||||
{
|
||||
return;
|
||||
}
|
||||
getToggles().forEach(b -> stopAndRemove(b, getToggles()));
|
||||
_toggles.forEach(b -> stopAndRemove(b, _toggles));
|
||||
// Update effect flags and icons.
|
||||
updateEffectList(update);
|
||||
}
|
||||
@@ -753,7 +753,7 @@ public final class CharEffectList
|
||||
{
|
||||
return;
|
||||
}
|
||||
getDances().forEach(b -> stopAndRemove(b, getDances()));
|
||||
_dances.forEach(b -> stopAndRemove(b, _dances));
|
||||
// Update effect flags and icons.
|
||||
updateEffectList(update);
|
||||
}
|
||||
@@ -768,7 +768,7 @@ public final class CharEffectList
|
||||
{
|
||||
return;
|
||||
}
|
||||
getDebuffs().forEach(b -> stopAndRemove(b, getDebuffs()));
|
||||
_debuffs.forEach(b -> stopAndRemove(b, _debuffs));
|
||||
// Update effect flags and icons.
|
||||
updateEffectList(update);
|
||||
}
|
||||
@@ -791,31 +791,31 @@ public final class CharEffectList
|
||||
|
||||
if (hasBuffs())
|
||||
{
|
||||
getBuffs().stream().filter(Objects::nonNull).forEach(action);
|
||||
_buffs.stream().filter(Objects::nonNull).forEach(action);
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
getTriggered().stream().filter(Objects::nonNull).forEach(action);
|
||||
_triggered.stream().filter(Objects::nonNull).forEach(action);
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasDances())
|
||||
{
|
||||
getDances().stream().filter(Objects::nonNull).forEach(action);
|
||||
_dances.stream().filter(Objects::nonNull).forEach(action);
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
getToggles().stream().filter(Objects::nonNull).forEach(action);
|
||||
_toggles.stream().filter(Objects::nonNull).forEach(action);
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasDebuffs())
|
||||
{
|
||||
getDebuffs().stream().filter(Objects::nonNull).forEach(action);
|
||||
_debuffs.stream().filter(Objects::nonNull).forEach(action);
|
||||
update = true;
|
||||
}
|
||||
|
||||
@@ -900,31 +900,31 @@ public final class CharEffectList
|
||||
boolean update = false;
|
||||
if (hasBuffs())
|
||||
{
|
||||
getBuffs().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getBuffs()));
|
||||
_buffs.stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, _buffs));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
getTriggered().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getTriggered()));
|
||||
_triggered.stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, _triggered));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasDebuffs())
|
||||
{
|
||||
getDebuffs().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getDebuffs()));
|
||||
_debuffs.stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, _debuffs));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasDances())
|
||||
{
|
||||
getDances().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getDances()));
|
||||
_dances.stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, _dances));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
getToggles().stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, getToggles()));
|
||||
_toggles.stream().filter(info -> info.getSkill().isRemovedOnAnyActionExceptMove()).forEach(info -> stopAndRemove(info, _toggles));
|
||||
update = true;
|
||||
}
|
||||
|
||||
@@ -944,32 +944,32 @@ public final class CharEffectList
|
||||
{
|
||||
if (hasBuffs())
|
||||
{
|
||||
getBuffs().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getBuffs()));
|
||||
_buffs.stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, _buffs));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
getTriggered().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getTriggered()));
|
||||
_triggered.stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, _triggered));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasDances())
|
||||
{
|
||||
getDances().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getDances()));
|
||||
_dances.stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, _dances));
|
||||
update = true;
|
||||
}
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
getToggles().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getToggles()));
|
||||
_toggles.stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, _toggles));
|
||||
update = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (_hasDebuffsRemovedOnDamage && hasDebuffs())
|
||||
{
|
||||
getDebuffs().stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, getDebuffs()));
|
||||
_debuffs.stream().filter(Objects::nonNull).filter(info -> info.getSkill().isRemovedOnDamage()).forEach(info -> stopAndRemove(info, _debuffs));
|
||||
update = true;
|
||||
}
|
||||
// Update effect flags and icons.
|
||||
@@ -1070,7 +1070,7 @@ public final class CharEffectList
|
||||
boolean update = false;
|
||||
if (hasBuffs())
|
||||
{
|
||||
for (BuffInfo info : getBuffs())
|
||||
for (BuffInfo info : _buffs)
|
||||
{
|
||||
update |= function.apply(info);
|
||||
}
|
||||
@@ -1078,7 +1078,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
for (BuffInfo info : getTriggered())
|
||||
for (BuffInfo info : _triggered)
|
||||
{
|
||||
update |= function.apply(info);
|
||||
}
|
||||
@@ -1086,7 +1086,7 @@ public final class CharEffectList
|
||||
|
||||
if (dances && hasDances())
|
||||
{
|
||||
for (BuffInfo info : getDances())
|
||||
for (BuffInfo info : _dances)
|
||||
{
|
||||
update |= function.apply(info);
|
||||
}
|
||||
@@ -1094,7 +1094,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
for (BuffInfo info : getToggles())
|
||||
for (BuffInfo info : _toggles)
|
||||
{
|
||||
update |= function.apply(info);
|
||||
}
|
||||
@@ -1102,7 +1102,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasDebuffs())
|
||||
{
|
||||
for (BuffInfo info : getDebuffs())
|
||||
for (BuffInfo info : _debuffs)
|
||||
{
|
||||
update |= function.apply(info);
|
||||
}
|
||||
@@ -1163,15 +1163,15 @@ public final class CharEffectList
|
||||
}
|
||||
|
||||
// Puts the effects in the list.
|
||||
getPassives().stream().filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
|
||||
_passives.stream().filter(b -> b.getSkill().getId() == skill.getId()).forEach(b ->
|
||||
{
|
||||
// Removes the old stats from the creature if the skill was present.
|
||||
b.setInUse(false);
|
||||
b.removeStats();
|
||||
getPassives().remove(b);
|
||||
_passives.remove(b);
|
||||
});
|
||||
|
||||
getPassives().add(info);
|
||||
_passives.add(info);
|
||||
|
||||
// Initialize effects.
|
||||
info.initializeEffects();
|
||||
@@ -1347,7 +1347,7 @@ public final class CharEffectList
|
||||
// Buffs.
|
||||
if (hasBuffs())
|
||||
{
|
||||
for (BuffInfo info : getBuffs())
|
||||
for (BuffInfo info : _buffs)
|
||||
{
|
||||
if (info.getSkill().isHealingPotionSkill())
|
||||
{
|
||||
@@ -1363,7 +1363,7 @@ public final class CharEffectList
|
||||
// Triggered buffs.
|
||||
if (hasTriggered())
|
||||
{
|
||||
for (BuffInfo info : getTriggered())
|
||||
for (BuffInfo info : _triggered)
|
||||
{
|
||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||
}
|
||||
@@ -1372,7 +1372,7 @@ public final class CharEffectList
|
||||
// Songs and dances.
|
||||
if (hasDances())
|
||||
{
|
||||
for (BuffInfo info : getDances())
|
||||
for (BuffInfo info : _dances)
|
||||
{
|
||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||
}
|
||||
@@ -1381,7 +1381,7 @@ public final class CharEffectList
|
||||
// Toggles.
|
||||
if (hasToggles())
|
||||
{
|
||||
for (BuffInfo info : getToggles())
|
||||
for (BuffInfo info : _toggles)
|
||||
{
|
||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||
}
|
||||
@@ -1390,7 +1390,7 @@ public final class CharEffectList
|
||||
// Debuffs.
|
||||
if (hasDebuffs())
|
||||
{
|
||||
for (BuffInfo info : getDebuffs())
|
||||
for (BuffInfo info : _debuffs)
|
||||
{
|
||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||
}
|
||||
@@ -1489,7 +1489,7 @@ public final class CharEffectList
|
||||
{
|
||||
if (hasBuffs())
|
||||
{
|
||||
for (BuffInfo info : getBuffs())
|
||||
for (BuffInfo info : _buffs)
|
||||
{
|
||||
if (info == null)
|
||||
{
|
||||
@@ -1510,7 +1510,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
for (BuffInfo info : getTriggered())
|
||||
for (BuffInfo info : _triggered)
|
||||
{
|
||||
if (info == null)
|
||||
{
|
||||
@@ -1531,7 +1531,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
for (BuffInfo info : getToggles())
|
||||
for (BuffInfo info : _toggles)
|
||||
{
|
||||
if (info == null)
|
||||
{
|
||||
@@ -1552,7 +1552,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasDebuffs())
|
||||
{
|
||||
for (BuffInfo info : getDebuffs())
|
||||
for (BuffInfo info : _debuffs)
|
||||
{
|
||||
if ((info != null) && info.getSkill().isRemovedOnDamage())
|
||||
{
|
||||
@@ -1571,7 +1571,7 @@ public final class CharEffectList
|
||||
int flags = 0;
|
||||
if (hasBuffs())
|
||||
{
|
||||
for (BuffInfo info : getBuffs())
|
||||
for (BuffInfo info : _buffs)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
@@ -1585,7 +1585,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasTriggered())
|
||||
{
|
||||
for (BuffInfo info : getTriggered())
|
||||
for (BuffInfo info : _triggered)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
@@ -1599,7 +1599,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasDebuffs())
|
||||
{
|
||||
for (BuffInfo info : getDebuffs())
|
||||
for (BuffInfo info : _debuffs)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
@@ -1613,7 +1613,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasDances())
|
||||
{
|
||||
for (BuffInfo info : getDances())
|
||||
for (BuffInfo info : _dances)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
@@ -1627,7 +1627,7 @@ public final class CharEffectList
|
||||
|
||||
if (hasToggles())
|
||||
{
|
||||
for (BuffInfo info : getToggles())
|
||||
for (BuffInfo info : _toggles)
|
||||
{
|
||||
if (info != null)
|
||||
{
|
||||
|
||||
@@ -73,7 +73,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();
|
||||
}
|
||||
|
||||
@@ -166,7 +166,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
_clanId = clanId;
|
||||
initializePrivs();
|
||||
restore();
|
||||
getWarehouse().restore();
|
||||
_warehouse.restore();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -226,7 +226,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
|
||||
@@ -262,7 +262,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
}
|
||||
|
||||
setLeader(member);
|
||||
if (getNewLeaderId() != 0)
|
||||
if (_newLeaderId != 0)
|
||||
{
|
||||
setNewLeaderId(0, true);
|
||||
}
|
||||
@@ -555,7 +555,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
switch (getLevel())
|
||||
switch (_level)
|
||||
{
|
||||
case 3:
|
||||
{
|
||||
@@ -593,7 +593,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
case 100:
|
||||
case 200:
|
||||
{
|
||||
switch (getLevel())
|
||||
switch (_level)
|
||||
{
|
||||
case 11:
|
||||
{
|
||||
@@ -613,7 +613,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
case 2001:
|
||||
case 2002:
|
||||
{
|
||||
switch (getLevel())
|
||||
switch (_level)
|
||||
{
|
||||
case 9:
|
||||
case 10:
|
||||
@@ -873,8 +873,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)
|
||||
@@ -917,8 +917,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)
|
||||
@@ -935,8 +935,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)
|
||||
@@ -965,15 +965,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)
|
||||
@@ -1002,19 +1002,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)
|
||||
@@ -1060,7 +1060,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())
|
||||
@@ -1073,12 +1073,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);
|
||||
}
|
||||
@@ -1098,7 +1098,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;
|
||||
@@ -1135,7 +1135,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())
|
||||
@@ -1166,7 +1166,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)
|
||||
{
|
||||
@@ -1222,7 +1222,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
|
||||
@@ -1333,7 +1333,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();
|
||||
}
|
||||
}
|
||||
@@ -1341,7 +1341,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());
|
||||
@@ -1578,7 +1578,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getName() + "[" + getId() + "]";
|
||||
return _name + "[" + _clanId + "]";
|
||||
}
|
||||
|
||||
public ItemContainer getWarehouse()
|
||||
@@ -1767,7 +1767,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())
|
||||
@@ -1857,7 +1857,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_SCORE_IS_TOO_LOW);
|
||||
return null;
|
||||
@@ -1866,7 +1866,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);
|
||||
@@ -1881,11 +1881,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
|
||||
}
|
||||
}
|
||||
@@ -1951,7 +1951,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();
|
||||
}
|
||||
@@ -1967,7 +1967,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())
|
||||
{
|
||||
@@ -2016,7 +2016,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);
|
||||
@@ -2053,7 +2053,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);
|
||||
@@ -2093,12 +2093,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)
|
||||
@@ -2172,7 +2172,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)
|
||||
@@ -2209,7 +2209,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;
|
||||
@@ -2241,7 +2241,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
|
||||
@@ -2393,22 +2393,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;
|
||||
@@ -2429,7 +2429,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
return;
|
||||
}
|
||||
|
||||
setAllyId(getId());
|
||||
setAllyId(_clanId);
|
||||
setAllyName(allyName.trim());
|
||||
setAllyPenaltyExpiryTime(0, 0);
|
||||
updateClanInDB();
|
||||
@@ -2443,12 +2443,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;
|
||||
@@ -2487,7 +2487,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;
|
||||
@@ -2495,7 +2495,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
|
||||
boolean increaseClanLevel = false;
|
||||
|
||||
switch (getLevel())
|
||||
switch (_level)
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
@@ -2593,9 +2593,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_POINTS_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION_SCORE);
|
||||
cr.addInt(Config.CLAN_LEVEL_6_COST);
|
||||
player.sendPacket(cr);
|
||||
@@ -2606,9 +2606,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_POINTS_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION_SCORE);
|
||||
cr.addInt(Config.CLAN_LEVEL_7_COST);
|
||||
player.sendPacket(cr);
|
||||
@@ -2619,9 +2619,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_POINTS_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION_SCORE);
|
||||
cr.addInt(Config.CLAN_LEVEL_8_COST);
|
||||
player.sendPacket(cr);
|
||||
@@ -2632,12 +2632,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_POINTS_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION_SCORE);
|
||||
cr.addInt(Config.CLAN_LEVEL_9_COST);
|
||||
player.sendPacket(cr);
|
||||
@@ -2653,12 +2653,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_POINTS_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION_SCORE);
|
||||
cr.addInt(Config.CLAN_LEVEL_10_COST);
|
||||
player.sendPacket(cr);
|
||||
@@ -2683,9 +2683,9 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasTerritory && (getReputationScore() >= Config.CLAN_LEVEL_11_COST) && (getMembersCount() >= Config.CLAN_LEVEL_11_REQUIREMENT))
|
||||
if (hasTerritory && (_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_POINTS_HAVE_BEEN_DEDUCTED_FROM_THE_CLAN_S_REPUTATION_SCORE);
|
||||
cr.addInt(Config.CLAN_LEVEL_11_COST);
|
||||
player.sendPacket(cr);
|
||||
@@ -2712,7 +2712,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
|
||||
player.sendPacket(new ItemList(player, false));
|
||||
|
||||
changeLevel(getLevel() + 1);
|
||||
changeLevel(_level + 1);
|
||||
|
||||
// Notify to scripts
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerClanLvlUp(player, this));
|
||||
@@ -2725,7 +2725,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)
|
||||
@@ -2735,9 +2735,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);
|
||||
@@ -2760,7 +2760,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
*/
|
||||
public void changeClanCrest(int crestId)
|
||||
{
|
||||
if (getCrestId() != 0)
|
||||
if (_crestId != 0)
|
||||
{
|
||||
CrestTable.getInstance().removeCrest(getCrestId());
|
||||
}
|
||||
@@ -2771,12 +2771,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))
|
||||
@@ -2793,15 +2793,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();
|
||||
@@ -2843,7 +2843,7 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
*/
|
||||
public void changeLargeCrest(int crestId)
|
||||
{
|
||||
if (getCrestLargeId() != 0)
|
||||
if (_crestLargeId != 0)
|
||||
{
|
||||
CrestTable.getInstance().removeCrest(getCrestLargeId());
|
||||
}
|
||||
@@ -2854,12 +2854,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))
|
||||
|
||||
+1
-1
@@ -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,24 +94,24 @@ 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:
|
||||
{
|
||||
activeChar.sendPacket(new ExPledgeEmblem(getId(), getData()));
|
||||
path = "Crest.crest_" + Config.SERVER_ID + "_" + getId() + "_l";
|
||||
activeChar.sendPacket(new ExPledgeEmblem(_id, _data));
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,15 +150,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;
|
||||
}
|
||||
|
||||
@@ -182,7 +177,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
|
||||
@@ -244,7 +239,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)
|
||||
@@ -627,7 +622,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
@Override
|
||||
public Location getLocation()
|
||||
{
|
||||
return new Location(getX(), getY(), getZ(), getHeading(), getInstanceId());
|
||||
return new Location(_x.get(), _y.get(), _z.get(), _heading.get(), _instanceId.get());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -675,13 +670,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);
|
||||
@@ -719,7 +713,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
@Override
|
||||
public void setInstanceId(int instanceId)
|
||||
{
|
||||
if ((instanceId < 0) || (getInstanceId() == instanceId))
|
||||
if ((instanceId < 0) || (_instanceId.get() == instanceId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -734,9 +728,9 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
if (isPlayer())
|
||||
{
|
||||
final L2PcInstance player = getActingPlayer();
|
||||
if ((getInstanceId() > 0) && (oldI != null))
|
||||
if ((_instanceId.get() > 0) && (oldI != null))
|
||||
{
|
||||
oldI.removePlayer(getObjectId());
|
||||
oldI.removePlayer(_objectId);
|
||||
if (oldI.isShowTimer())
|
||||
{
|
||||
sendInstanceUpdate(oldI, true);
|
||||
@@ -744,7 +738,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
}
|
||||
if (instanceId > 0)
|
||||
{
|
||||
newI.addPlayer(getObjectId());
|
||||
newI.addPlayer(_objectId);
|
||||
if (newI.isShowTimer())
|
||||
{
|
||||
sendInstanceUpdate(newI, false);
|
||||
@@ -758,7 +752,7 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
else if (isNpc())
|
||||
{
|
||||
final L2Npc npc = (L2Npc) this;
|
||||
if ((getInstanceId() > 0) && (oldI != null))
|
||||
if ((_instanceId.get() > 0) && (oldI != null))
|
||||
{
|
||||
oldI.removeNpc(npc);
|
||||
}
|
||||
@@ -826,7 +820,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);
|
||||
}
|
||||
|
||||
@@ -851,7 +845,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;
|
||||
@@ -896,7 +890,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);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -920,19 +914,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
|
||||
@@ -944,6 +937,6 @@ public abstract class L2Object extends ListenersContainer implements IIdentifiab
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getClass().getSimpleName() + ":" + getName() + "[" + getObjectId() + "]";
|
||||
return getClass().getSimpleName() + ":" + _name + "[" + _objectId + "]";
|
||||
}
|
||||
}
|
||||
@@ -156,7 +156,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))
|
||||
{
|
||||
@@ -183,7 +183,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;
|
||||
@@ -248,7 +248,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
*/
|
||||
public void broadcastToPartyMembersNewLeader()
|
||||
{
|
||||
for (L2PcInstance member : getMembers())
|
||||
for (L2PcInstance member : _members)
|
||||
{
|
||||
if (member != null)
|
||||
{
|
||||
@@ -267,7 +267,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()))
|
||||
{
|
||||
@@ -282,7 +282,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
*/
|
||||
public void addPartyMember(L2PcInstance player)
|
||||
{
|
||||
if (getMembers().contains(player))
|
||||
if (_members.contains(player))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -293,14 +293,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) && pMember.hasSummon())
|
||||
{
|
||||
@@ -316,7 +316,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));
|
||||
@@ -337,7 +337,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
|
||||
// update partySpelled
|
||||
L2Summon summon;
|
||||
for (L2PcInstance member : getMembers())
|
||||
for (L2PcInstance member : _members)
|
||||
{
|
||||
if (member != null)
|
||||
{
|
||||
@@ -396,19 +396,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.isFestivalParticipant())
|
||||
@@ -473,25 +473,25 @@ public class L2Party extends AbstractPlayerGroup
|
||||
{
|
||||
player.sendPacket(new ExCloseMPCC());
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -553,7 +553,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
{
|
||||
if ((player != null) && !player.isInDuel())
|
||||
{
|
||||
if (getMembers().contains(player))
|
||||
if (_members.contains(player))
|
||||
{
|
||||
if (isLeader(player))
|
||||
{
|
||||
@@ -563,9 +563,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());
|
||||
@@ -598,7 +598,7 @@ public class L2Party extends AbstractPlayerGroup
|
||||
*/
|
||||
private L2PcInstance getPlayerByName(String name)
|
||||
{
|
||||
for (L2PcInstance member : getMembers())
|
||||
for (L2PcInstance member : _members)
|
||||
{
|
||||
if (member.getName().equalsIgnoreCase(name))
|
||||
{
|
||||
@@ -712,7 +712,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))
|
||||
{
|
||||
@@ -828,11 +828,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;
|
||||
}
|
||||
|
||||
|
||||
@@ -473,7 +473,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
|
||||
// Call the constructor of the L2Npc
|
||||
final L2Npc npc = _constructor.newInstance(_template);
|
||||
npc.setInstanceId(getInstanceId()); // Must be done before object is spawned into visible world
|
||||
npc.setInstanceId(_location.getInstanceId()); // Must be done before object is spawned into visible world
|
||||
if (isSummonSpawn)
|
||||
{
|
||||
npc.setShowSummonAnimation(isSummonSpawn);
|
||||
@@ -507,7 +507,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
newlocy = loc.getY();
|
||||
newlocz = loc.getZ();
|
||||
}
|
||||
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;
|
||||
@@ -515,9 +515,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
|
||||
@@ -547,16 +547,16 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
npc.getVariables().getSet().clear();
|
||||
}
|
||||
// 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());
|
||||
}
|
||||
|
||||
if (npc instanceof L2Attackable)
|
||||
@@ -567,7 +567,7 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
if (Config.CHAMPION_ENABLE)
|
||||
{
|
||||
// Set champion on next spawn
|
||||
if (npc.isMonster() && !getTemplate().isUndying() && !npc.isRaid() && !npc.isRaidMinion() && (Config.CHAMPION_FREQUENCY > 0) && (npc.getLevel() >= Config.CHAMP_MIN_LVL) && (npc.getLevel() <= Config.CHAMP_MAX_LVL) && (Config.CHAMPION_ENABLE_IN_INSTANCES || (getInstanceId() == 0)))
|
||||
if (npc.isMonster() && !_template.isUndying() && !npc.isRaid() && !npc.isRaidMinion() && (Config.CHAMPION_FREQUENCY > 0) && (npc.getLevel() >= Config.CHAMP_MIN_LVL) && (npc.getLevel() <= Config.CHAMP_MAX_LVL) && (Config.CHAMPION_ENABLE_IN_INSTANCES || (_location.getInstanceId() == 0)))
|
||||
{
|
||||
if (Rnd.get(100) < Config.CHAMPION_FREQUENCY)
|
||||
{
|
||||
@@ -733,6 +733,6 @@ public class L2Spawn implements IPositionable, IIdentifiable, INamable
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "L2Spawn ID: " + getId() + " " + getLocation();
|
||||
return "L2Spawn ID: " + _template.getId() + " " + _location;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -210,6 +210,6 @@ public class Location implements IPositionable
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return "[" + getClass().getSimpleName() + "] X: " + getX() + " Y: " + getY() + " Z: " + getZ() + " Heading: " + _heading + " InstanceId: " + _instanceId;
|
||||
return "[" + getClass().getSimpleName() + "] X: " + _x + " Y: " + _y + " Z: " + _z + " Heading: " + _heading + " InstanceId: " + _instanceId;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,16 +135,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;
|
||||
@@ -198,14 +198,14 @@ public final class MobGroup
|
||||
public L2ControllableMobInstance getRandomMob()
|
||||
{
|
||||
removeDead();
|
||||
return getActiveMobCount() == 0 ? null : getMobs().get(Rnd.nextInt(getActiveMobCount()));
|
||||
return getMobs().size() == 0 ? null : getMobs().get(Rnd.nextInt(getMobs().size()));
|
||||
}
|
||||
|
||||
public void unspawnGroup()
|
||||
{
|
||||
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.ENDING_PETITION_CONSULTATION_WITH_C1);
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -197,7 +197,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;
|
||||
@@ -211,13 +211,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;
|
||||
@@ -267,7 +267,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;
|
||||
@@ -314,7 +314,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;
|
||||
@@ -606,12 +606,12 @@ public class TradeList
|
||||
if (!getOwner().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())))
|
||||
{
|
||||
partnerList.getOwner().sendPacket(SystemMessageId.YOUR_INVENTORY_IS_FULL);
|
||||
getOwner().sendPacket(SystemMessageId.YOUR_INVENTORY_IS_FULL);
|
||||
_owner.sendPacket(SystemMessageId.YOUR_INVENTORY_IS_FULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -620,7 +620,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);
|
||||
|
||||
_owner.sendPacket(ownerIU != null ? ownerIU : new ItemList(_owner, false));
|
||||
@@ -638,7 +638,7 @@ public class TradeList
|
||||
}
|
||||
// Finish the trade
|
||||
partnerList.getOwner().onTradeFinish(success);
|
||||
getOwner().onTradeFinish(success);
|
||||
_owner.onTradeFinish(success);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -694,7 +694,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;
|
||||
|
||||
+14
-14
@@ -232,7 +232,7 @@ public class L2Attackable extends L2Npc
|
||||
@Override
|
||||
public void reduceCurrentHp(double damage, L2Character attacker, boolean awake, boolean isDOT, Skill skill)
|
||||
{
|
||||
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
|
||||
{
|
||||
@@ -452,7 +452,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;
|
||||
@@ -461,8 +461,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);
|
||||
@@ -558,7 +558,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;
|
||||
@@ -569,8 +569,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);
|
||||
@@ -959,7 +959,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
|
||||
}
|
||||
@@ -999,7 +999,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
|
||||
}
|
||||
@@ -1009,7 +1009,7 @@ public class L2Attackable extends L2Npc
|
||||
}
|
||||
|
||||
// Broadcast message if RaidBoss was defeated
|
||||
if (isRaid() && !isRaidMinion() && (drop.getCount() > 0))
|
||||
if (_isRaid && !_isRaidMinion && (drop.getCount() > 0))
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_DIED_AND_DROPPED_S3_S2);
|
||||
sm.addString(getName());
|
||||
@@ -1021,7 +1021,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)))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1201,7 +1201,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))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -1405,7 +1405,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)
|
||||
@@ -1695,7 +1695,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. */
|
||||
|
||||
+133
-133
@@ -481,7 +481,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;
|
||||
}
|
||||
@@ -516,7 +516,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
try
|
||||
{
|
||||
if (!isTeleporting())
|
||||
if (!_isTeleporting)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -581,8 +581,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))
|
||||
{
|
||||
@@ -622,19 +622,19 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
*/
|
||||
public void broadcastStatusUpdate()
|
||||
{
|
||||
if (getStatus().getStatusListener().isEmpty() || !needHpUpdate())
|
||||
if (_status.getStatusListener().isEmpty() || !needHpUpdate())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// Create the Server->Client packet StatusUpdate with current HP
|
||||
final StatusUpdate su = new StatusUpdate(this);
|
||||
su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());
|
||||
su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
|
||||
su.addAttribute(StatusUpdate.MAX_HP, _stat.getMaxHp());
|
||||
su.addAttribute(StatusUpdate.CUR_HP, (int) _status.getCurrentHp());
|
||||
|
||||
// Go through the StatusListener
|
||||
// Send the Server->Client packet StatusUpdate with current HP and MP
|
||||
for (L2Character temp : getStatus().getStatusListener())
|
||||
for (L2Character temp : _status.getStatusListener())
|
||||
{
|
||||
if (temp != null)
|
||||
{
|
||||
@@ -808,7 +808,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
mpConsume = (int) calcStat(Stats.BOW_MP_CONSUME_RATE, mpConsume, null, null);
|
||||
|
||||
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);
|
||||
@@ -820,7 +820,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);
|
||||
}
|
||||
|
||||
// Set the period of bow no re-use
|
||||
@@ -1340,8 +1340,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
private boolean doAttackHitByPole(Attack attack, L2Character target, int sAtk)
|
||||
{
|
||||
// double angleChar;
|
||||
final int maxRadius = getStat().getPhysicalAttackRange();
|
||||
final int maxAngleDiff = getStat().getPhysicalAttackAngle();
|
||||
final int maxRadius = _stat.getPhysicalAttackRange();
|
||||
final int maxAngleDiff = _stat.getPhysicalAttackAngle();
|
||||
|
||||
// o1 x: 83420 y: 148158 (Giran)
|
||||
// o2 x: 83379 y: 148081 (Giran)
|
||||
@@ -1368,7 +1368,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
// angleChar = Util.convertHeadingToDegree(getHeading());
|
||||
|
||||
// H5 Changes: without Polearm Mastery (skill 216) max simultaneous attacks is 3 (1 by default + 2 in skill 3599).
|
||||
final int attackRandomCountMax = (int) getStat().calcStat(Stats.ATTACK_COUNT_MAX, 1, null, null);
|
||||
final int attackRandomCountMax = (int) _stat.calcStat(Stats.ATTACK_COUNT_MAX, 1, null, null);
|
||||
int attackcount = 0;
|
||||
|
||||
// if (angleChar <= 0) angleChar += 360;
|
||||
@@ -1392,7 +1392,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isAttackable() && obj.isPlayer() && getTarget().isAttackable())
|
||||
if (isAttackable() && obj.isPlayer() && _target.isAttackable())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -1636,7 +1636,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
else
|
||||
{
|
||||
target = (L2Character) getTarget();
|
||||
target = (L2Character) _target;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1741,7 +1741,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// queue herbs and potions
|
||||
if (isCastingSimultaneouslyNow() && simultaneously)
|
||||
if (_isCastingSimultaneouslyNow && simultaneously)
|
||||
{
|
||||
ThreadPool.schedule(() -> beginCast(skill, simultaneously, target, targets), 100);
|
||||
return;
|
||||
@@ -1795,12 +1795,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Check if this skill consume mp on start casting
|
||||
final int initmpcons = getStat().getMpInitialConsume(skill);
|
||||
final int initmpcons = _stat.getMpInitialConsume(skill);
|
||||
if (initmpcons > 0)
|
||||
{
|
||||
getStatus().reduceMp(initmpcons);
|
||||
_status.reduceMp(initmpcons);
|
||||
final StatusUpdate su = new StatusUpdate(this);
|
||||
su.addAttribute(StatusUpdate.CUR_MP, (int) getCurrentMp());
|
||||
su.addAttribute(StatusUpdate.CUR_MP, (int) _status.getCurrentMp());
|
||||
sendPacket(su);
|
||||
}
|
||||
|
||||
@@ -1965,7 +1965,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Check if the caster has enough MP
|
||||
if (getCurrentMp() < (getStat().getMpConsume(skill) + getStat().getMpInitialConsume(skill)))
|
||||
if (_status.getCurrentMp() < (_stat.getMpConsume(skill) + _stat.getMpInitialConsume(skill)))
|
||||
{
|
||||
// Send a System Message to the caster
|
||||
sendPacket(SystemMessageId.NOT_ENOUGH_MP);
|
||||
@@ -1976,7 +1976,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Check if the caster has enough HP
|
||||
if (getCurrentHp() <= skill.getHpConsume())
|
||||
if (_status.getCurrentHp() <= skill.getHpConsume())
|
||||
{
|
||||
// Send a System Message to the caster
|
||||
sendPacket(SystemMessageId.NOT_ENOUGH_HP);
|
||||
@@ -2402,7 +2402,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
// killing is only possible one time
|
||||
synchronized (this)
|
||||
{
|
||||
if (isDead())
|
||||
if (_isDead)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -2419,7 +2419,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
stopMove(null);
|
||||
|
||||
// Stop HP/MP/CP Regeneration task
|
||||
getStatus().stopHpMpRegeneration();
|
||||
_status.stopHpMpRegeneration();
|
||||
|
||||
stopAllEffectsExceptThoseThatLastThroughDeath();
|
||||
|
||||
@@ -2481,26 +2481,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
|
||||
@@ -2651,7 +2651,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
*/
|
||||
public boolean isAttackingDisabled()
|
||||
{
|
||||
return isFlying() || isStunned() || isSleeping() || isAttackingNow() || isAlikeDead() || isParalyzed() || isPhysicalAttackMuted() || isCoreAIDisabled();
|
||||
return _isFlying || isStunned() || isSleeping() || isAttackingNow() || isAlikeDead() || isParalyzed() || isPhysicalAttackMuted() || _AIdisabled;
|
||||
}
|
||||
|
||||
public final Calculator[] getCalculators()
|
||||
@@ -2716,7 +2716,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 isStunned() || isRooted() || isSleeping() || isOverloaded() || isParalyzed() || isImmobilized() || isAlikeDead() || isTeleporting();
|
||||
return isStunned() || isRooted() || isSleeping() || _isOverloaded || isParalyzed() || _isImmobilized || isAlikeDead() || _isTeleporting;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2753,7 +2753,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)
|
||||
@@ -2819,7 +2819,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
_isRunning = value;
|
||||
if (getRunSpeed() != 0)
|
||||
if (_stat.getRunSpeed() != 0)
|
||||
{
|
||||
broadcastPacket(new ChangeMoveType(this));
|
||||
}
|
||||
@@ -2844,7 +2844,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));
|
||||
}
|
||||
@@ -3052,15 +3052,15 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (ave.isEvent())
|
||||
{
|
||||
return (getAbnormalVisualEffectEvent() & ave.getMask()) == ave.getMask();
|
||||
return (_abnormalVisualEffectsEvent & ave.getMask()) == ave.getMask();
|
||||
}
|
||||
|
||||
if (ave.isSpecial())
|
||||
{
|
||||
return (getAbnormalVisualEffectSpecial() & ave.getMask()) == ave.getMask();
|
||||
return (_abnormalVisualEffectsSpecial & ave.getMask()) == ave.getMask();
|
||||
}
|
||||
|
||||
return (getAbnormalVisualEffects() & ave.getMask()) == ave.getMask();
|
||||
return (_abnormalVisualEffects & ave.getMask()) == ave.getMask();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3289,7 +3289,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (removeEffects)
|
||||
{
|
||||
getEffectList().stopSkillEffects(false, AbnormalType.TRANSFORM);
|
||||
_effectList.stopSkillEffects(false, AbnormalType.TRANSFORM);
|
||||
}
|
||||
|
||||
// if this is a player instance, then untransform, also set the transform_id column equal to 0 if not cursed.
|
||||
@@ -3634,11 +3634,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (stat == Stats.POWER_ATTACK_SPEED)
|
||||
{
|
||||
su.addAttribute(StatusUpdate.ATK_SPD, (int) getPAtkSpd());
|
||||
su.addAttribute(StatusUpdate.ATK_SPD, (int) _stat.getPAtkSpd());
|
||||
}
|
||||
else if (stat == Stats.MAGIC_ATTACK_SPEED)
|
||||
{
|
||||
su.addAttribute(StatusUpdate.CAST_SPD, getMAtkSpd());
|
||||
su.addAttribute(StatusUpdate.CAST_SPD, _stat.getMAtkSpd());
|
||||
}
|
||||
else if (stat == Stats.MOVE_SPEED)
|
||||
{
|
||||
@@ -3680,7 +3680,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));
|
||||
}
|
||||
@@ -3842,7 +3842,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
*/
|
||||
public final void abortCast()
|
||||
{
|
||||
if (isCastingNow() || isCastingSimultaneouslyNow())
|
||||
if (_isCastingNow || _isCastingSimultaneouslyNow)
|
||||
{
|
||||
Future<?> future = _skillCast;
|
||||
// cancels the skill hit scheduled task
|
||||
@@ -3949,7 +3949,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
|
||||
&& !isFloating)
|
||||
@@ -3964,7 +3964,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;
|
||||
}
|
||||
|
||||
@@ -4168,7 +4168,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;
|
||||
@@ -4195,7 +4195,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);
|
||||
@@ -4273,7 +4273,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)
|
||||
@@ -4402,7 +4402,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);
|
||||
}
|
||||
@@ -4449,7 +4449,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
|
||||
@@ -4769,11 +4769,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
if (!isBow) // Do not absorb if weapon is of type bow
|
||||
{
|
||||
// Absorb HP from the damage inflicted
|
||||
double absorbPercent = getStat().calcStat(Stats.ABSORB_DAMAGE_PERCENT, 0, null, null);
|
||||
double absorbPercent = _stat.calcStat(Stats.ABSORB_DAMAGE_PERCENT, 0, null, null);
|
||||
|
||||
if (absorbPercent > 0)
|
||||
{
|
||||
final int maxCanAbsorb = (int) (getMaxRecoverableHp() - getCurrentHp());
|
||||
final int maxCanAbsorb = (int) (_stat.getMaxRecoverableHp() - _status.getCurrentHp());
|
||||
int absorbDamage = (int) ((absorbPercent / 100.) * damage);
|
||||
|
||||
if (absorbDamage > maxCanAbsorb)
|
||||
@@ -4783,16 +4783,16 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
if (absorbDamage > 0)
|
||||
{
|
||||
setCurrentHp(getCurrentHp() + absorbDamage);
|
||||
setCurrentHp(_status.getCurrentHp() + absorbDamage);
|
||||
}
|
||||
}
|
||||
|
||||
// Absorb MP from the damage inflicted
|
||||
absorbPercent = getStat().calcStat(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0, null, null);
|
||||
absorbPercent = _stat.calcStat(Stats.ABSORB_MANA_DAMAGE_PERCENT, 0, null, null);
|
||||
|
||||
if (absorbPercent > 0)
|
||||
{
|
||||
final int maxCanAbsorb = (int) (getMaxRecoverableMp() - getCurrentMp());
|
||||
final int maxCanAbsorb = (int) (_stat.getMaxRecoverableMp() - _status.getCurrentMp());
|
||||
int absorbDamage = (int) ((absorbPercent / 100.) * damage);
|
||||
|
||||
if (absorbDamage > maxCanAbsorb)
|
||||
@@ -4802,7 +4802,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
if (absorbDamage > 0)
|
||||
{
|
||||
setCurrentMp(getCurrentMp() + absorbDamage);
|
||||
setCurrentMp(_status.getCurrentMp() + absorbDamage);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4876,7 +4876,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
public void breakCast()
|
||||
{
|
||||
// damage can only cancel magical & static skills
|
||||
if (isCastingNow() && canAbortCast() && (getLastSkillCast() != null) && (getLastSkillCast().isMagic() || getLastSkillCast().isStatic()))
|
||||
if (_isCastingNow && canAbortCast() && (_lastSkillCast != null) && (_lastSkillCast.isMagic() || _lastSkillCast.isStatic()))
|
||||
{
|
||||
// Abort the cast of the L2Character and send Server->Client MagicSkillCanceld/ActionFailed packet.
|
||||
abortCast();
|
||||
@@ -5044,7 +5044,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
*/
|
||||
public int calculateTimeBetweenAttacks()
|
||||
{
|
||||
return (int) (500000 / getPAtkSpd());
|
||||
return (int) (500000 / _stat.getPAtkSpd());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5059,11 +5059,11 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
case BOW:
|
||||
{
|
||||
return (int) ((1500 * 333 * getStat().getWeaponReuseModifier(null)) / getStat().getPAtkSpd());
|
||||
return (int) ((1500 * 333 * _stat.getWeaponReuseModifier(null)) / _stat.getPAtkSpd());
|
||||
}
|
||||
case CROSSBOW:
|
||||
{
|
||||
return (int) ((1200 * 333 * getStat().getWeaponReuseModifier(null)) / getStat().getPAtkSpd());
|
||||
return (int) ((1200 * 333 * _stat.getWeaponReuseModifier(null)) / _stat.getPAtkSpd());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5073,7 +5073,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (int) ((weapon.getReuseDelay() * 333) / getPAtkSpd());
|
||||
return (int) ((weapon.getReuseDelay() * 333) / _stat.getPAtkSpd());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5140,16 +5140,16 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
if (oldSkill != null)
|
||||
{
|
||||
// Stop casting if this skill is used right now
|
||||
if ((getLastSkillCast() != null) && isCastingNow())
|
||||
if ((_lastSkillCast != null) && _isCastingNow)
|
||||
{
|
||||
if (oldSkill.getId() == getLastSkillCast().getId())
|
||||
if (oldSkill.getId() == _lastSkillCast.getId())
|
||||
{
|
||||
abortCast();
|
||||
}
|
||||
}
|
||||
if ((getLastSimultaneousSkillCast() != null) && isCastingSimultaneouslyNow())
|
||||
if ((_lastSimultaneousSkillCast != null) && _isCastingSimultaneouslyNow)
|
||||
{
|
||||
if (oldSkill.getId() == getLastSimultaneousSkillCast().getId())
|
||||
if (oldSkill.getId() == _lastSimultaneousSkillCast.getId())
|
||||
{
|
||||
abortCast();
|
||||
}
|
||||
@@ -5288,7 +5288,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (target instanceof L2Character)
|
||||
{
|
||||
if (!isInsideRadius(target.getX(), target.getY(), target.getZ(), escapeRange + getTemplate().getCollisionRadius(), true, false))
|
||||
if (!isInsideRadius(target.getX(), target.getY(), target.getZ(), escapeRange + _template.getCollisionRadius(), true, false))
|
||||
{
|
||||
skipRange++;
|
||||
continue;
|
||||
@@ -5350,7 +5350,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
// Ensure that a cast is in progress
|
||||
// Check if player is using fake death.
|
||||
// Static skills can be used while faking death.
|
||||
if ((mut.isSimultaneous() && !isCastingSimultaneouslyNow()) || (!mut.isSimultaneous() && !isCastingNow()) || (isAlikeDead() && !skill.isStatic()))
|
||||
if ((mut.isSimultaneous() && !_isCastingSimultaneouslyNow) || (!mut.isSimultaneous() && !_isCastingNow) || (isAlikeDead() && !skill.isStatic()))
|
||||
{
|
||||
// now cancels both, simultaneous and normal
|
||||
getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
|
||||
@@ -5417,19 +5417,19 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
boolean isSendStatus = false;
|
||||
|
||||
// Consume MP of the L2Character and Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
|
||||
final double mpConsume = getStat().getMpConsume(skill);
|
||||
final double mpConsume = _stat.getMpConsume(skill);
|
||||
|
||||
if (mpConsume > 0)
|
||||
{
|
||||
if (mpConsume > getCurrentMp())
|
||||
if (mpConsume > _status.getCurrentMp())
|
||||
{
|
||||
sendPacket(SystemMessageId.NOT_ENOUGH_MP);
|
||||
abortCast();
|
||||
return;
|
||||
}
|
||||
|
||||
getStatus().reduceMp(mpConsume);
|
||||
su.addAttribute(StatusUpdate.CUR_MP, (int) getCurrentMp());
|
||||
_status.reduceMp(mpConsume);
|
||||
su.addAttribute(StatusUpdate.CUR_MP, (int) _status.getCurrentMp());
|
||||
isSendStatus = true;
|
||||
}
|
||||
|
||||
@@ -5438,16 +5438,16 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
final double consumeHp = skill.getHpConsume();
|
||||
|
||||
if (consumeHp >= getCurrentHp())
|
||||
if (consumeHp >= _status.getCurrentHp())
|
||||
{
|
||||
sendPacket(SystemMessageId.NOT_ENOUGH_HP);
|
||||
abortCast();
|
||||
return;
|
||||
}
|
||||
|
||||
getStatus().reduceHp(consumeHp, this, true);
|
||||
_status.reduceHp(consumeHp, this, true);
|
||||
|
||||
su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
|
||||
su.addAttribute(StatusUpdate.CUR_HP, (int) _status.getCurrentHp());
|
||||
isSendStatus = true;
|
||||
}
|
||||
|
||||
@@ -5535,7 +5535,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
}
|
||||
|
||||
// Attack target after skill use
|
||||
if ((skill.nextActionIsAttack()) && (getTarget() instanceof L2Character) && (getTarget() != this) && (target != null) && (getTarget() == target) && target.canBeAttacked())
|
||||
if ((skill.nextActionIsAttack()) && (_target instanceof L2Character) && (_target != this) && (target != null) && (_target == target) && target.canBeAttacked())
|
||||
{
|
||||
if ((getAI().getNextIntention() == null) || (getAI().getNextIntention().getCtrlIntention() != CtrlIntention.AI_INTENTION_MOVE_TO))
|
||||
{
|
||||
@@ -5869,7 +5869,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public boolean isBehindTarget()
|
||||
{
|
||||
return isBehind(getTarget());
|
||||
return isBehind(_target);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -5928,7 +5928,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public boolean isInFrontOfTarget()
|
||||
{
|
||||
final L2Object target = getTarget();
|
||||
final L2Object target = _target;
|
||||
if (target instanceof L2Character)
|
||||
{
|
||||
return isInFrontOf((L2Character) target);
|
||||
@@ -6005,189 +6005,189 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public final double calcStat(Stats stat, double init)
|
||||
{
|
||||
return getStat().calcStat(stat, init, null, null);
|
||||
return _stat.calcStat(stat, init, null, null);
|
||||
}
|
||||
|
||||
// Stat - NEED TO REMOVE ONCE L2CHARSTAT IS COMPLETE
|
||||
public final double calcStat(Stats stat, double init, L2Character target, Skill skill)
|
||||
{
|
||||
return getStat().calcStat(stat, init, target, skill);
|
||||
return _stat.calcStat(stat, init, target, skill);
|
||||
}
|
||||
|
||||
public int getAccuracy()
|
||||
{
|
||||
return getStat().getAccuracy();
|
||||
return _stat.getAccuracy();
|
||||
}
|
||||
|
||||
public final float getAttackSpeedMultiplier()
|
||||
{
|
||||
return getStat().getAttackSpeedMultiplier();
|
||||
return _stat.getAttackSpeedMultiplier();
|
||||
}
|
||||
|
||||
public final double getCriticalDmg(L2Character target, double init)
|
||||
{
|
||||
return getStat().getCriticalDmg(target, init);
|
||||
return _stat.getCriticalDmg(target, init);
|
||||
}
|
||||
|
||||
public int getCriticalHit(L2Character target, Skill skill)
|
||||
{
|
||||
return getStat().getCriticalHit(target, skill);
|
||||
return _stat.getCriticalHit(target, skill);
|
||||
}
|
||||
|
||||
public int getEvasionRate(L2Character target)
|
||||
{
|
||||
return getStat().getEvasionRate(target);
|
||||
return _stat.getEvasionRate(target);
|
||||
}
|
||||
|
||||
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 double getMAtk(L2Character target, Skill skill)
|
||||
{
|
||||
return getStat().getMAtk(target, skill);
|
||||
return _stat.getMAtk(target, skill);
|
||||
}
|
||||
|
||||
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(L2Character target, Skill skill)
|
||||
{
|
||||
return getStat().getMCriticalHit(target, skill);
|
||||
return _stat.getMCriticalHit(target, skill);
|
||||
}
|
||||
|
||||
public double getMDef(L2Character target, Skill skill)
|
||||
{
|
||||
return getStat().getMDef(target, skill);
|
||||
return _stat.getMDef(target, skill);
|
||||
}
|
||||
|
||||
public double getMReuseRate(Skill skill)
|
||||
{
|
||||
return getStat().getMReuseRate(skill);
|
||||
return _stat.getMReuseRate(skill);
|
||||
}
|
||||
|
||||
public double getPAtk(L2Character target)
|
||||
{
|
||||
return getStat().getPAtk(target);
|
||||
return _stat.getPAtk(target);
|
||||
}
|
||||
|
||||
public double getPAtkSpd()
|
||||
{
|
||||
return getStat().getPAtkSpd();
|
||||
return _stat.getPAtkSpd();
|
||||
}
|
||||
|
||||
public double getPDef(L2Character target)
|
||||
{
|
||||
return getStat().getPDef(target);
|
||||
return _stat.getPDef(target);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
// Status - NEED TO REMOVE ONCE L2CHARTATUS IS COMPLETE
|
||||
public void addStatusListener(L2Character object)
|
||||
{
|
||||
getStatus().addStatusListener(object);
|
||||
_status.addStatusListener(object);
|
||||
}
|
||||
|
||||
public void reduceCurrentHp(double i, L2Character attacker, Skill skill)
|
||||
@@ -6204,63 +6204,63 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
if (Config.CHAMPION_ENABLE && isChampion() && (Config.CHAMPION_HP != 0))
|
||||
{
|
||||
getStatus().reduceHp(i / Config.CHAMPION_HP, attacker, awake, isDOT, false);
|
||||
_status.reduceHp(i / Config.CHAMPION_HP, attacker, awake, isDOT, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
getStatus().reduceHp(i, attacker, awake, isDOT, false);
|
||||
_status.reduceHp(i, attacker, awake, isDOT, false);
|
||||
}
|
||||
}
|
||||
|
||||
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 void setCurrentCp(double newCp)
|
||||
{
|
||||
getStatus().setCurrentCp(newCp);
|
||||
_status.setCurrentCp(newCp);
|
||||
}
|
||||
|
||||
public final double getCurrentHp()
|
||||
{
|
||||
return getStatus().getCurrentHp();
|
||||
return _status.getCurrentHp();
|
||||
}
|
||||
|
||||
public final void setCurrentHp(double newHp)
|
||||
{
|
||||
getStatus().setCurrentHp(newHp);
|
||||
_status.setCurrentHp(newHp);
|
||||
}
|
||||
|
||||
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 void setCurrentMp(double newMp)
|
||||
{
|
||||
getStatus().setCurrentMp(newMp);
|
||||
_status.setCurrentMp(newMp);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -6325,17 +6325,17 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public byte getAttackElement()
|
||||
{
|
||||
return getStat().getAttackElement();
|
||||
return _stat.getAttackElement();
|
||||
}
|
||||
|
||||
public int getAttackElementValue(byte attackAttribute)
|
||||
{
|
||||
return getStat().getAttackElementValue(attackAttribute);
|
||||
return _stat.getAttackElementValue(attackAttribute);
|
||||
}
|
||||
|
||||
public int getDefenseElementValue(byte defenseAttribute)
|
||||
{
|
||||
return getStat().getDefenseElementValue(defenseAttribute);
|
||||
return _stat.getDefenseElementValue(defenseAttribute);
|
||||
}
|
||||
|
||||
public final void startPhysicalAttackMuted()
|
||||
@@ -6634,7 +6634,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
{
|
||||
return weapon.getItemType();
|
||||
}
|
||||
return getTemplate().getBaseAttackType();
|
||||
return _template.getBaseAttackType();
|
||||
}
|
||||
|
||||
public final boolean isInCategory(CategoryType type)
|
||||
@@ -6747,7 +6747,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
|
||||
@@ -6777,7 +6777,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe
|
||||
|
||||
public Race getRace()
|
||||
{
|
||||
return getTemplate().getRace();
|
||||
return _template.getRace();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -162,18 +162,18 @@ public abstract class L2Decoy 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public boolean isRandomAnimationEnabled()
|
||||
{
|
||||
return !isFakePlayer() && _isRandomAnimationEnabled;
|
||||
return !_isFakePlayer && _isRandomAnimationEnabled;
|
||||
}
|
||||
|
||||
public void setRandomWalking(boolean enabled)
|
||||
@@ -421,7 +421,7 @@ public class L2Npc extends L2Character
|
||||
return;
|
||||
}
|
||||
|
||||
if (isFakePlayer())
|
||||
if (_isFakePlayer)
|
||||
{
|
||||
player.sendPacket(new FakePlayerInfo(this));
|
||||
}
|
||||
@@ -562,7 +562,7 @@ public class L2Npc extends L2Character
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (isBusy())
|
||||
else if (_isBusy)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -708,13 +708,13 @@ public class L2Npc extends L2Character
|
||||
{
|
||||
// if (canInteract(player))
|
||||
{
|
||||
if (isBusy() && (getBusyMessage().length() > 0))
|
||||
if (_isBusy && (_busyMessage.length() > 0))
|
||||
{
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
|
||||
final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
|
||||
html.setFile(player, "data/html/npcbusy.htm");
|
||||
html.replace("%busymessage%", getBusyMessage());
|
||||
html.replace("%busymessage%", _busyMessage);
|
||||
html.replace("%npcname%", getName());
|
||||
html.replace("%playername%", player.getName());
|
||||
player.sendPacket(html);
|
||||
@@ -895,7 +895,7 @@ public class L2Npc extends L2Character
|
||||
*/
|
||||
public void showChatWindow(L2PcInstance player, int val)
|
||||
{
|
||||
if (!isTalkable())
|
||||
if (!_isTalkable)
|
||||
{
|
||||
player.sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return;
|
||||
@@ -1224,7 +1224,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) && (getKarma() < 0))
|
||||
@@ -1346,7 +1346,7 @@ public class L2Npc extends L2Character
|
||||
@Override
|
||||
public void onDecay()
|
||||
{
|
||||
if (isDecayed())
|
||||
if (_isDecayed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1431,7 +1431,7 @@ public class L2Npc extends L2Character
|
||||
|
||||
public void endDecayTask()
|
||||
{
|
||||
if (!isDecayed())
|
||||
if (!_isDecayed)
|
||||
{
|
||||
DecayTaskManager.getInstance().cancel(this);
|
||||
onDecay();
|
||||
@@ -1506,7 +1506,7 @@ public class L2Npc extends L2Character
|
||||
activeChar.sendMessage("Added NPC: " + getName());
|
||||
}
|
||||
|
||||
if (isFakePlayer())
|
||||
if (_isFakePlayer)
|
||||
{
|
||||
activeChar.sendPacket(new FakePlayerInfo(this));
|
||||
}
|
||||
@@ -1558,7 +1558,7 @@ public class L2Npc extends L2Character
|
||||
{
|
||||
ThreadPool.schedule(() ->
|
||||
{
|
||||
if (!isDecayed())
|
||||
if (!_isDecayed)
|
||||
{
|
||||
deleteMe();
|
||||
}
|
||||
@@ -1649,7 +1649,7 @@ public class L2Npc extends L2Character
|
||||
@Override
|
||||
public void rechargeShots(boolean physical, boolean magic)
|
||||
{
|
||||
if (isFakePlayer() && Config.FAKE_PLAYER_USE_SHOTS)
|
||||
if (_isFakePlayer && Config.FAKE_PLAYER_USE_SHOTS)
|
||||
{
|
||||
if (physical)
|
||||
{
|
||||
@@ -1755,7 +1755,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()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+62
-63
@@ -124,15 +124,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
|
||||
@@ -235,19 +235,19 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public final int getKarma()
|
||||
{
|
||||
return getOwner() != null ? getOwner().getKarma() : 0;
|
||||
return _owner != null ? _owner.getKarma() : 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()
|
||||
@@ -306,8 +306,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 ->
|
||||
{
|
||||
@@ -319,7 +318,7 @@ public abstract class L2Summon extends L2Playable
|
||||
AggroInfo info = TgMob.getAggroList().get(this);
|
||||
if (info != null)
|
||||
{
|
||||
TgMob.addDamageHate(owner, info.getDamage(), info.getHate());
|
||||
TgMob.addDamageHate(_owner, info.getDamage(), info.getHate());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -374,7 +373,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();
|
||||
if (owner != null)
|
||||
@@ -400,12 +399,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);
|
||||
}
|
||||
}
|
||||
abortAttack();
|
||||
@@ -458,7 +457,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
|
||||
{
|
||||
@@ -527,7 +526,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public boolean isInvul()
|
||||
{
|
||||
return super.isInvul() || getOwner().isSpawnProtected();
|
||||
return super.isInvul() || _owner.isSpawnProtected();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -572,7 +571,7 @@ public abstract class L2Summon extends L2Playable
|
||||
public boolean useMagic(Skill skill, 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;
|
||||
}
|
||||
@@ -591,7 +590,7 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
|
||||
// Set current pet skill
|
||||
getOwner().setCurrentPetSkill(skill, forceUse, dontMove);
|
||||
_owner.setCurrentPetSkill(skill, forceUse, dontMove);
|
||||
|
||||
// Get the target for the skill
|
||||
L2Object target = null;
|
||||
@@ -600,7 +599,7 @@ public abstract class L2Summon extends L2Playable
|
||||
// OWNER_PET should be cast even if no target has been found
|
||||
case OWNER_PET:
|
||||
{
|
||||
target = getOwner();
|
||||
target = _owner;
|
||||
break;
|
||||
}
|
||||
// PARTY, AURA, SELF should be cast even if no target has been found
|
||||
@@ -662,13 +661,13 @@ public abstract class L2Summon extends L2Playable
|
||||
// Check if this is bad magic skill
|
||||
if (skill.isBad())
|
||||
{
|
||||
if (getOwner() == target)
|
||||
if (_owner == target)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
// Summons can cast skills on NPCs inside peace zones.
|
||||
if (isInsidePeaceZone(this, target) && !getOwner().getAccessLevel().allowPeaceAttack())
|
||||
if (isInsidePeaceZone(this, target) && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// If summon or target is in a peace zone, send a system message:
|
||||
sendPacket(SystemMessageId.YOU_MAY_NOT_ATTACK_THIS_TARGET_IN_A_PEACEFUL_ZONE);
|
||||
@@ -676,13 +675,13 @@ public abstract class L2Summon extends L2Playable
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
|
||||
if ((target.getActingPlayer() != null) && (getOwner().getSiegeState() > 0) && getOwner().isInsideZone(ZoneId.SIEGE) && (target.getActingPlayer().getSiegeState() == getOwner().getSiegeState()) && (target.getActingPlayer() != getOwner()) && (target.getActingPlayer().getSiegeSide() == getOwner().getSiegeSide()))
|
||||
if ((target.getActingPlayer() != null) && (_owner.getSiegeState() > 0) && _owner.isInsideZone(ZoneId.SIEGE) && (target.getActingPlayer().getSiegeState() == _owner.getSiegeState()) && (target.getActingPlayer() != _owner) && (target.getActingPlayer().getSiegeSide() == _owner.getSiegeSide()))
|
||||
{
|
||||
if (TerritoryWarManager.getInstance().isTWInProgress())
|
||||
{
|
||||
@@ -699,7 +698,7 @@ public abstract class L2Summon extends L2Playable
|
||||
// Check if the target is attackable
|
||||
if (target.isDoor())
|
||||
{
|
||||
if (!target.isAutoAttackable(getOwner()))
|
||||
if (!target.isAutoAttackable(_owner))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -707,7 +706,7 @@ public abstract class L2Summon extends L2Playable
|
||||
else
|
||||
{
|
||||
// Summons can cast skills on NPCs inside peace zones.
|
||||
if (!target.canBeAttacked() && !getOwner().getAccessLevel().allowPeaceAttack())
|
||||
if (!target.canBeAttacked() && !_owner.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -731,7 +730,7 @@ public abstract class L2Summon extends L2Playable
|
||||
|
||||
if (value)
|
||||
{
|
||||
_previousFollowStatus = getFollowStatus();
|
||||
_previousFollowStatus = _follow;
|
||||
// if immobilized temporarily disable follow mode
|
||||
if (_previousFollowStatus)
|
||||
{
|
||||
@@ -753,13 +752,13 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void sendDamageMessage(L2Character target, int damage, boolean mcrit, boolean pcrit, 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 (pcrit || mcrit)
|
||||
{
|
||||
@@ -773,7 +772,7 @@ 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);
|
||||
}
|
||||
@@ -800,7 +799,7 @@ public abstract class L2Summon extends L2Playable
|
||||
public void reduceCurrentHp(double damage, L2Character attacker, Skill skill)
|
||||
{
|
||||
super.reduceCurrentHp(damage, attacker, skill);
|
||||
if ((getOwner() != null) && (attacker != null))
|
||||
if ((_owner != null) && (attacker != null))
|
||||
{
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.C1_HAS_RECEIVED_S3_DAMAGE_FROM_C2);
|
||||
sm.addNpcName(this);
|
||||
@@ -813,7 +812,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public void doCast(Skill skill)
|
||||
{
|
||||
final L2PcInstance actingPlayer = getActingPlayer();
|
||||
final L2PcInstance actingPlayer = getOwner();
|
||||
if (!actingPlayer.checkPvpSkill(getTarget(), skill) && !actingPlayer.getAccessLevel().allowPeaceAttack())
|
||||
{
|
||||
// Send a System Message to the L2PcInstance
|
||||
@@ -830,18 +829,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;
|
||||
}
|
||||
@@ -852,10 +851,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));
|
||||
}
|
||||
updateEffectIcons(true);
|
||||
}
|
||||
@@ -864,7 +863,7 @@ public abstract class L2Summon extends L2Playable
|
||||
{
|
||||
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
||||
{
|
||||
if ((player == getOwner()))
|
||||
if ((player == _owner))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -891,7 +890,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, 0));
|
||||
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
|
||||
@@ -917,7 +916,7 @@ public abstract class L2Summon extends L2Playable
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return super.toString() + "(" + getId() + ") Owner: " + getOwner();
|
||||
return super.toString() + "(" + getId() + ") Owner: " + _owner;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -950,16 +949,16 @@ public abstract class L2Summon extends L2Playable
|
||||
*/
|
||||
public void doAttack()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
if (_owner != null)
|
||||
{
|
||||
final L2Object target = getOwner().getTarget();
|
||||
final L2Object target = _owner.getTarget();
|
||||
if (target != null)
|
||||
{
|
||||
setTarget(target);
|
||||
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
if (target.isFakePlayer())
|
||||
{
|
||||
getOwner().updatePvPStatus();
|
||||
_owner.updatePvPStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -972,13 +971,13 @@ public abstract class L2Summon extends L2Playable
|
||||
*/
|
||||
public final boolean canAttack(boolean ctrlPressed)
|
||||
{
|
||||
if (getOwner() == null)
|
||||
if (_owner == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
final L2Object target = getOwner().getTarget();
|
||||
if ((target == null) || (this == target) || (getOwner() == target))
|
||||
final L2Object target = _owner.getTarget();
|
||||
if ((target == null) || (this == target) || (_owner == target))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -987,7 +986,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;
|
||||
}
|
||||
|
||||
@@ -1007,21 +1006,21 @@ 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()))
|
||||
{
|
||||
if (TerritoryWarManager.getInstance().isTWInProgress())
|
||||
{
|
||||
@@ -1035,7 +1034,7 @@ public abstract class L2Summon extends L2Playable
|
||||
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;
|
||||
@@ -1048,7 +1047,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);
|
||||
@@ -1068,18 +1067,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1120,14 +1119,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)
|
||||
{
|
||||
@@ -1138,7 +1137,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1150,14 +1149,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1165,13 +1164,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()
|
||||
|
||||
+2
-2
@@ -65,7 +65,7 @@ public class PcAppearance
|
||||
*/
|
||||
public final String getVisibleName()
|
||||
{
|
||||
return _visibleName == null ? getOwner().getName() : _visibleName;
|
||||
return _visibleName == null ? _owner.getName() : _visibleName;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -81,7 +81,7 @@ public class PcAppearance
|
||||
*/
|
||||
public final String getVisibleTitle()
|
||||
{
|
||||
return _visibleTitle == null ? getOwner().getTitle() : _visibleTitle;
|
||||
return _visibleTitle == null ? _owner.getTitle() : _visibleTitle;
|
||||
}
|
||||
|
||||
public final byte getFace()
|
||||
|
||||
+11
-12
@@ -68,7 +68,7 @@ public class L2DoorInstance extends L2Character
|
||||
/** The fort index in the array of L2Fort this L2NpcInstance belongs to */
|
||||
private int _fortIndex = -2;
|
||||
private ClanHall _clanHall;
|
||||
private boolean _open = false;
|
||||
boolean _open = false;
|
||||
private boolean _isAttackableDoor = false;
|
||||
private boolean _isTargetable;
|
||||
private int _meshindex = 1;
|
||||
@@ -319,7 +319,7 @@ public class L2DoorInstance extends L2Character
|
||||
{
|
||||
return true;
|
||||
}
|
||||
if ((getClanHall() != null) && getClanHall().isSiegableHall() && ((SiegableHall) getClanHall()).getSiegeZone().isActive() && getIsShowHp())
|
||||
if ((_clanHall != null) && _clanHall.isSiegableHall() && ((SiegableHall) _clanHall).getSiegeZone().isActive() && getIsShowHp())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -335,7 +335,7 @@ public class L2DoorInstance extends L2Character
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getIsAttackableDoor())
|
||||
if (_isAttackableDoor)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -346,9 +346,9 @@ public class L2DoorInstance extends L2Character
|
||||
|
||||
final L2PcInstance actingPlayer = attacker.getActingPlayer();
|
||||
|
||||
if (getClanHall() != null)
|
||||
if (_clanHall != null)
|
||||
{
|
||||
final SiegableHall hall = (SiegableHall) getClanHall();
|
||||
final SiegableHall hall = (SiegableHall) _clanHall;
|
||||
if (!hall.isSiegableHall())
|
||||
{
|
||||
return false;
|
||||
@@ -430,7 +430,7 @@ public class L2DoorInstance extends L2Character
|
||||
OnEventTrigger oe = null;
|
||||
if (getEmitter() > 0)
|
||||
{
|
||||
oe = new OnEventTrigger(this, isOpen());
|
||||
oe = new OnEventTrigger(this, _open);
|
||||
}
|
||||
|
||||
for (L2PcInstance player : knownPlayers)
|
||||
@@ -630,7 +630,7 @@ public class L2DoorInstance extends L2Character
|
||||
|
||||
final boolean isFort = ((getFort() != null) && (getFort().getResidenceId() > 0) && getFort().getSiege().isInProgress());
|
||||
final boolean isCastle = ((getCastle() != null) && (getCastle().getResidenceId() > 0) && getCastle().getSiege().isInProgress());
|
||||
final boolean isHall = ((getClanHall() != null) && getClanHall().isSiegableHall() && ((SiegableHall) getClanHall()).isInSiege());
|
||||
final boolean isHall = ((_clanHall != null) && _clanHall.isSiegableHall() && ((SiegableHall) _clanHall).isInSiege());
|
||||
|
||||
if (isFort || isCastle || isHall)
|
||||
{
|
||||
@@ -666,7 +666,7 @@ public class L2DoorInstance extends L2Character
|
||||
{
|
||||
if (getEmitter() > 0)
|
||||
{
|
||||
activeChar.sendPacket(new OnEventTrigger(this, isOpen()));
|
||||
activeChar.sendPacket(new OnEventTrigger(this, _open));
|
||||
}
|
||||
|
||||
activeChar.sendPacket(new StaticObject(this, activeChar.isGM()));
|
||||
@@ -731,7 +731,7 @@ public class L2DoorInstance extends L2Character
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (isOpen())
|
||||
if (_open)
|
||||
{
|
||||
closeMe();
|
||||
}
|
||||
@@ -743,8 +743,7 @@ public class L2DoorInstance extends L2Character
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
final boolean open = isOpen();
|
||||
if (open)
|
||||
if (_open)
|
||||
{
|
||||
closeMe();
|
||||
}
|
||||
@@ -753,7 +752,7 @@ public 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());
|
||||
|
||||
+1
-1
@@ -98,7 +98,7 @@ public class L2MerchantInstance extends L2NpcInstance
|
||||
return;
|
||||
}
|
||||
|
||||
final double taxRate = (applyTax) ? getMpc().getTotalTaxRate() : 0;
|
||||
final double taxRate = (applyTax) ? _mpc.getTotalTaxRate() : 0;
|
||||
|
||||
player.setInventoryBlockingStatus(true);
|
||||
|
||||
|
||||
+7
-7
@@ -102,11 +102,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();
|
||||
@@ -167,9 +167,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();
|
||||
@@ -223,7 +223,7 @@ public class L2MonsterInstance extends L2Attackable
|
||||
@Override
|
||||
public boolean isWalker()
|
||||
{
|
||||
return ((getLeader() == null) ? super.isWalker() : getLeader().isWalker());
|
||||
return ((_master == null) ? super.isWalker() : _master.isWalker());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -232,7 +232,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
|
||||
|
||||
+5
-5
@@ -511,7 +511,7 @@ public final class L2PcInstance extends L2Playable
|
||||
public int _telemode = 0;
|
||||
|
||||
private boolean _inCrystallize;
|
||||
private boolean _inCraftMode;
|
||||
private boolean _isCrafting;
|
||||
|
||||
private long _offlineShopStart = 0;
|
||||
|
||||
@@ -1261,14 +1261,14 @@ public final class L2PcInstance extends L2Playable
|
||||
return getPrivateStoreType() != PrivateStoreType.NONE;
|
||||
}
|
||||
|
||||
public boolean isInCraftMode()
|
||||
public boolean isCrafting()
|
||||
{
|
||||
return _inCraftMode;
|
||||
return _isCrafting;
|
||||
}
|
||||
|
||||
public void isInCraftMode(boolean b)
|
||||
public void setIsCrafting(boolean isCrafting)
|
||||
{
|
||||
_inCraftMode = b;
|
||||
_isCrafting = isCrafting;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+30
-30
@@ -79,8 +79,8 @@ public class L2PetInstance extends L2Summon
|
||||
private static final String RESTORE_SKILL_SAVE = "SELECT petObjItemId,skill_id,skill_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;
|
||||
@@ -171,7 +171,7 @@ public class L2PetInstance extends L2Summon
|
||||
stopFeed();
|
||||
return;
|
||||
}
|
||||
setCurrentFed(getCurrentFed() > getFeedConsume() ? getCurrentFed() - getFeedConsume() : 0);
|
||||
setCurrentFed(_curFed > getFeedConsume() ? _curFed - getFeedConsume() : 0);
|
||||
|
||||
broadcastStatusUpdate();
|
||||
|
||||
@@ -198,7 +198,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;
|
||||
@@ -315,7 +315,7 @@ public class L2PetInstance extends L2Summon
|
||||
@Override
|
||||
public L2ItemInstance getActiveWeaponInstance()
|
||||
{
|
||||
for (L2ItemInstance item : getInventory().getItems())
|
||||
for (L2ItemInstance item : _inventory.getItems())
|
||||
{
|
||||
if ((item.getItemLocation() == ItemLocation.PET_EQUIP) && (item.getItem().getBodyPart() == L2Item.SLOT_R_HAND))
|
||||
{
|
||||
@@ -602,8 +602,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));
|
||||
}
|
||||
}
|
||||
@@ -619,7 +619,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());
|
||||
@@ -682,9 +682,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)
|
||||
{
|
||||
@@ -736,11 +736,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_HAS_DISAPPEARED);
|
||||
@@ -778,7 +778,7 @@ public class L2PetInstance extends L2Summon
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM pets WHERE item_obj_id = ?"))
|
||||
{
|
||||
ps.setInt(1, getControlObjectId());
|
||||
ps.setInt(1, _controlObjectId);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -791,7 +791,7 @@ public class L2PetInstance extends L2Summon
|
||||
{
|
||||
try
|
||||
{
|
||||
for (L2ItemInstance item : getInventory().getItems())
|
||||
for (L2ItemInstance item : _inventory.getItems())
|
||||
{
|
||||
dropItemHere(item);
|
||||
}
|
||||
@@ -804,7 +804,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)
|
||||
{
|
||||
@@ -914,7 +914,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;
|
||||
@@ -925,7 +925,7 @@ public class L2PetInstance extends L2Summon
|
||||
_restoreSummon = false;
|
||||
}
|
||||
|
||||
final String req = !isRespawned() ? "INSERT INTO pets (name,level,curHp,curMp,exp,sp,fed,ownerId,restore,item_obj_id) VALUES (?,?,?,?,?,?,?,?,?,?)" : "UPDATE pets SET name=?,level=?,curHp=?,curMp=?,exp=?,sp=?,fed=?,ownerId=?,restore=? WHERE item_obj_id = ?";
|
||||
final String req = !_respawned ? "INSERT INTO pets (name,level,curHp,curMp,exp,sp,fed,ownerId,restore,item_obj_id) VALUES (?,?,?,?,?,?,?,?,?,?)" : "UPDATE pets SET name=?,level=?,curHp=?,curMp=?,exp=?,sp=?,fed=?,ownerId=?,restore=? WHERE item_obj_id = ?";
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(req))
|
||||
{
|
||||
@@ -935,10 +935,10 @@ public class L2PetInstance extends L2Summon
|
||||
ps.setDouble(4, getStatus().getCurrentMp());
|
||||
ps.setLong(5, getStat().getExp());
|
||||
ps.setLong(6, getStat().getSp());
|
||||
ps.setInt(7, getCurrentFed());
|
||||
ps.setInt(7, _curFed);
|
||||
ps.setInt(8, getOwner().getObjectId());
|
||||
ps.setString(9, String.valueOf(_restoreSummon)); // True restores pet on login
|
||||
ps.setInt(10, getControlObjectId());
|
||||
ps.setInt(10, _controlObjectId);
|
||||
ps.executeUpdate();
|
||||
|
||||
_respawned = true;
|
||||
@@ -981,7 +981,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;
|
||||
@@ -1023,7 +1023,7 @@ public class L2PetInstance extends L2Summon
|
||||
|
||||
storedSkills.add(skill.getReuseHashCode());
|
||||
|
||||
ps2.setInt(1, getControlObjectId());
|
||||
ps2.setInt(1, _controlObjectId);
|
||||
ps2.setInt(2, skill.getId());
|
||||
ps2.setInt(3, skill.getLevel());
|
||||
ps2.setInt(4, info.getTime());
|
||||
@@ -1050,7 +1050,7 @@ public class L2PetInstance extends L2Summon
|
||||
{
|
||||
if (!SummonEffectsTable.getInstance().containsPetId(getControlObjectId()))
|
||||
{
|
||||
ps1.setInt(1, getControlObjectId());
|
||||
ps1.setInt(1, _controlObjectId);
|
||||
try (ResultSet rs = ps1.executeQuery())
|
||||
{
|
||||
while (rs.next())
|
||||
@@ -1071,7 +1071,7 @@ public class L2PetInstance extends L2Summon
|
||||
}
|
||||
}
|
||||
|
||||
ps2.setInt(1, getControlObjectId());
|
||||
ps2.setInt(1, _controlObjectId);
|
||||
ps2.executeUpdate();
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -1114,9 +1114,9 @@ public class L2PetInstance extends L2Summon
|
||||
|
||||
if (!isDead())
|
||||
{
|
||||
if (getInventory() != null)
|
||||
if (_inventory != null)
|
||||
{
|
||||
getInventory().deleteMe();
|
||||
_inventory.deleteMe();
|
||||
}
|
||||
L2World.getInstance().removePet(owner.getObjectId());
|
||||
}
|
||||
@@ -1277,7 +1277,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());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1287,26 +1287,26 @@ 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);
|
||||
return weapon != null ? weapon.getId() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getArmor()
|
||||
{
|
||||
final L2ItemInstance weapon = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
|
||||
final L2ItemInstance weapon = _inventory.getPaperdollItem(Inventory.PAPERDOLL_CHEST);
|
||||
return weapon != null ? weapon.getId() : 0;
|
||||
}
|
||||
|
||||
public final int getJewel()
|
||||
{
|
||||
final L2ItemInstance weapon = getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK);
|
||||
final L2ItemInstance weapon = _inventory.getPaperdollItem(Inventory.PAPERDOLL_NECK);
|
||||
return weapon != null ? weapon.getId() : 0;
|
||||
}
|
||||
|
||||
|
||||
+8
-8
@@ -223,7 +223,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
|
||||
// Delete all current stored effects for summon to avoid dupe
|
||||
ps.setInt(1, getOwner().getObjectId());
|
||||
ps.setInt(2, getOwner().getClassIndex());
|
||||
ps.setInt(3, getReferenceSkill());
|
||||
ps.setInt(3, _referenceSkill);
|
||||
ps.execute();
|
||||
|
||||
int buff_index = 0;
|
||||
@@ -269,7 +269,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());
|
||||
@@ -304,7 +304,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
|
||||
{
|
||||
ps.setInt(1, getOwner().getObjectId());
|
||||
ps.setInt(2, getOwner().getClassIndex());
|
||||
ps.setInt(3, getReferenceSkill());
|
||||
ps.setInt(3, _referenceSkill);
|
||||
try (ResultSet rs = ps.executeQuery())
|
||||
{
|
||||
while (rs.next())
|
||||
@@ -330,7 +330,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();
|
||||
}
|
||||
}
|
||||
@@ -424,12 +424,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
|
||||
@@ -443,7 +443,7 @@ public class L2ServitorInstance extends L2Summon implements Runnable
|
||||
}
|
||||
}
|
||||
|
||||
sendPacket(new SetSummonRemainTime(getLifeTime(), _lifeTimeRemaining));
|
||||
sendPacket(new SetSummonRemainTime(_lifeTime, _lifeTimeRemaining));
|
||||
updateEffectIcons();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class ObjectPoly
|
||||
|
||||
public final boolean isMorphed()
|
||||
{
|
||||
return getPolyType() != null;
|
||||
return _polyType != null;
|
||||
}
|
||||
|
||||
public final int getPolyId()
|
||||
|
||||
+2
-2
@@ -92,9 +92,9 @@ public class CharStat
|
||||
}
|
||||
|
||||
// Apply transformation stats.
|
||||
if (getActiveChar().isPlayer() && getActiveChar().isTransformed())
|
||||
if (_activeChar.isPlayer() && _activeChar.isTransformed())
|
||||
{
|
||||
final double val = getActiveChar().getTransformation().getStat(getActiveChar().getActingPlayer(), stat);
|
||||
final double val = _activeChar.getTransformation().getStat(_activeChar.getActingPlayer(), stat);
|
||||
if (val > 0)
|
||||
{
|
||||
value = val;
|
||||
|
||||
+26
-26
@@ -66,7 +66,7 @@ public class CharStatus
|
||||
*/
|
||||
public final void addStatusListener(L2Character object)
|
||||
{
|
||||
if (object == getActiveChar())
|
||||
if (object == _activeChar)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -130,13 +130,13 @@ public class CharStatus
|
||||
|
||||
public void reduceHp(double value, L2Character attacker, boolean awake, boolean isDOT, boolean isHPConsumption)
|
||||
{
|
||||
if (getActiveChar().isDead())
|
||||
if (_activeChar.isDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// invul handling
|
||||
if (getActiveChar().isInvul() && !(isDOT || isHPConsumption))
|
||||
if (_activeChar.isInvul() && !(isDOT || isHPConsumption))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -152,30 +152,30 @@ public class CharStatus
|
||||
|
||||
if (!isDOT && !isHPConsumption)
|
||||
{
|
||||
getActiveChar().stopEffectsOnDamage(awake);
|
||||
if (getActiveChar().isStunned() && (Rnd.get(10) == 0))
|
||||
_activeChar.stopEffectsOnDamage(awake);
|
||||
if (_activeChar.isStunned() && (Rnd.get(10) == 0))
|
||||
{
|
||||
getActiveChar().stopStunning(true);
|
||||
_activeChar.stopStunning(true);
|
||||
}
|
||||
}
|
||||
|
||||
if (value > 0)
|
||||
{
|
||||
setCurrentHp(Math.max(getCurrentHp() - value, 0));
|
||||
setCurrentHp(Math.max(_currentHp - value, 0));
|
||||
}
|
||||
|
||||
if ((getActiveChar().getCurrentHp() < 0.5) && getActiveChar().isMortal()) // Die
|
||||
if ((_activeChar.getCurrentHp() < 0.5) && _activeChar.isMortal()) // Die
|
||||
{
|
||||
getActiveChar().abortAttack();
|
||||
getActiveChar().abortCast();
|
||||
_activeChar.abortAttack();
|
||||
_activeChar.abortCast();
|
||||
|
||||
getActiveChar().doDie(attacker);
|
||||
_activeChar.doDie(attacker);
|
||||
}
|
||||
}
|
||||
|
||||
public void reduceMp(double value)
|
||||
{
|
||||
setCurrentMp(Math.max(getCurrentMp() - value, 0));
|
||||
setCurrentMp(Math.max(_currentMp - value, 0));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -188,10 +188,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);
|
||||
@@ -249,12 +249,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().getMaxHp();
|
||||
final int currentHp = (int) _currentHp;
|
||||
final double maxHp = _activeChar.getMaxHp();
|
||||
|
||||
synchronized (this)
|
||||
{
|
||||
if (getActiveChar().isDead())
|
||||
if (_activeChar.isDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -287,7 +287,7 @@ public class CharStatus
|
||||
// Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
|
||||
if (hpWasChanged && broadcastPacket)
|
||||
{
|
||||
getActiveChar().broadcastStatusUpdate();
|
||||
_activeChar.broadcastStatusUpdate();
|
||||
}
|
||||
|
||||
return hpWasChanged;
|
||||
@@ -297,7 +297,7 @@ public class CharStatus
|
||||
{
|
||||
if (setCurrentHp(newHp, false) | setCurrentMp(newMp, false))
|
||||
{
|
||||
getActiveChar().broadcastStatusUpdate();
|
||||
_activeChar.broadcastStatusUpdate();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -320,12 +320,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().getMaxMp();
|
||||
final int currentMp = (int) _currentMp;
|
||||
final int maxMp = _activeChar.getMaxMp();
|
||||
|
||||
synchronized (this)
|
||||
{
|
||||
if (getActiveChar().isDead())
|
||||
if (_activeChar.isDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -358,7 +358,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;
|
||||
@@ -367,10 +367,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() + Formulas.calcHpRegen(getActiveChar());
|
||||
final double newMp = getCurrentMp() + Formulas.calcMpRegen(getActiveChar());
|
||||
final double newHp = _currentHp + Formulas.calcHpRegen(_activeChar);
|
||||
final double newMp = _currentMp + Formulas.calcMpRegen(_activeChar);
|
||||
setCurrentHpMp(newHp, newMp);
|
||||
}
|
||||
else
|
||||
|
||||
+9
-9
@@ -46,7 +46,7 @@ public class PcStatus extends PlayableStatus
|
||||
@Override
|
||||
public final void reduceCp(int value)
|
||||
{
|
||||
setCurrentCp(getCurrentCp() > value ? getCurrentCp() - value : 0);
|
||||
setCurrentCp(_currentCp > value ? _currentCp - value : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,7 +69,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;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public class PcStatus extends PlayableStatus
|
||||
{
|
||||
getActiveChar().stopEffectsOnDamage(awake);
|
||||
// Attacked players in craft/shops stand up.
|
||||
if (getActiveChar().isInCraftMode() || getActiveChar().isInStoreMode())
|
||||
if (getActiveChar().isCrafting() || getActiveChar().isInStoreMode())
|
||||
{
|
||||
getActiveChar().setPrivateStoreType(PrivateStoreType.NONE);
|
||||
getActiveChar().standUp();
|
||||
@@ -212,14 +212,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
|
||||
}
|
||||
}
|
||||
@@ -334,7 +334,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)
|
||||
@@ -385,9 +385,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() + Formulas.calcCpRegen(getActiveChar()), false);
|
||||
setCurrentCp(_currentCp + Formulas.calcCpRegen(getActiveChar()), false);
|
||||
}
|
||||
|
||||
// Modify the current HP of the L2Character and broadcast Server->Client packet StatusUpdate
|
||||
|
||||
+1
-1
@@ -268,7 +268,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()
|
||||
|
||||
+6
-6
@@ -215,13 +215,13 @@ public final class Transform implements IIdentifiable
|
||||
player.setIsFlying(true);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
// Set inventory blocks if needed.
|
||||
@@ -283,11 +283,11 @@ public final class Transform implements IIdentifiable
|
||||
player.setIsFlying(false);
|
||||
}
|
||||
|
||||
if (getName() != null)
|
||||
if (_name != null)
|
||||
{
|
||||
player.getAppearance().setVisibleName(null);
|
||||
}
|
||||
if (getTitle() != null)
|
||||
if (_title != null)
|
||||
{
|
||||
player.getAppearance().setVisibleTitle(null);
|
||||
}
|
||||
|
||||
+6
-6
@@ -100,9 +100,9 @@ public final class AutoAnnouncement extends Announcement implements Runnable
|
||||
ps.setInt(1, getType().ordinal());
|
||||
ps.setString(2, getContent());
|
||||
ps.setString(3, getAuthor());
|
||||
ps.setLong(4, getInitial());
|
||||
ps.setLong(5, getDelay());
|
||||
ps.setInt(6, getRepeat());
|
||||
ps.setLong(4, _initial);
|
||||
ps.setLong(5, _delay);
|
||||
ps.setInt(6, _repeat);
|
||||
ps.execute();
|
||||
try (ResultSet rset = ps.getGeneratedKeys())
|
||||
{
|
||||
@@ -129,9 +129,9 @@ public final class AutoAnnouncement extends Announcement implements Runnable
|
||||
ps.setInt(1, getType().ordinal());
|
||||
ps.setString(2, getContent());
|
||||
ps.setString(3, getAuthor());
|
||||
ps.setLong(4, getInitial());
|
||||
ps.setLong(5, getDelay());
|
||||
ps.setLong(6, getRepeat());
|
||||
ps.setLong(4, _initial);
|
||||
ps.setLong(5, _delay);
|
||||
ps.setLong(6, _repeat);
|
||||
ps.setLong(7, getId());
|
||||
ps.execute();
|
||||
}
|
||||
|
||||
@@ -131,7 +131,7 @@ public final class SubClass
|
||||
|
||||
public void incLevel()
|
||||
{
|
||||
if (getLevel() == _maxLevel)
|
||||
if (_level == _maxLevel)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public final class SubClass
|
||||
|
||||
public void decLevel()
|
||||
{
|
||||
if (getLevel() == Config.BASE_SUBCLASS_LEVEL)
|
||||
if (_level == Config.BASE_SUBCLASS_LEVEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -68,12 +68,12 @@ public final class Product
|
||||
|
||||
public int getItemId()
|
||||
{
|
||||
return getItem().getId();
|
||||
return _item.getId();
|
||||
}
|
||||
|
||||
public long getPrice()
|
||||
{
|
||||
return _price < 0 ? getItem().getReferencePrice() : _price;
|
||||
return _price < 0 ? _item.getReferencePrice() : _price;
|
||||
}
|
||||
|
||||
public long getRestockDelay()
|
||||
@@ -113,7 +113,7 @@ public final class Product
|
||||
}
|
||||
if ((_restockTask == null) || _restockTask.isDone())
|
||||
{
|
||||
_restockTask = ThreadPool.schedule(new RestockTask(), getRestockDelay());
|
||||
_restockTask = ThreadPool.schedule(new RestockTask(), _restockDelay);
|
||||
}
|
||||
final boolean result = _count.addAndGet(-val) >= 0;
|
||||
save();
|
||||
@@ -122,7 +122,7 @@ public final class Product
|
||||
|
||||
public boolean hasLimitedStock()
|
||||
{
|
||||
return getMaxCount() > -1;
|
||||
return _maxCount > -1;
|
||||
}
|
||||
|
||||
public void restartRestockTask(long nextRestockTime)
|
||||
@@ -140,7 +140,7 @@ public final class Product
|
||||
|
||||
public void restock()
|
||||
{
|
||||
setCount(getMaxCount());
|
||||
setCount(_maxCount);
|
||||
save();
|
||||
}
|
||||
|
||||
@@ -158,8 +158,8 @@ public final class Product
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO `buylists`(`buylist_id`, `item_id`, `count`, `next_restock_time`) VALUES(?, ?, ?, ?) ON DUPLICATE KEY UPDATE `count` = ?, `next_restock_time` = ?"))
|
||||
{
|
||||
ps.setInt(1, getBuyListId());
|
||||
ps.setInt(2, getItemId());
|
||||
ps.setInt(1, _buyListId);
|
||||
ps.setInt(2, _item.getId());
|
||||
ps.setLong(3, getCount());
|
||||
ps.setLong(5, getCount());
|
||||
if ((_restockTask != null) && (_restockTask.getDelay(TimeUnit.MILLISECONDS) > 0))
|
||||
@@ -177,7 +177,7 @@ public final class Product
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
LOGGER.log(Level.WARNING, "Failed to save Product buylist_id:" + getBuyListId() + " item_id:" + getItemId(), e);
|
||||
LOGGER.log(Level.WARNING, "Failed to save Product buylist_id:" + _buyListId + " item_id:" + _item.getId(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -233,13 +233,13 @@ public abstract class AbstractEffect
|
||||
*/
|
||||
public List<AbstractFunction> getStatFuncs(L2Character caster, L2Character target, Skill skill)
|
||||
{
|
||||
if (getFuncTemplates() == null)
|
||||
if (_funcTemplates == null)
|
||||
{
|
||||
return Collections.<AbstractFunction> emptyList();
|
||||
}
|
||||
|
||||
final List<AbstractFunction> functions = new ArrayList<>(getFuncTemplates().size());
|
||||
for (FuncTemplate functionTemplate : getFuncTemplates())
|
||||
final List<AbstractFunction> functions = new ArrayList<>(_funcTemplates.size());
|
||||
for (FuncTemplate functionTemplate : _funcTemplates)
|
||||
{
|
||||
final AbstractFunction function = functionTemplate.getFunc(caster, target, skill, this);
|
||||
if (function != null)
|
||||
|
||||
+1
-1
@@ -119,6 +119,6 @@ public abstract class AbstractResidence extends ListenersContainer implements IN
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return getName() + "(" + getResidenceId() + ")";
|
||||
return _name + "(" + _residenceId + ")";
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -165,7 +165,7 @@ public class Auction
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("Select * from auction where id = ?"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _id);
|
||||
try (ResultSet rs = ps.executeQuery())
|
||||
{
|
||||
while (rs.next())
|
||||
@@ -200,7 +200,7 @@ public class Auction
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT bidderId, bidderName, maxBid, clan_name, time_bid FROM auction_bid WHERE auctionId = ? ORDER BY maxBid DESC"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _id);
|
||||
try (ResultSet rs = ps.executeQuery())
|
||||
{
|
||||
while (rs.next())
|
||||
@@ -266,14 +266,14 @@ public class Auction
|
||||
*/
|
||||
public synchronized void setBid(L2PcInstance bidder, long bid)
|
||||
{
|
||||
final long requiredAdena = getHighestBidderName().equals(bidder.getClan().getLeaderName()) ? bid - getHighestBidderMaxBid() : bid;
|
||||
if ((((getHighestBidderId() > 0) && (bid > getHighestBidderMaxBid())) || ((getHighestBidderId() == 0) && (bid >= getStartingBid()))) && takeItem(bidder, requiredAdena))
|
||||
final long requiredAdena = _highestBidderName.equals(bidder.getClan().getLeaderName()) ? bid - _highestBidderMaxBid : bid;
|
||||
if ((((_highestBidderId > 0) && (bid > _highestBidderMaxBid)) || ((_highestBidderId == 0) && (bid >= _startingBid))) && takeItem(bidder, requiredAdena))
|
||||
{
|
||||
updateInDB(bidder, bid);
|
||||
bidder.getClan().setAuctionBiddedAt(_id, true);
|
||||
return;
|
||||
}
|
||||
if ((bid < getStartingBid()) || (bid <= getHighestBidderMaxBid()))
|
||||
if ((bid < _startingBid) || (bid <= _highestBidderMaxBid))
|
||||
{
|
||||
bidder.sendPacket(SystemMessageId.YOUR_BID_PRICE_MUST_BE_HIGHER_THAN_THE_MINIMUM_PRICE_CURRENTLY_BEING_BID);
|
||||
}
|
||||
@@ -347,7 +347,7 @@ public class Auction
|
||||
ps.setString(2, bidder.getClan().getLeaderName());
|
||||
ps.setLong(3, bid);
|
||||
ps.setLong(4, System.currentTimeMillis());
|
||||
ps.setInt(5, getId());
|
||||
ps.setInt(5, _id);
|
||||
ps.setInt(6, bidder.getClanId());
|
||||
ps.execute();
|
||||
}
|
||||
@@ -357,7 +357,7 @@ public class Auction
|
||||
try (PreparedStatement ps = con.prepareStatement("INSERT INTO auction_bid (id, auctionId, bidderId, bidderName, maxBid, clan_name, time_bid) VALUES (?, ?, ?, ?, ?, ?, ?)"))
|
||||
{
|
||||
ps.setInt(1, IdFactory.getInstance().getNextId());
|
||||
ps.setInt(2, getId());
|
||||
ps.setInt(2, _id);
|
||||
ps.setInt(3, bidder.getClanId());
|
||||
ps.setString(4, bidder.getName());
|
||||
ps.setLong(5, bid);
|
||||
@@ -397,7 +397,7 @@ public class Auction
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM auction_bid WHERE auctionId=?"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _id);
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -483,7 +483,7 @@ public class Auction
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM auction_bid WHERE auctionId=? AND bidderId=?"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _id);
|
||||
ps.setInt(2, bidder);
|
||||
ps.execute();
|
||||
}
|
||||
@@ -512,7 +512,7 @@ public class Auction
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO auction (id, sellerId, sellerName, sellerClanName, itemType, itemId, itemObjectId, itemName, itemQuantity, startingBid, currentBid, endDate) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _id);
|
||||
ps.setInt(2, _sellerId);
|
||||
ps.setString(3, _sellerName);
|
||||
ps.setString(4, _sellerClanName);
|
||||
|
||||
+1
-1
@@ -527,7 +527,7 @@ public final class BlockCheckerEngine
|
||||
_redPoints += _numOfBoxes / 2;
|
||||
_bluePoints += _numOfBoxes / 2;
|
||||
|
||||
getHolder().broadCastPacketToTeam(new ExCubeGameChangePoints((int) ((getStarterTime() - System.currentTimeMillis()) / 1000), getBluePoints(), getRedPoints()));
|
||||
_holder.broadCastPacketToTeam(new ExCubeGameChangePoints((int) ((_startedTime - System.currentTimeMillis()) / 1000), getBluePoints(), getRedPoints()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public final class Castle extends AbstractResidence
|
||||
protected static final Logger LOGGER = Logger.getLogger(Castle.class.getName());
|
||||
|
||||
private final List<L2DoorInstance> _doors = 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
|
||||
@@ -89,12 +89,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;
|
||||
|
||||
@@ -151,7 +151,7 @@ public final class Castle extends AbstractResidence
|
||||
|
||||
private void initializeTask(boolean cwh)
|
||||
{
|
||||
if (getOwnerId() <= 0)
|
||||
if (_ownerId <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -178,29 +178,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)
|
||||
@@ -216,11 +216,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)
|
||||
@@ -239,7 +239,7 @@ public final class Castle extends AbstractResidence
|
||||
*/
|
||||
_function = new ConcurrentHashMap<>();
|
||||
initResidenceZone();
|
||||
if (getOwnerId() != 0)
|
||||
if (_ownerId != 0)
|
||||
{
|
||||
loadFunctions();
|
||||
loadDoorUpgrade();
|
||||
@@ -276,7 +276,7 @@ public final class Castle extends AbstractResidence
|
||||
public void addToTreasury(long amount)
|
||||
{
|
||||
// check if owned
|
||||
if (getOwnerId() <= 0)
|
||||
if (_ownerId <= 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -319,7 +319,7 @@ public final class Castle extends AbstractResidence
|
||||
*/
|
||||
public boolean addToTreasuryNoTax(long amount)
|
||||
{
|
||||
if (getOwnerId() <= 0)
|
||||
if (_ownerId <= 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -348,7 +348,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();
|
||||
}
|
||||
@@ -364,7 +364,7 @@ public final class Castle extends AbstractResidence
|
||||
*/
|
||||
public void banishForeigners()
|
||||
{
|
||||
getResidenceZone().banishForeigners(getOwnerId());
|
||||
getResidenceZone().banishForeigners(_ownerId);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -444,7 +444,7 @@ public final class Castle extends AbstractResidence
|
||||
|
||||
public void openCloseDoor(L2PcInstance activeChar, int doorId, boolean open)
|
||||
{
|
||||
if (activeChar.getClanId() != getOwnerId())
|
||||
if (activeChar.getClanId() != _ownerId)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -479,7 +479,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)
|
||||
@@ -858,7 +858,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();
|
||||
}
|
||||
|
||||
@@ -883,7 +883,7 @@ public final class Castle extends AbstractResidence
|
||||
return null;
|
||||
}
|
||||
|
||||
for (L2DoorInstance door : getDoors())
|
||||
for (L2DoorInstance door : _doors)
|
||||
{
|
||||
if (door.getId() == doorId)
|
||||
{
|
||||
@@ -1004,7 +1004,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();
|
||||
}
|
||||
|
||||
+23
-23
@@ -40,7 +40,7 @@ public abstract class ClanHall
|
||||
{
|
||||
protected static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName());
|
||||
|
||||
private final int _clanHallId;
|
||||
final int _clanHallId;
|
||||
private ArrayList<L2DoorInstance> _doors;
|
||||
private final String _name;
|
||||
private int _ownerId;
|
||||
@@ -62,12 +62,12 @@ public abstract class ClanHall
|
||||
|
||||
public class ClanHallFunction
|
||||
{
|
||||
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; // first activating clanhall function is payed from player inventory, any others from clan warehouse
|
||||
|
||||
@@ -157,18 +157,18 @@ public abstract class ClanHall
|
||||
}
|
||||
if ((ClanTable.getInstance().getClan(getOwnerId()).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)
|
||||
{
|
||||
ClanTable.getInstance().getClan(getOwnerId()).getWarehouse().destroyItemByItemId("CH_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)
|
||||
@@ -183,12 +183,12 @@ public abstract class ClanHall
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("REPLACE INTO clanhall_functions (hall_id, type, lvl, lease, rate, endTime) VALUES (?,?,?,?,?,?)"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(2, getType());
|
||||
ps.setInt(3, getLvl());
|
||||
ps.setInt(4, getLease());
|
||||
ps.setLong(5, getRate());
|
||||
ps.setLong(6, getEndTime());
|
||||
ps.setInt(1, _clanHallId);
|
||||
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)
|
||||
@@ -215,7 +215,7 @@ public abstract class ClanHall
|
||||
final L2Clan clan = ClanTable.getInstance().getClan(_ownerId);
|
||||
if (clan != null)
|
||||
{
|
||||
clan.setHideoutId(getId());
|
||||
clan.setHideoutId(_clanHallId);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -321,7 +321,7 @@ public abstract class ClanHall
|
||||
*/
|
||||
public boolean checkIfInZone(int x, int y, int z)
|
||||
{
|
||||
return getZone().isInsideZone(x, y, z);
|
||||
return _zone.isInsideZone(x, y, z);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -358,7 +358,7 @@ public abstract class ClanHall
|
||||
}
|
||||
_ownerId = clan.getId();
|
||||
_isFree = false;
|
||||
clan.setHideoutId(getId());
|
||||
clan.setHideoutId(_clanHallId);
|
||||
// Announce to Online member new ClanHall
|
||||
clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
|
||||
updateDb();
|
||||
@@ -372,7 +372,7 @@ public abstract class ClanHall
|
||||
*/
|
||||
public void openCloseDoor(L2PcInstance activeChar, int doorId, boolean open)
|
||||
{
|
||||
if ((activeChar != null) && (activeChar.getClanId() == getOwnerId()))
|
||||
if ((activeChar != null) && (activeChar.getClanId() == _ownerId))
|
||||
{
|
||||
openCloseDoor(doorId, open);
|
||||
}
|
||||
@@ -400,7 +400,7 @@ public abstract class ClanHall
|
||||
|
||||
public void openCloseDoors(L2PcInstance activeChar, boolean open)
|
||||
{
|
||||
if ((activeChar != null) && (activeChar.getClanId() == getOwnerId()))
|
||||
if ((activeChar != null) && (activeChar.getClanId() == _ownerId))
|
||||
{
|
||||
openCloseDoors(open);
|
||||
}
|
||||
@@ -429,11 +429,11 @@ public abstract class ClanHall
|
||||
{
|
||||
if (_zone != null)
|
||||
{
|
||||
_zone.banishForeigners(getOwnerId());
|
||||
_zone.banishForeigners(_ownerId);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Zone is null for clan hall: " + getId() + " " + getName());
|
||||
LOGGER.log(Level.WARNING, getClass().getSimpleName() + ": Zone is null for clan hall: " + _clanHallId + " " + _name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -443,7 +443,7 @@ public abstract class ClanHall
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT * FROM clanhall_functions WHERE hall_id = ?"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanHallId);
|
||||
try (ResultSet rs = ps.executeQuery())
|
||||
{
|
||||
while (rs.next())
|
||||
@@ -468,7 +468,7 @@ public abstract class ClanHall
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("DELETE FROM clanhall_functions WHERE hall_id=? AND type=?"))
|
||||
{
|
||||
ps.setInt(1, getId());
|
||||
ps.setInt(1, _clanHallId);
|
||||
ps.setInt(2, functionType);
|
||||
ps.execute();
|
||||
}
|
||||
|
||||
@@ -678,7 +678,7 @@ public class Duel
|
||||
*/
|
||||
public L2PcInstance getWinner()
|
||||
{
|
||||
if (!getFinished() || (_playerA == null) || (_playerB == null))
|
||||
if (!_finished || (_playerA == null) || (_playerB == null))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
@@ -699,7 +699,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)
|
||||
@@ -238,7 +238,7 @@ public final class Fort extends AbstractResidence
|
||||
load();
|
||||
loadFlagPoles();
|
||||
_function = new ConcurrentHashMap<>();
|
||||
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
|
||||
@@ -439,7 +439,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))
|
||||
@@ -503,7 +503,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);
|
||||
@@ -778,7 +778,7 @@ public final class Fort extends AbstractResidence
|
||||
|
||||
private void updateOwnerInDB()
|
||||
{
|
||||
final L2Clan clan = getOwnerClan();
|
||||
final L2Clan clan = _fortOwner;
|
||||
int clanId = 0;
|
||||
if (clan != null)
|
||||
{
|
||||
@@ -862,7 +862,7 @@ public final class Fort extends AbstractResidence
|
||||
return null;
|
||||
}
|
||||
|
||||
for (L2DoorInstance door : getDoors())
|
||||
for (L2DoorInstance door : _doors)
|
||||
{
|
||||
if (door.getId() == doorId)
|
||||
{
|
||||
@@ -990,8 +990,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();
|
||||
}
|
||||
@@ -1057,7 +1057,7 @@ public final class Fort extends AbstractResidence
|
||||
*/
|
||||
public final int getFortSize()
|
||||
{
|
||||
return getFortType() == 0 ? 3 : 5;
|
||||
return _fortType == 0 ? 3 : 5;
|
||||
}
|
||||
|
||||
public void spawnSuspiciousMerchant()
|
||||
|
||||
+75
-75
@@ -71,7 +71,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (!isInProgress())
|
||||
if (!_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -102,7 +102,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -116,7 +116,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);
|
||||
@@ -185,7 +185,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -206,7 +206,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (!isInProgress())
|
||||
if (!_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -229,7 +229,7 @@ public class FortSiege implements Siegable
|
||||
// Fort setting
|
||||
protected List<L2Spawn> _commanders = new CopyOnWriteArrayList<>();
|
||||
protected final Fort _fort;
|
||||
private boolean _isInProgress = false;
|
||||
boolean _isInProgress = false;
|
||||
private FortSiegeGuardManager _siegeGuardManager;
|
||||
ScheduledFuture<?> _siegeEnd = null;
|
||||
ScheduledFuture<?> _siegeRestore = null;
|
||||
@@ -249,7 +249,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void endSiege()
|
||||
{
|
||||
if (!isInProgress())
|
||||
if (!_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -260,19 +260,19 @@ public class FortSiege implements Siegable
|
||||
|
||||
updatePlayerSiegeStateFlags(true);
|
||||
|
||||
final int ownerId = getFort().getOwnerClan() != null ? getFort().getOwnerClan().getId() : -1;
|
||||
getFort().getZone().banishForeigners(ownerId);
|
||||
getFort().getZone().setIsActive(false);
|
||||
getFort().getZone().updateZoneStatusForCharactersInside();
|
||||
getFort().getZone().setSiegeInstance(null);
|
||||
final int ownerId = _fort.getOwnerClan() != null ? _fort.getOwnerClan().getId() : -1;
|
||||
_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
|
||||
getSiegeGuardManager().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("Siege of " + getFort().getName() + " fort finished.");
|
||||
LOGGER.info("Siege of " + _fort.getName() + " fort finished.");
|
||||
|
||||
// Notify to scripts.
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnFortSiegeFinish(this), getFort());
|
||||
@@ -305,7 +305,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public void startSiege()
|
||||
{
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -313,11 +313,11 @@ public class FortSiege implements Siegable
|
||||
if (_siegeStartTask != null) // used admin command "admin_startfortsiege"
|
||||
{
|
||||
_siegeStartTask.cancel(true);
|
||||
getFort().despawnSuspiciousMerchant();
|
||||
_fort.despawnSuspiciousMerchant();
|
||||
}
|
||||
_siegeStartTask = null;
|
||||
|
||||
if (getAttackerClans().isEmpty())
|
||||
if (_attackerClans.isEmpty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -328,24 +328,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("Siege of " + getFort().getName() + " fort started.");
|
||||
LOGGER.info("Siege of " + _fort.getName() + " fort started.");
|
||||
|
||||
// Notify to scripts.
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnFortSiegeStart(this), getFort());
|
||||
@@ -359,7 +359,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))
|
||||
@@ -367,7 +367,7 @@ public class FortSiege implements Siegable
|
||||
member.sendPacket(sm);
|
||||
}
|
||||
}
|
||||
if (getFort().getOwnerClan() == null)
|
||||
if (_fort.getOwnerClan() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -390,7 +390,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))
|
||||
@@ -405,7 +405,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);
|
||||
@@ -415,7 +415,7 @@ public class FortSiege implements Siegable
|
||||
member.broadcastUserInfo();
|
||||
}
|
||||
}
|
||||
if (getFort().getOwnerClan() == null)
|
||||
if (_fort.getOwnerClan() == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -437,7 +437,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);
|
||||
@@ -465,7 +465,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
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -485,7 +485,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public boolean checkIsDefender(L2Clan clan)
|
||||
{
|
||||
return (clan != null) && (getFort().getOwnerClan() == clan);
|
||||
return (clan != null) && (_fort.getOwnerClan() == clan);
|
||||
}
|
||||
|
||||
/** Clear all registered siege clans from database for fort */
|
||||
@@ -494,22 +494,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();
|
||||
}
|
||||
@@ -530,7 +530,7 @@ public class FortSiege implements Siegable
|
||||
/** Set the date for the next siege. */
|
||||
private void clearSiegeDate()
|
||||
{
|
||||
getFort().getSiegeDate().setTimeInMillis(0);
|
||||
_fort.getSiegeDate().setTimeInMillis(0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -540,7 +540,7 @@ public class FortSiege implements Siegable
|
||||
public List<L2PcInstance> getAttackersInZone()
|
||||
{
|
||||
final List<L2PcInstance> players = new LinkedList<>();
|
||||
for (L2SiegeClan siegeclan : getAttackerClans())
|
||||
for (L2SiegeClan siegeclan : _attackerClans)
|
||||
{
|
||||
for (L2PcInstance player : ClanTable.getInstance().getClan(siegeclan.getClanId()).getOnlineMembers(0))
|
||||
{
|
||||
@@ -558,7 +558,7 @@ public class FortSiege implements Siegable
|
||||
*/
|
||||
public List<L2PcInstance> getPlayersInZone()
|
||||
{
|
||||
return getFort().getZone().getPlayersInside();
|
||||
return _fort.getZone().getPlayersInside();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -567,10 +567,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;
|
||||
}
|
||||
@@ -593,7 +593,7 @@ public class FortSiege implements Siegable
|
||||
*/
|
||||
public void killedCommander(L2FortCommanderInstance instance)
|
||||
{
|
||||
if (_commanders.isEmpty() || (getFort() == null))
|
||||
if (_commanders.isEmpty() || (_fort == null))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -640,14 +640,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())
|
||||
{
|
||||
@@ -657,11 +657,11 @@ 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));
|
||||
}
|
||||
else
|
||||
{
|
||||
getFort().getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.THE_BARRACKS_HAVE_BEEN_SEIZED));
|
||||
_fort.getSiege().announceToPlayer(SystemMessage.getSystemMessage(SystemMessageId.THE_BARRACKS_HAVE_BEEN_SEIZED));
|
||||
if (_siegeRestore == null)
|
||||
{
|
||||
_siegeRestore = ThreadPool.schedule(new ScheduleSiegeRestore(), FortSiegeManager.getInstance().getCountDownLength() * 60 * 1000);
|
||||
@@ -670,7 +670,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
else
|
||||
{
|
||||
LOGGER.warning("FortSiege.killedCommander(): killed commander, but commander not registered for fortress. NpcId: " + instance.getId() + " FortId: " + getFort().getResidenceId());
|
||||
LOGGER.warning("FortSiege.killedCommander(): killed commander, but commander not registered for fortress. NpcId: " + instance.getId() + " FortId: " + _fort.getResidenceId());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -685,7 +685,7 @@ public class FortSiege implements Siegable
|
||||
return;
|
||||
}
|
||||
|
||||
for (L2SiegeClan clan : getAttackerClans())
|
||||
for (L2SiegeClan clan : _attackerClans)
|
||||
{
|
||||
if (clan.removeFlag(flag))
|
||||
{
|
||||
@@ -714,7 +714,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 dont havee enough adena to register
|
||||
}
|
||||
@@ -744,7 +744,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
|
||||
saveSiegeClan(player.getClan());
|
||||
if (getAttackerClans().size() == 1)
|
||||
if (_attackerClans.size() == 1)
|
||||
{
|
||||
if (checkConditions)
|
||||
{
|
||||
@@ -778,7 +778,7 @@ public class FortSiege implements Siegable
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement(query))
|
||||
{
|
||||
ps.setInt(1, getFort().getResidenceId());
|
||||
ps.setInt(1, _fort.getResidenceId());
|
||||
if (clanId != 0)
|
||||
{
|
||||
ps.setInt(2, clanId);
|
||||
@@ -786,9 +786,9 @@ public class FortSiege implements Siegable
|
||||
ps.execute();
|
||||
|
||||
loadSiegeClan();
|
||||
if (getAttackerClans().isEmpty())
|
||||
if (_attackerClans.isEmpty())
|
||||
{
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
endSiege();
|
||||
}
|
||||
@@ -833,7 +833,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);
|
||||
@@ -865,7 +865,7 @@ public class FortSiege implements Siegable
|
||||
_siegeStartTask = ThreadPool.schedule(new ScheduleStartSiegeTask(60), 0);
|
||||
}
|
||||
|
||||
LOGGER.info("Siege of " + getFort().getName() + " fort: " + getFort().getSiegeDate().getTime());
|
||||
LOGGER.info("Siege of " + _fort.getName() + " fort: " + _fort.getSiegeDate().getTime());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -886,9 +886,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
|
||||
@@ -917,7 +917,7 @@ public class FortSiege implements Siegable
|
||||
}
|
||||
default:
|
||||
{
|
||||
players = getPlayersInZone();
|
||||
players = _fort.getZone().getPlayersInside();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -938,7 +938,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
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -981,18 +981,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())
|
||||
@@ -1032,7 +1032,7 @@ public class FortSiege implements Siegable
|
||||
/** Remove all flags. */
|
||||
private void removeFlags()
|
||||
{
|
||||
for (L2SiegeClan sc : getAttackerClans())
|
||||
for (L2SiegeClan sc : _attackerClans)
|
||||
{
|
||||
if (sc != null)
|
||||
{
|
||||
@@ -1054,8 +1054,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, getFort().getSiegeDate().getTimeInMillis());
|
||||
ps.setInt(2, _fort.getResidenceId());
|
||||
ps.execute();
|
||||
}
|
||||
catch (Exception e)
|
||||
@@ -1079,7 +1079,7 @@ public class FortSiege implements Siegable
|
||||
PreparedStatement ps = con.prepareStatement("INSERT INTO fortsiege_clans (clan_id,fort_id) values (?,?)"))
|
||||
{
|
||||
ps.setInt(1, clan.getId());
|
||||
ps.setInt(2, getFort().getResidenceId());
|
||||
ps.setInt(2, _fort.getResidenceId());
|
||||
ps.execute();
|
||||
|
||||
addAttacker(clan.getId());
|
||||
@@ -1156,7 +1156,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))
|
||||
{
|
||||
@@ -1186,7 +1186,7 @@ public class FortSiege implements Siegable
|
||||
@Override
|
||||
public final Calendar getSiegeDate()
|
||||
{
|
||||
return getFort().getSiegeDate();
|
||||
return _fort.getSiegeDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -1208,7 +1208,7 @@ public class FortSiege implements Siegable
|
||||
{
|
||||
if (_siegeGuardManager == null)
|
||||
{
|
||||
_siegeGuardManager = new FortSiegeGuardManager(getFort());
|
||||
_siegeGuardManager = new FortSiegeGuardManager(_fort);
|
||||
}
|
||||
|
||||
return _siegeGuardManager;
|
||||
@@ -1219,7 +1219,7 @@ public class FortSiege implements Siegable
|
||||
// reload commanders and repair doors
|
||||
removeCommanders();
|
||||
spawnCommanders();
|
||||
getFort().resetDoors();
|
||||
_fort.resetDoors();
|
||||
}
|
||||
|
||||
public List<L2Spawn> getCommanders()
|
||||
|
||||
+22
-22
@@ -124,22 +124,22 @@ public class NevitSystem implements IUniqueId
|
||||
{
|
||||
case 45:
|
||||
{
|
||||
getPlayer().sendPacket(SystemMessageId.YOU_ARE_STARTING_TO_FEEL_THE_EFFECTS_OF_NEVIT_S_ADVENT_BLESSING);
|
||||
_player.sendPacket(SystemMessageId.YOU_ARE_STARTING_TO_FEEL_THE_EFFECTS_OF_NEVIT_S_ADVENT_BLESSING);
|
||||
break;
|
||||
}
|
||||
case 50:
|
||||
{
|
||||
getPlayer().sendPacket(SystemMessageId.YOU_ARE_FURTHER_INFUSED_WITH_THE_BLESSINGS_OF_NEVIT_CONTINUE_TO_BATTLE_EVIL_WHEREVER_IT_MAY_LURK);
|
||||
_player.sendPacket(SystemMessageId.YOU_ARE_FURTHER_INFUSED_WITH_THE_BLESSINGS_OF_NEVIT_CONTINUE_TO_BATTLE_EVIL_WHEREVER_IT_MAY_LURK);
|
||||
break;
|
||||
}
|
||||
case 75:
|
||||
{
|
||||
getPlayer().sendPacket(SystemMessageId.NEVIT_S_ADVENT_BLESSING_SHINES_STRONGLY_FROM_ABOVE_YOU_CAN_ALMOST_SEE_HIS_DIVINE_AURA);
|
||||
_player.sendPacket(SystemMessageId.NEVIT_S_ADVENT_BLESSING_SHINES_STRONGLY_FROM_ABOVE_YOU_CAN_ALMOST_SEE_HIS_DIVINE_AURA);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
getPlayer().sendPacket(new ExNevitAdventPointInfoPacket(getAdventPoints()));
|
||||
_player.sendPacket(new ExNevitAdventPointInfoPacket(getAdventPoints()));
|
||||
}
|
||||
|
||||
public void startAdventTask()
|
||||
@@ -151,7 +151,7 @@ public class NevitSystem implements IUniqueId
|
||||
if ((_adventTask == null) && (getAdventTime() < Config.NEVIT_ADVENT_TIME))
|
||||
{
|
||||
_adventTask = ThreadPool.schedule(new AdventTask(), 30000);
|
||||
getPlayer().sendPacket(new ExNevitAdventTimeChange(getAdventTime(), false));
|
||||
_player.sendPacket(new ExNevitAdventTimeChange(getAdventTime(), false));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -173,7 +173,7 @@ public class NevitSystem implements IUniqueId
|
||||
addPoints(72);
|
||||
if ((getAdventTime() % 60) == 0)
|
||||
{
|
||||
getPlayer().sendPacket(new ExNevitAdventTimeChange(getAdventTime(), false));
|
||||
_player.sendPacket(new ExNevitAdventTimeChange(getAdventTime(), false));
|
||||
}
|
||||
}
|
||||
stopAdventTask(false);
|
||||
@@ -189,7 +189,7 @@ public class NevitSystem implements IUniqueId
|
||||
}
|
||||
if (sendPacket)
|
||||
{
|
||||
getPlayer().sendPacket(new ExNevitAdventTimeChange(getAdventTime(), true));
|
||||
_player.sendPacket(new ExNevitAdventTimeChange(getAdventTime(), true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -202,10 +202,10 @@ public class NevitSystem implements IUniqueId
|
||||
}
|
||||
if ((Config.NEVIT_IGNORE_ADVENT_TIME || (getAdventTime() < Config.NEVIT_ADVENT_TIME)) && (time > 0))
|
||||
{
|
||||
getPlayer().getVariables().set("nevit_b", time);
|
||||
getPlayer().sendPacket(new ExNevitAdventEffect(time));
|
||||
getPlayer().sendPacket(SystemMessageId.THE_ANGEL_NEVIT_HAS_BLESSED_YOU_FROM_ABOVE_YOU_ARE_IMBUED_WITH_FULL_VITALITY_AS_WELL_AS_A_VITALITY_REPLENISHING_EFFECT_AND_SHOULD_YOU_DIE_YOU_WILL_NOT_LOSE_EXP);
|
||||
getPlayer().startAbnormalVisualEffect(true, AbnormalVisualEffect.NAVIT_ADVENT);
|
||||
_player.getVariables().set("nevit_b", time);
|
||||
_player.sendPacket(new ExNevitAdventEffect(time));
|
||||
_player.sendPacket(SystemMessageId.THE_ANGEL_NEVIT_HAS_BLESSED_YOU_FROM_ABOVE_YOU_ARE_IMBUED_WITH_FULL_VITALITY_AS_WELL_AS_A_VITALITY_REPLENISHING_EFFECT_AND_SHOULD_YOU_DIE_YOU_WILL_NOT_LOSE_EXP);
|
||||
_player.startAbnormalVisualEffect(true, AbnormalVisualEffect.NAVIT_ADVENT);
|
||||
_nevitEffectTask = ThreadPool.schedule(new NevitEffectEnd(), time * 1000);
|
||||
}
|
||||
}
|
||||
@@ -219,11 +219,11 @@ public class NevitSystem implements IUniqueId
|
||||
{
|
||||
setAdventTime(0);
|
||||
}
|
||||
getPlayer().getVariables().remove("nevit_b");
|
||||
getPlayer().sendPacket(new ExNevitAdventEffect(0));
|
||||
getPlayer().sendPacket(new ExNevitAdventPointInfoPacket(getAdventPoints()));
|
||||
getPlayer().sendPacket(SystemMessageId.NEVIT_S_ADVENT_BLESSING_HAS_ENDED_CONTINUE_YOUR_JOURNEY_AND_YOU_WILL_SURELY_MEET_HIS_FAVOR_AGAIN_SOMETIME_SOON);
|
||||
getPlayer().stopAbnormalVisualEffect(true, AbnormalVisualEffect.NAVIT_ADVENT);
|
||||
_player.getVariables().remove("nevit_b");
|
||||
_player.sendPacket(new ExNevitAdventEffect(0));
|
||||
_player.sendPacket(new ExNevitAdventPointInfoPacket(getAdventPoints()));
|
||||
_player.sendPacket(SystemMessageId.NEVIT_S_ADVENT_BLESSING_HAS_ENDED_CONTINUE_YOUR_JOURNEY_AND_YOU_WILL_SURELY_MEET_HIS_FAVOR_AGAIN_SOMETIME_SOON);
|
||||
_player.stopAbnormalVisualEffect(true, AbnormalVisualEffect.NAVIT_ADVENT);
|
||||
stopNevitEffectTask(false);
|
||||
}
|
||||
}
|
||||
@@ -237,11 +237,11 @@ public class NevitSystem implements IUniqueId
|
||||
final int time = getEffectTime();
|
||||
if (time > 0)
|
||||
{
|
||||
getPlayer().getVariables().set("nevit_b", time);
|
||||
_player.getVariables().set("nevit_b", time);
|
||||
}
|
||||
else
|
||||
{
|
||||
getPlayer().getVariables().remove("nevit_b");
|
||||
_player.getVariables().remove("nevit_b");
|
||||
}
|
||||
}
|
||||
_nevitEffectTask.cancel(true);
|
||||
@@ -281,21 +281,21 @@ public class NevitSystem implements IUniqueId
|
||||
|
||||
public void setAdventPoints(int points)
|
||||
{
|
||||
getPlayer().getVariables().set("hunting_points", points);
|
||||
_player.getVariables().set("hunting_points", points);
|
||||
}
|
||||
|
||||
public void setAdventTime(int time)
|
||||
{
|
||||
getPlayer().getVariables().set("hunting_time", time);
|
||||
_player.getVariables().set("hunting_time", time);
|
||||
}
|
||||
|
||||
public int getAdventPoints()
|
||||
{
|
||||
return Config.NEVIT_ENABLED ? getPlayer().getVariables().getInt("hunting_points", 0) : 0;
|
||||
return Config.NEVIT_ENABLED ? _player.getVariables().getInt("hunting_points", 0) : 0;
|
||||
}
|
||||
|
||||
public int getAdventTime()
|
||||
{
|
||||
return Config.NEVIT_ENABLED ? getPlayer().getVariables().getInt("hunting_time", 0) : 0;
|
||||
return Config.NEVIT_ENABLED ? _player.getVariables().getInt("hunting_time", 0) : 0;
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ public class Siege implements Siegable
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (!isInProgress())
|
||||
if (!_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -158,7 +158,7 @@ public class Siege implements Siegable
|
||||
public void run()
|
||||
{
|
||||
_scheduledStartSiegeTask.cancel(false);
|
||||
if (isInProgress())
|
||||
if (_isInProgress)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -227,7 +227,7 @@ public class Siege implements Siegable
|
||||
private final List<L2ControlTowerInstance> _controlTowers = new ArrayList<>();
|
||||
private final List<L2FlameTowerInstance> _flameTowers = new ArrayList<>();
|
||||
private final Castle _castle;
|
||||
private boolean _isInProgress = false;
|
||||
boolean _isInProgress = false;
|
||||
private boolean _isNormalSide = true; // true = Atk is Atk, false = Atk is Def
|
||||
protected boolean _isRegistrationOver = false;
|
||||
protected Calendar _siegeEndDate;
|
||||
@@ -246,7 +246,7 @@ 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());
|
||||
@@ -377,7 +377,7 @@ public class Siege implements Siegable
|
||||
*/
|
||||
public void midVictory()
|
||||
{
|
||||
if (isInProgress()) // Siege still in progress
|
||||
if (_isInProgress) // Siege still in progress
|
||||
{
|
||||
if (getCastle().getOwnerId() > 0)
|
||||
{
|
||||
@@ -473,7 +473,7 @@ public class Siege implements Siegable
|
||||
@Override
|
||||
public void startSiege()
|
||||
{
|
||||
if (!isInProgress())
|
||||
if (!_isInProgress)
|
||||
{
|
||||
_firstOwnerClanId = getCastle().getOwnerId();
|
||||
|
||||
@@ -687,7 +687,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 && getCastle().checkIfInZone(x, y, z); // Castle zone during siege
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -741,7 +741,7 @@ public class Siege implements Siegable
|
||||
|
||||
getAttackerClans().clear();
|
||||
getDefenderClans().clear();
|
||||
getDefenderWaitingClans().clear();
|
||||
_defenderWaitingClans.clear();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -758,7 +758,7 @@ public class Siege implements Siegable
|
||||
ps.setInt(1, getCastle().getResidenceId());
|
||||
ps.execute();
|
||||
|
||||
getDefenderWaitingClans().clear();
|
||||
_defenderWaitingClans.clear();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -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());
|
||||
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);
|
||||
}
|
||||
@@ -1242,7 +1242,7 @@ 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)
|
||||
@@ -1618,7 +1618,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))
|
||||
{
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public final class TvTEventListener implements IEventListener
|
||||
@Override
|
||||
public boolean isOnEvent()
|
||||
{
|
||||
return TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(getPlayer().getObjectId());
|
||||
return TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(_player.getObjectId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ public class TvTEventPlayer
|
||||
|
||||
public boolean isOnEvent()
|
||||
{
|
||||
return TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(getPlayer().getObjectId());
|
||||
return TvTEvent.isStarted() && TvTEvent.isPlayerParticipant(_player.getObjectId());
|
||||
}
|
||||
|
||||
public boolean isBlockingExit()
|
||||
|
||||
+4
-4
@@ -38,7 +38,7 @@ public final class AuctionableHall extends ClanHall
|
||||
protected long _paidUntil;
|
||||
private final int _grade;
|
||||
protected boolean _paid;
|
||||
private final int _lease;
|
||||
final int _lease;
|
||||
private final int _chRate = 604800000;
|
||||
|
||||
public AuctionableHall(StatsSet set)
|
||||
@@ -192,7 +192,7 @@ public final class AuctionableHall extends ClanHall
|
||||
{
|
||||
updateDb();
|
||||
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());
|
||||
sm.addInt(_lease);
|
||||
Clan.broadcastToOnlineMembers(sm);
|
||||
if ((_time + (3600000 * 24)) <= (_paidUntil + _chRate))
|
||||
{
|
||||
@@ -219,8 +219,8 @@ public final class AuctionableHall extends ClanHall
|
||||
PreparedStatement ps = con.prepareStatement("UPDATE clanhall SET ownerId=?, paidUntil=?, paid=? WHERE id=?"))
|
||||
{
|
||||
ps.setInt(1, getOwnerId());
|
||||
ps.setLong(2, getPaidUntil());
|
||||
ps.setInt(3, getPaid() ? 1 : 0);
|
||||
ps.setLong(2, _paidUntil);
|
||||
ps.setInt(3, _paid ? 1 : 0);
|
||||
ps.setInt(4, getId());
|
||||
ps.execute();
|
||||
}
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ public abstract class ClanHallSiegeEngine extends Quest implements Siegable
|
||||
_hall.setSiege(this);
|
||||
|
||||
_siegeTask = ThreadPool.schedule(new PrepareOwner(), _hall.getNextSiegeTime() - System.currentTimeMillis() - 3600000);
|
||||
LOGGER.config(_hall.getName() + " siege scheduled for " + getSiegeDate().getTime() + ".");
|
||||
LOGGER.config(_hall.getName() + " siege scheduled for " + _hall.getSiegeDate().getTime() + ".");
|
||||
loadAttackers();
|
||||
}
|
||||
|
||||
|
||||
+5
-5
@@ -195,23 +195,23 @@ public final class SiegableHall extends ClanHall
|
||||
|
||||
public final void addAttacker(L2Clan clan)
|
||||
{
|
||||
if (getSiege() != null)
|
||||
if (_siege != null)
|
||||
{
|
||||
getSiege().getAttackers().put(clan.getId(), new L2SiegeClan(clan.getId(), SiegeClanType.ATTACKER));
|
||||
_siege.getAttackers().put(clan.getId(), new L2SiegeClan(clan.getId(), SiegeClanType.ATTACKER));
|
||||
}
|
||||
}
|
||||
|
||||
public final void removeAttacker(L2Clan clan)
|
||||
{
|
||||
if (getSiege() != null)
|
||||
if (_siege != null)
|
||||
{
|
||||
getSiege().getAttackers().remove(clan.getId());
|
||||
_siege.getAttackers().remove(clan.getId());
|
||||
}
|
||||
}
|
||||
|
||||
public final boolean isRegistered(L2Clan clan)
|
||||
{
|
||||
return (getSiege() != null) && getSiege().checkIsAttacker(clan);
|
||||
return (_siege != null) && _siege.checkIsAttacker(clan);
|
||||
}
|
||||
|
||||
public SiegeStatus getSiegeStatus()
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ public abstract class AbstractEventListener implements Comparable<AbstractEventL
|
||||
*/
|
||||
public void unregisterMe()
|
||||
{
|
||||
getContainer().removeListener(this);
|
||||
_container.removeListener(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -34,7 +34,7 @@ public final class MovieHolder
|
||||
_players = players;
|
||||
_movie = movie;
|
||||
|
||||
getPlayers().forEach(p -> p.playMovie(this));
|
||||
_players.forEach(p -> p.playMovie(this));
|
||||
}
|
||||
|
||||
public Movie getMovie()
|
||||
|
||||
+13
-13
@@ -252,7 +252,7 @@ public final class Instance
|
||||
{
|
||||
if (_doorTemplates.contains(set))
|
||||
{
|
||||
LOGGER.warning("Door ID " + set.getInt("DoorId") + " already exists in instance " + getId());
|
||||
LOGGER.warning("Door ID " + set.getInt("DoorId") + " already exists in instance " + _id);
|
||||
return;
|
||||
}
|
||||
_doorTemplates.add(set);
|
||||
@@ -269,7 +269,7 @@ public final class Instance
|
||||
final int doorId = template.getInt("DoorId");
|
||||
final StatsSet doorTemplate = DoorData.getInstance().getDoorTemplate(doorId);
|
||||
final L2DoorInstance newdoor = new L2DoorInstance(new L2DoorTemplate(doorTemplate));
|
||||
newdoor.setInstanceId(getId());
|
||||
newdoor.setInstanceId(_id);
|
||||
newdoor.setCurrentHp(newdoor.getMaxHp());
|
||||
newdoor.spawnMe(newdoor.getTemplate().getX(), newdoor.getTemplate().getY(), newdoor.getTemplate().getZ());
|
||||
|
||||
@@ -361,12 +361,12 @@ public final class Instance
|
||||
for (Integer objectId : _players)
|
||||
{
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
||||
if ((player != null) && (player.getInstanceId() == getId()))
|
||||
if ((player != null) && (player.getInstanceId() == _id))
|
||||
{
|
||||
player.setInstanceId(0);
|
||||
if (getExitLoc() != null)
|
||||
if (_exitLocation != null)
|
||||
{
|
||||
player.teleToLocation(getExitLoc(), true);
|
||||
player.teleToLocation(_exitLocation, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -435,7 +435,7 @@ public final class Instance
|
||||
spawnDat.setAmount(1);
|
||||
spawnDat.setHeading(set.getInt("heading"));
|
||||
spawnDat.setRespawnDelay(set.getInt("respawn"), set.getInt("respawnRandom"));
|
||||
spawnDat.setInstanceId(getId());
|
||||
spawnDat.setInstanceId(_id);
|
||||
spawnDat.setRandomWalking(set.getBoolean("allowRandomWalk"));
|
||||
final L2Npc spawned = spawnDat.doSpawn();
|
||||
if ((set.getInt("delay") >= 0) && (spawned instanceof L2Attackable))
|
||||
@@ -806,7 +806,7 @@ public final class Instance
|
||||
interval = 300000;
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES);
|
||||
sm.addString(Integer.toString(timeLeft));
|
||||
Broadcast.toPlayersInInstance(sm, getId());
|
||||
Broadcast.toPlayersInInstance(sm, _id);
|
||||
remaining = remaining - 300000;
|
||||
}
|
||||
else if (remaining > 60000)
|
||||
@@ -815,7 +815,7 @@ public final class Instance
|
||||
interval = 60000;
|
||||
final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THIS_DUNGEON_WILL_EXPIRE_IN_S1_MINUTE_S_YOU_WILL_BE_FORCED_OUT_OF_THE_DUNGEON_WHEN_THE_TIME_EXPIRES);
|
||||
sm.addString(Integer.toString(timeLeft));
|
||||
Broadcast.toPlayersInInstance(sm, getId());
|
||||
Broadcast.toPlayersInInstance(sm, _id);
|
||||
remaining = remaining - 60000;
|
||||
}
|
||||
else if (remaining > 30000)
|
||||
@@ -837,7 +837,7 @@ public final class Instance
|
||||
for (Integer objectId : _players)
|
||||
{
|
||||
final L2PcInstance player = L2World.getInstance().getPlayer(objectId);
|
||||
if ((player != null) && (player.getInstanceId() == getId()))
|
||||
if ((player != null) && (player.getInstanceId() == _id))
|
||||
{
|
||||
player.sendPacket(cs);
|
||||
}
|
||||
@@ -887,12 +887,12 @@ public final class Instance
|
||||
// Start eject task
|
||||
_ejectDeadTasks.put(player.getObjectId(), ThreadPool.schedule(() ->
|
||||
{
|
||||
if (player.isDead() && (player.getInstanceId() == getId()))
|
||||
if (player.isDead() && (player.getInstanceId() == _id))
|
||||
{
|
||||
player.setInstanceId(0);
|
||||
if (getExitLoc() != null)
|
||||
if (_exitLocation != null)
|
||||
{
|
||||
player.teleToLocation(getExitLoc(), true);
|
||||
player.teleToLocation(_exitLocation, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -945,7 +945,7 @@ public final class Instance
|
||||
|
||||
public boolean isRemoveBuffEnabled()
|
||||
{
|
||||
return getRemoveBuffType() != InstanceRemoveBuffType.NONE;
|
||||
return _removeBuffType != InstanceRemoveBuffType.NONE;
|
||||
}
|
||||
|
||||
public InstanceRemoveBuffType getRemoveBuffType()
|
||||
|
||||
+6
-6
@@ -168,7 +168,7 @@ public class InstanceWorld
|
||||
*/
|
||||
public List<L2Npc> getAliveNpcs()
|
||||
{
|
||||
return getNpcs().stream().filter(n -> n.getCurrentHp() > 0).collect(Collectors.toList());
|
||||
return _instance.getNpcs().stream().filter(n -> n.getCurrentHp() > 0).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -178,7 +178,7 @@ public class InstanceWorld
|
||||
*/
|
||||
public List<L2Npc> getNpcs(int... id)
|
||||
{
|
||||
return getNpcs().stream().filter(n -> CommonUtil.contains(id, n.getId())).collect(Collectors.toList());
|
||||
return _instance.getNpcs().stream().filter(n -> CommonUtil.contains(id, n.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -191,7 +191,7 @@ public class InstanceWorld
|
||||
@SafeVarargs
|
||||
public final <T extends L2Character> List<T> getNpcs(Class<T> clazz, int... ids)
|
||||
{
|
||||
return getNpcs().stream().filter(n -> (ids.length == 0) || CommonUtil.contains(ids, n.getId())).filter(clazz::isInstance).map(clazz::cast).collect(Collectors.toList());
|
||||
return _instance.getNpcs().stream().filter(n -> (ids.length == 0) || CommonUtil.contains(ids, n.getId())).filter(clazz::isInstance).map(clazz::cast).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,7 +204,7 @@ public class InstanceWorld
|
||||
@SafeVarargs
|
||||
public final <T extends L2Character> List<T> getAliveNpcs(Class<T> clazz, int... ids)
|
||||
{
|
||||
return getNpcs().stream().filter(n -> ((ids.length == 0) || CommonUtil.contains(ids, n.getId())) && (n.getCurrentHp() > 0)).filter(clazz::isInstance).map(clazz::cast).collect(Collectors.toList());
|
||||
return _instance.getNpcs().stream().filter(n -> ((ids.length == 0) || CommonUtil.contains(ids, n.getId())) && (n.getCurrentHp() > 0)).filter(clazz::isInstance).map(clazz::cast).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -214,7 +214,7 @@ public class InstanceWorld
|
||||
*/
|
||||
public List<L2Npc> getAliveNpcs(int... id)
|
||||
{
|
||||
return getNpcs().stream().filter(n -> (n.getCurrentHp() > 0) && CommonUtil.contains(id, n.getId())).collect(Collectors.toList());
|
||||
return _instance.getNpcs().stream().filter(n -> (n.getCurrentHp() > 0) && CommonUtil.contains(id, n.getId())).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -224,7 +224,7 @@ public class InstanceWorld
|
||||
*/
|
||||
public L2Npc getNpc(int id)
|
||||
{
|
||||
return getNpcs().stream().filter(n -> n.getId() == id).findFirst().orElse(null);
|
||||
return _instance.getNpcs().stream().filter(n -> n.getId() == id).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+4
-4
@@ -182,12 +182,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()
|
||||
@@ -251,7 +251,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;
|
||||
@@ -342,7 +342,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)
|
||||
{
|
||||
|
||||
+3
-3
@@ -119,15 +119,15 @@ public class Mail extends ItemContainer
|
||||
try (Connection con = DatabaseFactory.getInstance().getConnection();
|
||||
PreparedStatement ps = con.prepareStatement("SELECT object_id, item_id, count, enchant_level, loc, loc_data, custom_type1, custom_type2, mana_left, time FROM items WHERE owner_id=? AND loc=? AND loc_data=?"))
|
||||
{
|
||||
ps.setInt(1, getOwnerId());
|
||||
ps.setInt(1, _ownerId);
|
||||
ps.setString(2, getBaseLocation().name());
|
||||
ps.setInt(3, getMessageId());
|
||||
ps.setInt(3, _messageId);
|
||||
try (ResultSet inv = ps.executeQuery())
|
||||
{
|
||||
L2ItemInstance item;
|
||||
while (inv.next())
|
||||
{
|
||||
item = L2ItemInstance.restoreFromDb(getOwnerId(), inv);
|
||||
item = L2ItemInstance.restoreFromDb(_ownerId, inv);
|
||||
if (item == null)
|
||||
{
|
||||
continue;
|
||||
|
||||
+8
-8
@@ -141,7 +141,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);
|
||||
}
|
||||
@@ -180,7 +180,7 @@ public class PcInventory extends Inventory
|
||||
}
|
||||
}
|
||||
|
||||
if (!isDuplicate && (!onlyAvailable || (item.isSellable() && item.isAvailable(getOwner(), false, false))))
|
||||
if (!isDuplicate && (!onlyAvailable || (item.isSellable() && item.isAvailable(_owner, false, false))))
|
||||
{
|
||||
list.add(item);
|
||||
}
|
||||
@@ -267,7 +267,7 @@ public class PcInventory extends Inventory
|
||||
final List<L2ItemInstance> list = new LinkedList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item == null) || !item.isAvailable(getOwner(), allowAdena, allowNonTradeable) || !canManipulateWithItemId(item.getId()))
|
||||
if ((item == null) || !item.isAvailable(_owner, allowAdena, allowNonTradeable) || !canManipulateWithItemId(item.getId()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -330,7 +330,7 @@ public class PcInventory extends Inventory
|
||||
final List<TradeItem> list = new LinkedList<>();
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if ((item != null) && item.isAvailable(getOwner(), false, false))
|
||||
if ((item != null) && item.isAvailable(_owner, false, false))
|
||||
{
|
||||
final TradeItem adjItem = tradeList.adjustAvailableItem(item);
|
||||
if (adjItem != null)
|
||||
@@ -697,12 +697,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 (item.getObjectId() == getOwner().getActiveEnchantItemId())
|
||||
if (item.getObjectId() == _owner.getActiveEnchantItemId())
|
||||
{
|
||||
getOwner().setActiveEnchantItemId(L2PcInstance.ID_NONE);
|
||||
_owner.setActiveEnchantItemId(L2PcInstance.ID_NONE);
|
||||
}
|
||||
|
||||
if (item.getId() == ADENA_ID)
|
||||
@@ -736,7 +736,7 @@ public class PcInventory extends Inventory
|
||||
public void refreshWeight()
|
||||
{
|
||||
super.refreshWeight();
|
||||
getOwner().refreshOverloaded();
|
||||
_owner.refreshOverloaded();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+2
-2
@@ -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)
|
||||
@@ -118,7 +118,7 @@ public class PetInventory extends Inventory
|
||||
// check for equiped items from other pets
|
||||
for (L2ItemInstance item : _items)
|
||||
{
|
||||
if (item.isEquipped() && !item.getItem().checkCondition(getOwner(), getOwner(), false))
|
||||
if (item.isEquipped() && !item.getItem().checkCondition(_owner, _owner, false))
|
||||
{
|
||||
unEquipItemInSlot(item.getLocationSlot());
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ public final class L2Armor extends L2Item
|
||||
@Override
|
||||
public final int getItemMask()
|
||||
{
|
||||
return getItemType().mask();
|
||||
return _type.mask();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -137,7 +137,7 @@ public final class L2EtcItem extends L2Item
|
||||
@Override
|
||||
public int getItemMask()
|
||||
{
|
||||
return getItemType().mask();
|
||||
return _type.mask();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -452,11 +452,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:
|
||||
{
|
||||
@@ -473,11 +473,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:
|
||||
{
|
||||
@@ -572,7 +572,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
*/
|
||||
public boolean isEquipable()
|
||||
{
|
||||
return (getBodyPart() != 0) && !(getItemType() instanceof EtcItemType);
|
||||
return (_bodyPart != 0) && !(getItemType() instanceof EtcItemType);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -629,7 +629,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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -802,7 +802,7 @@ public abstract class L2Item extends ListenersContainer implements IIdentifiable
|
||||
}
|
||||
|
||||
// Don't allow hero equipment and restricted items during Olympiad
|
||||
if ((isOlyRestrictedItem() || isHeroItem()) && (activeChar instanceof L2PcInstance) && activeChar.getActingPlayer().isInOlympiadMode())
|
||||
if ((isOlyRestrictedItem() || _heroItem) && (activeChar instanceof L2PcInstance) && activeChar.getActingPlayer().isInOlympiadMode())
|
||||
{
|
||||
if (isEquipable())
|
||||
{
|
||||
|
||||
@@ -202,7 +202,7 @@ public final class L2Weapon extends L2Item
|
||||
@Override
|
||||
public int getItemMask()
|
||||
{
|
||||
return getItemType().mask();
|
||||
return _type.mask();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ public final class EnchantScroll extends AbstractEnchantItem
|
||||
}
|
||||
else if ((supportItem != null))
|
||||
{
|
||||
if (isBlessed())
|
||||
if (_isBlessed)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
+49
-50
@@ -260,15 +260,14 @@ public final class L2ItemInstance extends L2Object
|
||||
}
|
||||
|
||||
// if this item is a mercenary ticket, remove the spawns!
|
||||
final int itemId = getId();
|
||||
|
||||
if (MercTicketManager.getInstance().getTicketCastleId(itemId) > 0)
|
||||
if (MercTicketManager.getInstance().getTicketCastleId(_itemId) > 0)
|
||||
{
|
||||
MercTicketManager.getInstance().removeTicket(this);
|
||||
ItemsOnGroundManager.getInstance().removeObject(this);
|
||||
}
|
||||
|
||||
if (!Config.DISABLE_TUTORIAL && ((itemId == ADENA_ID) || (itemId == 6353)))
|
||||
if (!Config.DISABLE_TUTORIAL && ((_itemId == ADENA_ID) || (_itemId == 6353)))
|
||||
{
|
||||
// Note from UnAfraid:
|
||||
// Unhardcode this?
|
||||
@@ -278,7 +277,7 @@ public final class L2ItemInstance extends L2Object
|
||||
final QuestState qs = actor.getQuestState("Q00255_Tutorial");
|
||||
if ((qs != null) && (qs.getQuest() != null))
|
||||
{
|
||||
qs.getQuest().notifyEvent("CE" + itemId, null, actor);
|
||||
qs.getQuest().notifyEvent("CE" + _itemId, null, actor);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -306,14 +305,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
|
||||
@@ -322,7 +321,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
|
||||
@@ -344,7 +343,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -460,7 +459,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)))
|
||||
{
|
||||
@@ -482,12 +481,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
|
||||
@@ -497,7 +496,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
|
||||
@@ -520,7 +519,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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -537,7 +536,7 @@ public final class L2ItemInstance extends L2Object
|
||||
*/
|
||||
public int isEnchantable()
|
||||
{
|
||||
return (getItemLocation() == ItemLocation.INVENTORY) || (getItemLocation() == ItemLocation.PAPERDOLL) ? getItem().isEnchantable() : 0;
|
||||
return (_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.PAPERDOLL) ? _item.isEnchantable() : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -630,7 +629,7 @@ public final class L2ItemInstance extends L2Object
|
||||
*/
|
||||
public int getDisplayId()
|
||||
{
|
||||
return getItem().getDisplayId();
|
||||
return _item.getDisplayId();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -828,7 +827,7 @@ public final class L2ItemInstance extends L2Object
|
||||
|
||||
public boolean isOlyRestrictedItem()
|
||||
{
|
||||
return getItem().isOlyRestrictedItem();
|
||||
return _item.isOlyRestrictedItem();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -840,14 +839,14 @@ public final class L2ItemInstance extends L2Object
|
||||
public boolean isAvailable(L2PcInstance player, boolean allowAdena, boolean allowNonTradeable)
|
||||
{
|
||||
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
|
||||
&& (!player.hasSummon() || (getObjectId() != player.getSummon().getControlObjectId())) // Not Control item of currently summoned pet
|
||||
&& (player.getActiveEnchantItemId() != getObjectId()) // Not momentarily used enchant scroll
|
||||
&& (player.getActiveEnchantSupportItemId() != getObjectId()) // Not momentarily used enchant support item
|
||||
&& (player.getActiveEnchantAttrItemId() != getObjectId()) // Not momentarily used enchant attribute item
|
||||
&& (allowAdena || (getId() != ADENA_ID)) // Not Adena
|
||||
&& ((player.getCurrentSkill() == null) || (player.getCurrentSkill().getSkill().getItemConsumeId() != getId())) && (!player.isCastingSimultaneouslyNow() || (player.getLastSimultaneousSkillCast() == null) || (player.getLastSimultaneousSkillCast().getItemConsumeId() != getId())) && (allowNonTradeable || (isTradeable() && (!((getItem().getItemType() == EtcItemType.PET_COLLAR) && player.havePetInvItems())))));
|
||||
&& (allowAdena || (_itemId != ADENA_ID)) // Not Adena
|
||||
&& ((player.getCurrentSkill() == null) || (player.getCurrentSkill().getSkill().getItemConsumeId() != _itemId)) && (!player.isCastingSimultaneouslyNow() || (player.getLastSimultaneousSkillCast() == null) || (player.getLastSimultaneousSkillCast().getItemConsumeId() != _itemId)) && (allowNonTradeable || (isTradeable() && (!((_item.getItemType() == EtcItemType.PET_COLLAR) && player.havePetInvItems())))));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -902,7 +901,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;
|
||||
}
|
||||
|
||||
@@ -1062,9 +1061,9 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
return -2;
|
||||
}
|
||||
else if (getItem().getElementals() != null)
|
||||
else if (_item.getElementals() != null)
|
||||
{
|
||||
return getItem().getElementals()[0].getElement();
|
||||
return _item.getElementals()[0].getElement();
|
||||
}
|
||||
else if (_elementals != null)
|
||||
{
|
||||
@@ -1079,9 +1078,9 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (getItem().getElementals() != null)
|
||||
else if (_item.getElementals() != null)
|
||||
{
|
||||
return getItem().getElementals()[0].getValue();
|
||||
return _item.getElementals()[0].getValue();
|
||||
}
|
||||
else if (_elementals != null)
|
||||
{
|
||||
@@ -1096,9 +1095,9 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (getItem().getElementals() != null)
|
||||
else if (_item.getElementals() != null)
|
||||
{
|
||||
final Elementals elm = getItem().getElemental(element);
|
||||
final Elementals elm = _item.getElemental(element);
|
||||
if (elm != null)
|
||||
{
|
||||
return elm.getValue();
|
||||
@@ -1343,7 +1342,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);
|
||||
@@ -1373,7 +1372,7 @@ public final class L2ItemInstance extends L2Object
|
||||
{
|
||||
scheduleConsumeManaTask();
|
||||
}
|
||||
if (getItemLocation() != ItemLocation.WAREHOUSE)
|
||||
if (_loc != ItemLocation.WAREHOUSE)
|
||||
{
|
||||
final InventoryUpdate iu = new InventoryUpdate();
|
||||
iu.addModifiedItem(this);
|
||||
@@ -1409,7 +1408,7 @@ public final class L2ItemInstance extends L2Object
|
||||
*/
|
||||
public List<AbstractFunction> getStatFuncs(L2Character player)
|
||||
{
|
||||
return getItem().getStatFuncs(this, player);
|
||||
return _item.getStatFuncs(this, player);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1622,11 +1621,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;
|
||||
@@ -1658,12 +1657,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;
|
||||
@@ -1836,7 +1835,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);
|
||||
@@ -1977,28 +1976,28 @@ public final class L2ItemInstance extends L2Object
|
||||
|
||||
public boolean isQuestItem()
|
||||
{
|
||||
return getItem().isQuestItem();
|
||||
return _item.isQuestItem();
|
||||
}
|
||||
|
||||
public boolean isElementable()
|
||||
{
|
||||
return ((getItemLocation() == ItemLocation.INVENTORY) || (getItemLocation() == ItemLocation.PAPERDOLL)) && getItem().isElementable();
|
||||
return ((_loc == ItemLocation.INVENTORY) || (_loc == ItemLocation.PAPERDOLL)) && _item.isElementable();
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@@ -2020,7 +2019,7 @@ public final class L2ItemInstance extends L2Object
|
||||
|
||||
public boolean hasPassiveSkills()
|
||||
{
|
||||
return (getItemType() == EtcItemType.RUNE) && (getItemLocation() == ItemLocation.INVENTORY) && (getOwnerId() > 0) && getItem().hasSkills();
|
||||
return (_item.getItemType() == EtcItemType.RUNE) && (_loc == ItemLocation.INVENTORY) && (_ownerId > 0) && _item.hasSkills();
|
||||
}
|
||||
|
||||
public void giveSkillsToOwner()
|
||||
@@ -2034,7 +2033,7 @@ public final class L2ItemInstance extends L2Object
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
for (SkillHolder sh : getItem().getSkills())
|
||||
for (SkillHolder sh : _item.getSkills())
|
||||
{
|
||||
if (sh.getSkill().isPassive())
|
||||
{
|
||||
@@ -2055,7 +2054,7 @@ public final class L2ItemInstance extends L2Object
|
||||
|
||||
if (player != null)
|
||||
{
|
||||
for (SkillHolder sh : getItem().getSkills())
|
||||
for (SkillHolder sh : _item.getSkills())
|
||||
{
|
||||
if (sh.getSkill().isPassive())
|
||||
{
|
||||
|
||||
+1
-1
@@ -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();
|
||||
}
|
||||
|
||||
@@ -156,19 +156,19 @@ public class Options
|
||||
|
||||
public void apply(L2PcInstance player)
|
||||
{
|
||||
if (hasFuncs())
|
||||
if (!_funcs.isEmpty())
|
||||
{
|
||||
player.addStatFuncs(getStatFuncs(null, player));
|
||||
}
|
||||
if (hasActiveSkill())
|
||||
{
|
||||
addSkill(player, getActiveSkill().getSkill());
|
||||
addSkill(player, _activeSkill.getSkill());
|
||||
}
|
||||
if (hasPassiveSkill())
|
||||
{
|
||||
addSkill(player, getPassiveSkill().getSkill());
|
||||
addSkill(player, _passiveSkill.getSkill());
|
||||
}
|
||||
if (hasActivationSkills())
|
||||
if (!_activationSkills.isEmpty())
|
||||
{
|
||||
for (OptionsSkillHolder holder : _activationSkills)
|
||||
{
|
||||
@@ -181,19 +181,19 @@ public class Options
|
||||
|
||||
public void remove(L2PcInstance player)
|
||||
{
|
||||
if (hasFuncs())
|
||||
if (!_funcs.isEmpty())
|
||||
{
|
||||
player.removeStatsOwner(this);
|
||||
}
|
||||
if (hasActiveSkill())
|
||||
{
|
||||
player.removeSkill(getActiveSkill().getSkill(), false, false);
|
||||
player.removeSkill(_activeSkill.getSkill(), false, false);
|
||||
}
|
||||
if (hasPassiveSkill())
|
||||
{
|
||||
player.removeSkill(getPassiveSkill().getSkill(), false, true);
|
||||
player.removeSkill(_passiveSkill.getSkill(), false, true);
|
||||
}
|
||||
if (hasActivationSkills())
|
||||
if (!_activationSkills.isEmpty())
|
||||
{
|
||||
for (OptionsSkillHolder holder : _activationSkills)
|
||||
{
|
||||
|
||||
@@ -2445,7 +2445,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);
|
||||
@@ -2458,9 +2457,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);
|
||||
|
||||
+2
-2
@@ -260,7 +260,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -683,7 +683,7 @@ public final class QuestState
|
||||
Quest.deleteQuestInDb(this, repeatable);
|
||||
if (repeatable)
|
||||
{
|
||||
_player.delQuestState(getQuestName());
|
||||
_player.delQuestState(_questName);
|
||||
_player.sendPacket(new QuestList(_player));
|
||||
}
|
||||
else
|
||||
|
||||
+10
-10
@@ -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,12 +53,12 @@ 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;
|
||||
boolean _isActive = true;
|
||||
final String _name;
|
||||
final Quest _quest;
|
||||
final L2Npc _npc;
|
||||
final L2PcInstance _player;
|
||||
final boolean _isRepeating;
|
||||
private final ScheduledFuture<?> _schedular;
|
||||
|
||||
public QuestTimer(Quest quest, String name, long time, L2Npc npc, L2PcInstance player, boolean repeating)
|
||||
@@ -116,7 +116,7 @@ public class QuestTimer
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if ((quest != _quest) || !name.equalsIgnoreCase(getName()))
|
||||
if ((quest != _quest) || !name.equalsIgnoreCase(_name))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -310,7 +310,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.
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -343,7 +343,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;
|
||||
}
|
||||
|
||||
@@ -243,15 +243,15 @@ public final class Skill implements IIdentifiable
|
||||
_abnormalType = set.getEnum("abnormalType", 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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,8 +319,8 @@ public final class Skill implements IIdentifiable
|
||||
|
||||
_targetType = set.getEnum("targetType", L2TargetType.class, L2TargetType.SELF);
|
||||
_power = set.getFloat("power", 0.f);
|
||||
_pvpPower = set.getFloat("pvpPower", (float) getPower());
|
||||
_pvePower = set.getFloat("pvePower", (float) getPower());
|
||||
_pvpPower = set.getFloat("pvpPower", (float) _power);
|
||||
_pvePower = set.getFloat("pvePower", (float) _power);
|
||||
_magicLevel = set.getInt("magicLvl", 0);
|
||||
_lvlBonusRate = set.getInt("lvlBonusRate", 0);
|
||||
_activateRate = set.getInt("activateRate", -1);
|
||||
@@ -946,7 +946,7 @@ public final class Skill implements IIdentifiable
|
||||
*/
|
||||
public boolean isHealingPotionSkill()
|
||||
{
|
||||
return getAbnormalType() == AbnormalType.HP_RECOVER;
|
||||
return _abnormalType == AbnormalType.HP_RECOVER;
|
||||
}
|
||||
|
||||
public int getChargeConsume()
|
||||
@@ -1373,7 +1373,7 @@ public final class Skill implements IIdentifiable
|
||||
return;
|
||||
}
|
||||
|
||||
if (effected.isInvulAgainst(getId(), getLevel()))
|
||||
if (effected.isInvulAgainst(_id, _level))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -1402,9 +1402,9 @@ public final class Skill implements IIdentifiable
|
||||
// Support for buff sharing feature including healing herbs.
|
||||
if (effected.isPlayer() && effected.hasServitor() && (_abnormalType != AbnormalType.TRANSFORM))
|
||||
{
|
||||
if ((addContinuousEffects && isContinuous() && !isDebuff()) || isRecoveryHerb())
|
||||
if ((addContinuousEffects && isContinuous() && !_isDebuff) || _isRecoveryHerb)
|
||||
{
|
||||
applyEffects(effector, effected.getSummon(), isRecoveryHerb(), 0);
|
||||
applyEffects(effector, effected.getSummon(), _isRecoveryHerb, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1429,7 +1429,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 && info.getEffected().isPlayer() && info.getEffected().hasServitor() && isContinuous() && !isDebuff() && (getId() != CommonSkill.SERVITOR_SHARE.getId()))
|
||||
if (addContinuousEffects && info.getEffected().isPlayer() && info.getEffected().hasServitor() && isContinuous() && !_isDebuff && (getId() != CommonSkill.SERVITOR_SHARE.getId()))
|
||||
{
|
||||
applyEffects(effector, info.getEffected().getSummon(), false, 0);
|
||||
}
|
||||
@@ -1471,7 +1471,7 @@ public final class Skill implements IIdentifiable
|
||||
*/
|
||||
private void activateSkill(L2Character caster, L2CubicInstance cubic, L2Object... targets)
|
||||
{
|
||||
switch (getId())
|
||||
switch (_id)
|
||||
{
|
||||
// TODO: replace with AI
|
||||
case 5852:
|
||||
@@ -1537,9 +1537,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);
|
||||
}
|
||||
@@ -1556,7 +1556,7 @@ public final class Skill implements IIdentifiable
|
||||
}
|
||||
}
|
||||
|
||||
if (isSuicideAttack())
|
||||
if (_isSuicideAttack)
|
||||
{
|
||||
caster.doDie(caster);
|
||||
}
|
||||
@@ -1664,7 +1664,7 @@ public final class Skill implements IIdentifiable
|
||||
*/
|
||||
public boolean canBeStolen()
|
||||
{
|
||||
return !isPassive() && !isToggle() && !isDebuff() && !isHeroSkill() && !isGMSkill() && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && canBeDispeled() && (getId() != CommonSkill.SERVITOR_SHARE.getId());
|
||||
return !isPassive() && !isToggle() && !_isDebuff && !_isHeroSkill && !_isGMSkill && !(isStatic() && (getId() != CommonSkill.CARAVANS_SECRET_MEDICINE.getId())) && _canBeDispeled && (getId() != CommonSkill.SERVITOR_SHARE.getId());
|
||||
}
|
||||
|
||||
public boolean isClanSkill()
|
||||
|
||||
+5
-5
@@ -98,7 +98,7 @@ public class SkillChannelizer implements Runnable
|
||||
{
|
||||
for (L2Character chars : _channelized)
|
||||
{
|
||||
chars.getSkillChannelized().removeChannelizer(_skill.getChannelingSkillId(), getChannelizer());
|
||||
chars.getSkillChannelized().removeChannelizer(_skill.getChannelingSkillId(), _channelizer);
|
||||
}
|
||||
_channelized = null;
|
||||
}
|
||||
@@ -162,7 +162,7 @@ public class SkillChannelizer implements Runnable
|
||||
if (chars.isCharacter())
|
||||
{
|
||||
targetList.add((L2Character) chars);
|
||||
((L2Character) chars).getSkillChannelized().addChannelizer(_skill.getChannelingSkillId(), getChannelizer());
|
||||
((L2Character) chars).getSkillChannelized().addChannelizer(_skill.getChannelingSkillId(), _channelizer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -199,12 +199,12 @@ public class SkillChannelizer implements Runnable
|
||||
}
|
||||
|
||||
// Update PvP status
|
||||
if (character.isPlayable() && getChannelizer().isPlayer() && skill.isBad())
|
||||
if (character.isPlayable() && _channelizer.isPlayer() && skill.isBad())
|
||||
{
|
||||
((L2PcInstance) getChannelizer()).updatePvPStatus(character);
|
||||
((L2PcInstance) _channelizer).updatePvPStatus(character);
|
||||
}
|
||||
|
||||
skill.applyEffects(getChannelizer(), character);
|
||||
skill.applyEffects(_channelizer, character);
|
||||
|
||||
// Reduce shots.
|
||||
if (_skill.useSpiritShot())
|
||||
|
||||
@@ -188,7 +188,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,12 +392,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)
|
||||
@@ -557,7 +557,7 @@ public abstract class L2ZoneType extends ListenersContainer
|
||||
|
||||
public void visualizeZone(int z)
|
||||
{
|
||||
getZone().visualizeZone(z);
|
||||
_zone.visualizeZone(z);
|
||||
}
|
||||
|
||||
public void setEnabled(boolean state)
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user