Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### Eclipse Workspace Patch 1.0
- #P aCis_gameserver
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java (revision 5)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreSell.java (working copy)
- @@ -74,6 +74,9 @@
- if (!player.isInsideRadius(storePlayer, 150, true, false))
- return;
- + if (player.getFactionId() != storePlayer.getFactionId())
- + return;
- +
- if (storePlayer.getPrivateStoreType() != PrivateStoreType.BUY)
- return;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java (revision 5)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestPrivateStoreBuy.java (working copy)
- @@ -76,6 +76,9 @@
- if (player.isCursedWeaponEquipped())
- return;
- + if (player.getFactionId() != storePlayer.getFactionId())
- + return;
- +
- if (!player.isInsideRadius(storePlayer, 150, true, false))
- return;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java (revision 5)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/TradeRequest.java (working copy)
- @@ -59,6 +59,9 @@
- return;
- }
- + if (target.getFactionId() != player.getFactionId())
- + return;
- +
- // Alt game - Karma punishment
- if (!Config.KARMA_PLAYER_CAN_TRADE && (player.getKarma() > 0 || target.getKarma() > 0))
- {
- Index: java/net/sf/l2j/gameserver/model/L2World.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/L2World.java (revision 5)
- +++ java/net/sf/l2j/gameserver/model/L2World.java (working copy)
- @@ -140,6 +140,34 @@
- return _pets.get(ownerId);
- }
- + public Collection<L2PcInstance> getFactionPlayers(int id)
- + {
- + Map<Integer, L2PcInstance> players = new ConcurrentHashMap<>();
- +
- + for (L2PcInstance player : _players.values())
- + {
- + if (player.getFactionId() == id)
- + players.put(player.getObjectId(), player);
- + }
- +
- + return players.values();
- + }
- +
- + public int getFactionSize(int id)
- + {
- + int size = 0;
- +
- + for (L2PcInstance player : _players.values())
- + {
- + if (player.getFactionId() == id)
- + {
- + size++;
- + }
- + }
- +
- + return size;
- + }
- +
- /**
- * Add a L2Object in the world.<BR>
- * <BR>
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java (revision 5)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinParty.java (working copy)
- @@ -52,6 +52,9 @@
- return;
- }
- + if (target.getFactionId() != requestor.getFactionId())
- + return;
- +
- if (BlockList.isBlocked(target, requestor))
- {
- requestor.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_ADDED_YOU_TO_IGNORE_LIST).addPcName(target));
- Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/L2Character.java (revision 5)
- +++ java/net/sf/l2j/gameserver/model/actor/L2Character.java (working copy)
- @@ -571,6 +571,52 @@
- return;
- }
- + if (this instanceof L2Playable && target instanceof L2Playable)
- + {
- + if (this instanceof L2PcInstance && target instanceof L2PcInstance)
- + {
- + if (this.getActingPlayer().getFactionId() == target.getActingPlayer().getFactionId())
- + {
- + sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + }
- +
- + if (this instanceof L2Summon && target instanceof L2PcInstance)
- + {
- + L2Summon summon = (L2Summon) this;
- +
- + if (summon.getOwner().getFactionId() != target.getActingPlayer().getFactionId())
- + {
- + sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + }
- +
- + if (this instanceof L2Summon && target instanceof L2Summon)
- + {
- + L2Summon summon1 = (L2Summon) this;
- + L2Summon summon2 = (L2Summon) target;
- +
- + if (summon1.getOwner().getFactionId() == summon2.getOwner().getFactionId())
- + {
- + sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + }
- +
- + if (target instanceof L2Summon)
- + {
- + L2Summon summon = (L2Summon) target;
- +
- + if (summon.getOwner().getFactionId() == this.getActingPlayer().getFactionId())
- + {
- + sendPacket(ActionFailed.STATIC_PACKET);
- + return;
- + }
- + }
- + }
- +
- // Checking if target has moved to peace zone
- if (isInsidePeaceZone(this, target))
- {
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinAlly.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinAlly.java (revision 5)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestJoinAlly.java (working copy)
- @@ -52,6 +52,9 @@
- return;
- }
- + if (target.getFactionId() != activeChar.getFactionId())
- + return;
- +
- if (!clan.checkAllyJoinCondition(activeChar, target))
- return;
- Index: java/net/sf/l2j/gameserver/model/L2Skill.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/L2Skill.java (revision 5)
- +++ java/net/sf/l2j/gameserver/model/L2Skill.java (working copy)
- @@ -2061,6 +2061,9 @@
- if (targetPlayer.inObserverMode())
- return false;
- + if (player.getFactionId() == targetPlayer.getFactionId() && skill.isOffensive())
- + return false;
- +
- if (skill.isOffensive() && player.getSiegeState() > 0 && player.isInsideZone(ZoneId.SIEGE) && player.getSiegeState() == targetPlayer.getSiegeState())
- return false;
- Index: java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (revision 5)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/EnterWorld.java (working copy)
- @@ -18,6 +18,7 @@
- import net.sf.l2j.gameserver.communitybbs.Manager.MailBBSManager;
- import net.sf.l2j.gameserver.datatables.AdminCommandAccessRights;
- import net.sf.l2j.gameserver.datatables.AnnouncementTable;
- +import net.sf.l2j.gameserver.datatables.Faction;
- import net.sf.l2j.gameserver.datatables.GmListTable;
- import net.sf.l2j.gameserver.datatables.MapRegionTable;
- import net.sf.l2j.gameserver.datatables.SkillTable.FrequentSkill;
- @@ -229,6 +230,8 @@
- sendPacket(new SkillCoolTime(activeChar));
- + Faction.getInstance().onPlayerEnter(activeChar);
- +
- // If player logs back in a stadium, port him in nearest town.
- if (Olympiad.getInstance().playerInStadia(activeChar))
- activeChar.teleToLocation(MapRegionTable.TeleportWhereType.Town);
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2FactionInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2FactionInstance.java (revision 0)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2FactionInstance.java (working copy)
- @@ -0,0 +1,85 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.model.actor.instance;
- +
- +import net.sf.l2j.gameserver.ThreadPoolManager;
- +import net.sf.l2j.gameserver.datatables.Faction;
- +import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
- +import net.sf.l2j.gameserver.util.Broadcast;
- +
- +/**
- + * @author AccessDenied
- + */
- +public class L2FactionInstance extends L2NpcInstance
- +{
- +
- + public L2FactionInstance(int objectId, NpcTemplate template)
- + {
- + super(objectId, template);
- + }
- +
- + @Override
- + public void onBypassFeedback(L2PcInstance player, String command)
- + {
- + int id = Integer.parseInt(command);
- +
- + for (Faction.FactionHolder faction : Faction.getInstance().factions.values())
- + {
- + if (faction.getFactionId() == id)
- + {
- + player.getAppearance().setNameColor(Integer.decode("0x" + faction.getFactionColor()));
- + player.setTitle(faction.getFactionName());
- + player.setFactionId(id);
- + player.broadcastTitleInfo();
- + player.broadcastUserInfo();
- +
- + player.sendMessage("You will get teleported to your base soon.");
- + System.out.println("Player " + player.getName() + " choosed " + faction.getFactionName());
- + Broadcast.announceToOnlinePlayers("Player " + player.getName() + " has joined " + faction.getFactionName() + ".");
- +
- + ThreadPoolManager.getInstance().scheduleGeneral(new TeleToBase(player), 5000);
- + }
- + }
- +
- + }
- +
- + private static class TeleToBase implements Runnable
- + {
- +
- + L2PcInstance _player = null;
- +
- + public TeleToBase(L2PcInstance player)
- + {
- + _player = player;
- + }
- +
- + @Override
- + public void run()
- + {
- + if (_player !=null)
- + {
- + Faction.getInstance().teleToBase(_player);
- + _player.sendMessage("Have a nice gameplay!");
- + }
- + }
- +
- + }
- +
- + @Override
- + public String getHtmlPath(int npcId, int val)
- + {
- + return "data/html/mods/faction.htm";
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/GameServer.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/GameServer.java (revision 5)
- +++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
- @@ -46,6 +46,7 @@
- import net.sf.l2j.gameserver.datatables.CharTemplateTable;
- import net.sf.l2j.gameserver.datatables.ClanTable;
- import net.sf.l2j.gameserver.datatables.DoorTable;
- +import net.sf.l2j.gameserver.datatables.Faction;
- import net.sf.l2j.gameserver.datatables.FishTable;
- import net.sf.l2j.gameserver.datatables.GmListTable;
- import net.sf.l2j.gameserver.datatables.HelperBuffTable;
- @@ -264,6 +265,9 @@
- DayNightSpawnManager.getInstance();
- DimensionalRiftManager.getInstance();
- + StringUtil.printSection("Faction");
- + Faction.getInstance();
- +
- StringUtil.printSection("Olympiads & Heroes");
- OlympiadGameManager.getInstance();
- Olympiad.getInstance();
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestDuelStart.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestDuelStart.java (revision 5)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestDuelStart.java (working copy)
- @@ -55,6 +55,9 @@
- return;
- }
- + if (activeChar.getFactionId() == targetChar.getFactionId())
- + return;
- +
- if (!targetChar.canDuel())
- {
- activeChar.sendPacket(targetChar.getNoDuelReason());
- Index: java/net/sf/l2j/gameserver/datatables/Faction.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/datatables/Faction.java (revision 0)
- +++ java/net/sf/l2j/gameserver/datatables/Faction.java (working copy)
- @@ -0,0 +1,167 @@
- +/*
- + * This program is free software: you can redistribute it and/or modify it under
- + * the terms of the GNU General Public License as published by the Free Software
- + * Foundation, either version 3 of the License, or (at your option) any later
- + * version.
- + *
- + * This program is distributed in the hope that it will be useful, but WITHOUT
- + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- + * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- + * details.
- + *
- + * You should have received a copy of the GNU General Public License along with
- + * this program. If not, see <http://www.gnu.org/licenses/>.
- + */
- +package net.sf.l2j.gameserver.datatables;
- +
- +import java.sql.Connection;
- +import java.sql.PreparedStatement;
- +import java.sql.ResultSet;
- +import java.util.ArrayList;
- +import java.util.Map;
- +import java.util.concurrent.ConcurrentHashMap;
- +
- +import net.sf.l2j.L2DatabaseFactory;
- +import net.sf.l2j.commons.random.Rnd;
- +import net.sf.l2j.gameserver.model.Location;
- +import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
- +
- +
- +/**
- + * @author AccessDenied
- + */
- +public class Faction
- +{
- +
- + public Map<Integer, FactionHolder> factions = new ConcurrentHashMap<>();
- + public ArrayList<RewardHolder> rewards = new ArrayList<>();
- +
- + public Faction()
- + {
- + try (Connection con = L2DatabaseFactory.getInstance().getConnection())
- + {
- + PreparedStatement statement = con.prepareStatement("SELECT * FROM faction");
- + ResultSet result = statement.executeQuery();
- +
- + while(result.next())
- + {
- + int id = result.getInt("factionId");
- + String name = result.getString("factionName");
- + String[] pos = result.getString("factionPos").split(";");
- + Location loc = new Location(Integer.parseInt(pos[0]), Integer.parseInt(pos[1]), Integer.parseInt(pos[2]));
- + String color = result.getString("factionColor");
- +
- + factions.put(id, new FactionHolder(id, name, loc, color));
- + }
- + result.close();
- + statement.close();
- + }
- + catch (Exception e)
- + {
- + System.out.println("Failed to load factions from database: " + e);
- + return;
- + }
- + }
- +
- + public void teleToBase(L2PcInstance player)
- + {
- + player.teleToLocation(factions.get(player.getFactionId()).getFactionLoc(), 0);
- + }
- +
- + public Location getFactionLocation(L2PcInstance player)
- + {
- + return factions.get(player.getFactionId()).getFactionLoc();
- + }
- +
- + public void onPlayerEnter(L2PcInstance player)
- + {
- + player.setTitle(factions.get(player.getFactionId()).getFactionName());
- + player.getAppearance().setNameColor(Integer.decode("0x" + factions.get(player.getFactionId()).getFactionColor()));
- + teleToBase(player);
- + }
- +
- + public void onReward(L2PcInstance player)
- + {
- + if (rewards.isEmpty())
- + return;
- +
- + for (RewardHolder holder : rewards)
- + if (Rnd.get(100) <= holder.getChance())
- + player.getInventory().addItem("reward", holder.getRewardId(), holder.getRewardCount(), player, player);
- + }
- +
- + public class RewardHolder
- + {
- + private int _id;
- + private int _count;
- + private int _chance;
- +
- + public RewardHolder(int id, int count, int chance)
- + {
- + _id = id;
- + _count = count;
- + _chance = chance;
- + }
- +
- + public int getChance()
- + {
- + return _chance;
- + }
- +
- + public int getRewardId()
- + {
- + return _id;
- + }
- +
- + public int getRewardCount()
- + {
- + return _count;
- + }
- + }
- +
- + public class FactionHolder
- + {
- + private int _id;
- + private String _name;
- + private Location _pos;
- + private String _color;
- +
- + public FactionHolder(int id, String name, Location pos, String color)
- + {
- + _id = id;
- + _name = name;
- + _pos = pos;
- + _color = color;
- + }
- +
- + public String getFactionColor()
- + {
- + return _color;
- + }
- +
- + public int getFactionId()
- + {
- + return _id;
- + }
- +
- + public String getFactionName()
- + {
- + return _name;
- + }
- +
- + public Location getFactionLoc()
- + {
- + return _pos;
- + }
- + }
- +
- + public static Faction getInstance()
- + {
- + return SingletonHolder._instance;
- + }
- +
- + private static class SingletonHolder
- + {
- + protected static final Faction _instance = new Faction();
- + }
- +}
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java (revision 5)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRestartPoint.java (working copy)
- @@ -15,6 +15,7 @@
- package net.sf.l2j.gameserver.network.clientpackets;
- import net.sf.l2j.gameserver.ThreadPoolManager;
- +import net.sf.l2j.gameserver.datatables.Faction;
- import net.sf.l2j.gameserver.datatables.MapRegionTable;
- import net.sf.l2j.gameserver.instancemanager.CastleManager;
- import net.sf.l2j.gameserver.instancemanager.ClanHallManager;
- @@ -138,7 +139,7 @@
- break;
- default:
- - loc = MapRegionTable.getInstance().getTeleToLocation(activeChar, MapRegionTable.TeleportWhereType.Town);
- + loc = Faction.getInstance().getFactionLocation(activeChar);
- break;
- }
- Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 5)
- +++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
- @@ -52,6 +52,7 @@
- import net.sf.l2j.gameserver.datatables.CharNameTable;
- import net.sf.l2j.gameserver.datatables.CharTemplateTable;
- import net.sf.l2j.gameserver.datatables.ClanTable;
- +import net.sf.l2j.gameserver.datatables.Faction;
- import net.sf.l2j.gameserver.datatables.FishTable;
- import net.sf.l2j.gameserver.datatables.GmListTable;
- import net.sf.l2j.gameserver.datatables.HennaTable;
- @@ -313,8 +314,8 @@
- private static final String DELETE_SKILL_SAVE = "DELETE FROM character_skills_save WHERE char_obj_id=? AND class_index=?";
- private static final String INSERT_CHARACTER = "INSERT INTO characters (account_name,obj_Id,char_name,level,maxHp,curHp,maxCp,curCp,maxMp,curMp,face,hairStyle,hairColor,sex,exp,sp,karma,pvpkills,pkkills,clanid,race,classid,deletetime,cancraft,title,accesslevel,online,isin7sdungeon,clan_privs,wantspeace,base_class,nobless,power_grade,last_recom_date) 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=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=? WHERE obj_id=?";
- - private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level FROM characters WHERE obj_id=?";
- + 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=?,pvpkills=?,pkkills=?,rec_have=?,rec_left=?,clanid=?,race=?,classid=?,deletetime=?,title=?,accesslevel=?,online=?,isin7sdungeon=?,clan_privs=?,wantspeace=?,base_class=?,onlinetime=?,punish_level=?,punish_timer=?,nobless=?,power_grade=?,subpledge=?,last_recom_date=?,lvl_joined_academy=?,apprentice=?,sponsor=?,varka_ketra_ally=?,clan_join_expiry_time=?,clan_create_expiry_time=?,char_name=?,death_penalty_level=?, factionId=? WHERE obj_id=?";
- + private static final String RESTORE_CHARACTER = "SELECT account_name, obj_Id, char_name, level, maxHp, curHp, maxCp, curCp, maxMp, curMp, face, hairStyle, hairColor, sex, heading, x, y, z, exp, expBeforeDeath, sp, karma, pvpkills, pkkills, clanid, race, classid, deletetime, cancraft, title, rec_have, rec_left, accesslevel, online, char_slot, lastAccess, clan_privs, wantspeace, base_class, onlinetime, isin7sdungeon, punish_level, punish_timer, nobless, power_grade, subpledge, last_recom_date, lvl_joined_academy, apprentice, sponsor, varka_ketra_ally,clan_join_expiry_time,clan_create_expiry_time,death_penalty_level,factionId FROM characters WHERE obj_id=?";
- private static final String RESTORE_CHAR_SUBCLASSES = "SELECT class_id,exp,sp,level,class_index FROM character_subclasses WHERE char_obj_id=? ORDER BY class_index ASC";
- private static final String ADD_CHAR_SUBCLASS = "INSERT INTO character_subclasses (char_obj_id,class_id,exp,sp,level,class_index) VALUES (?,?,?,?,?,?)";
- @@ -4029,6 +4030,9 @@
- {
- L2PcInstance pk = killer.getActingPlayer();
- + pk.setPvpKills(pk.getPvpKills() + 1);
- + Faction.getInstance().onReward(pk);
- +
- // Clear resurrect xp calculation
- setExpBeforeDeath(0);
- @@ -4242,7 +4246,12 @@
- {
- // PK Points are increased only if you kill a player.
- if (target instanceof L2PcInstance)
- + {
- + if (target.getActingPlayer().getFactionId() != 0)
- + return;
- +
- setPkKills(getPkKills() + 1);
- + }
- // Calculate new karma.
- setKarma(getKarma() + Formulas.calculateKarmaGain(getPkKills(), target instanceof L2Summon));
- @@ -4257,6 +4266,9 @@
- if (isInsideZone(ZoneId.PVP))
- return;
- + if (getFactionId() != 0)
- + return;
- +
- PvpFlagTaskManager.getInstance().add(this, Config.PVP_NORMAL_TIME);
- if (getPvpFlag() == 0)
- @@ -4272,6 +4284,9 @@
- if (isInDuel() && player.getDuelId() == getDuelId())
- return;
- + if (getFactionId() != 0)
- + return;
- +
- if ((!isInsideZone(ZoneId.PVP) || !target.isInsideZone(ZoneId.PVP)) && player.getKarma() == 0)
- {
- PvpFlagTaskManager.getInstance().add(this, checkIfPvP(player) ? Config.PVP_PVP_TIME : Config.PVP_NORMAL_TIME);
- @@ -5479,6 +5494,8 @@
- player.setName(rset.getString("char_name"));
- player._lastAccess = rset.getLong("lastAccess");
- + player.setFactionId(rset.getInt("factionId"));
- +
- player.getStat().setExp(rset.getLong("exp"));
- player.setExpBeforeDeath(rset.getLong("expBeforeDeath"));
- player.getStat().setLevel(rset.getByte("level"));
- @@ -5922,7 +5939,8 @@
- statement.setLong(47, getClanCreateExpiryTime());
- statement.setString(48, getName());
- statement.setLong(49, getDeathPenaltyBuffLevel());
- - statement.setInt(50, getObjectId());
- + statement.setInt(50, getFactionId());
- + statement.setInt(51, getObjectId());
- statement.execute();
- statement.close();
- @@ -10705,4 +10723,16 @@
- break;
- }
- }
- +
- + private int _factionId;
- +
- + public void setFactionId(int id)
- + {
- + _factionId = id;
- + }
- +
- + public int getFactionId()
- + {
- + return _factionId;
- + }
- }
- \ No newline at end of file
- Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendInvite.java
- ===================================================================
- --- java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendInvite.java (revision 5)
- +++ java/net/sf/l2j/gameserver/network/clientpackets/RequestFriendInvite.java (working copy)
- @@ -55,6 +55,9 @@
- return;
- }
- + if (friend.getFactionId() != activeChar.getFactionId())
- + return;
- +
- if (BlockList.isBlocked(activeChar, friend))
- {
- activeChar.sendMessage("You have blocked " + _name + ".");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement