Fixed attacking single declared war players.

This commit is contained in:
MobiusDev
2018-09-06 20:29:01 +00:00
parent 2a9f97ae23
commit be61f093e9
21 changed files with 581 additions and 483 deletions
@@ -19,6 +19,8 @@ package com.l2jmobius.gameserver.model.actor;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -212,13 +214,17 @@ public abstract class L2Playable extends L2Character
{
return true;
}
else if (player.isInParty() && player.getParty().containsPlayer(target))
{
return false;
}
final L2Clan playerClan = player.getClan();
final L2Clan targetClan = target.getClan();
if ((playerClan != null) && (targetClan != null) && playerClan.isAtWarWith(targetClan) && targetClan.isAtWarWith(playerClan))
if ((playerClan != null) && !player.isAcademyMember() && !target.isAcademyMember())
{
return (player.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY);
final ClanWar war = playerClan.getWarWith(target.getClanId());
return (war != null) && (war.getState() == ClanWarState.MUTUAL);
}
return false;
}
@@ -119,6 +119,7 @@ import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.ClanPrivilege;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.L2AccessLevel;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -922,12 +923,16 @@ public final class L2PcInstance extends L2Playable
public int getRelation(L2PcInstance target)
{
final L2Clan clan = getClan();
final L2Party party = getParty();
final L2Clan targetClan = target.getClan();
int result = 0;
if (_clan != null)
if (clan != null)
{
result |= RelationChanged.RELATION_CLAN_MEMBER;
if (getClan() == target.getClan())
if (clan == target.getClan())
{
result |= RelationChanged.RELATION_CLAN_MATE;
}
@@ -940,12 +945,12 @@ public final class L2PcInstance extends L2Playable
{
result |= RelationChanged.RELATION_LEADER;
}
if ((getParty() != null) && (getParty() == target.getParty()))
if ((party != null) && (party == target.getParty()))
{
result |= RelationChanged.RELATION_HAS_PARTY;
for (int i = 0; i < _party.getMembers().size(); i++)
for (int i = 0; i < party.getMembers().size(); i++)
{
if (_party.getMembers().get(i) != this)
if (party.getMembers().get(i) != this)
{
continue;
}
@@ -1015,14 +1020,28 @@ public final class L2PcInstance extends L2Playable
result |= RelationChanged.RELATION_ATTACKER;
}
}
if ((getClan() != null) && (target.getClan() != null))
if ((clan != null) && (targetClan != null))
{
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && target.getClan().isAtWarWith(getClan().getId()))
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY))
{
result |= RelationChanged.RELATION_1SIDED_WAR;
if (getClan().isAtWarWith(target.getClan().getId()))
ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{
switch (war.getState())
{
case DECLARATION:
case BLOOD_DECLARATION:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
}
}
}
}
}
@@ -4130,6 +4149,29 @@ public final class L2PcInstance extends L2Playable
{
player.sendPacket(charInfo);
}
// Update relation.
final int relation = getRelation(player);
Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
final L2Summon pet = getPet();
if (pet != null)
{
rc.addRelation(pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -4148,11 +4190,13 @@ public final class L2PcInstance extends L2Playable
@Override
public final void broadcastPacket(IClientOutgoingPacket mov)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player))
@@ -4161,37 +4205,19 @@ public final class L2PcInstance extends L2Playable
}
player.sendPacket(mov);
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
});
}
@Override
public void broadcastPacket(IClientOutgoingPacket mov, int radiusInKnownlist)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player) || (calculateDistance3D(player) >= radiusInKnownlist))
@@ -4199,29 +4225,6 @@ public final class L2PcInstance extends L2Playable
return;
}
player.sendPacket(mov);
if (mov instanceof CharInfo)
{
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -8254,31 +8257,36 @@ public final class L2PcInstance extends L2Playable
// Get L2PcInstance
final L2PcInstance attackerPlayer = attacker.getActingPlayer();
if (_clan != null)
final L2Clan clan = getClan();
final L2Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Defender clan
if (siege.checkIsDefender(attackerPlayer.getClan()) && siege.checkIsDefender(getClan()))
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Attacker clan
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
return false;
}
}
// Check if clan is at war
if ((getClan() != null) && (attackerPlayer.getClan() != null) && getClan().isAtWarWith(attackerPlayer.getClanId()) && attackerPlayer.getClan().isAtWarWith(getClanId()) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && (war.getState() == ClanWarState.MUTUAL))
{
return true;
}
}
}
// Check if the L2PcInstance is in an arena, but NOT siege zone. NOTE: This check comes before clan/ally checks, but after party checks.
// This is done because in arenas, clan/ally members can autoattack if they arent in party.
@@ -8288,7 +8296,7 @@ public final class L2PcInstance extends L2Playable
}
// Check if the attacker is not in the same clan
if ((_clan != null) && _clan.isMember(attacker.getObjectId()))
if ((clan != null) && clan.isMember(attacker.getObjectId()))
{
return false;
}
@@ -42,8 +42,8 @@ public final class RelationChanged implements IClientOutgoingPacket
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_MUTUAL_WAR = 0x04000; // double fist
public static final int RELATION_1SIDED_WAR = 0x08000; // single fist
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
@@ -19,6 +19,8 @@ package com.l2jmobius.gameserver.model.actor;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -212,13 +214,17 @@ public abstract class L2Playable extends L2Character
{
return true;
}
else if (player.isInParty() && player.getParty().containsPlayer(target))
{
return false;
}
final L2Clan playerClan = player.getClan();
final L2Clan targetClan = target.getClan();
if ((playerClan != null) && (targetClan != null) && playerClan.isAtWarWith(targetClan) && targetClan.isAtWarWith(playerClan))
if ((playerClan != null) && !player.isAcademyMember() && !target.isAcademyMember())
{
return (player.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY);
final ClanWar war = playerClan.getWarWith(target.getClanId());
return (war != null) && (war.getState() == ClanWarState.MUTUAL);
}
return false;
}
@@ -120,6 +120,7 @@ import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.ClanPrivilege;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.L2AccessLevel;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -928,12 +929,16 @@ public final class L2PcInstance extends L2Playable
public int getRelation(L2PcInstance target)
{
final L2Clan clan = getClan();
final L2Party party = getParty();
final L2Clan targetClan = target.getClan();
int result = 0;
if (_clan != null)
if (clan != null)
{
result |= RelationChanged.RELATION_CLAN_MEMBER;
if (getClan() == target.getClan())
if (clan == target.getClan())
{
result |= RelationChanged.RELATION_CLAN_MATE;
}
@@ -946,12 +951,12 @@ public final class L2PcInstance extends L2Playable
{
result |= RelationChanged.RELATION_LEADER;
}
if ((getParty() != null) && (getParty() == target.getParty()))
if ((party != null) && (party == target.getParty()))
{
result |= RelationChanged.RELATION_HAS_PARTY;
for (int i = 0; i < _party.getMembers().size(); i++)
for (int i = 0; i < party.getMembers().size(); i++)
{
if (_party.getMembers().get(i) != this)
if (party.getMembers().get(i) != this)
{
continue;
}
@@ -1021,14 +1026,28 @@ public final class L2PcInstance extends L2Playable
result |= RelationChanged.RELATION_ATTACKER;
}
}
if ((getClan() != null) && (target.getClan() != null))
if ((clan != null) && (targetClan != null))
{
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && target.getClan().isAtWarWith(getClan().getId()))
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY))
{
result |= RelationChanged.RELATION_1SIDED_WAR;
if (getClan().isAtWarWith(target.getClan().getId()))
ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{
switch (war.getState())
{
case DECLARATION:
case BLOOD_DECLARATION:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
}
}
}
}
}
@@ -4136,6 +4155,29 @@ public final class L2PcInstance extends L2Playable
{
player.sendPacket(charInfo);
}
// Update relation.
final int relation = getRelation(player);
Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
final L2Summon pet = getPet();
if (pet != null)
{
rc.addRelation(pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -4154,11 +4196,13 @@ public final class L2PcInstance extends L2Playable
@Override
public final void broadcastPacket(IClientOutgoingPacket mov)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player))
@@ -4167,37 +4211,19 @@ public final class L2PcInstance extends L2Playable
}
player.sendPacket(mov);
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
});
}
@Override
public void broadcastPacket(IClientOutgoingPacket mov, int radiusInKnownlist)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player) || (calculateDistance3D(player) >= radiusInKnownlist))
@@ -4205,29 +4231,6 @@ public final class L2PcInstance extends L2Playable
return;
}
player.sendPacket(mov);
if (mov instanceof CharInfo)
{
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -8261,31 +8264,36 @@ public final class L2PcInstance extends L2Playable
// Get L2PcInstance
final L2PcInstance attackerPlayer = attacker.getActingPlayer();
if (_clan != null)
final L2Clan clan = getClan();
final L2Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Defender clan
if (siege.checkIsDefender(attackerPlayer.getClan()) && siege.checkIsDefender(getClan()))
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Attacker clan
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
return false;
}
}
// Check if clan is at war
if ((getClan() != null) && (attackerPlayer.getClan() != null) && getClan().isAtWarWith(attackerPlayer.getClanId()) && attackerPlayer.getClan().isAtWarWith(getClanId()) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && (war.getState() == ClanWarState.MUTUAL))
{
return true;
}
}
}
// Check if the L2PcInstance is in an arena, but NOT siege zone. NOTE: This check comes before clan/ally checks, but after party checks.
// This is done because in arenas, clan/ally members can autoattack if they arent in party.
@@ -8295,7 +8303,7 @@ public final class L2PcInstance extends L2Playable
}
// Check if the attacker is not in the same clan
if ((_clan != null) && _clan.isMember(attacker.getObjectId()))
if ((clan != null) && clan.isMember(attacker.getObjectId()))
{
return false;
}
@@ -42,8 +42,8 @@ public final class RelationChanged implements IClientOutgoingPacket
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_MUTUAL_WAR = 0x04000; // double fist
public static final int RELATION_1SIDED_WAR = 0x08000; // single fist
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
@@ -19,6 +19,8 @@ package com.l2jmobius.gameserver.model.actor;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -212,13 +214,17 @@ public abstract class L2Playable extends L2Character
{
return true;
}
else if (player.isInParty() && player.getParty().containsPlayer(target))
{
return false;
}
final L2Clan playerClan = player.getClan();
final L2Clan targetClan = target.getClan();
if ((playerClan != null) && (targetClan != null) && playerClan.isAtWarWith(targetClan) && targetClan.isAtWarWith(playerClan))
if ((playerClan != null) && !player.isAcademyMember() && !target.isAcademyMember())
{
return (player.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY);
final ClanWar war = playerClan.getWarWith(target.getClanId());
return (war != null) && (war.getState() == ClanWarState.MUTUAL);
}
return false;
}
@@ -121,6 +121,7 @@ import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.ClanPrivilege;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.L2AccessLevel;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -930,12 +931,16 @@ public final class L2PcInstance extends L2Playable
public int getRelation(L2PcInstance target)
{
final L2Clan clan = getClan();
final L2Party party = getParty();
final L2Clan targetClan = target.getClan();
int result = 0;
if (_clan != null)
if (clan != null)
{
result |= RelationChanged.RELATION_CLAN_MEMBER;
if (getClan() == target.getClan())
if (clan == target.getClan())
{
result |= RelationChanged.RELATION_CLAN_MATE;
}
@@ -948,12 +953,12 @@ public final class L2PcInstance extends L2Playable
{
result |= RelationChanged.RELATION_LEADER;
}
if ((getParty() != null) && (getParty() == target.getParty()))
if ((party != null) && (party == target.getParty()))
{
result |= RelationChanged.RELATION_HAS_PARTY;
for (int i = 0; i < _party.getMembers().size(); i++)
for (int i = 0; i < party.getMembers().size(); i++)
{
if (_party.getMembers().get(i) != this)
if (party.getMembers().get(i) != this)
{
continue;
}
@@ -1023,14 +1028,28 @@ public final class L2PcInstance extends L2Playable
result |= RelationChanged.RELATION_ATTACKER;
}
}
if ((getClan() != null) && (target.getClan() != null))
if ((clan != null) && (targetClan != null))
{
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && target.getClan().isAtWarWith(getClan().getId()))
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY))
{
result |= RelationChanged.RELATION_1SIDED_WAR;
if (getClan().isAtWarWith(target.getClan().getId()))
ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{
switch (war.getState())
{
case DECLARATION:
case BLOOD_DECLARATION:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
}
}
}
}
}
@@ -4138,6 +4157,29 @@ public final class L2PcInstance extends L2Playable
{
player.sendPacket(charInfo);
}
// Update relation.
final int relation = getRelation(player);
Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
final L2Summon pet = getPet();
if (pet != null)
{
rc.addRelation(pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -4156,11 +4198,13 @@ public final class L2PcInstance extends L2Playable
@Override
public final void broadcastPacket(IClientOutgoingPacket mov)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player))
@@ -4169,37 +4213,19 @@ public final class L2PcInstance extends L2Playable
}
player.sendPacket(mov);
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
});
}
@Override
public void broadcastPacket(IClientOutgoingPacket mov, int radiusInKnownlist)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player) || (calculateDistance3D(player) >= radiusInKnownlist))
@@ -4207,29 +4233,6 @@ public final class L2PcInstance extends L2Playable
return;
}
player.sendPacket(mov);
if (mov instanceof CharInfo)
{
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -8263,31 +8266,36 @@ public final class L2PcInstance extends L2Playable
// Get L2PcInstance
final L2PcInstance attackerPlayer = attacker.getActingPlayer();
if (_clan != null)
final L2Clan clan = getClan();
final L2Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Defender clan
if (siege.checkIsDefender(attackerPlayer.getClan()) && siege.checkIsDefender(getClan()))
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Attacker clan
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
return false;
}
}
// Check if clan is at war
if ((getClan() != null) && (attackerPlayer.getClan() != null) && getClan().isAtWarWith(attackerPlayer.getClanId()) && attackerPlayer.getClan().isAtWarWith(getClanId()) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && (war.getState() == ClanWarState.MUTUAL))
{
return true;
}
}
}
// Check if the L2PcInstance is in an arena, but NOT siege zone. NOTE: This check comes before clan/ally checks, but after party checks.
// This is done because in arenas, clan/ally members can autoattack if they arent in party.
@@ -8297,7 +8305,7 @@ public final class L2PcInstance extends L2Playable
}
// Check if the attacker is not in the same clan
if ((_clan != null) && _clan.isMember(attacker.getObjectId()))
if ((clan != null) && clan.isMember(attacker.getObjectId()))
{
return false;
}
@@ -42,8 +42,8 @@ public final class RelationChanged implements IClientOutgoingPacket
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_MUTUAL_WAR = 0x04000; // double fist
public static final int RELATION_1SIDED_WAR = 0x08000; // single fist
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
@@ -19,6 +19,8 @@ package com.l2jmobius.gameserver.model.actor;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -212,13 +214,17 @@ public abstract class L2Playable extends L2Character
{
return true;
}
else if (player.isInParty() && player.getParty().containsPlayer(target))
{
return false;
}
final L2Clan playerClan = player.getClan();
final L2Clan targetClan = target.getClan();
if ((playerClan != null) && (targetClan != null) && playerClan.isAtWarWith(targetClan) && targetClan.isAtWarWith(playerClan))
if ((playerClan != null) && !player.isAcademyMember() && !target.isAcademyMember())
{
return (player.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY);
final ClanWar war = playerClan.getWarWith(target.getClanId());
return (war != null) && (war.getState() == ClanWarState.MUTUAL);
}
return false;
}
@@ -124,6 +124,7 @@ import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.ClanPrivilege;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.L2AccessLevel;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -941,12 +942,16 @@ public final class L2PcInstance extends L2Playable
public int getRelation(L2PcInstance target)
{
final L2Clan clan = getClan();
final L2Party party = getParty();
final L2Clan targetClan = target.getClan();
int result = 0;
if (_clan != null)
if (clan != null)
{
result |= RelationChanged.RELATION_CLAN_MEMBER;
if (getClan() == target.getClan())
if (clan == target.getClan())
{
result |= RelationChanged.RELATION_CLAN_MATE;
}
@@ -959,12 +964,12 @@ public final class L2PcInstance extends L2Playable
{
result |= RelationChanged.RELATION_LEADER;
}
if ((getParty() != null) && (getParty() == target.getParty()))
if ((party != null) && (party == target.getParty()))
{
result |= RelationChanged.RELATION_HAS_PARTY;
for (int i = 0; i < _party.getMembers().size(); i++)
for (int i = 0; i < party.getMembers().size(); i++)
{
if (_party.getMembers().get(i) != this)
if (party.getMembers().get(i) != this)
{
continue;
}
@@ -1034,14 +1039,28 @@ public final class L2PcInstance extends L2Playable
result |= RelationChanged.RELATION_ATTACKER;
}
}
if ((getClan() != null) && (target.getClan() != null))
if ((clan != null) && (targetClan != null))
{
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && target.getClan().isAtWarWith(getClan().getId()))
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY))
{
result |= RelationChanged.RELATION_1SIDED_WAR;
if (getClan().isAtWarWith(target.getClan().getId()))
ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{
switch (war.getState())
{
case DECLARATION:
case BLOOD_DECLARATION:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
}
}
}
}
}
@@ -4129,6 +4148,29 @@ public final class L2PcInstance extends L2Playable
{
player.sendPacket(charInfo);
}
// Update relation.
final int relation = getRelation(player);
Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
final L2Summon pet = getPet();
if (pet != null)
{
rc.addRelation(pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -4147,11 +4189,13 @@ public final class L2PcInstance extends L2Playable
@Override
public final void broadcastPacket(IClientOutgoingPacket mov)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player))
@@ -4160,37 +4204,19 @@ public final class L2PcInstance extends L2Playable
}
player.sendPacket(mov);
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
});
}
@Override
public void broadcastPacket(IClientOutgoingPacket mov, int radiusInKnownlist)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player) || (calculateDistance3D(player) >= radiusInKnownlist))
@@ -4198,29 +4224,6 @@ public final class L2PcInstance extends L2Playable
return;
}
player.sendPacket(mov);
if (mov instanceof CharInfo)
{
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -8261,31 +8264,36 @@ public final class L2PcInstance extends L2Playable
// Get L2PcInstance
final L2PcInstance attackerPlayer = attacker.getActingPlayer();
if (_clan != null)
final L2Clan clan = getClan();
final L2Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Defender clan
if (siege.checkIsDefender(attackerPlayer.getClan()) && siege.checkIsDefender(getClan()))
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Attacker clan
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
return false;
}
}
// Check if clan is at war
if ((getClan() != null) && (attackerPlayer.getClan() != null) && getClan().isAtWarWith(attackerPlayer.getClanId()) && attackerPlayer.getClan().isAtWarWith(getClanId()) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && (war.getState() == ClanWarState.MUTUAL))
{
return true;
}
}
}
// Check if the L2PcInstance is in an arena, but NOT siege zone. NOTE: This check comes before clan/ally checks, but after party checks.
// This is done because in arenas, clan/ally members can autoattack if they arent in party.
@@ -8295,7 +8303,7 @@ public final class L2PcInstance extends L2Playable
}
// Check if the attacker is not in the same clan
if ((_clan != null) && _clan.isMember(attacker.getObjectId()))
if ((clan != null) && clan.isMember(attacker.getObjectId()))
{
return false;
}
@@ -42,8 +42,8 @@ public final class RelationChanged implements IClientOutgoingPacket
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_MUTUAL_WAR = 0x04000; // double fist
public static final int RELATION_1SIDED_WAR = 0x08000; // single fist
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
@@ -19,6 +19,8 @@ package com.l2jmobius.gameserver.model.actor;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -212,13 +214,17 @@ public abstract class L2Playable extends L2Character
{
return true;
}
else if (player.isInParty() && player.getParty().containsPlayer(target))
{
return false;
}
final L2Clan playerClan = player.getClan();
final L2Clan targetClan = target.getClan();
if ((playerClan != null) && (targetClan != null) && playerClan.isAtWarWith(targetClan) && targetClan.isAtWarWith(playerClan))
if ((playerClan != null) && !player.isAcademyMember() && !target.isAcademyMember())
{
return (player.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY);
final ClanWar war = playerClan.getWarWith(target.getClanId());
return (war != null) && (war.getState() == ClanWarState.MUTUAL);
}
return false;
}
@@ -120,6 +120,7 @@ import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.ClanPrivilege;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.L2AccessLevel;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -923,12 +924,16 @@ public final class L2PcInstance extends L2Playable
public int getRelation(L2PcInstance target)
{
final L2Clan clan = getClan();
final L2Party party = getParty();
final L2Clan targetClan = target.getClan();
int result = 0;
if (_clan != null)
if (clan != null)
{
result |= RelationChanged.RELATION_CLAN_MEMBER;
if (getClan() == target.getClan())
if (clan == target.getClan())
{
result |= RelationChanged.RELATION_CLAN_MATE;
}
@@ -941,12 +946,12 @@ public final class L2PcInstance extends L2Playable
{
result |= RelationChanged.RELATION_LEADER;
}
if ((getParty() != null) && (getParty() == target.getParty()))
if ((party != null) && (party == target.getParty()))
{
result |= RelationChanged.RELATION_HAS_PARTY;
for (int i = 0; i < _party.getMembers().size(); i++)
for (int i = 0; i < party.getMembers().size(); i++)
{
if (_party.getMembers().get(i) != this)
if (party.getMembers().get(i) != this)
{
continue;
}
@@ -1016,14 +1021,28 @@ public final class L2PcInstance extends L2Playable
result |= RelationChanged.RELATION_ATTACKER;
}
}
if ((getClan() != null) && (target.getClan() != null))
if ((clan != null) && (targetClan != null))
{
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && target.getClan().isAtWarWith(getClan().getId()))
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY))
{
result |= RelationChanged.RELATION_1SIDED_WAR;
if (getClan().isAtWarWith(target.getClan().getId()))
ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{
switch (war.getState())
{
case DECLARATION:
case BLOOD_DECLARATION:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
}
}
}
}
}
@@ -4105,6 +4124,29 @@ public final class L2PcInstance extends L2Playable
{
player.sendPacket(charInfo);
}
// Update relation.
final int relation = getRelation(player);
Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
final L2Summon pet = getPet();
if (pet != null)
{
rc.addRelation(pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -4123,11 +4165,13 @@ public final class L2PcInstance extends L2Playable
@Override
public final void broadcastPacket(IClientOutgoingPacket mov)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player))
@@ -4136,37 +4180,19 @@ public final class L2PcInstance extends L2Playable
}
player.sendPacket(mov);
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
});
}
@Override
public void broadcastPacket(IClientOutgoingPacket mov, int radiusInKnownlist)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player) || (calculateDistance3D(player) >= radiusInKnownlist))
@@ -4174,29 +4200,6 @@ public final class L2PcInstance extends L2Playable
return;
}
player.sendPacket(mov);
if (mov instanceof CharInfo)
{
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -8205,31 +8208,36 @@ public final class L2PcInstance extends L2Playable
// Get L2PcInstance
final L2PcInstance attackerPlayer = attacker.getActingPlayer();
if (_clan != null)
final L2Clan clan = getClan();
final L2Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Defender clan
if (siege.checkIsDefender(attackerPlayer.getClan()) && siege.checkIsDefender(getClan()))
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Attacker clan
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
return false;
}
}
// Check if clan is at war
if ((getClan() != null) && (attackerPlayer.getClan() != null) && getClan().isAtWarWith(attackerPlayer.getClanId()) && attackerPlayer.getClan().isAtWarWith(getClanId()) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && (war.getState() == ClanWarState.MUTUAL))
{
return true;
}
}
}
// Check if the L2PcInstance is in an arena, but NOT siege zone. NOTE: This check comes before clan/ally checks, but after party checks.
// This is done because in arenas, clan/ally members can autoattack if they arent in party.
@@ -8239,7 +8247,7 @@ public final class L2PcInstance extends L2Playable
}
// Check if the attacker is not in the same clan
if ((_clan != null) && _clan.isMember(attacker.getObjectId()))
if ((clan != null) && clan.isMember(attacker.getObjectId()))
{
return false;
}
@@ -42,8 +42,8 @@ public final class RelationChanged implements IClientOutgoingPacket
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_MUTUAL_WAR = 0x04000; // double fist
public static final int RELATION_1SIDED_WAR = 0x08000; // single fist
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
@@ -19,6 +19,8 @@ package com.l2jmobius.gameserver.model.actor;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -212,13 +214,17 @@ public abstract class L2Playable extends L2Character
{
return true;
}
else if (player.isInParty() && player.getParty().containsPlayer(target))
{
return false;
}
final L2Clan playerClan = player.getClan();
final L2Clan targetClan = target.getClan();
if ((playerClan != null) && (targetClan != null) && playerClan.isAtWarWith(targetClan) && targetClan.isAtWarWith(playerClan))
if ((playerClan != null) && !player.isAcademyMember() && !target.isAcademyMember())
{
return (player.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY);
final ClanWar war = playerClan.getWarWith(target.getClanId());
return (war != null) && (war.getState() == ClanWarState.MUTUAL);
}
return false;
}
@@ -120,6 +120,7 @@ import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.ClanPrivilege;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.L2AccessLevel;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -924,12 +925,16 @@ public final class L2PcInstance extends L2Playable
public int getRelation(L2PcInstance target)
{
final L2Clan clan = getClan();
final L2Party party = getParty();
final L2Clan targetClan = target.getClan();
int result = 0;
if (_clan != null)
if (clan != null)
{
result |= RelationChanged.RELATION_CLAN_MEMBER;
if (getClan() == target.getClan())
if (clan == target.getClan())
{
result |= RelationChanged.RELATION_CLAN_MATE;
}
@@ -942,12 +947,12 @@ public final class L2PcInstance extends L2Playable
{
result |= RelationChanged.RELATION_LEADER;
}
if ((getParty() != null) && (getParty() == target.getParty()))
if ((party != null) && (party == target.getParty()))
{
result |= RelationChanged.RELATION_HAS_PARTY;
for (int i = 0; i < _party.getMembers().size(); i++)
for (int i = 0; i < party.getMembers().size(); i++)
{
if (_party.getMembers().get(i) != this)
if (party.getMembers().get(i) != this)
{
continue;
}
@@ -1017,14 +1022,28 @@ public final class L2PcInstance extends L2Playable
result |= RelationChanged.RELATION_ATTACKER;
}
}
if ((getClan() != null) && (target.getClan() != null))
if ((clan != null) && (targetClan != null))
{
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && target.getClan().isAtWarWith(getClan().getId()))
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY))
{
result |= RelationChanged.RELATION_1SIDED_WAR;
if (getClan().isAtWarWith(target.getClan().getId()))
ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{
switch (war.getState())
{
case DECLARATION:
case BLOOD_DECLARATION:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
}
}
}
}
}
@@ -4106,6 +4125,29 @@ public final class L2PcInstance extends L2Playable
{
player.sendPacket(charInfo);
}
// Update relation.
final int relation = getRelation(player);
Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
final L2Summon pet = getPet();
if (pet != null)
{
rc.addRelation(pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -4124,11 +4166,13 @@ public final class L2PcInstance extends L2Playable
@Override
public final void broadcastPacket(IClientOutgoingPacket mov)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player))
@@ -4137,37 +4181,19 @@ public final class L2PcInstance extends L2Playable
}
player.sendPacket(mov);
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
});
}
@Override
public void broadcastPacket(IClientOutgoingPacket mov, int radiusInKnownlist)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player) || (calculateDistance3D(player) >= radiusInKnownlist))
@@ -4175,29 +4201,6 @@ public final class L2PcInstance extends L2Playable
return;
}
player.sendPacket(mov);
if (mov instanceof CharInfo)
{
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -8206,31 +8209,36 @@ public final class L2PcInstance extends L2Playable
// Get L2PcInstance
final L2PcInstance attackerPlayer = attacker.getActingPlayer();
if (_clan != null)
final L2Clan clan = getClan();
final L2Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Defender clan
if (siege.checkIsDefender(attackerPlayer.getClan()) && siege.checkIsDefender(getClan()))
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Attacker clan
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
return false;
}
}
// Check if clan is at war
if ((getClan() != null) && (attackerPlayer.getClan() != null) && getClan().isAtWarWith(attackerPlayer.getClanId()) && attackerPlayer.getClan().isAtWarWith(getClanId()) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && (war.getState() == ClanWarState.MUTUAL))
{
return true;
}
}
}
// Check if the L2PcInstance is in an arena, but NOT siege zone. NOTE: This check comes before clan/ally checks, but after party checks.
// This is done because in arenas, clan/ally members can autoattack if they arent in party.
@@ -8240,7 +8248,7 @@ public final class L2PcInstance extends L2Playable
}
// Check if the attacker is not in the same clan
if ((_clan != null) && _clan.isMember(attacker.getObjectId()))
if ((clan != null) && clan.isMember(attacker.getObjectId()))
{
return false;
}
@@ -42,8 +42,8 @@ public final class RelationChanged implements IClientOutgoingPacket
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_MUTUAL_WAR = 0x04000; // double fist
public static final int RELATION_1SIDED_WAR = 0x08000; // single fist
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon
@@ -19,6 +19,8 @@ package com.l2jmobius.gameserver.model.actor;
import com.l2jmobius.gameserver.ai.CtrlEvent;
import com.l2jmobius.gameserver.enums.InstanceType;
import com.l2jmobius.gameserver.instancemanager.ZoneManager;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.L2Clan;
import com.l2jmobius.gameserver.model.L2Object;
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
@@ -212,13 +214,17 @@ public abstract class L2Playable extends L2Character
{
return true;
}
else if (player.isInParty() && player.getParty().containsPlayer(target))
{
return false;
}
final L2Clan playerClan = player.getClan();
final L2Clan targetClan = target.getClan();
if ((playerClan != null) && (targetClan != null) && playerClan.isAtWarWith(targetClan) && targetClan.isAtWarWith(playerClan))
if ((playerClan != null) && !player.isAcademyMember() && !target.isAcademyMember())
{
return (player.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY);
final ClanWar war = playerClan.getWarWith(target.getClanId());
return (war != null) && (war.getState() == ClanWarState.MUTUAL);
}
return false;
}
@@ -120,6 +120,7 @@ import com.l2jmobius.gameserver.model.ArenaParticipantsHolder;
import com.l2jmobius.gameserver.model.BlockList;
import com.l2jmobius.gameserver.model.ClanPrivilege;
import com.l2jmobius.gameserver.model.ClanWar;
import com.l2jmobius.gameserver.model.ClanWar.ClanWarState;
import com.l2jmobius.gameserver.model.Fishing;
import com.l2jmobius.gameserver.model.L2AccessLevel;
import com.l2jmobius.gameserver.model.L2Clan;
@@ -924,12 +925,16 @@ public final class L2PcInstance extends L2Playable
public int getRelation(L2PcInstance target)
{
final L2Clan clan = getClan();
final L2Party party = getParty();
final L2Clan targetClan = target.getClan();
int result = 0;
if (_clan != null)
if (clan != null)
{
result |= RelationChanged.RELATION_CLAN_MEMBER;
if (getClan() == target.getClan())
if (clan == target.getClan())
{
result |= RelationChanged.RELATION_CLAN_MATE;
}
@@ -942,12 +947,12 @@ public final class L2PcInstance extends L2Playable
{
result |= RelationChanged.RELATION_LEADER;
}
if ((getParty() != null) && (getParty() == target.getParty()))
if ((party != null) && (party == target.getParty()))
{
result |= RelationChanged.RELATION_HAS_PARTY;
for (int i = 0; i < _party.getMembers().size(); i++)
for (int i = 0; i < party.getMembers().size(); i++)
{
if (_party.getMembers().get(i) != this)
if (party.getMembers().get(i) != this)
{
continue;
}
@@ -1017,14 +1022,28 @@ public final class L2PcInstance extends L2Playable
result |= RelationChanged.RELATION_ATTACKER;
}
}
if ((getClan() != null) && (target.getClan() != null))
if ((clan != null) && (targetClan != null))
{
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && target.getClan().isAtWarWith(getClan().getId()))
if ((target.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY))
{
result |= RelationChanged.RELATION_1SIDED_WAR;
if (getClan().isAtWarWith(target.getClan().getId()))
ClanWar war = clan.getWarWith(target.getClan().getId());
if (war != null)
{
switch (war.getState())
{
case DECLARATION:
case BLOOD_DECLARATION:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
break;
}
case MUTUAL:
{
result |= RelationChanged.RELATION_DECLARED_WAR;
result |= RelationChanged.RELATION_MUTUAL_WAR;
break;
}
}
}
}
}
@@ -4106,6 +4125,29 @@ public final class L2PcInstance extends L2Playable
{
player.sendPacket(charInfo);
}
// Update relation.
final int relation = getRelation(player);
Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
final L2Summon pet = getPet();
if (pet != null)
{
rc.addRelation(pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -4124,11 +4166,13 @@ public final class L2PcInstance extends L2Playable
@Override
public final void broadcastPacket(IClientOutgoingPacket mov)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player))
@@ -4137,37 +4181,19 @@ public final class L2PcInstance extends L2Playable
}
player.sendPacket(mov);
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
});
}
@Override
public void broadcastPacket(IClientOutgoingPacket mov, int radiusInKnownlist)
{
if (!(mov instanceof CharInfo))
if (mov instanceof CharInfo)
{
sendPacket(mov);
new IllegalArgumentException("CharInfo is being send via broadcastPacket. Do NOT do that! Use broadcastCharInfo() instead.");
}
sendPacket(mov);
L2World.getInstance().forEachVisibleObject(this, L2PcInstance.class, player ->
{
if (!isVisibleFor(player) || (calculateDistance3D(player) >= radiusInKnownlist))
@@ -4175,29 +4201,6 @@ public final class L2PcInstance extends L2Playable
return;
}
player.sendPacket(mov);
if (mov instanceof CharInfo)
{
final int relation = getRelation(player);
final Integer oldrelation = getKnownRelations().get(player.getObjectId());
if ((oldrelation == null) || (oldrelation != relation))
{
final RelationChanged rc = new RelationChanged();
rc.addRelation(this, relation, isAutoAttackable(player));
if (hasSummon())
{
if (_pet != null)
{
rc.addRelation(_pet, relation, isAutoAttackable(player));
}
if (hasServitors())
{
getServitors().values().forEach(s -> rc.addRelation(s, relation, isAutoAttackable(player)));
}
}
player.sendPacket(rc);
getKnownRelations().put(player.getObjectId(), relation);
}
}
});
}
@@ -8208,31 +8211,36 @@ public final class L2PcInstance extends L2Playable
// Get L2PcInstance
final L2PcInstance attackerPlayer = attacker.getActingPlayer();
if (_clan != null)
final L2Clan clan = getClan();
final L2Clan attackerClan = attackerPlayer.getClan();
if (clan != null)
{
final Siege siege = SiegeManager.getInstance().getSiege(getX(), getY(), getZ());
if (siege != null)
{
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Defender clan
if (siege.checkIsDefender(attackerPlayer.getClan()) && siege.checkIsDefender(getClan()))
if (siege.checkIsDefender(attackerClan) && siege.checkIsDefender(clan))
{
return false;
}
// Check if a siege is in progress and if attacker and the L2PcInstance aren't in the Attacker clan
if (siege.checkIsAttacker(attackerPlayer.getClan()) && siege.checkIsAttacker(getClan()))
if (siege.checkIsAttacker(attackerClan) && siege.checkIsAttacker(clan))
{
return false;
}
}
// Check if clan is at war
if ((getClan() != null) && (attackerPlayer.getClan() != null) && getClan().isAtWarWith(attackerPlayer.getClanId()) && attackerPlayer.getClan().isAtWarWith(getClanId()) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
if ((attackerClan != null) && (getWantsPeace() == 0) && (attackerPlayer.getWantsPeace() == 0) && !isAcademyMember())
{
final ClanWar war = attackerClan.getWarWith(getClanId());
if ((war != null) && (war.getState() == ClanWarState.MUTUAL))
{
return true;
}
}
}
// Check if the L2PcInstance is in an arena, but NOT siege zone. NOTE: This check comes before clan/ally checks, but after party checks.
// This is done because in arenas, clan/ally members can autoattack if they arent in party.
@@ -8242,7 +8250,7 @@ public final class L2PcInstance extends L2Playable
}
// Check if the attacker is not in the same clan
if ((_clan != null) && _clan.isMember(attacker.getObjectId()))
if ((clan != null) && clan.isMember(attacker.getObjectId()))
{
return false;
}
@@ -42,8 +42,8 @@ public final class RelationChanged implements IClientOutgoingPacket
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_MUTUAL_WAR = 0x04000; // double fist
public static final int RELATION_1SIDED_WAR = 0x08000; // single fist
public static final int RELATION_DECLARED_WAR = 0x04000; // single sword
public static final int RELATION_MUTUAL_WAR = 0x08000; // double swords
public static final int RELATION_ALLY_MEMBER = 0x10000; // clan is in alliance
public static final int RELATION_TERRITORY_WAR = 0x80000; // show Territory War icon