rendered paste bodyIndex: D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
===================================================================
--- D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 1543)
+++ D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)
@@ -69,6 +69,7 @@
import net.sf.l2j.gameserver.instancemanager.QuestManager;
import net.sf.l2j.gameserver.instancemanager.SiegeManager;
import net.sf.l2j.gameserver.instancemanager.ZoneManager;
+import net.sf.l2j.gameserver.instancemanager.CastleManager;
import net.sf.l2j.gameserver.lib.Rnd;
import net.sf.l2j.gameserver.model.BlockList;
import net.sf.l2j.gameserver.model.BuySellList;
@@ -153,6 +154,7 @@
import net.sf.l2j.gameserver.templates.L2Weapon;
import net.sf.l2j.gameserver.templates.L2WeaponType;
import net.sf.l2j.gameserver.util.Broadcast;
+import net.sf.l2j.gameserver.MapRegionTable;
import net.sf.l2j.util.Point3D;
@@ -1194,7 +1196,7 @@
{
return getSkillLevel(L2Skill.SKILL_CREATE_DWARVEN) >= 1;
}
-
+
public int getDwarvenCraft()
{
return getSkillLevel(L2Skill.SKILL_CREATE_DWARVEN);
@@ -1207,7 +1209,7 @@
{
return getSkillLevel(L2Skill.SKILL_CREATE_COMMON) >= 1;
}
-
+
public int getCommonCraft()
{
return getSkillLevel(L2Skill.SKILL_CREATE_COMMON);
@@ -2710,11 +2712,11 @@
ZoneManager.getInstance().checkIfInZonePvP(this) && // Player is inside pvp zone and
ZoneManager.getInstance().checkIfInZonePvP(target) // Target player is inside pvp zone
) ||
- (
- targetPlayer.getClan()!=null && this.getClan()!=null &&
- targetPlayer.getClan().isAtWarWith(this.getClanId()) &&
- this.getClan().isAtWarWith(targetPlayer.getClanId())
- )
+ (
+ targetPlayer.getClan()!=null && this.getClan()!=null &&
+ targetPlayer.getClan().isAtWarWith(this.getClanId()) &&
+ this.getClan().isAtWarWith(targetPlayer.getClanId())
+ )
)
{
// Increase the PvP Kills counter (Number of player killed during a PvP)
@@ -2772,7 +2774,7 @@
// Add karma to attacker and increase its PK counter
setPkKills(getPkKills() + 1);
- if (!(this.getClan() != null && this.getClan().isAtWarWith(targetPlayer.getClanId())))
+ if (!(this.getClan() != null && this.getClan().isAtWarWith(targetPlayer.getClanId())))
setKarma(getKarma() + newKarma);
// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter
@@ -5076,8 +5078,30 @@
/**
* Set the type of Pet mounted (0 : none, 1 : Stridder, 2 : Wyvern) and send a Server->Client packet InventoryUpdate to the L2PcInstance.<BR><BR>
*/
+
+ public boolean checkLandingState()
+ {
+ // Check if char is in a no landing zone
+ if (ZoneManager.getInstance().checkIfInZoneNoLanding(this))
+ return true;
+ else
+ // if this is a castle that is currently being sieged, and the rider is NOT a castle owner
+ // he cannot land.
+ // castle owner is the leader of the clan that owns the castle where the pc is
+ if (SiegeManager.getInstance().checkIfInZone(this) &&
+ !(getClan()!=null &&
+ CastleManager.getInstance().getCastle(this) == CastleManager.getInstance().getCastleByOwner(getClan()) &&
+ this == getClan().getLeader().getPlayerInstance()))
+ return true;
+
+ return false;
+ }
+
public void setMountType(int mountType)
{
+ if (checkLandingState() && mountType !=0)
+ return;
+
switch(mountType)
{
case 0: setIsFlying(false);
@@ -6137,12 +6161,15 @@
{
if (_taskRentPet != null)
{
+ // if the rent of a wyvern expires while over a flying zone, tp to down before unmounting
+ if (checkLandingState() && getMountType()==2)
+ teleToLocation(MapRegionTable.getInstance().getTeleToLocation(this, MapRegionTable.TeleportWhereType.Town));
_taskRentPet.cancel(false);
- Ride dismount = new Ride(getObjectId(), Ride.ACTION_DISMOUNT, 0);
- sendPacket(dismount);
- broadcastPacket(dismount);
+ Ride dismount = new Ride(getObjectId(), Ride.ACTION_DISMOUNT, 0);
+ sendPacket(dismount);
+ broadcastPacket(dismount);
_taskRentPet = null;
- setMountType(0);
+ setMountType(0);
}
}
public void startRentPet(int seconds)
Index: D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/entity/ZoneType.java
===================================================================
--- D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/entity/ZoneType.java (revision 1543)
+++ D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/model/entity/ZoneType.java (working copy)
@@ -28,7 +28,8 @@
Town,
TownSpawn,
Underground,
- Water
+ Water,
+ NoLanding
}
public static String[] ZoneTypeName =
@@ -36,7 +37,7 @@
"Arena", "Arena Spawn", "Castle Area",
"Castle Defender Spawn", "Clan Hall", "Peace",
"Siege Battlefield", "Town", "Town Spawn", "Underground",
- "Water"
+ "Water","No Landing"
};
public static String getZoneTypeName(ZoneTypeEnum zt)
Index: D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/instancemanager/ZoneManager.java
===================================================================
--- D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/instancemanager/ZoneManager.java (revision 1543)
+++ D:/Source/trunk/L2_Gameserver/java/net/sf/l2j/gameserver/instancemanager/ZoneManager.java (working copy)
@@ -71,6 +71,18 @@
);
}
+ public boolean checkIfInZoneNoLanding(L2Object obj)
+ {
+ return checkIfInZoneNoLanding(obj.getX(), obj.getY());
+ }
+
+ public boolean checkIfInZoneNoLanding(int x, int y)
+ {
+ return
+ (
+ checkIfInZone(ZoneType.getZoneTypeName(ZoneType.ZoneTypeEnum.NoLanding), x, y)// object is trying to dismount in nolanding zone
+ );
+ }
public boolean checkIfInZonePvP(L2Object obj)
{
return checkIfInZonePvP(obj.getX(), obj.getY());
@@ -88,15 +100,15 @@
);
}
- public void reloadAll()
- {
- _Zone = null;
- load();
- TownManager.getInstance().reloadAll();
- ArenaManager.getInstance().reloadAll();
- CastleManager.getInstance().reloadAll();
- ClanHallManager.getInstance().reloadAll();
- }
+ public void reloadAll()
+ {
+ _Zone = null;
+ load();
+ TownManager.getInstance().reloadAll();
+ ArenaManager.getInstance().reloadAll();
+ CastleManager.getInstance().reloadAll();
+ ClanHallManager.getInstance().reloadAll();
+ }
// =========================================================
// Method - Private
private void load()