Previous commit for older branches.

This commit is contained in:
MobiusDevelopment
2021-05-21 23:17:20 +00:00
parent 2a47b926ed
commit 80d9daf414
42 changed files with 452 additions and 431 deletions
@@ -1039,27 +1039,27 @@ public class PlayerInstance extends Playable
result |= RelationChanged.RELATION_ATTACKER; result |= RelationChanged.RELATION_ATTACKER;
} }
} }
if ((clan != null) && (targetClan != null)) if ((clan != null) && (targetClan != null) && (target.getPledgeType() != Clan.SUBUNIT_ACADEMY) && (getPledgeType() != Clan.SUBUNIT_ACADEMY))
{ {
if ((target.getPledgeType() != Clan.SUBUNIT_ACADEMY) && (getPledgeType() != Clan.SUBUNIT_ACADEMY)) final ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{ {
ClanWar war = clan.getWarWith(target.getClan().getId()); switch (war.getState())
if (war != null)
{ {
switch (war.getState()) case DECLARATION:
case BLOOD_DECLARATION:
{ {
case DECLARATION: if (war.getAttackerClanId() == target.getClanId())
case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
} }
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
} }
} }
} }
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1045,27 +1045,27 @@ public class PlayerInstance extends Playable
result |= RelationChanged.RELATION_ATTACKER; result |= RelationChanged.RELATION_ATTACKER;
} }
} }
if ((clan != null) && (targetClan != null)) if ((clan != null) && (targetClan != null) && (target.getPledgeType() != Clan.SUBUNIT_ACADEMY) && (getPledgeType() != Clan.SUBUNIT_ACADEMY))
{ {
if ((target.getPledgeType() != Clan.SUBUNIT_ACADEMY) && (getPledgeType() != Clan.SUBUNIT_ACADEMY)) final ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{ {
ClanWar war = clan.getWarWith(target.getClan().getId()); switch (war.getState())
if (war != null)
{ {
switch (war.getState()) case DECLARATION:
case BLOOD_DECLARATION:
{ {
case DECLARATION: if (war.getAttackerClanId() == target.getClanId())
case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
} }
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
} }
} }
} }
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1047,27 +1047,27 @@ public class PlayerInstance extends Playable
result |= RelationChanged.RELATION_ATTACKER; result |= RelationChanged.RELATION_ATTACKER;
} }
} }
if ((clan != null) && (targetClan != null)) if ((clan != null) && (targetClan != null) && (target.getPledgeType() != Clan.SUBUNIT_ACADEMY) && (getPledgeType() != Clan.SUBUNIT_ACADEMY))
{ {
if ((target.getPledgeType() != Clan.SUBUNIT_ACADEMY) && (getPledgeType() != Clan.SUBUNIT_ACADEMY)) final ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{ {
ClanWar war = clan.getWarWith(target.getClan().getId()); switch (war.getState())
if (war != null)
{ {
switch (war.getState()) case DECLARATION:
case BLOOD_DECLARATION:
{ {
case DECLARATION: if (war.getAttackerClanId() == target.getClanId())
case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
} }
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
} }
} }
} }
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1057,27 +1057,27 @@ public class PlayerInstance extends Playable
result |= RelationChanged.RELATION_ATTACKER; result |= RelationChanged.RELATION_ATTACKER;
} }
} }
if ((clan != null) && (targetClan != null)) if ((clan != null) && (targetClan != null) && (target.getPledgeType() != Clan.SUBUNIT_ACADEMY) && (getPledgeType() != Clan.SUBUNIT_ACADEMY))
{ {
if ((target.getPledgeType() != Clan.SUBUNIT_ACADEMY) && (getPledgeType() != Clan.SUBUNIT_ACADEMY)) final ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{ {
ClanWar war = clan.getWarWith(target.getClan().getId()); switch (war.getState())
if (war != null)
{ {
switch (war.getState()) case DECLARATION:
case BLOOD_DECLARATION:
{ {
case DECLARATION: if (war.getAttackerClanId() == target.getClanId())
case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
} }
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
} }
} }
} }
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1063,7 +1063,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1063,7 +1063,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1063,7 +1063,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1079,7 +1079,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -21,16 +21,16 @@ package org.l2jmobius.gameserver.cache;
*/ */
public final class RelationCache public final class RelationCache
{ {
private final int _relation; private final long _relation;
private final boolean _isAutoAttackable; private final boolean _isAutoAttackable;
public RelationCache(int relation, boolean isAutoAttackable) public RelationCache(long relation, boolean isAutoAttackable)
{ {
_relation = relation; _relation = relation;
_isAutoAttackable = isAutoAttackable; _isAutoAttackable = isAutoAttackable;
} }
public int getRelation() public long getRelation()
{ {
return _relation; return _relation;
} }
@@ -971,12 +971,12 @@ public class PlayerInstance extends Playable
return _chars; return _chars;
} }
public int getRelation(PlayerInstance target) public long getRelation(PlayerInstance target)
{ {
final Clan clan = getClan(); final Clan clan = getClan();
final Party party = getParty(); final Party party = getParty();
final Clan targetClan = target.getClan(); final Clan targetClan = target.getClan();
int result = 0; long result = 0;
if (clan != null) if (clan != null)
{ {
result |= RelationChanged.RELATION_CLAN_MEMBER; result |= RelationChanged.RELATION_CLAN_MEMBER;
@@ -1078,12 +1078,14 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR; result |= RelationChanged.RELATION_MUTUAL_WAR;
break; break;
} }
@@ -1780,7 +1782,7 @@ public class PlayerInstance extends Playable
return; return;
} }
final int relation = getRelation(player); final long relation = getRelation(player);
final boolean isAutoAttackable = isAutoAttackable(player); final boolean isAutoAttackable = isAutoAttackable(player);
final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -4073,7 +4075,7 @@ public class PlayerInstance extends Playable
} }
// Update relation. // Update relation.
final int relation = getRelation(player); final long relation = getRelation(player);
final boolean isAutoAttackable = isAutoAttackable(player); final boolean isAutoAttackable = isAutoAttackable(player);
final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -6345,7 +6347,7 @@ public class PlayerInstance extends Playable
return; return;
} }
final int relation = getRelation(player); final long relation = getRelation(player);
final boolean isAutoAttackable = isAutoAttackable(player); final boolean isAutoAttackable = isAutoAttackable(player);
final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -12372,7 +12374,7 @@ public class PlayerInstance extends Playable
player.sendPacket(new CharInfo(this, isInvisible() && player.canOverrideCond(PlayerCondOverride.SEE_ALL_PLAYERS))); player.sendPacket(new CharInfo(this, isInvisible() && player.canOverrideCond(PlayerCondOverride.SEE_ALL_PLAYERS)));
} }
final int relation1 = getRelation(player); final long relation1 = getRelation(player);
final RelationChanged rc1 = new RelationChanged(); final RelationChanged rc1 = new RelationChanged();
rc1.addRelation(this, relation1, !isInsideZone(ZoneId.PEACE) || !isInsideZone(ZoneId.NO_PVP)); rc1.addRelation(this, relation1, !isInsideZone(ZoneId.PEACE) || !isInsideZone(ZoneId.NO_PVP));
if (hasSummon()) if (hasSummon())
@@ -12388,7 +12390,7 @@ public class PlayerInstance extends Playable
} }
player.sendPacket(rc1); player.sendPacket(rc1);
final int relation2 = player.getRelation(this); final long relation2 = player.getRelation(this);
final RelationChanged rc2 = new RelationChanged(); final RelationChanged rc2 = new RelationChanged();
rc2.addRelation(player, relation2, !player.isInsideZone(ZoneId.PEACE)); rc2.addRelation(player, relation2, !player.isInsideZone(ZoneId.PEACE));
if (player.hasSummon()) if (player.hasSummon())
@@ -594,7 +594,7 @@ public class Siege implements Siegable
return; return;
} }
final int relation = member.getRelation(player); final long relation = member.getRelation(player);
final boolean isAutoAttackable = member.isAutoAttackable(player); final boolean isAutoAttackable = member.isAutoAttackable(player);
final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -654,7 +654,7 @@ public class Siege implements Siegable
return; return;
} }
final int relation = member.getRelation(player); final long relation = member.getRelation(player);
final boolean isAutoAttackable = member.isAutoAttackable(player); final boolean isAutoAttackable = member.isAutoAttackable(player);
final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -29,33 +29,32 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x100; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x200; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x400; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x800; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x4000; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x8000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
public static final long RELATION_DECLARED_WAR = 0x40000000L; // single sword
public static final long RELATION_MUTUAL_WAR = 0x4E200000L; // double swords?
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
{ {
int _objId; int _objId;
int _relation; long _relation;
int _autoAttackable; int _autoAttackable;
int _reputation; int _reputation;
int _pvpFlag; int _pvpFlag;
@@ -65,7 +64,7 @@ public class RelationChanged implements IClientOutgoingPacket
private final List<Relation> _multi; private final List<Relation> _multi;
private byte _mask = 0x00; private byte _mask = 0x00;
public RelationChanged(Playable activeChar, int relation, boolean autoattackable) public RelationChanged(Playable activeChar, long relation, boolean autoattackable)
{ {
_mask |= SEND_ONE; _mask |= SEND_ONE;
_singled = new Relation(); _singled = new Relation();
@@ -83,13 +82,13 @@ public class RelationChanged implements IClientOutgoingPacket
_multi = new LinkedList<>(); _multi = new LinkedList<>();
} }
public void addRelation(Playable activeChar, int relation, boolean autoattackable) public void addRelation(Playable activeChar, long relation, boolean autoattackable)
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,9 +123,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeQ(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
packet.writeD(relation._reputation); packet.writeD(relation._reputation);
packet.writeC(relation._pvpFlag); packet.writeC(relation._pvpFlag);
@@ -82,7 +82,7 @@ public class Broadcast
player.sendPacket(mov); player.sendPacket(mov);
if ((mov instanceof CharInfo) && (creature.isPlayer())) if ((mov instanceof CharInfo) && (creature.isPlayer()))
{ {
final int relation = ((PlayerInstance) creature).getRelation(player); final long relation = ((PlayerInstance) creature).getRelation(player);
final boolean isAutoAttackable = creature.isAutoAttackable(player); final boolean isAutoAttackable = creature.isAutoAttackable(player);
final RelationCache oldrelation = creature.getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = creature.getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -1102,6 +1102,7 @@ public class PlayerInstance extends Playable
} }
case MUTUAL: case MUTUAL:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR; result |= RelationChanged.RELATION_MUTUAL_WAR;
break; break;
} }
@@ -44,8 +44,8 @@ public class RelationChanged implements IClientOutgoingPacket
public static final int RELATION_ENEMY = 0x8000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x8000; // true when red icon, doesn't matter with blue
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
public static final long RELATION_DECLARED_WAR = 0x40000000L; // double swords public static final long RELATION_DECLARED_WAR = 0x40000000L; // single sword
public static final long RELATION_MUTUAL_WAR = 0x4E200000L; // single sword public static final long RELATION_MUTUAL_WAR = 0x4E200000L; // double swords?
// Masks // Masks
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02; public static final byte SEND_ONE = 0x02;
@@ -86,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -1041,7 +1041,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1041,7 +1041,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1039,7 +1039,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1050,7 +1050,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1050,7 +1050,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1068,7 +1068,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -1038,7 +1038,10 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
@@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x80; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x00; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x400; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword public static final int RELATION_DECLARED_WAR = 0x4000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords public static final int RELATION_MUTUAL_WAR = 0x8000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
@@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeD(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
@@ -21,16 +21,16 @@ package org.l2jmobius.gameserver.cache;
*/ */
public final class RelationCache public final class RelationCache
{ {
private final int _relation; private final long _relation;
private final boolean _isAutoAttackable; private final boolean _isAutoAttackable;
public RelationCache(int relation, boolean isAutoAttackable) public RelationCache(long relation, boolean isAutoAttackable)
{ {
_relation = relation; _relation = relation;
_isAutoAttackable = isAutoAttackable; _isAutoAttackable = isAutoAttackable;
} }
public int getRelation() public long getRelation()
{ {
return _relation; return _relation;
} }
@@ -986,12 +986,12 @@ public class PlayerInstance extends Playable
return _chars; return _chars;
} }
public int getRelation(PlayerInstance target) public long getRelation(PlayerInstance target)
{ {
final Clan clan = getClan(); final Clan clan = getClan();
final Party party = getParty(); final Party party = getParty();
final Clan targetClan = target.getClan(); final Clan targetClan = target.getClan();
int result = 0; long result = 0;
if (clan != null) if (clan != null)
{ {
result |= RelationChanged.RELATION_CLAN_MEMBER; result |= RelationChanged.RELATION_CLAN_MEMBER;
@@ -1093,12 +1093,14 @@ public class PlayerInstance extends Playable
case DECLARATION: case DECLARATION:
case BLOOD_DECLARATION: case BLOOD_DECLARATION:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR; if (war.getAttackerClanId() == target.getClanId())
{
result |= RelationChanged.RELATION_DECLARED_WAR;
}
break; break;
} }
case MUTUAL: case MUTUAL:
{ {
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR; result |= RelationChanged.RELATION_MUTUAL_WAR;
break; break;
} }
@@ -1795,7 +1797,7 @@ public class PlayerInstance extends Playable
return; return;
} }
final int relation = getRelation(player); final long relation = getRelation(player);
final boolean isAutoAttackable = isAutoAttackable(player); final boolean isAutoAttackable = isAutoAttackable(player);
final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -4107,7 +4109,7 @@ public class PlayerInstance extends Playable
} }
// Update relation. // Update relation.
final int relation = getRelation(player); final long relation = getRelation(player);
final boolean isAutoAttackable = isAutoAttackable(player); final boolean isAutoAttackable = isAutoAttackable(player);
final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -6357,7 +6359,7 @@ public class PlayerInstance extends Playable
return; return;
} }
final int relation = getRelation(player); final long relation = getRelation(player);
final boolean isAutoAttackable = isAutoAttackable(player); final boolean isAutoAttackable = isAutoAttackable(player);
final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -12343,7 +12345,7 @@ public class PlayerInstance extends Playable
player.sendPacket(new CharInfo(this, isInvisible() && player.canOverrideCond(PlayerCondOverride.SEE_ALL_PLAYERS))); player.sendPacket(new CharInfo(this, isInvisible() && player.canOverrideCond(PlayerCondOverride.SEE_ALL_PLAYERS)));
} }
final int relation1 = getRelation(player); final long relation1 = getRelation(player);
final RelationChanged rc1 = new RelationChanged(); final RelationChanged rc1 = new RelationChanged();
rc1.addRelation(this, relation1, !isInsideZone(ZoneId.PEACE) || !isInsideZone(ZoneId.NO_PVP)); rc1.addRelation(this, relation1, !isInsideZone(ZoneId.PEACE) || !isInsideZone(ZoneId.NO_PVP));
if (hasSummon()) if (hasSummon())
@@ -12359,7 +12361,7 @@ public class PlayerInstance extends Playable
} }
player.sendPacket(rc1); player.sendPacket(rc1);
final int relation2 = player.getRelation(this); final long relation2 = player.getRelation(this);
final RelationChanged rc2 = new RelationChanged(); final RelationChanged rc2 = new RelationChanged();
rc2.addRelation(player, relation2, !player.isInsideZone(ZoneId.PEACE)); rc2.addRelation(player, relation2, !player.isInsideZone(ZoneId.PEACE));
if (player.hasSummon()) if (player.hasSummon())
@@ -594,7 +594,7 @@ public class Siege implements Siegable
return; return;
} }
final int relation = member.getRelation(player); final long relation = member.getRelation(player);
final boolean isAutoAttackable = member.isAutoAttackable(player); final boolean isAutoAttackable = member.isAutoAttackable(player);
final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -654,7 +654,7 @@ public class Siege implements Siegable
return; return;
} }
final int relation = member.getRelation(player); final long relation = member.getRelation(player);
final boolean isAutoAttackable = member.isAutoAttackable(player); final boolean isAutoAttackable = member.isAutoAttackable(player);
final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))
@@ -29,33 +29,32 @@ import org.l2jmobius.gameserver.network.OutgoingPackets;
public class RelationChanged implements IClientOutgoingPacket public class RelationChanged implements IClientOutgoingPacket
{ {
// TODO: Enum // TODO: Enum
public static final int RELATION_PARTY1 = 0x00001; // party member public static final int RELATION_PARTY1 = 0x1; // party member
public static final int RELATION_PARTY2 = 0x00002; // party member public static final int RELATION_PARTY2 = 0x2; // party member
public static final int RELATION_PARTY3 = 0x00004; // party member public static final int RELATION_PARTY3 = 0x4; // party member
public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation())
public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader
public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party public static final int RELATION_HAS_PARTY = 0x20; // true if is in party
public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan
public static final int RELATION_LEADER = 0x00080; // true if is clan leader public static final int RELATION_LEADER = 0x100; // true if is clan leader
public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan public static final int RELATION_CLAN_MATE = 0x200; // true if is in same clan
public static final int RELATION_INSIEGE = 0x00200; // true if in siege public static final int RELATION_INSIEGE = 0x400; // true if in siege
public static final int RELATION_ATTACKER = 0x00400; // true when attacker public static final int RELATION_ATTACKER = 0x800; // true when attacker
public static final int RELATION_ALLY = 0x00800; // blue siege icon, cannot have if red public static final int RELATION_ALLY = 0x4000; // blue siege icon, cannot have if red
public static final int RELATION_ENEMY = 0x01000; // true when red icon, doesn't matter with blue public static final int RELATION_ENEMY = 0x8000; // true when red icon, doesn't matter with blue
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
public static final long RELATION_DECLARED_WAR = 0x40000000L; // single sword
public static final long RELATION_MUTUAL_WAR = 0x4E200000L; // double swords?
// Masks // Masks
public static final byte SEND_ONE = 0x00;
public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_DEFAULT = 0x01;
public static final byte SEND_ONE = 0x02;
public static final byte SEND_MULTI = 0x04; public static final byte SEND_MULTI = 0x04;
protected static class Relation protected static class Relation
{ {
int _objId; int _objId;
int _relation; long _relation;
int _autoAttackable; int _autoAttackable;
int _reputation; int _reputation;
int _pvpFlag; int _pvpFlag;
@@ -65,7 +64,7 @@ public class RelationChanged implements IClientOutgoingPacket
private final List<Relation> _multi; private final List<Relation> _multi;
private byte _mask = 0x00; private byte _mask = 0x00;
public RelationChanged(Playable activeChar, int relation, boolean autoattackable) public RelationChanged(Playable activeChar, long relation, boolean autoattackable)
{ {
_mask |= SEND_ONE; _mask |= SEND_ONE;
_singled = new Relation(); _singled = new Relation();
@@ -83,13 +82,13 @@ public class RelationChanged implements IClientOutgoingPacket
_multi = new LinkedList<>(); _multi = new LinkedList<>();
} }
public void addRelation(Playable activeChar, int relation, boolean autoattackable) public void addRelation(Playable activeChar, long relation, boolean autoattackable)
{ {
if (activeChar.isInvisible()) if (activeChar.isInvisible())
{ {
// throw new IllegalArgumentException("Cannot add invisible character to multi relation packet");
return; return;
} }
final Relation r = new Relation(); final Relation r = new Relation();
r._objId = activeChar.getObjectId(); r._objId = activeChar.getObjectId();
r._relation = relation; r._relation = relation;
@@ -124,9 +123,9 @@ public class RelationChanged implements IClientOutgoingPacket
{ {
packet.writeD(relation._objId); packet.writeD(relation._objId);
if ((_mask & SEND_DEFAULT) == 0) if ((_mask & SEND_DEFAULT) != SEND_DEFAULT)
{ {
packet.writeD(relation._relation); packet.writeQ(relation._relation);
packet.writeC(relation._autoAttackable); packet.writeC(relation._autoAttackable);
packet.writeD(relation._reputation); packet.writeD(relation._reputation);
packet.writeC(relation._pvpFlag); packet.writeC(relation._pvpFlag);
@@ -82,7 +82,7 @@ public class Broadcast
player.sendPacket(mov); player.sendPacket(mov);
if ((mov instanceof CharInfo) && (creature.isPlayer())) if ((mov instanceof CharInfo) && (creature.isPlayer()))
{ {
final int relation = ((PlayerInstance) creature).getRelation(player); final long relation = ((PlayerInstance) creature).getRelation(player);
final boolean isAutoAttackable = creature.isAutoAttackable(player); final boolean isAutoAttackable = creature.isAutoAttackable(player);
final RelationCache oldrelation = creature.getKnownRelations().get(player.getObjectId()); final RelationCache oldrelation = creature.getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))