View difference between Paste ID: 16E4atVk and kK9NEAyP
SHOW: | | - or go back to the newest paste.
1
### Eclipse Workspace Patch 1.0
2
#P aCis_gameserver
3
diff --git config/players.properties config/players.properties
4
index c645204..829d205 100644
5
--- config/players.properties
6
+++ config/players.properties
7
@@ -257,4 +257,20 @@
8
 MaxBuffsAmount = 20
9
 
10
 # Store buffs/debuffs on user logout. Default: True
11
-StoreSkillCooltime = True
12
\ No newline at end of file
13
+StoreSkillCooltime = True
14
+
15
+
16
+#=============================================================
17
+#              SMS-DONATION-MANAGER
18
+#=============================================================
19
+SMSItemID = 9494
20
+SMSItemIdEnchantHeroW = 3470
21
+
22
+
23
+SMSEnchantWeapon = 30
24
+SMSEnchantHeroWeapon = 30
25
+SMSEnchantArmor = 30
26
+SMSEnchantWeaponCount = 10
27
+SMSEnchantArmorCount = 5
28
+SMSEnchantHeroWeaponCount = 10000
29
+
30
diff --git java/net/sf/l2j/Config.java java/net/sf/l2j/Config.java
31
index 5fb661c..82dbd87 100644
32
--- java/net/sf/l2j/Config.java
33
+++ java/net/sf/l2j/Config.java
34
@@ -336,6 +336,19 @@
35
 	public static boolean ALLOW_DELEVEL;
36
 	public static int DEATH_PENALTY_CHANCE;
37
 	
38
+	
39
+	public static int SMS_ITEMID;
40
+
41
+	public static int SMS_ENCHANTWEAPON;
42
+	public static int SMS_ENCHANTARMOR;
43
+	public static int SMS_ENCHANTHEROWEAPON;
44
+	public static int SMS_ITEMID_ENCHANT_HERO_WEAPON;
45
+	public static int SMS_HEROWEAPON_COUNT;
46
+	public static int SMS_ENCHANTWEAPONCOUNT;
47
+	public static int SMS_ENCHANTARMORCOUNT;
48
+	
49
+	
50
+	
51
 	/** Inventory & WH */
52
 	public static int INVENTORY_MAXIMUM_NO_DWARF;
53
 	public static int INVENTORY_MAXIMUM_DWARF;
54
@@ -955,6 +968,17 @@
55
 		ALLOW_DELEVEL = players.getProperty("AllowDelevel", true);
56
 		DEATH_PENALTY_CHANCE = players.getProperty("DeathPenaltyChance", 20);
57
 		
58
+		SMS_ITEMID = players.getProperty("SMSItemID", 9494);
59
+		SMS_ENCHANTWEAPON = players.getProperty("SMSEnchantWeapon", 35);
60
+		SMS_ENCHANTHEROWEAPON = players.getProperty("SMSEnchantHeroWeapon", 30);
61
+		SMS_ITEMID_ENCHANT_HERO_WEAPON = players.getProperty("SMSItemIdEnchantHeroW", 3470);
62
+		SMS_HEROWEAPON_COUNT = players.getProperty("SMSEnchantHeroWeaponCount", 10000);
63
+		SMS_ENCHANTARMOR = players.getProperty("SMSEnchantArmor", 25);
64
+		SMS_ENCHANTWEAPONCOUNT = players.getProperty("SMSEnchantWeaponCount", 10);
65
+		SMS_ENCHANTARMORCOUNT = players.getProperty("SMSEnchantArmorCount", 5);
66
+		
67
+		
68
+		
69
 		INVENTORY_MAXIMUM_NO_DWARF = players.getProperty("MaximumSlotsForNoDwarf", 80);
70
 		INVENTORY_MAXIMUM_DWARF = players.getProperty("MaximumSlotsForDwarf", 100);
71
 		INVENTORY_MAXIMUM_PET = players.getProperty("MaximumSlotsForPet", 12);
72
diff --git java/net/sf/l2j/gameserver/model/actor/instance/BrancaSMS.java java/net/sf/l2j/gameserver/model/actor/instance/BrancaSMS.java
73
new file mode 100644
74
index 0000000..d3fe262
75
--- /dev/null
76
+++ java/net/sf/l2j/gameserver/model/actor/instance/BrancaSMS.java
77
@@ -0,0 +1,399 @@
78
+/* This program is free software; you can redistribute it and/or modify
79
+ * it under the terms of the GNU General Public License as published by
80
+ * the Free Software Foundation; either version 2, or (at your option)
81
+ * any later version.
82
+ *
83
+ * This program is distributed in the hope that it will be useful,
84
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
85
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
86
+ * GNU General Public License for more details.
87
+ *
88
+ * You should have received a copy of the GNU General Public License
89
+ * along with this program; if not, write to the Free Software
90
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
91
+ * 02111-1307, USA.
92
+ *
93
+ * http://www.gnu.org/copyleft/gpl.html
94
+ */
95
+package net.sf.l2j.gameserver.model.actor.instance;
96
+
97
+import net.sf.l2j.Config;
98
+import net.sf.l2j.gameserver.data.cache.HtmCache;
99
+import net.sf.l2j.gameserver.enums.Paperdoll;
100
+import net.sf.l2j.gameserver.model.actor.Player;
101
+import net.sf.l2j.gameserver.model.actor.template.NpcTemplate;
102
+import net.sf.l2j.gameserver.model.item.instance.ItemInstance;
103
+import net.sf.l2j.gameserver.network.SystemMessageId;
104
+import net.sf.l2j.gameserver.network.serverpackets.ItemList;
105
+import net.sf.l2j.gameserver.network.serverpackets.NpcHtmlMessage;
106
+import net.sf.l2j.gameserver.network.serverpackets.SystemMessage;
107
+
108
+
109
+
110
+/**
111
+ * @author Terius
112
+ */
113
+public class BrancaSMS extends Merchant
114
+{
115
+	
116
+	private static int itemid = Config.SMS_ITEMID;
117
+	
118
+
119
+	
120
+	@Override
121
+	public void onBypassFeedback(Player player, String command)
122
+	{
123
+
124
+		switch (command)
125
+		{
126
+			case "rhand":
127
+				EnchantWeapon(player, 16, 8, Paperdoll.RHAND); // Pasar Paperdoll.RHAND como argumento
128
+				break;
129
+			case "lhand":
130
+				Enchant(player, 16, 8, Paperdoll.LHAND);
131
+				break;
132
+			case "rear":
133
+				Enchant(player, 16, 3, Paperdoll.REAR);
134
+				break;
135
+			case "lear":
136
+				Enchant(player, 16, 3, Paperdoll.LEAR);
137
+				break;
138
+			case "rf":
139
+				Enchant(player, 16, 3, Paperdoll.RFINGER);
140
+				break;
141
+			case "lf":
142
+				Enchant(player, 16, 3, Paperdoll.LFINGER);
143
+				break;
144
+			case "neck":
145
+				Enchant(player, 16, 3, Paperdoll.NECK);
146
+				break;
147
+			case "head":
148
+				Enchant(player, 16, 3, Paperdoll.HEAD);
149
+				break;
150
+			case "feet":
151
+				Enchant(player, 16, 3, Paperdoll.FEET);
152
+				break;
153
+			case "gloves":
154
+				Enchant(player, 16, 3, Paperdoll.GLOVES);
155
+				break;
156
+			case "chest":
157
+				Enchant(player, 16, 3, Paperdoll.CHEST);
158
+				break;
159
+			case "legs":
160
+				Enchant(player, 16, 3, Paperdoll.LEGS);
161
+				break;
162
+			case "enchant":
163
+				winds(player, 1);
164
+				break;
165
+			case "back":
166
+				winds(player, 2);
167
+				break;
168
+		}
169
+		
170
+
171
+	}
172
+	
173
+	@Override
174
+	public void onInteract(Player player)
175
+	{
176
+		showChatWindow(player);
177
+	}
178
+	
179
+	public BrancaSMS(int objectId, NpcTemplate template)
180
+	{
181
+		super(objectId, template);
182
+		
183
+
184
+	}
185
+	
186
+	@Override
187
+	public void showChatWindow(Player player)
188
+	{
189
+		
190
+		ItemInstance SMS = player.getInventory().getItemByItemId(Config.SMS_ITEMID);
191
+		final String Donator_Shop = "data/html/mods/SMS-DONATENPC/10.htm";
192
+		NpcHtmlMessage msg = new NpcHtmlMessage(this.getObjectId());
193
+		msg.setFile(Donator_Shop);
194
+		msg.replace("%objectId%", String.valueOf(this.getObjectId()));
195
+		msg.replace("%name%", player.getName());
196
+		if (player.getInventory().getItemByItemId(Config.SMS_ITEMID) == null)
197
+		{
198
+			msg.replace("%sms%", "0");
199
+		}
200
+		else
201
+		{
202
+			msg.replace("%sms%", SMS.getCount());
203
+		}
204
+		player.sendPacket(msg);
205
+		
206
+	}
207
+	
208
+
209
+	
210
+	public void Enchant(Player activeChar, int enchant, int amount, Paperdoll paperdoll) {
211
+	    ItemInstance item = activeChar.getInventory().getItemFrom(paperdoll);
212
+	    
213
+		if (activeChar.getInventory().getItemCount(itemid, 0) >= Config.SMS_ENCHANTARMORCOUNT)
214
+		{
215
+			if (item == null)
216
+			{
217
+				activeChar.sendMessage("No tienes este item en el inventario.");
218
+				winds(activeChar, 1);
219
+				return;
220
+			}
221
+			else if (item.getEnchantLevel() == Config.SMS_ENCHANTARMOR)
222
+			{
223
+				activeChar.sendMessage("Este item " + item.getItemName() + " ya esta a +30 o superior!");
224
+				winds(activeChar, 1);
225
+				return;
226
+			}
227
+
228
+			
229
+			if (item.isEquipped() && item.getEnchantLevel() < Config.SMS_ENCHANTARMOR)
230
+			{
231
+				item.setEnchantLevel(Config.SMS_ENCHANTARMOR);
232
+				item.updateDatabase();
233
+				activeChar.sendPacket(new ItemList(activeChar, false));
234
+				activeChar.broadcastUserInfo();
235
+				activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED).addNumber(item.getEnchantLevel()).addItemName(item.getItemId()));
236
+				activeChar.destroyItemByItemId("SMS Point", Config.SMS_ITEMID, Config.SMS_ENCHANTARMORCOUNT, null, true);
237
+				winds(activeChar, 1);
238
+			}
239
+			
240
+		}
241
+		else if (activeChar.getInventory().getItemCount(itemid, 0) < Config.SMS_ENCHANTARMORCOUNT)
242
+		{
243
+			winds(activeChar, 1);
244
+			activeChar.sendMessage("No tienes suficientes SMS POINTS.");
245
+		}
246
+		
247
+	}
248
+	
249
+	public void EnchantWeapon(Player activeChar, int enchant, int amount, Paperdoll paperdoll) {
250
+	    ItemInstance rhand = activeChar.getInventory().getItemFrom(paperdoll); // Usar el objeto Paperdoll pasado como argumento
251
+	   
252
+	
253
+
254
+		ItemInstance item = activeChar.getInventory().getItemFrom(paperdoll);
255
+		if (activeChar.getInventory().getItemCount(itemid, 0) >= Config.SMS_ENCHANTWEAPONCOUNT)
256
+		{
257
+			if (item == null)
258
+			{
259
+				activeChar.sendMessage("No tienes este item en el inventario.");
260
+				winds(activeChar, 1);
261
+				return;
262
+			}
263
+			else if (item.getEnchantLevel() == Config.SMS_ENCHANTWEAPON)
264
+			{
265
+				activeChar.sendMessage("Este item " + item.getItemName() + " ya esta a +30 o superior!");
266
+				winds(activeChar, 1);
267
+				return;
268
+			}
269
+			else if (item.getEnchantLevel() == Config.SMS_ENCHANTWEAPON)
270
+			{
271
+				activeChar.sendMessage("Este item " + item.getItemName() + " ya esta a +30!");
272
+				winds(activeChar, 1);
273
+				return;
274
+			}
275
+
276
+			else if (rhand != null && rhand.getItemId() >= 6611 && rhand.getItemId() <= 6621 && item.getEnchantLevel() < 30 && (activeChar.getInventory().getItemCount(3470, 0) >= Config.SMS_HEROWEAPON_COUNT))
277
+			{
278
+				if (item.isEquipped() && item.getEnchantLevel() < Config.SMS_ENCHANTHEROWEAPON && (activeChar.getInventory().getItemCount(3470, 0) >= Config.SMS_HEROWEAPON_COUNT))
279
+				{
280
+					item.setEnchantLevel(Config.SMS_ENCHANTHEROWEAPON);
281
+					item.updateDatabase();
282
+					activeChar.sendPacket(new ItemList(activeChar, false));
283
+					activeChar.broadcastUserInfo();
284
+					activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED).addNumber(item.getEnchantLevel()).addItemName(item.getItemId()));
285
+					activeChar.destroyItemByItemId("SMS Point", Config.SMS_ITEMID_ENCHANT_HERO_WEAPON, Config.SMS_HEROWEAPON_COUNT, null, true);
286
+					activeChar.sendMessage("Enhorabuena Has Encantado Tu Arma Hero a +30");
287
+					winds(activeChar, 1);
288
+				}
289
+				else
290
+				{
291
+					activeChar.sendMessage("Equipate el arma por favor");
292
+				}
293
+				
294
+			}
295
+			
296
+			if (item.isEquipped() && item.getEnchantLevel() < Config.SMS_ENCHANTWEAPON)
297
+			{
298
+				item.setEnchantLevel(Config.SMS_ENCHANTWEAPON);
299
+				item.updateDatabase();
300
+				activeChar.sendPacket(new ItemList(activeChar, false));
301
+				activeChar.broadcastUserInfo();
302
+				activeChar.sendPacket(SystemMessage.getSystemMessage(SystemMessageId.S1_S2_SUCCESSFULLY_ENCHANTED).addNumber(item.getEnchantLevel()).addItemName(item.getItemId()));
303
+				activeChar.destroyItemByItemId("SMS Point", Config.SMS_ITEMID, Config.SMS_ENCHANTWEAPONCOUNT, null, true);
304
+				winds(activeChar, 1);
305
+			}
306
+			
307
+		}
308
+		else if (activeChar.getInventory().getItemCount(itemid, 0) < Config.SMS_ENCHANTWEAPONCOUNT)
309
+		{
310
+			activeChar.sendMessage("No tienes suficientes SMS POINTS.");
311
+			winds(activeChar, 1);
312
+		}
313
+		
314
+	}
315
+	
316
+	private void winds(Player player, int count)
317
+	{
318
+		ItemInstance rhand = player.getInventory().getItemFrom(1);
319
+	
320
+		NpcHtmlMessage html = new NpcHtmlMessage(1);
321
+		switch (count)
322
+		{
323
+			case 1:
324
+				String htmContent = HtmCache.getInstance().getHtm("data/html/mods/SMS-DONATENPC/enchant.htm");
325
+				html.setHtml(htmContent);
326
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
327
+				html.replace("%charname%", player.getName());
328
+				player.sendPacket(html);
329
+				break;
330
+			case 2:
331
+				ItemInstance SMS = player.getInventory().getItemByItemId(Config.SMS_ITEMID);
332
+				String htmContent1 = HtmCache.getInstance().getHtm("data/html/mods/SMS-DONATENPC/10.htm");
333
+				html.setHtml(htmContent1);
334
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
335
+				html.replace("%name%", player.getName());
336
+				if (player.getInventory().getItemByItemId(Config.SMS_ITEMID) == null)
337
+				{
338
+					html.replace("%sms%", "0");
339
+				}
340
+				else
341
+				{
342
+					html.replace("%sms%", SMS.getCount());
343
+				}
344
+				player.sendPacket(html);
345
+				break;
346
+			case 3:
347
+				String htmContent2 = HtmCache.getInstance().getHtm("data/html/mods/donate/clan.htm");
348
+				html.setHtml(htmContent2);
349
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
350
+				html.replace("%charname%", player.getName());
351
+				player.sendPacket(html);
352
+				break;
353
+			case 4:
354
+				String htmContent3 = HtmCache.getInstance().getHtm("data/html/mods/donate/sex.htm");
355
+				html.setHtml(htmContent3);
356
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
357
+				html.replace("%charname%", player.getName());
358
+				player.sendPacket(html);
359
+				break;
360
+			case 5:
361
+				String htmContent4 = HtmCache.getInstance().getHtm("data/html/mods/donate/name.htm");
362
+				html.setHtml(htmContent4);
363
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
364
+				html.replace("%charname%", player.getName());
365
+				player.sendPacket(html);
366
+				break;
367
+			case 6:
368
+				String htmContent5 = HtmCache.getInstance().getHtm("data/html/mods/donate/hero.htm");
369
+				html.setHtml(htmContent5);
370
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
371
+				html.replace("%charname%", player.getName());
372
+				player.sendPacket(html);
373
+				break;
374
+			case 7:
375
+				String htmContent6 = HtmCache.getInstance().getHtm("data/html/mods/donate/enchant.htm");
376
+				html.setHtml(htmContent6);
377
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
378
+				html.replace("%charname%", player.getName());
379
+				player.sendPacket(html);
380
+				break;
381
+			case 8:
382
+				String htmContent8 = HtmCache.getInstance().getHtm("data/html/mods/donate/augment/active/page1.htm");
383
+				html.setHtml(htmContent8);
384
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
385
+				html.replace("%charname%", player.getName());
386
+				if (rhand != null && rhand.isAugmented() && rhand.getAugmentation() != null && rhand.getAugmentation().getSkill() != null && rhand.getAugmentation().getSkill().getLevel() >= 1)
387
+				{
388
+					html.replace("%level%", rhand.getAugmentation().getSkill().getLevel());
389
+				}
390
+				html.replace("%level%", "None");
391
+				player.sendPacket(html);
392
+				break;
393
+			case 9:
394
+				String htmContent9 = HtmCache.getInstance().getHtm("data/html/mods/donate/augment/active/page2.htm");
395
+				html.setHtml(htmContent9);
396
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
397
+				html.replace("%charname%", player.getName());
398
+				if (rhand != null && rhand.isAugmented() && rhand.getAugmentation() != null && rhand.getAugmentation().getSkill() != null && rhand.getAugmentation().getSkill().getLevel() >= 1)
399
+				{
400
+					html.replace("%level%", rhand.getAugmentation().getSkill().getLevel());
401
+				}
402
+				html.replace("%level%", "None");
403
+				player.sendPacket(html);
404
+				break;
405
+			case 10:
406
+				String htmContent10 = HtmCache.getInstance().getHtm("data/html/mods/donate/augment/active/page3.htm");
407
+				html.setHtml(htmContent10);
408
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
409
+				html.replace("%charname%", player.getName());
410
+				if (rhand != null && rhand.isAugmented() && rhand.getAugmentation() != null && rhand.getAugmentation().getSkill() != null && rhand.getAugmentation().getSkill().getLevel() >= 1)
411
+				{
412
+					html.replace("%level%", rhand.getAugmentation().getSkill().getLevel());
413
+				}
414
+				html.replace("%level%", "None");
415
+				player.sendPacket(html);
416
+				break;
417
+			case 11:
418
+				String htmContent11 = HtmCache.getInstance().getHtm("data/html/mods/donate/augment/active/page4.htm");
419
+				html.setHtml(htmContent11);
420
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
421
+				html.replace("%charname%", player.getName());
422
+				if (rhand != null && rhand.isAugmented() && rhand.getAugmentation() != null && rhand.getAugmentation().getSkill() != null && rhand.getAugmentation().getSkill().getLevel() >= 1)
423
+				{
424
+					html.replace("%level%", rhand.getAugmentation().getSkill().getLevel());
425
+				}
426
+				html.replace("%level%", "None");
427
+				player.sendPacket(html);
428
+				break;
429
+			case 12:
430
+				String htmContent12 = HtmCache.getInstance().getHtm("data/html/mods/donate/augment/active/page5.htm");
431
+				html.setHtml(htmContent12);
432
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
433
+				html.replace("%charname%", player.getName());
434
+				if (rhand != null && rhand.isAugmented() && rhand.getAugmentation() != null && rhand.getAugmentation().getSkill() != null && rhand.getAugmentation().getSkill().getLevel() >= 1)
435
+				{
436
+					html.replace("%level%", rhand.getAugmentation().getSkill().getLevel());
437
+				}
438
+				html.replace("%level%", "None");
439
+				player.sendPacket(html);
440
+				break;
441
+			case 13:
442
+				String htmContent13 = HtmCache.getInstance().getHtm("data/html/mods/donate/augment.htm");
443
+				html.setHtml(htmContent13);
444
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
445
+				html.replace("%charname%", player.getName());
446
+				player.sendPacket(html);
447
+				break;
448
+			case 14:
449
+				String htmContent14 = HtmCache.getInstance().getHtm("data/html/mods/donate/augment/passive/page1.htm");
450
+				html.setHtml(htmContent14);
451
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
452
+				html.replace("%charname%", player.getName());
453
+				if (rhand != null && rhand.isAugmented() && rhand.getAugmentation() != null && rhand.getAugmentation().getSkill() != null && rhand.getAugmentation().getSkill().getLevel() >= 1)
454
+				{
455
+					html.replace("%level%", rhand.getAugmentation().getSkill().getLevel());
456
+				}
457
+				html.replace("%level%", "None");
458
+				player.sendPacket(html);
459
+				break;
460
+			case 15:
461
+				String htmContent15 = HtmCache.getInstance().getHtm("data/html/mods/donate/augment/passive/page2.htm");
462
+				html.setHtml(htmContent15);
463
+				html.replace("%objectId%", String.valueOf(this.getObjectId()));
464
+				html.replace("%charname%", player.getName());
465
+				if (rhand != null && rhand.isAugmented() && rhand.getAugmentation() != null && rhand.getAugmentation().getSkill() != null && rhand.getAugmentation().getSkill().getLevel() >= 1)
466
+				{
467
+					html.replace("%level%", rhand.getAugmentation().getSkill().getLevel());
468
+				}
469
+				html.replace("%level%", "None");
470
+				player.sendPacket(html);
471
+				break;
472
+		}
473
+	}
474
+	
475
+
476
+}
477
\ No newline at end of file
478