Summon related adjustments.
This commit is contained in:
parent
d0827d2363
commit
fc50379dc1
@ -207,7 +207,7 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
OutgoingPackets.EX_PET_INFO.writeId(packet);
|
||||
packet.writeD(_summon.getObjectId());
|
||||
packet.writeC(_value); // 0=teleported 1=default 2=summoned
|
||||
packet.writeH(37); // mask_bits_37
|
||||
packet.writeH(38); // 338 - mask_bits_38
|
||||
packet.writeB(_masks);
|
||||
// Block 1
|
||||
packet.writeC(_initSize);
|
||||
@ -355,7 +355,7 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
}
|
||||
if (containsMask(NpcInfoType.VISUAL_STATE))
|
||||
{
|
||||
packet.writeC(_statusMask);
|
||||
packet.writeD(_statusMask);
|
||||
}
|
||||
if (containsMask(NpcInfoType.ABNORMALS))
|
||||
{
|
||||
|
@ -431,7 +431,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
}
|
||||
if (containsMask(NpcInfoType.VISUAL_STATE))
|
||||
{
|
||||
packet.writeC(_statusMask);
|
||||
packet.writeD(_statusMask);
|
||||
}
|
||||
if (containsMask(NpcInfoType.ABNORMALS))
|
||||
{
|
||||
|
@ -208,7 +208,7 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
OutgoingPackets.SUMMON_INFO.writeId(packet);
|
||||
packet.writeD(_summon.getObjectId());
|
||||
packet.writeC(_value); // 0=teleported 1=default 2=summoned
|
||||
packet.writeH(37); // mask_bits_37
|
||||
packet.writeH(38); // 338 - mask_bits_38
|
||||
packet.writeB(_masks);
|
||||
// Block 1
|
||||
packet.writeC(_initSize);
|
||||
@ -356,7 +356,7 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
}
|
||||
if (containsMask(NpcInfoType.VISUAL_STATE))
|
||||
{
|
||||
packet.writeC(_statusMask);
|
||||
packet.writeD(_statusMask);
|
||||
}
|
||||
if (containsMask(NpcInfoType.ABNORMALS))
|
||||
{
|
||||
|
@ -2671,7 +2671,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
final Summon summon = (Summon) this;
|
||||
if (summon.getOwner() != null)
|
||||
{
|
||||
summon.updateAndBroadcastStatus();
|
||||
summon.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -10426,7 +10426,7 @@ public class Player extends Playable
|
||||
((SummonAI) _pet.getAI()).setStartFollowController(true);
|
||||
_pet.setFollowStatus(true);
|
||||
_pet.setInstance(getInstanceWorld());
|
||||
_pet.updateAndBroadcastStatus();
|
||||
_pet.updateAndBroadcastStatus(0);
|
||||
sendPacket(new PetInfo(_pet, 0));
|
||||
}
|
||||
|
||||
@ -10437,7 +10437,7 @@ public class Player extends Playable
|
||||
((SummonAI) s.getAI()).setStartFollowController(true);
|
||||
s.setFollowStatus(true);
|
||||
s.setInstance(getInstanceWorld());
|
||||
s.updateAndBroadcastStatus();
|
||||
s.updateAndBroadcastStatus(0);
|
||||
sendPacket(new PetInfo(s, 0));
|
||||
});
|
||||
|
||||
|
@ -123,7 +123,7 @@ public abstract class Summon extends Playable
|
||||
}
|
||||
|
||||
setFollowStatus(true);
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(0);
|
||||
if (isPet())
|
||||
{
|
||||
final Pet pet = (Pet) this;
|
||||
@ -133,13 +133,13 @@ public abstract class Summon extends Playable
|
||||
|
||||
if (_owner != null)
|
||||
{
|
||||
_owner.sendPacket(new PetInfo(this, 1));
|
||||
_owner.sendPacket(new ExPetSkillList(true, this));
|
||||
sendPacket(new PetInfo(this, 1));
|
||||
sendPacket(new ExPetSkillList(true, this));
|
||||
if (getInventory() != null)
|
||||
{
|
||||
_owner.sendPacket(new PetItemList(getInventory().getItems()));
|
||||
sendPacket(new PetItemList(getInventory().getItems()));
|
||||
}
|
||||
_owner.sendPacket(new RelationChanged(this, _owner.getRelation(_owner), false));
|
||||
sendPacket(new RelationChanged(this, _owner.getRelation(_owner), false));
|
||||
}
|
||||
World.getInstance().forEachVisibleObject(getOwner(), Player.class, player -> player.sendPacket(new RelationChanged(this, _owner.getRelation(player), isAutoAttackable(player))));
|
||||
final Party party = _owner.getParty();
|
||||
@ -199,14 +199,14 @@ public abstract class Summon extends Playable
|
||||
public void stopAllEffects()
|
||||
{
|
||||
super.stopAllEffects();
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAllEffectsExceptThoseThatLastThroughDeath()
|
||||
{
|
||||
super.stopAllEffectsExceptThoseThatLastThroughDeath();
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -384,7 +384,7 @@ public abstract class Summon extends Playable
|
||||
public void broadcastStatusUpdate(Creature caster)
|
||||
{
|
||||
super.broadcastStatusUpdate(caster);
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
public void deleteMe(Player owner)
|
||||
@ -836,17 +836,18 @@ public abstract class Summon extends Playable
|
||||
return _owner;
|
||||
}
|
||||
|
||||
public void updateAndBroadcastStatus()
|
||||
public void updateAndBroadcastStatus(int value)
|
||||
{
|
||||
if (_owner == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(0);
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
@ -886,9 +887,10 @@ public abstract class Summon extends Playable
|
||||
@Override
|
||||
public void sendInfo(Player player)
|
||||
{
|
||||
// Check if the Player is the owner of the Pet
|
||||
if (player == _owner)
|
||||
{
|
||||
player.sendPacket(new PetInfo(this, 1));
|
||||
player.sendPacket(new PetInfo(this, isDead() ? 0 : 1));
|
||||
if (isPet())
|
||||
{
|
||||
player.sendPacket(new PetItemList(getInventory().getItems()));
|
||||
@ -896,7 +898,7 @@ public abstract class Summon extends Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(new ExPetInfo(this, player, isShowSummonAnimation() ? 2 : isDead() ? 0 : 1));
|
||||
player.sendPacket(new ExPetInfo(this, player, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1436,10 +1436,10 @@ public class Pet extends Summon
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAndBroadcastStatus()
|
||||
public void updateAndBroadcastStatus(int value)
|
||||
{
|
||||
refreshOverloaded();
|
||||
super.updateAndBroadcastStatus();
|
||||
super.updateAndBroadcastStatus(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,7 +37,7 @@ public class PetStat extends SummonStat
|
||||
return false;
|
||||
}
|
||||
|
||||
getActiveChar().updateAndBroadcastStatus();
|
||||
getActiveChar().updateAndBroadcastStatus(1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ public class PetStat extends SummonStat
|
||||
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.YOUR_PET_GAINED_S1_XP);
|
||||
sm.addLong(finalExp);
|
||||
getActiveChar().updateAndBroadcastStatus();
|
||||
getActiveChar().updateAndBroadcastStatus(1);
|
||||
getActiveChar().sendPacket(sm);
|
||||
return true;
|
||||
}
|
||||
@ -71,7 +71,7 @@ public class PetStat extends SummonStat
|
||||
getActiveChar().broadcastPacket(new SocialAction(getActiveChar().getObjectId(), SocialAction.LEVEL_UP));
|
||||
}
|
||||
// Send a Server->Client packet PetInfo to the Player
|
||||
getActiveChar().updateAndBroadcastStatus();
|
||||
getActiveChar().updateAndBroadcastStatus(1);
|
||||
|
||||
if (getActiveChar().getControlItem() != null)
|
||||
{
|
||||
|
@ -287,7 +287,7 @@ public class PlayerStat extends PlayableStat
|
||||
pet.setCurrentHp(pet.getMaxHp());
|
||||
pet.setCurrentMp(pet.getMaxMp());
|
||||
pet.broadcastPacket(new SocialAction(getActiveChar().getObjectId(), SocialAction.LEVEL_UP));
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class PetInventory extends Inventory
|
||||
protected void refreshWeight()
|
||||
{
|
||||
super.refreshWeight();
|
||||
_owner.updateAndBroadcastStatus();
|
||||
_owner.updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -640,7 +640,7 @@ public class SkillCaster implements Runnable
|
||||
|
||||
if (obj.isSummon())
|
||||
{
|
||||
((Summon) obj).updateAndBroadcastStatus();
|
||||
((Summon) obj).updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
else if (obj.isAttackable())
|
||||
|
@ -85,6 +85,6 @@ public class RequestChangePetName implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
pet.setName(_name);
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class RequestPetUseItem implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
player.sendPacket(new PetItemList(pet.getInventory().getItems()));
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -133,7 +133,7 @@ public class RequestPetUseItem implements IClientIncomingPacket
|
||||
player.addTimeStampItem(item, reuseDelay);
|
||||
}
|
||||
player.sendPacket(new PetItemList(pet.getInventory().getItems()));
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -155,7 +155,7 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
{
|
||||
_statusMask |= 0x04;
|
||||
}
|
||||
_statusMask |= 0x08;
|
||||
_statusMask |= 0x08; // Show name (current on retail is empty).
|
||||
if (_statusMask != 0x00)
|
||||
{
|
||||
addComponentType(NpcInfoType.VISUAL_STATE);
|
||||
|
@ -2678,7 +2678,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
final Summon summon = (Summon) this;
|
||||
if (summon.getOwner() != null)
|
||||
{
|
||||
summon.updateAndBroadcastStatus();
|
||||
summon.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -10492,7 +10492,7 @@ public class Player extends Playable
|
||||
((SummonAI) _pet.getAI()).setStartFollowController(true);
|
||||
_pet.setFollowStatus(true);
|
||||
_pet.setInstance(getInstanceWorld());
|
||||
_pet.updateAndBroadcastStatus();
|
||||
_pet.updateAndBroadcastStatus(0);
|
||||
sendPacket(new PetInfo(_pet, 0));
|
||||
}
|
||||
|
||||
@ -10503,7 +10503,7 @@ public class Player extends Playable
|
||||
((SummonAI) s.getAI()).setStartFollowController(true);
|
||||
s.setFollowStatus(true);
|
||||
s.setInstance(getInstanceWorld());
|
||||
s.updateAndBroadcastStatus();
|
||||
s.updateAndBroadcastStatus(0);
|
||||
sendPacket(new PetInfo(s, 0));
|
||||
});
|
||||
|
||||
|
@ -123,7 +123,7 @@ public abstract class Summon extends Playable
|
||||
}
|
||||
|
||||
setFollowStatus(true);
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(0);
|
||||
if (isPet())
|
||||
{
|
||||
final Pet pet = (Pet) this;
|
||||
@ -133,13 +133,13 @@ public abstract class Summon extends Playable
|
||||
|
||||
if (_owner != null)
|
||||
{
|
||||
_owner.sendPacket(new PetInfo(this, 1));
|
||||
_owner.sendPacket(new ExPetSkillList(true, this));
|
||||
sendPacket(new PetInfo(this, 1));
|
||||
sendPacket(new ExPetSkillList(true, this));
|
||||
if (getInventory() != null)
|
||||
{
|
||||
_owner.sendPacket(new PetItemList(getInventory().getItems()));
|
||||
sendPacket(new PetItemList(getInventory().getItems()));
|
||||
}
|
||||
_owner.sendPacket(new RelationChanged(this, _owner.getRelation(_owner), false));
|
||||
sendPacket(new RelationChanged(this, _owner.getRelation(_owner), false));
|
||||
}
|
||||
World.getInstance().forEachVisibleObject(getOwner(), Player.class, player -> player.sendPacket(new RelationChanged(this, _owner.getRelation(player), isAutoAttackable(player))));
|
||||
final Party party = _owner.getParty();
|
||||
@ -199,14 +199,14 @@ public abstract class Summon extends Playable
|
||||
public void stopAllEffects()
|
||||
{
|
||||
super.stopAllEffects();
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAllEffectsExceptThoseThatLastThroughDeath()
|
||||
{
|
||||
super.stopAllEffectsExceptThoseThatLastThroughDeath();
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -384,7 +384,7 @@ public abstract class Summon extends Playable
|
||||
public void broadcastStatusUpdate(Creature caster)
|
||||
{
|
||||
super.broadcastStatusUpdate(caster);
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
public void deleteMe(Player owner)
|
||||
@ -836,17 +836,18 @@ public abstract class Summon extends Playable
|
||||
return _owner;
|
||||
}
|
||||
|
||||
public void updateAndBroadcastStatus()
|
||||
public void updateAndBroadcastStatus(int value)
|
||||
{
|
||||
if (_owner == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(0);
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
@ -886,9 +887,10 @@ public abstract class Summon extends Playable
|
||||
@Override
|
||||
public void sendInfo(Player player)
|
||||
{
|
||||
// Check if the Player is the owner of the Pet
|
||||
if (player == _owner)
|
||||
{
|
||||
player.sendPacket(new PetInfo(this, 1));
|
||||
player.sendPacket(new PetInfo(this, isDead() ? 0 : 1));
|
||||
if (isPet())
|
||||
{
|
||||
player.sendPacket(new PetItemList(getInventory().getItems()));
|
||||
@ -896,7 +898,7 @@ public abstract class Summon extends Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(new ExPetInfo(this, player, isShowSummonAnimation() ? 2 : isDead() ? 0 : 1));
|
||||
player.sendPacket(new ExPetInfo(this, player, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1436,10 +1436,10 @@ public class Pet extends Summon
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAndBroadcastStatus()
|
||||
public void updateAndBroadcastStatus(int value)
|
||||
{
|
||||
refreshOverloaded();
|
||||
super.updateAndBroadcastStatus();
|
||||
super.updateAndBroadcastStatus(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,7 +37,7 @@ public class PetStat extends SummonStat
|
||||
return false;
|
||||
}
|
||||
|
||||
getActiveChar().updateAndBroadcastStatus();
|
||||
getActiveChar().updateAndBroadcastStatus(1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ public class PetStat extends SummonStat
|
||||
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.YOUR_PET_GAINED_S1_XP);
|
||||
sm.addLong(finalExp);
|
||||
getActiveChar().updateAndBroadcastStatus();
|
||||
getActiveChar().updateAndBroadcastStatus(1);
|
||||
getActiveChar().sendPacket(sm);
|
||||
return true;
|
||||
}
|
||||
@ -71,7 +71,7 @@ public class PetStat extends SummonStat
|
||||
getActiveChar().broadcastPacket(new SocialAction(getActiveChar().getObjectId(), SocialAction.LEVEL_UP));
|
||||
}
|
||||
// Send a Server->Client packet PetInfo to the Player
|
||||
getActiveChar().updateAndBroadcastStatus();
|
||||
getActiveChar().updateAndBroadcastStatus(1);
|
||||
|
||||
if (getActiveChar().getControlItem() != null)
|
||||
{
|
||||
|
@ -287,7 +287,7 @@ public class PlayerStat extends PlayableStat
|
||||
pet.setCurrentHp(pet.getMaxHp());
|
||||
pet.setCurrentMp(pet.getMaxMp());
|
||||
pet.broadcastPacket(new SocialAction(getActiveChar().getObjectId(), SocialAction.LEVEL_UP));
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class PetInventory extends Inventory
|
||||
protected void refreshWeight()
|
||||
{
|
||||
super.refreshWeight();
|
||||
_owner.updateAndBroadcastStatus();
|
||||
_owner.updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -640,7 +640,7 @@ public class SkillCaster implements Runnable
|
||||
|
||||
if (obj.isSummon())
|
||||
{
|
||||
((Summon) obj).updateAndBroadcastStatus();
|
||||
((Summon) obj).updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
else if (obj.isAttackable())
|
||||
|
@ -85,6 +85,6 @@ public class RequestChangePetName implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
pet.setName(_name);
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class RequestPetUseItem implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
player.sendPacket(new PetItemList(pet.getInventory().getItems()));
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -133,7 +133,7 @@ public class RequestPetUseItem implements IClientIncomingPacket
|
||||
player.addTimeStampItem(item, reuseDelay);
|
||||
}
|
||||
player.sendPacket(new PetItemList(pet.getInventory().getItems()));
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -155,7 +155,7 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
{
|
||||
_statusMask |= 0x04;
|
||||
}
|
||||
_statusMask |= 0x08;
|
||||
_statusMask |= 0x08; // Show name (current on retail is empty).
|
||||
if (_statusMask != 0x00)
|
||||
{
|
||||
addComponentType(NpcInfoType.VISUAL_STATE);
|
||||
|
@ -2678,7 +2678,7 @@ public abstract class Creature extends WorldObject implements ISkillsHolder, IDe
|
||||
final Summon summon = (Summon) this;
|
||||
if (summon.getOwner() != null)
|
||||
{
|
||||
summon.updateAndBroadcastStatus();
|
||||
summon.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -10492,7 +10492,7 @@ public class Player extends Playable
|
||||
((SummonAI) _pet.getAI()).setStartFollowController(true);
|
||||
_pet.setFollowStatus(true);
|
||||
_pet.setInstance(getInstanceWorld());
|
||||
_pet.updateAndBroadcastStatus();
|
||||
_pet.updateAndBroadcastStatus(0);
|
||||
sendPacket(new PetInfo(_pet, 0));
|
||||
}
|
||||
|
||||
@ -10503,7 +10503,7 @@ public class Player extends Playable
|
||||
((SummonAI) s.getAI()).setStartFollowController(true);
|
||||
s.setFollowStatus(true);
|
||||
s.setInstance(getInstanceWorld());
|
||||
s.updateAndBroadcastStatus();
|
||||
s.updateAndBroadcastStatus(0);
|
||||
sendPacket(new PetInfo(s, 0));
|
||||
});
|
||||
|
||||
|
@ -123,7 +123,7 @@ public abstract class Summon extends Playable
|
||||
}
|
||||
|
||||
setFollowStatus(true);
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(0);
|
||||
if (isPet())
|
||||
{
|
||||
final Pet pet = (Pet) this;
|
||||
@ -133,13 +133,13 @@ public abstract class Summon extends Playable
|
||||
|
||||
if (_owner != null)
|
||||
{
|
||||
_owner.sendPacket(new PetInfo(this, 1));
|
||||
_owner.sendPacket(new ExPetSkillList(true, this));
|
||||
sendPacket(new PetInfo(this, 1));
|
||||
sendPacket(new ExPetSkillList(true, this));
|
||||
if (getInventory() != null)
|
||||
{
|
||||
_owner.sendPacket(new PetItemList(getInventory().getItems()));
|
||||
sendPacket(new PetItemList(getInventory().getItems()));
|
||||
}
|
||||
_owner.sendPacket(new RelationChanged(this, _owner.getRelation(_owner), false));
|
||||
sendPacket(new RelationChanged(this, _owner.getRelation(_owner), false));
|
||||
}
|
||||
World.getInstance().forEachVisibleObject(getOwner(), Player.class, player -> player.sendPacket(new RelationChanged(this, _owner.getRelation(player), isAutoAttackable(player))));
|
||||
final Party party = _owner.getParty();
|
||||
@ -199,14 +199,14 @@ public abstract class Summon extends Playable
|
||||
public void stopAllEffects()
|
||||
{
|
||||
super.stopAllEffects();
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void stopAllEffectsExceptThoseThatLastThroughDeath()
|
||||
{
|
||||
super.stopAllEffectsExceptThoseThatLastThroughDeath();
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -384,7 +384,7 @@ public abstract class Summon extends Playable
|
||||
public void broadcastStatusUpdate(Creature caster)
|
||||
{
|
||||
super.broadcastStatusUpdate(caster);
|
||||
updateAndBroadcastStatus();
|
||||
updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
public void deleteMe(Player owner)
|
||||
@ -836,17 +836,18 @@ public abstract class Summon extends Playable
|
||||
return _owner;
|
||||
}
|
||||
|
||||
public void updateAndBroadcastStatus()
|
||||
public void updateAndBroadcastStatus(int value)
|
||||
{
|
||||
if (_owner == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
sendPacket(new PetInfo(this, value));
|
||||
sendPacket(new PetStatusUpdate(this));
|
||||
if (isSpawned())
|
||||
{
|
||||
broadcastNpcInfo(0);
|
||||
broadcastNpcInfo(value);
|
||||
}
|
||||
final Party party = _owner.getParty();
|
||||
if (party != null)
|
||||
@ -886,9 +887,10 @@ public abstract class Summon extends Playable
|
||||
@Override
|
||||
public void sendInfo(Player player)
|
||||
{
|
||||
// Check if the Player is the owner of the Pet
|
||||
if (player == _owner)
|
||||
{
|
||||
player.sendPacket(new PetInfo(this, 1));
|
||||
player.sendPacket(new PetInfo(this, isDead() ? 0 : 1));
|
||||
if (isPet())
|
||||
{
|
||||
player.sendPacket(new PetItemList(getInventory().getItems()));
|
||||
@ -896,7 +898,7 @@ public abstract class Summon extends Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendPacket(new ExPetInfo(this, player, isShowSummonAnimation() ? 2 : isDead() ? 0 : 1));
|
||||
player.sendPacket(new ExPetInfo(this, player, 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1436,10 +1436,10 @@ public class Pet extends Summon
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateAndBroadcastStatus()
|
||||
public void updateAndBroadcastStatus(int value)
|
||||
{
|
||||
refreshOverloaded();
|
||||
super.updateAndBroadcastStatus();
|
||||
super.updateAndBroadcastStatus(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,7 +37,7 @@ public class PetStat extends SummonStat
|
||||
return false;
|
||||
}
|
||||
|
||||
getActiveChar().updateAndBroadcastStatus();
|
||||
getActiveChar().updateAndBroadcastStatus(1);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@ public class PetStat extends SummonStat
|
||||
|
||||
final SystemMessage sm = new SystemMessage(SystemMessageId.YOUR_PET_GAINED_S1_XP);
|
||||
sm.addLong(finalExp);
|
||||
getActiveChar().updateAndBroadcastStatus();
|
||||
getActiveChar().updateAndBroadcastStatus(1);
|
||||
getActiveChar().sendPacket(sm);
|
||||
return true;
|
||||
}
|
||||
@ -71,7 +71,7 @@ public class PetStat extends SummonStat
|
||||
getActiveChar().broadcastPacket(new SocialAction(getActiveChar().getObjectId(), SocialAction.LEVEL_UP));
|
||||
}
|
||||
// Send a Server->Client packet PetInfo to the Player
|
||||
getActiveChar().updateAndBroadcastStatus();
|
||||
getActiveChar().updateAndBroadcastStatus(1);
|
||||
|
||||
if (getActiveChar().getControlItem() != null)
|
||||
{
|
||||
|
@ -287,7 +287,7 @@ public class PlayerStat extends PlayableStat
|
||||
pet.setCurrentHp(pet.getMaxHp());
|
||||
pet.setCurrentMp(pet.getMaxMp());
|
||||
pet.broadcastPacket(new SocialAction(getActiveChar().getObjectId(), SocialAction.LEVEL_UP));
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,7 @@ public class PetInventory extends Inventory
|
||||
protected void refreshWeight()
|
||||
{
|
||||
super.refreshWeight();
|
||||
_owner.updateAndBroadcastStatus();
|
||||
_owner.updateAndBroadcastStatus(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -640,7 +640,7 @@ public class SkillCaster implements Runnable
|
||||
|
||||
if (obj.isSummon())
|
||||
{
|
||||
((Summon) obj).updateAndBroadcastStatus();
|
||||
((Summon) obj).updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
else if (obj.isAttackable())
|
||||
|
@ -85,6 +85,6 @@ public class RequestChangePetName implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
pet.setName(_name);
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
|
@ -118,7 +118,7 @@ public class RequestPetUseItem implements IClientIncomingPacket
|
||||
}
|
||||
|
||||
player.sendPacket(new PetItemList(pet.getInventory().getItems()));
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -133,7 +133,7 @@ public class RequestPetUseItem implements IClientIncomingPacket
|
||||
player.addTimeStampItem(item, reuseDelay);
|
||||
}
|
||||
player.sendPacket(new PetItemList(pet.getInventory().getItems()));
|
||||
pet.updateAndBroadcastStatus();
|
||||
pet.updateAndBroadcastStatus(1);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -208,7 +208,7 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
OutgoingPackets.SUMMON_INFO.writeId(packet);
|
||||
packet.writeD(_summon.getObjectId());
|
||||
packet.writeC(_value); // 0=teleported 1=default 2=summoned
|
||||
packet.writeH(37); // mask_bits_37
|
||||
packet.writeH(38); // 338 - mask_bits_38
|
||||
packet.writeB(_masks);
|
||||
// Block 1
|
||||
packet.writeC(_initSize);
|
||||
|
@ -155,7 +155,7 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
{
|
||||
_statusMask |= 0x04;
|
||||
}
|
||||
_statusMask |= 0x08;
|
||||
_statusMask |= 0x08; // Show name (current on retail is empty).
|
||||
if (_statusMask != 0x00)
|
||||
{
|
||||
addComponentType(NpcInfoType.VISUAL_STATE);
|
||||
@ -208,7 +208,7 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
||||
OutgoingPackets.EX_PET_INFO.writeId(packet);
|
||||
packet.writeD(_summon.getObjectId());
|
||||
packet.writeC(_value); // 0=teleported 1=default 2=summoned
|
||||
packet.writeH(37); // mask_bits_37
|
||||
packet.writeH(38); // 338 - mask_bits_38
|
||||
packet.writeB(_masks);
|
||||
// Block 1
|
||||
packet.writeC(_initSize);
|
||||
|
Loading…
Reference in New Issue
Block a user