|
@@ -592,8 +592,10 @@ public final class L2PcInstance extends L2Playable
|
|
|
/** The list containing all shortCuts of this L2PcInstance */
|
|
|
private final ShortCuts _shortCuts = new ShortCuts(this);
|
|
|
|
|
|
- /** The list containing all macroses of this L2PcInstance */
|
|
|
- private final MacroList _macroses = new MacroList(this);
|
|
|
+ /**
|
|
|
+ * The list containing all macros of this L2PcInstance.
|
|
|
+ */
|
|
|
+ private final MacroList _macros = new MacroList(this);
|
|
|
|
|
|
private final List<L2PcInstance> _snoopListener = new FastList<L2PcInstance>();
|
|
|
private final List<L2PcInstance> _snoopedPlayer = new FastList<L2PcInstance>();
|
|
@@ -1894,29 +1896,27 @@ public final class L2PcInstance extends L2Playable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Add a L2Macro to the L2PcInstance _macroses<BR><BR>
|
|
|
- * @param macro
|
|
|
+ * @param macro the macro to add to this L2PcInstance.
|
|
|
*/
|
|
|
public void registerMacro(L2Macro macro)
|
|
|
{
|
|
|
- _macroses.registerMacro(macro);
|
|
|
+ _macros.registerMacro(macro);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Delete the L2Macro corresponding to the Identifier from the L2PcInstance _macroses.<BR><BR>
|
|
|
- * @param id
|
|
|
+ * @param id the macro Id to delete.
|
|
|
*/
|
|
|
public void deleteMacro(int id)
|
|
|
{
|
|
|
- _macroses.deleteMacro(id);
|
|
|
+ _macros.deleteMacro(id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @return all L2Macro of the L2PcInstance.
|
|
|
*/
|
|
|
- public MacroList getMacroses()
|
|
|
+ public MacroList getMacros()
|
|
|
{
|
|
|
- return _macroses;
|
|
|
+ return _macros;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -7343,7 +7343,10 @@ public final class L2PcInstance extends L2Playable
|
|
|
player.setClassId(player.getBaseClass());
|
|
|
_log.warning("Player "+player.getName()+" reverted to base class. Possibly has tried a relogin exploit while subclassing.");
|
|
|
}
|
|
|
- else player._activeClass = activeClassId;
|
|
|
+ else
|
|
|
+ {
|
|
|
+ player._activeClass = activeClassId;
|
|
|
+ }
|
|
|
|
|
|
player.setApprentice(rset.getInt("apprentice"));
|
|
|
player.setSponsor(rset.getInt("sponsor"));
|
|
@@ -7363,9 +7366,6 @@ public final class L2PcInstance extends L2Playable
|
|
|
|
|
|
player.setVitalityPoints(rset.getInt("vitality_points"), true);
|
|
|
|
|
|
- // Add the L2PcInstance object in _allObjects
|
|
|
- //L2World.getInstance().storeObject(player);
|
|
|
-
|
|
|
// Set the x,y,z position of the L2PcInstance and make it invisible
|
|
|
player.setXYZInvisible(rset.getInt("x"), rset.getInt("y"), rset.getInt("z"));
|
|
|
|
|
@@ -7400,20 +7400,24 @@ public final class L2PcInstance extends L2Playable
|
|
|
statement.close();
|
|
|
|
|
|
// Set Hero status if it applies
|
|
|
- if (Hero.getInstance().getHeroes() != null && Hero.getInstance().getHeroes().containsKey(objectId))
|
|
|
+ if (Hero.getInstance().isHero(objectId))
|
|
|
+ {
|
|
|
player.setHero(true);
|
|
|
+ }
|
|
|
|
|
|
- // Retrieve from the database all skills of this L2PcInstance and add them to _skills
|
|
|
// Retrieve from the database all items of this L2PcInstance and add them to _inventory
|
|
|
player.getInventory().restore();
|
|
|
player.getFreight().restore();
|
|
|
if (!Config.WAREHOUSE_CACHE)
|
|
|
+ {
|
|
|
player.getWarehouse();
|
|
|
+ }
|
|
|
|
|
|
// Retrieve from the database all secondary data of this L2PcInstance
|
|
|
- // and reward expertise/lucky skills if necessary.
|
|
|
// Note that Clan, Noblesse and Hero skills are given separately and not here.
|
|
|
+ // Retrieve from the database all skills of this L2PcInstance and add them to _skills
|
|
|
player.restoreCharData();
|
|
|
+ // Reward auto-get skills and all available skills if auto-learn skills is true.
|
|
|
player.rewardSkills();
|
|
|
|
|
|
// buff and status icons
|
|
@@ -7425,7 +7429,8 @@ public final class L2PcInstance extends L2Playable
|
|
|
player.setCurrentHp(currentHp);
|
|
|
player.setCurrentMp(currentMp);
|
|
|
|
|
|
- if (currentHp < 0.5) {
|
|
|
+ if (currentHp < 0.5)
|
|
|
+ {
|
|
|
player.setIsDead(true);
|
|
|
player.stopHpMpRegeneration();
|
|
|
}
|
|
@@ -7455,7 +7460,6 @@ public final class L2PcInstance extends L2Playable
|
|
|
{
|
|
|
L2DatabaseFactory.close(con);
|
|
|
}
|
|
|
-
|
|
|
return player;
|
|
|
}
|
|
|
|
|
@@ -7559,15 +7563,26 @@ public final class L2PcInstance extends L2Playable
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Restores secondary data for the L2PcInstance, based on the current class index.
|
|
|
+ * Restores:
|
|
|
+ * <ul>
|
|
|
+ * <li>Skills</li>
|
|
|
+ * <li>Macros</li>
|
|
|
+ * <li>Short-cuts</li>
|
|
|
+ * <li>Henna</li>
|
|
|
+ * <li>Teleport Bookmark</li>
|
|
|
+ * <li>Recipe Book</li>
|
|
|
+ * <li>Recipe Shop List (If configuration enabled)</li>
|
|
|
+ * <li>Premium Item List</li>
|
|
|
+ * <li>Pet Inventory Items</li>
|
|
|
+ * </ul>
|
|
|
*/
|
|
|
private void restoreCharData()
|
|
|
{
|
|
|
// Retrieve from the database all skills of this L2PcInstance and add them to _skills.
|
|
|
restoreSkills();
|
|
|
|
|
|
- // Retrieve from the database all macroses of this L2PcInstance and add them to _macroses.
|
|
|
- _macroses.restore();
|
|
|
+ // Retrieve from the database all macroses of this L2PcInstance and add them to _macros.
|
|
|
+ _macros.restore();
|
|
|
|
|
|
// Retrieve from the database all shortCuts of this L2PcInstance and add them to _shortCuts.
|
|
|
_shortCuts.restore();
|
|
@@ -7581,15 +7596,15 @@ public final class L2PcInstance extends L2Playable
|
|
|
// Retrieve from the database the recipe book of this L2PcInstance.
|
|
|
restoreRecipeBook(true);
|
|
|
|
|
|
- // Restore Recipe Shop list
|
|
|
+ // Restore Recipe Shop list.
|
|
|
if(Config.STORE_RECIPE_SHOPLIST)
|
|
|
restoreRecipeShopList();
|
|
|
|
|
|
- // Load Premium Item List
|
|
|
+ // Load Premium Item List.
|
|
|
loadPremiumItemList();
|
|
|
|
|
|
- // Check for items in pet inventory
|
|
|
- checkPetInvItems();
|
|
|
+ // Restore items in pet inventory.
|
|
|
+ restorePetInventoryItems();
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -15083,10 +15098,12 @@ public final class L2PcInstance extends L2Playable
|
|
|
_petItems = haveit;
|
|
|
}
|
|
|
|
|
|
- private void checkPetInvItems()
|
|
|
+ /**
|
|
|
+ * Restore Pet's inventory items from database.
|
|
|
+ */
|
|
|
+ private void restorePetInventoryItems()
|
|
|
{
|
|
|
Connection con = null;
|
|
|
-
|
|
|
try
|
|
|
{
|
|
|
con = L2DatabaseFactory.getInstance().getConnection();
|