Delay tasks for frequent packet broadcasts.
This commit is contained in:
+1
-2
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
||||
player.sendPacket(msg);
|
||||
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -438,6 +438,8 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2303,7 +2305,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8755,9 +8757,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9577,6 +9586,18 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10018,7 +10039,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -826,18 +843,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -85,7 +85,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -442,7 +441,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Friend list
|
||||
player.sendPacket(new L2FriendList(player));
|
||||
|
||||
+1
-2
@@ -51,7 +51,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -698,7 +697,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
Vendored
+1
-2
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
||||
player.sendPacket(msg);
|
||||
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
Vendored
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -440,6 +440,8 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2305,7 +2307,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8758,9 +8760,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9580,6 +9589,18 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10021,7 +10042,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -826,18 +843,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -87,7 +87,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -447,7 +446,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Friend list
|
||||
player.sendPacket(new L2FriendList(player));
|
||||
|
||||
+1
-2
@@ -51,7 +51,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -698,7 +697,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
+1
-2
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
||||
player.sendPacket(msg);
|
||||
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -442,6 +442,8 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2307,7 +2309,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8760,9 +8762,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9582,6 +9591,18 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10023,7 +10044,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -826,18 +843,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -87,7 +87,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -447,7 +446,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Friend list
|
||||
player.sendPacket(new L2FriendList(player));
|
||||
|
||||
+1
-2
@@ -51,7 +51,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -698,7 +697,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
Vendored
+1
-2
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
||||
player.sendPacket(msg);
|
||||
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
Vendored
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -446,6 +446,8 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2315,7 +2317,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8778,9 +8780,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9596,6 +9605,18 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10037,7 +10058,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -826,18 +843,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -87,7 +87,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -447,7 +446,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Friend list
|
||||
player.sendPacket(new L2FriendList(player));
|
||||
|
||||
+1
-2
@@ -51,7 +51,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -698,7 +697,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
+1
-2
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
||||
player.sendPacket(msg);
|
||||
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -444,6 +444,8 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2312,7 +2314,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8799,9 +8801,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9621,6 +9630,18 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10062,7 +10083,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -826,18 +843,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -88,7 +88,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -448,7 +447,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Friend list
|
||||
player.sendPacket(new L2FriendList(player));
|
||||
|
||||
+1
-2
@@ -50,7 +50,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -648,7 +647,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
+1
-2
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
||||
player.sendPacket(msg);
|
||||
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -445,6 +445,8 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2325,7 +2327,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8812,9 +8814,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9634,6 +9643,18 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10075,7 +10096,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -826,18 +843,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -88,7 +88,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -448,7 +447,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Friend list
|
||||
player.sendPacket(new L2FriendList(player));
|
||||
|
||||
+1
-2
@@ -50,7 +50,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -648,7 +647,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
+1
-2
@@ -28,7 +28,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
||||
player.sendPacket(msg);
|
||||
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -445,6 +445,8 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2325,7 +2327,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8813,9 +8815,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9635,6 +9644,18 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10081,7 +10102,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -826,18 +843,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -88,7 +88,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -448,7 +447,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Friend list
|
||||
player.sendPacket(new L2FriendList(player));
|
||||
|
||||
+1
-2
@@ -50,7 +50,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -648,7 +647,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
Vendored
+1
-2
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -95,7 +94,7 @@ public class ClassChange extends AbstractEffect
|
||||
|
||||
player.updateSymbolSealSkills();
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
Vendored
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -456,6 +456,8 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2260,7 +2262,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8841,9 +8843,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9663,6 +9672,18 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10116,7 +10137,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -834,18 +851,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -89,7 +89,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -453,7 +452,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Friend list
|
||||
player.sendPacket(new L2FriendList(player));
|
||||
|
||||
+1
-2
@@ -50,7 +50,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -648,7 +647,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
+1
-2
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -95,7 +94,7 @@ public class ClassChange extends AbstractEffect
|
||||
|
||||
player.updateSymbolSealSkills();
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-5
@@ -16,13 +16,11 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
@@ -54,8 +52,6 @@ public class ExpModify extends AbstractStatAddEffect
|
||||
return;
|
||||
}
|
||||
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||
player.sendUserBoostStat();
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-5
@@ -16,13 +16,11 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
@@ -46,8 +44,6 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
||||
return;
|
||||
}
|
||||
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||
player.sendUserBoostStat();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -81,6 +81,7 @@ import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
||||
import org.l2jmobius.gameserver.data.xml.SymbolSealData;
|
||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.enums.BroochJewel;
|
||||
import org.l2jmobius.gameserver.enums.CastleSide;
|
||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||
@@ -312,6 +313,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ExStopScenePlayer;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUseSharedGroupItem;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoAbnormalVisualEffect;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
||||
@@ -453,6 +455,9 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _userBoostStatTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2291,7 +2296,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8943,9 +8948,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9765,6 +9777,32 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendUserBoostStat()
|
||||
{
|
||||
if (_userBoostStatTask == null)
|
||||
{
|
||||
_userBoostStatTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.VITALITY));
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.BUFFS));
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.PASSIVE));
|
||||
_userBoostStatTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10218,7 +10256,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -834,18 +851,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -91,7 +91,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -462,7 +461,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Send Equipped Items
|
||||
player.sendPacket(new ExUserInfoEquipSlot(player));
|
||||
|
||||
+1
-2
@@ -50,7 +50,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -677,7 +676,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
+1
-4
@@ -20,7 +20,6 @@ import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.enums.ItemGrade;
|
||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
@@ -421,9 +420,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
||||
// Send exp bonus change.
|
||||
if (containsMask(UserInfoType.VITA_FAME))
|
||||
{
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
||||
_player.sendUserBoostStat();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Vendored
+1
-2
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -95,7 +94,7 @@ public class ClassChange extends AbstractEffect
|
||||
|
||||
player.updateSymbolSealSkills();
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
Vendored
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-5
@@ -16,13 +16,11 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
@@ -54,8 +52,6 @@ public class ExpModify extends AbstractStatAddEffect
|
||||
return;
|
||||
}
|
||||
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||
player.sendUserBoostStat();
|
||||
}
|
||||
}
|
||||
|
||||
+1
-5
@@ -16,13 +16,11 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
@@ -46,8 +44,6 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
||||
return;
|
||||
}
|
||||
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||
player.sendUserBoostStat();
|
||||
}
|
||||
}
|
||||
|
||||
+21
-1
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+40
-2
@@ -83,6 +83,7 @@ import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
||||
import org.l2jmobius.gameserver.data.xml.SymbolSealData;
|
||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.enums.BroochJewel;
|
||||
import org.l2jmobius.gameserver.enums.CastleSide;
|
||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||
@@ -318,6 +319,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ExStopScenePlayer;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUseSharedGroupItem;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoAbnormalVisualEffect;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
||||
@@ -466,6 +468,9 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _userBoostStatTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2308,7 +2313,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8969,9 +8974,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9791,6 +9803,32 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendUserBoostStat()
|
||||
{
|
||||
if (_userBoostStatTask == null)
|
||||
{
|
||||
_userBoostStatTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.VITALITY));
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.BUFFS));
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.PASSIVE));
|
||||
_userBoostStatTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10245,7 +10283,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
+30
-4
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -834,18 +851,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -92,7 +92,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -467,7 +466,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Send Equipped Items
|
||||
player.sendPacket(new ExUserInfoEquipSlot(player));
|
||||
|
||||
+1
-2
@@ -50,7 +50,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -677,7 +676,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
+1
-4
@@ -20,7 +20,6 @@ import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.enums.ItemGrade;
|
||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
@@ -421,9 +420,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
||||
// Send exp bonus change.
|
||||
if (containsMask(UserInfoType.VITA_FAME))
|
||||
{
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
||||
_player.sendUserBoostStat();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Vendored
+1
-2
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -96,7 +95,7 @@ public class ClassChange extends AbstractEffect
|
||||
|
||||
player.updateSymbolSealSkills();
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
Vendored
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-5
@@ -16,13 +16,11 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
@@ -54,8 +52,6 @@ public class ExpModify extends AbstractStatAddEffect
|
||||
return;
|
||||
}
|
||||
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||
player.sendUserBoostStat();
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-5
@@ -16,13 +16,11 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
@@ -46,8 +44,6 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
||||
return;
|
||||
}
|
||||
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||
player.sendUserBoostStat();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,6 +83,7 @@ import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
||||
import org.l2jmobius.gameserver.data.xml.SymbolSealData;
|
||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.enums.BroochJewel;
|
||||
import org.l2jmobius.gameserver.enums.CastleSide;
|
||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||
@@ -318,6 +319,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ExStopScenePlayer;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUseSharedGroupItem;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoAbnormalVisualEffect;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
||||
@@ -467,6 +469,9 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _userBoostStatTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2310,7 +2315,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9007,9 +9012,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9829,6 +9841,32 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendUserBoostStat()
|
||||
{
|
||||
if (_userBoostStatTask == null)
|
||||
{
|
||||
_userBoostStatTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.VITALITY));
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.BUFFS));
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.PASSIVE));
|
||||
_userBoostStatTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10283,7 +10321,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -834,18 +851,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -92,7 +92,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -471,7 +470,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Send Equipped Items
|
||||
player.sendPacket(new ExUserInfoEquipSlot(player));
|
||||
|
||||
+1
-2
@@ -50,7 +50,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -677,7 +676,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
+1
-4
@@ -20,7 +20,6 @@ import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.enums.ItemGrade;
|
||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
@@ -423,9 +422,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
||||
// Send exp bonus change.
|
||||
if (containsMask(UserInfoType.VITA_FAME))
|
||||
{
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
||||
_player.sendUserBoostStat();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Vendored
+1
-2
@@ -29,7 +29,6 @@ import org.l2jmobius.gameserver.model.olympiad.OlympiadManager;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||
@@ -96,7 +95,7 @@ public class ClassChange extends AbstractEffect
|
||||
|
||||
player.updateSymbolSealSkills();
|
||||
player.broadcastUserInfo();
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
player.sendPacket(new AcquireSkillList(player));
|
||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||
|
||||
Vendored
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
||||
import org.l2jmobius.gameserver.enums.StorageType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.effects.AbstractEffect;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
|
||||
/**
|
||||
* @author Sdw
|
||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
||||
effected.getStat().mergeAdd(stat, _amount);
|
||||
if (effected.isPlayer())
|
||||
{
|
||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
||||
effected.getActingPlayer().sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-5
@@ -16,13 +16,11 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
@@ -54,8 +52,6 @@ public class ExpModify extends AbstractStatAddEffect
|
||||
return;
|
||||
}
|
||||
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||
player.sendUserBoostStat();
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-5
@@ -16,13 +16,11 @@
|
||||
*/
|
||||
package handlers.effecthandlers;
|
||||
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.model.StatSet;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
|
||||
/**
|
||||
* @author Mobius
|
||||
@@ -46,8 +44,6 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
||||
return;
|
||||
}
|
||||
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
||||
player.sendUserBoostStat();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||
import org.l2jmobius.gameserver.model.actor.Player;
|
||||
@@ -93,6 +96,9 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1073,12 +1079,21 @@ public class EffectList
|
||||
* @param partyOnly {@code true} only party icons need to be updated.
|
||||
*/
|
||||
public void updateEffectIcons(boolean partyOnly)
|
||||
{
|
||||
if (!partyOnly)
|
||||
{
|
||||
_updateAbnormalStatus.compareAndSet(false, true);
|
||||
}
|
||||
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
final Player player = _owner.getActingPlayer();
|
||||
if (player != null)
|
||||
{
|
||||
final Party party = player.getParty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && _updateAbnormalStatus.get()) ? Optional.of(new AbnormalStatusUpdate()) : Optional.empty();
|
||||
final Optional<PartySpelled> ps = ((party != null) || _owner.isSummon()) ? Optional.of(new PartySpelled(_owner)) : Optional.empty();
|
||||
final Optional<ExOlympiadSpelledInfo> os = (player.isInOlympiadMode() && player.isOlympiadStart()) ? Optional.of(new ExOlympiadSpelledInfo(player)) : Optional.empty();
|
||||
if (!_actives.isEmpty())
|
||||
@@ -1139,6 +1154,11 @@ public class EffectList
|
||||
{
|
||||
_owner.sendPacket(upd);
|
||||
}
|
||||
|
||||
_updateAbnormalStatus.set(false);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -83,6 +83,7 @@ import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
||||
import org.l2jmobius.gameserver.data.xml.SymbolSealData;
|
||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.enums.BroochJewel;
|
||||
import org.l2jmobius.gameserver.enums.CastleSide;
|
||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
||||
@@ -318,6 +319,7 @@ import org.l2jmobius.gameserver.network.serverpackets.ExStopScenePlayer;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUseSharedGroupItem;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoAbnormalVisualEffect;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
||||
@@ -467,6 +469,9 @@ public class Player extends Playable
|
||||
|
||||
private ScheduledFuture<?> _itemListTask;
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
private ScheduledFuture<?> _storageCountTask;
|
||||
private ScheduledFuture<?> _userBoostStatTask;
|
||||
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
@@ -2310,7 +2315,7 @@ public class Player extends Playable
|
||||
|
||||
if (getInventoryLimit() != oldInvLimit)
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9035,9 +9040,16 @@ public class Player extends Playable
|
||||
*/
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalVisualEffectTask == null)
|
||||
{
|
||||
_abnormalVisualEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
||||
broadcastCharInfo();
|
||||
_abnormalVisualEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -9857,6 +9869,32 @@ public class Player extends Playable
|
||||
}
|
||||
}
|
||||
|
||||
public void sendStorageMaxCount()
|
||||
{
|
||||
if (_storageCountTask == null)
|
||||
{
|
||||
_storageCountTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
_storageCountTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
public void sendUserBoostStat()
|
||||
{
|
||||
if (_userBoostStatTask == null)
|
||||
{
|
||||
_userBoostStatTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.VITALITY));
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.BUFFS));
|
||||
sendPacket(new ExUserBoostStat(this, BonusExpType.PASSIVE));
|
||||
_userBoostStatTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 1. Add the specified class ID as a subclass (up to the maximum number of <b>three</b>) for this character.<br>
|
||||
* 2. This method no longer changes the active _classIndex of the player. This is only done by the calling of setActiveClass() method as that should be the only way to do so.
|
||||
@@ -10311,7 +10349,7 @@ public class Player extends Playable
|
||||
sendPacket(new ShortCutInit(this));
|
||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||
sendPacket(new SkillCoolTime(this));
|
||||
sendPacket(new ExStorageMaxCount(this));
|
||||
sendStorageMaxCount();
|
||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||
}
|
||||
finally
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _summonPoints = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -192,6 +199,12 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalVisualEffects()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||
{
|
||||
@@ -214,6 +227,10 @@ public abstract class Summon extends Playable
|
||||
player.sendPacket(packet);
|
||||
});
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -834,18 +851,27 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
{
|
||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
}
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
+1
-2
@@ -92,7 +92,6 @@ import org.l2jmobius.gameserver.network.serverpackets.ExQuestItemList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExRotation;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||
@@ -471,7 +470,7 @@ public class EnterWorld implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
// Expand Skill
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
|
||||
// Send Equipped Items
|
||||
player.sendPacket(new ExUserInfoEquipSlot(player));
|
||||
|
||||
+1
-2
@@ -50,7 +50,6 @@ import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillDone;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAcquirableSkillListByClass;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.PledgeSkillList;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
||||
@@ -677,7 +676,7 @@ public class RequestAcquireSkill implements IClientIncomingPacket
|
||||
// If skill is expand type then sends packet:
|
||||
if ((_id >= 1368) && (_id <= 1372))
|
||||
{
|
||||
player.sendPacket(new ExStorageMaxCount(player));
|
||||
player.sendStorageMaxCount();
|
||||
}
|
||||
|
||||
// Notify scripts of the skill learn.
|
||||
|
||||
+1
-4
@@ -20,7 +20,6 @@ import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.network.PacketWriter;
|
||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||
import org.l2jmobius.gameserver.enums.ItemGrade;
|
||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||
@@ -429,9 +428,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
||||
// Send exp bonus change.
|
||||
if (containsMask(UserInfoType.VITA_FAME))
|
||||
{
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
||||
_player.sendUserBoostStat();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -91,8 +91,8 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
|
||||
private ScheduledFuture<?> _effectIconsUpdate;
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1377,13 +1377,9 @@ public class EffectList
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the previous call hasnt finished, if so, don't send packets uselessly again.
|
||||
if ((_effectIconsUpdate != null) && !_effectIconsUpdate.isDone())
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Schedule the icon update packets 500miliseconds ahead, so it can gather-up most of the changes.
|
||||
_effectIconsUpdate = ThreadPool.schedule(() ->
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
AbnormalStatusUpdate asu = null;
|
||||
PartySpelled ps = null;
|
||||
@@ -1506,8 +1502,9 @@ public class EffectList
|
||||
}
|
||||
}
|
||||
|
||||
_effectIconsUpdate = null;
|
||||
}, 500);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
private void addIcon(BuffInfo info, AbnormalStatusUpdate asu, PartySpelled ps, PartySpelled psSummon, ExOlympiadSpelledInfo os, boolean isSummon)
|
||||
|
||||
@@ -389,6 +389,8 @@ public class Player extends Playable
|
||||
private long _lastAccess;
|
||||
private long _uptime;
|
||||
|
||||
private ScheduledFuture<?> _skillListTask;
|
||||
|
||||
private boolean _subclassLock = false;
|
||||
protected int _baseClass;
|
||||
protected int _activeClass;
|
||||
@@ -9574,34 +9576,41 @@ public class Player extends Playable
|
||||
|
||||
public void sendSkillList()
|
||||
{
|
||||
boolean isDisabled = false;
|
||||
final SkillList sl = new SkillList();
|
||||
for (Skill s : getAllSkills())
|
||||
if (_skillListTask == null)
|
||||
{
|
||||
if (s == null)
|
||||
_skillListTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
boolean isDisabled = false;
|
||||
final SkillList skillList = new SkillList();
|
||||
for (Skill skill : getAllSkills())
|
||||
{
|
||||
if (skill == null)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if (_clan != null)
|
||||
{
|
||||
isDisabled = s.isClanSkill() && (_clan.getReputationScore() < 0);
|
||||
isDisabled = skill.isClanSkill() && (_clan.getReputationScore() < 0);
|
||||
}
|
||||
|
||||
boolean isEnchantable = SkillData.getInstance().isEnchantable(s.getId());
|
||||
boolean isEnchantable = SkillData.getInstance().isEnchantable(skill.getId());
|
||||
if (isEnchantable)
|
||||
{
|
||||
final EnchantSkillLearn esl = EnchantSkillGroupsData.getInstance().getSkillEnchantmentBySkillId(s.getId());
|
||||
if ((esl == null) || (s.getLevel() < esl.getBaseLevel()))
|
||||
final EnchantSkillLearn esl = EnchantSkillGroupsData.getInstance().getSkillEnchantmentBySkillId(skill.getId());
|
||||
if ((esl == null) || (skill.getLevel() < esl.getBaseLevel()))
|
||||
{
|
||||
isEnchantable = false;
|
||||
}
|
||||
}
|
||||
|
||||
sl.addSkill(s.getDisplayId(), s.getDisplayLevel(), s.isPassive(), isDisabled, isEnchantable);
|
||||
skillList.addSkill(skill.getDisplayId(), skill.getDisplayLevel(), skill.isPassive(), isDisabled, isEnchantable);
|
||||
}
|
||||
|
||||
sendPacket(sl);
|
||||
sendPacket(skillList);
|
||||
_skillListTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -16,7 +16,11 @@
|
||||
*/
|
||||
package org.l2jmobius.gameserver.model.actor;
|
||||
|
||||
import java.util.concurrent.ScheduledFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
import org.l2jmobius.Config;
|
||||
import org.l2jmobius.commons.threads.ThreadPool;
|
||||
import org.l2jmobius.commons.util.CommonUtil;
|
||||
import org.l2jmobius.commons.util.Rnd;
|
||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||
@@ -74,6 +78,9 @@ public abstract class Summon extends Playable
|
||||
private boolean _previousFollowStatus = true;
|
||||
protected boolean _restoreSummon = true;
|
||||
private int _shotsMask = 0;
|
||||
private ScheduledFuture<?> _abnormalEffectTask;
|
||||
private ScheduledFuture<?> _statusUpdateTask;
|
||||
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||
|
||||
// @formatter:off
|
||||
private static final int[] PASSIVE_SUMMONS =
|
||||
@@ -189,9 +196,19 @@ public abstract class Summon extends Playable
|
||||
|
||||
@Override
|
||||
public void updateAbnormalEffect()
|
||||
{
|
||||
if (_abnormalEffectTask == null)
|
||||
{
|
||||
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
World.getInstance().forEachVisibleObject(this, Player.class, player -> player.sendPacket(new SummonInfo(this, player, 1)));
|
||||
}
|
||||
_abnormalEffectTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Returns the mountable.
|
||||
@@ -823,19 +840,29 @@ public abstract class Summon extends Playable
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
_statusUpdateValue.set(value);
|
||||
if (_statusUpdateTask == null)
|
||||
{
|
||||
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
broadcastNpcInfo(_statusUpdateValue.get());
|
||||
|
||||
// final Party party = _owner.getParty();
|
||||
// if (party != null)
|
||||
// {
|
||||
// party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||
// }
|
||||
|
||||
updateEffectIcons(true);
|
||||
}
|
||||
_statusUpdateTask = null;
|
||||
}, 50);
|
||||
}
|
||||
}
|
||||
|
||||
public void broadcastNpcInfo(int value)
|
||||
{
|
||||
|
||||
@@ -91,8 +91,8 @@ public class EffectList
|
||||
private final Creature _owner;
|
||||
/** Hidden buffs count, prevents iterations. */
|
||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||
|
||||
private ScheduledFuture<?> _effectIconsUpdate;
|
||||
/** Delay task **/
|
||||
private ScheduledFuture<?> _updateEffectIconTask;
|
||||
|
||||
/**
|
||||
* Constructor for effect list.
|
||||
@@ -1377,13 +1377,9 @@ public class EffectList
|
||||
return;
|
||||
}
|
||||
|
||||
// Check if the previous call hasnt finished, if so, don't send packets uselessly again.
|
||||
if ((_effectIconsUpdate != null) && !_effectIconsUpdate.isDone())
|
||||
if (_updateEffectIconTask == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
// Schedule the icon update packets 500miliseconds ahead, so it can gather-up most of the changes.
|
||||
_effectIconsUpdate = ThreadPool.schedule(() ->
|
||||
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||
{
|
||||
AbnormalStatusUpdate asu = null;
|
||||
PartySpelled ps = null;
|
||||
@@ -1506,8 +1502,9 @@ public class EffectList
|
||||
}
|
||||
}
|
||||
|
||||
_effectIconsUpdate = null;
|
||||
}, 500);
|
||||
_updateEffectIconTask = null;
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
private void addIcon(BuffInfo info, AbnormalStatusUpdate asu, PartySpelled ps, PartySpelled psSummon, ExOlympiadSpelledInfo os, boolean isSummon)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user