Direct use of private constants instead of getters.

This commit is contained in:
MobiusDev
2018-06-24 15:33:19 +00:00
parent 6eee61d0d8
commit d265813c40
989 changed files with 12563 additions and 12892 deletions
@@ -205,7 +205,7 @@ public class RecipeController
_skillLevel = _player.getSkillLevel(_skillId);
_skill = _player.getKnownSkill(_skillId);
_player.isInCraftMode(true);
_player.setIsCrafting(true);
if (_player.isAlikeDead())
{
@@ -315,7 +315,7 @@ public class RecipeController
updateCurMp();
updateCurLoad();
_player.isInCraftMode(false);
_player.setIsCrafting(false);
_isValid = true;
}
@@ -459,7 +459,7 @@ public class RecipeController
updateCurMp();
updateCurLoad();
_activeMakers.remove(_player);
_player.isInCraftMode(false);
_player.setIsCrafting(false);
_target.sendPacket(new ItemList(_target, false));
}
@@ -594,7 +594,7 @@ public class RecipeController
private void abort()
{
updateMakeInfo(false);
_player.isInCraftMode(false);
_player.setIsCrafting(false);
_activeMakers.remove(_player);
}
@@ -725,7 +725,7 @@ public class RecipeController
if ((recipeList == null) || (recipeList.getRecipes().length == 0))
{
player.sendMessage("No recipe for: " + id);
player.isInCraftMode(false);
player.setIsCrafting(false);
return null;
}
return recipeList;
@@ -744,7 +744,7 @@ abstract class AbstractAI implements Ctrl
}
return;
}
if (!isAutoAttacking())
if (!_clientAutoAttacking)
{
if ((_actor instanceof L2PcInstance) && (((L2PcInstance) _actor).getPet() != null))
{
@@ -775,7 +775,7 @@ abstract class AbstractAI implements Ctrl
return;
}
final boolean isAutoAttacking = isAutoAttacking();
final boolean isAutoAttacking = _clientAutoAttacking;
if (_actor instanceof L2PcInstance)
{
@@ -75,7 +75,7 @@ public class L2ControllableMobAI extends L2AttackableAI
@Override
protected void onEvtThink()
{
if (isThinking() || _actor.isAllSkillsDisabled())
if (_isThinking || _actor.isAllSkillsDisabled())
{
return;
}
@@ -84,7 +84,7 @@ public class L2ControllableMobAI extends L2AttackableAI
try
{
switch (getAlternateAI())
switch (_alternateAI)
{
case AI_IDLE:
{
@@ -163,7 +163,7 @@ public class L2ControllableMobAI extends L2AttackableAI
max_range = Math.max(max_range, sk.getCastRange());
}
if (!isNotMoving())
if (!_isNotMoving)
{
moveToPawn(getAttackTarget(), max_range);
}
@@ -211,7 +211,7 @@ public class L2ControllableMobAI extends L2AttackableAI
max_range = Math.max(max_range, castRange);
}
if (!isNotMoving())
if (!_isNotMoving)
{
moveToPawn(target, range);
}
@@ -250,7 +250,7 @@ public class L2ControllableMobAI extends L2AttackableAI
max_range = Math.max(max_range, castRange);
}
if (!isNotMoving())
if (!_isNotMoving)
{
moveToPawn(getForcedTarget(), _actor.getPhysicalAttackRange()/* range */);
}
@@ -1004,7 +1004,7 @@ public class L2FortSiegeGuardAI extends L2CharacterAI implements Runnable
return;
}
for (L2Character aggroed : me.getAggroListRP().keySet())
for (L2Character aggroed : me.getAggroList().keySet())
{
me.addDamageHate(aggroed, 0, aggro);
}
@@ -76,7 +76,7 @@ public class L2NpcWalkerAI extends L2CharacterAI implements Runnable
return;
}
if (isWalkingToNextPoint())
if (_walkingToNextPoint)
{
checkArrived();
return;
@@ -831,7 +831,7 @@ public class L2SiegeGuardAI extends L2CharacterAI implements Runnable
return;
}
for (L2Character aggroed : me.getAggroListRP().keySet())
for (L2Character aggroed : me.getAggroList().keySet())
{
me.addDamageHate(aggroed, 0, aggro);
}
@@ -135,7 +135,7 @@ public class CrestCache
}
}
LOGGER.info("Cache[Crest]: " + String.format("%.3f", getMemoryUsage()) + "MB on " + getLoadedFiles() + " files loaded.");
LOGGER.info("Cache[Crest]: " + String.format("%.3f", getMemoryUsage()) + "MB on " + _loadedFiles + " files loaded.");
}
public void convertOldPedgeFiles()
@@ -67,7 +67,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
{
@@ -123,12 +123,12 @@ 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 statement = con.prepareStatement("DELETE FROM topic WHERE topic_id=? AND topic_forum_id=?");
statement.setInt(1, getID());
statement.setInt(1, _id);
statement.setInt(2, f.getID());
statement.execute();
statement.close();
@@ -78,7 +78,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)
@@ -71,7 +71,7 @@ public class NodeLoc extends AbstractNodeLoc
public boolean canGoAll()
{
return canGoNorth() && canGoEast() && canGoSouth() && canGoWest();
return _goNorth && _goEast && _goSouth && _goWest;
}
@Override
@@ -113,19 +113,19 @@ public class NodeLoc extends AbstractNodeLoc
result = (prime * result) + _y;
int nswe = 0;
if (canGoNorth())
if (_goNorth)
{
nswe |= Cell.NSWE_NORTH;
}
if (canGoEast())
if (_goEast)
{
nswe |= Cell.NSWE_EAST;
}
if (canGoSouth())
if (_goSouth)
{
nswe |= Cell.NSWE_SOUTH;
}
if (canGoWest())
if (_goWest)
{
nswe |= Cell.NSWE_WEST;
}
@@ -424,7 +424,7 @@ public class AutoAnnouncementHandler
_isActive = activeValue;
if (isActive())
if (_isActive)
{
AutoAnnouncementRunner acr = new AutoAnnouncementRunner(_defaultId);
_chatTask = ThreadPool.scheduleAtFixedRate(acr, _defaultDelay, _defaultDelay);
@@ -544,7 +544,7 @@ public class AutoChatHandler implements SpawnListener
_isActive = activeValue;
if (!isGlobal())
if (!_globalChat)
{
for (AutoChatDefinition chatDefinition : _chatDefinitions.values())
{
@@ -115,7 +115,7 @@ public class Fishing implements ISkillHandler
return;
}
if (player.isInCraftMode() || player.isInStoreMode())
if (player.isCrafting() || player.isInStoreMode())
{
player.sendPacket(SystemMessageId.CANNOT_FISH_WHILE_USING_RECIPE_BOOK);
// if(!player.isGM())
@@ -55,7 +55,7 @@ public class OfflineShop implements IUserCommandHandler
}
// Message like L2OFF
if ((!player.isInStoreMode() && (!player.isInCraftMode())) || !player.isSitting())
if ((!player.isInStoreMode() && (!player.isCrafting())) || !player.isSitting())
{
player.sendMessage("You are not running a private store or private work shop.");
player.sendPacket(ActionFailed.STATIC_PACKET);
@@ -150,7 +150,7 @@ public class OfflineShop implements IUserCommandHandler
player.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
}
if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isCrafting() && Config.OFFLINE_CRAFT_ENABLE))
{
// Sleep effect, not official feature but however L2OFF features (like offline trade)
if (Config.OFFLINE_SLEEP_EFFECT)
@@ -51,7 +51,7 @@ public class OfflineShop implements IVoicedCommandHandler
}
// Message like L2OFF
if ((!player.isInStoreMode() && (!player.isInCraftMode())) || !player.isSitting())
if ((!player.isInStoreMode() && (!player.isCrafting())) || !player.isSitting())
{
player.sendMessage("You are not running a private store or private work shop.");
player.sendPacket(ActionFailed.STATIC_PACKET);
@@ -146,7 +146,7 @@ public class OfflineShop implements IVoicedCommandHandler
player.removeSkill(SkillTable.getInstance().getInfo(4289, 1));
}
if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isCrafting() && Config.OFFLINE_CRAFT_ENABLE))
{
// Sleep effect, not official feature but however L2OFF features (like offline trade)
if (Config.OFFLINE_SLEEP_EFFECT)
@@ -29,7 +29,6 @@ import com.l2jmobius.commons.util.PrimeFinder;
* @author Olympic
* @version $Revision: 1.2 $ $Date: 2004/06/27 08:12:59 $
*/
public class BitSetIDFactory extends IdFactory
{
private static Logger LOGGER = Logger.getLogger(BitSetIDFactory.class.getName());
@@ -148,7 +147,7 @@ public class BitSetIDFactory extends IdFactory
protected synchronized int usedIdCount()
{
return (size() - FIRST_OID);
return (_freeIdCount.get() - FIRST_OID);
}
protected synchronized boolean reachingBitSetCapacity()
@@ -144,7 +144,7 @@ public class AuctionManager
}
statement.close();
rs.close();
LOGGER.info("Loaded: " + getAuctions().size() + " auction(s)");
LOGGER.info("Loaded: " + _auctions.size() + " auction(s)");
}
catch (Exception e)
@@ -159,7 +159,7 @@ public class AuctionManager
final int index = getAuctionIndex(auctionId);
if (index >= 0)
{
return getAuctions().get(index);
return _auctions.get(index);
}
return null;
@@ -169,9 +169,9 @@ public class AuctionManager
{
Auction auction;
for (int i = 0; i < getAuctions().size(); i++)
for (int i = 0; i < _auctions.size(); i++)
{
auction = getAuctions().get(i);
auction = _auctions.get(i);
if ((auction != null) && (auction.getId() == auctionId))
{
return i;
@@ -61,8 +61,8 @@ public class CastleManorManager
protected static final int MANOR_REFRESH_MIN = Config.ALT_MANOR_REFRESH_MIN; //
protected static final long MAINTENANCE_PERIOD = Config.ALT_MANOR_MAINTENANCE_PERIOD / 60000; // 6 mins
private boolean _underMaintenance;
private boolean _disabled;
boolean _underMaintenance;
boolean _disabled;
public static CastleManorManager getInstance()
{
@@ -522,13 +522,13 @@ public class CastleManorManager
LOGGER.info("Manor System: Under maintenance mode started");
}
}
else if (isUnderMaintenance()) // 20:00 - 20:06
else if (_underMaintenance) // 20:00 - 20:06
{
if ((H != MANOR_REFRESH) || (M >= (MANOR_REFRESH_MIN + MAINTENANCE_PERIOD)))
{
setUnderMaintenance(false);
LOGGER.info("Manor System: Next period started");
if (isDisabled())
if (_disabled)
{
return;
}
@@ -547,7 +547,7 @@ public class CastleManorManager
{
APPROVE = 1;
LOGGER.info("Manor System: Next period approved");
if (isDisabled())
if (_disabled)
{
return;
}
@@ -111,8 +111,8 @@ public class ClanHallManager
rs.close();
statement.close();
LOGGER.info("Loaded: " + getClanHalls().size() + " clan halls");
LOGGER.info("Loaded: " + getFreeClanHalls().size() + " free clan halls");
LOGGER.info("Loaded: " + _clanHall.size() + " clan halls");
LOGGER.info("Loaded: " + _freeClanHall.size() + " free clan halls");
_loaded = true;
}
catch (Exception e)
@@ -73,13 +73,13 @@ public class CoupleManager
while (rs.next())
{
getCouples().add(new Wedding(rs.getInt("id")));
_couples.add(new Wedding(rs.getInt("id")));
}
statement.close();
rs.close();
LOGGER.info("Loaded: " + getCouples().size() + " couples(s)");
LOGGER.info("Loaded: " + _couples.size() + " couples(s)");
}
catch (Exception e)
{
@@ -94,7 +94,7 @@ public class CoupleManager
final int index = getCoupleIndex(coupleId);
if (index >= 0)
{
return getCouples().get(index);
return _couples.get(index);
}
return null;
}
@@ -109,7 +109,7 @@ public class CoupleManager
final int _player2id = player2.getObjectId();
Wedding _new = new Wedding(player1, player2);
getCouples().add(_new);
_couples.add(_new);
player1.setPartnerId(_player2id);
player2.setPartnerId(_player1id);
player1.setCoupleId(_new.getId());
@@ -121,7 +121,7 @@ public class CoupleManager
public void deleteCouple(int coupleId)
{
final int index = getCoupleIndex(coupleId);
Wedding wedding = getCouples().get(index);
Wedding wedding = _couples.get(index);
if (wedding != null)
{
@@ -140,14 +140,14 @@ public class CoupleManager
player2.setCoupleId(0);
}
wedding.divorce();
getCouples().remove(index);
_couples.remove(index);
}
}
public final int getCoupleIndex(int coupleId)
{
int i = 0;
for (Wedding temp : getCouples())
for (Wedding temp : _couples)
{
if ((temp != null) && (temp.getId() == coupleId))
{
@@ -65,9 +65,9 @@ public class FortManager
double closestDistance = 99999999;
double distance;
Fort fort;
for (int i = 0; i < getForts().size(); i++)
for (int i = 0; i < _forts.size(); i++)
{
fort = getForts().get(i);
fort = _forts.get(i);
if (fort == null)
{
continue;
@@ -97,13 +97,13 @@ public class FortManager
while (rs.next())
{
getForts().add(new Fort(rs.getInt("id")));
_forts.add(new Fort(rs.getInt("id")));
}
rs.close();
statement.close();
LOGGER.info("Loaded: " + getForts().size() + " fortress");
LOGGER.info("Loaded: " + _forts.size() + " fortress");
}
catch (Exception e)
{
@@ -116,7 +116,7 @@ public class FortManager
// Property - Public
public final Fort getFortById(int fortId)
{
for (Fort f : getForts())
for (Fort f : _forts)
{
if (f.getFortId() == fortId)
{
@@ -128,7 +128,7 @@ public class FortManager
public final Fort getFortByOwner(L2Clan clan)
{
for (Fort f : getForts())
for (Fort f : _forts)
{
if (f.getOwnerId() == clan.getClanId())
{
@@ -140,7 +140,7 @@ public class FortManager
public final Fort getFort(String name)
{
for (Fort f : getForts())
for (Fort f : _forts)
{
if (f.getName().equalsIgnoreCase(name.trim()))
{
@@ -152,7 +152,7 @@ public class FortManager
public final Fort getFort(int x, int y, int z)
{
for (Fort f : getForts())
for (Fort f : _forts)
{
if (f.checkIfInZone(x, y, z))
{
@@ -170,9 +170,9 @@ public class FortManager
public final int getFortIndex(int fortId)
{
Fort fort;
for (int i = 0; i < getForts().size(); i++)
for (int i = 0; i < _forts.size(); i++)
{
fort = getForts().get(i);
fort = _forts.get(i);
if ((fort != null) && (fort.getFortId() == fortId))
{
return i;
@@ -189,9 +189,9 @@ public class FortManager
public final int getFortIndex(int x, int y, int z)
{
Fort fort;
for (int i = 0; i < getForts().size(); i++)
for (int i = 0; i < _forts.size(); i++)
{
fort = getForts().get(i);
fort = _forts.get(i);
if ((fort != null) && fort.checkIfInZone(x, y, z))
{
return i;
@@ -146,13 +146,13 @@ public class FortSiegeGuardManager
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Delete From fort_siege_guards Where fortId = ? And isHired = 1");
statement.setInt(1, getFort().getFortId());
statement.setInt(1, _fort.getFortId());
statement.execute();
statement.close();
}
catch (Exception e1)
{
LOGGER.warning("Error deleting hired siege guard for fort " + getFort().getName() + ":" + e1);
LOGGER.warning("Error deleting hired siege guard for fort " + _fort.getName() + ":" + e1);
}
}
@@ -165,7 +165,7 @@ public class FortSiegeGuardManager
try
{
loadSiegeGuard();
for (L2Spawn spawn : getSiegeGuardSpawn())
for (L2Spawn spawn : _siegeGuardSpawn)
{
if (spawn != null)
{
@@ -175,7 +175,7 @@ public class FortSiegeGuardManager
}
catch (Throwable t)
{
LOGGER.warning("Error spawning siege guards for fort " + getFort().getName() + ":" + t);
LOGGER.warning("Error spawning siege guards for fort " + _fort.getName() + ":" + t);
}
}
@@ -185,7 +185,7 @@ public class FortSiegeGuardManager
*/
public void unspawnSiegeGuard()
{
for (L2Spawn spawn : getSiegeGuardSpawn())
for (L2Spawn spawn : _siegeGuardSpawn)
{
if (spawn == null)
{
@@ -196,7 +196,7 @@ public class FortSiegeGuardManager
spawn.getLastSpawn().doDie(spawn.getLastSpawn());
}
getSiegeGuardSpawn().clear();
_siegeGuardSpawn.clear();
}
// =========================================================
@@ -210,7 +210,7 @@ public class FortSiegeGuardManager
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("SELECT * FROM fort_siege_guards Where fortId = ? ");
statement.setInt(1, getFort().getFortId());
statement.setInt(1, _fort.getFortId());
ResultSet rs = statement.executeQuery();
L2Spawn spawn1;
@@ -242,7 +242,7 @@ public class FortSiegeGuardManager
}
catch (Exception e1)
{
LOGGER.warning("Error loading siege guard for fort " + getFort().getName() + ":" + e1);
LOGGER.warning("Error loading siege guard for fort " + _fort.getName() + ":" + e1);
}
}
@@ -261,7 +261,7 @@ public class FortSiegeGuardManager
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Insert Into fort_siege_guards (fortId, npcId, x, y, z, heading, respawnDelay, isHired) Values (?, ?, ?, ?, ?, ?, ?, ?)");
statement.setInt(1, getFort().getFortId());
statement.setInt(1, _fort.getFortId());
statement.setInt(2, npcId);
statement.setInt(3, x);
statement.setInt(4, y);
@@ -281,7 +281,7 @@ public class FortSiegeGuardManager
}
catch (Exception e1)
{
LOGGER.warning("Error adding siege guard for fort " + getFort().getName() + ":" + e1);
LOGGER.warning("Error adding siege guard for fort " + _fort.getName() + ":" + e1);
}
}
@@ -1115,7 +1115,7 @@ public class FourSepulchersManager extends GrandBossManager
}
}
if (!isEntryTime())
if (!_inEntryTime)
{
showHtmlFile(player, npcId + "-NE.htm", npc, null);
return;
@@ -1232,7 +1232,7 @@ public class FourSepulchersManager extends GrandBossManager
public void spawnMysteriousBox(int npcId)
{
if (!isAttackTime())
if (!_inAttackTime)
{
return;
}
@@ -1247,7 +1247,7 @@ public class FourSepulchersManager extends GrandBossManager
public void spawnMonster(int npcId)
{
if (!isAttackTime())
if (!_inAttackTime)
{
return;
}
@@ -1423,7 +1423,7 @@ public class FourSepulchersManager extends GrandBossManager
public void spawnKeyBox(L2NpcInstance activeChar)
{
if (!isAttackTime())
if (!_inAttackTime)
{
return;
}
@@ -1445,7 +1445,7 @@ public class FourSepulchersManager extends GrandBossManager
public void spawnExecutionerOfHalisha(L2NpcInstance activeChar)
{
if (!isAttackTime())
if (!_inAttackTime)
{
return;
}
@@ -1467,7 +1467,7 @@ public class FourSepulchersManager extends GrandBossManager
public void spawnArchonOfHalisha(int npcId)
{
if (!isAttackTime())
if (!_inAttackTime)
{
return;
}
@@ -1498,7 +1498,7 @@ public class FourSepulchersManager extends GrandBossManager
public void spawnEmperorsGraveNpc(int npcId)
{
if (!isAttackTime())
if (!_inAttackTime)
{
return;
}
@@ -1544,7 +1544,7 @@ public class FourSepulchersManager extends GrandBossManager
public void spawnShadow(int npcId)
{
if (!isAttackTime())
if (!_inAttackTime)
{
return;
}
@@ -679,7 +679,7 @@ public class MercTicketManager
public void reload()
{
getDroppedTickets().clear();
_droppedTickets.clear();
load();
}
@@ -733,7 +733,7 @@ public class MercTicketManager
dropticket.dropMe(null, x, y, z);
dropticket.setDropTime(0); // avoids it from beeing removed by the auto item destroyer
L2World.getInstance().storeObject(dropticket);
getDroppedTickets().add(dropticket);
_droppedTickets.add(dropticket);
}
break;
}
@@ -742,7 +742,7 @@ public class MercTicketManager
statement.close();
rs.close();
LOGGER.info("Loaded: " + getDroppedTickets().size() + " Mercenary Tickets");
LOGGER.info("Loaded: " + _droppedTickets.size() + " Mercenary Tickets");
}
catch (Exception e)
{
@@ -778,9 +778,9 @@ public class MercTicketManager
int count = 0;
L2ItemInstance ticket;
for (int i = 0; i < getDroppedTickets().size(); i++)
for (int i = 0; i < _droppedTickets.size(); i++)
{
ticket = getDroppedTickets().get(i);
ticket = _droppedTickets.get(i);
if ((ticket != null) && (ticket.getItemId() == itemId))
{
count++;
@@ -815,9 +815,9 @@ public class MercTicketManager
int count = 0;
L2ItemInstance ticket;
for (int i = 0; i < getDroppedTickets().size(); i++)
for (int i = 0; i < _droppedTickets.size(); i++)
{
ticket = getDroppedTickets().get(i);
ticket = _droppedTickets.get(i);
if ((ticket != null) && (getTicketCastleId(ticket.getItemId()) == castleId))
{
count++;
@@ -906,16 +906,16 @@ public class MercTicketManager
public void deleteTickets(int castleId)
{
int i = 0;
while (i < getDroppedTickets().size())
while (i < _droppedTickets.size())
{
L2ItemInstance item = getDroppedTickets().get(i);
L2ItemInstance item = _droppedTickets.get(i);
if ((item != null) && (getTicketCastleId(item.getItemId()) == castleId))
{
item.decayMe();
L2World.getInstance().removeObject(item);
// remove from the list
getDroppedTickets().remove(i);
_droppedTickets.remove(i);
}
else
{
@@ -950,7 +950,7 @@ public class MercTicketManager
new SiegeGuardManager(castle).removeMerc(npcId, item.getX(), item.getY(), item.getZ());
}
getDroppedTickets().remove(item);
_droppedTickets.remove(item);
}
public int[] getItemIds()
@@ -44,8 +44,8 @@ public final class PetitionManager
protected static final Logger LOGGER = Logger.getLogger(PetitionManager.class.getName());
private static PetitionManager _instance;
private final Map<Integer, Petition> _pendingPetitions;
private final Map<Integer, Petition> _completedPetitions;
final Map<Integer, Petition> _pendingPetitions;
final Map<Integer, Petition> _completedPetitions;
private enum PetitionState
{
@@ -128,37 +128,37 @@ public final class PetitionManager
setState(endState);
// _endTime = System.currentTimeMillis();
if ((getResponder() != null) && (getResponder().isOnline() == 1))
if ((_responder != null) && (_responder.isOnline() == 1))
{
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 = new SystemMessage(SystemMessageId.PETITION_ENDED_WITH_S1);
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 = new SystemMessage(SystemMessageId.RECENT_NO_S1_CANCELED);
sm.addNumber(getId());
getResponder().sendPacket(sm);
sm.addNumber(_id);
_responder.sendPacket(sm);
}
}
}
// End petition consultation and inform them, if they are still online.
if ((getPetitioner() != null) && (getPetitioner().isOnline() == 1))
if ((_petitioner != null) && (_petitioner.isOnline() == 1))
{
getPetitioner().sendPacket(SystemMessageId.THIS_END_THE_PETITION_PLEASE_PROVIDE_FEEDBACK);
_petitioner.sendPacket(SystemMessageId.THIS_END_THE_PETITION_PLEASE_PROVIDE_FEEDBACK);
}
getCompletedPetitions().put(getId(), this);
return getPendingPetitions().remove(getId()) != null;
_completedPetitions.put(_id, this);
return _pendingPetitions.remove(_id) != null;
}
public String getContent()
@@ -203,24 +203,24 @@ public final class PetitionManager
public void sendPetitionerPacket(L2GameServerPacket responsePacket)
{
if ((getPetitioner() == null) || (getPetitioner().isOnline() == 0))
if ((_petitioner == null) || (_petitioner.isOnline() == 0))
{
// endPetitionConsultation(PetitionState.Petitioner_Missing);
return;
}
getPetitioner().sendPacket(responsePacket);
_petitioner.sendPacket(responsePacket);
}
public void sendResponderPacket(L2GameServerPacket responsePacket)
{
if ((getResponder() == null) || (getResponder().isOnline() == 0))
if ((_responder == null) || (_responder.isOnline() == 0))
{
endPetitionConsultation(PetitionState.Responder_Missing);
return;
}
getResponder().sendPacket(responsePacket);
_responder.sendPacket(responsePacket);
}
public void setState(PetitionState state)
@@ -230,7 +230,7 @@ public final class PetitionManager
public void setResponder(L2PcInstance respondingAdmin)
{
if (getResponder() != null)
if (_responder != null)
{
return;
}
@@ -247,17 +247,17 @@ public final class PetitionManager
public void clearCompletedPetitions()
{
final int numPetitions = getPendingPetitionCount();
final int numPetitions = _pendingPetitions.size();
getCompletedPetitions().clear();
_completedPetitions.clear();
LOGGER.info("PetitionManager: 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("PetitionManager: Pending petition queue cleared. " + numPetitions + " petition(s) removed.");
}
@@ -268,7 +268,7 @@ public final class PetitionManager
return false;
}
Petition currPetition = getPendingPetitions().get(petitionId);
Petition currPetition = _pendingPetitions.get(petitionId);
if (currPetition.getResponder() != null)
{
@@ -295,7 +295,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()))
{
@@ -315,7 +315,7 @@ public final class PetitionManager
{
if (petitioner != null)
{
for (Petition currPetition : getPendingPetitions().values())
for (Petition currPetition : _pendingPetitions.values())
{
if (currPetition == null)
{
@@ -342,7 +342,7 @@ public final class PetitionManager
return false;
}
for (Petition currPetition : getPendingPetitions().values())
for (Petition currPetition : _pendingPetitions.values())
{
if (currPetition == null)
{
@@ -370,7 +370,7 @@ public final class PetitionManager
public int getPendingPetitionCount()
{
return getPendingPetitions().size();
return _pendingPetitions.size();
}
public int getPlayerTotalPetitionCount(L2PcInstance player)
@@ -382,7 +382,7 @@ public final class PetitionManager
int petitionCount = 0;
for (Petition currPetition : getPendingPetitions().values())
for (Petition currPetition : _pendingPetitions.values())
{
if (currPetition == null)
{
@@ -395,7 +395,7 @@ public final class PetitionManager
}
}
for (Petition currPetition : getCompletedPetitions().values())
for (Petition currPetition : _completedPetitions.values())
{
if (currPetition == null)
{
@@ -413,7 +413,7 @@ public final class PetitionManager
public boolean isPetitionInProcess()
{
for (Petition currPetition : getPendingPetitions().values())
for (Petition currPetition : _pendingPetitions.values())
{
if (currPetition == null)
{
@@ -436,7 +436,7 @@ public final class PetitionManager
return false;
}
final Petition currPetition = getPendingPetitions().get(petitionId);
final Petition currPetition = _pendingPetitions.get(petitionId);
return currPetition.getState() == PetitionState.In_Process;
}
@@ -444,7 +444,7 @@ public final class PetitionManager
{
if (player != null)
{
for (Petition currPetition : getPendingPetitions().values())
for (Petition currPetition : _pendingPetitions.values())
{
if (currPetition == null)
{
@@ -475,7 +475,7 @@ public final class PetitionManager
{
if (petitioner != null)
{
for (Petition currPetition : getPendingPetitions().values())
for (Petition currPetition : _pendingPetitions.values())
{
if (currPetition == null)
{
@@ -494,7 +494,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)
@@ -504,7 +504,7 @@ public final class PetitionManager
return false;
}
final Petition currPetition = getPendingPetitions().get(petitionId);
final Petition currPetition = _pendingPetitions.get(petitionId);
if (currPetition.getResponder() != null)
{
@@ -522,7 +522,7 @@ public final class PetitionManager
CreatureSay cs;
for (Petition currPetition : getPendingPetitions().values())
for (Petition currPetition : _pendingPetitions.values())
{
if (currPetition == null)
{
@@ -558,7 +558,7 @@ public final class PetitionManager
final StringBuilder htmlContent = new StringBuilder("<html><body><center><font color=\"LEVEL\">Current Petitions</font><br><table width=\"300\">");
final SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM HH:mm z");
if (getPendingPetitionCount() == 0)
if (_pendingPetitions.size() == 0)
{
htmlContent.append("<tr><td colspan=\"4\">There are no currently pending petitions.</td></tr>");
}
@@ -567,7 +567,7 @@ public final class PetitionManager
htmlContent.append("<tr><td></td><td><font color=\"999999\">Petitioner</font></td><td><font color=\"999999\">Petition Type</font></td><td><font color=\"999999\">Submitted</font></td></tr>");
}
for (Petition currPetition : getPendingPetitions().values())
for (Petition currPetition : _pendingPetitions.values())
{
if (currPetition == null)
{
@@ -600,7 +600,7 @@ public final class PetitionManager
// Create a new petition instance and add it to the list of pending petitions.
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.
String msgContent = petitioner.getName() + " has submitted a new petition."; // (ID: " + newPetitionId + ").";
@@ -621,7 +621,7 @@ public final class PetitionManager
return;
}
Petition currPetition = getPendingPetitions().get(petitionId);
Petition currPetition = _pendingPetitions.get(petitionId);
StringBuilder htmlContent = new StringBuilder("<html><body>");
SimpleDateFormat dateFormat = new SimpleDateFormat("EEE dd MMM HH:mm z");
@@ -142,13 +142,13 @@ public class SiegeGuardManager
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Delete From castle_siege_guards Where castleId = ? And isHired = 1");
statement.setInt(1, getCastle().getCastleId());
statement.setInt(1, _castle.getCastleId());
statement.execute();
statement.close();
}
catch (Exception e1)
{
LOGGER.warning("Error deleting hired siege guard for castle " + getCastle().getName() + ":" + e1);
LOGGER.warning("Error deleting hired siege guard for castle " + _castle.getName() + ":" + e1);
}
}
@@ -159,7 +159,7 @@ public class SiegeGuardManager
public void spawnSiegeGuard()
{
loadSiegeGuard();
for (L2Spawn spawn : getSiegeGuardSpawn())
for (L2Spawn spawn : _siegeGuardSpawn)
{
if (spawn != null)
{
@@ -174,7 +174,7 @@ public class SiegeGuardManager
*/
public void unspawnSiegeGuard()
{
for (L2Spawn spawn : getSiegeGuardSpawn())
for (L2Spawn spawn : _siegeGuardSpawn)
{
if (spawn == null)
{
@@ -185,7 +185,7 @@ public class SiegeGuardManager
spawn.getLastSpawn().doDie(spawn.getLastSpawn());
}
getSiegeGuardSpawn().clear();
_siegeGuardSpawn.clear();
}
// =========================================================
@@ -199,8 +199,8 @@ public class SiegeGuardManager
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("SELECT * FROM castle_siege_guards Where castleId = ? And isHired = ?");
statement.setInt(1, getCastle().getCastleId());
if (getCastle().getOwnerId() > 0)
statement.setInt(1, _castle.getCastleId());
if (_castle.getOwnerId() > 0)
{
statement.setInt(2, 1);
}
@@ -239,7 +239,7 @@ public class SiegeGuardManager
}
catch (Exception e1)
{
LOGGER.warning("Error loading siege guard for castle " + getCastle().getName() + ":" + e1);
LOGGER.warning("Error loading siege guard for castle " + _castle.getName() + ":" + e1);
}
}
@@ -258,7 +258,7 @@ public class SiegeGuardManager
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Insert Into castle_siege_guards (castleId, npcId, x, y, z, heading, respawnDelay, isHired) Values (?, ?, ?, ?, ?, ?, ?, ?)");
statement.setInt(1, getCastle().getCastleId());
statement.setInt(1, _castle.getCastleId());
statement.setInt(2, npcId);
statement.setInt(3, x);
statement.setInt(4, y);
@@ -278,7 +278,7 @@ public class SiegeGuardManager
}
catch (Exception e1)
{
LOGGER.warning("Error adding siege guard for castle " + getCastle().getName() + ":" + e1);
LOGGER.warning("Error adding siege guard for castle " + _castle.getName() + ":" + e1);
}
}
@@ -64,7 +64,7 @@ public class CursedWeapon
private ScheduledFuture<?> _removeTask;
private int _nbKills = 0;
private long _endTime = 0;
long _endTime = 0;
private int _playerId = 0;
private L2PcInstance _player = null;
@@ -208,7 +208,7 @@ public class CursedWeapon
@Override
public void run()
{
if (System.currentTimeMillis() >= getEndTime())
if (System.currentTimeMillis() >= _endTime)
{
endOfLife();
}
@@ -183,7 +183,7 @@ public class L2Clan
try
{
restore();
getWarehouse().restore();
_warehouse.restore();
}
catch (Exception e)
{
@@ -290,7 +290,7 @@ public class L2Clan
activeChar.sendPacket(ActionFailed.STATIC_PACKET);
return;
}
if (!getLeader().isOnline())
if (!_leader.isOnline())
{
return;
}
@@ -305,19 +305,13 @@ public class L2Clan
return;
}
// L2PcInstance exLeader = getLeader().getPlayerInstance();
// L2PcInstance exLeader = _leader.getPlayerInstance();
if (setLeader(member))
{
SystemMessage sm = new SystemMessage(SystemMessageId.CLAN_LEADER_PRIVILEGES_HAVE_BEEN_TRANSFERRED_TO_S1);
sm.addString(member.getName());
broadcastToOnlineMembers(sm);
}
// SiegeManager.getInstance().removeSiegeSkills(exLeader);
/*
* if(getLevel() >= 4) { SiegeManager.getInstance().addSiegeSkills(newLeader); }
*/
}
/**
@@ -518,7 +512,7 @@ public class L2Clan
{
case 0:
{
switch (getLevel())
switch (_level)
{
case 4:
{
@@ -769,20 +763,20 @@ public class L2Clan
{
PreparedStatement statement = 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=? WHERE clan_id=?");
statement.setInt(1, getLeaderId());
statement.setInt(2, getAllyId());
statement.setString(3, getAllyName());
statement.setInt(4, getReputationScore());
statement.setLong(5, getAllyPenaltyExpiryTime());
statement.setInt(6, getAllyPenaltyType());
statement.setLong(7, getCharPenaltyExpiryTime());
statement.setLong(8, getDissolvingExpiryTime());
statement.setInt(9, getClanId());
statement.setInt(2, _allyId);
statement.setString(3, _allyName);
statement.setInt(4, _reputationScore);
statement.setLong(5, _allyPenaltyExpiryTime);
statement.setInt(6, _allyPenaltyType);
statement.setLong(7, _charPenaltyExpiryTime);
statement.setLong(8, _dissolvingExpiryTime);
statement.setInt(9, _clanId);
statement.execute();
statement.close();
if (Config.DEBUG)
{
LOGGER.info("New clan leader saved in db: " + getClanId());
LOGGER.info("New clan leader saved in db: " + _clanId);
}
}
catch (Exception e)
@@ -796,22 +790,22 @@ public class L2Clan
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("INSERT INTO clan_data (clan_id,clan_name,clan_level,hasCastle,ally_id,ally_name,leader_id,crest_id,crest_large_id,ally_crest_id) values (?,?,?,?,?,?,?,?,?,?)");
statement.setInt(1, getClanId());
statement.setString(2, getName());
statement.setInt(3, getLevel());
statement.setInt(4, getHasCastle());
statement.setInt(5, getAllyId());
statement.setString(6, getAllyName());
statement.setInt(1, _clanId);
statement.setString(2, _name);
statement.setInt(3, _level);
statement.setInt(4, _hasCastle);
statement.setInt(5, _allyId);
statement.setString(6, _allyName);
statement.setInt(7, getLeaderId());
statement.setInt(8, getCrestId());
statement.setInt(9, getCrestLargeId());
statement.setInt(10, getAllyCrestId());
statement.setInt(8, _crestId);
statement.setInt(9, _crestLargeId);
statement.setInt(10, _allyCrestId);
statement.execute();
statement.close();
if (Config.DEBUG)
{
LOGGER.info("New clan saved in db: " + getClanId());
LOGGER.info("New clan saved in db: " + _clanId);
}
}
catch (Exception e)
@@ -834,7 +828,7 @@ public class L2Clan
if (Config.DEBUG)
{
LOGGER.info("clan member removed in db: " + getClanId());
LOGGER.info("clan member removed in db: " + _clanId);
}
statement = con.prepareStatement("UPDATE characters SET apprentice=0 WHERE apprentice=?");
@@ -860,7 +854,7 @@ public class L2Clan
L2ClanMember member;
PreparedStatement statement = con.prepareStatement("SELECT clan_name,clan_level,hasCastle,ally_id,ally_name,leader_id,crest_id,crest_large_id,ally_crest_id,reputation_score,auction_bid_at,ally_penalty_expiry_time,ally_penalty_type,char_penalty_expiry_time,dissolving_expiry_time FROM clan_data where clan_id=?");
statement.setInt(1, getClanId());
statement.setInt(1, _clanId);
ResultSet clanData = statement.executeQuery();
if (clanData.next())
@@ -872,14 +866,14 @@ public class L2Clan
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);
}
@@ -888,14 +882,14 @@ public class L2Clan
setCrestId(clanData.getInt("crest_id"));
if (getCrestId() != 0)
if (_crestId != 0)
{
setHasCrest(true);
}
setCrestLargeId(clanData.getInt("crest_large_id"));
if (getCrestLargeId() != 0)
if (_crestLargeId != 0)
{
setHasCrestLarge(true);
}
@@ -907,7 +901,7 @@ public class L2Clan
final int leaderId = clanData.getInt("leader_id");
PreparedStatement statement2 = con.prepareStatement("SELECT char_name,level,classid,obj_Id,title,power_grade,subpledge,apprentice,sponsor FROM characters WHERE clanid=?");
statement2.setInt(1, getClanId());
statement2.setInt(1, _clanId);
ResultSet clanMembers = statement2.executeQuery();
while (clanMembers.next())
@@ -931,9 +925,9 @@ public class L2Clan
clanData.close();
statement.close();
if (Config.DEBUG && (getName() != null))
if (Config.DEBUG && (_name != null))
{
LOGGER.info("Restored clan data for \"" + getName() + "\" from database.");
LOGGER.info("Restored clan data for \"" + _name + "\" from database.");
}
restoreSubPledges();
@@ -1048,7 +1042,7 @@ public class L2Clan
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("SELECT skill_id,skill_level FROM clan_skills WHERE clan_id=?");
statement.setInt(1, getClanId());
statement.setInt(1, _clanId);
ResultSet rset = statement.executeQuery();
@@ -1129,7 +1123,7 @@ public class L2Clan
statement = con.prepareStatement("UPDATE clan_skills SET skill_level=? WHERE skill_id=? AND clan_id=?");
statement.setInt(1, newSkill.getLevel());
statement.setInt(2, oldSkill.getId());
statement.setInt(3, getClanId());
statement.setInt(3, _clanId);
statement.execute();
statement.close();
}
@@ -1138,7 +1132,7 @@ public class L2Clan
try
{
statement = con.prepareStatement("INSERT INTO clan_skills (clan_id,skill_id,skill_level,skill_name) VALUES (?,?,?,?)");
statement.setInt(1, getClanId());
statement.setInt(1, _clanId);
statement.setInt(2, newSkill.getId());
statement.setInt(3, newSkill.getLevel());
statement.setString(4, newSkill.getName());
@@ -1150,7 +1144,7 @@ public class L2Clan
statement = con.prepareStatement("UPDATE clan_skills SET skill_level=? WHERE skill_id=? AND clan_id=?");
statement.setInt(1, newSkill.getLevel());
statement.setInt(2, newSkill.getId());
statement.setInt(3, getClanId());
statement.setInt(3, _clanId);
statement.execute();
statement.close();
}
@@ -1230,7 +1224,7 @@ public class L2Clan
public void broadcastToOnlineAllyMembers(L2GameServerPacket packet)
{
if (getAllyId() == 0)
if (_allyId == 0)
{
return;
}
@@ -1521,7 +1515,7 @@ public class L2Clan
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("SELECT sub_pledge_id,name,leader_name FROM clan_subpledges WHERE clan_id=?");
statement.setInt(1, getClanId());
statement.setInt(1, _clanId);
ResultSet rset = statement.executeQuery();
while (rset.next())
@@ -1621,7 +1615,7 @@ public class L2Clan
// Royal Guard 5000 points per each
// Order of Knights 10000 points per each
if ((pledgeType != -1) && (((getReputationScore() < 5000) && (pledgeType < SUBUNIT_KNIGHT1)) || ((getReputationScore() < 10000) && (pledgeType > SUBUNIT_ROYAL2))))
if ((pledgeType != -1) && (((_reputationScore < 5000) && (pledgeType < SUBUNIT_KNIGHT1)) || ((_reputationScore < 10000) && (pledgeType > SUBUNIT_ROYAL2))))
{
SystemMessage sp = new SystemMessage(SystemMessageId.THE_CLAN_REPUTATION_SCORE_IS_TOO_LOW);
player.sendPacket(sp);
@@ -1632,7 +1626,7 @@ public class L2Clan
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("INSERT INTO clan_subpledges (clan_id,sub_pledge_id,name,leader_name) values (?,?,?,?)");
statement.setInt(1, getClanId());
statement.setInt(1, _clanId);
statement.setInt(2, pledgeType);
statement.setString(3, subPledgeName);
@@ -1653,12 +1647,12 @@ public class L2Clan
if (pledgeType != -1)
{
setReputationScore(getReputationScore() - 2500, true);
setReputationScore(_reputationScore - 2500, true);
}
if (Config.DEBUG)
{
LOGGER.info("New sub_clan saved in db: " + getClanId() + "; " + pledgeType);
LOGGER.info("New sub_clan saved in db: " + _clanId + "; " + pledgeType);
}
}
catch (Exception e)
@@ -1723,7 +1717,7 @@ public class L2Clan
PreparedStatement statement = con.prepareStatement("UPDATE clan_subpledges SET leader_name=?, name=? WHERE clan_id=? AND sub_pledge_id=?");
statement.setString(1, getSubPledge(pledgeType).getLeaderName());
statement.setString(2, getSubPledge(pledgeType).getName());
statement.setInt(3, getClanId());
statement.setInt(3, _clanId);
statement.setInt(4, pledgeType);
statement.execute();
@@ -1731,7 +1725,7 @@ public class L2Clan
if (Config.DEBUG)
{
LOGGER.info("New subpledge leader saved in db: " + getClanId());
LOGGER.info("New subpledge leader saved in db: " + _clanId);
}
}
catch (Exception e)
@@ -1745,8 +1739,8 @@ public class L2Clan
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("SELECT privs,rank,party FROM clan_privs WHERE clan_id=?");
statement.setInt(1, getClanId());
// LOGGER.warning("clanPrivs restore for ClanId : "+getClanId());
statement.setInt(1, _clanId);
// LOGGER.warning("clanPrivs restore for ClanId : "+_clanId);
ResultSet rset = statement.executeQuery();
// Go though the recordset of this SQL query
@@ -1801,7 +1795,7 @@ public class L2Clan
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?) ON DUPLICATE KEY UPDATE privs = ?");
statement.setInt(1, getClanId());
statement.setInt(1, _clanId);
statement.setInt(2, rank);
statement.setInt(3, 0);
statement.setInt(4, privs);
@@ -1838,7 +1832,7 @@ public class L2Clan
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("INSERT INTO clan_privs (clan_id,rank,party,privs) VALUES (?,?,?,?)");
statement.setInt(1, getClanId());
statement.setInt(1, _clanId);
statement.setInt(2, rank);
statement.setInt(3, 0);
statement.setInt(4, privs);
@@ -1970,7 +1964,7 @@ public class L2Clan
{
PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET auction_bid_at=? WHERE clan_id=?");
statement.setInt(1, id);
statement.setInt(2, getClanId());
statement.setInt(2, _clanId);
statement.execute();
statement.close();
}
@@ -2013,7 +2007,7 @@ public class L2Clan
return false;
}
if (getCharPenaltyExpiryTime() > System.currentTimeMillis())
if (_charPenaltyExpiryTime > System.currentTimeMillis())
{
SystemMessage sm = new SystemMessage(SystemMessageId.YOU_MUST_WAIT_BEFORE_ACCEPTING_A_NEW_MEMBER);
sm.addString(target.getName());
@@ -2051,7 +2045,7 @@ public class L2Clan
if (pledgeType == 0)
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_CLAN_IS_FULL);
sm.addString(getName());
sm.addString(_name);
activeChar.sendPacket(sm);
}
else
@@ -2238,28 +2232,28 @@ public class L2Clan
return;
}
if (getAllyId() != 0)
if (_allyId != 0)
{
player.sendPacket(SystemMessageId.ALREADY_JOINED_ALLIANCE);
return;
}
if (getLevel() < 5)
if (_level < 5)
{
player.sendPacket(SystemMessageId.TO_CREATE_AN_ALLY_YOU_CLAN_MUST_BE_LEVEL_5_OR_HIGHER);
return;
}
if (getAllyPenaltyExpiryTime() > System.currentTimeMillis())
if (_allyPenaltyExpiryTime > System.currentTimeMillis())
{
if (getAllyPenaltyType() == PENALTY_TYPE_DISSOLVE_ALLY)
if (_allyPenaltyType == PENALTY_TYPE_DISSOLVE_ALLY)
{
player.sendPacket(SystemMessageId.CANT_CREATE_ALLIANCE_10_DAYS_DISOLUTION);
return;
}
}
if (getDissolvingExpiryTime() > System.currentTimeMillis())
if (_dissolvingExpiryTime > System.currentTimeMillis())
{
player.sendPacket(SystemMessageId.YOU_MAY_NOT_CREATE_ALLY_WHILE_DISSOLVING);
return;
@@ -2296,7 +2290,7 @@ public class L2Clan
return;
}
setAllyId(getClanId());
setAllyId(_clanId);
setAllyName(allyName.trim());
setAllyPenaltyExpiryTime(0, 0);
updateClanInDB();
@@ -2309,13 +2303,13 @@ public class L2Clan
public void dissolveAlly(L2PcInstance player)
{
if (getAllyId() == 0)
if (_allyId == 0)
{
player.sendPacket(SystemMessageId.NO_CURRENT_ALLIANCES);
return;
}
if (!player.isClanLeader() || (getClanId() != getAllyId()))
if (!player.isClanLeader() || (_clanId != _allyId))
{
player.sendPacket(SystemMessageId.FEATURE_ONLY_FOR_ALLIANCE_LEADER);
return;
@@ -2360,7 +2354,7 @@ public class L2Clan
return;
}
if (System.currentTimeMillis() < getDissolvingExpiryTime())
if (System.currentTimeMillis() < _dissolvingExpiryTime)
{
player.sendPacket(SystemMessageId.CANNOT_RISE_LEVEL_WHILE_DISSOLUTION_IN_PROGRESS);
return;
@@ -2368,7 +2362,7 @@ public class L2Clan
boolean increaseClanLevel = false;
switch (getLevel())
switch (_level)
{
case 0:
{
@@ -2467,9 +2461,9 @@ public class L2Clan
}
case 5:
{
if ((getReputationScore() >= 10000) && (getMembersCount() >= 30))
if ((_reputationScore >= 10000) && (_members.size() >= 30))
{
setReputationScore(getReputationScore() - 10000, true);
setReputationScore(_reputationScore - 10000, true);
SystemMessage cr = new SystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP);
cr.addNumber(10000);
player.sendPacket(cr);
@@ -2479,9 +2473,9 @@ public class L2Clan
}
case 6:
{
if ((getReputationScore() >= 20000) && (getMembersCount() >= 80))
if ((_reputationScore >= 20000) && (_members.size() >= 80))
{
setReputationScore(getReputationScore() - 20000, true);
setReputationScore(_reputationScore - 20000, true);
SystemMessage cr = new SystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP);
cr.addNumber(20000);
player.sendPacket(cr);
@@ -2491,9 +2485,9 @@ public class L2Clan
}
case 7:
{
if ((getReputationScore() >= 40000) && (getMembersCount() >= 120))
if ((_reputationScore >= 40000) && (_members.size() >= 120))
{
setReputationScore(getReputationScore() - 40000, true);
setReputationScore(_reputationScore - 40000, true);
SystemMessage cr = new SystemMessage(SystemMessageId.S1_DEDUCTED_FROM_CLAN_REP);
cr.addNumber(40000);
player.sendPacket(cr);
@@ -2522,7 +2516,7 @@ public class L2Clan
ItemList il = new ItemList(player, false);
player.sendPacket(il);
changeLevel(getLevel() + 1);
changeLevel(_level + 1);
}
public void changeLevel(int level)
@@ -2531,7 +2525,7 @@ public class L2Clan
{
PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET clan_level = ? WHERE clan_id = ?");
statement.setInt(1, level);
statement.setInt(2, getClanId());
statement.setInt(2, _clanId);
statement.execute();
statement.close();
}
@@ -2542,9 +2536,9 @@ public class L2Clan
setLevel(level);
if (getLeader().isOnline())
if (_leader.isOnline())
{
L2PcInstance leader = getLeader().getPlayerInstance();
L2PcInstance leader = _leader.getPlayerInstance();
if (3 < level)
{
@@ -2578,7 +2572,7 @@ public class L2Clan
setAllyCrestId(crestId);
PreparedStatement statement = con.prepareStatement("UPDATE clan_data SET ally_crest_id = ? WHERE clan_id = ?");
statement.setInt(1, crestId);
statement.setInt(2, getClanId());
statement.setInt(2, _clanId);
statement.executeUpdate();
statement.close();
}
@@ -35,7 +35,7 @@ import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
*/
public class L2CommandChannel
{
private final List<L2Party> _partys;
private final List<L2Party> _parties;
private L2PcInstance _commandLeader = null;
private int _channelLvl;
@@ -46,8 +46,8 @@ public class L2CommandChannel
public L2CommandChannel(L2PcInstance leader)
{
_commandLeader = leader;
_partys = new ArrayList<>();
_partys.add(leader.getParty());
_parties = new ArrayList<>();
_parties.add(leader.getParty());
_channelLvl = leader.getParty().getLevel();
leader.getParty().setCommandChannel(this);
leader.getParty().broadcastToPartyMembers(new SystemMessage(SystemMessageId.COMMAND_CHANNEL_FORMED));
@@ -65,7 +65,7 @@ public class L2CommandChannel
return;
}
_partys.add(party);
_parties.add(party);
if (party.getLevel() > _channelLvl)
{
@@ -88,10 +88,10 @@ public class L2CommandChannel
return;
}
_partys.remove(party);
_parties.remove(party);
_channelLvl = 0;
for (L2Party pty : _partys)
for (L2Party pty : _parties)
{
if (pty.getLevel() > _channelLvl)
{
@@ -102,7 +102,7 @@ public class L2CommandChannel
party.setCommandChannel(null);
party.broadcastToPartyMembers(new ExCloseMPCC());
if (_partys.size() < 2)
if (_parties.size() < 2)
{
broadcastToChannelMembers(new SystemMessage(SystemMessageId.COMMAND_CHANNEL_DISBANDED));
disbandChannel();
@@ -114,16 +114,16 @@ public class L2CommandChannel
*/
public void disbandChannel()
{
if (_partys != null)
if (_parties != null)
{
for (L2Party party : _partys)
for (L2Party party : _parties)
{
if (party != null)
{
removeParty(party);
}
}
_partys.clear();
_parties.clear();
}
}
@@ -134,7 +134,7 @@ public class L2CommandChannel
{
int count = 0;
for (L2Party party : _partys)
for (L2Party party : _parties)
{
if (party != null)
{
@@ -150,9 +150,9 @@ public class L2CommandChannel
*/
public void broadcastToChannelMembers(L2GameServerPacket gsp)
{
if ((_partys != null) && !_partys.isEmpty())
if ((_parties != null) && !_parties.isEmpty())
{
for (L2Party party : _partys)
for (L2Party party : _parties)
{
if (party != null)
{
@@ -164,9 +164,9 @@ public class L2CommandChannel
public void broadcastCSToChannelMembers(CreatureSay gsp, L2PcInstance broadcaster)
{
if ((_partys != null) && !_partys.isEmpty())
if ((_parties != null) && !_parties.isEmpty())
{
for (L2Party party : _partys)
for (L2Party party : _parties)
{
if (party != null)
{
@@ -181,7 +181,7 @@ public class L2CommandChannel
*/
public List<L2Party> getPartys()
{
return _partys;
return _parties;
}
/**
@@ -190,7 +190,7 @@ public class L2CommandChannel
public List<L2PcInstance> getMembers()
{
final List<L2PcInstance> members = new ArrayList<>();
for (L2Party party : getPartys())
for (L2Party party : _parties)
{
members.addAll(party.getPartyMembers());
}
@@ -69,7 +69,7 @@ public class L2DropCategory
public boolean isSweep()
{
return getCategoryType() == -1;
return _categoryType == -1;
}
// this returns the chance for the category to be visited in order to check if
@@ -77,7 +77,7 @@ public class L2DropCategory
// (but may return 0 or many drops)
public int getCategoryChance()
{
if (getCategoryType() >= 0)
if (_categoryType >= 0)
{
return _categoryChance;
}
@@ -86,7 +86,7 @@ public class L2DropCategory
public int getCategoryBalancedChance()
{
if (getCategoryType() >= 0)
if (_categoryType >= 0)
{
return _categoryBalancedChance;
}
@@ -107,7 +107,7 @@ public class L2DropCategory
{
List<L2DropData> drops = new ArrayList<>();
int subCatChance = 0;
for (L2DropData drop : getAllDrops())
for (L2DropData drop : _drops)
{
if ((drop.getItemId() == 57) || (drop.getItemId() == 6360) || (drop.getItemId() == 6361) || (drop.getItemId() == 6362))
{
@@ -148,7 +148,7 @@ public class L2DropCategory
{
final int randomIndex = Rnd.get(getCategoryBalancedChance());
int sum = 0;
for (L2DropData drop : getAllDrops())
for (L2DropData drop : _drops)
{
sum += Math.min((drop.getChance() * (raid ? 1 : Config.RATE_DROP_ITEMS)), L2DropData.MAX_CHANCE);
@@ -157,10 +157,10 @@ public class L2DropData
@Override
public String toString()
{
String out = "ItemID: " + getItemId() + " Min: " + getMinDrop() + " Max: " + getMaxDrop() + " Chance: " + (getChance() / 10000.0) + "%";
String out = "ItemID: " + _itemId + " Min: " + _minDrop + " Max: " + _maxDrop + " Chance: " + (_chance / 10000.0) + "%";
if (isQuestDrop())
{
out += " QuestID: " + getQuestID() + " StateID's: " + Arrays.toString(getStateIDs());
out += " QuestID: " + _questID + " StateID's: " + Arrays.toString(_stateID);
}
return out;
@@ -185,6 +185,6 @@ public class L2DropData
@Override
public int hashCode()
{
return getItemId();
return _itemId;
}
}
@@ -131,7 +131,7 @@ public abstract class L2Effect
// period, seconds
private final int _period;
private int _periodStartTicks;
private int _periodfirsttime;
int _periodfirsttime;
// function templates
private final FuncTemplate[] _funcTemplates;
@@ -164,7 +164,7 @@ public abstract class L2Effect
{
try
{
if (getPeriodfirsttime() == 0)
if (_periodfirsttime == 0)
{
setPeriodStartTicks(GameTimeController.getGameTicks());
}
@@ -317,7 +317,7 @@ public abstract class L2Effect
public boolean isHerbEffect()
{
if (getSkill().getName().contains("Herb"))
if (_skill.getName().contains("Herb"))
{
return true;
}
@@ -437,7 +437,7 @@ public abstract class L2Effect
{
if (_abnormalEffect != 0)
{
getEffected().startAbnormalEffect(_abnormalEffect);
_effected.startAbnormalEffect(_abnormalEffect);
}
}
@@ -449,7 +449,7 @@ public abstract class L2Effect
{
if (_abnormalEffect != 0)
{
getEffected().stopAbnormalEffect(_abnormalEffect);
_effected.stopAbnormalEffect(_abnormalEffect);
}
}
@@ -488,11 +488,11 @@ public abstract class L2Effect
onStart();
if (_skill.isPvpSkill() && (getEffected() != null) && (getEffected() instanceof L2PcInstance) && getShowIcon())
if (_skill.isPvpSkill() && (_effected != null) && (_effected instanceof L2PcInstance) && _template.showIcon)
{
SystemMessage smsg = new SystemMessage(SystemMessageId.YOU_FEEL_S1_EFFECT);
smsg.addString(_skill.getName());
getEffected().sendPacket(smsg);
_effected.sendPacket(smsg);
}
if (_count > 1)
@@ -511,7 +511,7 @@ public abstract class L2Effect
{
if (_count-- > 0)
{
if (getInUse())
if (_inUse)
{ // effect has to be in use
if (onActionTime())
{
@@ -532,26 +532,26 @@ public abstract class L2Effect
onExit();
// If the time left is equal to zero, send the message
if ((getEffected() != null) && (getEffected() instanceof L2PcInstance) && getShowIcon() && !getEffected().isDead())
if ((_effected != null) && (_effected instanceof L2PcInstance) && _template.showIcon && !_effected.isDead())
{
// Like L2OFF message S1_HAS_BEEN_ABORTED for toogle skills
if (getSkill().isToggle())
if (_skill.isToggle())
{
final SystemMessage smsg3 = new SystemMessage(SystemMessageId.S1_HAS_BEEN_ABORTED);
smsg3.addString(getSkill().getName());
getEffected().sendPacket(smsg3);
smsg3.addString(_skill.getName());
_effected.sendPacket(smsg3);
}
else if (_cancelEffect)
{
SystemMessage smsg3 = new SystemMessage(SystemMessageId.EFFECT_S1_DISAPPEARED);
smsg3.addString(getSkill().getName());
getEffected().sendPacket(smsg3);
smsg3.addString(_skill.getName());
_effected.sendPacket(smsg3);
}
else if (_count == 0)
{
SystemMessage smsg3 = new SystemMessage(SystemMessageId.S1_HAS_WORN_OFF);
smsg3.addString(_skill.getName());
getEffected().sendPacket(smsg3);
_effected.sendPacket(smsg3);
}
}
@@ -570,9 +570,9 @@ public abstract class L2Effect
for (FuncTemplate t : _funcTemplates)
{
final Env env = new Env();
env.player = getEffector();
env.target = getEffected();
env.skill = getSkill();
env.player = _effector;
env.target = _effected;
env.skill = _skill;
final Func f = t.getFunc(env, this); // effect is owner
if (f != null)
{
@@ -601,42 +601,40 @@ public abstract class L2Effect
return;
}
if (!getShowIcon())
if (!_template.showIcon)
{
return;
}
final L2Skill sk = getSkill();
if (task._rate > 0)
{
if (sk.isPotion())
if (_skill.isPotion())
{
mi.addEffect(sk.getId(), getLevel(), sk.getBuffDuration() - (getTaskTime() * 1000), false);
mi.addEffect(_skill.getId(), _skill.getLevel(), _skill.getBuffDuration() - (getTaskTime() * 1000), false);
}
else if (!sk.isToggle())
else if (!_skill.isToggle())
{
if (sk.is_Debuff())
if (_skill.is_Debuff())
{
mi.addEffect(sk.getId(), getLevel(), (_count * _period) * 1000, true);
mi.addEffect(_skill.getId(), _skill.getLevel(), (_count * _period) * 1000, true);
}
else
{
mi.addEffect(sk.getId(), getLevel(), (_count * _period) * 1000, false);
mi.addEffect(_skill.getId(), _skill.getLevel(), (_count * _period) * 1000, false);
}
}
else
{
mi.addEffect(sk.getId(), getLevel(), -1, true);
mi.addEffect(_skill.getId(), _skill.getLevel(), -1, true);
}
}
else if (sk.getSkillType() == SkillType.DEBUFF)
else if (_skill.getSkillType() == SkillType.DEBUFF)
{
mi.addEffect(sk.getId(), getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS) + 1000, true);
mi.addEffect(_skill.getId(), _skill.getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS) + 1000, true);
}
else
{
mi.addEffect(sk.getId(), getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS) + 1000, false);
mi.addEffect(_skill.getId(), _skill.getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS) + 1000, false);
}
}
@@ -655,8 +653,7 @@ public abstract class L2Effect
return;
}
L2Skill sk = getSkill();
ps.addPartySpelledEffect(sk.getId(), getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS));
ps.addPartySpelledEffect(_skill.getId(), _skill.getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS));
}
public final void addOlympiadSpelledIcon(ExOlympiadSpelledInfo os)
@@ -674,13 +671,12 @@ public abstract class L2Effect
return;
}
L2Skill sk = getSkill();
os.addEffect(sk.getId(), getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS));
os.addEffect(_skill.getId(), _skill.getLevel(), (int) future.getDelay(TimeUnit.MILLISECONDS));
}
public int getLevel()
{
return getSkill().getLevel();
return _skill.getLevel();
}
public int getPeriodfirsttime()
@@ -271,19 +271,11 @@ public abstract class L2Object
assert getPosition().getWorldRegion() != null;
}
L2WorldRegion reg = getPosition().getWorldRegion();
synchronized (this)
{
_isVisible = false;
getPosition().setWorldRegion(null);
}
// this can synchronize on others instances, so it's out of
// synchronized, to avoid deadlocks
// Remove the L2Object from the world
L2World.getInstance().removeVisibleObject(this, reg);
_isVisible = false;
L2World.getInstance().removeVisibleObject(this, getPosition().getWorldRegion());
L2World.getInstance().removeObject(this);
getPosition().setWorldRegion(null);
if (Config.SAVE_DROPPED_ITEM)
{
@@ -616,7 +608,7 @@ public abstract class L2Object
@Override
public String toString()
{
return "" + getObjectId();
return "" + _objectId;
}
public boolean isCharacter()
@@ -102,7 +102,7 @@ public class L2Party
{
_members = new ArrayList<>();
_itemDistribution = itemDistribution;
getPartyMembers().add(leader);
_members.add(leader);
_partyLvl = leader.getLevel();
}
@@ -112,7 +112,7 @@ public class L2Party
*/
public int getMemberCount()
{
return getPartyMembers().size();
return _members.size();
}
/**
@@ -163,7 +163,7 @@ public class L2Party
{
final List<L2PcInstance> availableMembers = new ArrayList<>();
for (L2PcInstance member : getPartyMembers())
for (L2PcInstance member : _members)
{
if (member.getInventory().validateCapacityByItemId(ItemId) && Util.checkIfInRange(Config.ALT_PARTY_RANGE2, target, member, true))
{
@@ -186,9 +186,9 @@ public class L2Party
*/
private L2PcInstance getCheckedNextLooter(int ItemId, L2Character target)
{
for (int i = 0; i < getMemberCount(); i++)
for (int i = 0; i < _members.size(); i++)
{
if (++_itemLastLoot >= getMemberCount())
if (++_itemLastLoot >= _members.size())
{
_itemLastLoot = 0;
}
@@ -196,7 +196,7 @@ public class L2Party
L2PcInstance member;
try
{
member = getPartyMembers().get(_itemLastLoot);
member = _members.get(_itemLastLoot);
if (member.getInventory().validateCapacityByItemId(ItemId) && Util.checkIfInRange(Config.ALT_PARTY_RANGE2, target, member, true))
{
return member;
@@ -286,7 +286,7 @@ public class L2Party
*/
public void broadcastToPartyMembers(L2GameServerPacket msg)
{
for (L2PcInstance member : getPartyMembers())
for (L2PcInstance member : _members)
{
if (member != null)
{
@@ -297,7 +297,7 @@ public class L2Party
public void broadcastToPartyMembersNewLeader()
{
for (L2PcInstance member : getPartyMembers())
for (L2PcInstance member : _members)
{
if (member != null)
{
@@ -310,7 +310,7 @@ public class L2Party
public void broadcastCSToPartyMembers(CreatureSay msg, L2PcInstance broadcaster)
{
for (L2PcInstance member : getPartyMembers())
for (L2PcInstance member : _members)
{
if ((member == null) || (broadcaster == null))
{
@@ -332,7 +332,7 @@ public class L2Party
*/
public void broadcastToPartyMembers(L2PcInstance player, L2GameServerPacket msg)
{
for (L2PcInstance member : getPartyMembers())
for (L2PcInstance member : _members)
{
if ((member != null) && !member.equals(player))
{
@@ -347,7 +347,7 @@ public class L2Party
*/
public synchronized void addPartyMember(L2PcInstance player)
{
if (getPartyMembers().contains(player))
if (_members.contains(player))
{
return;
}
@@ -365,14 +365,14 @@ public class L2Party
broadcastToPartyMembers(new PartySmallWindowAdd(player, this));
// add player to party, adjust party level
getPartyMembers().add(player);
_members.add(player);
if (player.getLevel() > _partyLvl)
{
_partyLvl = player.getLevel();
}
// update partySpelled
for (L2PcInstance member : getPartyMembers())
for (L2PcInstance member : _members)
{
if (member != null)
{
@@ -424,10 +424,10 @@ public class L2Party
public synchronized void removePartyMember(L2PcInstance player, boolean sendMessage)
{
if (getPartyMembers().contains(player))
if (_members.contains(player))
{
final boolean isLeader = isLeader(player);
getPartyMembers().remove(player);
_members.remove(player);
recalculatePartyLevel();
if (player.isFestivalParticipant())
@@ -464,7 +464,7 @@ public class L2Party
player.sendPacket(new ExCloseMPCC());
}
if (isLeader && (getPartyMembers().size() > 1))
if (isLeader && (_members.size() > 1))
{
SystemMessage msg = new SystemMessage(SystemMessageId.S1_HAS_BECOME_A_PARTY_LEADER);
msg.addString(getLeader().getName());
@@ -472,18 +472,18 @@ public class L2Party
broadcastToPartyMembersNewLeader();
}
if (getPartyMembers().size() == 1)
if (_members.size() == 1)
{
if (isInCommandChannel())
{
// delete the whole command channel when the party who opened the channel is disbanded
if (getCommandChannel().getChannelLeader().equals(getLeader()))
if (_commandChannel.getChannelLeader().equals(getLeader()))
{
getCommandChannel().disbandChannel();
_commandChannel.disbandChannel();
}
else
{
getCommandChannel().removeParty(this);
_commandChannel.removeParty(this);
}
}
@@ -518,7 +518,7 @@ public class L2Party
if ((player != null) && !player.isInDuel())
{
if (getPartyMembers().contains(player))
if (_members.contains(player))
{
if (isLeader(player))
{
@@ -528,10 +528,10 @@ public class L2Party
{
// Swap party members
L2PcInstance temp;
final int p1 = getPartyMembers().indexOf(player);
final int p1 = _members.indexOf(player);
temp = getLeader();
getPartyMembers().set(0, getPartyMembers().get(p1));
getPartyMembers().set(p1, temp);
_members.set(0, _members.get(p1));
_members.set(p1, temp);
SystemMessage msg = new SystemMessage(SystemMessageId.S1_HAS_BECOME_A_PARTY_LEADER);
msg.addString(getLeader().getName());
@@ -567,7 +567,7 @@ public class L2Party
*/
private L2PcInstance getPlayerByName(String name)
{
for (L2PcInstance member : getPartyMembers())
for (L2PcInstance member : _members)
{
if (member.getName().equalsIgnoreCase(name))
{
@@ -663,7 +663,7 @@ public class L2Party
public void distributeAdena(L2PcInstance player, int adena, L2Character target)
{
// Get all the party members
final List<L2PcInstance> membersList = getPartyMembers();
final List<L2PcInstance> membersList = _members;
// Check the number of party members that must be rewarded
// (The party member must be in range to receive its reward)
@@ -797,11 +797,11 @@ public class L2Party
{
int newLevel = 0;
for (L2PcInstance member : getPartyMembers())
for (L2PcInstance member : _members)
{
if (member == null)
{
getPartyMembers().remove(member);
_members.remove(member);
continue;
}
@@ -440,17 +440,17 @@ public class L2PetData
@Override
public String toString()
{
return "PetID: " + getPetID() + " \tPetLevel: " + getPetLevel() + " \t" +
return "PetID: " + _petId + " \tPetLevel: " + _petLevel + " \t" +
// PET_EXP + ": " + getPetExp() + " \t" +
PET_MAX_EXP + ": " + getPetMaxExp() + " \t" +
PET_MAX_EXP + ": " + _petMaxExp + " \t" +
// PET_HP + ": " + getPetHP() + " \t" +
PET_MAX_HP + ": " + getPetMaxHP() + " \t" +
PET_MAX_HP + ": " + _petMaxHP + " \t" +
// PET_MP + ": " + getPetMP() + " \t" +
PET_MAX_MP + ": " + getPetMaxMP() + " \t" + PET_PATK + ": " + getPetPAtk() + " \t" + PET_PDEF + ": " + getPetPDef() + " \t" + PET_MATK + ": " + getPetMAtk() + " \t" + PET_MDEF + ": " + getPetMDef() + " \t" + PET_ACCURACY + ": " + getPetAccuracy() + " \t" + PET_EVASION + ": " + getPetEvasion() + " \t" + PET_CRITICAL + ": " + getPetCritical() + " \t" + PET_SPEED + ": " + getPetSpeed() + " \t" + PET_ATK_SPEED + ": " + getPetAtkSpeed() + " \t" + PET_CAST_SPEED + ": " + getPetCastSpeed() + " \t" +
PET_MAX_MP + ": " + _petMaxMP + " \t" + PET_PATK + ": " + _petPAtk + " \t" + PET_PDEF + ": " + _petPDef + " \t" + PET_MATK + ": " + _petMAtk + " \t" + PET_MDEF + ": " + _petMDef + " \t" + PET_ACCURACY + ": " + _petAccuracy + " \t" + PET_EVASION + ": " + _petEvasion + " \t" + PET_CRITICAL + ": " + _petCritical + " \t" + PET_SPEED + ": " + _petSpeed + " \t" + PET_ATK_SPEED + ": " + _petAtkSpeed + " \t" + PET_CAST_SPEED + ": " + _petCastSpeed + " \t" +
// PET_FEED + ": " + getPetFeed() + " \t" +
PET_MAX_FEED + ": " + getPetMaxFeed() + " \t" + PET_FEED_BATTLE + ": " + getPetFeedBattle() + " \t" + PET_FEED_NORMAL + ": " + getPetFeedNormal() + " \t" +
PET_MAX_FEED + ": " + _petMaxFeed + " \t" + PET_FEED_BATTLE + ": " + _petFeedBattle + " \t" + PET_FEED_NORMAL + ": " + _petFeedNormal + " \t" +
// PET_LOAD + ": " + getPetLoad() + " \t" +
PET_MAX_LOAD + ": " + getPetMaxLoad() + " \t" + PET_REGEN_HP + ": " + getPetRegenHP() + " \t" + PET_REGEN_MP + ": " + getPetRegenMP();
PET_MAX_LOAD + ": " + _petMaxLoad + " \t" + PET_REGEN_HP + ": " + _petRegenHP + " \t" + PET_REGEN_MP + ": " + _petRegenMP;
}
}
@@ -744,7 +744,7 @@ public abstract class L2Skill
public final boolean hasEffectWhileCasting()
{
return getSkillType() == SkillType.SIGNET_CASTTIME;
return _skillType == SkillType.SIGNET_CASTTIME;
}
public final BaseStats getSavevs()
@@ -1148,17 +1148,17 @@ public abstract class L2Skill
public final boolean useSoulShot()
{
return (getSkillType() == SkillType.PDAM) || (getSkillType() == SkillType.STUN) || (getSkillType() == SkillType.CHARGEDAM) || (getSkillType() == SkillType.BLOW);
return (_skillType == SkillType.PDAM) || (_skillType == SkillType.STUN) || (_skillType == SkillType.CHARGEDAM) || (_skillType == SkillType.BLOW);
}
public final boolean useSpiritShot()
{
return isMagic();
return _magic;
}
public final boolean useFishShot()
{
return (getSkillType() == SkillType.PUMPING) || (getSkillType() == SkillType.REELING);
return (_skillType == SkillType.PUMPING) || (_skillType == SkillType.REELING);
}
public final int getWeaponsAllowed()
@@ -1353,7 +1353,7 @@ public abstract class L2Skill
return true;
}
final SystemMessage message = new SystemMessage(SystemMessageId.S1_CANNOT_BE_USED);
message.addSkillName(getId());
message.addSkillName(_id);
activeChar.sendPacket(message);
return false;
@@ -1361,7 +1361,7 @@ public abstract class L2Skill
public final boolean getWeaponDependancy(L2Character activeChar, boolean chance)
{
final int weaponsAllowed = getWeaponsAllowed();
final int weaponsAllowed = _weaponsAllowed;
// check to see if skill has a weapon dependency.
if (weaponsAllowed == 0)
{
@@ -1467,7 +1467,7 @@ public abstract class L2Skill
if (activeChar instanceof L2PcInstance)
{ // to avoid attacks during oly start period
if (isOffensive() && (((L2PcInstance) activeChar).isInOlympiadMode() && !((L2PcInstance) activeChar).isOlympiadStart()))
if (_isOffensive && (((L2PcInstance) activeChar).isInOlympiadMode() && !((L2PcInstance) activeChar).isOlympiadStart()))
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
return null;
@@ -1476,7 +1476,7 @@ public abstract class L2Skill
final List<L2Character> targetList = new ArrayList<>();
if (isPotion())
if (_ispotion)
{
return new L2Character[]
{
@@ -1484,21 +1484,13 @@ public abstract class L2Skill
};
}
// Get the target type of the skill
// (ex : ONE, SELF, HOLY, PET, AURA, AURA_CLOSE, AREA, MULTIFACE, PARTY, CLAN, CORPSE_PLAYER, CORPSE_MOB, CORPSE_CLAN, UNLOCKABLE, ITEM, UNDEAD)
final SkillTargetType targetType = getTargetType();
// Get the type of the skill
// (ex : PDAM, MDAM, DOT, BLEED, POISON, HEAL, HOT, MANAHEAL, MANARECHARGE, AGGDAMAGE, BUFF, DEBUFF, STUN, ROOT, RESURRECT, PASSIVE...)
final SkillType skillType = getSkillType();
switch (targetType)
switch (_targetType)
{
// The skill can only be used on the L2Character targeted, or on the caster itself
case TARGET_ONE:
{
boolean canTargetSelf = false;
switch (skillType)
switch (_skillType)
{
case BUFF:
case HEAL:
@@ -1524,7 +1516,7 @@ public abstract class L2Skill
}
}
switch (skillType)
switch (_skillType)
{
case CONFUSION:
case DEBUFF:
@@ -1548,7 +1540,7 @@ public abstract class L2Skill
}
}
switch (skillType)
switch (_skillType)
{
case AGGDEBUFF:
case DEBUFF:
@@ -1579,7 +1571,7 @@ public abstract class L2Skill
}
// Like L2OFF Shield stun can't be used on Npc
if ((getId() == 92) && (target instanceof L2NpcInstance) && !(target instanceof L2MonsterInstance))
if ((_id == 92) && (target instanceof L2NpcInstance) && !(target instanceof L2MonsterInstance))
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
return null;
@@ -1665,7 +1657,7 @@ public abstract class L2Skill
}
case TARGET_AURA:
{
final int radius = getSkillRadius();
final int radius = _skillRadius;
final boolean srcInArena = activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE);
L2PcInstance src = null;
if (activeChar instanceof L2PcInstance)
@@ -1684,7 +1676,7 @@ public abstract class L2Skill
continue;
}
// Like L2OFF you can cast the skill on peace zone but hasn't any effect
if (isOffensive() && L2Character.isInsidePeaceZone(target, activeChar))
if (_isOffensive && L2Character.isInsidePeaceZone(target, activeChar))
{
continue;
}
@@ -1792,13 +1784,13 @@ public abstract class L2Skill
{
// Like L2OFF players can use TARGET_AREA skills on NPC in peacezone
if ((!(target instanceof L2Attackable) && !(target instanceof L2Playable) && !(target instanceof L2NpcInstance)) || // Target is not L2Attackable or L2PlayableInstance or L2NpcInstance
((getCastRange() >= 0) && ((target == activeChar) || target.isAlikeDead()))) // target is null or self or dead/faking
((_castRange >= 0) && ((target == activeChar) || target.isAlikeDead()))) // target is null or self or dead/faking
{
activeChar.sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
return null;
}
L2Character cha;
if (getCastRange() >= 0)
if (_castRange >= 0)
{
cha = target;
if (!onlyFirst)
@@ -1827,7 +1819,7 @@ public abstract class L2Skill
{
src = ((L2Summon) activeChar).getOwner();
}
final int radius = getSkillRadius();
final int radius = _skillRadius;
final boolean srcInArena = activeChar.isInsideZone(ZoneId.PVP) && !activeChar.isInsideZone(ZoneId.SIEGE);
for (L2Object obj : activeChar.getKnownList().getKnownObjects().values())
{
@@ -1852,7 +1844,7 @@ public abstract class L2Skill
{
continue;
}
if (isOffensive() && L2Character.isInsidePeaceZone(activeChar, target))
if (_isOffensive && L2Character.isInsidePeaceZone(activeChar, target))
{
continue;
}
@@ -1994,7 +1986,7 @@ public abstract class L2Skill
target
};
}
final int radius = getSkillRadius();
final int radius = _skillRadius;
L2PcInstance src = null;
if (activeChar instanceof L2PcInstance)
{
@@ -2121,7 +2113,7 @@ public abstract class L2Skill
continue;
}
}
if (!partyMember.isDead() && Util.checkIfInRange(getSkillRadius(), activeChar, partyMember, true))
if (!partyMember.isDead() && Util.checkIfInRange(_skillRadius, activeChar, partyMember, true))
{
L2PcInstance src = null;
if (activeChar instanceof L2PcInstance)
@@ -2183,10 +2175,10 @@ public abstract class L2Skill
{
if (activeChar instanceof L2PcInstance)
{
final int radius = getSkillRadius();
final int radius = _skillRadius;
L2PcInstance player = (L2PcInstance) activeChar;
L2Clan clan = player.getClan();
if (targetType != SkillTargetType.TARGET_CORPSE_ALLY) // if corpose, the caster is not included
if (_targetType != SkillTargetType.TARGET_CORPSE_ALLY) // if corpose, the caster is not included
{
if (player.isInOlympiadMode())
{
@@ -2227,7 +2219,7 @@ public abstract class L2Skill
continue;
}
final L2PcInstance playerTarget = (L2PcInstance) newTarget;
if (playerTarget.isDead() && (targetType != SkillTargetType.TARGET_CORPSE_ALLY))
if (playerTarget.isDead() && (_targetType != SkillTargetType.TARGET_CORPSE_ALLY))
{
continue;
}
@@ -2267,17 +2259,17 @@ public abstract class L2Skill
* trg._inEventDM || trg._inEventTvT || trg._inEventVIP) && (!src._inEvent && !src._inEventCTF && !src._inEventDM && !src._inEventTvT && !src._inEventVIP)) ){ continue; } }
*/
L2Summon pet = ((L2PcInstance) newTarget).getPet();
if ((pet != null) && Util.checkIfInRange(radius, activeChar, pet, true) && !onlyFirst && (((targetType == SkillTargetType.TARGET_CORPSE_ALLY) && pet.isDead()) || ((targetType == SkillTargetType.TARGET_ALLY) && !pet.isDead())) && player.checkPvpSkill(newTarget, this))
if ((pet != null) && Util.checkIfInRange(radius, activeChar, pet, true) && !onlyFirst && (((_targetType == SkillTargetType.TARGET_CORPSE_ALLY) && pet.isDead()) || ((_targetType == SkillTargetType.TARGET_ALLY) && !pet.isDead())) && player.checkPvpSkill(newTarget, this))
{
targetList.add(pet);
}
if (targetType == SkillTargetType.TARGET_CORPSE_ALLY)
if (_targetType == SkillTargetType.TARGET_CORPSE_ALLY)
{
if (!((L2PcInstance) newTarget).isDead())
{
continue;
}
if ((getSkillType() == SkillType.RESURRECT) && ((L2PcInstance) newTarget).isInsideZone(ZoneId.SIEGE))
if ((_skillType == SkillType.RESURRECT) && ((L2PcInstance) newTarget).isInsideZone(ZoneId.SIEGE))
{
continue;
}
@@ -2312,10 +2304,10 @@ public abstract class L2Skill
{
if (activeChar instanceof L2PcInstance)
{
final int radius = getSkillRadius();
final int radius = _skillRadius;
L2PcInstance player = (L2PcInstance) activeChar;
L2Clan clan = player.getClan();
if (targetType != SkillTargetType.TARGET_CORPSE_CLAN)
if (_targetType != SkillTargetType.TARGET_CORPSE_CLAN)
{
if (player.isInOlympiadMode())
{
@@ -2365,17 +2357,17 @@ public abstract class L2Skill
* player._inEventTvT)) { continue; } if((newTarget._inEventCTF && !player._inEventCTF) || (!newTarget._inEventCTF && player._inEventCTF)) { continue; } if((newTarget._inEventDM && !player._inEventDM) || (!newTarget._inEventDM && player._inEventDM)) { continue; } }
*/
L2Summon pet = newTarget.getPet();
if ((pet != null) && Util.checkIfInRange(radius, activeChar, pet, true) && !onlyFirst && (((targetType == SkillTargetType.TARGET_CORPSE_CLAN) && pet.isDead()) || ((targetType == SkillTargetType.TARGET_CLAN) && !pet.isDead())) && player.checkPvpSkill(newTarget, this))
if ((pet != null) && Util.checkIfInRange(radius, activeChar, pet, true) && !onlyFirst && (((_targetType == SkillTargetType.TARGET_CORPSE_CLAN) && pet.isDead()) || ((_targetType == SkillTargetType.TARGET_CLAN) && !pet.isDead())) && player.checkPvpSkill(newTarget, this))
{
targetList.add(pet);
}
if (targetType == SkillTargetType.TARGET_CORPSE_CLAN)
if (_targetType == SkillTargetType.TARGET_CORPSE_CLAN)
{
if (!newTarget.isDead())
{
continue;
}
if (getSkillType() == SkillType.RESURRECT)
if (_skillType == SkillType.RESURRECT)
{
// check target is not in a active siege zone
Siege siege = SiegeManager.getInstance().getSiege(newTarget);
@@ -2427,7 +2419,7 @@ public abstract class L2Skill
{
if ((newTarget instanceof L2NpcInstance) && npc.getFactionId().equals(((L2NpcInstance) newTarget).getFactionId()))
{
if (!Util.checkIfInRange(getCastRange(), activeChar, newTarget, true))
if (!Util.checkIfInRange(_castRange, activeChar, newTarget, true))
{
continue;
}
@@ -2460,7 +2452,7 @@ public abstract class L2Skill
if ((player != null) && ((targetPlayer != null) || (targetPet != null)))
{
boolean condGood = true;
if (getSkillType() == SkillType.RESURRECT)
if (_skillType == SkillType.RESURRECT)
{
// check target is not in a active siege zone
if (target.isInsideZone(ZoneId.SIEGE))
@@ -2551,7 +2543,7 @@ public abstract class L2Skill
src = (L2PcInstance) activeChar;
}
L2PcInstance trg = null;
final int radius = getSkillRadius();
final int radius = _skillRadius;
if (activeChar.getKnownList() != null)
{
for (L2Object obj : activeChar.getKnownList().getKnownObjects().values())
@@ -2572,7 +2564,7 @@ public abstract class L2Skill
{
continue;
}
if (isOffensive() && L2Character.isInsidePeaceZone(activeChar, obj))
if (_isOffensive && L2Character.isInsidePeaceZone(activeChar, obj))
{
continue;
}
@@ -2708,8 +2700,8 @@ public abstract class L2Skill
case TARGET_AREA_UNDEAD:
{
L2Character cha;
final int radius = getSkillRadius();
if ((getCastRange() >= 0) && ((target instanceof L2NpcInstance) || (target instanceof L2SummonInstance)) && target.isUndead() && !target.isAlikeDead())
final int radius = _skillRadius;
if ((_castRange >= 0) && ((target instanceof L2NpcInstance) || (target instanceof L2SummonInstance)) && target.isUndead() && !target.isAlikeDead())
{
cha = target;
if (!onlyFirst)
@@ -2854,7 +2846,7 @@ public abstract class L2Skill
{
if ((newTarget instanceof L2NpcInstance) && npc.getFactionId().equals(((L2NpcInstance) newTarget).getFactionId()))
{
if (!Util.checkIfInRange(getCastRange(), activeChar, newTarget, true))
if (!Util.checkIfInRange(_castRange, activeChar, newTarget, true))
{
continue;
}
@@ -2936,7 +2928,7 @@ public abstract class L2Skill
public boolean hasEffects()
{
return (getEffectTemplates() != null) && (getEffectTemplates().length > 0);
return (_effectTemplates != null) && (_effectTemplates.length > 0);
}
public final L2Effect[] getEffects(L2Character effector, L2Character effected)
@@ -2951,7 +2943,7 @@ public abstract class L2Skill
return _emptyEffectSet;
}
if (getEffectTemplates() == null)
if (_effectTemplates == null)
{
return _emptyEffectSet;
}
@@ -2961,7 +2953,7 @@ public abstract class L2Skill
return _emptyEffectSet;
}
if ((getSkillType() == SkillType.BUFF) && effected.isBlockBuff())
if ((_skillType == SkillType.BUFF) && effected.isBlockBuff())
{
return _emptyEffectSet;
}
@@ -2976,7 +2968,7 @@ public abstract class L2Skill
}
/*
* if(getSkillType()==SkillType.BUFF) for(L2Effect ef: effector.getAllEffects()) { if(ef!=null && ef.getSkill()!=null){ if(ef.getSkill().getId() == getId() && ef.getSkill().getLevel() > getLevel()) return _emptyEffectSet; } }
* if(_skillType==SkillType.BUFF) for(L2Effect ef: effector.getAllEffects()) { if(ef!=null && ef.getSkill()!=null){ if(ef.getSkill().getId() == getId() && ef.getSkill().getLevel() > getLevel()) return _emptyEffectSet; } }
*/
final Env env = new Env();
@@ -2985,7 +2977,7 @@ public abstract class L2Skill
env.skill = this;
env.skillMastery = skillMastery;
for (EffectTemplate et : getEffectTemplates())
for (EffectTemplate et : _effectTemplates)
{
boolean success = true;
if (et.effectPower > -1)
@@ -3100,7 +3092,7 @@ public abstract class L2Skill
public final void attach(EffectTemplate effect)
{
if (getEffectTemplates() == null)
if (_effectTemplates == null)
{
setEffectTemplates(new EffectTemplate[]
{
@@ -3109,9 +3101,9 @@ public abstract class L2Skill
}
else
{
final int len = getEffectTemplates().length;
final int len = _effectTemplates.length;
EffectTemplate[] tmp = new EffectTemplate[len + 1];
System.arraycopy(getEffectTemplates(), 0, tmp, 0, len);
System.arraycopy(_effectTemplates, 0, tmp, 0, len);
tmp[len] = effect;
setEffectTemplates(tmp);
}
@@ -3145,12 +3137,12 @@ public abstract class L2Skill
return false;
}
if (getEffectTemplates() == null)
if (_effectTemplates == null)
{
return false;
}
for (EffectTemplate et : getEffectTemplates())
for (EffectTemplate et : _effectTemplates)
{
if (et.abnormalEffect == abnormalEffect)
{
@@ -80,7 +80,7 @@ public class L2TradeList
{
if (price < (item.getReferencePrice() / 2))
{
LOGGER.warning("L2TradeList " + getListId() + " itemId " + itemID + " has an ADENA sell price lower then reference price.. Automatically Updating it..");
LOGGER.warning("L2TradeList " + _listId + " itemId " + itemID + " has an ADENA sell price lower then reference price.. Automatically Updating it..");
price = item.getReferencePrice();
}
item.setPriceToSell(price);
@@ -285,7 +285,7 @@ public final class L2WorldRegion
public Boolean areNeighborsEmpty()
{
// if this region is occupied, return false.
if (isActive() && (_allPlayable.size() > 0))
if (_active && (_allPlayable.size() > 0))
{
return false;
}
@@ -138,16 +138,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++)
{
L2GroupSpawn spawn = new L2GroupSpawn(getTemplate());
L2GroupSpawn spawn = new L2GroupSpawn(_npcTemplate);
final int signX = Rnd.nextInt(2) == 0 ? -1 : 1;
final int signY = Rnd.nextInt(2) == 0 ? -1 : 1;
@@ -205,12 +205,12 @@ public final class MobGroup
{
removeDead();
if (getActiveMobCount() == 0)
if (getMobs().size() == 0)
{
return null;
}
final int choice = Rnd.nextInt(getActiveMobCount());
final int choice = Rnd.nextInt(getMobs().size());
return getMobs().get(choice);
}
@@ -219,7 +219,7 @@ public final class MobGroup
{
removeDead();
if (getActiveMobCount() == 0)
if (getMobs().size() == 0)
{
return;
}
@@ -63,7 +63,7 @@ public class PartyMatchRoom
public void deleteMember(L2PcInstance player)
{
if (player != getOwner())
if (player != _members.get(0)) // owner
{
_members.remove(player);
notifyMembersAboutExit(player);
@@ -81,7 +81,7 @@ public class PartyMatchRoom
public void notifyMembersAboutExit(L2PcInstance player)
{
for (L2PcInstance _member : getPartyMembers())
for (L2PcInstance _member : _members)
{
final SystemMessage sm = new SystemMessage(SystemMessageId.S1_LEFT_PARTY_ROOM);
sm.addString(player.getName());
@@ -117,7 +117,7 @@ public class PartyMatchRoom
}
// Broadcast change
for (L2PcInstance member : getPartyMembers())
for (L2PcInstance member : _members)
{
member.sendPacket(new ExManagePartyRoomMember(newLeader, this, 1));
member.sendPacket(new ExManagePartyRoomMember(oldLeader, this, 1));
@@ -120,7 +120,7 @@ public class PcInventory extends Inventory
break;
}
}
if (!isDuplicate && (!onlyAvailable || (item.getItem().isSellable() && item.isAvailable(getOwner(), false, allowEquipped))))
if (!isDuplicate && (!onlyAvailable || (item.getItem().isSellable() && item.isAvailable(_owner, false, allowEquipped))))
{
list.add(item);
}
@@ -167,7 +167,7 @@ public class PcInventory extends Inventory
}
}
if (!isDuplicate && (!onlyAvailable || (item.getItem().isSellable() && item.isAvailable(getOwner(), false, allowEquipped))))
if (!isDuplicate && (!onlyAvailable || (item.getItem().isSellable() && item.isAvailable(_owner, false, allowEquipped))))
{
list.add(item);
}
@@ -228,7 +228,7 @@ public class PcInventory extends Inventory
for (L2ItemInstance item : _items)
{
if ((item != null) && item.isAvailable(getOwner(), allowAdena, false))
if ((item != null) && item.isAvailable(_owner, allowAdena, false))
{
list.add(item);
}
@@ -267,7 +267,7 @@ public class PcInventory extends Inventory
for (L2ItemInstance item : _items)
{
if (item.isAvailable(getOwner(), false, false))
if (item.isAvailable(_owner, false, false))
{
final TradeItem adjItem = tradeList.adjustAvailableItem(item);
if (adjItem != null)
@@ -626,12 +626,12 @@ public class PcInventory extends Inventory
protected void 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.equals(getOwner().getActiveEnchantItem()))
if (item.equals(_owner.getActiveEnchantItem()))
{
getOwner().setActiveEnchantItem(null);
_owner.setActiveEnchantItem(null);
}
if (item.getItemId() == ADENA_ID)
@@ -653,7 +653,7 @@ public class PcInventory extends Inventory
public void refreshWeight()
{
super.refreshWeight();
getOwner().refreshOverloaded();
_owner.refreshOverloaded();
}
/**
@@ -330,7 +330,7 @@ public class TradeList
*/
public synchronized TradeItem addItem(int objectId, int count, int price)
{
if (isLocked())
if (_locked)
{
Util.handleIllegalPlayerAction(_owner, "Player " + _owner.getName() + " Attempt to modify locked TradeList! ", Config.DEFAULT_PUNISH);
LOGGER.warning(_owner.getName() + ": Attempt to modify locked TradeList!");
@@ -361,7 +361,7 @@ public class TradeList
}
// GM items trade restriction (valid for trade and private sell)
if ((getOwner().isGM() && Config.GM_TRADE_RESTRICTED_ITEMS))
if ((_owner.isGM() && Config.GM_TRADE_RESTRICTED_ITEMS))
{
return null;
}
@@ -404,7 +404,7 @@ public class TradeList
*/
public synchronized TradeItem addItemByItemId(int itemId, int count, int price, int enchant)
{
if (isLocked())
if (_locked)
{
Util.handleIllegalPlayerAction(_owner, "Player " + _owner.getName() + " Attempt to modify locked TradeList! Banned ", Config.DEFAULT_PUNISH);
LOGGER.warning(_owner.getName() + ": Attempt to modify locked TradeList!");
@@ -456,7 +456,7 @@ public class TradeList
*/
public synchronized TradeItem removeItem(int objectId, int itemId, int count)
{
if (isLocked())
if (_locked)
{
Util.handleIllegalPlayerAction(_owner, "Player " + _owner.getName() + " Attempt to modify locked TradeList! Banned ", Config.DEFAULT_PUNISH);
LOGGER.warning(_owner.getName() + ": Attempt to modify locked TradeList!");
@@ -770,12 +770,12 @@ public class TradeList
if (!getOwner().getInventory().validateWeight(partnerList.calcItemsWeight()) || !partnerList.getOwner().getInventory().validateWeight(calcItemsWeight()))
{
partnerList.getOwner().sendPacket(SystemMessageId.WEIGHT_LIMIT_EXCEEDED);
getOwner().sendPacket(SystemMessageId.WEIGHT_LIMIT_EXCEEDED);
_owner.sendPacket(SystemMessageId.WEIGHT_LIMIT_EXCEEDED);
}
else if (!getOwner().getInventory().validateCapacity(partnerList.countItemsSlots(getOwner())) || !partnerList.getOwner().getInventory().validateCapacity(countItemsSlots(partnerList.getOwner())))
{
partnerList.getOwner().sendPacket(SystemMessageId.SLOTS_FULL);
getOwner().sendPacket(SystemMessageId.SLOTS_FULL);
_owner.sendPacket(SystemMessageId.SLOTS_FULL);
}
else
{
@@ -784,7 +784,7 @@ public class TradeList
InventoryUpdate partnerIU = Config.FORCE_INVENTORY_UPDATE ? null : new InventoryUpdate();
// Transfer items
partnerList.TransferItems(getOwner(), partnerIU, ownerIU);
partnerList.TransferItems(_owner, partnerIU, ownerIU);
TransferItems(partnerList.getOwner(), ownerIU, partnerIU);
// Send inventory update packet
@@ -820,7 +820,7 @@ public class TradeList
}
// Finish the trade
partnerList.getOwner().onTradeFinish(success);
getOwner().onTradeFinish(success);
_owner.onTradeFinish(success);
}
/**
@@ -283,15 +283,6 @@ public class L2Attackable extends L2NpcInstance
*/
private final Map<L2Character, AggroInfo> _aggroList = new ConcurrentHashMap<>();
/**
* Use this to Read or Put Object to this Map
* @return
*/
public final Map<L2Character, AggroInfo> getAggroListRP()
{
return _aggroList;
}
/**
* Use this to Remove Object from this Map This Should be Synchronized While Interacting over This Map - ie u cant Interacting and removing object at once
* @return
@@ -650,7 +641,7 @@ public class L2Attackable extends L2NpcInstance
try
{
if (getAggroListRP().isEmpty())
if (_aggroList.isEmpty())
{
return;
}
@@ -663,10 +654,10 @@ public class L2Attackable extends L2NpcInstance
L2Character attacker, ddealer;
// While Interacting over This Map Removing Object is Not Allowed
synchronized (getAggroList())
synchronized (_aggroList)
{
// Go through the _aggroList of the L2Attackable
for (AggroInfo info : getAggroListRP().values())
for (AggroInfo info : _aggroList.values())
{
if (info == null)
{
@@ -725,7 +716,7 @@ public class L2Attackable extends L2NpcInstance
// Manage drop of Special Events created by GM for a defined period
doEventDrop((maxDealer != null) && (maxDealer.isOnline() == 1) ? maxDealer : lastAttacker);
if (!getMustRewardExpSP())
if (!_mustGiveExpSp)
{
return;
}
@@ -808,7 +799,7 @@ public class L2Attackable extends L2NpcInstance
if (attacker instanceof L2PcInstance)
{
final L2PcInstance player = (L2PcInstance) attacker;
if (isOverhit() && (attacker == getOverhitAttacker()))
if (_overhit && (attacker == _overhitAttacker))
{
player.sendPacket(SystemMessageId.OVER_HIT);
exp += calculateOverhitExp(exp);
@@ -959,7 +950,7 @@ public class L2Attackable extends L2NpcInstance
{
final L2PcInstance player = (L2PcInstance) attacker;
if (isOverhit() && (attacker == getOverhitAttacker()))
if (_overhit && (attacker == _overhitAttacker))
{
player.sendPacket(SystemMessageId.OVER_HIT);
exp += calculateOverhitExp(exp);
@@ -1007,14 +998,14 @@ public class L2Attackable extends L2NpcInstance
}
// Get the AggroInfo of the attacker L2Character from the _aggroList of the L2Attackable
AggroInfo ai = getAggroListRP().get(attacker);
AggroInfo ai = _aggroList.get(attacker);
if (ai == null)
{
ai = new AggroInfo(attacker);
ai._damage = 0;
ai._hate = 0;
getAggroListRP().put(attacker, ai);
_aggroList.put(attacker, ai);
}
// If aggro is negative, its comming from SEE_SPELL, buffs use constant 150
@@ -1090,9 +1081,9 @@ public class L2Attackable extends L2NpcInstance
((L2AttackableAI) getAI()).setGlobalAggro(-25);
return;
}
for (L2Character aggroed : getAggroListRP().keySet())
for (L2Character aggroed : _aggroList.keySet())
{
AggroInfo ai = getAggroListRP().get(aggroed);
AggroInfo ai = _aggroList.get(aggroed);
if (ai == null)
{
return;
@@ -1113,7 +1104,7 @@ public class L2Attackable extends L2NpcInstance
return;
}
AggroInfo ai = getAggroListRP().get(target);
AggroInfo ai = _aggroList.get(target);
if (ai == null)
{
@@ -1146,7 +1137,7 @@ public class L2Attackable extends L2NpcInstance
return;
}
AggroInfo ai = getAggroListRP().get(target);
AggroInfo ai = _aggroList.get(target);
if (ai == null)
{
@@ -1163,7 +1154,7 @@ public class L2Attackable extends L2NpcInstance
*/
public L2Character getMostHated()
{
if (getAggroListRP().isEmpty() || isAlikeDead())
if (_aggroList.isEmpty() || isAlikeDead())
{
return null;
}
@@ -1173,10 +1164,10 @@ public class L2Attackable extends L2NpcInstance
int maxHate = 0;
// While Interating over This Map Removing Object is Not Allowed
synchronized (getAggroList())
synchronized (_aggroList)
{
// Go through the aggroList of the L2Attackable
for (AggroInfo ai : getAggroListRP().values())
for (AggroInfo ai : _aggroList.values())
{
if (ai == null)
{
@@ -1212,8 +1203,8 @@ public class L2Attackable extends L2NpcInstance
*/
/*
* public L2Character getMostDamager(){ if(getAggroListRP().isEmpty() || isAlikeDead()) return null; //L2Character mostDamager = null; int maxDamage = 0; // While Interating over This Map Removing Object is Not Allowed synchronized (getAggroList()) { // Go through the aggroList of the
* L2Attackable for(AggroInfo ai : getAggroListRP().values()) { if(ai == null) { continue; } if(ai._attacker.isAlikeDead() || !getKnownList().knowsObject(ai._attacker) || !ai._attacker.isVisible() || ai._attacker instanceof L2PcInstance && ((L2PcInstance)ai._attacker).isOffline() ) { ai._damage
* = 0; } if(ai._damage > maxDamage) { _mostDamager = ai._attacker; maxDamage = ai._damage; } } } return _mostDamager; }
* L2Attackable for(AggroInfo ai : _aggroList.values()) { if(ai == null) { continue; } if(ai._attacker.isAlikeDead() || !getKnownList().knowsObject(ai._attacker) || !ai._attacker.isVisible() || ai._attacker instanceof L2PcInstance && ((L2PcInstance)ai._attacker).isOffline() ) { ai._damage = 0; }
* if(ai._damage > maxDamage) { _mostDamager = ai._attacker; maxDamage = ai._damage; } } } return _mostDamager; }
*/
/**
* Return the hate level of the L2Attackable against this L2Character contained in _aggroList.<BR>
@@ -1223,7 +1214,7 @@ public class L2Attackable extends L2NpcInstance
*/
public int getHating(L2Character target)
{
if (getAggroListRP().isEmpty())
if (_aggroList.isEmpty())
{
return 0;
}
@@ -1233,7 +1224,7 @@ public class L2Attackable extends L2NpcInstance
return 0;
}
final AggroInfo ai = getAggroListRP().get(target);
final AggroInfo ai = _aggroList.get(target);
if (ai == null)
{
@@ -1243,14 +1234,14 @@ public class L2Attackable extends L2NpcInstance
if ((ai._attacker instanceof L2PcInstance) && (((L2PcInstance) ai._attacker).getAppearance().getInvisible() || ((L2PcInstance) ai._attacker).isSpawnProtected() || ((L2PcInstance) ai._attacker).isTeleportProtected() || ai._attacker.isInvul()))
{
// Remove Object Should Use This Method and Can be Blocked While Interating
getAggroList().remove(target);
_aggroList.remove(target);
return 0;
}
if (!ai._attacker.isVisible())
{
getAggroList().remove(target);
_aggroList.remove(target);
return 0;
}
@@ -1940,7 +1931,7 @@ public class L2Attackable extends L2NpcInstance
if (cat.isSweep())
{
// according to sh1ny, seeded mobs CAN be spoiled and swept.
if (isSpoil()/* && !isSeeded() */)
if (isSpoil()/* && !_seeded */)
{
List<RewardItem> sweepList = new ArrayList<>();
@@ -1970,7 +1961,7 @@ public class L2Attackable extends L2NpcInstance
}
else
{
if (isSeeded())
if (_seeded)
{
L2DropData drop = cat.dropSeedAllowedDropsOnly();
@@ -2580,7 +2571,7 @@ public class L2Attackable extends L2NpcInstance
*/
public boolean noTarget()
{
return getAggroListRP().isEmpty();
return _aggroList.isEmpty();
}
/**
@@ -2591,7 +2582,7 @@ public class L2Attackable extends L2NpcInstance
*/
public boolean containsTarget(L2Character player)
{
return getAggroListRP().containsKey(player);
return _aggroList.containsKey(player);
}
/**
@@ -2600,7 +2591,7 @@ public class L2Attackable extends L2NpcInstance
*/
public void clearAggroList()
{
getAggroList().clear();
_aggroList.clear();
}
/**
@@ -2817,7 +2808,7 @@ public class L2Attackable extends L2NpcInstance
if (!isBossMob)
{
// Fail if this L2Attackable isn't absorbed or there's no one in its _absorbersList
if (!isAbsorbed() /* || _absorbersList == null */)
if (!_absorbed /* || _absorbersList == null */)
{
resetAbsorbList();
return;
@@ -3147,7 +3138,7 @@ public class L2Attackable extends L2NpcInstance
public long calculateOverhitExp(long normalExp)
{
// 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)
@@ -407,7 +407,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// to avoid that a spell affecting a L2NPCInstance, affects others L2NPCInstance of the same type too.
_skills = ((L2NpcTemplate) template).getSkills();
for (Map.Entry<Integer, L2Skill> skill : getSkills().entrySet())
for (Map.Entry<Integer, L2Skill> skill : _skills.entrySet())
{
addStatFuncs(skill.getValue().getStatFuncs(null, this));
}
@@ -439,9 +439,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
protected void initCharStatusUpdateValues()
{
_hpUpdateInterval = getMaxHp() / 352.0; // MAX_HP div MAX_HP_BAR_PX
_hpUpdateIncCheck = getMaxHp();
_hpUpdateDecCheck = getMaxHp() - _hpUpdateInterval;
_hpUpdateInterval = getStat().getMaxHp() / 352.0; // MAX_HP div MAX_HP_BAR_PX
_hpUpdateIncCheck = getStat().getMaxHp();
_hpUpdateDecCheck = getStat().getMaxHp() - _hpUpdateInterval;
}
// =========================================================
@@ -481,7 +481,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public void onTeleported()
{
if (!isTeleporting())
if (!_isTeleporting)
{
return;
}
@@ -665,16 +665,16 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
protected boolean needHpUpdate(int barPixels)
{
final double currentHp = getCurrentHp();
final double currentHp = getStatus().getCurrentHp();
if ((currentHp <= 1.0) || (getMaxHp() < barPixels))
if ((currentHp <= 1.0) || (getStat().getMaxHp() < barPixels))
{
return true;
}
if ((currentHp <= _hpUpdateDecCheck) || (currentHp >= _hpUpdateIncCheck))
{
if (currentHp == getMaxHp())
if (currentHp == getStat().getMaxHp())
{
_hpUpdateIncCheck = currentHp + 1;
_hpUpdateDecCheck = currentHp - _hpUpdateInterval;
@@ -722,7 +722,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
if (Config.DEBUG)
{
LOGGER.info("Broadcast Status Update for " + getObjectId() + "(" + getName() + "). HP: " + getCurrentHp());
LOGGER.info("Broadcast Status Update for " + getObjectId() + "(" + getName() + "). HP: " + getStatus().getCurrentHp());
}
// Create the Server->Client packet StatusUpdate with current HP and MP
@@ -734,8 +734,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
else
{
su = new StatusUpdate(getObjectId());
su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
su.addAttribute(StatusUpdate.CUR_MP, (int) getCurrentMp());
su.addAttribute(StatusUpdate.CUR_HP, (int) getStatus().getCurrentHp());
su.addAttribute(StatusUpdate.CUR_MP, (int) getStatus().getCurrentMp());
}
// Go through the StatusListener
@@ -812,7 +812,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
z1 = getZ();
L2TownZone Town;
Town = TownManager.getInstance().getTown(x1, y1, z1);
if ((Town != null) && isinTownWar())
if ((Town != null) && _inTownWar)
{
if ((Town.getTownId() == Config.TW_TOWN_ID) && !Config.TW_ALL_TOWNS)
{
@@ -1132,7 +1132,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
if ((target instanceof L2GrandBossInstance) && (((L2GrandBossInstance) target).getNpcId() == 29022))
{
if (Math.abs(getClientZ() - target.getZ()) > 200)
if (Math.abs(_clientZ - target.getZ()) > 200)
{
sendPacket(new SystemMessage(SystemMessageId.CANT_SEE_TARGET));
getAI().setIntention(CtrlIntention.AI_INTENTION_IDLE);
@@ -1183,7 +1183,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
final int saMpConsume = (int) getStat().calcStat(Stats.MP_CONSUME, 0, null, null);
final int mpConsume = saMpConsume == 0 ? weaponItem.getMpConsume() : saMpConsume;
if (getCurrentMp() < mpConsume)
if (getStatus().getCurrentMp() < mpConsume)
{
// If L2PcInstance doesn't have enough MP, stop the attack
ThreadPool.schedule(new NotifyAITask(CtrlEvent.EVT_READY_TO_ACT), 1000);
@@ -1222,7 +1222,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// Reduce the current CP if TIREDNESS configuration is activated
if (Config.ALT_GAME_TIREDNESS)
{
setCurrentCp(getCurrentCp() - 10);
setCurrentCp(getStatus().getCurrentCp() - 10);
}
final int timeAtk = calculateTimeBetweenAttacks(target, weaponItem);
@@ -1368,7 +1368,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
broadcastPacket(attack);
fireEvent(EventType.ATTACK.name, new Object[]
{
getTarget()
_target
});
}
@@ -1376,7 +1376,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
if ((this instanceof L2MonsterInstance) && (((L2MonsterInstance) this).getNpcId() == 27181))
{
final int rndNum = Rnd.get(100);
final L2PcInstance gettarget = (L2PcInstance) getTarget();
final L2PcInstance gettarget = (L2PcInstance) _target;
if ((rndNum < 5) && (gettarget != null))
{
@@ -1560,15 +1560,15 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
final int maxRadius = (int) getStat().calcStat(Stats.POWER_ATTACK_RANGE, 66, null, null);
final int maxAngleDiff = (int) getStat().calcStat(Stats.POWER_ATTACK_ANGLE, 120, null, null);
if (getTarget() == null)
if (_target == null)
{
return false;
}
angleTarget = Util.calculateAngleFrom(this, getTarget());
angleTarget = Util.calculateAngleFrom(this, _target);
setHeading((int) ((angleTarget / 9.0) * 1610.0));
angleChar = Util.convertHeadingToDegree(getHeading());
angleChar = Util.convertHeadingToDegree(_heading);
double attackpercent = 85;
final int attackcountmax = (int) getStat().calcStat(Stats.ATTACK_COUNT_MAX, 3, null, null);
int attackcount = 0;
@@ -1725,14 +1725,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
// Check if the skill is a magic spell and if the L2Character is not muted
if (skill.isMagic() && isMuted() && !skill.isPotion())
if (skill.isMagic() && _isMuted && !skill.isPotion())
{
getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
return;
}
// Check if the skill is psychical and if the L2Character is not psychical_muted
if (!skill.isMagic() && isPsychicalMuted() && !skill.isPotion())
if (!skill.isMagic() && _isPsychicalMuted && !skill.isPotion())
{
getAI().notifyEvent(CtrlEvent.EVT_CANCEL);
return;
@@ -1841,7 +1841,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
else
{
target = (L2Character) getTarget();
target = (L2Character) _target;
}
if (target == null)
@@ -1953,7 +1953,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// Init the reuse time of the skill
// int reuseDelay = (int)(skill.getReuseDelay() * getStat().getMReuseRate(skill));
// reuseDelay *= 333.0 / (skill.isMagic() ? getMAtkSpd() : getPAtkSpd());
// reuseDelay *= 333.0 / (skill.isMagic() ? getStat().getMAtkSpd() : getStat().getPAtkSpd());
int reuseDelay = skill.getReuseDelay();
if ((activeChar instanceof L2PcInstance) && Formulas.getInstance().calcSkillMastery(activeChar))
@@ -1971,7 +1971,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
reuseDelay *= getStat().getPReuseRate(skill);
}
reuseDelay *= 333.0 / (skill.isMagic() ? getMAtkSpd() : getPAtkSpd());
reuseDelay *= 333.0 / (skill.isMagic() ? getStat().getMAtkSpd() : getStat().getPAtkSpd());
}
// To turn local player in target direction
@@ -2083,7 +2083,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
getStatus().reduceMp(calcStat(Stats.PHYSICAL_MP_CONSUME_RATE, initmpcons, null, null));
}
su.addAttribute(StatusUpdate.CUR_MP, (int) getCurrentMp());
su.addAttribute(StatusUpdate.CUR_MP, (int) getStatus().getCurrentMp());
sendPacket(su);
}
@@ -2124,7 +2124,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// Create a task MagicUseTask to launch the MagicSkill at the end of the casting time (hitTime)
// For client animation reasons (party buffs especially) 200 ms before!
if ((getForceBuff() != null) || effectWhileCasting)
if ((_forceBuff != null) || effectWhileCasting)
{
if (skill.isPotion())
{
@@ -2217,7 +2217,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// killing is only possible one time
synchronized (this)
{
if (isKilledAlready())
if (_isKilledAlready)
{
return false;
}
@@ -2228,7 +2228,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
setTarget(null);
// Stop fear to avoid possible bug with char position after death
if (isAfraid())
if (_isAfraid)
{
stopFear(null);
}
@@ -2372,7 +2372,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
/** Sets HP, MP and CP and revives the L2Character. */
public void doRevive()
{
if (!isTeleporting())
if (!_isTeleporting)
{
setIsPendingRevive(false);
@@ -2381,14 +2381,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
((L2Playable) this).stopPhoenixBlessing(null);
// Like L2OFF Soul of The Phoenix and Salvation restore all hp,cp,mp.
_status.setCurrentCp(getMaxCp());
_status.setCurrentHp(getMaxHp());
_status.setCurrentMp(getMaxMp());
_status.setCurrentCp(getStat().getMaxCp());
_status.setCurrentHp(getStat().getMaxHp());
_status.setCurrentMp(getStat().getMaxMp());
}
else
{
_status.setCurrentCp(getMaxCp() * Config.RESPAWN_RESTORE_CP);
_status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP);
_status.setCurrentCp(getStat().getMaxCp() * Config.RESPAWN_RESTORE_CP);
_status.setCurrentHp(getStat().getMaxHp() * Config.RESPAWN_RESTORE_HP);
}
}
// Start broadcast status
@@ -2608,7 +2608,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public final boolean isAlikeDead()
{
return isFakeDeath() || (getCurrentHp() <= 0.01);
return _isFakeDeath || (getStatus().getCurrentHp() <= 0.01);
}
/**
@@ -2617,7 +2617,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public final boolean isAllSkillsDisabled()
{
return _allSkillsDisabled || isImmobileUntilAttacked() || isStunned() || isSleeping() || isParalyzed();
return _allSkillsDisabled || _isImmobileUntilAttacked || _isStunned || _isSleeping || _isParalyzed;
}
/**
@@ -2626,7 +2626,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public boolean isAttackingDisabled()
{
return isImmobileUntilAttacked() || isStunned() || isSleeping() || isFallsdown() || (_attackEndTime > GameTimeController.getGameTicks()) || isFakeDeath() || isParalyzed() || isAttackDisabled();
return _isImmobileUntilAttacked || _isStunned || _isSleeping || _isFallsdown || (_attackEndTime > GameTimeController.getGameTicks()) || _isFakeDeath || _isParalyzed || _isAttackDisabled;
}
/**
@@ -2662,7 +2662,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public final boolean isDead()
{
return !isFakeDeath() && (getCurrentHp() < 0.5);
return !_isFakeDeath && (getStatus().getCurrentHp() < 0.5);
}
/**
@@ -2843,7 +2843,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public boolean isMovementDisabled()
{
return isImmobileUntilAttacked() || isStunned() || isRooted() || isSleeping() || isOverloaded() || isParalyzed() || isImobilised() || isFakeDeath() || isFallsdown();
return _isImmobileUntilAttacked || _isStunned || _isRooted || _isSleeping || _isOverloaded || _isParalyzed || isImobilised() || _isFakeDeath || _isFallsdown;
}
/**
@@ -2852,7 +2852,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public final boolean isOutOfControl()
{
return isConfused() || isAfraid() || isBlocked();
return _isConfused || _isAfraid || _blocked;
}
/**
@@ -2987,7 +2987,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public final void setRunning()
{
if (!isRunning())
if (!_isRunning)
{
setIsRunning(true);
}
@@ -3242,7 +3242,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public final void setWalking()
{
if (isRunning())
if (_isRunning)
{
setIsRunning(false);
}
@@ -3534,12 +3534,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// LOGGER.fine("Checking pvp time: " + getlastPvpAttack());
// "lastattack: " _lastAttackTime "currenttime: "
// System.currentTimeMillis());
if (System.currentTimeMillis() > getPvpFlagLasts())
if (System.currentTimeMillis() > _pvpFlagLasts)
{
// LOGGER.fine("Stopping PvP");
stopPvPFlag();
}
else if (System.currentTimeMillis() > (getPvpFlagLasts() - 5000))
else if (System.currentTimeMillis() > (_pvpFlagLasts - 5000))
{
updatePvPFlag(2);
}
@@ -4102,7 +4102,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public final void startStunning()
{
if (isStunned())
if (_isStunned)
{
return;
}
@@ -4523,7 +4523,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public final void stopStunning(L2Effect effect)
{
if (!isStunned())
if (!_isStunned)
{
return;
}
@@ -4722,31 +4722,31 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
{
int ae = _AbnormalEffects;
if (isStunned())
if (_isStunned)
{
ae |= ABNORMAL_EFFECT_STUN;
}
if (isRooted())
if (_isRooted)
{
ae |= ABNORMAL_EFFECT_ROOT;
}
if (isSleeping())
if (_isSleeping)
{
ae |= ABNORMAL_EFFECT_SLEEP;
}
if (isConfused())
if (_isConfused)
{
ae |= ABNORMAL_EFFECT_CONFUSED;
}
if (isMuted())
if (_isMuted)
{
ae |= ABNORMAL_EFFECT_MUTED;
}
if (isAfraid())
if (_isAfraid)
{
ae |= ABNORMAL_EFFECT_AFRAID;
}
if (isPsychicalMuted())
if (_isPsychicalMuted)
{
ae |= ABNORMAL_EFFECT_MUTED;
}
@@ -5505,7 +5505,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
su = new StatusUpdate(getObjectId());
}
su.addAttribute(StatusUpdate.ATK_SPD, getPAtkSpd());
su.addAttribute(StatusUpdate.ATK_SPD, getStat().getPAtkSpd());
}
else if (stat == Stats.MAGIC_ATTACK_SPEED)
{
@@ -5514,12 +5514,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
su = new StatusUpdate(getObjectId());
}
su.addAttribute(StatusUpdate.CAST_SPD, getMAtkSpd());
su.addAttribute(StatusUpdate.CAST_SPD, getStat().getMAtkSpd());
}
// else if (stat==Stats.MAX_HP) //
// {
// if (su == null) su = new StatusUpdate(getObjectId());
// su.addAttribute(StatusUpdate.MAX_HP, getMaxHp());
// su.addAttribute(StatusUpdate.MAX_HP, getStat().getMaxHp());
// }
else if (stat == Stats.MAX_CP)
{
@@ -5530,13 +5530,13 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
su = new StatusUpdate(getObjectId());
}
su.addAttribute(StatusUpdate.MAX_CP, getMaxCp());
su.addAttribute(StatusUpdate.MAX_CP, getStat().getMaxCp());
}
}
// else if (stat==Stats.MAX_MP)
// {
// if (su == null) su = new StatusUpdate(getObjectId());
// su.addAttribute(StatusUpdate.MAX_MP, getMaxMp());
// su.addAttribute(StatusUpdate.MAX_MP, getStat().getMaxMp());
// }
else if (stat == Stats.RUN_SPEED)
{
@@ -5909,9 +5909,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
_skillCast = null;
}
if (getForceBuff() != null)
if (_forceBuff != null)
{
getForceBuff().onCastAbort();
_forceBuff.onCastAbort();
}
final L2Effect mog = getFirstEffect(L2Effect.EffectType.SIGNET_GROUND);
@@ -6331,7 +6331,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
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);
@@ -6409,7 +6409,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
m.onGeodataPathIndex = -1; // Initialize not on geodata path
m.disregardingGeodata = false;
if (!isFlying() && !isInWater && !(this instanceof L2BoatInstance) && !(this instanceof L2NpcWalkerInstance) && !_cursorKeyMovement)
if (!_isFlying && !isInWater && !(this instanceof L2BoatInstance) && !(this instanceof L2NpcWalkerInstance) && !_cursorKeyMovement)
{
final boolean isInBoat = (this instanceof L2PcInstance) && ((L2PcInstance) this).isInBoat();
if (isInBoat)
@@ -6477,7 +6477,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
// Pathfinding checks.
if (((originalDistance - distance) > 30) && !isAfraid() && !isInBoat)
if (((originalDistance - distance) > 30) && !_isAfraid && !isInBoat)
{
// Path calculation
// Overrides previous movement check
@@ -6527,7 +6527,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
// If no distance to go through, the movement is cancelled
if ((distance < 1) && ((Config.PATHFINDING > 0) || (this instanceof L2Playable) || isAfraid() || (this instanceof L2RiftInvaderInstance)))
if ((distance < 1) && ((Config.PATHFINDING > 0) || (this instanceof L2Playable) || _isAfraid || (this instanceof L2RiftInvaderInstance)))
{
if (this instanceof L2Summon)
{
@@ -6539,7 +6539,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
// Apply Z distance for flying or swimming for correct timing calculations
if ((isFlying() || isInWater) && !verticalMovementOnly)
if ((_isFlying || isInWater) && !verticalMovementOnly)
{
distance = Math.hypot(distance, dz);
}
@@ -7279,7 +7279,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
if (absorbPercent > 0)
{
final int maxCanAbsorb = (int) (getMaxHp() - getCurrentHp());
final int maxCanAbsorb = (int) (getStat().getMaxHp() - getStatus().getCurrentHp());
int absorbDamage = (int) ((absorbPercent / 100.) * damage);
if (absorbDamage > maxCanAbsorb)
@@ -7289,7 +7289,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
if (absorbDamage > 0)
{
setCurrentHp(getCurrentHp() + absorbDamage);
setCurrentHp(getStatus().getCurrentHp() + absorbDamage);
// Custom messages - nice but also more network load
/*
@@ -7416,7 +7416,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
public void breakCast()
{
// damage can only cancel magical skills
if (isCastingNow() && canAbortCast() && (getLastSkillCast() != null) && getLastSkillCast().isMagic())
if (isCastingNow() && canAbortCast() && (_lastSkillCast != null) && _lastSkillCast.isMagic())
{
// Abort the cast of the L2Character and send Server->Client MagicSkillCanceld/ActionFailed packet.
abortCast();
@@ -7769,7 +7769,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
else
{
atkSpd = getPAtkSpd();
atkSpd = getStat().getPAtkSpd();
}
return Formulas.getInstance().calcPAtkSpd(this, target, atkSpd);
@@ -7852,7 +7852,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
if (newSkill != null)
{
// Replace oldSkill by newSkill or Add the newSkill
oldSkill = getSkills().put(newSkill.getId(), newSkill);
oldSkill = _skills.put(newSkill.getId(), newSkill);
// If an old skill has been replaced, remove all its Func objects
if (oldSkill != null)
@@ -7998,7 +7998,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
public L2Skill removeSkill(int skillId, boolean cancelEffect)
{
// Remove the skill from the L2Character _skills
final L2Skill oldSkill = getSkills().remove(skillId);
final L2Skill oldSkill = _skills.remove(skillId);
// Remove all its Func objects from the L2Character calculator set
if (oldSkill != null)
{
@@ -8014,9 +8014,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
// 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();
}
@@ -8052,7 +8052,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public final L2Skill[] getAllSkills()
{
return getSkills().values().toArray(new L2Skill[getSkills().values().size()]);
return _skills.values().toArray(new L2Skill[_skills.values().size()]);
}
/**
@@ -8082,7 +8082,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
@Override
public int getSkillLevel(int skillId)
{
final L2Skill skill = getSkills().get(skillId);
final L2Skill skill = _skills.get(skillId);
return (skill == null) ? 0 : skill.getLevel();
}
@@ -8095,7 +8095,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
@Override
public final L2Skill getKnownSkill(int skillId)
{
return getSkills().get(skillId);
return _skills.get(skillId);
}
/**
@@ -8512,12 +8512,12 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
return;
}
if (getForceBuff() != null)
if (_forceBuff != null)
{
_skillCast = null;
enableAllSkills();
getForceBuff().onCastAbort();
_forceBuff.onCastAbort();
return;
}
@@ -8616,7 +8616,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
getStatus().reduceMp(calcStat(Stats.PHYSICAL_MP_CONSUME_RATE, mpConsume, null, null));
}
su.addAttribute(StatusUpdate.CUR_MP, (int) getCurrentMp());
su.addAttribute(StatusUpdate.CUR_MP, (int) getStatus().getCurrentMp());
isSendStatus = true;
}
@@ -8627,14 +8627,14 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
consumeHp = calcStat(Stats.HP_CONSUME_RATE, skill.getHpConsume(), null, null);
if ((consumeHp + 1) >= getCurrentHp())
if ((consumeHp + 1) >= getStatus().getCurrentHp())
{
consumeHp = getCurrentHp() - 1.0;
consumeHp = getStatus().getCurrentHp() - 1.0;
}
getStatus().reduceHp(consumeHp, this);
su.addAttribute(StatusUpdate.CUR_HP, (int) getCurrentHp());
su.addAttribute(StatusUpdate.CUR_HP, (int) getStatus().getCurrentHp());
isSendStatus = true;
}
@@ -8712,18 +8712,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// Like L2OFF if the skill is BLOW the player doesn't auto attack
// If on XML skill nextActionAttack = true the char auto attack
// If CTRL is pressed the autoattack is aborted (like L2OFF)
if ((skilldat != null) && !skilldat.isCtrlPressed() && skill.nextActionIsAttack() && (getTarget() != null) && (getTarget() instanceof L2Character))
if ((skilldat != null) && !skilldat.isCtrlPressed() && skill.nextActionIsAttack() && (_target != null) && (_target instanceof L2Character))
{
getAI().setIntention(AI_INTENTION_ATTACK, getTarget());
getAI().setIntention(AI_INTENTION_ATTACK, _target);
}
}
else if (skill.nextActionIsAttack() && (getTarget() != null) && (getTarget() instanceof L2Character))
else if (skill.nextActionIsAttack() && (_target != null) && (_target instanceof L2Character))
{
getAI().setIntention(AI_INTENTION_ATTACK, getTarget());
getAI().setIntention(AI_INTENTION_ATTACK, _target);
}
else if ((skill.isOffensive()) && (skill.getSkillType() != SkillType.UNLOCK) && (skill.getSkillType() != SkillType.BLOW) && (skill.getSkillType() != SkillType.DELUXE_KEY_UNLOCK) && (skill.getId() != 345) && (skill.getId() != 346))
{
getAI().setIntention(AI_INTENTION_ATTACK, getTarget());
getAI().setIntention(AI_INTENTION_ATTACK, _target);
getAI().clientStartAutoAttack();
}
}
@@ -8735,7 +8735,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
{
if (!skill.isMagic() && skill.nextActionIsAttack())
{
getAI().setIntention(AI_INTENTION_ATTACK, getTarget());
getAI().setIntention(AI_INTENTION_ATTACK, _target);
}
getAI().clientStartAutoAttack();
@@ -8745,7 +8745,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
{
if (!skill.isMagic())
{
getAI().setIntention(AI_INTENTION_ATTACK, getTarget());
getAI().setIntention(AI_INTENTION_ATTACK, _target);
}
getAI().clientStartAutoAttack();
@@ -8759,7 +8759,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
// Notify the AI of the L2Character with EVT_FINISH_CASTING
getAI().notifyEvent(CtrlEvent.EVT_FINISH_CASTING);
notifyQuestEventSkillFinished(skill, getTarget());
notifyQuestEventSkillFinished(skill, _target);
/*
* If character is a player, then wipe their current cast state and check if a skill is queued. If there is a queued skill, launch it and wipe the queue.
@@ -8823,7 +8823,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
{
final L2PcInstance player = target instanceof L2PcInstance ? (L2PcInstance) target : ((L2Summon) target).getOwner();
for (Quest quest : ((L2NpcTemplate) getTemplate()).getEventQuests(Quest.QuestEventType.ON_SPELL_FINISHED))
for (Quest quest : ((L2NpcTemplate) _template).getEventQuests(Quest.QuestEventType.ON_SPELL_FINISHED))
{
quest.notifySpellFinished(((L2NpcInstance) this), player, skill);
}
@@ -9516,7 +9516,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public boolean isBehindTarget()
{
return isBehind(getTarget());
return isBehind(_target);
}
/**
@@ -9534,7 +9534,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
maxAngleDiff = maxAngle / 2;
angleTarget = Util.calculateAngleFrom(this, target);
angleChar = Util.convertHeadingToDegree(getHeading());
angleChar = Util.convertHeadingToDegree(_heading);
angleDiff = angleChar - angleTarget;
if (angleDiff <= (-360 + maxAngleDiff))
{
@@ -9589,7 +9589,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
if (Math.abs(angleDiff) <= maxAngleDiff)
{
if (isBehindTarget())
if (isBehind(_target))
{
return false;
}
@@ -9612,7 +9612,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public boolean isFrontTarget()
{
return isFront(getTarget());
return isFront(_target);
}
/**
@@ -9630,7 +9630,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
if (target instanceof L2Character)
{
if (isBehindTarget() || isFrontTarget())
if (isBehind(_target) || isFront(_target))
{
return false;
}
@@ -9645,7 +9645,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public boolean isSideTarget()
{
return isSide(getTarget());
return isSide(_target);
}
/**
@@ -9682,7 +9682,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
private Future<?> _PvPRegTask;
/** The _pvp flag lasts. */
private long _pvpFlagLasts;
long _pvpFlagLasts;
/**
* Sets the pvp flag lasts.
@@ -10316,18 +10316,18 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
}
}
if (Config.L2JMOD_CHAMPION_ENABLE && isChampion() && (Config.L2JMOD_CHAMPION_HP != 0))
if (Config.L2JMOD_CHAMPION_ENABLE && _champion && (Config.L2JMOD_CHAMPION_HP != 0))
{
getStatus().reduceHp(i / Config.L2JMOD_CHAMPION_HP, attacker, awake);
}
else if (is_advanceFlag())
else if (_advanceFlag)
{
getStatus().reduceHp(i / _advanceMultiplier, attacker, awake);
}
else if (isUnkillable())
else if (_isUnkillable)
{
final double hpToReduce = getCurrentHp() - 1;
if (i > getCurrentHp())
final double hpToReduce = getStatus().getCurrentHp() - 1;
if (i > getStatus().getCurrentHp())
{
getStatus().reduceHp(hpToReduce, attacker, awake);
}
@@ -10678,7 +10678,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public void restoreHPMP()
{
getStatus().setCurrentHpMp(getMaxHp(), getMaxMp());
getStatus().setCurrentHpMp(getStat().getMaxHp(), getStat().getMaxMp());
}
/**
@@ -10686,7 +10686,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder
*/
public void restoreCP()
{
getStatus().setCurrentCp(getMaxCp());
getStatus().setCurrentCp(getStat().getMaxCp());
}
/**
@@ -59,7 +59,7 @@ public abstract class L2Summon extends L2Playable
protected int _pkKills;
private L2PcInstance _owner;
private int _attackRange = 36; // Melee range
private boolean _follow = true;
boolean _follow = true;
private boolean _previousFollowStatus = true;
private int _maxLoad;
@@ -86,7 +86,7 @@ public abstract class L2Summon extends L2Playable
public boolean isAutoFollow()
{
return getFollowStatus();
return _follow;
}
public void doPickupItem(L2Object object)
@@ -278,12 +278,12 @@ public abstract class L2Summon extends L2Playable
public final int getKarma()
{
return getOwner() != null ? getOwner().getKarma() : 0;
return _owner != null ? _owner.getKarma() : 0;
}
public final byte getPvpFlag()
{
return getOwner() != null ? getOwner().getPvpFlag() : 0;
return _owner != null ? _owner.getPvpFlag() : 0;
}
public final L2PcInstance getOwner()
@@ -299,7 +299,7 @@ public abstract class L2Summon extends L2Playable
@Override
protected void doAttack(L2Character target)
{
if ((getOwner() != null) && (getOwner() == target) && !getOwner().isBetrayed())
if ((_owner != null) && (_owner == target) && !_owner.isBetrayed())
{
sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
return;
@@ -409,9 +409,9 @@ public abstract class L2Summon extends L2Playable
{
super.broadcastStatusUpdate();
if ((getOwner() != null) && isVisible())
if ((_owner != null) && isVisible())
{
getOwner().sendPacket(new PetStatusUpdate(this));
_owner.sendPacket(new PetStatusUpdate(this));
}
}
@@ -480,7 +480,7 @@ public abstract class L2Summon extends L2Playable
if (_follow)
{
getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, getOwner());
getAI().setIntention(CtrlIntention.AI_INTENTION_FOLLOW, _owner);
}
else
{
@@ -632,7 +632,7 @@ public abstract class L2Summon extends L2Playable
}
// Set current pet skill
getOwner().setCurrentPetSkill(skill, forceUse, dontMove);
_owner.setCurrentPetSkill(skill, forceUse, dontMove);
// ************************************* Check Target *******************************************
@@ -644,7 +644,7 @@ public abstract class L2Summon extends L2Playable
// OWNER_PET should be cast even if no target has been found
case TARGET_OWNER_PET:
{
target = getOwner();
target = _owner;
break;
}
// PARTY, AURA, SELF should be cast even if no target has been found
@@ -666,9 +666,9 @@ public abstract class L2Summon extends L2Playable
// Check the validity of the target
if (target == null)
{
if (getOwner() != null)
if (_owner != null)
{
getOwner().sendPacket(SystemMessageId.TARGET_CANT_FOUND);
_owner.sendPacket(SystemMessageId.TARGET_CANT_FOUND);
}
return;
}
@@ -676,16 +676,16 @@ public abstract class L2Summon extends L2Playable
// ************************************* Check skill availability *******************************************
// Check if this skill is enabled (ex : reuse time)
if (isSkillDisabled(skill) && (getOwner() != null) && getOwner().getAccessLevel().allowPeaceAttack())
if (isSkillDisabled(skill) && (_owner != null) && _owner.getAccessLevel().allowPeaceAttack())
{
SystemMessage sm = new SystemMessage(SystemMessageId.S1_PREPARED_FOR_REUSE);
sm.addString(skill.getName());
getOwner().sendPacket(sm);
_owner.sendPacket(sm);
return;
}
// Check if all skills are disabled
if (isAllSkillsDisabled() && (getOwner() != null) && getOwner().getAccessLevel().allowPeaceAttack())
if (isAllSkillsDisabled() && (_owner != null) && _owner.getAccessLevel().allowPeaceAttack())
{
return;
}
@@ -696,9 +696,9 @@ public abstract class L2Summon extends L2Playable
if (getCurrentMp() < (getStat().getMpConsume(skill) + getStat().getMpInitialConsume(skill)))
{
// Send a System Message to the caster
if (getOwner() != null)
if (_owner != null)
{
getOwner().sendPacket(SystemMessageId.NOT_ENOUGH_MP);
_owner.sendPacket(SystemMessageId.NOT_ENOUGH_MP);
}
return;
@@ -708,9 +708,9 @@ public abstract class L2Summon extends L2Playable
if (getCurrentHp() <= skill.getHpConsume())
{
// Send a System Message to the caster
if (getOwner() != null)
if (_owner != null)
{
getOwner().sendPacket(SystemMessageId.NOT_ENOUGH_HP);
_owner.sendPacket(SystemMessageId.NOT_ENOUGH_HP);
}
return;
@@ -721,20 +721,20 @@ public abstract class L2Summon extends L2Playable
// Check if this is offensive magic skill
if (skill.isOffensive())
{
if ((getOwner() != null) && (getOwner() == target) && !getOwner().isBetrayed())
if ((_owner != null) && (_owner == target) && !_owner.isBetrayed())
{
sendPacket(new SystemMessage(SystemMessageId.TARGET_IS_INCORRECT));
return;
}
if (isInsidePeaceZone(this, target) && (getOwner() != null) && !getOwner().getAccessLevel().allowPeaceAttack())
if (isInsidePeaceZone(this, target) && (_owner != null) && !_owner.getAccessLevel().allowPeaceAttack())
{
// If summon or target is in a peace zone, send a system message TARGET_IN_PEACEZONE
sendPacket(new SystemMessage(SystemMessageId.TARGET_IN_PEACEZONE));
return;
}
if ((getOwner() != null) && getOwner().isInOlympiadMode() && !getOwner().isOlympiadStart())
if ((_owner != null) && _owner.isInOlympiadMode() && !_owner.isOlympiadStart())
{
// if L2PcInstance is in Olympia and the match isn't already start, send a Server->Client packet ActionFailed
sendPacket(ActionFailed.STATIC_PACKET);
@@ -744,14 +744,14 @@ public abstract class L2Summon extends L2Playable
// Check if the target is attackable
if (target instanceof L2DoorInstance)
{
if (!((L2DoorInstance) target).isAttackable(getOwner()))
if (!((L2DoorInstance) target).isAttackable(_owner))
{
return;
}
}
else
{
if (!target.isAttackable() && (getOwner() != null) && getOwner().getAccessLevel().allowPeaceAttack())
if (!target.isAttackable() && (_owner != null) && _owner.getAccessLevel().allowPeaceAttack())
{
return;
}
@@ -775,7 +775,7 @@ public abstract class L2Summon extends L2Playable
if (value)
{
_previousFollowStatus = getFollowStatus();
_previousFollowStatus = _follow;
// if imobilized temporarly disable follow mode
if (_previousFollowStatus)
@@ -814,7 +814,7 @@ public abstract class L2Summon extends L2Playable
@Override
public boolean isInCombat()
{
return getOwner() != null ? getOwner().isInCombat() : false;
return _owner != null ? _owner.isInCombat() : false;
}
/**
@@ -58,7 +58,7 @@ public final class L2CastleTeleporterInstance extends L2NpcInstance
if (actualCommand.equalsIgnoreCase("tele"))
{
int delay;
if (!getTask())
if (!_currentTask)
{
if (getCastle().getSiege().getIsInProgress() && (getCastle().getSiege().getControlTowerCount() == 0))
{
@@ -90,7 +90,7 @@ public final class L2CastleTeleporterInstance extends L2NpcInstance
public void showChatWindow(L2PcInstance player)
{
String filename;
if (!getTask())
if (!_currentTask)
{
if (getCastle().getSiege().getIsInProgress() && (getCastle().getSiege().getControlTowerCount() == 0))
{
@@ -232,7 +232,7 @@ public final class L2ChestInstance extends L2MonsterInstance
return true;
}
if (isInteracted())
if (_isInteracted)
{
return false;
}
@@ -93,7 +93,7 @@ public class L2ControllableMobInstance extends L2MonsterInstance
@Override
public void reduceCurrentHp(double i, L2Character attacker, boolean awake)
{
if (isInvul() || isDead())
if (_isInvul || isDead())
{
return;
}
@@ -110,7 +110,7 @@ public class L2DoorInstance extends L2Character
protected final String _name;
/** The _open. */
private boolean _open;
boolean _open;
/** The _unlockable. */
private final boolean _unlockable;
@@ -262,7 +262,7 @@ public class L2DoorInstance extends L2Character
{
String doorAction;
if (!getOpen())
if (!_open)
{
doorAction = "opened";
openMe();
@@ -512,7 +512,7 @@ public class L2DoorInstance extends L2Character
@Override
public boolean isAutoAttackable(L2Character attacker)
{
if (isUnlockable())
if (_unlockable)
{
return true;
}
@@ -681,12 +681,12 @@ public class L2DoorInstance extends L2Character
LOGGER.info("player clanid " + player.getClanId());
LOGGER.info("player clanleaderid " + player.getClan().getLeaderId());
}
LOGGER.info("clanhall " + getClanHall());
if (getClanHall() != null)
LOGGER.info("clanhall " + _clanHall);
if (_clanHall != null)
{
LOGGER.info("clanhallID " + getClanHall().getId());
LOGGER.info("clanhallOwner " + getClanHall().getOwnerId());
for (L2DoorInstance door : getClanHall().getDoors())
LOGGER.info("clanhallID " + _clanHall.getId());
LOGGER.info("clanhallOwner " + _clanHall.getOwnerId());
for (L2DoorInstance door : _clanHall.getDoors())
{
LOGGER.info("clanhallDoor " + door.getObjectId());
}
@@ -721,7 +721,7 @@ public class L2DoorInstance extends L2Character
player.getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, this);
}
}
else if ((player.getClan() != null) && (getClanHall() != null) && (player.getClanId() == getClanHall().getOwnerId()))
else if ((player.getClan() != null) && (_clanHall != null) && (player.getClanId() == _clanHall.getOwnerId()))
{
if (!isInsideRadius(player, L2NpcInstance.INTERACTION_DISTANCE, false, false))
{
@@ -731,7 +731,7 @@ public class L2DoorInstance extends L2Character
{
// Like L2OFF Clanhall's doors get request to be closed/opened
player.gatesRequest(this);
if (!getOpen())
if (!_open)
{
player.sendPacket(new ConfirmDlg(1140));
}
@@ -768,12 +768,12 @@ public class L2DoorInstance extends L2Character
LOGGER.info("player clanid " + player.getClanId());
LOGGER.info("player clanleaderid " + player.getClan().getLeaderId());
}
LOGGER.info("clanhall " + getClanHall());
if (getClanHall() != null)
LOGGER.info("clanhall " + _clanHall);
if (_clanHall != null)
{
LOGGER.info("clanhallID " + getClanHall().getId());
LOGGER.info("clanhallOwner " + getClanHall().getOwnerId());
for (L2DoorInstance door : getClanHall().getDoors())
LOGGER.info("clanhallID " + _clanHall.getId());
LOGGER.info("clanhallOwner " + _clanHall.getOwnerId());
for (L2DoorInstance door : _clanHall.getDoors())
{
LOGGER.info("clanhallDoor " + door.getObjectId());
}
@@ -799,7 +799,7 @@ public class L2DoorInstance extends L2Character
html1.append("<tr><td>Max HP " + getMaxHp() + "</td></tr>");
html1.append("<tr><td>Object ID: " + getObjectId() + "</td></tr>");
html1.append("<tr><td>Door ID: " + getDoorId() + "</td></tr>");
html1.append("<tr><td>Door ID: " + _doorId + "</td></tr>");
html1.append("<tr><td><br></td></tr>");
html1.append("<tr><td>Class: " + getClass().getName() + "</td></tr>");
@@ -807,8 +807,8 @@ public class L2DoorInstance extends L2Character
html1.append("</table>");
html1.append("<table><tr>");
html1.append("<td><button value=\"Open\" action=\"bypass -h admin_open " + getDoorId() + "\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
html1.append("<td><button value=\"Close\" action=\"bypass -h admin_close " + getDoorId() + "\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
html1.append("<td><button value=\"Open\" action=\"bypass -h admin_open " + _doorId + "\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
html1.append("<td><button value=\"Close\" action=\"bypass -h admin_close " + _doorId + "\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
html1.append("<td><button value=\"Kill\" action=\"bypass -h admin_kill\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
html1.append("<td><button value=\"Delete\" action=\"bypass -h admin_delete\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
html1.append("</tr></table></body></html>");
@@ -888,7 +888,7 @@ public class L2DoorInstance extends L2Character
{
synchronized (this)
{
if (!getOpen())
if (!_open)
{
return;
}
@@ -906,7 +906,7 @@ public class L2DoorInstance extends L2Character
{
synchronized (this)
{
if (getOpen())
if (_open)
{
return;
}
@@ -67,7 +67,7 @@ public final class L2GourdInstance extends L2MonsterInstance
@Override
public void reduceCurrentHp(double damage, L2Character attacker, boolean awake)
{
if (!attacker.getName().equalsIgnoreCase(getOwner()))
if (!attacker.getName().equalsIgnoreCase(_name))
{
damage = 0;
}
@@ -539,7 +539,7 @@ public final class L2ItemInstance extends L2Object
*/
public boolean isCupidBow()
{
if ((getItemId() == 9140) || (getItemId() == 9141))
if ((_itemId == 9140) || (_itemId == 9141))
{
return true;
}
@@ -615,7 +615,7 @@ public final class L2ItemInstance extends L2Object
*/
public int getPriceToSell()
{
return isConsumable() ? (int) (_priceSell * Config.RATE_CONSUMABLE_COST) : _priceSell;
return _item.isConsumable() ? (int) (_priceSell * Config.RATE_CONSUMABLE_COST) : _priceSell;
}
/**
@@ -719,9 +719,9 @@ public final class L2ItemInstance extends L2Object
*/
public boolean isAvailable(L2PcInstance player, boolean allowAdena, boolean allowEquipped)
{
return (!isEquipped() || allowEquipped) && (getItem().getType2() != L2Item.TYPE2_QUEST) && ((getItem().getType2() != L2Item.TYPE2_MONEY) || (getItem().getType1() != L2Item.TYPE1_SHIELD_ARMOR)) // TODO: what does this mean?
return (!isEquipped() || allowEquipped) && (_item.getType2() != L2Item.TYPE2_QUEST) && ((_item.getType2() != L2Item.TYPE2_MONEY) || (_item.getType1() != L2Item.TYPE1_SHIELD_ARMOR)) // TODO: what does this mean?
&& ((player.getPet() == null) || (getObjectId() != player.getPet().getControlItemId())) // Not Control item of currently summoned pet
&& (player.getActiveEnchantItem() != this) && (allowAdena || (getItemId() != 57)) && ((player.getCurrentSkill() == null) || (player.getCurrentSkill().getSkill().getItemConsumeId() != getItemId())) && isTradeable();
&& (player.getActiveEnchantItem() != this) && (allowAdena || (_itemId != 57)) && ((player.getCurrentSkill() == null) || (player.getCurrentSkill().getSkill().getItemConsumeId() != _itemId)) && isTradeable();
}
/*
@@ -946,21 +946,21 @@ public final class L2ItemInstance extends L2Object
case 10:
{
sm = new SystemMessage(SystemMessageId.S1S_REMAINING_MANA_IS_NOW_10);
sm.addString(getItemName());
sm.addString(_item.getName());
player.sendPacket(sm);
break;
}
case 5:
{
sm = new SystemMessage(SystemMessageId.S1S_REMAINING_MANA_IS_NOW_5);
sm.addString(getItemName());
sm.addString(_item.getName());
player.sendPacket(sm);
break;
}
case 1:
{
sm = new SystemMessage(SystemMessageId.S1S_REMAINING_MANA_IS_NOW_1);
sm.addString(getItemName());
sm.addString(_item.getName());
player.sendPacket(sm);
break;
}
@@ -969,7 +969,7 @@ public final class L2ItemInstance extends L2Object
if (_mana == 0) // The life time has expired
{
sm = new SystemMessage(SystemMessageId.S1S_REMAINING_MANA_IS_NOW_0);
sm.addString(getItemName());
sm.addString(_item.getName());
player.sendPacket(sm);
// unequip
@@ -987,7 +987,7 @@ public final class L2ItemInstance extends L2Object
player.sendPacket(iu);
}
if (getLocation() != ItemLocation.WAREHOUSE)
if (_loc != ItemLocation.WAREHOUSE)
{
// destroy
player.getInventory().destroyItem("L2ItemInstance", this, player, null);
@@ -1017,7 +1017,7 @@ public final class L2ItemInstance extends L2Object
scheduleConsumeManaTask();
}
if (getLocation() != ItemLocation.WAREHOUSE)
if (_loc != ItemLocation.WAREHOUSE)
{
InventoryUpdate iu = new InventoryUpdate();
iu.addModifiedItem(this);
@@ -1108,7 +1108,7 @@ public final class L2ItemInstance extends L2Object
*/
public Func[] getStatFuncs(L2Character player)
{
return getItem().getStatFuncs(this, player);
return _item.getStatFuncs(this, player);
}
/**
@@ -1127,9 +1127,7 @@ public final class L2ItemInstance extends L2Object
*/
public void updateDatabase()
{
// LOGGER.info("Item: "+getItemId()+" Loc: "+_loc.name()+" ExistInDb: "+_existsInDb+" owner: "+_ownerId);
if (isWear())
if (_wear)
{
return;
}
@@ -1374,15 +1372,15 @@ public final class L2ItemInstance extends L2Object
{
PreparedStatement statement = con.prepareStatement("UPDATE items SET owner_id=?,count=?,loc=?,loc_data=?,enchant_level=?,price_sell=?,price_buy=?,custom_type1=?,custom_type2=?,mana_left=? WHERE object_id = ?");
statement.setInt(1, _ownerId);
statement.setInt(2, getCount());
statement.setInt(2, _count);
statement.setString(3, _loc.name());
statement.setInt(4, _locData);
statement.setInt(5, getEnchantLevel());
statement.setInt(5, _enchantLevel);
statement.setInt(6, _priceSell);
statement.setInt(7, _priceBuy);
statement.setInt(8, getCustomType1());
statement.setInt(9, getCustomType2());
statement.setInt(10, getMana());
statement.setInt(8, _type1);
statement.setInt(9, _type2);
statement.setInt(10, _mana);
statement.setInt(11, getObjectId());
statement.executeUpdate();
_existsInDb = true;
@@ -1420,16 +1418,16 @@ public final class L2ItemInstance extends L2Object
PreparedStatement statement = con.prepareStatement("INSERT INTO items (owner_id,item_id,count,loc,loc_data,enchant_level,price_sell,price_buy,object_id,custom_type1,custom_type2,mana_left) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)");
statement.setInt(1, _ownerId);
statement.setInt(2, _itemId);
statement.setInt(3, getCount());
statement.setInt(3, _count);
statement.setString(4, _loc.name());
statement.setInt(5, _locData);
statement.setInt(6, getEnchantLevel());
statement.setInt(6, _enchantLevel);
statement.setInt(7, _priceSell);
statement.setInt(8, _priceBuy);
statement.setInt(9, getObjectId());
statement.setInt(10, _type1);
statement.setInt(11, _type2);
statement.setInt(12, getMana());
statement.setInt(12, _mana);
statement.executeUpdate();
_existsInDb = true;
@@ -1440,7 +1438,7 @@ public final class L2ItemInstance extends L2Object
{
if (Config.DEBUG)
{
LOGGER.warning("ATTENTION: Update Item instead of Insert one, check player with id " + getOwnerId() + " actions on item " + getObjectId());
LOGGER.warning("ATTENTION: Update Item instead of Insert one, check player with id " + _ownerId + " actions on item " + getObjectId());
}
updateInDb();
}
@@ -1659,7 +1657,7 @@ public final class L2ItemInstance extends L2Object
*/
public boolean isVarkaKetraAllyQuestItem()
{
if (((getItemId() >= 7211) && (getItemId() <= 7215)) || ((getItemId() >= 7221) && (getItemId() <= 7225)))
if (((_itemId >= 7211) && (_itemId <= 7215)) || ((_itemId >= 7221) && (_itemId <= 7225)))
{
return true;
}
@@ -1679,7 +1677,7 @@ public final class L2ItemInstance extends L2Object
public boolean checkOlympCondition()
{
if (isHeroItem() || isOlyRestrictedItem() || isWear() || (!Config.ALT_OLY_AUGMENT_ALLOW && isAugmented()))
if (isHeroItem() || isOlyRestrictedItem() || _wear || (!Config.ALT_OLY_AUGMENT_ALLOW && isAugmented()))
{
return false;
}
@@ -57,7 +57,7 @@ public final class L2MinionInstance extends L2MonsterInstance
@Override
public boolean isRaid()
{
return getLeader() instanceof L2RaidBossInstance;
return _master instanceof L2RaidBossInstance;
}
/**
@@ -79,7 +79,7 @@ public final class L2MinionInstance extends L2MonsterInstance
{
super.onSpawn();
// Notify Leader that Minion has Spawned
getLeader().notifyMinionSpawned(this);
_master.notifyMinionSpawned(this);
// check the region where this mob is, do not activate the AI if region is inactive.
L2WorldRegion region = L2World.getInstance().getRegion(getX(), getY());
@@ -141,13 +141,13 @@ public class L2MonsterInstance extends L2Attackable
{
try
{
for (L2MinionInstance minion : getSpawnedMinions())
for (L2MinionInstance minion : _minionList.getSpawnedMinions())
{
if (minion == null)
{
continue;
}
getSpawnedMinions().remove(minion);
_minionList.getSpawnedMinions().remove(minion);
minion.deleteMe();
}
_minionList.clearRespawnList();
@@ -354,7 +354,7 @@ public class L2MonsterInstance extends L2Attackable
@Override
public void deleteMe()
{
if (hasMinions())
if (_minionList.hasMinions())
{
if (_minionMaintainTask != null)
{
@@ -371,7 +371,7 @@ public class L2MonsterInstance extends L2Attackable
*/
public void deleteSpawnedMinions()
{
for (L2MinionInstance minion : getSpawnedMinions())
for (L2MinionInstance minion : _minionList.getSpawnedMinions())
{
if (minion == null)
{
@@ -380,7 +380,7 @@ public class L2MonsterInstance extends L2Attackable
minion.abortAttack();
minion.abortCast();
minion.deleteMe();
getSpawnedMinions().remove(minion);
_minionList.getSpawnedMinions().remove(minion);
}
_minionList.clearRespawnList();
}
@@ -1031,7 +1031,7 @@ public class L2NpcInstance extends L2Character
String className = getClass().getName().substring(43);
html1.append("<br>");
html1.append("Instance Type: " + className + "<br1>Faction: " + getFactionId() + "<br1>Location ID: " + (getSpawn() != null ? getSpawn().getLocation() : 0) + "<br1>");
html1.append("Instance Type: " + className + "<br1>Faction: " + getTemplate().factionId + "<br1>Location ID: " + (_spawn != null ? _spawn.getLocation() : 0) + "<br1>");
if (this instanceof L2ControllableMobInstance)
{
@@ -1039,13 +1039,13 @@ public class L2NpcInstance extends L2Character
}
else
{
html1.append("Respawn Time: " + (getSpawn() != null ? (getSpawn().getRespawnDelay() / 1000) + " Seconds<br>" : "? Seconds<br>"));
html1.append("Respawn Time: " + (_spawn != null ? (_spawn.getRespawnDelay() / 1000) + " Seconds<br>" : "? Seconds<br>"));
}
html1.append("<table border=\"0\" width=\"100%\">");
html1.append("<tr><td>Object ID</td><td>" + getObjectId() + "</td><td>NPC ID</td><td>" + getTemplate().npcId + "</td></tr>");
html1.append("<tr><td>Castle</td><td>" + getCastle().getCastleId() + "</td><td>Coords</td><td>" + getX() + "," + getY() + "," + getZ() + "</td></tr>");
html1.append("<tr><td>Level</td><td>" + getLevel() + "</td><td>Aggro</td><td>" + (this instanceof L2Attackable ? ((L2Attackable) this).getAggroRange() : 0) + "</td></tr>");
html1.append("<tr><td>Level</td><td>" + getTemplate().level + "</td><td>Aggro</td><td>" + (this instanceof L2Attackable ? ((L2Attackable) this).getAggroRange() : 0) + "</td></tr>");
html1.append("</table><br>");
html1.append("<font color=\"LEVEL\">Combat</font>");
@@ -1400,13 +1400,13 @@ public class L2NpcInstance extends L2Character
{
// if (canInteract(player))
// {
if (isBusy() && (getBusyMessage().length() > 0))
if (_isBusy && (_busyMessage.length() > 0))
{
player.sendPacket(ActionFailed.STATIC_PACKET);
NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
html.setFile("/data/html/npcbusy.htm");
html.replace("%busymessage%", getBusyMessage());
html.replace("%busymessage%", _busyMessage);
html.replace("%npcname%", getName());
html.replace("%playername%", player.getName());
player.sendPacket(html);
@@ -2464,7 +2464,7 @@ public class L2NpcInstance extends L2Character
*/
public void makeCPRecovery(L2PcInstance player)
{
if ((getNpcId() != 31225) && (getNpcId() != 31226))
if ((getTemplate().npcId != 31225) && (getTemplate().npcId != 31226))
{
return;
}
@@ -3277,7 +3277,7 @@ public class L2NpcInstance extends L2Character
@Override
public void onDecay()
{
if (isDecayed())
if (_isDecayed)
{
return;
}
@@ -3385,7 +3385,7 @@ public class L2NpcInstance extends L2Character
*/
public void endDecayTask()
{
if (!isDecayed())
if (!_isDecayed)
{
DecayTaskManager.getInstance().cancelDecayTask(this);
onDecay();
@@ -552,7 +552,7 @@ public final class L2PcInstance extends L2Playable
private boolean _inCrystallize;
/** The _in craft mode. */
private boolean _inCraftMode;
private boolean _isCrafting;
/** The table containing all L2RecipeList of the L2PcInstance. */
private final Map<Integer, L2RecipeList> _dwarvenRecipeBook = new HashMap<>();
@@ -1955,24 +1955,22 @@ public final class L2PcInstance extends L2Playable
return getPrivateStoreType() > 0;
}
// public boolean isInCraftMode() { return (getPrivateStoreType() == STORE_PRIVATE_MANUFACTURE); }
/**
* Checks if is in craft mode.
* @return true, if is in craft mode
*/
public boolean isInCraftMode()
public boolean isCrafting()
{
return _inCraftMode;
return _isCrafting;
}
/**
* Checks if is in craft mode.
* @param b the b
* @param isCrafting
*/
public void isInCraftMode(boolean b)
public void setIsCrafting(boolean isCrafting)
{
_inCraftMode = b;
_isCrafting = isCrafting;
}
/** The _kicked. */
@@ -1995,7 +1993,6 @@ public final class L2PcInstance extends L2Playable
_kicked = kicked;
closeNetConnection();
}
/**
@@ -68,10 +68,10 @@ public class L2PetInstance extends L2Summon
// private byte _pvpFlag;
/** The _cur fed. */
private int _curFed;
int _curFed;
/** The _inventory. */
private final PetInventory _inventory;
final PetInventory _inventory;
/** The _control item id. */
private final int _controlItemId;
@@ -160,10 +160,10 @@ public class L2PetInstance extends L2Summon
}
}
if (getCurrentFed() > FOOD_ITEM_CONSUME_COUNT)
if (_curFed > FOOD_ITEM_CONSUME_COUNT)
{
// eat
setCurrentFed(getCurrentFed() - FOOD_ITEM_CONSUME_COUNT);
setCurrentFed(_curFed - FOOD_ITEM_CONSUME_COUNT);
}
else
{
@@ -181,13 +181,13 @@ public class L2PetInstance extends L2Summon
}
L2ItemInstance food = null;
food = getInventory().getItemByItemId(foodId);
food = _inventory.getItemByItemId(foodId);
if ((food != null) && (getCurrentFed() < (0.55 * getMaxFed())))
if ((food != null) && (_curFed < (0.55 * getStat().getMaxFeed())))
{
if (destroyItem("Feed", food.getObjectId(), 1, null, false))
{
setCurrentFed(getCurrentFed() + 100);
setCurrentFed(_curFed + 100);
if (getOwner() != null)
{
SystemMessage sm = new SystemMessage(SystemMessageId.PET_TOOK_S1_BECAUSE_HE_WAS_HUNGRY);
@@ -291,7 +291,7 @@ public class L2PetInstance extends L2Summon
@Override
public double getLevelMod()
{
return ((100.0 - 11) + getLevel()) / 100.0;
return ((100.0 - 11) + getStat().getLevel()) / 100.0;
}
/**
@@ -380,7 +380,7 @@ public class L2PetInstance extends L2Summon
*/
public void setCurrentFed(int num)
{
_curFed = num > getMaxFed() ? getMaxFed() : num;
_curFed = num > getStat().getMaxFeed() ? getStat().getMaxFeed() : num;
}
// public void setPvpFlag(byte pvpFlag) { _pvpFlag = pvpFlag; }
@@ -402,7 +402,7 @@ public class L2PetInstance extends L2Summon
@Override
public L2ItemInstance getActiveWeaponInstance()
{
for (L2ItemInstance item : getInventory().getItems())
for (L2ItemInstance item : _inventory.getItems())
{
if ((item.getLocation() == L2ItemInstance.ItemLocation.PET_EQUIP) && (item.getItem().getBodyPart() == L2Item.SLOT_R_HAND))
{
@@ -641,7 +641,7 @@ public class L2PetInstance extends L2Summon
}
}
getInventory().addItem("Pickup", target, getOwner(), this);
_inventory.addItem("Pickup", target, getOwner(), this);
// FIXME Just send the updates if possible (old way wasn't working though)
PetItemList iu = new PetItemList(this);
getOwner().sendPacket(iu);
@@ -689,9 +689,9 @@ public class L2PetInstance extends L2Summon
@Override
public void doRevive()
{
if (_curFed > (getMaxFed() / 10))
if (_curFed > (getStat().getMaxFeed() / 10))
{
_curFed = getMaxFed() / 10;
_curFed = getStat().getMaxFeed() / 10;
}
getOwner().removeReviving();
@@ -728,8 +728,8 @@ public class L2PetInstance extends L2Summon
*/
public L2ItemInstance transferItem(String process, int objectId, int count, Inventory target, L2PcInstance actor, L2Object reference)
{
L2ItemInstance oldItem = getInventory().getItemByObjectId(objectId);
final L2ItemInstance newItem = getInventory().transferItem(process, objectId, count, target, actor, reference);
L2ItemInstance oldItem = _inventory.getItemByObjectId(objectId);
final L2ItemInstance newItem = _inventory.transferItem(process, objectId, count, target, actor, reference);
if (newItem == null)
{
@@ -794,7 +794,7 @@ public class L2PetInstance extends L2Summon
{
try
{
Inventory petInventory = getInventory();
Inventory petInventory = _inventory;
L2ItemInstance[] items = petInventory.getItems();
for (L2ItemInstance item : items)
{
@@ -850,7 +850,7 @@ public class L2PetInstance extends L2Summon
// delete from inventory
try
{
L2ItemInstance removedItem = owner.getInventory().destroyItem("PetDestroy", getControlItemId(), 1, getOwner(), this);
L2ItemInstance removedItem = owner.getInventory().destroyItem("PetDestroy", _controlItemId, 1, getOwner(), this);
InventoryUpdate iu = new InventoryUpdate();
iu.addRemovedItem(removedItem);
@@ -874,7 +874,7 @@ public class L2PetInstance extends L2Summon
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("DELETE FROM pets WHERE item_obj_id=?");
statement.setInt(1, getControlItemId());
statement.setInt(1, _controlItemId);
statement.execute();
statement.close();
}
@@ -891,7 +891,7 @@ public class L2PetInstance extends L2Summon
{
try
{
L2ItemInstance[] items = getInventory().getItems();
L2ItemInstance[] items = _inventory.getItems();
for (L2ItemInstance item : items)
{
dropItemHere(item);
@@ -919,7 +919,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)
{
@@ -1032,14 +1032,14 @@ public class L2PetInstance extends L2Summon
@Override
public void store()
{
if (getControlItemId() == 0)
if (_controlItemId == 0)
{
// this is a summon, not a pet, don't store anything
return;
}
String req;
if (!isRespawned())
if (!_respawned)
{
req = "INSERT INTO pets (name,level,curHp,curMp,exp,sp,karma,pkkills,fed,item_obj_id) VALUES (?,?,?,?,?,?,?,?,?,?)";
}
@@ -1059,8 +1059,8 @@ public class L2PetInstance extends L2Summon
statement.setInt(6, getStat().getSp());
statement.setInt(7, getKarma());
statement.setInt(8, getPkKills());
statement.setInt(9, getCurrentFed());
statement.setInt(10, getControlItemId());
statement.setInt(9, _curFed);
statement.setInt(10, _controlItemId);
statement.executeUpdate();
statement.close();
_respawned = true;
@@ -1201,7 +1201,7 @@ public class L2PetInstance extends L2Summon
@Override
public long getExpForThisLevel()
{
return getStat().getExpForLevel(getLevel());
return getStat().getExpForLevel(getStat().getLevel());
}
/*
@@ -1211,7 +1211,7 @@ public class L2PetInstance extends L2Summon
@Override
public long getExpForNextLevel()
{
return getStat().getExpForLevel(getLevel() + 1);
return getStat().getExpForLevel(getStat().getLevel() + 1);
}
/*
@@ -1344,7 +1344,7 @@ public class L2PetInstance extends L2Summon
{
return 0;
}
final int lvl = getLevel();
final int lvl = getStat().getLevel();
return lvl > 70 ? 7 + ((lvl - 70) / 5) : lvl / 10;
}
@@ -140,7 +140,7 @@ public class L2StaticObjectInstance extends L2Object
{
if (_type < 0)
{
LOGGER.info("L2StaticObjectInstance: StaticObject with invalid type! StaticObjectId: " + getStaticObjectId());
LOGGER.info("L2StaticObjectInstance: StaticObject with invalid type! StaticObjectId: " + _staticObjectId);
}
// Check if the L2PcInstance already target the L2NpcInstance
if (this != player.getTarget())
@@ -82,9 +82,9 @@ public class AttackableKnownList extends NpcKnownList
@Override
public int getDistanceToForgetObject(L2Object object)
{
if (getActiveChar().getAggroListRP() != null)
if (getActiveChar().getAggroList() != null)
{
if (getActiveChar().getAggroListRP().get(object) != null)
if (getActiveChar().getAggroList().get(object) != null)
{
return 3000;
}
@@ -51,7 +51,7 @@ public class ObjectKnownList
public boolean addKnownObject(L2Object object, L2Character dropper)
{
if ((object == null) || (object == getActiveObject()))
if ((object == null) || (object == _activeObject))
{
return false;
}
@@ -67,7 +67,7 @@ public class ObjectKnownList
}
// Check if object is not inside distance to watch object
if (!Util.checkIfInRange(getDistanceToWatchObject(object), getActiveObject(), object, true))
if (!Util.checkIfInRange(getDistanceToWatchObject(object), _activeObject, object, true))
{
return false;
}
@@ -82,7 +82,7 @@ public class ObjectKnownList
return false;
}
return (getActiveObject() == object) || getKnownObjects().containsKey(object.getObjectId());
return (_activeObject == object) || getKnownObjects().containsKey(object.getObjectId());
}
/** Remove all L2Object from _knownObjects */
@@ -114,7 +114,7 @@ public class ObjectKnownList
public final synchronized void updateKnownObjects()
{
// Only bother updating knownobjects for L2Character; don't for L2Object
if (getActiveObject() instanceof L2Character)
if (_activeObject instanceof L2Character)
{
findCloseObjects();
forgetObjects();
@@ -125,7 +125,7 @@ public class ObjectKnownList
// Method - Private
private final void findCloseObjects()
{
final boolean isActiveObjectPlayable = getActiveObject() instanceof L2Playable;
final boolean isActiveObjectPlayable = _activeObject instanceof L2Playable;
if (isActiveObjectPlayable)
{
@@ -152,7 +152,7 @@ public class ObjectKnownList
// Only if object is a L2Character and active object is a L2PlayableInstance
if (object instanceof L2Character)
{
object.getKnownList().addKnownObject(getActiveObject());
object.getKnownList().addKnownObject(_activeObject);
}
}
}
@@ -201,17 +201,17 @@ public class ObjectKnownList
// Remove all invisible object
// Remove all too far object
if (!object.isVisible() || !Util.checkIfInRange(getDistanceToForgetObject(object), getActiveObject(), object, true))
if (!object.isVisible() || !Util.checkIfInRange(getDistanceToForgetObject(object), _activeObject, object, true))
{
if ((object instanceof L2BoatInstance) && (getActiveObject() instanceof L2PcInstance))
if ((object instanceof L2BoatInstance) && (_activeObject instanceof L2PcInstance))
{
if (((L2BoatInstance) object).getVehicleDeparture() == null)
{
//
}
else if (((L2PcInstance) getActiveObject()).isInBoat())
else if (((L2PcInstance) _activeObject).isInBoat())
{
if (((L2PcInstance) getActiveObject()).getBoat() == object)
if (((L2PcInstance) _activeObject).getBoat() == object)
{
//
}
@@ -53,7 +53,7 @@ public class ObjectPoly
public final boolean isMorphed()
{
return getPolyType() != null;
return _polyType != null;
}
public final int getPolyId()
@@ -98,18 +98,18 @@ public class ObjectPosition
}
catch (Exception e)
{
LOGGER.warning("Object Id at bad coords: (x: " + getX() + ", y: " + getY() + ", z: " + getZ() + ").");
LOGGER.warning("Object Id at bad coords: (x: " + getWorldPosition().getX() + ", y: " + getWorldPosition().getY() + ", z: " + getWorldPosition().getZ() + ").");
if (getActiveObject() instanceof L2PcInstance)
if (_activeObject instanceof L2PcInstance)
{
// ((L2PcInstance)obj).deleteMe();
((L2PcInstance) getActiveObject()).teleToLocation(0, 0, 0, false);
((L2PcInstance) getActiveObject()).sendMessage("Error with your coords, Please ask a GM for help!");
((L2PcInstance) _activeObject).teleToLocation(0, 0, 0, false);
((L2PcInstance) _activeObject).sendMessage("Error with your coords, Please ask a GM for help!");
}
else if (getActiveObject() instanceof L2Character)
else if (_activeObject instanceof L2Character)
{
getActiveObject().decayMe();
_activeObject.decayMe();
}
}
}
@@ -160,7 +160,7 @@ public class ObjectPosition
}
setWorldPosition(x, y, z);
getActiveObject().setIsVisible(false);
_activeObject.setIsVisible(false);
}
/**
@@ -168,7 +168,7 @@ public class ObjectPosition
*/
public void updateWorldRegion()
{
if (!getActiveObject().isVisible())
if (!_activeObject.isVisible())
{
return;
}
@@ -176,12 +176,12 @@ public class ObjectPosition
L2WorldRegion newRegion = L2World.getInstance().getRegion(getWorldPosition());
if (newRegion != getWorldRegion())
{
getWorldRegion().removeVisibleObject(getActiveObject());
getWorldRegion().removeVisibleObject(_activeObject);
setWorldRegion(newRegion);
// Add the L2Oject spawn to _visibleObjects and if necessary to _allplayers of its L2WorldRegion
getWorldRegion().addVisibleObject(getActiveObject());
getWorldRegion().addVisibleObject(_activeObject);
}
}
@@ -48,16 +48,16 @@ public class CharStatus
// =========================================================
// Data Field
/** The _active char. */
private final L2Character _activeChar;
final L2Character _activeChar;
/** The _current cp. */
private double _currentCp = 0; // Current CP of the L2Character
double _currentCp = 0; // Current CP of the L2Character
/** The _current hp. */
private double _currentHp = 0; // Current HP of the L2Character
double _currentHp = 0; // Current HP of the L2Character
/** The _current mp. */
private double _currentMp = 0; // Current MP of the L2Character
double _currentMp = 0; // Current MP of the L2Character
/** Array containing all clients that need to be notified about hp/mp updates of the L2Character. */
private Set<L2Character> _StatusListener;
@@ -104,7 +104,7 @@ public class CharStatus
*/
public final void addStatusListener(L2Character object)
{
if (object == getActiveChar())
if (object == _activeChar)
{
return;
}
@@ -121,9 +121,9 @@ public class CharStatus
*/
public final void reduceCp(int value)
{
if (getCurrentCp() > value)
if (_currentCp > value)
{
setCurrentCp(getCurrentCp() - value);
setCurrentCp(_currentCp - value);
}
else
{
@@ -154,94 +154,94 @@ public class CharStatus
*/
public void reduceHp(double value, L2Character attacker, boolean awake)
{
if (getActiveChar().isInvul())
if (_activeChar.isInvul())
{
return;
}
if (getActiveChar() instanceof L2PcInstance)
if (_activeChar instanceof L2PcInstance)
{
if (((L2PcInstance) getActiveChar()).isInDuel())
if (((L2PcInstance) _activeChar).isInDuel())
{
// the duel is finishing - players do not recive damage
if (((L2PcInstance) getActiveChar()).getDuelState() == Duel.DUELSTATE_DEAD)
if (((L2PcInstance) _activeChar).getDuelState() == Duel.DUELSTATE_DEAD)
{
return;
}
else if (((L2PcInstance) getActiveChar()).getDuelState() == Duel.DUELSTATE_WINNER)
else if (((L2PcInstance) _activeChar).getDuelState() == Duel.DUELSTATE_WINNER)
{
return;
}
// cancel duel if player got hit by another player, that is not part of the duel or a monster
if (!(attacker instanceof L2SummonInstance) && (!(attacker instanceof L2PcInstance) || (((L2PcInstance) attacker).getDuelId() != ((L2PcInstance) getActiveChar()).getDuelId())))
if (!(attacker instanceof L2SummonInstance) && (!(attacker instanceof L2PcInstance) || (((L2PcInstance) attacker).getDuelId() != ((L2PcInstance) _activeChar).getDuelId())))
{
((L2PcInstance) getActiveChar()).setDuelState(Duel.DUELSTATE_INTERRUPTED);
((L2PcInstance) _activeChar).setDuelState(Duel.DUELSTATE_INTERRUPTED);
}
}
if (getActiveChar().isDead() && !getActiveChar().isFakeDeath())
if (_activeChar.isDead() && !_activeChar.isFakeDeath())
{
return; // Disabled == null check so skills like Body to Mind work again untill another solution is found
}
}
else
{
if (getActiveChar().isDead())
if (_activeChar.isDead())
{
return; // Disabled == null check so skills like Body to Mind work again untill another solution is found
}
if ((attacker instanceof L2PcInstance) && ((L2PcInstance) attacker).isInDuel() && (!(getActiveChar() instanceof L2SummonInstance) || (((L2SummonInstance) getActiveChar()).getOwner().getDuelId() != ((L2PcInstance) attacker).getDuelId()))) // Duelling player attacks mob
if ((attacker instanceof L2PcInstance) && ((L2PcInstance) attacker).isInDuel() && (!(_activeChar instanceof L2SummonInstance) || (((L2SummonInstance) _activeChar).getOwner().getDuelId() != ((L2PcInstance) attacker).getDuelId()))) // Duelling player attacks mob
{
((L2PcInstance) attacker).setDuelState(Duel.DUELSTATE_INTERRUPTED);
}
}
if (awake && getActiveChar().isSleeping())
if (awake && _activeChar.isSleeping())
{
getActiveChar().stopSleeping(null);
_activeChar.stopSleeping(null);
}
if (awake && getActiveChar().isImmobileUntilAttacked())
if (awake && _activeChar.isImmobileUntilAttacked())
{
getActiveChar().stopImmobileUntilAttacked(null);
_activeChar.stopImmobileUntilAttacked(null);
}
if (getActiveChar().isStunned() && (Rnd.get(10) == 0))
if (_activeChar.isStunned() && (Rnd.get(10) == 0))
{
getActiveChar().stopStunning(null);
_activeChar.stopStunning(null);
}
// Add attackers to npc's attacker list
if (getActiveChar() instanceof L2NpcInstance)
if (_activeChar instanceof L2NpcInstance)
{
getActiveChar().addAttackerToAttackByList(attacker);
_activeChar.addAttackerToAttackByList(attacker);
}
if (value > 0) // Reduce Hp if any
{
// If we're dealing with an L2Attackable Instance and the attacker hit it with an over-hit enabled skill, set the over-hit values.
// Anything else, clear the over-hit flag
if (getActiveChar() instanceof L2Attackable)
if (_activeChar instanceof L2Attackable)
{
if (((L2Attackable) getActiveChar()).isOverhit())
if (((L2Attackable) _activeChar).isOverhit())
{
((L2Attackable) getActiveChar()).setOverhitValues(attacker, value);
((L2Attackable) _activeChar).setOverhitValues(attacker, value);
}
else
{
((L2Attackable) getActiveChar()).overhitEnabled(false);
((L2Attackable) _activeChar).overhitEnabled(false);
}
}
value = getCurrentHp() - value; // Get diff of Hp vs value
value = _currentHp - value; // Get diff of Hp vs value
if (value <= 0)
{
// is the dieing one a duelist? if so change his duel state to dead
if ((getActiveChar() instanceof L2PcInstance) && ((L2PcInstance) getActiveChar()).isInDuel())
if ((_activeChar instanceof L2PcInstance) && ((L2PcInstance) _activeChar).isInDuel())
{
getActiveChar().disableAllSkills();
_activeChar.disableAllSkills();
stopHpMpRegeneration();
attacker.getAI().setIntention(CtrlIntention.AI_INTENTION_ACTIVE);
attacker.sendPacket(ActionFailed.STATIC_PACKET);
@@ -259,19 +259,19 @@ public class CharStatus
setCurrentHp(value); // Set Hp
}
else // If we're dealing with an L2Attackable Instance and the attacker's hit didn't kill the mob, clear the over-hit flag
if (getActiveChar() instanceof L2Attackable)
if (_activeChar instanceof L2Attackable)
{
((L2Attackable) getActiveChar()).overhitEnabled(false);
((L2Attackable) _activeChar).overhitEnabled(false);
}
if (getActiveChar().isDead())
if (_activeChar.isDead())
{
getActiveChar().abortAttack();
getActiveChar().abortCast();
_activeChar.abortAttack();
_activeChar.abortCast();
if (getActiveChar() instanceof L2PcInstance)
if (_activeChar instanceof L2PcInstance)
{
if (((L2PcInstance) getActiveChar()).isInOlympiadMode())
if (((L2PcInstance) _activeChar).isInOlympiadMode())
{
stopHpMpRegeneration();
return;
@@ -286,15 +286,15 @@ public class CharStatus
}
// Start the doDie process
getActiveChar().doDie(attacker);
_activeChar.doDie(attacker);
// now reset currentHp to zero
setCurrentHp(0);
}
else // If we're dealing with an L2Attackable Instance and the attacker's hit didn't kill the mob, clear the over-hit flag
if (getActiveChar() instanceof L2Attackable)
if (_activeChar instanceof L2Attackable)
{
((L2Attackable) getActiveChar()).overhitEnabled(false);
((L2Attackable) _activeChar).overhitEnabled(false);
}
}
@@ -304,7 +304,7 @@ public class CharStatus
*/
public final void reduceMp(double value)
{
value = getCurrentMp() - value;
value = _currentMp - value;
if (value < 0)
{
@@ -347,7 +347,7 @@ public class CharStatus
*/
public final synchronized void startHpMpRegeneration()
{
if ((_regTask == null) && !getActiveChar().isDead())
if ((_regTask == null) && !_activeChar.isDead())
{
if (Config.DEBUG)
{
@@ -355,7 +355,7 @@ public class CharStatus
}
// Get the Regeneration periode
final int period = Formulas.getRegeneratePeriod(getActiveChar());
final int period = Formulas.getRegeneratePeriod(_activeChar);
// Create the HP/MP/CP Regeneration task
_regTask = ThreadPool.scheduleAtFixedRate(new RegenTask(), period, period);
@@ -451,7 +451,7 @@ public class CharStatus
synchronized (this)
{
// Get the Max CP of the L2Character
final int maxCp = getActiveChar().getStat().getMaxCp();
final int maxCp = _activeChar.getStat().getMaxCp();
if (newCp < 0)
{
@@ -484,7 +484,7 @@ public class CharStatus
// Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
if (broadcastPacket)
{
getActiveChar().broadcastStatusUpdate();
_activeChar.broadcastStatusUpdate();
}
}
@@ -545,14 +545,14 @@ public class CharStatus
synchronized (this)
{
// Get the Max HP of the L2Character
final double maxHp = getActiveChar().getStat().getMaxHp();
final double maxHp = _activeChar.getStat().getMaxHp();
if ((newHp >= maxHp) && !direct)
{
// Set the RegenActive flag to false
_currentHp = maxHp;
_flagsRegenActive &= ~REGEN_FLAG_HP;
getActiveChar().setIsKilledAlready(false);
_activeChar.setIsKilledAlready(false);
// Stop the HP/MP/CP Regeneration task
if (_flagsRegenActive == 0)
@@ -566,9 +566,9 @@ public class CharStatus
_currentHp = newHp;
_flagsRegenActive |= REGEN_FLAG_HP;
if (!getActiveChar().isDead())
if (!_activeChar.isDead())
{
getActiveChar().setIsKilledAlready(false);
_activeChar.setIsKilledAlready(false);
}
// Start the HP/MP/CP Regeneration task with Medium priority
@@ -580,7 +580,7 @@ public class CharStatus
// Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
if (broadcastPacket)
{
getActiveChar().broadcastStatusUpdate();
_activeChar.broadcastStatusUpdate();
}
}
@@ -634,7 +634,7 @@ public class CharStatus
synchronized (this)
{
// Get the Max MP of the L2Character
final int maxMp = getActiveChar().getStat().getMaxMp();
final int maxMp = _activeChar.getStat().getMaxMp();
if ((newMp >= maxMp) && !direct)
{
@@ -662,7 +662,7 @@ public class CharStatus
// Send the Server->Client packet StatusUpdate with current HP and MP to all other L2PcInstance to inform
if (broadcastPacket)
{
getActiveChar().broadcastStatusUpdate();
_activeChar.broadcastStatusUpdate();
}
}
@@ -703,43 +703,43 @@ public class CharStatus
{
try
{
final CharStat charstat = getActiveChar().getStat();
final CharStat charstat = _activeChar.getStat();
// Modify the current CP of the L2Character and broadcast Server->Client packet StatusUpdate
if (getCurrentCp() < charstat.getMaxCp())
if (_currentCp < charstat.getMaxCp())
{
setCurrentCp(getCurrentCp() + Formulas.calcCpRegen(getActiveChar()), false);
setCurrentCp(_currentCp + Formulas.calcCpRegen(_activeChar), false);
}
// Modify the current HP of the L2Character and broadcast Server->Client packet StatusUpdate
if (getCurrentHp() < charstat.getMaxHp())
if (_currentHp < charstat.getMaxHp())
{
setCurrentHp(getCurrentHp() + Formulas.calcHpRegen(getActiveChar()), false);
setCurrentHp(_currentHp + Formulas.calcHpRegen(_activeChar), false);
}
// Modify the current MP of the L2Character and broadcast Server->Client packet StatusUpdate
if (getCurrentMp() < charstat.getMaxMp())
if (_currentMp < charstat.getMaxMp())
{
setCurrentMp(getCurrentMp() + Formulas.calcMpRegen(getActiveChar()), false);
setCurrentMp(_currentMp + Formulas.calcMpRegen(_activeChar), false);
}
if (!getActiveChar().isInActiveRegion())
if (!_activeChar.isInActiveRegion())
{
// no broadcast necessary for characters that are in inactive regions.
// stop regeneration for characters who are filled up and in an inactive region.
if ((getCurrentCp() == charstat.getMaxCp()) && (getCurrentHp() == charstat.getMaxHp()) && (getCurrentMp() == charstat.getMaxMp()))
if ((_currentCp == charstat.getMaxCp()) && (_currentHp == charstat.getMaxHp()) && (_currentMp == charstat.getMaxMp()))
{
stopHpMpRegeneration();
}
}
else
{
getActiveChar().broadcastStatusUpdate(); // send the StatusUpdate packet
_activeChar.broadcastStatusUpdate(); // send the StatusUpdate packet
}
}
catch (Throwable e)
{
LOGGER.warning("RegenTask failed for " + getActiveChar().getName() + " " + e);
LOGGER.warning("RegenTask failed for " + _activeChar.getName() + " " + e);
}
}
}
@@ -125,7 +125,7 @@ public final class SubClass
public void incLevel()
{
if (getLevel() == (Config.MAX_SUBCLASS_LEVEL - 1))
if (_level == (Config.MAX_SUBCLASS_LEVEL - 1))
{
return;
}
@@ -135,7 +135,7 @@ public final class SubClass
public void decLevel()
{
if (getLevel() == Config.BASE_SUBCLASS_LEVEL)
if (_level == Config.BASE_SUBCLASS_LEVEL)
{
return;
}
@@ -272,7 +272,7 @@ public class Auction
ResultSet rs;
statement = con.prepareStatement("Select * from auction where id = ?");
statement.setInt(1, getId());
statement.setInt(1, _id);
rs = statement.executeQuery();
while (rs.next())
@@ -314,7 +314,7 @@ public class Auction
ResultSet rs;
statement = con.prepareStatement("SELECT bidderId, bidderName, maxBid, clan_name, time_bid FROM auction_bid WHERE auctionId = ? ORDER BY maxBid DESC");
statement.setInt(1, getId());
statement.setInt(1, _id);
rs = statement.executeQuery();
while (rs.next())
@@ -397,12 +397,12 @@ public class Auction
{
int requiredAdena = bid;
if (getHighestBidderName().equals(bidder.getClan().getLeaderName()))
if (_highestBidderName.equals(bidder.getClan().getLeaderName()))
{
requiredAdena = bid - getHighestBidderMaxBid();
requiredAdena = bid - _highestBidderMaxBid;
}
if (((getHighestBidderId() > 0) && (bid > getHighestBidderMaxBid())) || ((getHighestBidderId() == 0) && (bid >= getStartingBid())))
if (((_highestBidderId > 0) && (bid > _highestBidderMaxBid)) || ((_highestBidderId == 0) && (bid >= _startingBid)))
{
if (takeItem(bidder, requiredAdena))
{
@@ -411,7 +411,7 @@ public class Auction
return;
}
}
if ((bid < getStartingBid()) || (bid <= getHighestBidderMaxBid()))
if ((bid < _startingBid) || (bid <= _highestBidderMaxBid))
{
bidder.sendMessage("Bid Price must be higher");
}
@@ -465,14 +465,14 @@ public class Auction
{
PreparedStatement statement;
if (getBidders().get(bidder.getClanId()) != null)
if (_bidders.get(bidder.getClanId()) != null)
{
statement = con.prepareStatement("UPDATE auction_bid SET bidderId=?, bidderName=?, maxBid=?, time_bid=? WHERE auctionId=? AND bidderId=?");
statement.setInt(1, bidder.getClanId());
statement.setString(2, bidder.getClan().getLeaderName());
statement.setInt(3, bid);
statement.setLong(4, System.currentTimeMillis());
statement.setInt(5, getId());
statement.setInt(5, _id);
statement.setInt(6, bidder.getClanId());
statement.execute();
statement.close();
@@ -481,7 +481,7 @@ public class Auction
{
statement = con.prepareStatement("INSERT INTO auction_bid (id, auctionId, bidderId, bidderName, maxBid, clan_name, time_bid) VALUES (?, ?, ?, ?, ?, ?, ?)");
statement.setInt(1, IdFactory.getInstance().getNextId());
statement.setInt(2, getId());
statement.setInt(2, _id);
statement.setInt(3, bidder.getClanId());
statement.setString(4, bidder.getName());
statement.setInt(5, bid);
@@ -528,7 +528,7 @@ public class Auction
PreparedStatement statement;
statement = con.prepareStatement("DELETE FROM auction_bid WHERE auctionId=?");
statement.setInt(1, getId());
statement.setInt(1, _id);
statement.execute();
statement.close();
@@ -628,7 +628,7 @@ public class Auction
PreparedStatement statement;
statement = con.prepareStatement("DELETE FROM auction_bid WHERE auctionId=? AND bidderId=?");
statement.setInt(1, getId());
statement.setInt(1, _id);
statement.setInt(2, bidder);
statement.execute();
@@ -664,7 +664,7 @@ public class Auction
{
PreparedStatement statement;
statement = con.prepareStatement("INSERT INTO auction (id, sellerId, sellerName, sellerClanName, itemType, itemId, itemObjectId, itemName, itemQuantity, startingBid, currentBid, endDate) VALUES (?,?,?,?,?,?,?,?,?,?,?,?)");
statement.setInt(1, getId());
statement.setInt(1, _id);
statement.setInt(2, _sellerId);
statement.setString(3, _sellerName);
statement.setString(4, _sellerClanName);
@@ -49,7 +49,7 @@ public class ClanHall
protected static final Logger LOGGER = Logger.getLogger(ClanHall.class.getName());
/** The _clan hall id. */
private final int _clanHallId;
final int _clanHallId;
/** The _doors. */
private final List<L2DoorInstance> _doors = new ArrayList<>();
@@ -58,7 +58,7 @@ public class ClanHall
private final List<String> _doorDefault = new ArrayList<>();
/** The _name. */
private final String _name;
final String _name;
/** The _owner id. */
private int _ownerId;
@@ -126,7 +126,7 @@ public class ClanHall
public class ClanHallFunction
{
/** The _type. */
private final int _type;
final int _type;
/** The _lvl. */
private int _lvl;
@@ -138,10 +138,10 @@ public class ClanHall
protected int _tempFee;
/** The _rate. */
private final long _rate;
final long _rate;
/** The _end date. */
private long _endDate;
long _endDate;
/** The _in debt. */
protected boolean _inDebt;
@@ -291,9 +291,9 @@ public class ClanHall
int fee = _fee;
boolean newfc = true;
if ((getEndTime() == 0) || (getEndTime() == -1))
if ((_endDate == 0) || (_endDate == -1))
{
if (getEndTime() == -1)
if (_endDate == -1)
{
newfc = false;
fee = _tempFee;
@@ -304,20 +304,20 @@ public class ClanHall
newfc = false;
}
setEndTime(System.currentTimeMillis() + getRate());
setEndTime(System.currentTimeMillis() + _rate);
dbSave(newfc);
getOwnerClan().getWarehouse().destroyItemByItemId("CH_function_fee", 57, fee, null, null);
if (Config.DEBUG)
{
LOGGER.warning("deducted " + fee + " adena from " + getName() + " owner's cwh for function id : " + getType());
LOGGER.warning("deducted " + fee + " adena from " + _name + " owner's cwh for function id : " + _type);
}
ThreadPool.schedule(new FunctionTask(), getRate());
ThreadPool.schedule(new FunctionTask(), _rate);
}
else
{
removeFunction(getType());
removeFunction(_type);
}
}
catch (Throwable t)
@@ -339,21 +339,21 @@ public class ClanHall
if (newFunction)
{
statement = con.prepareStatement("INSERT INTO clanhall_functions (hall_id, type, lvl, lease, rate, endTime) VALUES (?,?,?,?,?,?)");
statement.setInt(1, getId());
statement.setInt(2, getType());
statement.setInt(3, getLvl());
statement.setInt(4, getLease());
statement.setLong(5, getRate());
statement.setLong(6, getEndTime());
statement.setInt(1, _clanHallId);
statement.setInt(2, _type);
statement.setInt(3, _lvl);
statement.setInt(4, _fee);
statement.setLong(5, _rate);
statement.setLong(6, _endDate);
}
else
{
statement = con.prepareStatement("UPDATE clanhall_functions SET lvl=?, lease=?, endTime=? WHERE hall_id=? AND type=?");
statement.setInt(1, getLvl());
statement.setInt(2, getLease());
statement.setLong(3, getEndTime());
statement.setInt(4, getId());
statement.setInt(5, getType());
statement.setInt(1, _lvl);
statement.setInt(2, _fee);
statement.setLong(3, _endDate);
statement.setInt(4, _clanHallId);
statement.setInt(5, _type);
}
statement.execute();
statement.close();
@@ -644,7 +644,7 @@ public 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);
}
@@ -687,7 +687,7 @@ public class ClanHall
*/
public void openCloseDoors(L2PcInstance activeChar, boolean open)
{
if ((activeChar != null) && (activeChar.getClanId() == getOwnerId()))
if ((activeChar != null) && (activeChar.getClanId() == _ownerId))
{
openCloseDoors(open);
}
@@ -720,7 +720,7 @@ public class ClanHall
*/
public void banishForeigners()
{
_zone.banishForeigners(getOwnerId());
_zone.banishForeigners(_ownerId);
}
/**
@@ -733,7 +733,7 @@ public class ClanHall
PreparedStatement statement;
ResultSet rs;
statement = con.prepareStatement("Select * from clanhall_functions where hall_id = ?");
statement.setInt(1, getId());
statement.setInt(1, _clanHallId);
rs = statement.executeQuery();
while (rs.next())
@@ -761,7 +761,7 @@ public class ClanHall
{
PreparedStatement statement;
statement = con.prepareStatement("DELETE FROM clanhall_functions WHERE hall_id=? AND type=?");
statement.setInt(1, getId());
statement.setInt(1, _clanHallId);
statement.setInt(2, functionType);
statement.execute();
statement.close();
@@ -785,7 +785,7 @@ public class ClanHall
{
if (Config.DEBUG)
{
LOGGER.warning("Called ClanHall.updateFunctions(int type, int lvl, int lease, long rate, boolean addNew) Owner : " + getOwnerId());
LOGGER.warning("Called ClanHall.updateFunctions(int type, int lvl, int lease, long rate, boolean addNew) Owner : " + _ownerId);
}
if (addNew)
@@ -916,7 +916,7 @@ public class ClanHall
if (Config.DEBUG)
{
LOGGER.warning("deducted " + getLease() + " adena from " + getName() + " owner's cwh for ClanHall _paidUntil" + _paidUntil);
LOGGER.warning("deducted " + getLease() + " adena from " + _name + " owner's cwh for ClanHall _paidUntil" + _paidUntil);
}
ThreadPool.schedule(new FeeTask(), _paidUntil - System.currentTimeMillis());
@@ -972,7 +972,7 @@ public class ClanHall
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Select * from castle_door where castleId = ?");
statement.setInt(1, getId());
statement.setInt(1, _clanHallId);
ResultSet rs = statement.executeQuery();
while (rs.next())
@@ -847,7 +847,7 @@ public class Duel
*/
public L2PcInstance getWinner()
{
if (!getFinished() || (_playerA == null) || (_playerB == null))
if (!_finished || (_playerA == null) || (_playerB == null))
{
return null;
}
@@ -871,7 +871,7 @@ public class Duel
*/
public L2PcInstance getLooser()
{
if (!getFinished() || (_playerA == null) || (_playerB == null))
if (!_finished || (_playerA == null) || (_playerB == null))
{
return null;
}
@@ -155,7 +155,7 @@ public class CTF implements EventTask
*/
public static boolean set_eventName(String _eventName)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._eventName = _eventName;
return true;
@@ -179,7 +179,7 @@ public class CTF implements EventTask
*/
public static boolean set_eventDesc(String _eventDesc)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._eventDesc = _eventDesc;
return true;
@@ -203,7 +203,7 @@ public class CTF implements EventTask
*/
public static boolean set_joiningLocationName(String _joiningLocationName)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._joiningLocationName = _joiningLocationName;
return true;
@@ -227,7 +227,7 @@ public class CTF implements EventTask
*/
public static boolean set_npcId(int _npcId)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._npcId = _npcId;
return true;
@@ -262,7 +262,7 @@ public class CTF implements EventTask
*/
public static boolean set_rewardId(int _rewardId)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._rewardId = _rewardId;
return true;
@@ -286,7 +286,7 @@ public class CTF implements EventTask
*/
public static boolean set_rewardAmount(int _rewardAmount)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._rewardAmount = _rewardAmount;
return true;
@@ -310,7 +310,7 @@ public class CTF implements EventTask
*/
public static boolean set_minlvl(int _minlvl)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._minlvl = _minlvl;
return true;
@@ -334,7 +334,7 @@ public class CTF implements EventTask
*/
public static boolean set_maxlvl(int _maxlvl)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._maxlvl = _maxlvl;
return true;
@@ -358,7 +358,7 @@ public class CTF implements EventTask
*/
public static boolean set_joinTime(int _joinTime)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._joinTime = _joinTime;
return true;
@@ -382,7 +382,7 @@ public class CTF implements EventTask
*/
public static boolean set_eventTime(int _eventTime)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._eventTime = _eventTime;
return true;
@@ -406,7 +406,7 @@ public class CTF implements EventTask
*/
public static boolean set_minPlayers(int _minPlayers)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._minPlayers = _minPlayers;
return true;
@@ -430,7 +430,7 @@ public class CTF implements EventTask
*/
public static boolean set_maxPlayers(int _maxPlayers)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._maxPlayers = _maxPlayers;
return true;
@@ -454,7 +454,7 @@ public class CTF implements EventTask
*/
public static boolean set_intervalBetweenMatches(long _intervalBetweenMatches)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._intervalBetweenMatches = _intervalBetweenMatches;
return true;
@@ -478,7 +478,7 @@ public class CTF implements EventTask
*/
public boolean setStartEventTime(String startEventTime)
{
if (!is_inProgress())
if (!_inProgress)
{
this.startEventTime = startEventTime;
return true;
@@ -2518,7 +2518,7 @@ public class CTF implements EventTask
*/
public static void addTeam(String teamName)
{
if (is_inProgress())
if (_inProgress)
{
if (Config.DEBUG)
{
@@ -2558,7 +2558,7 @@ public class CTF implements EventTask
*/
public static void removeTeam(String teamName)
{
if (is_inProgress() || _teams.isEmpty())
if (_inProgress || _teams.isEmpty())
{
if (Config.DEBUG)
{
@@ -2657,7 +2657,7 @@ public class CTF implements EventTask
*/
public static void setTeamColor(String teamName, int color)
{
if (is_inProgress())
if (_inProgress)
{
return;
}
@@ -2863,7 +2863,7 @@ public class CTF implements EventTask
*/
public static boolean set_eventOffset(int _eventOffset)
{
if (!is_inProgress())
if (!_inProgress)
{
CTF._eventOffset = _eventOffset;
return true;
@@ -122,7 +122,7 @@ public class DM implements EventTask
*/
public static boolean set_eventName(String _eventName)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._eventName = _eventName;
return true;
@@ -146,7 +146,7 @@ public class DM implements EventTask
*/
public static boolean set_eventDesc(String _eventDesc)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._eventDesc = _eventDesc;
return true;
@@ -170,7 +170,7 @@ public class DM implements EventTask
*/
public static boolean set_joiningLocationName(String _joiningLocationName)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._joiningLocationName = _joiningLocationName;
return true;
@@ -194,7 +194,7 @@ public class DM implements EventTask
*/
public static boolean set_npcId(int _npcId)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._npcId = _npcId;
return true;
@@ -229,7 +229,7 @@ public class DM implements EventTask
*/
public static boolean set_rewardId(int _rewardId)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._rewardId = _rewardId;
return true;
@@ -253,7 +253,7 @@ public class DM implements EventTask
*/
public static boolean set_rewardAmount(int _rewardAmount)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._rewardAmount = _rewardAmount;
return true;
@@ -277,7 +277,7 @@ public class DM implements EventTask
*/
public static boolean set_minlvl(int _minlvl)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._minlvl = _minlvl;
return true;
@@ -301,7 +301,7 @@ public class DM implements EventTask
*/
public static boolean set_maxlvl(int _maxlvl)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._maxlvl = _maxlvl;
return true;
@@ -325,7 +325,7 @@ public class DM implements EventTask
*/
public static boolean set_joinTime(int _joinTime)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._joinTime = _joinTime;
return true;
@@ -349,7 +349,7 @@ public class DM implements EventTask
*/
public static boolean set_eventTime(int _eventTime)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._eventTime = _eventTime;
return true;
@@ -373,7 +373,7 @@ public class DM implements EventTask
*/
public static boolean set_minPlayers(int _minPlayers)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._minPlayers = _minPlayers;
return true;
@@ -397,7 +397,7 @@ public class DM implements EventTask
*/
public static boolean set_maxPlayers(int _maxPlayers)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._maxPlayers = _maxPlayers;
return true;
@@ -421,7 +421,7 @@ public class DM implements EventTask
*/
public static boolean set_intervalBetweenMatchs(long _intervalBetweenMatchs)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._intervalBetweenMatchs = _intervalBetweenMatchs;
return true;
@@ -445,7 +445,7 @@ public class DM implements EventTask
*/
public boolean setStartEventTime(String startEventTime)
{
if (!is_inProgress())
if (!_inProgress)
{
this.startEventTime = startEventTime;
return true;
@@ -2022,7 +2022,7 @@ public class DM implements EventTask
*/
public static boolean set_playerColors(int _playerColors)
{
if (!is_inProgress())
if (!_inProgress)
{
DM._playerColors = _playerColors;
return true;
@@ -49,7 +49,7 @@ public class EventPoint
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
final PreparedStatement st = con.prepareStatement("Select * From char_points where charId = ?");
st.setInt(1, getActiveChar().getObjectId());
st.setInt(1, _activeChar.getObjectId());
final ResultSet rst = st.executeQuery();
while (rst.next())
@@ -71,7 +71,7 @@ public class EventPoint
{
final PreparedStatement st = con.prepareStatement("Update char_points Set points = ? Where charId = ?");
st.setInt(1, _points);
st.setInt(2, getActiveChar().getObjectId());
st.setInt(2, _activeChar.getObjectId());
st.execute();
st.close();
}
@@ -99,9 +99,9 @@ public class Lottery
{
PreparedStatement statement;
statement = con.prepareStatement(UPDATE_PRICE);
statement.setInt(1, getPrize());
statement.setInt(2, getPrize());
statement.setInt(3, getId());
statement.setInt(1, _prize);
statement.setInt(2, _prize);
statement.setInt(3, _number);
statement.execute();
statement.close();
}
@@ -187,7 +187,7 @@ public class Lottery
if (Config.DEBUG)
{
LOGGER.info("Lottery: Starting ticket sell for lottery #" + getId() + ".");
LOGGER.info("Lottery: Starting ticket sell for lottery #" + _number + ".");
}
_isSellingTickets = true;
@@ -219,10 +219,10 @@ public class Lottery
{
statement = con.prepareStatement(INSERT_LOTTERY);
statement.setInt(1, 1);
statement.setInt(2, getId());
statement.setLong(3, getEndDate());
statement.setInt(4, getPrize());
statement.setInt(5, getPrize());
statement.setInt(2, _number);
statement.setLong(3, _enddate);
statement.setInt(4, _prize);
statement.setInt(5, _prize);
statement.execute();
statement.close();
}
@@ -245,7 +245,7 @@ public class Lottery
{
if (Config.DEBUG)
{
LOGGER.info("Lottery: Stopping ticket sell for lottery #" + getId() + ".");
LOGGER.info("Lottery: Stopping ticket sell for lottery #" + _number + ".");
}
_isSellingTickets = false;
@@ -266,7 +266,7 @@ public class Lottery
{
if (Config.DEBUG)
{
LOGGER.info("Lottery: Ending lottery #" + getId() + ".");
LOGGER.info("Lottery: Ending lottery #" + _number + ".");
}
final int[] luckynums = new int[5];
@@ -327,7 +327,7 @@ public class Lottery
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
statement = con.prepareStatement(SELECT_LOTTERY_ITEM);
statement.setInt(1, getId());
statement.setInt(1, _number);
ResultSet rset = statement.executeQuery();
while (rset.next())
@@ -394,17 +394,17 @@ public class Lottery
if (count1 > 0)
{
prize1 = (int) (((getPrize() - prize4) * Config.ALT_LOTTERY_5_NUMBER_RATE) / count1);
prize1 = (int) (((_prize - prize4) * Config.ALT_LOTTERY_5_NUMBER_RATE) / count1);
}
if (count2 > 0)
{
prize2 = (int) (((getPrize() - prize4) * Config.ALT_LOTTERY_4_NUMBER_RATE) / count2);
prize2 = (int) (((_prize - prize4) * Config.ALT_LOTTERY_4_NUMBER_RATE) / count2);
}
if (count3 > 0)
{
prize3 = (int) (((getPrize() - prize4) * Config.ALT_LOTTERY_3_NUMBER_RATE) / count3);
prize3 = (int) (((_prize - prize4) * Config.ALT_LOTTERY_3_NUMBER_RATE) / count3);
}
if (Config.DEBUG)
@@ -415,7 +415,7 @@ public class Lottery
LOGGER.info("Lottery: " + count4 + " players with ONE or TWO numbers each win " + prize4 + ".");
}
final int newprize = getPrize() - (prize1 + prize2 + prize3 + prize4);
final int newprize = _prize - (prize1 + prize2 + prize3 + prize4);
if (Config.DEBUG)
{
LOGGER.info("Lottery: Jackpot for next lottery is " + newprize + ".");
@@ -427,8 +427,8 @@ public class Lottery
{
// There are winners.
sm = new SystemMessage(SystemMessageId.AMOUNT_FOR_WINNER_S1_IS_S2_ADENA_WE_HAVE_S3_PRIZE_WINNER);
sm.addNumber(getId());
sm.addNumber(getPrize());
sm.addNumber(_number);
sm.addNumber(_prize);
sm.addNumber(count1);
Announcements.getInstance().announceToAll(sm);
}
@@ -436,22 +436,22 @@ public class Lottery
{
// There are no winners.
sm = new SystemMessage(SystemMessageId.AMOUNT_FOR_LOTTERY_S1_IS_S2_ADENA_NO_WINNER);
sm.addNumber(getId());
sm.addNumber(getPrize());
sm.addNumber(_number);
sm.addNumber(_prize);
Announcements.getInstance().announceToAll(sm);
}
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
statement = con.prepareStatement(UPDATE_LOTTERY);
statement.setInt(1, getPrize());
statement.setInt(1, _prize);
statement.setInt(2, newprize);
statement.setInt(3, enchant);
statement.setInt(4, type2);
statement.setInt(5, prize1);
statement.setInt(6, prize2);
statement.setInt(7, prize3);
statement.setInt(8, getId());
statement.setInt(8, _number);
statement.execute();
statement.close();
}
@@ -133,7 +133,7 @@ public class TvT implements EventTask
*/
public static boolean set_eventName(String _eventName)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._eventName = _eventName;
return true;
@@ -157,7 +157,7 @@ public class TvT implements EventTask
*/
public static boolean set_eventDesc(String _eventDesc)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._eventDesc = _eventDesc;
return true;
@@ -181,7 +181,7 @@ public class TvT implements EventTask
*/
public static boolean set_joiningLocationName(String _joiningLocationName)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._joiningLocationName = _joiningLocationName;
return true;
@@ -205,7 +205,7 @@ public class TvT implements EventTask
*/
public static boolean set_npcId(int _npcId)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._npcId = _npcId;
return true;
@@ -240,7 +240,7 @@ public class TvT implements EventTask
*/
public static boolean set_rewardId(int _rewardId)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._rewardId = _rewardId;
return true;
@@ -264,7 +264,7 @@ public class TvT implements EventTask
*/
public static boolean set_rewardAmount(int _rewardAmount)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._rewardAmount = _rewardAmount;
return true;
@@ -288,7 +288,7 @@ public class TvT implements EventTask
*/
public static boolean set_minlvl(int _minlvl)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._minlvl = _minlvl;
return true;
@@ -312,7 +312,7 @@ public class TvT implements EventTask
*/
public static boolean set_maxlvl(int _maxlvl)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._maxlvl = _maxlvl;
return true;
@@ -336,7 +336,7 @@ public class TvT implements EventTask
*/
public static boolean set_joinTime(int _joinTime)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._joinTime = _joinTime;
return true;
@@ -360,7 +360,7 @@ public class TvT implements EventTask
*/
public static boolean set_eventTime(int _eventTime)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._eventTime = _eventTime;
return true;
@@ -384,7 +384,7 @@ public class TvT implements EventTask
*/
public static boolean set_minPlayers(int _minPlayers)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._minPlayers = _minPlayers;
return true;
@@ -408,7 +408,7 @@ public class TvT implements EventTask
*/
public static boolean set_maxPlayers(int _maxPlayers)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._maxPlayers = _maxPlayers;
return true;
@@ -432,7 +432,7 @@ public class TvT implements EventTask
*/
public static boolean set_intervalBetweenMatchs(long _intervalBetweenMatchs)
{
if (!is_inProgress())
if (!_inProgress)
{
TvT._intervalBetweenMatchs = _intervalBetweenMatchs;
return true;
@@ -456,7 +456,7 @@ public class TvT implements EventTask
*/
public boolean setStartEventTime(String startEventTime)
{
if (!is_inProgress())
if (!_inProgress)
{
this.startEventTime = startEventTime;
return true;
@@ -2396,7 +2396,7 @@ public class TvT implements EventTask
*/
public static void addTeam(String teamName)
{
if (is_inProgress())
if (_inProgress)
{
if (Config.DEBUG)
{
@@ -2436,7 +2436,7 @@ public class TvT implements EventTask
*/
public static void removeTeam(String teamName)
{
if (is_inProgress() || _teams.isEmpty())
if (_inProgress || _teams.isEmpty())
{
if (Config.DEBUG)
{
@@ -2530,7 +2530,7 @@ public class TvT implements EventTask
*/
public static void setTeamColor(String teamName, int color)
{
if (is_inProgress())
if (_inProgress)
{
return;
}
@@ -1109,7 +1109,7 @@ public class Olympiad
{
final int[] array = new int[2];
if (!inCompPeriod())
if (!_inCompPeriod)
{
return null;
}
@@ -61,7 +61,7 @@ class OlympiadStadium
protected void addSpectator(int id, L2PcInstance spec, boolean storeCoords)
{
spec.enterOlympiadObserverMode(getCoordinates()[0], getCoordinates()[1], getCoordinates()[2], id, storeCoords);
spec.enterOlympiadObserverMode(_coords[0], _coords[1], _coords[2], id, storeCoords);
_spectators.add(spec);
}
@@ -666,7 +666,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:
@@ -1424,7 +1424,7 @@ public class SevenSigns
{
SystemMessage sm = null;
switch (getCurrentPeriod())
switch (_activePeriod)
{
case PERIOD_COMP_RECRUITING:
{
@@ -1761,7 +1761,7 @@ public class SevenSigns
/*
* Remember the period check here refers to the period just ENDED!
*/
final int periodEnded = getCurrentPeriod();
final int periodEnded = _activePeriod;
_activePeriod++;
switch (periodEnded)
@@ -4643,7 +4643,7 @@ public class SevenSignsFestival implements SpawnListener
*/
public final L2DarknessFestival getFestivalInstance(int oracle, int festivalId)
{
if (!isFestivalInitialized())
if (!_festivalInitialized)
{
return null;
}
@@ -156,7 +156,7 @@ public class Castle
*/
public void addToTreasury(int amount)
{
if (getOwnerId() <= 0)
if (_ownerId <= 0)
{
return;
}
@@ -203,7 +203,7 @@ public class Castle
*/
public boolean addToTreasuryNoTax(int amount)
{
if (getOwnerId() <= 0)
if (_ownerId <= 0)
{
return false;
}
@@ -231,8 +231,8 @@ public class Castle
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Update castle set treasury = ? where id = ?");
statement.setInt(1, getTreasury());
statement.setInt(2, getCastleId());
statement.setInt(1, _treasury);
statement.setInt(2, _castleId);
statement.execute();
statement.close();
}
@@ -249,7 +249,7 @@ public class Castle
*/
public void banishForeigners()
{
_zone.banishForeigners(getOwnerId());
_zone.banishForeigners(_ownerId);
}
/**
@@ -309,7 +309,7 @@ public class Castle
public void openCloseDoor(L2PcInstance activeChar, int doorId, boolean open)
{
if (activeChar.getClanId() != getOwnerId())
if (activeChar.getClanId() != _ownerId)
{
return;
}
@@ -338,7 +338,7 @@ public class Castle
public void setOwner(L2Clan clan)
{
// Remove old owner
if ((getOwnerId() > 0) && ((clan == null) || (clan.getClanId() != getOwnerId())))
if ((_ownerId > 0) && ((clan == null) || (clan.getClanId() != _ownerId)))
{
L2Clan oldOwner = ClanTable.getInstance().getClan(getOwnerId()); // Try to find clan instance
@@ -427,7 +427,7 @@ public class Castle
}
setTaxPercent(taxPercent);
activeChar.sendMessage(getName() + " castle tax changed to " + taxPercent + "%.");
activeChar.sendMessage(_name + " castle tax changed to " + taxPercent + "%.");
}
public void setTaxPercent(int taxPercent)
@@ -439,7 +439,7 @@ public class Castle
{
PreparedStatement statement = con.prepareStatement("Update castle set taxPercent = ? where id = ?");
statement.setInt(1, taxPercent);
statement.setInt(2, getCastleId());
statement.setInt(2, _castleId);
statement.execute();
statement.close();
}
@@ -464,9 +464,9 @@ public class Castle
*/
public void spawnDoor(boolean isDoorWeak)
{
for (int i = 0; i < getDoors().size(); i++)
for (int i = 0; i < _doors.size(); i++)
{
L2DoorInstance door = getDoors().get(i);
L2DoorInstance door = _doors.get(i);
if (door.getCurrentHp() <= 0)
{
door.decayMe(); // Kill current if not killed already
@@ -482,7 +482,7 @@ public class Castle
}
door.spawnMe(door.getX(), door.getY(), door.getZ());
getDoors().set(i, door);
_doors.set(i, door);
}
else if (door.getOpen())
{
@@ -521,7 +521,7 @@ public class Castle
ResultSet rs;
statement = con.prepareStatement("Select * from castle where id = ?");
statement.setInt(1, getCastleId());
statement.setInt(1, _castleId);
rs = statement.executeQuery();
while (rs.next())
@@ -556,7 +556,7 @@ public class Castle
_taxRate = _taxPercent / 100.0;
statement = con.prepareStatement("Select clan_id from clan_data where hasCastle = ?");
statement.setInt(1, getCastleId());
statement.setInt(1, _castleId);
rs = statement.executeQuery();
while (rs.next())
@@ -564,7 +564,7 @@ public class Castle
_ownerId = rs.getInt("clan_id");
}
if (getOwnerId() > 0)
if (_ownerId > 0)
{
L2Clan clan = ClanTable.getInstance().getClan(getOwnerId()); // Try to find clan instance
ThreadPool.schedule(new CastleUpdater(clan, 1), 3600000); // Schedule owner tasks to start running
@@ -585,7 +585,7 @@ public class Castle
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Select * from castle_door where castleId = ?");
statement.setInt(1, getCastleId());
statement.setInt(1, _castleId);
ResultSet rs = statement.executeQuery();
while (rs.next())
@@ -614,7 +614,7 @@ public class Castle
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Select * from castle_doorupgrade where doorId in (Select Id from castle_door where castleId = ?)");
statement.setInt(1, getCastleId());
statement.setInt(1, _castleId);
ResultSet rs = statement.executeQuery();
while (rs.next())
@@ -636,7 +636,7 @@ public class Castle
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("delete from castle_doorupgrade where doorId in (select id from castle_door where castleId=?)");
statement.setInt(1, getCastleId());
statement.setInt(1, _castleId);
statement.execute();
statement.close();
}
@@ -683,13 +683,13 @@ public class Castle
// NEED TO REMOVE HAS CASTLE FLAG FROM CLAN_DATA
// SHOULD BE CHECKED FROM CASTLE TABLE
statement = con.prepareStatement("UPDATE clan_data SET hasCastle=0 WHERE hasCastle=?");
statement.setInt(1, getCastleId());
statement.setInt(1, _castleId);
statement.execute();
statement.close();
statement = con.prepareStatement("UPDATE clan_data SET hasCastle=? WHERE clan_id=?");
statement.setInt(1, getCastleId());
statement.setInt(2, getOwnerId());
statement.setInt(1, _castleId);
statement.setInt(2, _ownerId);
statement.execute();
statement.close();
// ============================================================================
@@ -697,7 +697,7 @@ public class Castle
// Announce to clan memebers
if (clan != null)
{
clan.setHasCastle(getCastleId()); // Set has castle flag for new owner
clan.setHasCastle(_castleId); // Set has castle flag for new owner
Announcements.getInstance().announceToAll(clan.getName() + " has taken " + getName() + " castle!");
clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
clan.broadcastToOnlineMembers(new PlaySound(1, "Siege_Victory", 0, 0, 0, 0, 0));
@@ -727,9 +727,9 @@ public class Castle
return null;
}
for (int i = 0; i < getDoors().size(); i++)
for (int i = 0; i < _doors.size(); i++)
{
L2DoorInstance door = getDoors().get(i);
L2DoorInstance door = _doors.get(i);
if (door.getDoorId() == doorId)
{
@@ -899,7 +899,7 @@ public class Castle
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
statement = con.prepareStatement(CASTLE_MANOR_DELETE_PRODUCTION);
statement.setInt(1, getCastleId());
statement.setInt(1, _castleId);
statement.execute();
statement.close();
@@ -913,7 +913,7 @@ public class Castle
for (SeedProduction s : _production)
{
values[count] = "(" + getCastleId() + "," + s.getId() + "," + s.getCanProduce() + "," + s.getStartProduce() + "," + s.getPrice() + "," + CastleManorManager.PERIOD_CURRENT + ")";
values[count] = "(" + _castleId + "," + s.getId() + "," + s.getCanProduce() + "," + s.getStartProduce() + "," + s.getPrice() + "," + CastleManorManager.PERIOD_CURRENT + ")";
count++;
}
@@ -939,7 +939,7 @@ public class Castle
for (SeedProduction s : _productionNext)
{
values[count] = "(" + getCastleId() + "," + s.getId() + "," + s.getCanProduce() + "," + s.getStartProduce() + "," + s.getPrice() + "," + CastleManorManager.PERIOD_NEXT + ")";
values[count] = "(" + _castleId + "," + s.getId() + "," + s.getCanProduce() + "," + s.getStartProduce() + "," + s.getPrice() + "," + CastleManorManager.PERIOD_NEXT + ")";
count++;
}
@@ -960,7 +960,7 @@ public class Castle
}
catch (Exception e)
{
LOGGER.info("Error adding seed production data for castle " + getName() + ": " + e.getMessage());
LOGGER.info("Error adding seed production data for castle " + _name + ": " + e.getMessage());
}
}
@@ -971,7 +971,7 @@ public class Castle
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
statement = con.prepareStatement(CASTLE_MANOR_DELETE_PRODUCTION_PERIOD);
statement.setInt(1, getCastleId());
statement.setInt(1, _castleId);
statement.setInt(2, period);
statement.execute();
statement.close();
@@ -988,7 +988,7 @@ public class Castle
for (SeedProduction s : prod)
{
values[count] = "(" + getCastleId() + "," + s.getId() + "," + s.getCanProduce() + "," + s.getStartProduce() + "," + s.getPrice() + "," + period + ")";
values[count] = "(" + _castleId + "," + s.getId() + "," + s.getCanProduce() + "," + s.getStartProduce() + "," + s.getPrice() + "," + period + ")";
count++;
}
if (values.length > 0)
@@ -1006,7 +1006,7 @@ public class Castle
}
catch (Exception e)
{
LOGGER.info("Error adding seed production data for castle " + getName() + ": " + e.getMessage());
LOGGER.info("Error adding seed production data for castle " + _name + ": " + e.getMessage());
}
}
@@ -1017,7 +1017,7 @@ public class Castle
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
statement = con.prepareStatement(CASTLE_MANOR_DELETE_PROCURE);
statement.setInt(1, getCastleId());
statement.setInt(1, _castleId);
statement.execute();
statement.close();
@@ -1030,7 +1030,7 @@ public class Castle
for (CropProcure cp : _procure)
{
values[count] = "(" + getCastleId() + "," + cp.getId() + "," + cp.getAmount() + "," + cp.getStartAmount() + "," + cp.getPrice() + "," + cp.getReward() + "," + CastleManorManager.PERIOD_CURRENT + ")";
values[count] = "(" + _castleId + "," + cp.getId() + "," + cp.getAmount() + "," + cp.getStartAmount() + "," + cp.getPrice() + "," + cp.getReward() + "," + CastleManorManager.PERIOD_CURRENT + ")";
count++;
}
@@ -1058,7 +1058,7 @@ public class Castle
for (CropProcure cp : _procureNext)
{
values[count] = "(" + getCastleId() + "," + cp.getId() + "," + cp.getAmount() + "," + cp.getStartAmount() + "," + cp.getPrice() + "," + cp.getReward() + "," + CastleManorManager.PERIOD_NEXT + ")";
values[count] = "(" + _castleId + "," + cp.getId() + "," + cp.getAmount() + "," + cp.getStartAmount() + "," + cp.getPrice() + "," + cp.getReward() + "," + CastleManorManager.PERIOD_NEXT + ")";
count++;
}
@@ -1077,7 +1077,7 @@ public class Castle
}
catch (Exception e)
{
LOGGER.info("Error adding crop data for castle " + getName() + ": " + e.getMessage());
LOGGER.info("Error adding crop data for castle " + _name + ": " + e.getMessage());
}
}
@@ -1088,7 +1088,7 @@ public class Castle
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
statement = con.prepareStatement(CASTLE_MANOR_DELETE_PROCURE_PERIOD);
statement.setInt(1, getCastleId());
statement.setInt(1, _castleId);
statement.setInt(2, period);
statement.execute();
statement.close();
@@ -1105,7 +1105,7 @@ public class Castle
for (CropProcure cp : proc)
{
values[count] = "(" + getCastleId() + "," + cp.getId() + "," + cp.getAmount() + "," + cp.getStartAmount() + "," + cp.getPrice() + "," + cp.getReward() + "," + period + ")";
values[count] = "(" + _castleId + "," + cp.getId() + "," + cp.getAmount() + "," + cp.getStartAmount() + "," + cp.getPrice() + "," + cp.getReward() + "," + period + ")";
count++;
}
@@ -1126,7 +1126,7 @@ public class Castle
}
catch (Exception e)
{
LOGGER.info("Error adding crop data for castle " + getName() + ": " + e.getMessage());
LOGGER.info("Error adding crop data for castle " + _name + ": " + e.getMessage());
}
}
@@ -1138,14 +1138,14 @@ public class Castle
statement = con.prepareStatement(CASTLE_UPDATE_CROP);
statement.setInt(1, amount);
statement.setInt(2, cropId);
statement.setInt(3, getCastleId());
statement.setInt(3, _castleId);
statement.setInt(4, period);
statement.execute();
statement.close();
}
catch (Exception e)
{
LOGGER.info("Error adding crop data for castle " + getName() + ": " + e.getMessage());
LOGGER.info("Error adding crop data for castle " + _name + ": " + e.getMessage());
}
}
@@ -1157,14 +1157,14 @@ public class Castle
statement = con.prepareStatement(CASTLE_UPDATE_SEED);
statement.setInt(1, amount);
statement.setInt(2, seedId);
statement.setInt(3, getCastleId());
statement.setInt(3, _castleId);
statement.setInt(4, period);
statement.execute();
statement.close();
}
catch (Exception e)
{
LOGGER.info("Error adding seed production data for castle " + getName() + ": " + e.getMessage());
LOGGER.info("Error adding seed production data for castle " + _name + ": " + e.getMessage());
}
}
@@ -1263,7 +1263,7 @@ public class Castle
LOGGER.info(" Player Name: " + actual.getName());
}
}
getTeleZone().oustAllPlayers();
_teleZone.oustAllPlayers();
}
/**
@@ -75,7 +75,7 @@ public abstract class ClanHallSiege
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
final PreparedStatement statement = con.prepareStatement("UPDATE clanhall_siege SET siege_data=? WHERE id = ?");
statement.setLong(1, getSiegeDate().getTimeInMillis());
statement.setLong(1, _siegeDate.getTimeInMillis());
statement.setInt(2, ClanHallId);
statement.execute();
statement.close();
@@ -110,7 +110,7 @@ public class Fort
*/
public void banishForeigners()
{
_zone.banishForeigners(getOwnerId());
_zone.banishForeigners(_ownerId);
}
/**
@@ -160,7 +160,7 @@ public class Fort
public void openCloseDoor(L2PcInstance activeChar, int doorId, boolean open)
{
if (activeChar.getClanId() != getOwnerId())
if (activeChar.getClanId() != _ownerId)
{
return;
}
@@ -190,7 +190,7 @@ public class Fort
public void setOwner(L2Clan clan)
{
// Remove old owner
if ((getOwnerId() > 0) && ((clan == null) || (clan.getClanId() != getOwnerId())))
if ((_ownerId > 0) && ((clan == null) || (clan.getClanId() != _ownerId)))
{
// Try to find clan instance
L2Clan oldOwner = ClanTable.getInstance().getClan(getOwnerId());
@@ -270,7 +270,7 @@ public class Fort
return;
}
activeChar.sendMessage(getName() + " fort tax changed to " + taxPercent + "%.");
activeChar.sendMessage(_name + " fort tax changed to " + taxPercent + "%.");
}
/**
@@ -288,9 +288,9 @@ public class Fort
*/
public void spawnDoor(boolean isDoorWeak)
{
for (int i = 0; i < getDoors().size(); i++)
for (int i = 0; i < _doors.size(); i++)
{
L2DoorInstance door = getDoors().get(i);
L2DoorInstance door = _doors.get(i);
if (door.getCurrentHp() >= 0)
{
@@ -307,7 +307,7 @@ public class Fort
}
door.spawnMe(door.getX(), door.getY(), door.getZ());
getDoors().set(i, door);
_doors.set(i, door);
}
else if (!door.getOpen())
{
@@ -348,7 +348,7 @@ public class Fort
ResultSet rs;
statement = con.prepareStatement("Select * from fort where id = ?");
statement.setInt(1, getFortId());
statement.setInt(1, _fortId);
rs = statement.executeQuery();
while (rs.next())
@@ -377,13 +377,13 @@ public class Fort
rs.close();
statement.close();
if (getOwnerId() > 0)
if (_ownerId > 0)
{
L2Clan clan = ClanTable.getInstance().getClan(getOwnerId()); // Try to find clan instance
// ThreadPoolManager.scheduleGeneral(new FortUpdater(clan, 1), 3600000); // Schedule owner tasks to start running
if (clan != null)
{
clan.setHasFort(getFortId());
clan.setHasFort(_fortId);
_fortOwner = clan;
}
}
@@ -405,7 +405,7 @@ public class Fort
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Select * from fort_door where fortId = ?");
statement.setInt(1, getFortId());
statement.setInt(1, _fortId);
ResultSet rs = statement.executeQuery();
while (rs.next())
@@ -437,7 +437,7 @@ public class Fort
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Select * from fort_doorupgrade where doorId in (Select Id from fort_door where fortId = ?)");
statement.setInt(1, getFortId());
statement.setInt(1, _fortId);
ResultSet rs = statement.executeQuery();
while (rs.next())
@@ -459,7 +459,7 @@ public class Fort
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("delete from fort_doorupgrade where doorId in (select id from fort_door where fortId=?)");
statement.setInt(1, getFortId());
statement.setInt(1, _fortId);
statement.execute();
statement.close();
}
@@ -505,8 +505,8 @@ public class Fort
PreparedStatement statement;
statement = con.prepareStatement("UPDATE fort SET owner=? where id = ?");
statement.setInt(1, getOwnerId());
statement.setInt(2, getFortId());
statement.setInt(1, _ownerId);
statement.setInt(2, _fortId);
statement.execute();
statement.close();
@@ -515,7 +515,7 @@ public class Fort
// Announce to clan memebers
if (clan != null)
{
clan.setHasFort(getFortId()); // Set has fort flag for new owner
clan.setHasFort(_fortId); // Set has fort flag for new owner
Announcements.getInstance().announceToAll(clan.getName() + " has taken " + getName() + " fort!");
clan.broadcastToOnlineMembers(new PledgeShowInfoUpdate(clan));
clan.broadcastToOnlineMembers(new PlaySound(1, "Siege_Victory", 0, 0, 0, 0, 0));
@@ -552,9 +552,9 @@ public class Fort
return null;
}
for (int i = 0; i < getDoors().size(); i++)
for (int i = 0; i < _doors.size(); i++)
{
L2DoorInstance door = getDoors().get(i);
L2DoorInstance door = _doors.get(i);
if (door.getDoorId() == doorId)
{
@@ -109,7 +109,7 @@ public class FortSiege
@Override
public void run()
{
if (!getIsInProgress())
if (!_isInProgress)
{
return;
}
@@ -179,7 +179,7 @@ public class FortSiege
@Override
public void run()
{
if (getIsInProgress())
if (_isInProgress)
{
return;
}
@@ -266,7 +266,7 @@ public class FortSiege
private final Fort[] _fort;
/** The _is in progress. */
private boolean _isInProgress = false;
boolean _isInProgress = false;
/** The _is scheduled. */
private boolean _isScheduled = false;
@@ -309,7 +309,7 @@ public class FortSiege
*/
public void endSiege()
{
if (getIsInProgress())
if (_isInProgress)
{
announceToPlayer("The siege of " + getFort().getName() + " has finished!", false);
@@ -420,7 +420,7 @@ public class FortSiege
*/
public void midVictory()
{
if (getIsInProgress()) // Siege still in progress
if (_isInProgress) // Siege still in progress
{
// defenders to attacker
for (L2SiegeClan sc : getDefenderClans())
@@ -449,7 +449,7 @@ public class FortSiege
*/
public void startSiege()
{
if (!getIsInProgress())
if (!_isInProgress)
{
if (getAttackerClans().size() <= 0)
{
@@ -627,7 +627,7 @@ public class FortSiege
*/
public boolean checkIfInZone(int x, int y, int z)
{
return getIsInProgress() && getFort().checkIfInZone(x, y, z); // Fort zone during siege
return _isInProgress && getFort().checkIfInZone(x, y, z); // Fort zone during siege
}
/**
@@ -682,7 +682,7 @@ public class FortSiege
getAttackerClans().clear();
getDefenderClans().clear();
getDefenderWaitingClans().clear();
_defenderWaitingClans.clear();
}
catch (Exception e)
{
@@ -710,7 +710,7 @@ public class FortSiege
statement.execute();
statement.close();
getDefenderWaitingClans().clear();
_defenderWaitingClans.clear();
}
catch (Exception e)
{
@@ -1124,7 +1124,7 @@ public class FortSiege
}
default:
{
players = getPlayersInZone();
players = getFort().getZone().getAllPlayers();
}
}
@@ -1184,7 +1184,7 @@ public class FortSiege
*/
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
}
/**
@@ -1195,11 +1195,11 @@ public class FortSiege
*/
private boolean checkIfCanRegister(L2PcInstance player)
{
if (getIsRegistrationOver())
if (_isRegistrationOver)
{
player.sendMessage("The deadline to register for the siege of " + getFort().getName() + " has passed.");
}
else if (getIsInProgress())
else if (_isInProgress)
{
player.sendMessage("This is not the time for siege registration and so registration and cancellation cannot be done.");
}
@@ -1249,7 +1249,7 @@ public class FortSiege
{
getAttackerClans().clear();
getDefenderClans().clear();
getDefenderWaitingClans().clear();
_defenderWaitingClans.clear();
// Add fort owner as defender (add owner first so that they are on the top of the defender list)
if (getFort().getOwnerId() > 0)
@@ -1344,7 +1344,7 @@ public class FortSiege
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Update fort set siegeDate = ? where id = ?");
statement.setLong(1, getSiegeDate().getTimeInMillis());
statement.setLong(1, getFort().getSiegeDate().getTimeInMillis());
statement.setInt(2, getFort().getFortId());
statement.execute();
@@ -1676,7 +1676,7 @@ public class FortSiege
*/
public final L2SiegeClan getDefenderWaitingClan(int clanId)
{
for (L2SiegeClan sc : getDefenderWaitingClans())
for (L2SiegeClan sc : _defenderWaitingClans)
{
if ((sc != null) && (sc.getClanId() == clanId))
{
@@ -164,7 +164,7 @@ public class Siege
@Override
public void run()
{
if (!getIsInProgress())
if (!_isInProgress)
{
return;
}
@@ -241,7 +241,7 @@ public class Siege
@Override
public void run()
{
if (getIsInProgress())
if (_isInProgress)
{
return;
}
@@ -329,7 +329,7 @@ public class Siege
private final Castle[] _castle;
/** The _is in progress. */
private boolean _isInProgress = false;
boolean _isInProgress = false;
/** The _is normal side. */
private boolean _isNormalSide = true; // true = Atk is Atk, false = Atk is Def
@@ -369,7 +369,7 @@ public class Siege
*/
public void endSiege()
{
if (getIsInProgress())
if (_isInProgress)
{
announceToPlayer("The siege of " + getCastle().getName() + " has finished!", false);
@@ -487,7 +487,7 @@ public class Siege
*/
public void midVictory()
{
if (getIsInProgress()) // Siege still in progress
if (_isInProgress) // Siege still in progress
{
if (getCastle().getOwnerId() > 0)
{
@@ -607,7 +607,7 @@ public class Siege
*/
public void startSiege()
{
if (!getIsInProgress())
if (!_isInProgress)
{
if (getAttackerClans().size() <= 0)
{
@@ -796,7 +796,7 @@ public class Siege
*/
public boolean checkIfInZone(int x, int y, int z)
{
return getIsInProgress() && getCastle().checkIfInZone(x, y, z); // Castle zone during siege
return _isInProgress && getCastle().checkIfInZone(x, y, z); // Castle zone during siege
}
/**
@@ -857,7 +857,7 @@ public class Siege
getAttackerClans().clear();
getDefenderClans().clear();
getDefenderWaitingClans().clear();
_defenderWaitingClans.clear();
}
catch (Exception e)
{
@@ -877,7 +877,7 @@ public class Siege
statement.execute();
statement.close();
getDefenderWaitingClans().clear();
_defenderWaitingClans.clear();
}
catch (Exception e)
{
@@ -1241,7 +1241,7 @@ public class Siege
}
default:
{
players = getPlayersInZone();
players = getCastle().getZone().getAllPlayers();
}
}
@@ -1304,7 +1304,7 @@ public class Siege
private void addDefenderWaiting(int clanId)
{
// Add registered defender to defender list
getDefenderWaitingClans().add(new L2SiegeClan(clanId, SiegeClanType.DEFENDER_PENDING));
_defenderWaitingClans.add(new L2SiegeClan(clanId, SiegeClanType.DEFENDER_PENDING));
}
/**
@@ -1315,11 +1315,11 @@ public class Siege
*/
private boolean checkIfCanRegister(L2PcInstance player)
{
if (getIsRegistrationOver())
if (_isRegistrationOver)
{
player.sendMessage("The deadline to register for the siege of " + getCastle().getName() + " has passed.");
}
else if (getIsInProgress())
else if (_isInProgress)
{
player.sendMessage("This is not the time for siege registration and so registration and cancellation cannot be done.");
}
@@ -1431,7 +1431,7 @@ public class Siege
{
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)
@@ -1555,7 +1555,7 @@ public class Siege
try (Connection con = DatabaseFactory.getInstance().getConnection())
{
PreparedStatement statement = con.prepareStatement("Update castle set siegeDate = ? where id = ?");
statement.setLong(1, getSiegeDate().getTimeInMillis());
statement.setLong(1, getCastle().getSiegeDate().getTimeInMillis());
statement.setInt(2, getCastle().getCastleId());
statement.execute();
@@ -1907,7 +1907,7 @@ public class Siege
*/
public final L2SiegeClan getDefenderWaitingClan(int clanId)
{
for (L2SiegeClan sc : getDefenderWaitingClans())
for (L2SiegeClan sc : _defenderWaitingClans)
{
if ((sc != null) && (sc.getClanId() == clanId))
{
@@ -51,7 +51,7 @@ public class BanditStrongholdSiege extends ClanHallSiege
{
protected static Logger LOGGER = Logger.getLogger(BanditStrongholdSiege.class.getName());
private static BanditStrongholdSiege _instance;
private boolean _registrationPeriod = false;
boolean _registrationPeriod = false;
private int _clanCounter = 0;
protected Map<Integer, clanPlayersInfo> _clansInfo = new HashMap<>();
private L2ClanHallZone zone;
@@ -571,7 +571,7 @@ public class BanditStrongholdSiege extends ClanHallSiege
long remaining = registerTimeRemaining;
if (registerTimeRemaining <= 0)
{
if (!isRegistrationPeriod())
if (!_registrationPeriod)
{
if (clanhall.getOwnerClan() != null)
{
@@ -48,7 +48,7 @@ public class WildBeastFarmSiege extends ClanHallSiege
{
protected static Logger LOGGER = Logger.getLogger(WildBeastFarmSiege.class.getName());
private static WildBeastFarmSiege _instance;
private boolean _registrationPeriod = false;
boolean _registrationPeriod = false;
private int _clanCounter = 0;
protected Map<Integer, clanPlayersInfo> _clansInfo = new HashMap<>();
public ClanHall clanhall = ClanHallManager.getInstance().getClanHallById(63);
@@ -556,7 +556,7 @@ public class WildBeastFarmSiege extends ClanHallSiege
long remaining = registerTimeRemaining;
if (registerTimeRemaining <= 0)
{
if (!isRegistrationPeriod())
if (!_registrationPeriod)
{
if (clanhall.getOwnerClan() != null)
{
@@ -263,7 +263,7 @@ public class Quest extends ManagedScript
*/
public QuestState newQuestState(L2PcInstance player)
{
QuestState qs = new QuestState(this, player, getInitialState());
QuestState qs = new QuestState(this, player, _initialState);
createQuestInDb(qs);
return qs;
}
@@ -397,7 +397,7 @@ public class Quest extends ManagedScript
{
if (Config.DEBUG)
{
LOGGER.info("StartingQuestTimer for Quest " + getName());
LOGGER.info("StartingQuestTimer for Quest " + _name);
String info = "Event:" + name + " Time:" + time;
if (npc != null)
@@ -764,7 +764,7 @@ public class Quest extends ManagedScript
// if not overriden by a subclass, then default to the returned value of the simpler (and older) onEvent override
// if the player has a state, use it as parameter in the next call, else return null
final QuestState qs = player.getQuestState(getName());
final QuestState qs = player.getQuestState(_name);
if (qs != null)
{
@@ -1259,7 +1259,7 @@ public class Quest extends ManagedScript
{
PreparedStatement statement;
statement = con.prepareStatement("REPLACE INTO quest_global_data (quest_name,var,value) VALUES (?,?,?)");
statement.setString(1, getName());
statement.setString(1, _name);
statement.setString(2, var);
statement.setString(3, value);
statement.executeUpdate();
@@ -1284,7 +1284,7 @@ public class Quest extends ManagedScript
{
PreparedStatement statement;
statement = con.prepareStatement("SELECT value FROM quest_global_data WHERE quest_name = ? AND var = ?");
statement.setString(1, getName());
statement.setString(1, _name);
statement.setString(2, var);
ResultSet rs = statement.executeQuery();
@@ -1313,7 +1313,7 @@ public class Quest extends ManagedScript
{
PreparedStatement statement;
statement = con.prepareStatement("DELETE FROM quest_global_data WHERE quest_name = ? AND var = ?");
statement.setString(1, getName());
statement.setString(1, _name);
statement.setString(2, var);
statement.executeUpdate();
statement.close();
@@ -1333,7 +1333,7 @@ public class Quest extends ManagedScript
{
PreparedStatement statement;
statement = con.prepareStatement("DELETE FROM quest_global_data WHERE quest_name = ?");
statement.setString(1, getName());
statement.setString(1, _name);
statement.executeUpdate();
statement.close();
}
@@ -1501,7 +1501,7 @@ public class Quest extends ManagedScript
}
// Check player's quest conditions.
final QuestState st = player.getQuestState(getName());
final QuestState st = player.getQuestState(_name);
if (st == null)
{
return null;
@@ -1538,7 +1538,7 @@ public class Quest extends ManagedScript
}
// Check player's quest conditions.
final QuestState st = player.getQuestState(getName());
final QuestState st = player.getQuestState(_name);
if (st == null)
{
return null;
@@ -1676,7 +1676,7 @@ public class Quest extends ManagedScript
// if this player is not in a party, just check if this player instance matches the conditions itself
if ((party == null) || (party.getPartyMembers().size() == 0))
{
temp = player.getQuestState(getName());
temp = player.getQuestState(_name);
if ((temp != null) && (temp.get(var) != null) && ((String) temp.get(var)).equalsIgnoreCase(value))
{
return player; // match
@@ -1698,7 +1698,7 @@ public class Quest extends ManagedScript
for (L2PcInstance partyMember : party.getPartyMembers())
{
temp = partyMember.getQuestState(getName());
temp = partyMember.getQuestState(_name);
if ((temp != null) && (temp.get(var) != null) && ((String) temp.get(var)).equalsIgnoreCase(value) && partyMember.isInsideRadius(target, 1500, true, false))
{
candidates.add(partyMember);
@@ -1777,7 +1777,7 @@ public class Quest extends ManagedScript
// if this player is not in a party, just check if this player instance matches the conditions itself
if ((party == null) || (party.getPartyMembers().size() == 0))
{
temp = player.getQuestState(getName());
temp = player.getQuestState(_name);
if ((temp != null) && (temp.getState() == state))
{
return player; // match
@@ -1799,7 +1799,7 @@ public class Quest extends ManagedScript
for (L2PcInstance partyMember : party.getPartyMembers())
{
temp = partyMember.getQuestState(getName());
temp = partyMember.getQuestState(_name);
if ((temp != null) && (temp.getState() == state) && partyMember.isInsideRadius(target, 1500, true, false))
{
@@ -1825,10 +1825,10 @@ public class Quest extends ManagedScript
*/
public String showHtmlFile(L2PcInstance player, String fileName)
{
final String questId = getName();
final String questId = _name;
// Create handler to file linked to the quest
final String directory = getDescr().toLowerCase();
final String directory = _descr.toLowerCase();
String content = HtmCache.getInstance().getHtm("data/scripts/" + directory + "/" + questId + "/" + fileName);
if (content == null)
@@ -1876,7 +1876,7 @@ public class Quest extends ManagedScript
*/
public boolean isRealQuest()
{
return getQuestIntId() > 0;
return _questId > 0;
}
// =========================================================
@@ -1959,7 +1959,7 @@ public class Quest extends ManagedScript
@Override
public String getScriptName()
{
return getName();
return _name;
}
/**
@@ -100,7 +100,7 @@ public final class QuestState
_player = player;
// Save the state of the quest for the player in the player's list of quest onwed
getPlayer().setQuestState(this);
_player.setQuestState(this);
// set the state of the quest
_state = state;
@@ -144,7 +144,7 @@ public final class QuestState
*/
public boolean isCompleted()
{
return (getState() == State.COMPLETED);
return (_state == State.COMPLETED);
}
/**
@@ -153,7 +153,7 @@ public final class QuestState
*/
public boolean isStarted()
{
return (getState() == State.STARTED);
return (_state == State.STARTED);
}
/**
@@ -175,7 +175,7 @@ public final class QuestState
Quest.updateQuestInDb(this);
final QuestList ql = new QuestList();
getPlayer().sendPacket(ql);
_player.sendPacket(ql);
return state;
}
@@ -256,7 +256,7 @@ public final class QuestState
}
catch (Exception e)
{
LOGGER.finer(getPlayer().getName() + ", " + getQuestName() + " cond [" + val + "] is not an integer. Value stored, but no packet was sent: " + e);
LOGGER.finer(_player.getName() + ", " + _questName + " cond [" + val + "] is not an integer. Value stored, but no packet was sent: " + e);
}
}
@@ -352,13 +352,13 @@ public final class QuestState
// send a packet to the client to inform it of the quest progress (step change)
QuestList ql = new QuestList();
getPlayer().sendPacket(ql);
_player.sendPacket(ql);
final int questId = getQuest().getQuestIntId();
if ((questId > 0) && (questId < 999) && (cond > 0))
{
getPlayer().sendPacket(new ExShowQuestMark(questId));
_player.sendPacket(new ExShowQuestMark(questId));
}
}
@@ -434,7 +434,7 @@ public final class QuestState
}
catch (Exception e)
{
LOGGER.info(getPlayer().getName() + ": variable " + var + " isn't an integer: returned value will be " + varint + e);
LOGGER.info(_player.getName() + ": variable " + var + " isn't an integer: returned value will be " + varint + e);
if (Config.AUTODELETE_INVALID_QUEST_DATA)
{
@@ -469,9 +469,9 @@ public final class QuestState
{
int count = 0;
if ((getPlayer() != null) && (getPlayer().getInventory() != null) && (getPlayer().getInventory().getItems() != null))
if ((_player != null) && (_player.getInventory() != null) && (_player.getInventory().getItems() != null))
{
for (L2ItemInstance item : getPlayer().getInventory().getItems())
for (L2ItemInstance item : _player.getInventory().getItems())
{
if ((item != null) && (item.getItemId() == itemId))
{
@@ -536,7 +536,7 @@ public final class QuestState
*/
public int getEnchantLevel(int itemId)
{
final L2ItemInstance enchanteditem = getPlayer().getInventory().getItemByItemId(itemId);
final L2ItemInstance enchanteditem = _player.getInventory().getItemByItemId(itemId);
if (enchanteditem == null)
{
@@ -573,7 +573,7 @@ public final class QuestState
// Set quantity of item
// Add items to player's inventory
final L2ItemInstance item = getPlayer().getInventory().addItem("Quest", itemId, count, getPlayer(), getPlayer().getTarget());
final L2ItemInstance item = _player.getInventory().addItem("Quest", itemId, count, _player, _player.getTarget());
if (item == null)
{
@@ -590,7 +590,7 @@ public final class QuestState
{
SystemMessage smsg = new SystemMessage(SystemMessageId.EARNED_ADENA);
smsg.addNumber(count);
getPlayer().sendPacket(smsg);
_player.sendPacket(smsg);
}
// Otherwise, send message of object reward to client
else if (count > 1)
@@ -598,19 +598,19 @@ public final class QuestState
SystemMessage smsg = new SystemMessage(SystemMessageId.EARNED_S2_S1_S);
smsg.addItemName(item.getItemId());
smsg.addNumber(count);
getPlayer().sendPacket(smsg);
_player.sendPacket(smsg);
}
else
{
SystemMessage smsg = new SystemMessage(SystemMessageId.EARNED_ITEM);
smsg.addItemName(item.getItemId());
getPlayer().sendPacket(smsg);
_player.sendPacket(smsg);
}
getPlayer().sendPacket(new ItemList(getPlayer(), false));
_player.sendPacket(new ItemList(_player, false));
StatusUpdate su = new StatusUpdate(getPlayer().getObjectId());
su.addAttribute(StatusUpdate.CUR_LOAD, getPlayer().getCurrentLoad());
getPlayer().sendPacket(su);
StatusUpdate su = new StatusUpdate(_player.getObjectId());
su.addAttribute(StatusUpdate.CUR_LOAD, _player.getCurrentLoad());
_player.sendPacket(su);
}
/**
@@ -646,7 +646,7 @@ public final class QuestState
public boolean dropQuestItems(int itemId, int minCount, int maxCount, int neededCount, int dropChance, boolean sound)
{
dropChance *= Config.RATE_DROP_QUEST / (getPlayer().getParty() != null ? getPlayer().getParty().getMemberCount() : 1);
dropChance *= Config.RATE_DROP_QUEST / (_player.getParty() != null ? _player.getParty().getMemberCount() : 1);
final int currentCount = getQuestItemsCount(itemId);
@@ -692,7 +692,7 @@ public final class QuestState
}
// Inventory slot check
if (!getPlayer().getInventory().validateCapacityByItemId(itemId))
if (!_player.getInventory().validateCapacityByItemId(itemId))
{
return false;
}
@@ -708,7 +708,7 @@ public final class QuestState
// }
// Give the item to Player
getPlayer().addItem("Quest", itemId, itemCount, getPlayer().getTarget(), true);
_player.addItem("Quest", itemId, itemCount, _player.getTarget(), true);
if (sound)
{
@@ -940,17 +940,17 @@ public final class QuestState
// BEGIN STUFF THAT WILL PROBABLY BE CHANGED
public void addRadar(int x, int y, int z)
{
getPlayer().getRadar().addMarker(x, y, z);
_player.getRadar().addMarker(x, y, z);
}
public void removeRadar(int x, int y, int z)
{
getPlayer().getRadar().removeMarker(x, y, z);
_player.getRadar().removeMarker(x, y, z);
}
public void clearRadar()
{
getPlayer().getRadar().removeAllMarkers();
_player.getRadar().removeAllMarkers();
}
// END STUFF THAT WILL PROBABLY BE CHANGED
@@ -967,16 +967,16 @@ public final class QuestState
public void takeItems(int itemId, int count)
{
// Get object item from player's inventory list
L2ItemInstance item = getPlayer().getInventory().getItemByItemId(itemId);
L2ItemInstance item = _player.getInventory().getItemByItemId(itemId);
if (item == null)
{
return;
}
if (getPlayer().isProcessingTransaction())
if (_player.isProcessingTransaction())
{
getPlayer().cancelActiveTrade();
_player.cancelActiveTrade();
}
// Tests on count value in order not to have negative value
@@ -988,23 +988,23 @@ public final class QuestState
// Destroy the quantity of items wanted
if (itemId == 57)
{
getPlayer().reduceAdena("Quest", count, getPlayer(), true);
_player.reduceAdena("Quest", count, _player, true);
}
else
{
// Fix for destroyed quest items
if (item.isEquipped())
{
getPlayer().getInventory().unEquipItemInBodySlotAndRecord(item.getItem().getBodyPart());
_player.getInventory().unEquipItemInBodySlotAndRecord(item.getItem().getBodyPart());
}
getPlayer().destroyItemByItemId("Quest", itemId, count, getPlayer(), true);
_player.destroyItemByItemId("Quest", itemId, count, _player, true);
}
// on quests, always refresh inventory
final InventoryUpdate u = new InventoryUpdate();
u.addItem(item);
getPlayer().sendPacket(u);
_player.sendPacket(u);
}
/**
@@ -1013,7 +1013,7 @@ public final class QuestState
*/
public void playSound(String sound)
{
getPlayer().sendPacket(new PlaySound(sound));
_player.sendPacket(new PlaySound(sound));
}
/**
@@ -1023,7 +1023,7 @@ public final class QuestState
*/
public void rewardExpAndSp(int exp, int sp)
{
getPlayer().addExpAndSp((int) getPlayer().calcStat(Stats.EXPSP_RATE, exp * Config.RATE_QUESTS_REWARD, null, null), (int) getPlayer().calcStat(Stats.EXPSP_RATE, sp * Config.RATE_QUESTS_REWARD, null, null));
_player.addExpAndSp((int) _player.calcStat(Stats.EXPSP_RATE, exp * Config.RATE_QUESTS_REWARD, null, null), (int) _player.calcStat(Stats.EXPSP_RATE, sp * Config.RATE_QUESTS_REWARD, null, null));
}
/**
@@ -1042,7 +1042,7 @@ public final class QuestState
*/
public int getItemEquipped(int loc)
{
return getPlayer().getInventory().getPaperdollItemId(loc);
return _player.getInventory().getPaperdollItemId(loc);
}
/**
@@ -1115,12 +1115,12 @@ public final class QuestState
*/
public L2NpcInstance addSpawn(int npcId)
{
return addSpawn(npcId, getPlayer().getX(), getPlayer().getY(), getPlayer().getZ(), 0, false, 0);
return addSpawn(npcId, _player.getX(), _player.getY(), _player.getZ(), 0, false, 0);
}
public L2NpcInstance addSpawn(int npcId, int despawnDelay)
{
return addSpawn(npcId, getPlayer().getX(), getPlayer().getY(), getPlayer().getZ(), 0, false, despawnDelay);
return addSpawn(npcId, _player.getX(), _player.getY(), _player.getZ(), 0, false, despawnDelay);
}
public L2NpcInstance addSpawn(int npcId, int x, int y, int z)
@@ -1220,7 +1220,7 @@ public final class QuestState
// If quest is repeatable, delete quest from list of quest of the player and from database (quest CAN be created again => repeatable)
if (repeatable)
{
getPlayer().delQuestState(getQuestName());
_player.delQuestState(_questName);
Quest.deleteQuestInDb(this);
_vars = null;
@@ -1244,12 +1244,12 @@ public final class QuestState
public void showQuestionMark(int number)
{
getPlayer().sendPacket(new TutorialShowQuestionMark(number));
_player.sendPacket(new TutorialShowQuestionMark(number));
}
public void playTutorialVoice(String voice)
{
getPlayer().sendPacket(new PlaySound(2, voice, 0, 0, getPlayer().getX(), getPlayer().getY(), getPlayer().getZ()));
_player.sendPacket(new PlaySound(2, voice, 0, 0, _player.getX(), _player.getY(), _player.getZ()));
}
public void showTutorialHTML(String html)
@@ -1262,17 +1262,17 @@ public final class QuestState
text = "<html><body>File data/scripts/quests/255_Tutorial/" + html + " not found or file is empty.</body></html>";
}
getPlayer().sendPacket(new TutorialShowHtml(text));
_player.sendPacket(new TutorialShowHtml(text));
}
public void closeTutorialHtml()
{
getPlayer().sendPacket(new TutorialCloseHtml());
_player.sendPacket(new TutorialCloseHtml());
}
public void onTutorialClientEvent(int number)
{
getPlayer().sendPacket(new TutorialEnableClientEvent(number));
_player.sendPacket(new TutorialEnableClientEvent(number));
}
public void dropItem(L2MonsterInstance npc, L2PcInstance player, int itemId, int count)
@@ -1282,9 +1282,9 @@ public final class QuestState
public L2NpcInstance getNpc()
{
if (getPlayer().getTarget() instanceof L2NpcInstance)
if (_player.getTarget() instanceof L2NpcInstance)
{
return (L2NpcInstance) getPlayer().getTarget();
return (L2NpcInstance) _player.getTarget();
}
return null;
}
@@ -31,18 +31,18 @@ public class QuestTimer
@Override
public void run()
{
if (!getIsActive())
if (!_isActive)
{
return;
}
try
{
if (!getIsRepeating())
if (!_isRepeating)
{
cancel();
}
getQuest().notifyEvent(getName(), getNpc(), getPlayer());
_quest.notifyEvent(_name, _npc, _player);
}
catch (Throwable t)
{
@@ -52,12 +52,12 @@ public class QuestTimer
// =========================================================
// Data Field
private boolean _isActive = true;
private final String _name;
private final Quest _quest;
private final L2NpcInstance _npc;
private final L2PcInstance _player;
private final boolean _isRepeating;
boolean _isActive = true;
final String _name;
final Quest _quest;
final L2NpcInstance _npc;
final L2PcInstance _player;
final boolean _isRepeating;
private ScheduledFuture<?> _schedular;
// =========================================================
@@ -107,7 +107,7 @@ public class QuestTimer
if (removeTimer)
{
getQuest().removeQuestTimer(this);
_quest.removeQuestTimer(this);
}
}
@@ -116,24 +116,17 @@ public class QuestTimer
// null npc or player act as wildcards for the match
public boolean isMatch(Quest quest, String name, L2NpcInstance npc, L2PcInstance player)
{
/*
* if (quest instanceof Frintezza_l2j) { LOGGER.info("#### INPUT Parameters ####"); LOGGER.info("Quest Name: " + quest.getName()); LOGGER.info("Quest Timer Name: " + name); LOGGER.info("Quest NPC: " + npc); if (npc != null) { LOGGER.info(" NPC Name: " + npc.getName());
* LOGGER.info(" NPC Id: " + npc.getNpcId()); LOGGER.info(" NPC Instance: " + npc.getInstanceId()); } LOGGER.info("Quest Player: " + player); if (player != null) { LOGGER.info(" Player Name: " + player.getName()); LOGGER.info(" Player Instance: " + player.getInstanceId()); }
* LOGGER.info("\n#### LOCAL Parameters ####"); LOGGER.info("Quest Name: " + getQuest().getName()); LOGGER.info("Quest Timer Name: " + getName()); LOGGER.info("Quest NPC: " + getNpc()); if (getNpc() != null) { LOGGER.info(" NPC Name: " + getNpc().getName()); LOGGER.info(" NPC Id: " +
* getNpc().getNpcId()); LOGGER.info(" NPC Instance: " + getNpc().getInstanceId()); } LOGGER.info("Quest Player: " + getPlayer()); if (getPlayer() != null) { LOGGER.info(" Player Name: " + getPlayer().getName()); LOGGER.info(" Player Instance: " + getPlayer().getInstanceId()); } }
*/
if ((quest == null) || (name == null))
{
return false;
}
if ((quest != getQuest()) || (name.compareToIgnoreCase(getName()) != 0))
if ((quest != _quest) || (name.compareToIgnoreCase(_name) != 0))
{
return false;
}
return (npc == getNpc()) && (player == getPlayer());
return (npc == _npc) && (player == _player);
}
// =========================================================
@@ -544,9 +544,9 @@ public class L2Spawn
int newlocx, newlocy, newlocz;
// If Locx=0 and Locy=0, the L2NpcInstance must be spawned in an area defined by location
if ((getX() == 0) && (getY() == 0))
if ((_locX == 0) && (_locY == 0))
{
if (getLocation() == 0)
if (_location == 0)
{
return mob;
}
@@ -562,9 +562,9 @@ public class L2Spawn
else
{
// The L2NpcInstance is spawned at the exact position (Lox, Locy, Locz)
newlocx = getX();
newlocy = getY();
newlocz = getZ();
newlocx = _locX;
newlocy = _locY;
newlocz = _locZ;
}
if (mob != null)
@@ -575,13 +575,13 @@ public class L2Spawn
mob.setCurrentHpMp(mob.getMaxHp(), mob.getMaxMp());
// Set the heading of the L2NpcInstance (random heading if not defined)
if (getHeading() == -1)
if (_heading == -1)
{
mob.setHeading(Rnd.nextInt(61794));
}
else
{
mob.setHeading(getHeading());
mob.setHeading(_heading);
}
// Reset decay info
@@ -43,10 +43,10 @@ public class L2EffectZone extends L2ZoneType
{
public static final Logger LOGGER = Logger.getLogger(L2EffectZone.class.getName());
private int _chance;
int _chance;
private int _initialDelay;
private int _reuse;
private boolean _enabled;
boolean _enabled;
private boolean _isShowDangerIcon;
private volatile Future<?> _task;
protected volatile Map<Integer, Integer> _skills;
@@ -254,7 +254,7 @@ public class L2EffectZone extends L2ZoneType
@Override
public void run()
{
if (isEnabled())
if (_enabled)
{
for (L2Character temp : getCharacterList())
{
@@ -265,7 +265,7 @@ public class L2EffectZone extends L2ZoneType
continue;
}
if (Rnd.get(100) < getChance())
if (Rnd.get(100) < _chance)
{
for (Entry<Integer, Integer> e : _skills.entrySet())
{
@@ -56,7 +56,7 @@ public class L2OlympiadStadiumZone extends L2ZoneType
if (character instanceof L2PcInstance)
{
if ((((L2PcInstance) character).getOlympiadGameId() + 1) == getStadiumId())
if ((((L2PcInstance) character).getOlympiadGameId() + 1) == _stadiumId)
{
((L2PcInstance) character).sendPacket(SystemMessageId.ENTERED_COMBAT_ZONE);
}
@@ -33,12 +33,12 @@ public class L2PoisonZone extends L2ZoneType
{
protected final Logger LOGGER = Logger.getLogger(L2PoisonZone.class.getName());
protected int _skillId;
private int _chance;
int _chance;
private int _initialDelay;
protected int _skillLvl;
private int _reuse;
private boolean _enabled;
private String _target;
boolean _enabled;
String _target;
private Future<?> _task;
public L2PoisonZone(int id)
@@ -161,13 +161,13 @@ public class L2PoisonZone extends L2ZoneType
@Override
public void run()
{
if (isEnabled())
if (_enabled)
{
for (L2Character temp : _characterList.values())
{
if ((temp != null) && !temp.isDead())
{
if ((((temp instanceof L2Playable) && getTargetType().equalsIgnoreCase("pc")) || ((temp instanceof L2PcInstance) && getTargetType().equalsIgnoreCase("pc_only")) || ((temp instanceof L2MonsterInstance) && getTargetType().equalsIgnoreCase("npc"))) && (Rnd.get(100) < getChance()))
if ((((temp instanceof L2Playable) && _target.equalsIgnoreCase("pc")) || ((temp instanceof L2PcInstance) && _target.equalsIgnoreCase("pc_only")) || ((temp instanceof L2MonsterInstance) && _target.equalsIgnoreCase("npc"))) && (Rnd.get(100) < _chance))
{
L2Skill skill = getSkill();
if (skill == null)
@@ -343,10 +343,6 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
public void markRestoredChar(int charslot)
{
// have to make sure active character must be nulled
/*
* if (getActiveChar() != null) { saveCharToDisk (getActiveChar()); if (Config.DEBUG) LOGGER.fine("active Char saved"); this.setActiveChar(null); }
*/
final int objid = getObjectIdForSlot(charslot);
if (objid < 0)
@@ -485,7 +481,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
{
// exploit prevention, should not happens in normal way
LOGGER.warning("Attempt of double login: " + character.getName() + "(" + objId + ") " + getAccountName());
LOGGER.warning("Attempt of double login: " + character.getName() + "(" + objId + ") " + accountName);
if (character.getClient() != null)
{
@@ -662,7 +658,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
ip = address.getHostAddress();
}
switch (getState())
switch (_state)
{
case CONNECTED:
{
@@ -670,11 +666,11 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
}
case AUTHED:
{
return "[Account: " + getAccountName() + " - IP: " + ip + "]";
return "[Account: " + accountName + " - IP: " + ip + "]";
}
case IN_GAME:
{
return "[Character: " + (getActiveChar() == null ? "disconnected" : getActiveChar().getName()) + " - Account: " + getAccountName() + " - IP: " + ip + "]";
return "[Character: " + (activeChar == null ? "disconnected" : activeChar.getName()) + " - Account: " + accountName + " - IP: " + ip + "]";
}
default:
{
@@ -700,7 +696,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
// _autoSaveInDB.cancel(true);
//
final L2PcInstance player = getActiveChar();
final L2PcInstance player = activeChar;
if (player != null) // this should only happen on connection loss
{
// we store all data from players who are disconnected while in an event in order to restore it in the next login
@@ -787,7 +783,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
// if(_autoSaveInDB != null)
// _autoSaveInDB.cancel(true);
L2PcInstance player = getActiveChar();
L2PcInstance player = activeChar;
if (player != null) // this should only happen on connection loss
{
// we store all data from players who are disconnected while in an event in order to restore it in the next login
@@ -840,7 +836,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
&& !player.isInOlympiadMode() //
&& !player.isInFunEvent() //
&& ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) //
|| (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE)))
|| (player.isCrafting() && Config.OFFLINE_CRAFT_ENABLE)))
{
if (!Config.OFFLINE_MODE_IN_PEACE_ZONE || (Config.OFFLINE_MODE_IN_PEACE_ZONE && player.isInsideZone(ZoneId.PEACE)))
{
@@ -851,7 +847,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
if (Config.OFFLINE_MODE_SET_INVULNERABLE)
{
getActiveChar().setIsInvul(true);
activeChar.setIsInvul(true);
}
if (Config.OFFLINE_SET_NAME_COLOR)
{
@@ -932,7 +928,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
*/
public void onBufferUnderflow()
{
if (getStats().countUnderflowException())
if (_stats.countUnderflowException())
{
LOGGER.warning("Client " + this + " - Disconnected: Too many buffer underflow exceptions.");
closeNow();
@@ -951,16 +947,16 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
*/
public void execute(ReceivablePacket<L2GameClient> packet)
{
if (getStats().countFloods())
if (_stats.countFloods())
{
LOGGER.warning("Client " + this + " - Disconnected, too many floods:" + getStats().longFloods + " long and " + getStats().shortFloods + " short.");
LOGGER.warning("Client " + this + " - Disconnected, too many floods:" + _stats.longFloods + " long and " + _stats.shortFloods + " short.");
closeNow();
return;
}
if (!_packetQueue.offer(packet))
{
if (getStats().countQueueOverflow())
if (_stats.countQueueOverflow())
{
LOGGER.warning("Client " + this + " - Disconnected, too many queue overflows.");
closeNow();
@@ -986,7 +982,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
{
if (_state == GameClientState.CONNECTED)
{
if (getStats().processedPackets > 3)
if (_stats.processedPackets > 3)
{
LOGGER.warning("Client " + this + " - Disconnected, too many packets in non-authed state.");
closeNow();
@@ -1040,7 +1036,7 @@ public final class L2GameClient extends MMOClient<MMOConnection<L2GameClient>> i
}
count++;
if (getStats().countBurst(count))
if (_stats.countBurst(count))
{
return;
}
@@ -129,7 +129,7 @@ public final class Logout extends L2GameClientPacket
if (Config.OFFLINE_LOGOUT && player.isSitting())
{
if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isInCraftMode() && Config.OFFLINE_CRAFT_ENABLE))
if ((player.isInStoreMode() && Config.OFFLINE_TRADE_ENABLE) || (player.isCrafting() && Config.OFFLINE_CRAFT_ENABLE))
{
// Sleep effect, not official feature but however L2OFF features (like offline trade)
if (Config.OFFLINE_SLEEP_EFFECT)
@@ -49,7 +49,7 @@ public final class RequestRecipeItemMakeSelf extends L2GameClientPacket
return;
}
if (activeChar.isInCraftMode())
if (activeChar.isCrafting())
{
activeChar.sendMessage("Currently in Craft Mode");
return;
@@ -69,7 +69,7 @@ public final class RequestRecipeShopMakeItem extends L2GameClientPacket
return;
}
if (activeChar.isInCraftMode() || manufacturer.isInCraftMode())
if (activeChar.isCrafting() || manufacturer.isCrafting())
{
activeChar.sendMessage("Currently in Craft Mode");
return;
@@ -94,26 +94,26 @@ public class ScriptPackage
@Override
public String toString()
{
if (getScriptFiles().isEmpty() && getOtherFiles().isEmpty())
if (_scriptFiles.isEmpty() && _otherFiles.isEmpty())
{
return "Empty Package.";
}
String out = "Package Name: " + getName() + "\n";
String out = "Package Name: " + _name + "\n";
if (!getScriptFiles().isEmpty())
if (!_scriptFiles.isEmpty())
{
out += "Xml Script Files...\n";
for (ScriptDocument script : getScriptFiles())
for (ScriptDocument script : _scriptFiles)
{
out += script.getName() + "\n";
}
}
if (!getOtherFiles().isEmpty())
if (!_otherFiles.isEmpty())
{
out += "Other Files...\n";
for (String fileName : getOtherFiles())
for (String fileName : _otherFiles)
{
out += fileName + "\n";
}
@@ -97,6 +97,6 @@ public class CompiledScriptHolder implements Serializable
public boolean matches(File f)
{
return (f.lastModified() == getLastModified()) && (f.length() == getSize());
return (f.lastModified() == _lastModified) && (f.length() == _size);
}
}
@@ -80,7 +80,7 @@ public class L2SkillSummon extends L2Skill
{
final L2PcInstance player = (L2PcInstance) activeChar;
if (isCubic())
if (_isCubic)
{
if (getTargetType() != L2Skill.SkillTargetType.TARGET_SELF)
{
@@ -413,7 +413,7 @@ public abstract class L2Item
*/
public final int getItemGrade()
{
return getCrystalType();
return _crystalType;
}
/**
@@ -439,11 +439,11 @@ public abstract class L2Item
case TYPE2_SHIELD_ARMOR:
case TYPE2_ACCESSORY:
{
return _crystalCount + (crystalEnchantBonusArmor[getCrystalType()] * ((3 * enchantLevel) - 6));
return _crystalCount + (crystalEnchantBonusArmor[_crystalType] * ((3 * enchantLevel) - 6));
}
case TYPE2_WEAPON:
{
return _crystalCount + (crystalEnchantBonusWeapon[getCrystalType()] * ((2 * enchantLevel) - 3));
return _crystalCount + (crystalEnchantBonusWeapon[_crystalType] * ((2 * enchantLevel) - 3));
}
default:
{
@@ -458,11 +458,11 @@ public abstract class L2Item
case TYPE2_SHIELD_ARMOR:
case TYPE2_ACCESSORY:
{
return _crystalCount + (crystalEnchantBonusArmor[getCrystalType()] * enchantLevel);
return _crystalCount + (crystalEnchantBonusArmor[_crystalType] * enchantLevel);
}
case TYPE2_WEAPON:
{
return _crystalCount + (crystalEnchantBonusWeapon[getCrystalType()] * enchantLevel);
return _crystalCount + (crystalEnchantBonusWeapon[_crystalType] * enchantLevel);
}
default:
{
@@ -568,7 +568,7 @@ public abstract class L2Item
public boolean isPotion()
{
return (getItemType() == L2EtcItemType.POTION);
return (_type == L2EtcItemType.POTION);
}
/**
@@ -65,7 +65,7 @@ public class MinionList
int count = 0;
synchronized (minionReferences)
{
for (L2MinionInstance minion : getSpawnedMinions())
for (L2MinionInstance minion : minionReferences)
{
if (minion.getNpcId() == minionId)
{
@@ -78,7 +78,7 @@ public class MinionList
public boolean hasMinions()
{
return getSpawnedMinions().size() > 0;
return minionReferences.size() > 0;
}
public List<L2MinionInstance> getSpawnedMinions()
@@ -97,7 +97,7 @@ public class MinionList
public int lazyCountSpawnedMinionsGroups()
{
final Set<Integer> seenGroups = new HashSet<>();
for (L2MinionInstance minion : getSpawnedMinions())
for (L2MinionInstance minion : minionReferences)
{
seenGroups.add(minion.getNpcId());
}
@@ -106,7 +106,7 @@ public class MultiSort
totalValue += 1 / currValue;
}
return getCount() / totalValue;
return getValues().size() / totalValue;
}
public final List<?> getKeys()
@@ -141,7 +141,7 @@ public class MultiSort
return -1;
}
return getTotalValue() / getCount();
return getTotalValue() / getValues().size();
}
public final double getStandardDeviation()
@@ -154,7 +154,7 @@ public class MultiSort
final List<Double> tempValList = new ArrayList<>();
final int meanValue = getMean();
final int numValues = getCount();
final int numValues = getValues().size();
for (int value : getValues())
{
@@ -226,7 +226,7 @@ public class MultiSort
int lastValue = 0;
if (!isSortDescending())
if (!_isSortDescending)
{
// If there are no keys, just return the ascendingly sorted values.
if (getKeys().isEmpty())