Addition of friendly command channel configuration.

This commit is contained in:
MobiusDevelopment
2020-04-30 21:46:27 +00:00
parent d6c62b24af
commit de8e676534
90 changed files with 810 additions and 0 deletions

View File

@@ -557,6 +557,10 @@ AltPartyRange = 1500
# Default: False
AltLeavePartyLeader = False
# Consider same command channel members friends. (Used by target handlers.)
# Retail is supposed to be false, but have no proof that it is like that.
AltCommandChannelFriends = False
# ---------------------------------------------------------------------------
# Initial Settings:

View File

@@ -16,7 +16,9 @@
*/
package handlers.targethandlers.affectobject;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
import org.l2jmobius.gameserver.model.CommandChannel;
import org.l2jmobius.gameserver.model.Party;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -49,6 +51,16 @@ public class Friend implements IAffectObjectHandler
return true;
}
if (Config.ALT_COMMAND_CHANNEL_FRIENDS)
{
final CommandChannel playerCC = player.getCommandChannel();
final CommandChannel targetCC = targetPlayer.getCommandChannel();
if ((playerCC != null) && (targetCC != null) && (playerCC.getLeaderObjectId() == targetCC.getLeaderObjectId()))
{
return true;
}
}
// Party (command channel doesn't make you friends).
final Party party = player.getParty();
final Party targetParty = targetPlayer.getParty();

View File

@@ -16,7 +16,9 @@
*/
package handlers.targethandlers.affectobject;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
import org.l2jmobius.gameserver.model.CommandChannel;
import org.l2jmobius.gameserver.model.Party;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -47,6 +49,16 @@ public class FriendPc implements IAffectObjectHandler
return true;
}
if (Config.ALT_COMMAND_CHANNEL_FRIENDS)
{
final CommandChannel playerCC = player.getCommandChannel();
final CommandChannel targetCC = targetPlayer.getCommandChannel();
if ((playerCC != null) && (targetCC != null) && (playerCC.getLeaderObjectId() == targetCC.getLeaderObjectId()))
{
return true;
}
}
// Party (command channel doesn't make you friends).
final Party party = player.getParty();
final Party targetParty = targetPlayer.getParty();

View File

@@ -16,7 +16,9 @@
*/
package handlers.targethandlers.affectobject;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
import org.l2jmobius.gameserver.model.CommandChannel;
import org.l2jmobius.gameserver.model.Party;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -58,6 +60,16 @@ public class NotFriend implements IAffectObjectHandler
return false;
}
if (Config.ALT_COMMAND_CHANNEL_FRIENDS)
{
final CommandChannel playerCC = player.getCommandChannel();
final CommandChannel targetCC = targetPlayer.getCommandChannel();
if ((playerCC != null) && (targetCC != null) && (playerCC.getLeaderObjectId() == targetCC.getLeaderObjectId()))
{
return false;
}
}
// Party (command channel doesn't make you friends).
final Party party = player.getParty();
final Party targetParty = targetPlayer.getParty();

View File

@@ -16,7 +16,9 @@
*/
package handlers.targethandlers.affectobject;
import org.l2jmobius.Config;
import org.l2jmobius.gameserver.handler.IAffectObjectHandler;
import org.l2jmobius.gameserver.model.CommandChannel;
import org.l2jmobius.gameserver.model.Party;
import org.l2jmobius.gameserver.model.actor.Creature;
import org.l2jmobius.gameserver.model.actor.instance.PlayerInstance;
@@ -58,6 +60,16 @@ public class NotFriendPc implements IAffectObjectHandler
return false;
}
if (Config.ALT_COMMAND_CHANNEL_FRIENDS)
{
final CommandChannel playerCC = player.getCommandChannel();
final CommandChannel targetCC = targetPlayer.getCommandChannel();
if ((playerCC != null) && (targetCC != null) && (playerCC.getLeaderObjectId() == targetCC.getLeaderObjectId()))
{
return false;
}
}
// Party (command channel doesn't make you friends).
final Party party = player.getParty();
final Party targetParty = targetPlayer.getParty();

View File

@@ -269,6 +269,7 @@ public class Config
public static int ALT_PARTY_MAX_MEMBERS;
public static int ALT_PARTY_RANGE;
public static boolean ALT_LEAVE_PARTY_LEADER;
public static boolean ALT_COMMAND_CHANNEL_FRIENDS;
public static boolean INITIAL_EQUIPMENT_EVENT;
public static long STARTING_ADENA;
public static byte STARTING_LEVEL;
@@ -1739,6 +1740,7 @@ public class Config
ALT_PARTY_MAX_MEMBERS = Character.getInt("AltPartyMaxMembers", 7);
ALT_PARTY_RANGE = Character.getInt("AltPartyRange", 1500);
ALT_LEAVE_PARTY_LEADER = Character.getBoolean("AltLeavePartyLeader", false);
ALT_COMMAND_CHANNEL_FRIENDS = Character.getBoolean("AltCommandChannelFriends", false);
INITIAL_EQUIPMENT_EVENT = Character.getBoolean("InitialEquipmentEvent", false);
STARTING_ADENA = Character.getLong("StartingAdena", 0);
STARTING_LEVEL = Character.getByte("StartingLevel", (byte) 1);