diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 431ed022ea..c05d0a9504 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1039,27 +1039,27 @@ public class PlayerInstance extends Playable 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()); - if (war != null) + switch (war.getState()) { - switch (war.getState()) + case DECLARATION: + case BLOOD_DECLARATION: { - case DECLARATION: - case BLOOD_DECLARATION: + if (war.getAttackerClanId() == target.getClanId()) { 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; } } } diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index ff243f441a..d342848355 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1045,27 +1045,27 @@ public class PlayerInstance extends Playable 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()); - if (war != null) + switch (war.getState()) { - switch (war.getState()) + case DECLARATION: + case BLOOD_DECLARATION: { - case DECLARATION: - case BLOOD_DECLARATION: + if (war.getAttackerClanId() == target.getClanId()) { 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; } } } diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 313668a825..74462929e7 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1047,27 +1047,27 @@ public class PlayerInstance extends Playable 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()); - if (war != null) + switch (war.getState()) { - switch (war.getState()) + case DECLARATION: + case BLOOD_DECLARATION: { - case DECLARATION: - case BLOOD_DECLARATION: + if (war.getAttackerClanId() == target.getClanId()) { 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; } } } diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 59ff4f1211..e4d101c805 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1057,27 +1057,27 @@ public class PlayerInstance extends Playable 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()); - if (war != null) + switch (war.getState()) { - switch (war.getState()) + case DECLARATION: + case BLOOD_DECLARATION: { - case DECLARATION: - case BLOOD_DECLARATION: + if (war.getAttackerClanId() == target.getClanId()) { 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; } } } diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index d64ad454ff..e0a5b42345 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1063,7 +1063,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 61c3b9f960..1ad4756fc0 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1063,7 +1063,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 9db5d77b93..0a8a0a9b07 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1063,7 +1063,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index d46faff0c2..c2c03d33f7 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1079,7 +1079,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/cache/RelationCache.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/cache/RelationCache.java index 91d5ea7d55..ab9195847b 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/cache/RelationCache.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/cache/RelationCache.java @@ -21,16 +21,16 @@ package org.l2jmobius.gameserver.cache; */ public final class RelationCache { - private final int _relation; + private final long _relation; private final boolean _isAutoAttackable; - public RelationCache(int relation, boolean isAutoAttackable) + public RelationCache(long relation, boolean isAutoAttackable) { _relation = relation; _isAutoAttackable = isAutoAttackable; } - public int getRelation() + public long getRelation() { return _relation; } diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index c971dc6923..39ef50ad64 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -971,12 +971,12 @@ public class PlayerInstance extends Playable return _chars; } - public int getRelation(PlayerInstance target) + public long getRelation(PlayerInstance target) { final Clan clan = getClan(); final Party party = getParty(); final Clan targetClan = target.getClan(); - int result = 0; + long result = 0; if (clan != null) { result |= RelationChanged.RELATION_CLAN_MEMBER; @@ -1078,12 +1078,14 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: { - result |= RelationChanged.RELATION_DECLARED_WAR; result |= RelationChanged.RELATION_MUTUAL_WAR; break; } @@ -1780,7 +1782,7 @@ public class PlayerInstance extends Playable return; } - final int relation = getRelation(player); + final long relation = getRelation(player); final boolean isAutoAttackable = isAutoAttackable(player); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) @@ -4073,7 +4075,7 @@ public class PlayerInstance extends Playable } // Update relation. - final int relation = getRelation(player); + final long relation = getRelation(player); final boolean isAutoAttackable = isAutoAttackable(player); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) @@ -6345,7 +6347,7 @@ public class PlayerInstance extends Playable return; } - final int relation = getRelation(player); + final long relation = getRelation(player); final boolean isAutoAttackable = isAutoAttackable(player); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); 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))); } - final int relation1 = getRelation(player); + final long relation1 = getRelation(player); final RelationChanged rc1 = new RelationChanged(); rc1.addRelation(this, relation1, !isInsideZone(ZoneId.PEACE) || !isInsideZone(ZoneId.NO_PVP)); if (hasSummon()) @@ -12388,7 +12390,7 @@ public class PlayerInstance extends Playable } player.sendPacket(rc1); - final int relation2 = player.getRelation(this); + final long relation2 = player.getRelation(this); final RelationChanged rc2 = new RelationChanged(); rc2.addRelation(player, relation2, !player.isInsideZone(ZoneId.PEACE)); if (player.hasSummon()) diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/siege/Siege.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/siege/Siege.java index a207a925f4..b5bbaf4a6b 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/siege/Siege.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/model/siege/Siege.java @@ -594,7 +594,7 @@ public class Siege implements Siegable return; } - final int relation = member.getRelation(player); + final long relation = member.getRelation(player); final boolean isAutoAttackable = member.isAutoAttackable(player); final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId()); if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) @@ -654,7 +654,7 @@ public class Siege implements Siegable return; } - final int relation = member.getRelation(player); + final long relation = member.getRelation(player); final boolean isAutoAttackable = member.isAutoAttackable(player); final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId()); if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..024a7bc691 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,33 +29,32 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x100; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x200; // true if is in same clan + public static final int RELATION_INSIEGE = 0x400; // true if in siege + public static final int RELATION_ATTACKER = 0x800; // true when attacker + public static final int RELATION_ALLY = 0x4000; // blue siege icon, cannot have if red + 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_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 - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation { int _objId; - int _relation; + long _relation; int _autoAttackable; int _reputation; int _pvpFlag; @@ -65,7 +64,7 @@ public class RelationChanged implements IClientOutgoingPacket private final List _multi; private byte _mask = 0x00; - public RelationChanged(Playable activeChar, int relation, boolean autoattackable) + public RelationChanged(Playable activeChar, long relation, boolean autoattackable) { _mask |= SEND_ONE; _singled = new Relation(); @@ -83,13 +82,13 @@ public class RelationChanged implements IClientOutgoingPacket _multi = new LinkedList<>(); } - public void addRelation(Playable activeChar, int relation, boolean autoattackable) + public void addRelation(Playable activeChar, long relation, boolean autoattackable) { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,9 +123,9 @@ public class RelationChanged implements IClientOutgoingPacket { 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.writeD(relation._reputation); packet.writeC(relation._pvpFlag); diff --git a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/util/Broadcast.java b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/util/Broadcast.java index e06c7046db..9bd624d486 100644 --- a/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/util/Broadcast.java +++ b/L2J_Mobius_8.0_Homunculus/java/org/l2jmobius/gameserver/util/Broadcast.java @@ -82,7 +82,7 @@ public class Broadcast player.sendPacket(mov); 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 RelationCache oldrelation = creature.getKnownRelations().get(player.getObjectId()); if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index e7842a9eb1..069c76d81d 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1102,6 +1102,7 @@ public class PlayerInstance extends Playable } case MUTUAL: { + result |= RelationChanged.RELATION_DECLARED_WAR; result |= RelationChanged.RELATION_MUTUAL_WAR; break; } diff --git a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index 709dee7ed0..024a7bc691 100644 --- a/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_9.0_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -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_ALLY_MEMBER = 0x10000; // clan is in alliance 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_MUTUAL_WAR = 0x4E200000L; // single sword + public static final long RELATION_DECLARED_WAR = 0x40000000L; // single sword + public static final long RELATION_MUTUAL_WAR = 0x4E200000L; // double swords? // Masks public static final byte SEND_DEFAULT = 0x01; public static final byte SEND_ONE = 0x02; @@ -86,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index c9ae6af5bd..776f925520 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1041,7 +1041,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index f51305471e..b1653c9a0a 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1041,7 +1041,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 1c7f7690ed..d8f9479fb1 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1039,7 +1039,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 696c114f3f..8feeb1994d 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1050,7 +1050,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index 33662f4bb2..32bc8a0ca9 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1050,7 +1050,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index c39136048d..d1ca8803d3 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1068,7 +1068,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index fcb6ce45c4..8b1b81f06c 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -1038,7 +1038,10 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..68bcff162a 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,27 +29,26 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x80; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x100; // true if is in same clan + public static final int RELATION_INSIEGE = 0x00; // true if in siege + public static final int RELATION_ATTACKER = 0x400; // true when attacker + public static final int RELATION_ALLY = 0x800; // blue siege icon, cannot have if red + public static final int RELATION_ENEMY = 0x1000; // true when red icon, doesn't matter with blue + public static final int RELATION_DECLARED_WAR = 0x4000; // single sword + 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_TERRITORY_WAR = 0x80000; // show Territory War icon - // Masks - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation @@ -87,9 +86,9 @@ public class RelationChanged implements IClientOutgoingPacket { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,7 +123,7 @@ public class RelationChanged implements IClientOutgoingPacket { packet.writeD(relation._objId); - if ((_mask & SEND_DEFAULT) == 0) + if ((_mask & SEND_DEFAULT) != SEND_DEFAULT) { packet.writeD(relation._relation); packet.writeC(relation._autoAttackable); diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/cache/RelationCache.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/cache/RelationCache.java index 91d5ea7d55..ab9195847b 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/cache/RelationCache.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/cache/RelationCache.java @@ -21,16 +21,16 @@ package org.l2jmobius.gameserver.cache; */ public final class RelationCache { - private final int _relation; + private final long _relation; private final boolean _isAutoAttackable; - public RelationCache(int relation, boolean isAutoAttackable) + public RelationCache(long relation, boolean isAutoAttackable) { _relation = relation; _isAutoAttackable = isAutoAttackable; } - public int getRelation() + public long getRelation() { return _relation; } diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java index b0cf9790b9..f99dcee1ee 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/actor/instance/PlayerInstance.java @@ -986,12 +986,12 @@ public class PlayerInstance extends Playable return _chars; } - public int getRelation(PlayerInstance target) + public long getRelation(PlayerInstance target) { final Clan clan = getClan(); final Party party = getParty(); final Clan targetClan = target.getClan(); - int result = 0; + long result = 0; if (clan != null) { result |= RelationChanged.RELATION_CLAN_MEMBER; @@ -1093,12 +1093,14 @@ public class PlayerInstance extends Playable case DECLARATION: case BLOOD_DECLARATION: { - result |= RelationChanged.RELATION_DECLARED_WAR; + if (war.getAttackerClanId() == target.getClanId()) + { + result |= RelationChanged.RELATION_DECLARED_WAR; + } break; } case MUTUAL: { - result |= RelationChanged.RELATION_DECLARED_WAR; result |= RelationChanged.RELATION_MUTUAL_WAR; break; } @@ -1795,7 +1797,7 @@ public class PlayerInstance extends Playable return; } - final int relation = getRelation(player); + final long relation = getRelation(player); final boolean isAutoAttackable = isAutoAttackable(player); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) @@ -4107,7 +4109,7 @@ public class PlayerInstance extends Playable } // Update relation. - final int relation = getRelation(player); + final long relation = getRelation(player); final boolean isAutoAttackable = isAutoAttackable(player); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) @@ -6357,7 +6359,7 @@ public class PlayerInstance extends Playable return; } - final int relation = getRelation(player); + final long relation = getRelation(player); final boolean isAutoAttackable = isAutoAttackable(player); final RelationCache oldrelation = getKnownRelations().get(player.getObjectId()); 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))); } - final int relation1 = getRelation(player); + final long relation1 = getRelation(player); final RelationChanged rc1 = new RelationChanged(); rc1.addRelation(this, relation1, !isInsideZone(ZoneId.PEACE) || !isInsideZone(ZoneId.NO_PVP)); if (hasSummon()) @@ -12359,7 +12361,7 @@ public class PlayerInstance extends Playable } player.sendPacket(rc1); - final int relation2 = player.getRelation(this); + final long relation2 = player.getRelation(this); final RelationChanged rc2 = new RelationChanged(); rc2.addRelation(player, relation2, !player.isInsideZone(ZoneId.PEACE)); if (player.hasSummon()) diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/siege/Siege.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/siege/Siege.java index a20374a251..1839b6539e 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/siege/Siege.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/siege/Siege.java @@ -594,7 +594,7 @@ public class Siege implements Siegable return; } - final int relation = member.getRelation(player); + final long relation = member.getRelation(player); final boolean isAutoAttackable = member.isAutoAttackable(player); final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId()); if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) @@ -654,7 +654,7 @@ public class Siege implements Siegable return; } - final int relation = member.getRelation(player); + final long relation = member.getRelation(player); final boolean isAutoAttackable = member.isAutoAttackable(player); final RelationCache oldrelation = member.getKnownRelations().get(player.getObjectId()); if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable)) diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java index af84573e63..024a7bc691 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/network/serverpackets/RelationChanged.java @@ -29,33 +29,32 @@ import org.l2jmobius.gameserver.network.OutgoingPackets; public class RelationChanged implements IClientOutgoingPacket { // TODO: Enum - public static final int RELATION_PARTY1 = 0x00001; // party member - public static final int RELATION_PARTY2 = 0x00002; // party member - public static final int RELATION_PARTY3 = 0x00004; // party member - public static final int RELATION_PARTY4 = 0x00008; // party member (for information, see PlayerInstance.getRelation()) - public static final int RELATION_PARTYLEADER = 0x00010; // true if is party leader - public static final int RELATION_HAS_PARTY = 0x00020; // true if is in party - public static final int RELATION_CLAN_MEMBER = 0x00040; // true if is in clan - public static final int RELATION_LEADER = 0x00080; // true if is clan leader - public static final int RELATION_CLAN_MATE = 0x00100; // true if is in same clan - public static final int RELATION_INSIEGE = 0x00200; // true if in siege - public static final int RELATION_ATTACKER = 0x00400; // true when attacker - public static final int RELATION_ALLY = 0x00800; // 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_DECLARED_WAR = 0x04000; // single sword - public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords + public static final int RELATION_PARTY1 = 0x1; // party member + public static final int RELATION_PARTY2 = 0x2; // party member + public static final int RELATION_PARTY3 = 0x4; // party member + public static final int RELATION_PARTY4 = 0x8; // party member (for information, see PlayerInstance.getRelation()) + public static final int RELATION_PARTYLEADER = 0x10; // true if is party leader + public static final int RELATION_HAS_PARTY = 0x20; // true if is in party + public static final int RELATION_CLAN_MEMBER = 0x40; // true if is in clan + public static final int RELATION_LEADER = 0x100; // true if is clan leader + public static final int RELATION_CLAN_MATE = 0x200; // true if is in same clan + public static final int RELATION_INSIEGE = 0x400; // true if in siege + public static final int RELATION_ATTACKER = 0x800; // true when attacker + public static final int RELATION_ALLY = 0x4000; // blue siege icon, cannot have if red + 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_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 - public static final byte SEND_ONE = 0x00; public static final byte SEND_DEFAULT = 0x01; + public static final byte SEND_ONE = 0x02; public static final byte SEND_MULTI = 0x04; protected static class Relation { int _objId; - int _relation; + long _relation; int _autoAttackable; int _reputation; int _pvpFlag; @@ -65,7 +64,7 @@ public class RelationChanged implements IClientOutgoingPacket private final List _multi; private byte _mask = 0x00; - public RelationChanged(Playable activeChar, int relation, boolean autoattackable) + public RelationChanged(Playable activeChar, long relation, boolean autoattackable) { _mask |= SEND_ONE; _singled = new Relation(); @@ -83,13 +82,13 @@ public class RelationChanged implements IClientOutgoingPacket _multi = new LinkedList<>(); } - public void addRelation(Playable activeChar, int relation, boolean autoattackable) + public void addRelation(Playable activeChar, long relation, boolean autoattackable) { if (activeChar.isInvisible()) { - // throw new IllegalArgumentException("Cannot add invisible character to multi relation packet"); return; } + final Relation r = new Relation(); r._objId = activeChar.getObjectId(); r._relation = relation; @@ -124,9 +123,9 @@ public class RelationChanged implements IClientOutgoingPacket { 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.writeD(relation._reputation); packet.writeC(relation._pvpFlag); diff --git a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/util/Broadcast.java b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/util/Broadcast.java index e06c7046db..9bd624d486 100644 --- a/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/util/Broadcast.java +++ b/L2J_Mobius_Essence_4.0_DwellingOfSpirits/java/org/l2jmobius/gameserver/util/Broadcast.java @@ -82,7 +82,7 @@ public class Broadcast player.sendPacket(mov); 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 RelationCache oldrelation = creature.getKnownRelations().get(player.getObjectId()); if ((oldrelation == null) || (oldrelation.getRelation() != relation) || (oldrelation.isAutoAttackable() != isAutoAttackable))