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();