Config for disabling mounts on sieges.
This commit is contained in:
parent
ead9206d06
commit
52afbcbf9c
6
trunk/dist/game/config/Feature.properties
vendored
6
trunk/dist/game/config/Feature.properties
vendored
@ -393,4 +393,8 @@ AllowRideWyvernAlways = False
|
||||
|
||||
# Allow riding wyvern during Castle/Fort Siege
|
||||
# Default: True
|
||||
AllowRideWyvernDuringSiege = True
|
||||
AllowRideWyvernDuringSiege = True
|
||||
|
||||
# Allow riding mounts (wyvern excluded) during Castle/Fort Siege
|
||||
# Default: False
|
||||
AllowRideMountsDuringSiege = False
|
@ -421,6 +421,7 @@ public final class Config
|
||||
public static int CLAN_LEVEL_11_REQUIREMENT;
|
||||
public static boolean ALLOW_WYVERN_ALWAYS;
|
||||
public static boolean ALLOW_WYVERN_DURING_SIEGE;
|
||||
public static boolean ALLOW_MOUNTS_DURING_SIEGE;
|
||||
|
||||
// --------------------------------------------------
|
||||
// General Settings
|
||||
@ -1406,6 +1407,7 @@ public final class Config
|
||||
CLAN_LEVEL_11_REQUIREMENT = Feature.getInt("ClanLevel11Requirement", 170);
|
||||
ALLOW_WYVERN_ALWAYS = Feature.getBoolean("AllowRideWyvernAlways", false);
|
||||
ALLOW_WYVERN_DURING_SIEGE = Feature.getBoolean("AllowRideWyvernDuringSiege", true);
|
||||
ALLOW_MOUNTS_DURING_SIEGE = Feature.getBoolean("AllowRideMountsDuringSiege", false);
|
||||
|
||||
// Load Character L2Properties file (if exists)
|
||||
final PropertiesParser Character = new PropertiesParser(CHARACTER_CONFIG_FILE);
|
||||
|
@ -4815,6 +4815,11 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
public void transform(Transform transformation)
|
||||
{
|
||||
if (!Config.ALLOW_MOUNTS_DURING_SIEGE && transformation.isRiding() && isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (_transformation != null)
|
||||
{
|
||||
// You already polymorphed and cannot polymorph again.
|
||||
@ -6395,6 +6400,11 @@ public final class L2PcInstance extends L2Playable
|
||||
|
||||
public boolean mount(L2Summon pet)
|
||||
{
|
||||
if (!Config.ALLOW_MOUNTS_DURING_SIEGE && isInsideZone(ZoneId.SIEGE))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!disarmWeapons() || !disarmShield() || isTransformed())
|
||||
{
|
||||
return false;
|
||||
|
@ -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.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user