View difference between Paste ID: x58BKdGk and gHvvQXme
SHOW: | | - or go back to the newest paste.
1
### Eclipse Workspace Patch 1.0
2
#P L2UFS
3
Index: dist/config/players.properties
4
===================================================================
5
--- dist/config/players.properties	(revision 174)
6
+++ dist/config/players.properties	(working copy)
7
@@ -75,6 +75,22 @@
8
 # Default : False
9
 AnnounceKillPLayers = true
10
 
11
+#==================================================
12
+#              L2ChaoticZone
13
+#==================================================
14
+# If set to false, zone will be no-restart zone
15
+NoRestartZone = True
16
+# If set to false, zone will be no-logout zone
17
+NoLogoutZone = True
18
+# If set to false, zone will be no-store zone
19
+NoStoreZone = True
20
+# Give noblesse after revive?
21
+ReviveNoblesse = True
22
+# Heal after revive?
23
+ReviveHeal = True
24
+# If set to true, players will take noblesse blessing when entering
25
+GiveNoblesse = True
26
+
27
 #=============================================================
28
 #                           Misc
29
 #=============================================================
30
Index: java/net/sf/l2j/gameserver/network/serverpackets/ExSetCompassZoneCode.java
31
===================================================================
32
--- java/net/sf/l2j/gameserver/network/serverpackets/ExSetCompassZoneCode.java	(revision 173)
33
+++ java/net/sf/l2j/gameserver/network/serverpackets/ExSetCompassZoneCode.java	(working copy)
34
@@ -20,12 +20,13 @@
35
  */
36
 public class ExSetCompassZoneCode extends L2GameServerPacket
37
 {
38
-	public static final int SIEGEWARZONE1 = 0x0A;
39
-	public static final int SIEGEWARZONE2 = 0x0B;
40
-	public static final int PEACEZONE = 0x0C;
41
-	public static final int SEVENSIGNSZONE = 0x0D;
42
-	public static final int PVPZONE = 0x0E;
43
-	public static final int GENERALZONE = 0x0F;
44
+	public static final int SIEGEWARZONE1 = 10;
45
+	public static final int SIEGEWARZONE2 = 11;
46
+	public static final int PEACEZONE = 12;
47
+	public static final int SEVENSIGNSZONE = 13;
48
+	public static final int PVPZONE = 14;
49
+	public static final int GENERALZONE = 15;
50
+	public static final int CHAOTIC = 16;
51
 	
52
 	private final int _zoneType;
53
 	
54
@@ -37,8 +38,8 @@
55
 	@Override
56
 	protected void writeImpl()
57
 	{
58
-		writeC(0xFE);
59
-		writeH(0x32);
60
+		writeC(254);
61
+		writeH(50);
62
 		writeD(_zoneType);
63
 	}
64
 }
65
\ No newline at end of file
66
Index: java/net/sf/l2j/gameserver/model/actor/L2Character.java
67
===================================================================
68
--- java/net/sf/l2j/gameserver/model/actor/L2Character.java	(revision 173)
69
+++ java/net/sf/l2j/gameserver/model/actor/L2Character.java	(working copy)
70
@@ -1587,8 +1587,17 @@
71
 		
72
 		setIsDead(false);
73
 		
74
+	    if (isInsideZone(ZoneId.CHAOTIC))
75
+	    {
76
+	      _status.setCurrentCp(getMaxCp());
77
+	      _status.setCurrentHp(getMaxHp());
78
+	      _status.setCurrentMp(getMaxMp());
79
+	    }
80
+	    else 
81
+	    {
82
 		_status.setCurrentHp(getMaxHp() * Config.RESPAWN_RESTORE_HP);
83
-		
84
+	    }
85
+	    
86
 		// Start broadcast status
87
 		broadcastPacket(new Revive(this));
88
 		
89
Index: java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java
90
===================================================================
91
--- java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java	(revision 173)
92
+++ java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListSell.java	(working copy)
93
@@ -84,6 +84,15 @@
94
 			return;
95
 		}
96
 		
97
+		if (Config.NOSTORE_ZONE)
98
+		{
99
+			if (player.isInsideZone(ZoneId.CHAOTIC))
100
+			{
101
+				player.sendMessage("You cannot craft while inside Chaotic zone.");
102
+				return;
103
+			}
104
+		}
105
+		
106
 		if (player.isInsideZone(ZoneId.NO_STORE))
107
 		{
108
 			player.sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE);
109
Index: java/net/sf/l2j/gameserver/model/zone/type/L2ChaoticZone.java
110
===================================================================
111
--- java/net/sf/l2j/gameserver/model/zone/type/L2ChaoticZone.java	(nonexistent)
112
+++ java/net/sf/l2j/gameserver/model/zone/type/L2ChaoticZone.java	(working copy)
113
@@ -0,0 +1,88 @@
114
+package net.sf.l2j.gameserver.model.zone.type;
115
+
116
+import net.sf.l2j.Config;
117
+import net.sf.l2j.gameserver.datatables.SkillTable;
118
+import net.sf.l2j.gameserver.model.L2Skill;
119
+import net.sf.l2j.gameserver.model.actor.L2Character;
120
+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
121
+import net.sf.l2j.gameserver.model.zone.L2SpawnZone;
122
+import net.sf.l2j.gameserver.model.zone.ZoneId;
123
+import net.sf.l2j.gameserver.network.serverpackets.ExShowScreenMessage;
124
+
125
+/**
126
+ * by : Wallister
127
+ */
128
+
129
+public class L2ChaoticZone extends L2SpawnZone
130
+{
131
+	private static final boolean give_noblesse = Config.GIVE_NOBLESSE;
132
+	private static final boolean revive_noblesse = Config.REVIVE_NOBLESSE;
133
+	private static final boolean revive_heal = Config.REVIVE_HEAL;
134
+	
135
+	public L2ChaoticZone(int id)
136
+	{
137
+		super(id);
138
+	}
139
+	
140
+	L2Skill noblesse = SkillTable.getInstance().getInfo(1323, 1);
141
+	
142
+	@Override
143
+	protected void onEnter(L2Character character)
144
+	{
145
+		character.setInsideZone(ZoneId.CHAOTIC, true);
146
+		character.setInsideZone(ZoneId.DANGER_AREA, true);
147
+		
148
+		if ((character instanceof L2PcInstance))
149
+		{
150
+			if (((L2PcInstance) character).getPvpFlag() == 0)
151
+				((L2PcInstance) character).updatePvPFlag(1);
152
+			
153
+			L2PcInstance activeChar = ((L2PcInstance) character);
154
+			if (give_noblesse)
155
+				noblesse.getEffects(activeChar, activeChar);
156
+			
157
+			((L2PcInstance) character).sendPacket(new ExShowScreenMessage("You entered a Chaotic Zone", 10000));
158
+			((L2PcInstance) character).sendMessage("You entered a Chaotic Zone");
159
+		}
160
+	}
161
+	
162
+	@Override
163
+	protected void onExit(L2Character character)
164
+	{
165
+		character.setInsideZone(ZoneId.CHAOTIC, false);
166
+		character.setInsideZone(ZoneId.DANGER_AREA, false);
167
+		
168
+		if ((character instanceof L2PcInstance))
169
+		{
170
+			if (((L2PcInstance) character).getPvpFlag() == 1)
171
+				((L2PcInstance) character).updatePvPFlag(0);
172
+			((L2PcInstance) character).sendPacket(new ExShowScreenMessage("You left a Chaotic Zone", 10000));
173
+			((L2PcInstance) character).sendMessage("You left a Chaotic Zone");
174
+		}
175
+	}
176
+	
177
+	@Override
178
+	public void onDieInside(L2Character character)
179
+	{
180
+	}
181
+	
182
+	@Override
183
+	public void onReviveInside(L2Character character)
184
+	{
185
+		if (character instanceof L2PcInstance)
186
+		{
187
+			L2PcInstance activeChar = ((L2PcInstance) character);
188
+			if (revive_noblesse)
189
+				noblesse.getEffects(activeChar, activeChar);
190
+			if (revive_heal)
191
+				heal(activeChar);
192
+		}
193
+	}
194
+	
195
+	static void heal(L2PcInstance activeChar)
196
+	{
197
+		activeChar.setCurrentHp(activeChar.getMaxHp());
198
+		activeChar.setCurrentCp(activeChar.getMaxCp());
199
+		activeChar.setCurrentMp(activeChar.getMaxMp());
200
+	}
201
+}
202
Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java
203
===================================================================
204
--- java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java	(revision 173)
205
+++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRestart.java	(working copy)
206
@@ -14,6 +14,7 @@
207
  */
208
 package net.sf.l2j.gameserver.network.clientpackets;
209
 
210
+import net.sf.l2j.Config;
211
 import net.sf.l2j.gameserver.instancemanager.SevenSignsFestival;
212
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
213
 import net.sf.l2j.gameserver.model.zone.ZoneId;
214
@@ -47,7 +48,15 @@
215
 			sendPacket(RestartResponse.valueOf(false));
216
 			return;
217
 		}
218
-		
219
+		if (Config.NORESTART_ZONE)
220
+		{
221
+			if (player.isInsideZone(ZoneId.CHAOTIC))
222
+			{
223
+				player.sendMessage("You cannot restart while inside a Chaotic zone.");
224
+				sendPacket(RestartResponse.valueOf(false));
225
+				return;
226
+			}
227
+		}
228
 		if (player.isInsideZone(ZoneId.NO_RESTART))
229
 		{
230
 			player.sendPacket(SystemMessageId.NO_RESTART_HERE);
231
@@ -64,7 +73,7 @@
232
 				return;
233
 			}
234
 			
235
-			if(NexusEvents.isInEvent(player))
236
+			if (NexusEvents.isInEvent(player))
237
 			{
238
 				player.sendMessage("A superior power doesn't allow you to leave the event");
239
 				player.sendPacket(ActionFailed.STATIC_PACKET);
240
Index: java/net/sf/l2j/Config.java
241
===================================================================
242
--- java/net/sf/l2j/Config.java	(revision 175)
243
+++ java/net/sf/l2j/Config.java	(working copy)
244
@@ -419,6 +419,12 @@
245
 	public static boolean ENABLE_MODIFY_SKILL_DURATION;
246
 	public static Map<Integer, Integer> SKILL_DURATION_LIST;
247
 	public static boolean ANNOUNCE_KILL;
248
+	public static boolean NORESTART_ZONE;
249
+	public static boolean NOSTORE_ZONE;
250
+	public static boolean NOLOGOUT_ZONE;
251
+	public static boolean GIVE_NOBLESSE;
252
+	public static boolean REVIVE_NOBLESSE;
253
+	public static boolean REVIVE_HEAL;
254
 	public static boolean EFFECT_CANCELING;
255
 	public static double HP_REGEN_MULTIPLIER;
256
 	public static double MP_REGEN_MULTIPLIER;
257
@@ -1211,6 +1217,12 @@
258
 			}
259
 		}
260
 		ANNOUNCE_KILL = players.getProperty("AnnounceKillPLayers", false);
261
+		NORESTART_ZONE = players.getProperty("NoRestartZone", false);
262
+		NOSTORE_ZONE = players.getProperty("NoStoreZone", false);
263
+		NOLOGOUT_ZONE = players.getProperty("NoLogoutZone", false);
264
+		GIVE_NOBLESSE = players.getProperty("GiveNoblesse", false);
265
+		REVIVE_NOBLESSE = players.getProperty("ReviveNoblesse", false);
266
+		REVIVE_HEAL = players.getProperty("ReviveHeal", false);
267
 		
268
 		EFFECT_CANCELING = players.getProperty("CancelLesserEffect", true);
269
 		HP_REGEN_MULTIPLIER = players.getProperty("HpRegenMultiplier", 1.);
270
Index: java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java
271
===================================================================
272
--- java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java	(revision 173)
273
+++ java/net/sf/l2j/gameserver/network/clientpackets/SetPrivateStoreListBuy.java	(working copy)
274
@@ -83,6 +83,15 @@
275
 			return;
276
 		}
277
 		
278
+		if (Config.NOSTORE_ZONE)
279
+		{
280
+			if (player.isInsideZone(ZoneId.CHAOTIC))
281
+			{
282
+				player.sendMessage("You cannot craft while inside Chaotic zone.");
283
+				return;
284
+			}
285
+		}
286
+		
287
 		if (player.isInsideZone(ZoneId.NO_STORE))
288
 		{
289
 			player.sendPacket(SystemMessageId.NO_PRIVATE_STORE_HERE);
290
Index: java/net/sf/l2j/gameserver/network/clientpackets/Logout.java
291
===================================================================
292
--- java/net/sf/l2j/gameserver/network/clientpackets/Logout.java	(revision 173)
293
+++ java/net/sf/l2j/gameserver/network/clientpackets/Logout.java	(working copy)
294
@@ -14,6 +14,7 @@
295
  */
296
 package net.sf.l2j.gameserver.network.clientpackets;
297
 
298
+import net.sf.l2j.Config;
299
 import net.sf.l2j.gameserver.instancemanager.SevenSignsFestival;
300
 import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;
301
 import net.sf.l2j.gameserver.model.zone.ZoneId;
302
@@ -51,6 +52,15 @@
303
 			return;
304
 		}
305
 		
306
+		if (Config.NOLOGOUT_ZONE)
307
+		{
308
+			if (player.isInsideZone(ZoneId.CHAOTIC))
309
+			{
310
+				player.sendMessage("You cannot logout while inside a Chaotic zone.");
311
+				player.sendPacket(ActionFailed.STATIC_PACKET);
312
+				return;
313
+			}
314
+		}
315
 		if (!player.isGM())
316
 		{
317
 			if (AttackStanceTaskManager.getInstance().isInAttackStance(player))
318
@@ -67,7 +77,7 @@
319
 				return;
320
 			}
321
 			
322
-			if(NexusEvents.isInEvent(player))
323
+			if (NexusEvents.isInEvent(player))
324
 			{
325
 				player.sendMessage("A superior power doesn't allow you to leave the event");
326
 				sendPacket(ActionFailed.STATIC_PACKET);
327
Index: java/net/sf/l2j/gameserver/model/zone/ZoneId.java
328
===================================================================
329
--- java/net/sf/l2j/gameserver/model/zone/ZoneId.java	(revision 173)
330
+++ java/net/sf/l2j/gameserver/model/zone/ZoneId.java	(working copy)
331
@@ -38,7 +38,8 @@
332
 	DANGER_AREA(15),
333
 	CAST_ON_ARTIFACT(16),
334
 	NO_RESTART(17),
335
-	SCRIPT(18);
336
+	SCRIPT(18),
337
+	CHAOTIC(19);
338
 	
339
 	private final int _id;
340
 	
341
Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java
342
===================================================================
343
--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(revision 174)
344
+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java	(working copy)
345
@@ -1285,6 +1285,14 @@
346
 			_lastCompassZone = ExSetCompassZoneCode.PEACEZONE;
347
 			sendPacket(new ExSetCompassZoneCode(ExSetCompassZoneCode.PEACEZONE));
348
 		}
349
+		else if (isInsideZone(ZoneId.CHAOTIC))
350
+		{
351
+			if (_lastCompassZone == ExSetCompassZoneCode.CHAOTIC)
352
+				return;
353
+			
354
+			_lastCompassZone = ExSetCompassZoneCode.CHAOTIC;
355
+			sendPacket(new ExSetCompassZoneCode(ExSetCompassZoneCode.CHAOTIC));
356
+		}
357
 		else
358
 		{
359
 			if (_lastCompassZone == ExSetCompassZoneCode.GENERALZONE)
360
@@ -3975,7 +3983,7 @@
361
 					}
362
 					
363
 					// Reduce player's xp and karma.
364
-					if (Config.ALT_GAME_DELEVEL && (getSkillLevel(L2Skill.SKILL_LUCKY) < 0 || getStat().getLevel() > 9))
365
+					if (Config.ALT_GAME_DELEVEL && (!isInsideZone(ZoneId.CHAOTIC)) && (getSkillLevel(L2Skill.SKILL_LUCKY) < 0 || getStat().getLevel() > 9))
366
 						deathPenalty(pk != null && getClan() != null && pk.getClan() != null && (getClan().isAtWarWith(pk.getClanId()) || pk.getClan().isAtWarWith(getClanId())), pk != null, killer instanceof L2SiegeGuardInstance);
367
 				}
368
 			}
369
@@ -4026,7 +4034,7 @@
370
 		if (getKarma() <= 0 && pk != null && pk.getClan() != null && getClan() != null && pk.getClan().isAtWarWith(getClanId()))
371
 			return;
372
 		
373
-		if ((!isInsideZone(ZoneId.PVP) || pk == null) && (!isGM() || Config.KARMA_DROP_GM))
374
+		if ((!isInsideZone(ZoneId.CHAOTIC)) && (!isInsideZone(ZoneId.PVP) || pk == null) && (!isGM() || Config.KARMA_DROP_GM))
375
 		{
376
 			boolean isKillerNpc = (killer instanceof L2Npc);
377
 			int pkLimit = Config.KARMA_PK_LIMIT;
378
@@ -4231,6 +4239,9 @@
379
 		if (isInsideZone(ZoneId.PVP))
380
 			return;
381
 		
382
+		if (isInsideZone(ZoneId.CHAOTIC))
383
+			return;
384
+		
385
 		PvpFlagTaskManager.getInstance().add(this, Config.PVP_NORMAL_TIME);
386
 		
387
 		if (getPvpFlag() == 0)
388
@@ -4246,7 +4257,7 @@
389
 		if (isInDuel() && player.getDuelId() == getDuelId())
390
 			return;
391
 		
392
-		if ((!isInsideZone(ZoneId.PVP) || !target.isInsideZone(ZoneId.PVP)) && player.getKarma() == 0)
393
+		if ((!isInsideZone(ZoneId.PVP) || !target.isInsideZone(ZoneId.PVP)) && (!isInsideZone(ZoneId.CHAOTIC) || !target.isInsideZone(ZoneId.CHAOTIC)) && player.getKarma() == 0)
394
 		{
395
 			PvpFlagTaskManager.getInstance().add(this, checkIfPvP(player) ? Config.PVP_PVP_TIME : Config.PVP_NORMAL_TIME);
396
 			
397
@@ -6633,6 +6644,9 @@
398
 			if (getClan() != null && getClan().isMember(cha.getObjectId()))
399
 				return false;
400
 			
401
+			if ((isInsideZone(ZoneId.CHAOTIC)) && (((L2PcInstance) attacker).isInsideZone(ZoneId.CHAOTIC)))
402
+				return true;
403
+			
404
 			// Now check again if the L2PcInstance is in pvp zone (as arenas check was made before, it ends with sieges).
405
 			if (isInsideZone(ZoneId.PVP) && attacker.isInsideZone(ZoneId.PVP))
406
 				return true;
407
@@ -9936,7 +9950,7 @@
408
 		if (_deathPenaltyBuffLevel >= 15) // maximum level reached
409
 			return;
410
 		
411
-		if ((getKarma() > 0 || Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof L2PcInstance) && !isGM() && !(getCharmOfLuck() && (killer == null || killer.isRaid())) && !isPhoenixBlessed() && !(isInsideZone(ZoneId.PVP) || isInsideZone(ZoneId.SIEGE)))
412
+		if ((getKarma() > 0 || Rnd.get(1, 100) <= Config.DEATH_PENALTY_CHANCE) && !(killer instanceof L2PcInstance) && !isGM() && !(getCharmOfLuck() && (killer == null || killer.isRaid())) && !isPhoenixBlessed() && !(isInsideZone(ZoneId.PVP) && (!isInsideZone(ZoneId.CHAOTIC)) || isInsideZone(ZoneId.SIEGE)))
413
 		{
414
 			if (_deathPenaltyBuffLevel != 0)
415
 			{
416
Index: java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopListSet.java
417
===================================================================
418
--- java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopListSet.java	(revision 173)
419
+++ java/net/sf/l2j/gameserver/network/clientpackets/RequestRecipeShopListSet.java	(working copy)
420
@@ -69,6 +69,14 @@
421
 			return;
422
 		}
423
 		
424
+		if (Config.NOSTORE_ZONE)
425
+		{
426
+			if (player.isInsideZone(ZoneId.CHAOTIC))
427
+			{
428
+				player.sendMessage("You cannot craft while inside Chaotic zone.");
429
+				return;
430
+			}
431
+		}
432
 		if (_count == 0)
433
 			player.forceStandUp();
434
 		else