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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
player.sendPacket(msg);
|
player.sendPacket(msg);
|
||||||
|
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||||
|
|||||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
|||||||
import org.l2jmobius.gameserver.enums.StorageType;
|
import org.l2jmobius.gameserver.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
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.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -438,6 +438,8 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2303,7 +2305,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8756,8 +8758,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -826,16 +843,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -442,7 +441,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Friend list
|
// Friend list
|
||||||
player.sendPacket(new L2FriendList(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
player.sendPacket(msg);
|
player.sendPacket(msg);
|
||||||
|
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
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.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
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.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -440,6 +440,8 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2305,7 +2307,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8759,8 +8761,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -826,16 +843,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -447,7 +446,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Friend list
|
// Friend list
|
||||||
player.sendPacket(new L2FriendList(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
player.sendPacket(msg);
|
player.sendPacket(msg);
|
||||||
|
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||||
|
|||||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
|||||||
import org.l2jmobius.gameserver.enums.StorageType;
|
import org.l2jmobius.gameserver.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
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.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -442,6 +442,8 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2307,7 +2309,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8761,8 +8763,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -826,16 +843,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -447,7 +446,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Friend list
|
// Friend list
|
||||||
player.sendPacket(new L2FriendList(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
player.sendPacket(msg);
|
player.sendPacket(msg);
|
||||||
|
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
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.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
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.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -446,6 +446,8 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2315,7 +2317,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8779,8 +8781,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
+52
-26
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -826,16 +843,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -447,7 +446,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Friend list
|
// Friend list
|
||||||
player.sendPacket(new L2FriendList(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
player.sendPacket(msg);
|
player.sendPacket(msg);
|
||||||
|
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||||
|
|||||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
|||||||
import org.l2jmobius.gameserver.enums.StorageType;
|
import org.l2jmobius.gameserver.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
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.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -444,6 +444,8 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2312,7 +2314,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8800,8 +8802,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -826,16 +843,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -448,7 +447,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Friend list
|
// Friend list
|
||||||
player.sendPacket(new L2FriendList(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
player.sendPacket(msg);
|
player.sendPacket(msg);
|
||||||
|
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||||
|
|||||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
|||||||
import org.l2jmobius.gameserver.enums.StorageType;
|
import org.l2jmobius.gameserver.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
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.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -445,6 +445,8 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2325,7 +2327,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8813,8 +8815,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -826,16 +843,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -448,7 +447,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Friend list
|
// Friend list
|
||||||
player.sendPacket(new L2FriendList(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -92,7 +91,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
player.sendPacket(msg);
|
player.sendPacket(msg);
|
||||||
|
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||||
|
|||||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
|||||||
import org.l2jmobius.gameserver.enums.StorageType;
|
import org.l2jmobius.gameserver.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
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.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -445,6 +445,8 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2325,7 +2327,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8814,8 +8816,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -826,16 +843,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -448,7 +447,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Friend list
|
// Friend list
|
||||||
player.sendPacket(new L2FriendList(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -95,7 +94,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
|
|
||||||
player.updateSymbolSealSkills();
|
player.updateSymbolSealSkills();
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
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.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
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.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -456,6 +456,8 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2260,7 +2262,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8842,8 +8844,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
+52
-26
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -834,16 +851,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -453,7 +452,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Friend list
|
// Friend list
|
||||||
player.sendPacket(new L2FriendList(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -95,7 +94,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
|
|
||||||
player.updateSymbolSealSkills();
|
player.updateSymbolSealSkills();
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
player.sendPacket(new ExAcquireAPSkillList(player));
|
||||||
|
|||||||
+1
-3
@@ -19,11 +19,9 @@ package handlers.effecthandlers;
|
|||||||
import org.l2jmobius.gameserver.enums.StorageType;
|
import org.l2jmobius.gameserver.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
if (effected.isPlayer())
|
||||||
{
|
{
|
||||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
effected.getActingPlayer().sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-5
@@ -16,13 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Mobius
|
||||||
@@ -54,8 +52,6 @@ public class ExpModify extends AbstractStatAddEffect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
player.sendUserBoostStat();
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-5
@@ -16,13 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Mobius
|
||||||
@@ -46,8 +44,6 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
player.sendUserBoostStat();
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 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.SymbolSealData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.BroochJewel;
|
import org.l2jmobius.gameserver.enums.BroochJewel;
|
||||||
import org.l2jmobius.gameserver.enums.CastleSide;
|
import org.l2jmobius.gameserver.enums.CastleSide;
|
||||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
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.ExStorageMaxCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUseSharedGroupItem;
|
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.ExUserInfoAbnormalVisualEffect;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
||||||
@@ -453,6 +455,9 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _userBoostStatTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2291,7 +2296,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8944,8 +8949,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -834,16 +851,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -462,7 +461,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Send Equipped Items
|
// Send Equipped Items
|
||||||
player.sendPacket(new ExUserInfoEquipSlot(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.enums.ItemGrade;
|
import org.l2jmobius.gameserver.enums.ItemGrade;
|
||||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
@@ -421,9 +420,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
|||||||
// Send exp bonus change.
|
// Send exp bonus change.
|
||||||
if (containsMask(UserInfoType.VITA_FAME))
|
if (containsMask(UserInfoType.VITA_FAME))
|
||||||
{
|
{
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
_player.sendUserBoostStat();
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
return true;
|
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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -95,7 +94,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
|
|
||||||
player.updateSymbolSealSkills();
|
player.updateSymbolSealSkills();
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
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.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
if (effected.isPlayer())
|
||||||
{
|
{
|
||||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
effected.getActingPlayer().sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-5
@@ -16,13 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Mobius
|
||||||
@@ -54,8 +52,6 @@ public class ExpModify extends AbstractStatAddEffect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
player.sendUserBoostStat();
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-5
@@ -16,13 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Mobius
|
||||||
@@ -46,8 +44,6 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
player.sendUserBoostStat();
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+69
-49
@@ -27,11 +27,14 @@ import java.util.Queue;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+42
-4
@@ -83,6 +83,7 @@ import org.l2jmobius.gameserver.data.xml.SkillTreeData;
|
|||||||
import org.l2jmobius.gameserver.data.xml.SymbolSealData;
|
import org.l2jmobius.gameserver.data.xml.SymbolSealData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.BroochJewel;
|
import org.l2jmobius.gameserver.enums.BroochJewel;
|
||||||
import org.l2jmobius.gameserver.enums.CastleSide;
|
import org.l2jmobius.gameserver.enums.CastleSide;
|
||||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
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.ExStorageMaxCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUseSharedGroupItem;
|
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.ExUserInfoAbnormalVisualEffect;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
||||||
@@ -466,6 +468,9 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _userBoostStatTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2308,7 +2313,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8970,8 +8975,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
+52
-26
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -834,16 +851,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -467,7 +466,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Send Equipped Items
|
// Send Equipped Items
|
||||||
player.sendPacket(new ExUserInfoEquipSlot(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.enums.ItemGrade;
|
import org.l2jmobius.gameserver.enums.ItemGrade;
|
||||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
@@ -421,9 +420,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
|||||||
// Send exp bonus change.
|
// Send exp bonus change.
|
||||||
if (containsMask(UserInfoType.VITA_FAME))
|
if (containsMask(UserInfoType.VITA_FAME))
|
||||||
{
|
{
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
_player.sendUserBoostStat();
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
return true;
|
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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -96,7 +95,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
|
|
||||||
player.updateSymbolSealSkills();
|
player.updateSymbolSealSkills();
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
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.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
if (effected.isPlayer())
|
||||||
{
|
{
|
||||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
effected.getActingPlayer().sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-5
@@ -16,13 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Mobius
|
||||||
@@ -54,8 +52,6 @@ public class ExpModify extends AbstractStatAddEffect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
player.sendUserBoostStat();
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-5
@@ -16,13 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Mobius
|
||||||
@@ -46,8 +44,6 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
player.sendUserBoostStat();
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 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.SymbolSealData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.BroochJewel;
|
import org.l2jmobius.gameserver.enums.BroochJewel;
|
||||||
import org.l2jmobius.gameserver.enums.CastleSide;
|
import org.l2jmobius.gameserver.enums.CastleSide;
|
||||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
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.ExStorageMaxCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUseSharedGroupItem;
|
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.ExUserInfoAbnormalVisualEffect;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
||||||
@@ -467,6 +469,9 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _userBoostStatTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2310,7 +2315,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9008,8 +9013,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -834,16 +851,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -471,7 +470,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Send Equipped Items
|
// Send Equipped Items
|
||||||
player.sendPacket(new ExUserInfoEquipSlot(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.enums.ItemGrade;
|
import org.l2jmobius.gameserver.enums.ItemGrade;
|
||||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
@@ -423,9 +422,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
|||||||
// Send exp bonus change.
|
// Send exp bonus change.
|
||||||
if (containsMask(UserInfoType.VITA_FAME))
|
if (containsMask(UserInfoType.VITA_FAME))
|
||||||
{
|
{
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
_player.sendUserBoostStat();
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
return true;
|
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.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.network.SystemMessageId;
|
import org.l2jmobius.gameserver.network.SystemMessageId;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.AcquireSkillList;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowAll;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
import org.l2jmobius.gameserver.network.serverpackets.PartySmallWindowDeleteAll;
|
||||||
@@ -96,7 +95,7 @@ public class ClassChange extends AbstractEffect
|
|||||||
|
|
||||||
player.updateSymbolSealSkills();
|
player.updateSymbolSealSkills();
|
||||||
player.broadcastUserInfo();
|
player.broadcastUserInfo();
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
player.sendPacket(new AcquireSkillList(player));
|
player.sendPacket(new AcquireSkillList(player));
|
||||||
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
player.sendPacket(new ExSubjobInfo(player, SubclassInfoType.CLASS_CHANGED));
|
||||||
player.sendPacket(new ExAcquireAPSkillList(player));
|
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.enums.StorageType;
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
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.effects.AbstractEffect;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExStorageMaxCount;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Sdw
|
* @author Sdw
|
||||||
@@ -75,7 +73,7 @@ public class EnlargeSlot extends AbstractEffect
|
|||||||
effected.getStat().mergeAdd(stat, _amount);
|
effected.getStat().mergeAdd(stat, _amount);
|
||||||
if (effected.isPlayer())
|
if (effected.isPlayer())
|
||||||
{
|
{
|
||||||
effected.sendPacket(new ExStorageMaxCount((Player) effected));
|
effected.getActingPlayer().sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-5
@@ -16,13 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Mobius
|
||||||
@@ -54,8 +52,6 @@ public class ExpModify extends AbstractStatAddEffect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
player.sendUserBoostStat();
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Vendored
+1
-5
@@ -16,13 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package handlers.effecthandlers;
|
package handlers.effecthandlers;
|
||||||
|
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.model.StatSet;
|
import org.l2jmobius.gameserver.model.StatSet;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
import org.l2jmobius.gameserver.model.skill.Skill;
|
import org.l2jmobius.gameserver.model.skill.Skill;
|
||||||
import org.l2jmobius.gameserver.model.stats.Stat;
|
import org.l2jmobius.gameserver.model.stats.Stat;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserBoostStat;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Mobius
|
* @author Mobius
|
||||||
@@ -46,8 +44,6 @@ public class VitalityExpRate extends AbstractStatPercentEffect
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.VITALITY));
|
player.sendUserBoostStat();
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.BUFFS));
|
|
||||||
player.sendPacket(new ExUserBoostStat(player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,11 +27,14 @@ import java.util.Queue;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
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.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
import org.l2jmobius.gameserver.enums.SkillFinishType;
|
||||||
import org.l2jmobius.gameserver.model.actor.Creature;
|
import org.l2jmobius.gameserver.model.actor.Creature;
|
||||||
import org.l2jmobius.gameserver.model.actor.Player;
|
import org.l2jmobius.gameserver.model.actor.Player;
|
||||||
@@ -93,6 +96,9 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
private final AtomicBoolean _updateAbnormalStatus = new AtomicBoolean();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1074,70 +1080,84 @@ public class EffectList
|
|||||||
*/
|
*/
|
||||||
public void updateEffectIcons(boolean partyOnly)
|
public void updateEffectIcons(boolean partyOnly)
|
||||||
{
|
{
|
||||||
final Player player = _owner.getActingPlayer();
|
if (!partyOnly)
|
||||||
if (player != null)
|
|
||||||
{
|
{
|
||||||
final Party party = player.getParty();
|
_updateAbnormalStatus.compareAndSet(false, true);
|
||||||
final Optional<AbnormalStatusUpdate> asu = (_owner.isPlayer() && !partyOnly) ? 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 (_updateEffectIconTask == null)
|
||||||
if (!_actives.isEmpty())
|
{
|
||||||
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
for (BuffInfo info : _actives)
|
final Player player = _owner.getActingPlayer();
|
||||||
|
if (player != null)
|
||||||
{
|
{
|
||||||
if ((info != null) && info.isInUse())
|
final Party party = player.getParty();
|
||||||
|
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())
|
||||||
{
|
{
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
for (BuffInfo info : _actives)
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
if ((info != null) && info.isInUse())
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
asu.ifPresent(a -> a.addSkill(info));
|
||||||
|
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
||||||
|
os.ifPresent(o -> o.addSkill(info));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
|
||||||
|
// Send icon update for player buff bar.
|
||||||
|
asu.ifPresent(_owner::sendPacket);
|
||||||
|
|
||||||
|
// Player or summon is in party. Broadcast packet to everyone in the party.
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
ps.ifPresent(party::broadcastPacket);
|
||||||
|
}
|
||||||
|
else // Not in party, then its a summon info for its owner.
|
||||||
|
{
|
||||||
|
ps.ifPresent(player::sendPacket);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send icon update to all olympiad observers.
|
||||||
|
if (os.isPresent())
|
||||||
|
{
|
||||||
|
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
||||||
|
if ((game != null) && game.isBattleStarted())
|
||||||
{
|
{
|
||||||
asu.ifPresent(a -> a.addSkill(info));
|
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
||||||
ps.filter(p -> !info.getSkill().isToggle()).ifPresent(p -> p.addSkill(info));
|
|
||||||
os.ifPresent(o -> o.addSkill(info));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update for player buff bar.
|
// Update effect icons for everyone targeting this owner.
|
||||||
asu.ifPresent(_owner::sendPacket);
|
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
||||||
|
for (Creature creature : _owner.getStatus().getStatusListener())
|
||||||
// Player or summon is in party. Broadcast packet to everyone in the party.
|
|
||||||
if (party != null)
|
|
||||||
{
|
|
||||||
ps.ifPresent(party::broadcastPacket);
|
|
||||||
}
|
|
||||||
else // Not in party, then its a summon info for its owner.
|
|
||||||
{
|
|
||||||
ps.ifPresent(player::sendPacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Send icon update to all olympiad observers.
|
|
||||||
if (os.isPresent())
|
|
||||||
{
|
|
||||||
final OlympiadGameTask game = OlympiadGameManager.getInstance().getOlympiadTask(player.getOlympiadGameId());
|
|
||||||
if ((game != null) && game.isBattleStarted())
|
|
||||||
{
|
{
|
||||||
os.ifPresent(game.getStadium()::broadcastPacketToObservers);
|
if ((creature != null) && creature.isPlayer())
|
||||||
|
{
|
||||||
|
creature.sendPacket(upd);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update effect icons for everyone targeting this owner.
|
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
||||||
final ExAbnormalStatusUpdateFromTarget upd = new ExAbnormalStatusUpdateFromTarget(_owner);
|
{
|
||||||
for (Creature creature : _owner.getStatus().getStatusListener())
|
_owner.sendPacket(upd);
|
||||||
{
|
}
|
||||||
if ((creature != null) && creature.isPlayer())
|
|
||||||
{
|
|
||||||
creature.sendPacket(upd);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isPlayer() && (_owner.getTarget() == _owner))
|
_updateAbnormalStatus.set(false);
|
||||||
{
|
_updateEffectIconTask = null;
|
||||||
_owner.sendPacket(upd);
|
}, 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.SymbolSealData;
|
||||||
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
import org.l2jmobius.gameserver.data.xml.TimedHuntingZoneData;
|
||||||
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
import org.l2jmobius.gameserver.enums.AdminTeleportType;
|
||||||
|
import org.l2jmobius.gameserver.enums.BonusExpType;
|
||||||
import org.l2jmobius.gameserver.enums.BroochJewel;
|
import org.l2jmobius.gameserver.enums.BroochJewel;
|
||||||
import org.l2jmobius.gameserver.enums.CastleSide;
|
import org.l2jmobius.gameserver.enums.CastleSide;
|
||||||
import org.l2jmobius.gameserver.enums.CategoryType;
|
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.ExStorageMaxCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
import org.l2jmobius.gameserver.network.serverpackets.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUseSharedGroupItem;
|
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.ExUserInfoAbnormalVisualEffect;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoCubic;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoInvenWeight;
|
||||||
@@ -467,6 +469,9 @@ public class Player extends Playable
|
|||||||
|
|
||||||
private ScheduledFuture<?> _itemListTask;
|
private ScheduledFuture<?> _itemListTask;
|
||||||
private ScheduledFuture<?> _skillListTask;
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
private ScheduledFuture<?> _storageCountTask;
|
||||||
|
private ScheduledFuture<?> _userBoostStatTask;
|
||||||
|
private ScheduledFuture<?> _abnormalVisualEffectTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
@@ -2310,7 +2315,7 @@ public class Player extends Playable
|
|||||||
|
|
||||||
if (getInventoryLimit() != oldInvLimit)
|
if (getInventoryLimit() != oldInvLimit)
|
||||||
{
|
{
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9036,8 +9041,15 @@ public class Player extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
sendPacket(new ExUserInfoAbnormalVisualEffect(this));
|
if (_abnormalVisualEffectTask == null)
|
||||||
broadcastCharInfo();
|
{
|
||||||
|
_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>
|
* 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.
|
* 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));
|
sendPacket(new ShortCutInit(this));
|
||||||
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
broadcastPacket(new SocialAction(getObjectId(), SocialAction.LEVEL_UP));
|
||||||
sendPacket(new SkillCoolTime(this));
|
sendPacket(new SkillCoolTime(this));
|
||||||
sendPacket(new ExStorageMaxCount(this));
|
sendStorageMaxCount();
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -82,6 +86,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _summonPoints = 0;
|
private int _summonPoints = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -193,26 +200,36 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalVisualEffects()
|
public void updateAbnormalVisualEffects()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
if (_abnormalEffectTask == null)
|
||||||
{
|
{
|
||||||
if (player == _owner)
|
_abnormalEffectTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
if (isSpawned())
|
||||||
return;
|
{
|
||||||
}
|
World.getInstance().forEachVisibleObject(this, Player.class, player ->
|
||||||
|
{
|
||||||
|
if (player == _owner)
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final AbstractMaskPacket<NpcInfoType> packet;
|
final AbstractMaskPacket<NpcInfoType> packet;
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
packet = new ExPetInfo(this, player, 1);
|
packet = new ExPetInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
packet = new SummonInfo(this, player, 1);
|
packet = new SummonInfo(this, player, 1);
|
||||||
}
|
}
|
||||||
packet.addComponentType(NpcInfoType.ABNORMALS);
|
packet.addComponentType(NpcInfoType.ABNORMALS);
|
||||||
player.sendPacket(packet);
|
player.sendPacket(packet);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
_abnormalEffectTask = null;
|
||||||
|
}, 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -834,16 +851,25 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
}
|
{
|
||||||
final Party party = _owner.getParty();
|
if (isSpawned())
|
||||||
if (party != null)
|
{
|
||||||
{
|
sendPacket(new PetInfo(this, _statusUpdateValue.get()));
|
||||||
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
sendPacket(new PetStatusUpdate(this));
|
||||||
|
broadcastNpcInfo(_statusUpdateValue.get());
|
||||||
|
|
||||||
|
final Party party = _owner.getParty();
|
||||||
|
if (party != null)
|
||||||
|
{
|
||||||
|
party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_statusUpdateTask = null;
|
||||||
|
}, 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+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.ExRotation;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
import org.l2jmobius.gameserver.network.serverpackets.ExShowScreenMessage;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExShowUsm;
|
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.ExSubjobInfo;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUnReadMailCount;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
import org.l2jmobius.gameserver.network.serverpackets.ExUserInfoEquipSlot;
|
||||||
@@ -471,7 +470,7 @@ public class EnterWorld implements IClientIncomingPacket
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand Skill
|
// Expand Skill
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
|
|
||||||
// Send Equipped Items
|
// Send Equipped Items
|
||||||
player.sendPacket(new ExUserInfoEquipSlot(player));
|
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.ExAcquirableSkillListByClass;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
import org.l2jmobius.gameserver.network.serverpackets.ExAlchemySkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ExBasicActionList;
|
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.PledgeSkillList;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
import org.l2jmobius.gameserver.network.serverpackets.ShortCutInit;
|
||||||
import org.l2jmobius.gameserver.network.serverpackets.SystemMessage;
|
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 skill is expand type then sends packet:
|
||||||
if ((_id >= 1368) && (_id <= 1372))
|
if ((_id >= 1368) && (_id <= 1372))
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExStorageMaxCount(player));
|
player.sendStorageMaxCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify scripts of the skill learn.
|
// 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.commons.network.PacketWriter;
|
||||||
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
import org.l2jmobius.gameserver.data.xml.ExperienceData;
|
||||||
import org.l2jmobius.gameserver.enums.AttributeType;
|
import org.l2jmobius.gameserver.enums.AttributeType;
|
||||||
import org.l2jmobius.gameserver.enums.BonusExpType;
|
|
||||||
import org.l2jmobius.gameserver.enums.ItemGrade;
|
import org.l2jmobius.gameserver.enums.ItemGrade;
|
||||||
import org.l2jmobius.gameserver.enums.UserInfoType;
|
import org.l2jmobius.gameserver.enums.UserInfoType;
|
||||||
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
import org.l2jmobius.gameserver.instancemanager.CastleManager;
|
||||||
@@ -429,9 +428,7 @@ public class UserInfo extends AbstractMaskPacket<UserInfoType>
|
|||||||
// Send exp bonus change.
|
// Send exp bonus change.
|
||||||
if (containsMask(UserInfoType.VITA_FAME))
|
if (containsMask(UserInfoType.VITA_FAME))
|
||||||
{
|
{
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.VITALITY));
|
_player.sendUserBoostStat();
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.BUFFS));
|
|
||||||
_player.sendPacket(new ExUserBoostStat(_player, BonusExpType.PASSIVE));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
private ScheduledFuture<?> _effectIconsUpdate;
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1377,137 +1377,134 @@ public class EffectList
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the previous call hasnt finished, if so, don't send packets uselessly again.
|
if (_updateEffectIconTask == null)
|
||||||
if ((_effectIconsUpdate != null) && !_effectIconsUpdate.isDone())
|
|
||||||
{
|
{
|
||||||
return;
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
}
|
|
||||||
// Schedule the icon update packets 500miliseconds ahead, so it can gather-up most of the changes.
|
|
||||||
_effectIconsUpdate = ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
AbnormalStatusUpdate asu = null;
|
|
||||||
PartySpelled ps = null;
|
|
||||||
PartySpelled psSummon = null;
|
|
||||||
ExOlympiadSpelledInfo os = null;
|
|
||||||
boolean isSummon = false;
|
|
||||||
|
|
||||||
if (_owner.isPlayer())
|
|
||||||
{
|
{
|
||||||
if (_partyOnly)
|
AbnormalStatusUpdate asu = null;
|
||||||
{
|
PartySpelled ps = null;
|
||||||
_partyOnly = false;
|
PartySpelled psSummon = null;
|
||||||
}
|
ExOlympiadSpelledInfo os = null;
|
||||||
else
|
boolean isSummon = false;
|
||||||
{
|
|
||||||
asu = new AbnormalStatusUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isInParty())
|
if (_owner.isPlayer())
|
||||||
{
|
{
|
||||||
ps = new PartySpelled(_owner);
|
if (_partyOnly)
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.getActingPlayer().isInOlympiadMode() && _owner.getActingPlayer().isOlympiadStart())
|
|
||||||
{
|
|
||||||
os = new ExOlympiadSpelledInfo(_owner.getActingPlayer());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_owner.isSummon())
|
|
||||||
{
|
|
||||||
isSummon = true;
|
|
||||||
ps = new PartySpelled(_owner);
|
|
||||||
psSummon = new PartySpelled(_owner);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Buffs.
|
|
||||||
if (hasBuffs())
|
|
||||||
{
|
|
||||||
for (BuffInfo info : _buffs)
|
|
||||||
{
|
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
_partyOnly = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
asu = new AbnormalStatusUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_owner.isInParty())
|
||||||
|
{
|
||||||
|
ps = new PartySpelled(_owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_owner.getActingPlayer().isInOlympiadMode() && _owner.getActingPlayer().isOlympiadStart())
|
||||||
|
{
|
||||||
|
os = new ExOlympiadSpelledInfo(_owner.getActingPlayer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (_owner.isSummon())
|
||||||
|
{
|
||||||
|
isSummon = true;
|
||||||
|
ps = new PartySpelled(_owner);
|
||||||
|
psSummon = new PartySpelled(_owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Buffs.
|
||||||
|
if (hasBuffs())
|
||||||
|
{
|
||||||
|
for (BuffInfo info : _buffs)
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Songs and dances.
|
||||||
|
if (hasDances())
|
||||||
|
{
|
||||||
|
for (BuffInfo info : _dances)
|
||||||
{
|
{
|
||||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Songs and dances.
|
// Toggles.
|
||||||
if (hasDances())
|
if (hasToggles())
|
||||||
{
|
|
||||||
for (BuffInfo info : _dances)
|
|
||||||
{
|
{
|
||||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
for (BuffInfo info : _toggles)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Toggles.
|
|
||||||
if (hasToggles())
|
|
||||||
{
|
|
||||||
for (BuffInfo info : _toggles)
|
|
||||||
{
|
|
||||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Debuffs.
|
|
||||||
if (hasDebuffs())
|
|
||||||
{
|
|
||||||
for (BuffInfo info : _debuffs)
|
|
||||||
{
|
|
||||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (asu != null)
|
|
||||||
{
|
|
||||||
_owner.sendPacket(asu);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps != null)
|
|
||||||
{
|
|
||||||
if (_owner.isSummon())
|
|
||||||
{
|
|
||||||
final Player summonOwner = ((Summon) _owner).getOwner();
|
|
||||||
if (summonOwner != null)
|
|
||||||
{
|
{
|
||||||
if (summonOwner.isInParty())
|
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Debuffs.
|
||||||
|
if (hasDebuffs())
|
||||||
|
{
|
||||||
|
for (BuffInfo info : _debuffs)
|
||||||
|
{
|
||||||
|
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (asu != null)
|
||||||
|
{
|
||||||
|
_owner.sendPacket(asu);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ps != null)
|
||||||
|
{
|
||||||
|
if (_owner.isSummon())
|
||||||
|
{
|
||||||
|
final Player summonOwner = ((Summon) _owner).getOwner();
|
||||||
|
if (summonOwner != null)
|
||||||
{
|
{
|
||||||
summonOwner.getParty().broadcastToPartyMembers(summonOwner, psSummon); // send to all member except summonOwner
|
if (summonOwner.isInParty())
|
||||||
summonOwner.sendPacket(ps); // now send to summonOwner
|
{
|
||||||
|
summonOwner.getParty().broadcastToPartyMembers(summonOwner, psSummon); // send to all member except summonOwner
|
||||||
|
summonOwner.sendPacket(ps); // now send to summonOwner
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
summonOwner.sendPacket(ps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
else if (_owner.isPlayer() && _owner.isInParty())
|
||||||
|
{
|
||||||
|
_owner.getParty().broadcastPacket(ps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (os != null)
|
||||||
|
{
|
||||||
|
final List<Player> specs = Olympiad.getInstance().getSpectators(((Player) _owner).getOlympiadGameId());
|
||||||
|
if ((specs != null) && !specs.isEmpty())
|
||||||
|
{
|
||||||
|
for (Player spec : specs)
|
||||||
{
|
{
|
||||||
summonOwner.sendPacket(ps);
|
if (spec != null)
|
||||||
|
{
|
||||||
|
spec.sendPacket(os);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_owner.isPlayer() && _owner.isInParty())
|
|
||||||
{
|
|
||||||
_owner.getParty().broadcastPacket(ps);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (os != null)
|
_updateEffectIconTask = null;
|
||||||
{
|
}, 300);
|
||||||
final List<Player> specs = Olympiad.getInstance().getSpectators(((Player) _owner).getOlympiadGameId());
|
}
|
||||||
if ((specs != null) && !specs.isEmpty())
|
|
||||||
{
|
|
||||||
for (Player spec : specs)
|
|
||||||
{
|
|
||||||
if (spec != null)
|
|
||||||
{
|
|
||||||
spec.sendPacket(os);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_effectIconsUpdate = null;
|
|
||||||
}, 500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addIcon(BuffInfo info, AbnormalStatusUpdate asu, PartySpelled ps, PartySpelled psSummon, ExOlympiadSpelledInfo os, boolean isSummon)
|
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 _lastAccess;
|
||||||
private long _uptime;
|
private long _uptime;
|
||||||
|
|
||||||
|
private ScheduledFuture<?> _skillListTask;
|
||||||
|
|
||||||
private boolean _subclassLock = false;
|
private boolean _subclassLock = false;
|
||||||
protected int _baseClass;
|
protected int _baseClass;
|
||||||
protected int _activeClass;
|
protected int _activeClass;
|
||||||
@@ -9574,34 +9576,41 @@ public class Player extends Playable
|
|||||||
|
|
||||||
public void sendSkillList()
|
public void sendSkillList()
|
||||||
{
|
{
|
||||||
boolean isDisabled = false;
|
if (_skillListTask == null)
|
||||||
final SkillList sl = new SkillList();
|
|
||||||
for (Skill s : getAllSkills())
|
|
||||||
{
|
{
|
||||||
if (s == null)
|
_skillListTask = ThreadPool.schedule(() ->
|
||||||
{
|
{
|
||||||
continue;
|
boolean isDisabled = false;
|
||||||
}
|
final SkillList skillList = new SkillList();
|
||||||
|
for (Skill skill : getAllSkills())
|
||||||
if (_clan != null)
|
|
||||||
{
|
|
||||||
isDisabled = s.isClanSkill() && (_clan.getReputationScore() < 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean isEnchantable = SkillData.getInstance().isEnchantable(s.getId());
|
|
||||||
if (isEnchantable)
|
|
||||||
{
|
|
||||||
final EnchantSkillLearn esl = EnchantSkillGroupsData.getInstance().getSkillEnchantmentBySkillId(s.getId());
|
|
||||||
if ((esl == null) || (s.getLevel() < esl.getBaseLevel()))
|
|
||||||
{
|
{
|
||||||
isEnchantable = false;
|
if (skill == null)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_clan != null)
|
||||||
|
{
|
||||||
|
isDisabled = skill.isClanSkill() && (_clan.getReputationScore() < 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
boolean isEnchantable = SkillData.getInstance().isEnchantable(skill.getId());
|
||||||
|
if (isEnchantable)
|
||||||
|
{
|
||||||
|
final EnchantSkillLearn esl = EnchantSkillGroupsData.getInstance().getSkillEnchantmentBySkillId(skill.getId());
|
||||||
|
if ((esl == null) || (skill.getLevel() < esl.getBaseLevel()))
|
||||||
|
{
|
||||||
|
isEnchantable = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
skillList.addSkill(skill.getDisplayId(), skill.getDisplayLevel(), skill.isPassive(), isDisabled, isEnchantable);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
sl.addSkill(s.getDisplayId(), s.getDisplayLevel(), s.isPassive(), isDisabled, isEnchantable);
|
sendPacket(skillList);
|
||||||
|
_skillListTask = null;
|
||||||
|
}, 300);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(sl);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -16,7 +16,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.l2jmobius.gameserver.model.actor;
|
package org.l2jmobius.gameserver.model.actor;
|
||||||
|
|
||||||
|
import java.util.concurrent.ScheduledFuture;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import org.l2jmobius.Config;
|
import org.l2jmobius.Config;
|
||||||
|
import org.l2jmobius.commons.threads.ThreadPool;
|
||||||
import org.l2jmobius.commons.util.CommonUtil;
|
import org.l2jmobius.commons.util.CommonUtil;
|
||||||
import org.l2jmobius.commons.util.Rnd;
|
import org.l2jmobius.commons.util.Rnd;
|
||||||
import org.l2jmobius.gameserver.ai.CreatureAI;
|
import org.l2jmobius.gameserver.ai.CreatureAI;
|
||||||
@@ -74,6 +78,9 @@ public abstract class Summon extends Playable
|
|||||||
private boolean _previousFollowStatus = true;
|
private boolean _previousFollowStatus = true;
|
||||||
protected boolean _restoreSummon = true;
|
protected boolean _restoreSummon = true;
|
||||||
private int _shotsMask = 0;
|
private int _shotsMask = 0;
|
||||||
|
private ScheduledFuture<?> _abnormalEffectTask;
|
||||||
|
private ScheduledFuture<?> _statusUpdateTask;
|
||||||
|
private final AtomicInteger _statusUpdateValue = new AtomicInteger();
|
||||||
|
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
private static final int[] PASSIVE_SUMMONS =
|
private static final int[] PASSIVE_SUMMONS =
|
||||||
@@ -190,7 +197,17 @@ public abstract class Summon extends Playable
|
|||||||
@Override
|
@Override
|
||||||
public void updateAbnormalEffect()
|
public void updateAbnormalEffect()
|
||||||
{
|
{
|
||||||
World.getInstance().forEachVisibleObject(this, Player.class, player -> player.sendPacket(new SummonInfo(this, player, 1)));
|
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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -823,18 +840,28 @@ public abstract class Summon extends Playable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
sendPacket(new PetInfo(this, value));
|
_statusUpdateValue.set(value);
|
||||||
sendPacket(new PetStatusUpdate(this));
|
if (_statusUpdateTask == null)
|
||||||
if (isSpawned())
|
|
||||||
{
|
{
|
||||||
broadcastNpcInfo(value);
|
_statusUpdateTask = ThreadPool.schedule(() ->
|
||||||
|
{
|
||||||
|
if (isSpawned())
|
||||||
|
{
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
// final Party party = _owner.getParty();
|
|
||||||
// if (party != null)
|
|
||||||
// {
|
|
||||||
// party.broadcastToPartyMembers(_owner, new ExPartyPetWindowUpdate(this));
|
|
||||||
// }
|
|
||||||
updateEffectIcons(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void broadcastNpcInfo(int value)
|
public void broadcastNpcInfo(int value)
|
||||||
|
|||||||
@@ -91,8 +91,8 @@ public class EffectList
|
|||||||
private final Creature _owner;
|
private final Creature _owner;
|
||||||
/** Hidden buffs count, prevents iterations. */
|
/** Hidden buffs count, prevents iterations. */
|
||||||
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
private final AtomicInteger _hiddenBuffs = new AtomicInteger();
|
||||||
|
/** Delay task **/
|
||||||
private ScheduledFuture<?> _effectIconsUpdate;
|
private ScheduledFuture<?> _updateEffectIconTask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for effect list.
|
* Constructor for effect list.
|
||||||
@@ -1377,137 +1377,134 @@ public class EffectList
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the previous call hasnt finished, if so, don't send packets uselessly again.
|
if (_updateEffectIconTask == null)
|
||||||
if ((_effectIconsUpdate != null) && !_effectIconsUpdate.isDone())
|
|
||||||
{
|
{
|
||||||
return;
|
_updateEffectIconTask = ThreadPool.schedule(() ->
|
||||||
}
|
|
||||||
// Schedule the icon update packets 500miliseconds ahead, so it can gather-up most of the changes.
|
|
||||||
_effectIconsUpdate = ThreadPool.schedule(() ->
|
|
||||||
{
|
|
||||||
AbnormalStatusUpdate asu = null;
|
|
||||||
PartySpelled ps = null;
|
|
||||||
PartySpelled psSummon = null;
|
|
||||||
ExOlympiadSpelledInfo os = null;
|
|
||||||
boolean isSummon = false;
|
|
||||||
|
|
||||||
if (_owner.isPlayer())
|
|
||||||
{
|
{
|
||||||
if (_partyOnly)
|
AbnormalStatusUpdate asu = null;
|
||||||
{
|
PartySpelled ps = null;
|
||||||
_partyOnly = false;
|
PartySpelled psSummon = null;
|
||||||
}
|
ExOlympiadSpelledInfo os = null;
|
||||||
else
|
boolean isSummon = false;
|
||||||
{
|
|
||||||
asu = new AbnormalStatusUpdate();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.isInParty())
|
if (_owner.isPlayer())
|
||||||
{
|
{
|
||||||
ps = new PartySpelled(_owner);
|
if (_partyOnly)
|
||||||
}
|
|
||||||
|
|
||||||
if (_owner.getActingPlayer().isInOlympiadMode() && _owner.getActingPlayer().isOlympiadStart())
|
|
||||||
{
|
|
||||||
os = new ExOlympiadSpelledInfo(_owner.getActingPlayer());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (_owner.isSummon())
|
|
||||||
{
|
|
||||||
isSummon = true;
|
|
||||||
ps = new PartySpelled(_owner);
|
|
||||||
psSummon = new PartySpelled(_owner);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Buffs.
|
|
||||||
if (hasBuffs())
|
|
||||||
{
|
|
||||||
for (BuffInfo info : _buffs)
|
|
||||||
{
|
|
||||||
if (info.getSkill().isHealingPotionSkill())
|
|
||||||
{
|
{
|
||||||
shortBuffStatusUpdate(info);
|
_partyOnly = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
asu = new AbnormalStatusUpdate();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_owner.isInParty())
|
||||||
|
{
|
||||||
|
ps = new PartySpelled(_owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_owner.getActingPlayer().isInOlympiadMode() && _owner.getActingPlayer().isOlympiadStart())
|
||||||
|
{
|
||||||
|
os = new ExOlympiadSpelledInfo(_owner.getActingPlayer());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (_owner.isSummon())
|
||||||
|
{
|
||||||
|
isSummon = true;
|
||||||
|
ps = new PartySpelled(_owner);
|
||||||
|
psSummon = new PartySpelled(_owner);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Buffs.
|
||||||
|
if (hasBuffs())
|
||||||
|
{
|
||||||
|
for (BuffInfo info : _buffs)
|
||||||
|
{
|
||||||
|
if (info.getSkill().isHealingPotionSkill())
|
||||||
|
{
|
||||||
|
shortBuffStatusUpdate(info);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Songs and dances.
|
||||||
|
if (hasDances())
|
||||||
|
{
|
||||||
|
for (BuffInfo info : _dances)
|
||||||
{
|
{
|
||||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Songs and dances.
|
// Toggles.
|
||||||
if (hasDances())
|
if (hasToggles())
|
||||||
{
|
|
||||||
for (BuffInfo info : _dances)
|
|
||||||
{
|
{
|
||||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
for (BuffInfo info : _toggles)
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Toggles.
|
|
||||||
if (hasToggles())
|
|
||||||
{
|
|
||||||
for (BuffInfo info : _toggles)
|
|
||||||
{
|
|
||||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Debuffs.
|
|
||||||
if (hasDebuffs())
|
|
||||||
{
|
|
||||||
for (BuffInfo info : _debuffs)
|
|
||||||
{
|
|
||||||
addIcon(info, asu, ps, psSummon, os, isSummon);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (asu != null)
|
|
||||||
{
|
|
||||||
_owner.sendPacket(asu);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ps != null)
|
|
||||||
{
|
|
||||||
if (_owner.isSummon())
|
|
||||||
{
|
|
||||||
final Player summonOwner = ((Summon) _owner).getOwner();
|
|
||||||
if (summonOwner != null)
|
|
||||||
{
|
{
|
||||||
if (summonOwner.isInParty())
|
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Debuffs.
|
||||||
|
if (hasDebuffs())
|
||||||
|
{
|
||||||
|
for (BuffInfo info : _debuffs)
|
||||||
|
{
|
||||||
|
addIcon(info, asu, ps, psSummon, os, isSummon);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (asu != null)
|
||||||
|
{
|
||||||
|
_owner.sendPacket(asu);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ps != null)
|
||||||
|
{
|
||||||
|
if (_owner.isSummon())
|
||||||
|
{
|
||||||
|
final Player summonOwner = ((Summon) _owner).getOwner();
|
||||||
|
if (summonOwner != null)
|
||||||
{
|
{
|
||||||
summonOwner.getParty().broadcastToPartyMembers(summonOwner, psSummon); // send to all member except summonOwner
|
if (summonOwner.isInParty())
|
||||||
summonOwner.sendPacket(ps); // now send to summonOwner
|
{
|
||||||
|
summonOwner.getParty().broadcastToPartyMembers(summonOwner, psSummon); // send to all member except summonOwner
|
||||||
|
summonOwner.sendPacket(ps); // now send to summonOwner
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
summonOwner.sendPacket(ps);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
}
|
||||||
|
else if (_owner.isPlayer() && _owner.isInParty())
|
||||||
|
{
|
||||||
|
_owner.getParty().broadcastPacket(ps);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (os != null)
|
||||||
|
{
|
||||||
|
final List<Player> specs = Olympiad.getInstance().getSpectators(((Player) _owner).getOlympiadGameId());
|
||||||
|
if ((specs != null) && !specs.isEmpty())
|
||||||
|
{
|
||||||
|
for (Player spec : specs)
|
||||||
{
|
{
|
||||||
summonOwner.sendPacket(ps);
|
if (spec != null)
|
||||||
|
{
|
||||||
|
spec.sendPacket(os);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_owner.isPlayer() && _owner.isInParty())
|
|
||||||
{
|
|
||||||
_owner.getParty().broadcastPacket(ps);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (os != null)
|
_updateEffectIconTask = null;
|
||||||
{
|
}, 300);
|
||||||
final List<Player> specs = Olympiad.getInstance().getSpectators(((Player) _owner).getOlympiadGameId());
|
}
|
||||||
if ((specs != null) && !specs.isEmpty())
|
|
||||||
{
|
|
||||||
for (Player spec : specs)
|
|
||||||
{
|
|
||||||
if (spec != null)
|
|
||||||
{
|
|
||||||
spec.sendPacket(os);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_effectIconsUpdate = null;
|
|
||||||
}, 500);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addIcon(BuffInfo info, AbnormalStatusUpdate asu, PartySpelled ps, PartySpelled psSummon, ExOlympiadSpelledInfo os, boolean isSummon)
|
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