Faction system.
This commit is contained in:
@@ -2258,6 +2258,11 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
activeChar.sendPacket(SystemMessageId.YOU_HAVE_INVITED_THE_WRONG_TARGET);
|
||||
return false;
|
||||
}
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((activeChar.isGood() && target.isEvil()) || (activeChar.isEvil() && target.isGood())))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_HAVE_INVITED_THE_WRONG_TARGET);
|
||||
return false;
|
||||
}
|
||||
if (activeChar.getObjectId() == target.getObjectId())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
|
||||
@@ -2337,6 +2342,11 @@ public class L2Clan implements IIdentifiable, INamable
|
||||
activeChar.sendPacket(SystemMessageId.YOU_HAVE_INVITED_THE_WRONG_TARGET);
|
||||
return false;
|
||||
}
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((activeChar.isGood() && target.isEvil()) || (activeChar.isEvil() && target.isGood())))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_HAVE_INVITED_THE_WRONG_TARGET);
|
||||
return false;
|
||||
}
|
||||
if (activeChar.getObjectId() == target.getObjectId())
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_CANNOT_ASK_YOURSELF_TO_APPLY_TO_A_CLAN);
|
||||
|
@@ -72,6 +72,10 @@ public final class L2World
|
||||
|
||||
/** Map containing all the players in game. */
|
||||
private final Map<Integer, L2PcInstance> _allPlayers = new ConcurrentHashMap<>();
|
||||
/** Map containing all the Good players in game. */
|
||||
private final static Map<Integer, L2PcInstance> _allGoodPlayers = new ConcurrentHashMap<>();
|
||||
/** Map containing all the Evil players in game. */
|
||||
private final static Map<Integer, L2PcInstance> _allEvilPlayers = new ConcurrentHashMap<>();
|
||||
/** Map containing all visible objects. */
|
||||
private final Map<Integer, L2Object> _allObjects = new ConcurrentHashMap<>();
|
||||
/** Map used for debug. */
|
||||
@@ -165,6 +169,16 @@ public final class L2World
|
||||
return _allPlayers.values();
|
||||
}
|
||||
|
||||
public Collection<L2PcInstance> getAllGoodPlayers()
|
||||
{
|
||||
return _allGoodPlayers.values();
|
||||
}
|
||||
|
||||
public Collection<L2PcInstance> getAllEvilPlayers()
|
||||
{
|
||||
return _allEvilPlayers.values();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all players sorted by the given comparator.
|
||||
* @param comparator the comparator
|
||||
@@ -186,6 +200,16 @@ public final class L2World
|
||||
return _allPlayers.size();
|
||||
}
|
||||
|
||||
public int getAllgoodPlayersCount()
|
||||
{
|
||||
return _allGoodPlayers.size();
|
||||
}
|
||||
|
||||
public int getAllevilPlayersCount()
|
||||
{
|
||||
return _allEvilPlayers.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* <B>If you have access to player objectId use {@link #getPlayer(int playerObjId)}</B>
|
||||
* @param name Name of the player to get Instance
|
||||
@@ -315,6 +339,23 @@ public final class L2World
|
||||
public void addPlayerToWorld(L2PcInstance player)
|
||||
{
|
||||
_allPlayers.put(player.getObjectId(), player);
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
addFactionPlayerToWorld(player);
|
||||
}
|
||||
}
|
||||
|
||||
public static void addFactionPlayerToWorld(L2PcInstance player)
|
||||
{
|
||||
if (player.isGood())
|
||||
{
|
||||
_allGoodPlayers.put(player.getObjectId(), player);
|
||||
}
|
||||
else if (player.isEvil())
|
||||
{
|
||||
_allEvilPlayers.put(player.getObjectId(), player);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -324,6 +365,18 @@ public final class L2World
|
||||
public void removeFromAllPlayers(L2PcInstance player)
|
||||
{
|
||||
_allPlayers.remove(player.getObjectId());
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
if (player.isGood())
|
||||
{
|
||||
_allGoodPlayers.remove(player.getObjectId());
|
||||
}
|
||||
else if (player.isEvil())
|
||||
{
|
||||
_allEvilPlayers.remove(player.getObjectId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -980,14 +980,17 @@ public abstract class L2Summon extends L2Playable
|
||||
*/
|
||||
public void doAttack()
|
||||
{
|
||||
if (getOwner() != null)
|
||||
final L2PcInstance owner = getOwner();
|
||||
final L2Object target = getOwner().getTarget();
|
||||
|
||||
if ((owner != null) && (target != null))
|
||||
{
|
||||
final L2Object target = getOwner().getTarget();
|
||||
if (target != null)
|
||||
if (Config.FACTION_SYSTEM_ENABLED && target.isPlayer() && ((owner.isGood() && target.getActingPlayer().isGood()) || (owner.isEvil() && target.getActingPlayer().isEvil())))
|
||||
{
|
||||
setTarget(target);
|
||||
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
return;
|
||||
}
|
||||
setTarget(target);
|
||||
getAI().setIntention(CtrlIntention.AI_INTENTION_ATTACK, target);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -360,7 +360,7 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
// Character Character SQL String Definitions:
|
||||
private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,charId,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,fame,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,title_color,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,newbie,nobless,power_grade,createDate) values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
|
||||
private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=? WHERE charId=?";
|
||||
private static final String UPDATE_CHARACTER = "UPDATE characters SET level=?,maxHp=?,curHp=?,maxCp=?,curCp=?,maxMp=?,curMp=?,face=?,hairStyle=?,hairColor=?,sex=?,heading=?,x=?,y=?,z=?,exp=?,expBeforeDeath=?,sp=?,karma=?,fame=?,pvpkills=?,pkkills=?,clanid=?,race=?,classid=?,deletetime=?,title=?,title_color=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,newbie=?,nobless=?,power_grade=?,subpledge=?,lvl_joined_academy=?,apprentice=?,sponsor=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?,bookmarkslot=?,vitality_points=?,language=?,faction=? WHERE charId=?";
|
||||
private static final String RESTORE_CHARACTER = "SELECT * FROM characters WHERE charId=?";
|
||||
|
||||
// Character Teleport Bookmark:
|
||||
@@ -421,6 +421,11 @@ public final class L2PcInstance extends L2Playable
|
||||
@Override
|
||||
public void doAttack(L2Character target)
|
||||
{
|
||||
if (Config.FACTION_SYSTEM_ENABLED && target.isPlayer() && ((isGood() && target.getActingPlayer().isGood()) || (isEvil() && target.getActingPlayer().isEvil())))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
super.doAttack(target);
|
||||
|
||||
// cancel the recent fake-death protection instantly if the player attacks or casts spells
|
||||
@@ -595,6 +600,10 @@ public final class L2PcInstance extends L2Playable
|
||||
private boolean _noble = false;
|
||||
private boolean _hero = false;
|
||||
|
||||
/** Faction System */
|
||||
private boolean _isGood = false;
|
||||
private boolean _isEvil = false;
|
||||
|
||||
/** The L2FolkInstance corresponding to the last Folk which one the player talked. */
|
||||
private L2Npc _lastFolkNpc = null;
|
||||
|
||||
@@ -5534,6 +5543,17 @@ public final class L2PcInstance extends L2Playable
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((isGood() && targetPlayer.isEvil()) || (isEvil() && targetPlayer.isGood())))
|
||||
{
|
||||
increasePvpKills(target);
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((isGood() && targetPlayer.isGood()) || (isEvil() && targetPlayer.isEvil())))
|
||||
{
|
||||
increasePkKillsAndKarma(target);
|
||||
}
|
||||
|
||||
// Target player doesn't have pvp flag set
|
||||
// check about wars
|
||||
if ((targetPlayer.getClan() != null) && (getClan() != null) && getClan().isAtWarWith(targetPlayer.getClanId()) && targetPlayer.getClan().isAtWarWith(getClanId()) && (targetPlayer.getPledgeType() != L2Clan.SUBUNIT_ACADEMY) && (getPledgeType() != L2Clan.SUBUNIT_ACADEMY))
|
||||
@@ -5593,8 +5613,11 @@ public final class L2PcInstance extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
// Calculate new karma. (calculate karma before incrase pk count!)
|
||||
setKarma(getKarma() + Formulas.calculateKarmaGain(getPkKills(), target.isSummon()));
|
||||
if (!Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
// Calculate new karma. (calculate karma before incrase pk count!)
|
||||
setKarma(getKarma() + Formulas.calculateKarmaGain(getPkKills(), target.isSummon()));
|
||||
}
|
||||
|
||||
// PK Points are increased only if you kill a player.
|
||||
if (target.isPlayer())
|
||||
@@ -5632,6 +5655,11 @@ public final class L2PcInstance extends L2Playable
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED && target.isPlayer() && ((isGood() && player_target.isEvil()) || (isEvil() && player_target.isGood())))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((isInDuel() && (player_target.getDuelId() == getDuelId())))
|
||||
{
|
||||
return;
|
||||
@@ -6908,6 +6936,19 @@ public final class L2PcInstance extends L2Playable
|
||||
player.setNewbie(rset.getInt("newbie"));
|
||||
player.setNoble(rset.getInt("nobless") == 1);
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
final int factionId = rset.getInt("faction");
|
||||
if (factionId == 1)
|
||||
{
|
||||
player.setGood();
|
||||
}
|
||||
if (factionId == 2)
|
||||
{
|
||||
player.setEvil();
|
||||
}
|
||||
}
|
||||
|
||||
player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time"));
|
||||
if (player.getClanJoinExpiryTime() < System.currentTimeMillis())
|
||||
{
|
||||
@@ -7477,7 +7518,19 @@ public final class L2PcInstance extends L2Playable
|
||||
statement.setInt(47, getBookMarkSlot());
|
||||
statement.setInt(48, 0); // unset
|
||||
statement.setString(49, getLang());
|
||||
statement.setInt(50, getObjectId());
|
||||
|
||||
int factionId = 0;
|
||||
if (isGood())
|
||||
{
|
||||
factionId = 1;
|
||||
}
|
||||
if (isEvil())
|
||||
{
|
||||
factionId = 2;
|
||||
}
|
||||
statement.setInt(50, factionId);
|
||||
|
||||
statement.setInt(51, getObjectId());
|
||||
|
||||
statement.execute();
|
||||
}
|
||||
@@ -8434,6 +8487,11 @@ public final class L2PcInstance extends L2Playable
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((isGood() && attackerPlayer.isEvil()) || (isEvil() && attackerPlayer.isGood())))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (attacker instanceof L2DefenderInstance)
|
||||
{
|
||||
@@ -8657,6 +8715,18 @@ public final class L2PcInstance extends L2Playable
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((Config.FACTION_SYSTEM_ENABLED && target.isPlayer() && skill.isBad()) && ((isGood() && target.getActingPlayer().isGood()) || (isEvil() && target.getActingPlayer().isEvil())))
|
||||
{
|
||||
sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
}
|
||||
|
||||
if ((Config.FACTION_SYSTEM_ENABLED && target.isPlayer() && !skill.isBad()) && ((isGood() && target.getActingPlayer().isEvil()) || (isEvil() && target.getActingPlayer().isGood())))
|
||||
{
|
||||
sendPacket(ActionFailed.STATIC_PACKET);
|
||||
return false;
|
||||
}
|
||||
|
||||
// skills can be used on Walls and Doors only during siege
|
||||
if (target.isDoor())
|
||||
{
|
||||
@@ -14347,6 +14417,26 @@ public final class L2PcInstance extends L2Playable
|
||||
_jumpTrackId = jumpTrackId;
|
||||
}
|
||||
|
||||
public boolean isGood()
|
||||
{
|
||||
return _isGood;
|
||||
}
|
||||
|
||||
public boolean isEvil()
|
||||
{
|
||||
return _isEvil;
|
||||
}
|
||||
|
||||
public void setGood()
|
||||
{
|
||||
_isGood = true;
|
||||
}
|
||||
|
||||
public void setEvil()
|
||||
{
|
||||
_isEvil = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param target the target
|
||||
* @return {@code true} if this player got war with the target, {@code false} otherwise.
|
||||
|
@@ -1219,6 +1219,11 @@ public final class Skill implements IIdentifiable
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED && target.isPlayer() && ((player.isGood() && targetPlayer.isGood()) || (player.isEvil() && targetPlayer.isEvil())))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.PartyMatchRoom;
|
||||
import com.l2jserver.gameserver.model.PartyMatchRoomList;
|
||||
@@ -69,6 +70,13 @@ public final class AnswerJoinPartyRoom extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((player.isEvil() && partner.isGood()) || (player.isGood() && partner.isEvil())))
|
||||
{
|
||||
player.sendMessage("You cannot party with different team members.");
|
||||
player.setActiveRequester(null);
|
||||
return;
|
||||
}
|
||||
|
||||
// If answer is positive, join the requester's PartyRoom.
|
||||
if ((_answer == 1) && !partner.isRequestExpired())
|
||||
{
|
||||
|
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
@@ -75,6 +76,14 @@ public final class AnswerTradeRequest extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((player.isEvil() && partner.isGood()) || (player.isGood() && partner.isEvil())))
|
||||
{
|
||||
player.sendPacket(new TradeDone(0));
|
||||
player.sendMessage("You cannot trade with different team members.");
|
||||
player.setActiveRequester(null);
|
||||
return;
|
||||
}
|
||||
|
||||
if ((_response == 1) && !partner.isRequestExpired())
|
||||
{
|
||||
player.startTrade(partner);
|
||||
|
@@ -295,6 +295,10 @@ public final class CharacterCreate extends L2GameClientPacket
|
||||
Location createLoc = new Location(Config.CUSTOM_STARTING_LOC_X, Config.CUSTOM_STARTING_LOC_Y, Config.CUSTOM_STARTING_LOC_Z);
|
||||
newChar.setXYZInvisible(createLoc.getX(), createLoc.getY(), createLoc.getZ());
|
||||
}
|
||||
else if (Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
newChar.setXYZInvisible(Config.FACTION_STARTING_LOCATION.getX(), Config.FACTION_STARTING_LOCATION.getY(), Config.FACTION_STARTING_LOCATION.getZ());
|
||||
}
|
||||
else
|
||||
{
|
||||
Location createLoc = template.getCreationPoint();
|
||||
|
@@ -388,6 +388,25 @@ public class EnterWorld extends L2GameClientPacket
|
||||
activeChar.sendPacket(new ExUnReadMailCount(activeChar));
|
||||
}
|
||||
|
||||
// Faction System
|
||||
if (Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
if (activeChar.isGood())
|
||||
{
|
||||
activeChar.getAppearance().setNameColor(Config.FACTION_GOOD_NAME_COLOR);
|
||||
activeChar.getAppearance().setTitleColor(Config.FACTION_GOOD_NAME_COLOR);
|
||||
activeChar.sendMessage("Welcome " + activeChar.getName() + ", you are fighting for the " + Config.FACTION_GOOD_TEAM_NAME + " faction.");
|
||||
activeChar.sendPacket(new ExShowScreenMessage("Welcome " + activeChar.getName() + ", you are fighting for the " + Config.FACTION_GOOD_TEAM_NAME + " faction.", 10000));
|
||||
}
|
||||
else if (activeChar.isEvil())
|
||||
{
|
||||
activeChar.getAppearance().setNameColor(Config.FACTION_EVIL_NAME_COLOR);
|
||||
activeChar.getAppearance().setTitleColor(Config.FACTION_EVIL_NAME_COLOR);
|
||||
activeChar.sendMessage("Welcome " + activeChar.getName() + ", you are fighting for the " + Config.FACTION_EVIL_TEAM_NAME + " faction.");
|
||||
activeChar.sendPacket(new ExShowScreenMessage("Welcome " + activeChar.getName() + ", you are fighting for the " + Config.FACTION_EVIL_TEAM_NAME + " faction.", 10000));
|
||||
}
|
||||
}
|
||||
|
||||
Quest.playerEnter(activeChar);
|
||||
|
||||
// Send Quest List
|
||||
|
@@ -82,6 +82,11 @@ public final class RequestDuelStart extends L2GameClientPacket
|
||||
activeChar.sendPacket(msg);
|
||||
return;
|
||||
}
|
||||
else if (Config.FACTION_SYSTEM_ENABLED && ((activeChar.isEvil() && targetChar.isGood()) || (activeChar.isGood() && targetChar.isEvil())))
|
||||
{
|
||||
activeChar.sendPacket(SystemMessageId.YOU_ARE_UNABLE_TO_REQUEST_A_DUEL_AT_THIS_TIME);
|
||||
return;
|
||||
}
|
||||
|
||||
// Duel is a party duel
|
||||
if (_partyDuel == 1)
|
||||
|
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.clientpackets;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.model.BlockList;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
@@ -97,6 +98,11 @@ public final class RequestFriendInvite extends L2GameClientPacket
|
||||
activeChar.sendPacket(sm);
|
||||
return;
|
||||
}
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((friend.isEvil() && activeChar.isGood()) || (friend.isGood() && activeChar.isEvil())))
|
||||
{
|
||||
activeChar.sendMessage("You cannot have a friend of the opposing faction.");
|
||||
return;
|
||||
}
|
||||
// Friend request sent.
|
||||
activeChar.onTransactionRequest(friend);
|
||||
friend.sendPacket(new FriendAddRequest(activeChar.getName()));
|
||||
|
@@ -120,6 +120,15 @@ public final class RequestPrivateStoreBuy extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
if ((storePlayer.isEvil() && player.isGood()) || (storePlayer.isGood() && player.isEvil()))
|
||||
{
|
||||
player.sendMessage("You cant buy from different faction members.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
TradeList storeList = storePlayer.getSellList();
|
||||
if (storeList == null)
|
||||
{
|
||||
|
@@ -139,6 +139,15 @@ public final class RequestPrivateStoreSell extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED)
|
||||
{
|
||||
if ((storePlayer.isEvil() && player.isGood()) || (storePlayer.isGood() && player.isEvil()))
|
||||
{
|
||||
player.sendMessage("You cant sell on different faction members.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Update offline trade record, if realtime saving is enabled
|
||||
if (Config.OFFLINE_TRADE_ENABLE && Config.STORE_OFFLINE_TRADE_IN_REALTIME && ((storePlayer.getClient() == null) || storePlayer.getClient().isDetached()))
|
||||
{
|
||||
|
@@ -190,6 +190,12 @@ public final class TradeRequest extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((player.isEvil() && partner.isGood()) || (player.isGood() && partner.isEvil())))
|
||||
{
|
||||
player.sendMessage("You cannot trade with different team members.");
|
||||
return;
|
||||
}
|
||||
|
||||
player.onTransactionRequest(partner);
|
||||
partner.sendPacket(new SendTradeRequest(player.getObjectId()));
|
||||
sm = SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_REQUESTED_A_TRADE_WITH_C1);
|
||||
|
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.clientpackets.friend;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.model.BlockList;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
@@ -100,6 +101,11 @@ public final class RequestFriendInvite extends L2GameClientPacket
|
||||
activeChar.sendPacket(sm);
|
||||
return;
|
||||
}
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((friend.isEvil() && activeChar.isGood()) || (friend.isGood() && activeChar.isEvil())))
|
||||
{
|
||||
activeChar.sendMessage("You cannot have a friend of the opposing faction.");
|
||||
return;
|
||||
}
|
||||
// Friend request sent.
|
||||
activeChar.onTransactionRequest(friend);
|
||||
friend.sendPacket(new FriendAddRequest(activeChar.getName()));
|
||||
|
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
package com.l2jserver.gameserver.network.clientpackets.mentoring;
|
||||
|
||||
import com.l2jserver.Config;
|
||||
import com.l2jserver.gameserver.model.L2World;
|
||||
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
|
||||
import com.l2jserver.gameserver.network.SystemMessageId;
|
||||
@@ -53,6 +54,12 @@ public class RequestMenteeAdd extends L2GameClientPacket
|
||||
return;
|
||||
}
|
||||
|
||||
if (Config.FACTION_SYSTEM_ENABLED && ((mentor.isEvil() && mentee.isGood()) || (mentor.isGood() && mentee.isEvil())))
|
||||
{
|
||||
mentor.sendMessage("You cannot mentor a member of the opposing faction.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ConfirmMenteeAdd.validate(mentor, mentee))
|
||||
{
|
||||
mentor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.YOU_HAVE_OFFERED_TO_BECOME_S1_S_MENTOR).addCharName(mentee));
|
||||
|
Reference in New Issue
Block a user