diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Player.java
index 1daa6d4ace..a669fd50f7 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7352,7 +7352,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Player.java
index d76be17e1c..e5c4aad162 100644
--- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7355,7 +7355,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Player.java
index 4c90d19e66..6b6e76ada8 100644
--- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7357,7 +7357,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Player.java
index 922c117c35..d050537e2c 100644
--- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7352,7 +7352,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Player.java
index 48ee4697c1..c2821fec32 100644
--- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7368,7 +7368,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Player.java
index fe0c71fa1a..d17de6915c 100644
--- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7368,7 +7368,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Player.java
index bbbcb2acc5..774b3db270 100644
--- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7369,7 +7369,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java
index 0fac4f5f5a..460a0d83dd 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7384,7 +7384,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java
index fc943294e4..532ed995e4 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7486,7 +7486,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java
index 92ffcb7dc9..c10bccfe0b 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7512,7 +7512,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java
index 8d088ab697..c4b8c80b70 100644
--- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7549,7 +7549,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_10.0_MasterClass/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index b2bd1a7471..8c1ab51f07 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -200,7 +200,6 @@ public class OfflineTraderTable
client.setPlayer(player);
client.setAccountName(player.getAccountName());
player.setClient(client);
- player.setOfflineMode(true);
player.setOnlineStatus(false);
player.setOfflineStartTime(time);
if (Config.OFFLINE_SLEEP_EFFECT)
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Player.java
index 9bc35223b8..377d5bc1a5 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -441,7 +441,6 @@ public class Player extends Playable
private double _mpUpdateDecCheck = .0;
private double _mpUpdateInterval = .0;
private long _timerToAttack;
- private boolean _isInOfflineMode = false;
private boolean _isTradeOff = false;
private long _offlineShopStart = 0;
public int _originalNameColorOffline = 0xFFFFFF;
@@ -7993,15 +7992,7 @@ public class Player extends Playable
statement.setLong(33, getDeleteTimer());
statement.setString(34, getTitle());
statement.setInt(35, getAccessLevel().getLevel());
- if (_isInOfflineMode || isOnline()) // in offline mode or online
- {
- statement.setInt(36, 1);
- }
- else
- {
- statement.setInt(36, isOnline() ? 1 : 0);
- }
-
+ statement.setInt(36, isOnlineInt());
statement.setInt(37, isIn7sDungeon() ? 1 : 0);
statement.setInt(38, getClanPrivileges());
statement.setInt(39, getWantsPeace());
@@ -8163,14 +8154,34 @@ public class Player extends Playable
}
/**
- * Return True if the Player is online.
- * @return if player is online
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
return _isOnline;
}
+ public int isOnlineInt()
+ {
+ if (_isOnline && (_client != null))
+ {
+ return _client.isDetached() ? 2 : 1;
+ }
+ return 0;
+ }
+
+ /**
+ * Verifies if the player is in offline mode.
+ * The offline mode may happen for different reasons:
+ * Abnormally: Player gets abruptly disconnected from server.
+ * Normally: The player gets into offline shop mode, only available by enabling the offline shop mod.
+ * @return {@code true} if the player is in offline mode, {@code false} otherwise
+ */
+ public boolean isInOfflineMode()
+ {
+ return (_client == null) || _client.isDetached();
+ }
+
/**
* Checks if is in7s dungeon.
* @return true, if is in7s dungeon
@@ -14278,24 +14289,6 @@ public class Player extends Playable
return color;
}
- /**
- * Checks if is offline.
- * @return true, if is offline
- */
- public boolean isInOfflineMode()
- {
- return _isInOfflineMode;
- }
-
- /**
- * Sets the offline.
- * @param set the new offline
- */
- public void setOfflineMode(boolean set)
- {
- _isInOfflineMode = set;
- }
-
/**
* Checks if is trade disabled.
* @return true, if is trade disabled
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/item/instance/Item.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/item/instance/Item.java
index 5efde536c4..3c872c62f6 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/item/instance/Item.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/model/item/instance/Item.java
@@ -79,7 +79,10 @@ public class Item extends WorldObject
FREIGHT
}
+ /** Owner */
private int _ownerId;
+ private Player _owner;
+
private int _count;
private int _initCount;
private int _time;
@@ -171,6 +174,7 @@ public class Item extends WorldObject
return;
}
+ _owner = null;
_ownerId = ownerId;
_storedInDb = false;
}
@@ -1072,6 +1076,11 @@ public class Item extends WorldObject
{
ItemsOnGroundManager.getInstance().save(this);
}
+
+ if ((dropper != null) && dropper.isPlayer())
+ {
+ _owner = null;
+ }
}
/**
@@ -1369,4 +1378,14 @@ public class Item extends WorldObject
{
return true;
}
+
+ @Override
+ public Player getActingPlayer()
+ {
+ if ((_owner == null) && (_ownerId != 0))
+ {
+ _owner = World.getInstance().getPlayer(_ownerId);
+ }
+ return _owner;
+ }
}
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/GameClient.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/GameClient.java
index 498288987f..1f795a50f1 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/GameClient.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/network/GameClient.java
@@ -664,7 +664,6 @@ public class GameClient extends ChannelInboundHandler
{
if (!Config.OFFLINE_MODE_IN_PEACE_ZONE || (Config.OFFLINE_MODE_IN_PEACE_ZONE && player.isInsideZone(ZoneId.PEACE)))
{
- player.setOfflineMode(true);
player.setOnlineStatus(false);
player.leaveParty();
player.store();
diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
index b2bd1a7471..8c1ab51f07 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/data/sql/OfflineTraderTable.java
@@ -200,7 +200,6 @@ public class OfflineTraderTable
client.setPlayer(player);
client.setAccountName(player.getAccountName());
player.setClient(client);
- player.setOfflineMode(true);
player.setOnlineStatus(false);
player.setOfflineStartTime(time);
if (Config.OFFLINE_SLEEP_EFFECT)
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Player.java
index f8fc21c118..119a55a309 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -455,7 +455,6 @@ public class Player extends Playable
private double _mpUpdateDecCheck = .0;
private double _mpUpdateInterval = .0;
private long _timerToAttack;
- private boolean _isInOfflineMode = false;
private boolean _isTradeOff = false;
private long _offlineShopStart = 0;
public int _originalNameColorOffline = 0xFFFFFF;
@@ -8140,15 +8139,7 @@ public class Player extends Playable
statement.setLong(33, getDeleteTimer());
statement.setString(34, getTitle());
statement.setInt(35, getAccessLevel().getLevel());
- if (_isInOfflineMode || isOnline()) // in offline mode or online
- {
- statement.setInt(36, 1);
- }
- else
- {
- statement.setInt(36, isOnline() ? 1 : 0);
- }
-
+ statement.setInt(36, isOnlineInt());
statement.setInt(37, isIn7sDungeon() ? 1 : 0);
statement.setInt(38, getClanPrivileges());
statement.setInt(39, getWantsPeace());
@@ -8310,14 +8301,34 @@ public class Player extends Playable
}
/**
- * Return True if the Player is online.
- * @return if player is online
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
return _isOnline;
}
+ public int isOnlineInt()
+ {
+ if (_isOnline && (_client != null))
+ {
+ return _client.isDetached() ? 2 : 1;
+ }
+ return 0;
+ }
+
+ /**
+ * Verifies if the player is in offline mode.
+ * The offline mode may happen for different reasons:
+ * Abnormally: Player gets abruptly disconnected from server.
+ * Normally: The player gets into offline shop mode, only available by enabling the offline shop mod.
+ * @return {@code true} if the player is in offline mode, {@code false} otherwise
+ */
+ public boolean isInOfflineMode()
+ {
+ return (_client == null) || _client.isDetached();
+ }
+
/**
* Checks if is in7s dungeon.
* @return true, if is in7s dungeon
@@ -14640,24 +14651,6 @@ public class Player extends Playable
return color;
}
- /**
- * Checks if is offline.
- * @return true, if is offline
- */
- public boolean isInOfflineMode()
- {
- return _isInOfflineMode;
- }
-
- /**
- * Sets the offline.
- * @param set the new offline
- */
- public void setOfflineMode(boolean set)
- {
- _isInOfflineMode = set;
- }
-
/**
* Checks if is trade disabled.
* @return true, if is trade disabled
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/item/instance/Item.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/item/instance/Item.java
index 1422d2a5c6..03e6a52344 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/item/instance/Item.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/model/item/instance/Item.java
@@ -80,7 +80,10 @@ public class Item extends WorldObject
FREIGHT
}
+ /** Owner */
private int _ownerId;
+ private Player _owner;
+
private int _count;
private int _initCount;
private int _time;
@@ -173,6 +176,7 @@ public class Item extends WorldObject
return;
}
+ _owner = null;
_ownerId = ownerId;
_storedInDb = false;
}
@@ -1133,6 +1137,11 @@ public class Item extends WorldObject
{
ItemsOnGroundManager.getInstance().save(this);
}
+
+ if ((dropper != null) && dropper.isPlayer())
+ {
+ _owner = null;
+ }
}
/**
@@ -1436,4 +1445,14 @@ public class Item extends WorldObject
{
return true;
}
+
+ @Override
+ public Player getActingPlayer()
+ {
+ if ((_owner == null) && (_ownerId != 0))
+ {
+ _owner = World.getInstance().getPlayer(_ownerId);
+ }
+ return _owner;
+ }
}
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/GameClient.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/GameClient.java
index a0e20b5b71..2458da9edc 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/GameClient.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/network/GameClient.java
@@ -658,7 +658,6 @@ public class GameClient extends ChannelInboundHandler
{
if (!Config.OFFLINE_MODE_IN_PEACE_ZONE || (Config.OFFLINE_MODE_IN_PEACE_ZONE && player.isInsideZone(ZoneId.PEACE)))
{
- player.setOfflineMode(true);
player.setOnlineStatus(false);
player.leaveParty();
player.store();
diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Player.java
index c1568a21fa..7b7529b9d5 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7668,7 +7668,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Player.java
index 7d3e294b83..9877b8cd50 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7551,7 +7551,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Player.java
index 3d3fb08f60..d4434fc763 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7310,7 +7310,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Player.java
index 00fafa1d1c..0fab3049bd 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7310,7 +7310,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Player.java
index ca450a3a46..3424a94307 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7296,7 +7296,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Player.java
index e78a6dfb6a..4e68dffb61 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7323,7 +7323,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Player.java
index 36137b9fdc..0c559cf6e6 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7323,7 +7323,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Player.java
index 9dc7ef09ba..60b126b4dd 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7276,7 +7276,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Player.java
index f8be00e615..8e09cef2e8 100644
--- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7288,7 +7288,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Player.java
index 534a722c52..86ae0c7327 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7428,7 +7428,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java
index 186f840b14..2a1835ad55 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7494,7 +7494,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java
index fa15dec1f4..af9fd00b68 100644
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/model/actor/Player.java
@@ -7494,7 +7494,7 @@ public class Player extends Playable
}
/**
- * @return True if the Player is on line.
+ * @return True if the Player is online.
*/
public boolean isOnline()
{
diff --git a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
index 3902b96886..28c98a858d 100644
--- a/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
+++ b/L2J_Mobius_Essence_6.0_BattleChronicle/java/org/l2jmobius/gameserver/taskmanager/ItemManaTaskManager.java
@@ -22,6 +22,7 @@ import java.util.concurrent.ConcurrentHashMap;
import org.l2jmobius.commons.threads.ThreadPool;
import org.l2jmobius.commons.util.Chronos;
+import org.l2jmobius.gameserver.model.actor.Player;
import org.l2jmobius.gameserver.model.item.instance.Item;
/**
@@ -54,7 +55,14 @@ public class ItemManaTaskManager implements Runnable
{
final Item item = entry.getKey();
ITEMS.remove(item);
- item.decreaseMana(true);
+
+ final Player player = item.getActingPlayer();
+ if ((player == null) || player.isInOfflineMode())
+ {
+ return;
+ }
+
+ item.decreaseMana(item.isEquipped());
}
}