Servitor improvements.
This commit is contained in:
@@ -62,7 +62,7 @@ public enum NpcInfoType implements IUpdateTypeComponent
|
|||||||
// 4
|
// 4
|
||||||
TITLE_NPCSTRINGID(0x20, 4),
|
TITLE_NPCSTRINGID(0x20, 4),
|
||||||
PVP_FLAG(0x21, 1),
|
PVP_FLAG(0x21, 1),
|
||||||
NAME_COLOR(0x22, 4),
|
REPUTATION(0x22, 4),
|
||||||
CLAN(0x23, (5 * 4)),
|
CLAN(0x23, (5 * 4)),
|
||||||
ABNORMALS(0x24, 0),
|
ABNORMALS(0x24, 0),
|
||||||
VISUAL_STATE(0x25, 1);
|
VISUAL_STATE(0x25, 1);
|
||||||
|
@@ -191,20 +191,19 @@ public abstract class L2Summon extends L2Playable
|
|||||||
{
|
{
|
||||||
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
||||||
{
|
{
|
||||||
|
if (player == getOwner())
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExPetInfo(this, player, 1));
|
player.sendPacket(new ExPetInfo(this, player, 1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (player == getOwner())
|
player.sendPacket(new SummonInfo(this, player, 1));
|
||||||
{
|
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendPacket(new SummonInfo(this, player, 1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -364,6 +363,8 @@ public abstract class L2Summon extends L2Playable
|
|||||||
|
|
||||||
public void deleteMe(L2PcInstance owner)
|
public void deleteMe(L2PcInstance owner)
|
||||||
{
|
{
|
||||||
|
super.deleteMe();
|
||||||
|
|
||||||
if (owner != null)
|
if (owner != null)
|
||||||
{
|
{
|
||||||
owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
|
owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
|
||||||
@@ -372,16 +373,7 @@ public abstract class L2Summon extends L2Playable
|
|||||||
{
|
{
|
||||||
party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
|
party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// pet will be deleted along with all his items
|
|
||||||
if (getInventory() != null)
|
|
||||||
{
|
|
||||||
getInventory().destroyAllItems("pet deleted", getOwner(), this);
|
|
||||||
}
|
|
||||||
decayMe();
|
|
||||||
if (owner != null)
|
|
||||||
{
|
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
owner.setPet(null);
|
owner.setPet(null);
|
||||||
@@ -391,7 +383,13 @@ public abstract class L2Summon extends L2Playable
|
|||||||
owner.removeServitor(getObjectId());
|
owner.removeServitor(getObjectId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
super.deleteMe();
|
|
||||||
|
// pet will be deleted along with all his items
|
||||||
|
if (getInventory() != null)
|
||||||
|
{
|
||||||
|
getInventory().destroyAllItems("pet deleted", getOwner(), this);
|
||||||
|
}
|
||||||
|
decayMe();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unSummon(L2PcInstance owner)
|
public void unSummon(L2PcInstance owner)
|
||||||
@@ -842,7 +840,7 @@ public abstract class L2Summon extends L2Playable
|
|||||||
// Check if the L2PcInstance is the owner of the Pet
|
// Check if the L2PcInstance is the owner of the Pet
|
||||||
if (activeChar == getOwner())
|
if (activeChar == getOwner())
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(new PetInfo(this, 1));
|
activeChar.sendPacket(new PetInfo(this, isDead() ? 0 : 1));
|
||||||
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
|
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
|
||||||
updateEffectIcons(true);
|
updateEffectIcons(true);
|
||||||
if (isPet())
|
if (isPet())
|
||||||
|
@@ -147,6 +147,11 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
addComponentType(NpcInfoType.SUMMONED);
|
addComponentType(NpcInfoType.SUMMONED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (summon.getReputation() != 0)
|
||||||
|
{
|
||||||
|
addComponentType(NpcInfoType.REPUTATION);
|
||||||
|
}
|
||||||
|
|
||||||
if (summon.getOwner().getClan() != null)
|
if (summon.getOwner().getClan() != null)
|
||||||
{
|
{
|
||||||
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
||||||
@@ -366,9 +371,9 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(_summon.getReputation()); // Name color
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.CLAN))
|
if (containsMask(NpcInfoType.CLAN))
|
||||||
{
|
{
|
||||||
|
@@ -400,7 +400,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_npc.getPvpFlag()); // PVP flag
|
packet.writeC(_npc.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(0x00); // Name color
|
||||||
}
|
}
|
||||||
|
@@ -65,8 +65,11 @@ public class PetInfo implements IClientOutgoingPacket
|
|||||||
_maxFed = sum.getLifeTime();
|
_maxFed = sum.getLifeTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// _statusMask |= 0x01; // Auto attackable status
|
if (summon.isBetrayed())
|
||||||
// _statusMask |= 0x02; // can be chatted with
|
{
|
||||||
|
_statusMask |= 0x01; // Auto attackable status
|
||||||
|
}
|
||||||
|
_statusMask |= 0x02; // can be chatted with
|
||||||
|
|
||||||
if (summon.isRunning())
|
if (summon.isRunning())
|
||||||
{
|
{
|
||||||
|
@@ -147,6 +147,11 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
addComponentType(NpcInfoType.SUMMONED);
|
addComponentType(NpcInfoType.SUMMONED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (summon.getReputation() != 0)
|
||||||
|
{
|
||||||
|
addComponentType(NpcInfoType.REPUTATION);
|
||||||
|
}
|
||||||
|
|
||||||
if (summon.getOwner().getClan() != null)
|
if (summon.getOwner().getClan() != null)
|
||||||
{
|
{
|
||||||
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
||||||
@@ -366,9 +371,9 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(_summon.getReputation()); // Name color
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.CLAN))
|
if (containsMask(NpcInfoType.CLAN))
|
||||||
{
|
{
|
||||||
|
@@ -62,7 +62,7 @@ public enum NpcInfoType implements IUpdateTypeComponent
|
|||||||
// 4
|
// 4
|
||||||
TITLE_NPCSTRINGID(0x20, 4),
|
TITLE_NPCSTRINGID(0x20, 4),
|
||||||
PVP_FLAG(0x21, 1),
|
PVP_FLAG(0x21, 1),
|
||||||
NAME_COLOR(0x22, 4),
|
REPUTATION(0x22, 4),
|
||||||
CLAN(0x23, (5 * 4)),
|
CLAN(0x23, (5 * 4)),
|
||||||
ABNORMALS(0x24, 0),
|
ABNORMALS(0x24, 0),
|
||||||
VISUAL_STATE(0x25, 1);
|
VISUAL_STATE(0x25, 1);
|
||||||
|
@@ -191,20 +191,19 @@ public abstract class L2Summon extends L2Playable
|
|||||||
{
|
{
|
||||||
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
||||||
{
|
{
|
||||||
|
if (player == getOwner())
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExPetInfo(this, player, 1));
|
player.sendPacket(new ExPetInfo(this, player, 1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (player == getOwner())
|
player.sendPacket(new SummonInfo(this, player, 1));
|
||||||
{
|
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendPacket(new SummonInfo(this, player, 1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -364,6 +363,8 @@ public abstract class L2Summon extends L2Playable
|
|||||||
|
|
||||||
public void deleteMe(L2PcInstance owner)
|
public void deleteMe(L2PcInstance owner)
|
||||||
{
|
{
|
||||||
|
super.deleteMe();
|
||||||
|
|
||||||
if (owner != null)
|
if (owner != null)
|
||||||
{
|
{
|
||||||
owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
|
owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
|
||||||
@@ -372,16 +373,7 @@ public abstract class L2Summon extends L2Playable
|
|||||||
{
|
{
|
||||||
party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
|
party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// pet will be deleted along with all his items
|
|
||||||
if (getInventory() != null)
|
|
||||||
{
|
|
||||||
getInventory().destroyAllItems("pet deleted", getOwner(), this);
|
|
||||||
}
|
|
||||||
decayMe();
|
|
||||||
if (owner != null)
|
|
||||||
{
|
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
owner.setPet(null);
|
owner.setPet(null);
|
||||||
@@ -391,7 +383,13 @@ public abstract class L2Summon extends L2Playable
|
|||||||
owner.removeServitor(getObjectId());
|
owner.removeServitor(getObjectId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
super.deleteMe();
|
|
||||||
|
// pet will be deleted along with all his items
|
||||||
|
if (getInventory() != null)
|
||||||
|
{
|
||||||
|
getInventory().destroyAllItems("pet deleted", getOwner(), this);
|
||||||
|
}
|
||||||
|
decayMe();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unSummon(L2PcInstance owner)
|
public void unSummon(L2PcInstance owner)
|
||||||
@@ -842,7 +840,7 @@ public abstract class L2Summon extends L2Playable
|
|||||||
// Check if the L2PcInstance is the owner of the Pet
|
// Check if the L2PcInstance is the owner of the Pet
|
||||||
if (activeChar == getOwner())
|
if (activeChar == getOwner())
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(new PetInfo(this, 1));
|
activeChar.sendPacket(new PetInfo(this, isDead() ? 0 : 1));
|
||||||
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
|
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
|
||||||
updateEffectIcons(true);
|
updateEffectIcons(true);
|
||||||
if (isPet())
|
if (isPet())
|
||||||
|
@@ -147,6 +147,11 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
addComponentType(NpcInfoType.SUMMONED);
|
addComponentType(NpcInfoType.SUMMONED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (summon.getReputation() != 0)
|
||||||
|
{
|
||||||
|
addComponentType(NpcInfoType.REPUTATION);
|
||||||
|
}
|
||||||
|
|
||||||
if (summon.getOwner().getClan() != null)
|
if (summon.getOwner().getClan() != null)
|
||||||
{
|
{
|
||||||
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
||||||
@@ -366,9 +371,9 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(_summon.getReputation()); // Name color
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.CLAN))
|
if (containsMask(NpcInfoType.CLAN))
|
||||||
{
|
{
|
||||||
|
@@ -400,7 +400,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_npc.getPvpFlag()); // PVP flag
|
packet.writeC(_npc.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(0x00); // Name color
|
||||||
}
|
}
|
||||||
|
@@ -65,8 +65,11 @@ public class PetInfo implements IClientOutgoingPacket
|
|||||||
_maxFed = sum.getLifeTime();
|
_maxFed = sum.getLifeTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// _statusMask |= 0x01; // Auto attackable status
|
if (summon.isBetrayed())
|
||||||
// _statusMask |= 0x02; // can be chatted with
|
{
|
||||||
|
_statusMask |= 0x01; // Auto attackable status
|
||||||
|
}
|
||||||
|
_statusMask |= 0x02; // can be chatted with
|
||||||
|
|
||||||
if (summon.isRunning())
|
if (summon.isRunning())
|
||||||
{
|
{
|
||||||
|
@@ -147,6 +147,11 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
addComponentType(NpcInfoType.SUMMONED);
|
addComponentType(NpcInfoType.SUMMONED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (summon.getReputation() != 0)
|
||||||
|
{
|
||||||
|
addComponentType(NpcInfoType.REPUTATION);
|
||||||
|
}
|
||||||
|
|
||||||
if (summon.getOwner().getClan() != null)
|
if (summon.getOwner().getClan() != null)
|
||||||
{
|
{
|
||||||
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
||||||
@@ -366,9 +371,9 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(_summon.getReputation()); // Name color
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.CLAN))
|
if (containsMask(NpcInfoType.CLAN))
|
||||||
{
|
{
|
||||||
|
@@ -62,7 +62,7 @@ public enum NpcInfoType implements IUpdateTypeComponent
|
|||||||
// 4
|
// 4
|
||||||
TITLE_NPCSTRINGID(0x20, 4),
|
TITLE_NPCSTRINGID(0x20, 4),
|
||||||
PVP_FLAG(0x21, 1),
|
PVP_FLAG(0x21, 1),
|
||||||
NAME_COLOR(0x22, 4),
|
REPUTATION(0x22, 4),
|
||||||
CLAN(0x23, (5 * 4)),
|
CLAN(0x23, (5 * 4)),
|
||||||
ABNORMALS(0x24, 0),
|
ABNORMALS(0x24, 0),
|
||||||
VISUAL_STATE(0x25, 1);
|
VISUAL_STATE(0x25, 1);
|
||||||
|
@@ -191,20 +191,19 @@ public abstract class L2Summon extends L2Playable
|
|||||||
{
|
{
|
||||||
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
||||||
{
|
{
|
||||||
|
if (player == getOwner())
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExPetInfo(this, player, 1));
|
player.sendPacket(new ExPetInfo(this, player, 1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (player == getOwner())
|
player.sendPacket(new SummonInfo(this, player, 1));
|
||||||
{
|
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendPacket(new SummonInfo(this, player, 1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -364,6 +363,8 @@ public abstract class L2Summon extends L2Playable
|
|||||||
|
|
||||||
public void deleteMe(L2PcInstance owner)
|
public void deleteMe(L2PcInstance owner)
|
||||||
{
|
{
|
||||||
|
super.deleteMe();
|
||||||
|
|
||||||
if (owner != null)
|
if (owner != null)
|
||||||
{
|
{
|
||||||
owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
|
owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
|
||||||
@@ -372,16 +373,7 @@ public abstract class L2Summon extends L2Playable
|
|||||||
{
|
{
|
||||||
party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
|
party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// pet will be deleted along with all his items
|
|
||||||
if (getInventory() != null)
|
|
||||||
{
|
|
||||||
getInventory().destroyAllItems("pet deleted", getOwner(), this);
|
|
||||||
}
|
|
||||||
decayMe();
|
|
||||||
if (owner != null)
|
|
||||||
{
|
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
owner.setPet(null);
|
owner.setPet(null);
|
||||||
@@ -391,7 +383,13 @@ public abstract class L2Summon extends L2Playable
|
|||||||
owner.removeServitor(getObjectId());
|
owner.removeServitor(getObjectId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
super.deleteMe();
|
|
||||||
|
// pet will be deleted along with all his items
|
||||||
|
if (getInventory() != null)
|
||||||
|
{
|
||||||
|
getInventory().destroyAllItems("pet deleted", getOwner(), this);
|
||||||
|
}
|
||||||
|
decayMe();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unSummon(L2PcInstance owner)
|
public void unSummon(L2PcInstance owner)
|
||||||
@@ -842,7 +840,7 @@ public abstract class L2Summon extends L2Playable
|
|||||||
// Check if the L2PcInstance is the owner of the Pet
|
// Check if the L2PcInstance is the owner of the Pet
|
||||||
if (activeChar == getOwner())
|
if (activeChar == getOwner())
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(new PetInfo(this, 1));
|
activeChar.sendPacket(new PetInfo(this, isDead() ? 0 : 1));
|
||||||
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
|
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
|
||||||
updateEffectIcons(true);
|
updateEffectIcons(true);
|
||||||
if (isPet())
|
if (isPet())
|
||||||
|
@@ -147,6 +147,11 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
addComponentType(NpcInfoType.SUMMONED);
|
addComponentType(NpcInfoType.SUMMONED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (summon.getReputation() != 0)
|
||||||
|
{
|
||||||
|
addComponentType(NpcInfoType.REPUTATION);
|
||||||
|
}
|
||||||
|
|
||||||
if (summon.getOwner().getClan() != null)
|
if (summon.getOwner().getClan() != null)
|
||||||
{
|
{
|
||||||
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
||||||
@@ -366,9 +371,9 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(_summon.getReputation()); // Name color
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.CLAN))
|
if (containsMask(NpcInfoType.CLAN))
|
||||||
{
|
{
|
||||||
|
@@ -400,7 +400,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_npc.getPvpFlag()); // PVP flag
|
packet.writeC(_npc.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(0x00); // Name color
|
||||||
}
|
}
|
||||||
|
@@ -65,8 +65,11 @@ public class PetInfo implements IClientOutgoingPacket
|
|||||||
_maxFed = sum.getLifeTime();
|
_maxFed = sum.getLifeTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// _statusMask |= 0x01; // Auto attackable status
|
if (summon.isBetrayed())
|
||||||
// _statusMask |= 0x02; // can be chatted with
|
{
|
||||||
|
_statusMask |= 0x01; // Auto attackable status
|
||||||
|
}
|
||||||
|
_statusMask |= 0x02; // can be chatted with
|
||||||
|
|
||||||
if (summon.isRunning())
|
if (summon.isRunning())
|
||||||
{
|
{
|
||||||
|
@@ -147,6 +147,11 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
addComponentType(NpcInfoType.SUMMONED);
|
addComponentType(NpcInfoType.SUMMONED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (summon.getReputation() != 0)
|
||||||
|
{
|
||||||
|
addComponentType(NpcInfoType.REPUTATION);
|
||||||
|
}
|
||||||
|
|
||||||
if (summon.getOwner().getClan() != null)
|
if (summon.getOwner().getClan() != null)
|
||||||
{
|
{
|
||||||
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
||||||
@@ -366,9 +371,9 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(_summon.getReputation()); // Name color
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.CLAN))
|
if (containsMask(NpcInfoType.CLAN))
|
||||||
{
|
{
|
||||||
|
@@ -62,7 +62,7 @@ public enum NpcInfoType implements IUpdateTypeComponent
|
|||||||
// 4
|
// 4
|
||||||
TITLE_NPCSTRINGID(0x20, 4),
|
TITLE_NPCSTRINGID(0x20, 4),
|
||||||
PVP_FLAG(0x21, 1),
|
PVP_FLAG(0x21, 1),
|
||||||
NAME_COLOR(0x22, 4),
|
REPUTATION(0x22, 4),
|
||||||
CLAN(0x23, (5 * 4)),
|
CLAN(0x23, (5 * 4)),
|
||||||
ABNORMALS(0x24, 0),
|
ABNORMALS(0x24, 0),
|
||||||
VISUAL_STATE(0x25, 1);
|
VISUAL_STATE(0x25, 1);
|
||||||
|
@@ -191,20 +191,19 @@ public abstract class L2Summon extends L2Playable
|
|||||||
{
|
{
|
||||||
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
|
||||||
{
|
{
|
||||||
|
if (player == getOwner())
|
||||||
|
{
|
||||||
|
player.sendPacket(new PetInfo(this, 1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
player.sendPacket(new ExPetInfo(this, player, 1));
|
player.sendPacket(new ExPetInfo(this, player, 1));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (player == getOwner())
|
player.sendPacket(new SummonInfo(this, player, 1));
|
||||||
{
|
|
||||||
player.sendPacket(new PetInfo(this, 1));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
player.sendPacket(new SummonInfo(this, player, 1));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -364,6 +363,8 @@ public abstract class L2Summon extends L2Playable
|
|||||||
|
|
||||||
public void deleteMe(L2PcInstance owner)
|
public void deleteMe(L2PcInstance owner)
|
||||||
{
|
{
|
||||||
|
super.deleteMe();
|
||||||
|
|
||||||
if (owner != null)
|
if (owner != null)
|
||||||
{
|
{
|
||||||
owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
|
owner.sendPacket(new PetDelete(getSummonType(), getObjectId()));
|
||||||
@@ -372,16 +373,7 @@ public abstract class L2Summon extends L2Playable
|
|||||||
{
|
{
|
||||||
party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
|
party.broadcastToPartyMembers(owner, new ExPartyPetWindowDelete(this));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// pet will be deleted along with all his items
|
|
||||||
if (getInventory() != null)
|
|
||||||
{
|
|
||||||
getInventory().destroyAllItems("pet deleted", getOwner(), this);
|
|
||||||
}
|
|
||||||
decayMe();
|
|
||||||
if (owner != null)
|
|
||||||
{
|
|
||||||
if (isPet())
|
if (isPet())
|
||||||
{
|
{
|
||||||
owner.setPet(null);
|
owner.setPet(null);
|
||||||
@@ -391,7 +383,13 @@ public abstract class L2Summon extends L2Playable
|
|||||||
owner.removeServitor(getObjectId());
|
owner.removeServitor(getObjectId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
super.deleteMe();
|
|
||||||
|
// pet will be deleted along with all his items
|
||||||
|
if (getInventory() != null)
|
||||||
|
{
|
||||||
|
getInventory().destroyAllItems("pet deleted", getOwner(), this);
|
||||||
|
}
|
||||||
|
decayMe();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void unSummon(L2PcInstance owner)
|
public void unSummon(L2PcInstance owner)
|
||||||
@@ -842,7 +840,7 @@ public abstract class L2Summon extends L2Playable
|
|||||||
// Check if the L2PcInstance is the owner of the Pet
|
// Check if the L2PcInstance is the owner of the Pet
|
||||||
if (activeChar == getOwner())
|
if (activeChar == getOwner())
|
||||||
{
|
{
|
||||||
activeChar.sendPacket(new PetInfo(this, 1));
|
activeChar.sendPacket(new PetInfo(this, isDead() ? 0 : 1));
|
||||||
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
|
// The PetInfo packet wipes the PartySpelled (list of active spells' icons). Re-add them
|
||||||
updateEffectIcons(true);
|
updateEffectIcons(true);
|
||||||
if (isPet())
|
if (isPet())
|
||||||
|
@@ -147,6 +147,11 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
addComponentType(NpcInfoType.SUMMONED);
|
addComponentType(NpcInfoType.SUMMONED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (summon.getReputation() != 0)
|
||||||
|
{
|
||||||
|
addComponentType(NpcInfoType.REPUTATION);
|
||||||
|
}
|
||||||
|
|
||||||
if (summon.getOwner().getClan() != null)
|
if (summon.getOwner().getClan() != null)
|
||||||
{
|
{
|
||||||
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
||||||
@@ -366,9 +371,9 @@ public class ExPetInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(_summon.getReputation()); // Name color
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.CLAN))
|
if (containsMask(NpcInfoType.CLAN))
|
||||||
{
|
{
|
||||||
|
@@ -400,7 +400,7 @@ public class NpcInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_npc.getPvpFlag()); // PVP flag
|
packet.writeC(_npc.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(0x00); // Name color
|
||||||
}
|
}
|
||||||
|
@@ -65,8 +65,11 @@ public class PetInfo implements IClientOutgoingPacket
|
|||||||
_maxFed = sum.getLifeTime();
|
_maxFed = sum.getLifeTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
// _statusMask |= 0x01; // Auto attackable status
|
if (summon.isBetrayed())
|
||||||
// _statusMask |= 0x02; // can be chatted with
|
{
|
||||||
|
_statusMask |= 0x01; // Auto attackable status
|
||||||
|
}
|
||||||
|
_statusMask |= 0x02; // can be chatted with
|
||||||
|
|
||||||
if (summon.isRunning())
|
if (summon.isRunning())
|
||||||
{
|
{
|
||||||
|
@@ -147,6 +147,11 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
addComponentType(NpcInfoType.SUMMONED);
|
addComponentType(NpcInfoType.SUMMONED);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (summon.getReputation() != 0)
|
||||||
|
{
|
||||||
|
addComponentType(NpcInfoType.REPUTATION);
|
||||||
|
}
|
||||||
|
|
||||||
if (summon.getOwner().getClan() != null)
|
if (summon.getOwner().getClan() != null)
|
||||||
{
|
{
|
||||||
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
_clanId = summon.getOwner().getAppearance().getVisibleClanId();
|
||||||
@@ -366,9 +371,9 @@ public class SummonInfo extends AbstractMaskPacket<NpcInfoType>
|
|||||||
{
|
{
|
||||||
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
packet.writeC(_summon.getPvpFlag()); // PVP flag
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.NAME_COLOR))
|
if (containsMask(NpcInfoType.REPUTATION))
|
||||||
{
|
{
|
||||||
packet.writeD(0x00); // Name color
|
packet.writeD(_summon.getReputation()); // Name color
|
||||||
}
|
}
|
||||||
if (containsMask(NpcInfoType.CLAN))
|
if (containsMask(NpcInfoType.CLAN))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user