Last active
December 4, 2015 15:04
-
-
Save Pandragon/019b9bc7cc376f59ff1d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Eclipse Workspace Patch 1.0 | |
#P L2J_Server_BETA | |
Index: java/com/l2jserver/gameserver/model/zone/type/L2SwampZone.java | |
=================================================================== | |
--- java/com/l2jserver/gameserver/model/zone/type/L2SwampZone.java (revision 6602) | |
+++ java/com/l2jserver/gameserver/model/zone/type/L2SwampZone.java (working copy) | |
@@ -18,24 +18,30 @@ | |
*/ | |
package com.l2jserver.gameserver.model.zone.type; | |
+import java.util.concurrent.ScheduledFuture; | |
+ | |
+import com.l2jserver.gameserver.ThreadPoolManager; | |
import com.l2jserver.gameserver.instancemanager.CastleManager; | |
import com.l2jserver.gameserver.model.actor.L2Character; | |
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; | |
import com.l2jserver.gameserver.model.entity.Castle; | |
import com.l2jserver.gameserver.model.zone.L2ZoneType; | |
import com.l2jserver.gameserver.model.zone.ZoneId; | |
+import com.l2jserver.gameserver.network.serverpackets.OnEventTrigger; | |
/** | |
* another type of zone where your speed is changed | |
- * @author kerberos | |
+ * @author kerberos, Pandragon | |
*/ | |
public class L2SwampZone extends L2ZoneType | |
{ | |
private double _move_bonus; | |
- | |
private int _castleId; | |
private Castle _castle; | |
+ int _eventId; | |
+ ScheduledFuture<?> _broadcastTrapAnimation = null; | |
+ | |
public L2SwampZone(int id) | |
{ | |
super(id); | |
@@ -46,6 +52,9 @@ | |
// no castle by default | |
_castleId = 0; | |
_castle = null; | |
+ | |
+ // no event by default | |
+ _eventId = 0; | |
} | |
@Override | |
@@ -59,13 +68,17 @@ | |
{ | |
_castleId = Integer.parseInt(value); | |
} | |
+ else if (name.equals("eventId")) | |
+ { | |
+ _eventId = Integer.parseInt(value); | |
+ } | |
else | |
{ | |
super.setParameter(name, value); | |
} | |
} | |
- private Castle getCastle() | |
+ Castle getCastle() | |
{ | |
if ((_castleId > 0) && (_castle == null)) | |
{ | |
@@ -115,6 +128,45 @@ | |
} | |
} | |
+ @Override | |
+ public void setEnabled(boolean state) | |
+ { | |
+ _enabled = state; | |
+ | |
+ if (_enabled && (_broadcastTrapAnimation == null)) | |
+ { | |
+ _broadcastTrapAnimation = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new broadcastTrapAnimation(), 1000, 15000); | |
+ } | |
+ } | |
+ | |
+ private class broadcastTrapAnimation implements Runnable | |
+ { | |
+ public broadcastTrapAnimation() | |
+ { | |
+ } | |
+ | |
+ @Override | |
+ public void run() | |
+ { | |
+ final Castle castle = getCastle(); | |
+ | |
+ if (castle != null) | |
+ { | |
+ if (castle.getSiege().isInProgress() && isEnabled()) | |
+ { | |
+ castle.getZone().broadcastPacket(new OnEventTrigger(_eventId, true)); | |
+ } | |
+ else | |
+ { | |
+ castle.getZone().broadcastPacket(new OnEventTrigger(_eventId, false)); | |
+ // Keep task running? | |
+ // What when player returns to castle after task canceled? | |
+ // _broadcastTrapAnimation.cancel(true); | |
+ } | |
+ } | |
+ } | |
+ } | |
+ | |
public double getMoveBonus() | |
{ | |
return _move_bonus; | |
Index: java/com/l2jserver/gameserver/network/serverpackets/OnEventTrigger.java | |
=================================================================== | |
--- java/com/l2jserver/gameserver/network/serverpackets/OnEventTrigger.java (revision 6602) | |
+++ java/com/l2jserver/gameserver/network/serverpackets/OnEventTrigger.java (working copy) | |
@@ -34,6 +34,12 @@ | |
_enabled = enabled ? 1 : 0; | |
} | |
+ public OnEventTrigger(int emitterId, boolean enabled) | |
+ { | |
+ _emitterId = emitterId; | |
+ _enabled = enabled ? 1 : 0; | |
+ } | |
+ | |
@Override | |
protected final void writeImpl() | |
{ | |
Index: java/com/l2jserver/gameserver/model/zone/L2ZoneType.java | |
=================================================================== | |
--- java/com/l2jserver/gameserver/model/zone/L2ZoneType.java (revision 6602) | |
+++ java/com/l2jserver/gameserver/model/zone/L2ZoneType.java (working copy) | |
@@ -62,7 +62,7 @@ | |
private char _classType; | |
private InstanceType _target = InstanceType.L2Character; // default all chars | |
private boolean _allowStore; | |
- private boolean _enabled; | |
+ protected boolean _enabled; | |
private AbstractZoneSettings _settings; | |
protected L2ZoneType(int id) | |
#P L2J_DataPack_BETA | |
Index: dist/game/data/zones/castle_trap.xml | |
=================================================================== | |
--- dist/game/data/zones/castle_trap.xml (revision 10396) | |
+++ dist/game/data/zones/castle_trap.xml (working copy) | |
@@ -1,77 +1,25 @@ | |
<?xml version="1.0" encoding="UTF-8"?> | |
<list enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../xsd/zones.xsd"> | |
<!-- Castle Trap Zones --> | |
- <zone name="aden_slow_8" id="70001" type="SwampZone" shape="NPoly" minZ="-560" maxZ="-360"> <!-- [24_18] --> | |
+ <zone name="aden_slow_2" id="70001" type="SwampZone" shape="NPoly" minZ="-560" maxZ="-360"> <!-- [24_18] --> | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="5" /> | |
- <node X="149084" Y="7070" /> | |
- <node X="149349" Y="7069" /> | |
+ <stat name="eventId" val="2418002" /> | |
<node X="149349" Y="7203" /> | |
<node X="149084" Y="7204" /> | |
- </zone> | |
- <zone name="aden_slow_7" id="70002" type="SwampZone" shape="NPoly" minZ="-528" maxZ="-328"> <!-- [24_18] --> | |
- <stat name="default_enabled" val="false" /> | |
- <stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
- <stat name="castleId" val="5" /> | |
- <node X="149084" Y="6942" /> | |
- <node X="149349" Y="6941" /> | |
- <node X="149349" Y="7075" /> | |
- <node X="149084" Y="7076" /> | |
- </zone> | |
- <zone name="aden_slow_6" id="70003" type="SwampZone" shape="NPoly" minZ="-528" maxZ="-328"> <!-- [24_18] --> | |
- <stat name="default_enabled" val="false" /> | |
- <stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
- <stat name="castleId" val="5" /> | |
- <node X="149084" Y="6814" /> | |
- <node X="149349" Y="6813" /> | |
- <node X="149349" Y="6947" /> | |
- <node X="149084" Y="6948" /> | |
- </zone> | |
- <zone name="aden_slow_5" id="70004" type="SwampZone" shape="NPoly" minZ="-528" maxZ="-328"> <!-- [24_18] --> | |
- <stat name="default_enabled" val="false" /> | |
- <stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
- <stat name="castleId" val="5" /> | |
<node X="149084" Y="6686" /> | |
<node X="149349" Y="6685" /> | |
- <node X="149349" Y="6819" /> | |
- <node X="149084" Y="6820" /> | |
</zone> | |
- <zone name="aden_slow_4" id="70005" type="SwampZone" shape="NPoly" minZ="-528" maxZ="-328"> <!-- [24_18] --> | |
+ <zone name="aden_slow_1" id="70005" type="SwampZone" shape="NPoly" minZ="-528" maxZ="-328"> <!-- [24_18] --> | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="5" /> | |
- <node X="145548" Y="7054" /> | |
- <node X="145813" Y="7053" /> | |
+ <stat name="eventId" val="2418001" /> | |
<node X="145813" Y="7187" /> | |
<node X="145548" Y="7188" /> | |
- </zone> | |
- <zone name="aden_slow_3" id="70006" type="SwampZone" shape="NPoly" minZ="-496" maxZ="-296"> <!-- [24_18] --> | |
- <stat name="default_enabled" val="false" /> | |
- <stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
- <stat name="castleId" val="5" /> | |
- <node X="145548" Y="6926" /> | |
- <node X="145813" Y="6925" /> | |
- <node X="145813" Y="7059" /> | |
- <node X="145548" Y="7060" /> | |
- </zone> | |
- <zone name="aden_slow_2" id="70007" type="SwampZone" shape="NPoly" minZ="-496" maxZ="-296"> <!-- [24_18] --> | |
- <stat name="default_enabled" val="false" /> | |
- <stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
- <stat name="castleId" val="5" /> | |
- <node X="145548" Y="6798" /> | |
- <node X="145813" Y="6797" /> | |
- <node X="145813" Y="6931" /> | |
- <node X="145548" Y="6932" /> | |
- </zone> | |
- <zone name="aden_slow_1" id="70008" type="SwampZone" shape="NPoly" minZ="-496" maxZ="-296"> <!-- [24_18] --> | |
- <stat name="default_enabled" val="false" /> | |
- <stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
- <stat name="castleId" val="5" /> | |
<node X="145548" Y="6670" /> | |
<node X="145813" Y="6669" /> | |
- <node X="145813" Y="6803" /> | |
- <node X="145548" Y="6804" /> | |
</zone> | |
<zone name="aden_damage_8" id="70009" type="DamageZone" shape="NPoly" minZ="-560" maxZ="-360"> <!-- [24_18] --> | |
<stat name="default_enabled" val="false" /> | |
@@ -140,6 +88,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="1" /> | |
+ <stat name="eventId" val="1921001" /> | |
<node X="-18255" Y="110790" /> | |
<node X="-17971" Y="110790" /> | |
<node X="-17972" Y="111174" /> | |
@@ -149,6 +98,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="1" /> | |
+ <stat name="eventId" val="1921002" /> | |
<node X="-19213" Y="107137" /> | |
<node X="-18827" Y="107137" /> | |
<node X="-18827" Y="107404" /> | |
@@ -174,6 +124,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="2" /> | |
+ <stat name="eventId" val="2022001" /> | |
<node X="22215" Y="158960" /> | |
<node X="21931" Y="158960" /> | |
<node X="21932" Y="158576" /> | |
@@ -183,6 +134,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="2" /> | |
+ <stat name="eventId" val="2022002" /> | |
<node X="23173" Y="162613" /> | |
<node X="22787" Y="162613" /> | |
<node X="22787" Y="162346" /> | |
@@ -207,6 +159,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="3" /> | |
+ <stat name="eventId" val="2322001" /> | |
<node X="115132" Y="144954" /> | |
<node X="115132" Y="145238" /> | |
<node X="114748" Y="145237" /> | |
@@ -216,6 +169,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="3" /> | |
+ <stat name="eventId" val="2322002" /> | |
<node X="118785" Y="143996" /> | |
<node X="118785" Y="144382" /> | |
<node X="118518" Y="144382" /> | |
@@ -241,6 +195,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="4" /> | |
+ <stat name="eventId" val="2219001" /> | |
<node X="81208" Y="37049" /> | |
<node X="81208" Y="37333" /> | |
<node X="80824" Y="37332" /> | |
@@ -250,6 +205,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="4" /> | |
+ <stat name="eventId" val="2219002" /> | |
<node X="84861" Y="36091" /> | |
<node X="84861" Y="36477" /> | |
<node X="84594" Y="36477" /> | |
@@ -275,6 +231,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="6" /> | |
+ <stat name="eventId" val="2325001" /> | |
<node X="116166" Y="247739" /> | |
<node X="115882" Y="247739" /> | |
<node X="115883" Y="247355" /> | |
@@ -284,6 +241,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="6" /> | |
+ <stat name="eventId" val="2325002" /> | |
<node X="117124" Y="251392" /> | |
<node X="116738" Y="251392" /> | |
<node X="116738" Y="251125" /> | |
@@ -309,6 +267,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="7" /> | |
+ <stat name="eventId" val="2416001" /> | |
<node X="149235" Y="-47768" /> | |
<node X="149579" Y="-47608" /> | |
<node X="149515" Y="-47472" /> | |
@@ -318,6 +277,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="7" /> | |
+ <stat name="eventId" val="2416002" /> | |
<node X="145352" Y="-47607" /> | |
<node X="145696" Y="-47768" /> | |
<node X="145760" Y="-47633" /> | |
@@ -343,6 +303,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="8" /> | |
+ <stat name="eventId" val="2016002" /> | |
<node X="13785" Y="-47663" /> | |
<node X="14046" Y="-47854" /> | |
<node X="14203" Y="-47668" /> | |
@@ -352,6 +313,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="8" /> | |
+ <stat name="eventId" val="2016001" /> | |
<node X="13917" Y="-50851" /> | |
<node X="14209" Y="-50630" /> | |
<node X="14052" Y="-50447" /> | |
@@ -377,6 +339,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="9" /> | |
+ <stat name="eventId" val="2213002" /> | |
<node X="75440" Y="-151667" /> | |
<node X="75787" Y="-151830" /> | |
<node X="75849" Y="-151697" /> | |
@@ -386,6 +349,7 @@ | |
<stat name="default_enabled" val="false" /> | |
<stat name="move_bonus" val="0.2" /> <!-- -80% --> | |
<stat name="castleId" val="9" /> | |
+ <stat name="eventId" val="2213001" /> | |
<node X="79322" Y="-151831" /> | |
<node X="79668" Y="-151670" /> | |
<node X="79606" Y="-151535" /> | |
Index: dist/game/data/xsd/zones.xsd | |
=================================================================== | |
--- dist/game/data/xsd/zones.xsd (revision 10396) | |
+++ dist/game/data/xsd/zones.xsd (working copy) | |
@@ -21,6 +21,7 @@ | |
<xs:enumeration value="default_enabled" /> | |
<xs:enumeration value="domainId" /> | |
<xs:enumeration value="enterMsgId" /> | |
+ <xs:enumeration value="eventId" /> | |
<xs:enumeration value="fortId" /> | |
<xs:enumeration value="HpRegenBonus" /> | |
<xs:enumeration value="initialDelay" /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank but not work .