Config for disabling mounts on sieges.

This commit is contained in:
mobius
2015-01-02 14:33:23 +00:00
parent ead9206d06
commit 52afbcbf9c
4 changed files with 27 additions and 1 deletions

View File

@@ -394,3 +394,7 @@ AllowRideWyvernAlways = False
# Allow riding wyvern during Castle/Fort Siege # Allow riding wyvern during Castle/Fort Siege
# Default: True # Default: True
AllowRideWyvernDuringSiege = True AllowRideWyvernDuringSiege = True
# Allow riding mounts (wyvern excluded) during Castle/Fort Siege
# Default: False
AllowRideMountsDuringSiege = False

View File

@@ -421,6 +421,7 @@ public final class Config
public static int CLAN_LEVEL_11_REQUIREMENT; public static int CLAN_LEVEL_11_REQUIREMENT;
public static boolean ALLOW_WYVERN_ALWAYS; public static boolean ALLOW_WYVERN_ALWAYS;
public static boolean ALLOW_WYVERN_DURING_SIEGE; public static boolean ALLOW_WYVERN_DURING_SIEGE;
public static boolean ALLOW_MOUNTS_DURING_SIEGE;
// -------------------------------------------------- // --------------------------------------------------
// General Settings // General Settings
@@ -1406,6 +1407,7 @@ public final class Config
CLAN_LEVEL_11_REQUIREMENT = Feature.getInt("ClanLevel11Requirement", 170); CLAN_LEVEL_11_REQUIREMENT = Feature.getInt("ClanLevel11Requirement", 170);
ALLOW_WYVERN_ALWAYS = Feature.getBoolean("AllowRideWyvernAlways", false); ALLOW_WYVERN_ALWAYS = Feature.getBoolean("AllowRideWyvernAlways", false);
ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true); ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true);
ALLOW_MOUNTS_DURING_SIEGE = Feature.getBoolean("AllowRideMountsDuringSiege", false);
// Load Character L2Properties file (if exists) // Load Character L2Properties file (if exists)
final PropertiesParser Character = new PropertiesParser(CHARACTER_CONFIG_FILE); final PropertiesParser Character = new PropertiesParser(CHARACTER_CONFIG_FILE);

View File

@@ -4815,6 +4815,11 @@ public final class L2PcInstance extends L2Playable
public void transform(Transform transformation) public void transform(Transform transformation)
{ {
if (!Config.ALLOW_MOUNTS_DURING_SIEGE && transformation.isRiding() && isInsideZone(ZoneId.SIEGE))
{
return;
}
if (_transformation != null) if (_transformation != null)
{ {
// You already polymorphed and cannot polymorph again. // You already polymorphed and cannot polymorph again.
@@ -6395,6 +6400,11 @@ public final class L2PcInstance extends L2Playable
public boolean mount(L2Summon pet) public boolean mount(L2Summon pet)
{ {
if (!Config.ALLOW_MOUNTS_DURING_SIEGE && isInsideZone(ZoneId.SIEGE))
{
return false;
}
if (!disarmWeapons() || !disarmShield() || isTransformed()) if (!disarmWeapons() || !disarmShield() || isTransformed())
{ {
return false; return false;

View File

@@ -182,6 +182,16 @@ public class L2SiegeZone extends L2ZoneType
plyer.sendPacket(SystemMessageId.THIS_AREA_CANNOT_BE_ENTERED_WHILE_MOUNTED_ATOP_OF_A_WYVERN_YOU_WILL_BE_DISMOUNTED_FROM_YOUR_WYVERN_IF_YOU_DO_NOT_LEAVE); plyer.sendPacket(SystemMessageId.THIS_AREA_CANNOT_BE_ENTERED_WHILE_MOUNTED_ATOP_OF_A_WYVERN_YOU_WILL_BE_DISMOUNTED_FROM_YOUR_WYVERN_IF_YOU_DO_NOT_LEAVE);
plyer.enteredNoLanding(DISMOUNT_DELAY); plyer.enteredNoLanding(DISMOUNT_DELAY);
} }
if (!Config.ALLOW_MOUNTS_DURING_SIEGE && (plyer.isMounted()))
{
plyer.dismount();
}
if (!Config.ALLOW_MOUNTS_DURING_SIEGE && plyer.isTransformed() && plyer.getTransformation().isRiding())
{
plyer.untransform();
}
} }
} }
} }