diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/buffer_schemes.sql b/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/buffer_schemes.sql
new file mode 100644
index 0000000000..ecc7cb6ed7
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/buffer_schemes.sql
@@ -0,0 +1,5 @@
+CREATE TABLE IF NOT EXISTS `buffer_schemes` (
+ `object_id` INT UNSIGNED NOT NULL DEFAULT '0',
+ `scheme_name` VARCHAR(16) NOT NULL DEFAULT 'default',
+ `skills` VARCHAR(200) NOT NULL
+);
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/custom_npc_buffer.sql b/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/custom_npc_buffer.sql
deleted file mode 100644
index ae988339ee..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/custom_npc_buffer.sql
+++ /dev/null
@@ -1,65 +0,0 @@
-CREATE TABLE IF NOT EXISTS `custom_npc_buffer` (
- `npc_id` mediumint(7) NOT NULL,
- `skill_id` int(6) NOT NULL,
- `skill_level` int(6) NOT NULL DEFAULT '1',
- `skill_fee_id` int(6) NOT NULL DEFAULT '0',
- `skill_fee_amount` int(6) NOT NULL DEFAULT '0',
- `buff_group` int(6) NOT NULL DEFAULT '0',
- PRIMARY KEY (`npc_id`,`skill_id`,`buff_group`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-
-INSERT IGNORE INTO `custom_npc_buffer` VALUES
-(1000003,264,1,57,100,264),
-(1000003,265,1,57,100,265),
-(1000003,266,1,57,100,266),
-(1000003,267,1,57,100,267),
-(1000003,268,1,57,100,268),
-(1000003,269,1,57,100,269),
-(1000003,270,1,57,100,270),
-(1000003,271,1,57,100,271),
-(1000003,272,1,57,100,272),
-(1000003,273,1,57,100,273),
-(1000003,274,1,57,100,274),
-(1000003,275,1,57,100,275),
-(1000003,276,1,57,100,276),
-(1000003,277,1,57,100,277),
-(1000003,304,1,57,100,304),
-(1000003,305,1,57,100,305),
-(1000003,306,1,57,100,306),
-(1000003,307,1,57,100,307),
-(1000003,308,1,57,100,308),
-(1000003,309,1,57,100,309),
-(1000003,310,1,57,100,310),
-(1000003,311,1,57,100,311),
-(1000003,349,1,57,100,349),
-(1000003,363,1,57,100,363),
-(1000003,364,1,57,100,364),
-(1000003,366,1,57,100,366),
-(1000003,367,1,57,100,367),
-(1000003,529,1,57,100,529),
-(1000003,530,1,57,100,530),
-(1000003,1032,1,57,100,1032),
-(1000003,1033,1,57,100,1033),
-(1000003,1035,1,57,100,1035),
-(1000003,1036,1,57,100,1036),
-(1000003,1040,1,57,100,1040),
-(1000003,1043,1,57,100,1043),
-(1000003,1044,1,57,100,1044),
-(1000003,1045,1,57,100,1045),
-(1000003,1048,1,57,100,1048),
-(1000003,1059,1,57,100,1059),
-(1000003,1062,1,57,100,1062),
-(1000003,1068,1,57,100,1068),
-(1000003,1077,1,57,100,1077),
-(1000003,1078,1,57,100,1078),
-(1000003,1085,1,57,100,1085),
-(1000003,1086,1,57,100,1086),
-(1000003,1182,1,57,100,1182),
-(1000003,1189,1,57,100,1189),
-(1000003,1191,1,57,100,1191),
-(1000003,1204,1,57,100,1204),
-(1000003,1240,1,57,100,1240),
-(1000003,1242,1,57,100,1242),
-(1000003,1243,1,57,100,1243),
-(1000003,1303,1,57,100,1303),
-(1000003,1397,1,57,100,1397);
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/npc_buffer.sql b/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/npc_buffer.sql
deleted file mode 100644
index 442e4e32e7..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/npc_buffer.sql
+++ /dev/null
@@ -1,22 +0,0 @@
-DROP TABLE IF EXISTS `npc_buffer`;
-CREATE TABLE `npc_buffer` (
- `npc_id` int(6) NOT NULL,
- `skill_id` int(6) NOT NULL,
- `skill_level` int(6) NOT NULL DEFAULT '1',
- `skill_fee_id` int(6) NOT NULL DEFAULT '0',
- `skill_fee_amount` int(6) NOT NULL DEFAULT '0',
- `buff_group` int(6) NOT NULL DEFAULT '0',
- PRIMARY KEY (`npc_id`,`skill_id`,`buff_group`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-
-INSERT INTO `npc_buffer` VALUES
-(36402,4356,3,0,0,4356),
-(36402,4352,2,0,0,4352),
-(36402,4345,3,0,0,4345),
-(36402,4359,3,0,0,4359),
-(36402,4351,6,0,0,4351),
-(36402,4355,3,0,0,4355),
-(36402,4357,2,0,0,4357),
-(36402,4342,2,0,0,4342),
-(36402,4358,3,0,0,4358),
-(36402,4360,3,0,0,4360);
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/scheme_npcbuffer.sql b/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/scheme_npcbuffer.sql
deleted file mode 100644
index 64f9f23446..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/dist/db_installer/sql/game/scheme_npcbuffer.sql
+++ /dev/null
@@ -1,178 +0,0 @@
-DROP TABLE IF EXISTS `npcbuffer_buff_list`;
-DROP TABLE IF EXISTS `npcbuffer_scheme_contents`;
-DROP TABLE IF EXISTS `npcbuffer_scheme_list`;
-
-CREATE TABLE `npcbuffer_buff_list` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `buff_class` int(2) DEFAULT NULL,
- `buffType` varchar(10) DEFAULT NULL,
- `buffId` int(5) DEFAULT '0',
- `buffLevel` int(5) DEFAULT NULL,
- `forClass` tinyint(1) DEFAULT NULL,
- `canUse` tinyint(1) DEFAULT NULL,
- PRIMARY KEY (`id`)
-) AUTO_INCREMENT=136;
-CREATE TABLE `npcbuffer_scheme_contents` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `scheme_id` int(11) DEFAULT NULL,
- `skill_id` int(8) DEFAULT NULL,
- `skill_level` int(4) DEFAULT NULL,
- `buff_class` int(2) DEFAULT NULL,
- PRIMARY KEY (`id`)
-) AUTO_INCREMENT=30;
-CREATE TABLE `npcbuffer_scheme_list` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `player_id` varchar(40) DEFAULT NULL,
- `scheme_name` varchar(36) DEFAULT NULL,
- `mod_accepted` tinyint(1) DEFAULT NULL,
- PRIMARY KEY (`id`)
-) AUTO_INCREMENT=7;
-
-INSERT INTO `npcbuffer_buff_list` VALUES ('1', '0', 'buff', '1036', '2', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('2', '0', 'buff', '1040', '3', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('3', '0', 'buff', '1043', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('4', '0', 'buff', '1044', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('5', '0', 'buff', '1045', '6', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('6', '0', 'buff', '1047', '4', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('7', '0', 'buff', '1048', '6', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('8', '0', 'buff', '1059', '3', '1', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('9', '0', 'buff', '1068', '3', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('10', '0', 'buff', '1077', '3', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('11', '0', 'buff', '1085', '3', '1', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('12', '0', 'buff', '1086', '2', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('13', '0', 'buff', '1087', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('14', '0', 'buff', '1204', '2', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('15', '0', 'buff', '1240', '3', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('16', '0', 'buff', '1242', '3', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('17', '0', 'buff', '1243', '6', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('18', '0', 'buff', '1257', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('19', '0', 'buff', '1268', '4', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('20', '0', 'buff', '1303', '2', '1', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('21', '0', 'buff', '1304', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('22', '0', 'buff', '1307', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('23', '0', 'buff', '1311', '6', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('24', '0', 'buff', '1397', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('25', '0', 'buff', '1460', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('26', '0', 'buff', '1232', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('27', '0', 'buff', '1238', '3', '3', '0');
-INSERT INTO `npcbuffer_buff_list` VALUES ('28', '0', 'special', '1323', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('29', '0', 'special', '1388', '3', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('30', '0', 'special', '1389', '3', '1', '1');
-
-INSERT INTO `npcbuffer_buff_list` VALUES ('31', '1', 'song', '264', '1', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('32', '1', 'song', '265', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('33', '1', 'song', '266', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('34', '1', 'song', '267', '1', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('35', '1', 'song', '268', '1', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('36', '1', 'song', '269', '1', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('37', '1', 'song', '270', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('38', '1', 'song', '304', '1', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('39', '1', 'song', '305', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('40', '1', 'song', '306', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('41', '1', 'song', '308', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('42', '1', 'song', '349', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('43', '1', 'song', '363', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('44', '1', 'song', '364', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('45', '1', 'song', '529', '1', '3', '1');
-
-INSERT INTO `npcbuffer_buff_list` VALUES ('48', '2', 'dance', '271', '1', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('49', '2', 'dance', '272', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('50', '2', 'dance', '273', '1', '1', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('51', '2', 'dance', '274', '1', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('52', '2', 'dance', '275', '1', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('53', '2', 'dance', '276', '1', '1', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('54', '2', 'dance', '277', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('55', '2', 'dance', '307', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('56', '2', 'dance', '309', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('57', '2', 'dance', '310', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('58', '2', 'dance', '311', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('59', '2', 'dance', '365', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('60', '2', 'dance', '366', '1', '3', '0');
-INSERT INTO `npcbuffer_buff_list` VALUES ('61', '2', 'dance', '530', '1', '3', '1');
-
-INSERT INTO `npcbuffer_buff_list` VALUES ('64', '3', 'resist', '1461', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('65', '3', 'chant', '1002', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('66', '3', 'chant', '1006', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('67', '3', 'chant', '1007', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('68', '3', 'chant', '1009', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('69', '3', 'chant', '1251', '2', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('70', '3', 'chant', '1252', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('71', '3', 'chant', '1253', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('72', '3', 'chant', '1284', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('73', '3', 'chant', '1308', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('74', '3', 'chant', '1309', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('75', '3', 'chant', '1310', '4', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('76', '3', 'chant', '1362', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('77', '3', 'special', '1499', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('78', '3', 'special', '1500', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('79', '3', 'special', '1501', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('80', '3', 'special', '1502', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('81', '3', 'special', '1503', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('82', '3', 'special', '1504', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('83', '3', 'special', '1519', '1', '3', '1');
-
-INSERT INTO `npcbuffer_buff_list` VALUES ('84', '4', 'others', '825', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('85', '4', 'others', '826', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('86', '4', 'others', '827', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('87', '4', 'others', '828', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('88', '4', 'others', '829', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('89', '4', 'others', '830', '1', '3', '1');
-
-INSERT INTO `npcbuffer_buff_list` VALUES ('90', '5', 'others', '834', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('91', '5', 'others', '1442', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('92', '5', 'others', '1443', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('93', '5', 'others', '1444', '1', '3', '1');
-
-INSERT INTO `npcbuffer_buff_list` VALUES ('94', '6', 'cubic', '67', '7', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('95', '6', 'cubic', '10', '8', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('96', '6', 'cubic', '22', '7', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('97', '6', 'cubic', '33', '8', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('98', '6', 'cubic', '278', '6', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('99', '6', 'cubic', '449', '4', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('100', '6', 'cubic', '1279', '9', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('101', '6', 'cubic', '1280', '9', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('102', '6', 'cubic', '1281', '9', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('103', '6', 'cubic', '1328', '8', '3', '0');
-INSERT INTO `npcbuffer_buff_list` VALUES ('104', '6', 'cubic', '1329', '9', '3', '0');
-INSERT INTO `npcbuffer_buff_list` VALUES ('105', '6', 'cubic', '1330', '8', '3', '0');
-INSERT INTO `npcbuffer_buff_list` VALUES ('106', '6', 'cubic', '779', '1', '3', '1');
-
-INSERT INTO `npcbuffer_buff_list` VALUES ('107', '7', 'special', '1062', '2', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('108', '7', 'special', '1355', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('109', '7', 'special', '1356', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('110', '7', 'special', '1357', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('111', '7', 'special', '1363', '1', '0', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('112', '7', 'special', '1413', '1', '1', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('114', '7', 'special', '1457', '1', '3', '0');
-INSERT INTO `npcbuffer_buff_list` VALUES ('115', '7', 'special', '4699', '13', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('116', '7', 'special', '4700', '13', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('117', '7', 'special', '4702', '13', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('118', '7', 'special', '4703', '13', '3', '1');
-
-INSERT INTO `npcbuffer_buff_list` VALUES ('119', '8', 'resist', '1032', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('120', '8', 'resist', '1033', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('121', '8', 'resist', '1035', '4', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('122', '8', 'resist', '1078', '6', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('123', '8', 'resist', '1182', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('124', '8', 'resist', '1189', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('125', '8', 'resist', '1191', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('126', '8', 'resist', '1259', '4', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('127', '8', 'resist', '1352', '1', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('128', '8', 'resist', '1353', '1', '2', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('129', '8', 'resist', '1354', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('130', '8', 'resist', '1392', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('131', '8', 'resist', '1393', '3', '3', '1');
-
-INSERT INTO `npcbuffer_buff_list` VALUES ('132', '8', 'overlord', '1003', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('133', '8', 'overlord', '1004', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('134', '8', 'overlord', '1005', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('135', '8', 'overlord', '1008', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('136', '8', 'overlord', '1249', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('137', '8', 'overlord', '1250', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('138', '8', 'overlord', '1260', '3', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('139', '8', 'overlord', '1261', '2', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('140', '8', 'overlord', '1282', '2', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('141', '8', 'overlord', '1364', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('142', '8', 'overlord', '1365', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('143', '8', 'overlord', '1415', '1', '3', '1');
-INSERT INTO `npcbuffer_buff_list` VALUES ('144', '8', 'overlord', '1416', '1', '3', '1');
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/ShemeBuffer.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/ShemeBuffer.ini
new file mode 100644
index 0000000000..9087a3df17
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/ShemeBuffer.ini
@@ -0,0 +1,10 @@
+#=============================================================
+# Buffer
+#=============================================================
+# Also check data\SchemeBufferSkills.xml
+
+# Maximum number of available schemes per player.
+BufferMaxSchemesPerChar = 4
+
+# Static cost of buffs ; override skills price if different of -1.
+BufferStaticCostPerBuff = -1
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/SchemeBufferSkills.xml b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/SchemeBufferSkills.xml
new file mode 100644
index 0000000000..dc54a77ef5
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/SchemeBufferSkills.xml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-1.htm b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-1.htm
deleted file mode 100644
index 3621434bce..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-1.htm
+++ /dev/null
@@ -1,23 +0,0 @@
-
Core NPC Buffer
-
-
-
-Please tell me the buff you would like.
-Dance of Alignment
-Dance of Aqua Guard
-Dance of Concentration
-Dance of Earth Guard
-Dance of Fire
-Dance of Fury
-Dance of Inspiration
-Dance of Light
-Dance of Protection
-Dance of Shadows
-Dance of the Mystic
-Dance of the Vampire
-Dance of the Warrior
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-2.htm b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-2.htm
deleted file mode 100644
index 72fa973aa9..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-2.htm
+++ /dev/null
@@ -1,35 +0,0 @@
-Core NPC Buffer
-
-
-
-Please tell me the buff you would like.
-Acumen
-Berserk Spirit
-Bless Shield
-Bless the Body
-Bless the Soul
-Concentration
-Clarity
-Death Whisper
-Empower
-Focus
-Guidance
-Haste
-Holy Weapon
-Invigor
-Magic Barrier
-Mental Shield
-Might
-Regeneration
-Resist Aqua
-Resist Fire
-Resist Poison
-Resist Wind
-Shield
-Wild Magic
-Wind Walk
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-3.htm b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-3.htm
deleted file mode 100644
index b0799c9745..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-3.htm
+++ /dev/null
@@ -1,25 +0,0 @@
-Core NPC Buffer
-
-
-
-Please tell me the buff you would like.
-Song of Champion
-Song of Earth
-Song of Elemental
-Song of Flame Guard
-Song of Hunter
-Song of Invocation
-Song of Life
-Song of Meditation
-Song of Renewal
-Song of Storm Guard
-Song of Vengeance
-Song of Vitality
-Song of Warding
-Song of Water
-Song of Wind
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-4.htm b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-4.htm
deleted file mode 100644
index 875ac43836..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer-4.htm
+++ /dev/null
@@ -1,12 +0,0 @@
-Core NPC Buffer
-
-
-
-Please tell me the player style you are so I can give you 20 recommended buffs.
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer.htm b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer.htm
deleted file mode 100644
index 223f61b60b..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/NpcBuffer.htm
+++ /dev/null
@@ -1,22 +0,0 @@
-NPC Buffer
-
-
-
-
-Hello,
-Please have your Express Credit Card ready for this transaction.
-Oh, wait you play on a Server, that means you can put away that
-Express Credit Card, and use your pocket change to pay for these buffs...
-I'd normally charge you 200 adena per buff, but since I think you're cute, I'll charge half off
-That means you pay 100 adena per buff only.
-*wink*Aren't I nice...
-
-What type of buffs would you like?
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/SchemeBuffer/50008-1.htm b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/SchemeBuffer/50008-1.htm
new file mode 100644
index 0000000000..5b426a67fe
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/SchemeBuffer/50008-1.htm
@@ -0,0 +1,14 @@
+
+You can create up to %max_schemes% schemes. Is it clear for you?
+If not, read until you get it! I can't afford idiots...
+You can register a new scheme filling this form, here!
+
+Here are listed your schemes and their fee.
+%schemes%
+Back
+
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/SchemeBuffer/50008-2.htm b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/SchemeBuffer/50008-2.htm
new file mode 100644
index 0000000000..a67c328098
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/SchemeBuffer/50008-2.htm
@@ -0,0 +1,8 @@
+
+%schemename% scheme holds %count% buffs.
+
+%typesframe%
+%skilllistframe%
+
+Back
+
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/SchemeBuffer/50008.htm b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/SchemeBuffer/50008.htm
new file mode 100644
index 0000000000..5309ad3e52
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/html/mods/SchemeBuffer/50008.htm
@@ -0,0 +1,8 @@
+
+Hello stranger!
+Yup, you're right, I decided to share some of my powerful buffs in order to improve your pew-pew-bum-zap abilities.
+What can I do for you?
+Magic support
+Heal me and my pet
+Cleanup all effects on me and my pet
+
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/NpcBuffer/NpcBuffer.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/NpcBuffer/NpcBuffer.java
deleted file mode 100644
index 7ff45b055e..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/custom/NpcBuffer/NpcBuffer.java
+++ /dev/null
@@ -1,2142 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package custom.NpcBuffer;
-
-import static com.l2jmobius.gameserver.util.Util.formatAdena;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.commons.database.DatabaseFactory;
-import com.l2jmobius.gameserver.data.xml.impl.SkillData;
-import com.l2jmobius.gameserver.instancemanager.QuestManager;
-import com.l2jmobius.gameserver.model.actor.L2Npc;
-import com.l2jmobius.gameserver.model.actor.L2Summon;
-import com.l2jmobius.gameserver.model.actor.instance.L2CubicInstance;
-import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
-import com.l2jmobius.gameserver.model.actor.instance.L2PetInstance;
-import com.l2jmobius.gameserver.model.actor.instance.L2ServitorInstance;
-import com.l2jmobius.gameserver.model.actor.stat.PcStat;
-import com.l2jmobius.gameserver.model.actor.stat.SummonStat;
-import com.l2jmobius.gameserver.model.actor.status.PcStatus;
-import com.l2jmobius.gameserver.model.actor.status.SummonStatus;
-import com.l2jmobius.gameserver.model.effects.L2EffectType;
-import com.l2jmobius.gameserver.model.entity.TvTEvent;
-import com.l2jmobius.gameserver.model.olympiad.OlympiadManager;
-import com.l2jmobius.gameserver.model.quest.QuestState;
-import com.l2jmobius.gameserver.model.skills.Skill;
-import com.l2jmobius.gameserver.network.SystemMessageId;
-import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
-import com.l2jmobius.gameserver.network.serverpackets.MagicSkillUse;
-import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
-import com.l2jmobius.gameserver.network.serverpackets.SetSummonRemainTime;
-import com.l2jmobius.gameserver.network.serverpackets.SetupGauge;
-
-import ai.AbstractNpcAI;
-
-public class NpcBuffer extends AbstractNpcAI
-{
- private static final boolean DEBUG = false;
-
- private static void print(Exception e)
- {
- LOGGER.warning(">>>" + e + "<<<");
- if (DEBUG)
- {
- e.printStackTrace();
- }
- }
-
- private static final String QUEST_LOADING_INFO = "NpcBuffer";
- private static final int NPC_ID = 12;
-
- private static final String TITLE_NAME = "Scheme Buffer";
- private static final boolean SCRIPT_RELOAD = false;
- private static final boolean SMART_WINDOW = true;
- private static final boolean ENABLE_BUFF_SECTION = true;
- private static final boolean ENABLE_SCHEME_SYSTEM = true;
- private static final boolean ENABLE_HEAL = true;
- private static final boolean ENABLE_HEAL_IN_COMBAT = false;
- private static final boolean ENABLE_BUFFS = true;
- private static final boolean ENABLE_RESIST = true;
- private static final boolean ENABLE_SONGS = true;
- private static final boolean ENABLE_DANCES = true;
- private static final boolean ENABLE_CHANTS = false;
- private static final boolean ENABLE_OTHERS = false;
- private static final boolean ENABLE_SPECIAL = false;
- private static final boolean ENABLE_CUBIC = false;
- private static final boolean ENABLE_BUFF_REMOVE = true;
- private static final boolean ENABLE_BUFF_SET = true;
- private static final boolean BUFF_WITH_KARMA = true;
- private static final boolean FREE_BUFFS = false;
- private static final boolean TIME_OUT = true;
- private static final int TIME_OUT_TIME = 3;
- private static final int MIN_LEVEL = 1;
- private static final int BUFF_REMOVE_PRICE = 30000;
- private static final int HEAL_PRICE = 30000;
- private static final int BUFF_PRICE = 2000;
- private static final int RESIST_PRICE = 2000;
- private static final int SONG_PRICE = 2000;
- private static final int DANCE_PRICE = 2000;
- private static final int CHANT_PRICE = 2000;
- private static final int OTHERS_PRICE = 2000;
- private static final int SPECIAL_PRICE = 2000;
- private static final int CUBIC_PRICE = 2000;
- private static final int BUFF_SET_PRICE = 30000;
- private static final int SCHEME_BUFF_PRICE = 50000;
- private static final int SCHEMES_PER_PLAYER = 4;
- private static final int CONSUMABLE_ID = 57;
- private static final int MAX_SCHEME_BUFFS = Config.BUFFS_MAX_AMOUNT; // +4 = Divine Inspiration Lv4
- private static final int MAX_SCHEME_DANCES = Config.DANCES_MAX_AMOUNT;
-
- private static final String SET_FIGHTER = "Fighter";
- private static final String SET_MAGE = "Mage";
- private static final String SET_ALL = "All";
- private static final String SET_NONE = "None";
-
- private static final int SKILL_HEAL = 6696;
- private static final int SKILL_BUFF_1 = 1411;
- private static final int SKILL_BUFF_2 = 6662;
-
- private String rebuildMainHtml(QuestState st)
- {
- String MAIN_HTML_MESSAGE = "" + TITLE_NAME + " ";
- String MESSAGE = "";
- int td = 0;
- final String[] TRS =
- {
- "",
- " ",
- "",
- " "
- };
-
- final String bottonA, bottonB, bottonC;
- if (st.getInt("Pet-On-Off") == 1)
- {
- bottonA = "Auto Buff Pet";
- bottonB = "Heal My Pet";
- bottonC = "Remove Pet Buffs";
- MAIN_HTML_MESSAGE += "";
- }
- else
- {
- bottonA = "Auto Buff";
- bottonB = "Heal";
- bottonC = "Remove Buffs";
- MAIN_HTML_MESSAGE += "";
- }
-
- if (ENABLE_BUFF_SECTION)
- {
- if (ENABLE_BUFFS)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
- if (ENABLE_RESIST)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
- if (ENABLE_SONGS)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
- if (ENABLE_DANCES)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
- if (ENABLE_CHANTS)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
- if (ENABLE_SPECIAL)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
- if (ENABLE_OTHERS)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
- }
-
- if (ENABLE_CUBIC)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
-
- if (MESSAGE.length() > 0)
- {
- MAIN_HTML_MESSAGE += "Buffs: " + formatAdena(BUFF_PRICE) + " adena
";
- MESSAGE = "";
- td = 0;
- }
-
- if (ENABLE_BUFF_SET)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
-
- if (ENABLE_HEAL)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
-
- if (ENABLE_BUFF_REMOVE)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
-
- if (MESSAGE.length() > 0)
- {
- MAIN_HTML_MESSAGE += "Preset: " + formatAdena(BUFF_SET_PRICE) + " adena
";
- MESSAGE = "";
- td = 0;
- }
-
- if (ENABLE_SCHEME_SYSTEM)
- {
- MAIN_HTML_MESSAGE += generateScheme(st);
- }
-
- if (st.getPlayer().isGM())
- {
- MAIN_HTML_MESSAGE += "";
- }
- MAIN_HTML_MESSAGE += "" + TITLE_NAME + " ";
- return MAIN_HTML_MESSAGE;
- }
-
- private String generateScheme(QuestState st)
- {
- final List schemeName = new ArrayList<>();
- final List schemeId = new ArrayList<>();
- String HTML = "";
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT * FROM npcbuffer_scheme_list WHERE player_id=?");
- statement.setInt(1, st.getPlayer().getObjectId());
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- schemeName.add(rss.getString("scheme_name"));
- schemeId.add(rss.getString("id"));
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- HTML += "Scheme: " + formatAdena(SCHEME_BUFF_PRICE) + " adena
";
- if (schemeName.size() > 0)
- {
- String MESSAGE = "";
- int td = 0;
- final String[] TRS =
- {
- "",
- " ",
- "",
- " "
- };
- for (int i = 0; i < schemeName.size(); ++i)
- {
- if (td > 2)
- {
- td = 0;
- }
- MESSAGE += TRS[td] + "" + TRS[td + 1];
- td += 2;
- }
-
- if (MESSAGE.length() > 0)
- {
- HTML += "";
- }
- }
-
- if (schemeName.size() < SCHEMES_PER_PLAYER)
- {
- HTML += " ";
- }
- else
- {
- HTML += "";
- }
-
- if (schemeName.size() > 0)
- {
- HTML += "
";
- }
- else
- {
- HTML += "
";
- }
- return HTML;
- }
-
- private String reloadPanel(QuestState st)
- {
- return "" + TITLE_NAME + " " + TITLE_NAME + " This option can be seen by GMs only and itallow to update any changes made in thescript. You can disable this option inthe settings section within the Script.Do you want to update the SCRIPT?
";
- }
-
- private String getItemNameHtml(QuestState st, int itemval)
- {
- return "" + itemval + ";";
- }
-
- private int getBuffCount(String scheme)
- {
- int count = 0;
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT buff_class FROM npcbuffer_scheme_contents WHERE scheme_id=?");
- statement.setString(1, scheme);
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- ++count;
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- return count;
- }
-
- private String getBuffType(int id)
- {
- String val = "none";
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT buffType FROM npcbuffer_buff_list WHERE buffId=? LIMIT 1");
- statement.setInt(1, id);
- final ResultSet rss = statement.executeQuery();
- if (rss.next())
- {
- val = rss.getString("buffType");
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- return val;
- }
-
- private boolean isEnabled(int id, int level)
- {
- boolean val = false;
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT canUse FROM npcbuffer_buff_list WHERE buffId=? AND buffLevel=? LIMIT 1");
- statement.setInt(1, id);
- statement.setInt(2, level);
- final ResultSet rss = statement.executeQuery();
- if (rss.next())
- {
- if ("1".equals(rss.getString("canUse")))
- {
- val = true;
- }
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- return val;
- }
-
- private boolean isUsed(String scheme, int id, int level)
- {
- boolean used = false;
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT id FROM npcbuffer_scheme_contents WHERE scheme_id=? AND skill_id=? AND skill_level=? LIMIT 1");
- statement.setString(1, scheme);
- statement.setInt(2, id);
- statement.setInt(3, level);
- final ResultSet rss = statement.executeQuery();
- if (rss.next())
- {
- used = true;
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- return used;
- }
-
- private int getClassBuff(String id)
- {
- int val = 0;
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT buff_class FROM npcbuffer_buff_list WHERE buffId=?");
- statement.setString(1, id);
- final ResultSet rss = statement.executeQuery();
- if (rss.next())
- {
- val = rss.getInt("buff_class");
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- return val;
- }
-
- private String showText(QuestState st, String type, String text, boolean buttonEnabled, String buttonName, String location)
- {
- String MESSAGE = "" + TITLE_NAME + " ";
- MESSAGE += "" + type + " " + text + " ";
- if (buttonEnabled)
- {
- MESSAGE += "";
- }
- MESSAGE += "" + TITLE_NAME + " ";
- playSound(st.getPlayer(), "ItemSound3.sys_shortage");
- return MESSAGE;
- }
-
- private String reloadConfig(QuestState st)
- {
- try
- {
- if (QuestManager.getInstance().reload(QUEST_LOADING_INFO))
- {
- st.getPlayer().sendMessage("The script and settings have been reloaded successfully.");
- }
- else
- {
- st.getPlayer().sendMessage("Script Reloaded Failed. you edited something wrong! :P, fix it and restart the server");
- }
- }
- catch (Exception e)
- {
- st.getPlayer().sendMessage("Script Reloaded Failed. you edited something wrong! :P, fix it and restart the server");
- print(e);
- }
- return rebuildMainHtml(st);
- }
-
- private NpcBuffer()
- {
- addStartNpc(NPC_ID);
- addFirstTalkId(NPC_ID);
- addTalkId(NPC_ID);
- }
-
- private boolean isPetBuff(QuestState st)
- {
- return st.getInt("Pet-On-Off") != 0;
- }
-
- private String createScheme()
- {
- return "" + TITLE_NAME + " You MUST seprerate new words with a dot (.) Scheme name: " + TITLE_NAME + " ";
- }
-
- private String deleteScheme(L2PcInstance player)
- {
- String HTML = "" + TITLE_NAME + " Available schemes: ";
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT * FROM npcbuffer_scheme_list WHERE player_id=?");
- statement.setInt(1, player.getObjectId());
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- HTML += "";
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- HTML += "" + TITLE_NAME + " ";
- return HTML;
- }
-
- private String editScheme(L2PcInstance player)
- {
- String HTML = "" + TITLE_NAME + " Select a scheme that you would like to manage: ";
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT * FROM npcbuffer_scheme_list WHERE player_id=?");
- statement.setInt(1, player.getObjectId());
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- final String name = rss.getString("scheme_name");
- final String id = rss.getString("id");
- HTML += "";
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- HTML += "" + TITLE_NAME + " ";
- return HTML;
- }
-
- private String getOptionList(String scheme)
- {
- final int bcount = getBuffCount(scheme);
- String HTML = "" + TITLE_NAME + " There are " + bcount + " buffs in current scheme! ";
- if (bcount < (MAX_SCHEME_BUFFS + MAX_SCHEME_DANCES))
- {
- HTML += "";
- }
- if (bcount > 0)
- {
- HTML += "";
- }
- HTML += "" + TITLE_NAME + " ";
- return HTML;
- }
-
- private String buildHtml(String buffType)
- {
- String HTML_MESSAGE = "" + TITLE_NAME + " ";
-
- final List availableBuffs = new ArrayList<>();
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT buffId,buffLevel FROM npcbuffer_buff_list WHERE buffType=\"" + buffType + "\" AND canUse=1 ORDER BY Buff_Class ASC, id");
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- final int bId = rss.getInt("buffId");
- final int bLevel = rss.getInt("buffLevel");
- String bName = SkillData.getInstance().getSkill(bId, bLevel).getName();
- bName = bName.replace(" ", "+");
- availableBuffs.add(bName + "_" + bId + "_" + bLevel);
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
-
- if (availableBuffs.size() == 0)
- {
- HTML_MESSAGE += "No buffs are available at this moment!";
- }
- else
- {
- if (FREE_BUFFS)
- {
- HTML_MESSAGE += "All buffs are for free !";
- }
- else
- {
- int price = 0;
- switch (buffType)
- {
- case "buff":
- {
- price = BUFF_PRICE;
- break;
- }
- case "resist":
- {
- price = RESIST_PRICE;
- break;
- }
- case "song":
- {
- price = SONG_PRICE;
- break;
- }
- case "dance":
- {
- price = DANCE_PRICE;
- break;
- }
- case "chant":
- {
- price = CHANT_PRICE;
- break;
- }
- case "others":
- {
- price = OTHERS_PRICE;
- break;
- }
- case "special":
- {
- price = SPECIAL_PRICE;
- break;
- }
- case "cubic":
- {
- price = CUBIC_PRICE;
- break;
- }
- default:
- {
- if (DEBUG)
- {
- throw new RuntimeException();
- }
- }
- }
- HTML_MESSAGE += "All special buffs cost " + formatAdena(price) + " adena!";
- }
- HTML_MESSAGE += "";
- for (String buff : availableBuffs)
- {
- buff = buff.replace("_", " ");
- final String[] buffSplit = buff.split(" ");
- String name = buffSplit[0];
- final int id = Integer.parseInt(buffSplit[1]);
- final int level = Integer.parseInt(buffSplit[2]);
- name = name.replace("+", " ");
- HTML_MESSAGE += "" + getSkillIconHtml(id, level) + " ";
- }
- HTML_MESSAGE += "
";
- }
-
- HTML_MESSAGE += "" + TITLE_NAME + " ";
- return HTML_MESSAGE;
- }
-
- private String generateQuery(int case1, int case2)
- {
- final StringBuilder qry = new StringBuilder();
- if (ENABLE_BUFFS)
- {
- if (case1 < MAX_SCHEME_BUFFS)
- {
- qry.append(",\"buff\"");
- }
- }
- if (ENABLE_RESIST)
- {
- if (case1 < MAX_SCHEME_BUFFS)
- {
- qry.append(",\"resist\"");
- }
- }
- if (ENABLE_SONGS)
- {
- if (case2 < MAX_SCHEME_DANCES)
- {
- qry.append(",\"song\"");
- }
- }
- if (ENABLE_DANCES)
- {
- if (case2 < MAX_SCHEME_DANCES)
- {
- qry.append(",\"dance\"");
- }
- }
- if (ENABLE_CHANTS)
- {
- if (case1 < MAX_SCHEME_BUFFS)
- {
- qry.append(",\"chant\"");
- }
- }
- if (ENABLE_OTHERS)
- {
- if (case1 < MAX_SCHEME_BUFFS)
- {
- qry.append(",\"others\"");
- }
- }
- if (ENABLE_SPECIAL)
- {
- if (case1 < MAX_SCHEME_BUFFS)
- {
- qry.append(",\"special\"");
- }
- }
- if (qry.length() > 0)
- {
- qry.deleteCharAt(0);
- }
- return qry.toString();
- }
-
- private String viewAllSchemeBuffs$getBuffCount(String scheme)
- {
- int count = 0;
- int D_S_Count = 0;
- int B_Count = 0;
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT buff_class FROM npcbuffer_scheme_contents WHERE scheme_id=?");
- statement.setString(1, scheme);
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- ++count;
- final int val = rss.getInt("buff_class");
- if ((val == 1) || (val == 2))
- {
- ++D_S_Count;
- }
- else
- {
- ++B_Count;
- }
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- final String res = count + " " + B_Count + " " + D_S_Count;
- return res;
- }
-
- private String viewAllSchemeBuffs(String scheme, String page, String addOrRemove)
- {
- final List buffList = new ArrayList<>();
- String HTML_MESSAGE = "" + TITLE_NAME + " ";
- final String[] eventSplit = viewAllSchemeBuffs$getBuffCount(scheme).split(" ");
- final int TOTAL_BUFF = Integer.parseInt(eventSplit[0]);
- final int BUFF_COUNT = Integer.parseInt(eventSplit[1]);
- final int DANCE_SONG = Integer.parseInt(eventSplit[2]);
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- if (addOrRemove.equals("add"))
- {
- HTML_MESSAGE += "You can add " + (MAX_SCHEME_BUFFS - BUFF_COUNT) + " Buffs and " + (MAX_SCHEME_DANCES - DANCE_SONG) + " Dances more!";
- final String QUERY = "SELECT * FROM npcbuffer_buff_list WHERE buffType IN (" + generateQuery(BUFF_COUNT, DANCE_SONG) + ") AND canUse=1 ORDER BY Buff_Class ASC, id";
- final PreparedStatement statement = con.prepareStatement(QUERY);
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- String name = SkillData.getInstance().getSkill(rss.getInt("buffId"), rss.getInt("buffLevel")).getName();
- name = name.replace(" ", "+");
- buffList.add(name + "_" + rss.getInt("buffId") + "_" + rss.getInt("buffLevel"));
- }
- statement.close();
- rss.close();
- }
- else if (addOrRemove.equals("remove"))
- {
- HTML_MESSAGE += "You have " + BUFF_COUNT + " Buffs and " + DANCE_SONG + " Dances";
- final String QUERY = "SELECT * FROM npcbuffer_scheme_contents WHERE scheme_id=? ORDER BY Buff_Class ASC, id";
- final PreparedStatement statement = con.prepareStatement(QUERY);
- statement.setString(1, scheme);
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- String name = SkillData.getInstance().getSkill(rss.getInt("skill_id"), rss.getInt("skill_level")).getName();
- name = name.replace(" ", "+");
- buffList.add(name + "_" + rss.getInt("skill_id") + "_" + rss.getInt("skill_level"));
- }
- statement.close();
- rss.close();
- }
- else if (DEBUG)
- {
- throw new RuntimeException();
- }
- }
- catch (SQLException e)
- {
- print(e);
- }
-
- HTML_MESSAGE += "";
- final int buffsPerPage = 20;
- final String width, pageName;
- final int pc = ((buffList.size() - 1) / buffsPerPage) + 1;
- if (pc > 5)
- {
- width = "25";
- pageName = "P";
- }
- else
- {
- width = "50";
- pageName = "Page ";
- }
- for (int ii = 1; ii <= pc; ++ii)
- {
- if (ii == Integer.parseInt(page))
- {
- HTML_MESSAGE += "" + pageName + ii + " ";
- }
- else if (addOrRemove.equals("add"))
- {
- HTML_MESSAGE += " ";
- }
- else if (addOrRemove.equals("remove"))
- {
- HTML_MESSAGE += " ";
- }
- else if (DEBUG)
- {
- throw new RuntimeException();
- }
- }
- HTML_MESSAGE += "
";
-
- final int limit = buffsPerPage * Integer.parseInt(page);
- final int start = limit - buffsPerPage;
- final int end = Math.min(limit, buffList.size());
- int k = 0;
- for (int i = start; i < end; ++i)
- {
- String value = buffList.get(i);
- value = value.replace("_", " ");
- final String[] extr = value.split(" ");
- String name = extr[0];
- name = name.replace("+", " ");
- final int id = Integer.parseInt(extr[1]);
- final int level = Integer.parseInt(extr[2]);
- if (addOrRemove.equals("add"))
- {
- if (!isUsed(scheme, id, level))
- {
- if ((k % 2) != 0)
- {
- HTML_MESSAGE += "";
- }
- else
- {
- HTML_MESSAGE += "";
- }
- HTML_MESSAGE += "" + getSkillIconHtml(id, level) + " " + name + "
";
- k += 1;
- }
- }
- else if (addOrRemove.equals("remove"))
- {
- if ((k % 2) != 0)
- {
- HTML_MESSAGE += "";
- }
- else
- {
- HTML_MESSAGE += "";
- }
- HTML_MESSAGE += "" + getSkillIconHtml(id, level) + " " + name + "
";
- k += 1;
- }
- }
- HTML_MESSAGE += "" + TITLE_NAME + " ";
- return HTML_MESSAGE;
- }
-
- private String viewAllBuffTypes()
- {
- String HTML_MESSAGE = "" + TITLE_NAME + " ";
- HTML_MESSAGE += "[Buff management] ";
- if (ENABLE_BUFFS)
- {
- HTML_MESSAGE += "";
- }
- if (ENABLE_RESIST)
- {
- HTML_MESSAGE += "";
- }
- if (ENABLE_SONGS)
- {
- HTML_MESSAGE += "";
- }
- if (ENABLE_DANCES)
- {
- HTML_MESSAGE += "";
- }
- if (ENABLE_CHANTS)
- {
- HTML_MESSAGE += "";
- }
- if (ENABLE_SPECIAL)
- {
- HTML_MESSAGE += "";
- }
- if (ENABLE_OTHERS)
- {
- HTML_MESSAGE += "";
- }
- if (ENABLE_CUBIC)
- {
- HTML_MESSAGE += "";
- }
- if (ENABLE_BUFF_SET)
- {
- HTML_MESSAGE += " ";
- }
- HTML_MESSAGE += "" + TITLE_NAME + " ";
- return HTML_MESSAGE;
- }
-
- private String viewAllBuffs(String type, String typeName, String page)
- {
- final List buffList = new ArrayList<>();
- String HTML_MESSAGE = "" + TITLE_NAME + " ";
- typeName = typeName.replace("_", " ");
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement;
- if (type.equals("set"))
- {
- statement = con.prepareStatement("SELECT * FROM npcbuffer_buff_list WHERE buffType IN (" + generateQuery(0, 0) + ") AND canUse=1");
- }
- else
- {
- statement = con.prepareStatement("SELECT * FROM npcbuffer_buff_list WHERE buffType=?");
- statement.setString(1, type);
- }
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- String name = SkillData.getInstance().getSkill(rss.getInt("buffId"), rss.getInt("buffLevel")).getName();
- name = name.replace(" ", "+");
- final String usable = rss.getString("canUse");
- final String forClass = rss.getString("forClass");
- final String skill_id = rss.getString("buffId");
- final String skill_level = rss.getString("buffLevel");
- buffList.add(name + "_" + forClass + "_" + page + "_" + usable + "_" + skill_id + "_" + skill_level);
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- Collections.sort(buffList);
-
- HTML_MESSAGE += "[Buff management - " + typeName + " - Page " + page + "] ";
- final int buffsPerPage;
- if (type.equals("set"))
- {
- buffsPerPage = 12;
- }
- else
- {
- buffsPerPage = 20;
- }
- final String width, pageName;
- final int pc = ((buffList.size() - 1) / buffsPerPage) + 1;
- if (pc > 5)
- {
- width = "25";
- pageName = "P";
- }
- else
- {
- width = "50";
- pageName = "Page ";
- }
- typeName = typeName.replace(" ", "_");
- for (int ii = 1; ii <= pc; ++ii)
- {
- if (ii == Integer.parseInt(page))
- {
- HTML_MESSAGE += "" + pageName + ii + " ";
- }
- else
- {
- HTML_MESSAGE += " ";
- }
- }
- HTML_MESSAGE += "
";
-
- final int limit = buffsPerPage * Integer.parseInt(page);
- final int start = limit - buffsPerPage;
- final int end = Math.min(limit, buffList.size());
- for (int i = start; i < end; ++i)
- {
- String value = buffList.get(i);
- value = value.replace("_", " ");
- final String[] extr = value.split(" ");
- String name = extr[0];
- name = name.replace("+", " ");
- final int forClass = Integer.parseInt(extr[1]);
- final int usable = Integer.parseInt(extr[3]);
- final String skillPos = extr[4] + "_" + extr[5];
- if ((i % 2) != 0)
- {
- HTML_MESSAGE += "";
- }
- else
- {
- HTML_MESSAGE += "";
- }
- if (type.equals("set"))
- {
- String listOrder = null;
- if (forClass == 0)
- {
- listOrder = "List=\"" + SET_FIGHTER + ";" + SET_MAGE + ";" + SET_ALL + ";" + SET_NONE + ";\"";
- }
- else if (forClass == 1)
- {
- listOrder = "List=\"" + SET_MAGE + ";" + SET_FIGHTER + ";" + SET_ALL + ";" + SET_NONE + ";\"";
- }
- else if (forClass == 2)
- {
- listOrder = "List=\"" + SET_ALL + ";" + SET_FIGHTER + ";" + SET_MAGE + ";" + SET_NONE + ";\"";
- }
- else if (forClass == 3)
- {
- listOrder = "List=\"" + SET_NONE + ";" + SET_FIGHTER + ";" + SET_MAGE + ";" + SET_ALL + ";\"";
- }
- HTML_MESSAGE += "" + name + " ";
- }
- else
- {
- HTML_MESSAGE += "" + name + " ";
- if (usable == 1)
- {
- HTML_MESSAGE += " ";
- }
- else if (usable == 0)
- {
- HTML_MESSAGE += "";
- }
- }
- HTML_MESSAGE += "
";
- }
- HTML_MESSAGE += "" + TITLE_NAME + " ";
- return HTML_MESSAGE;
- }
-
- private void manageSelectedBuff(String buffPosId, String canUseBuff)
- {
- final String[] bpid = buffPosId.split("_");
- final String bId = bpid[0];
- final String bLvl = bpid[1];
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("UPDATE npcbuffer_buff_list SET canUse=? WHERE buffId=? AND buffLevel=? LIMIT 1");
- statement.setString(1, canUseBuff);
- statement.setString(2, bId);
- statement.setString(3, bLvl);
- statement.executeUpdate();
- statement.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- }
-
- private String manageSelectedSet(String id, String newVal, String opt3)
- {
- final String[] bpid = id.split("_");
- final String bId = bpid[0];
- final String bLvl = bpid[1];
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("UPDATE npcbuffer_buff_list SET forClass=? WHERE buffId=? AND bufflevel=?");
- statement.setString(1, newVal);
- statement.setString(2, bId);
- statement.setString(3, bLvl);
- statement.executeUpdate();
- statement.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- return viewAllBuffs("set", "Buff Sets", opt3);
- }
-
- private void addTimeout(QuestState st, int gaugeColor, int amount, int offset)
- {
- final int endtime = (int) ((System.currentTimeMillis() + (amount * 1000)) / 1000);
- st.set("blockUntilTime", String.valueOf(endtime));
- st.getPlayer().sendPacket(new SetupGauge(gaugeColor, (amount * 1000) + offset));
- }
-
- private void heal(L2PcInstance player, boolean isPet)
- {
- final L2Summon target = player.getSummon();
- if (!isPet)
- {
- final PcStatus pcStatus = player.getStatus();
- final PcStat pcStat = player.getStat();
- pcStatus.setCurrentHp(pcStat.getMaxHp());
- pcStatus.setCurrentMp(pcStat.getMaxMp());
- pcStatus.setCurrentCp(pcStat.getMaxCp());
- player.setTarget(player);
- player.broadcastPacket(new MagicSkillUse(player, SKILL_HEAL, 1, 1000, 0));
- }
- else if (target != null)
- {
- final SummonStatus petStatus = target.getStatus();
- final SummonStat petStat = target.getStat();
- petStatus.setCurrentHp(petStat.getMaxHp());
- petStatus.setCurrentMp(petStat.getMaxMp());
- if (target instanceof L2PetInstance)
- {
- final L2PetInstance pet = (L2PetInstance) target;
- pet.setCurrentFed(pet.getMaxFed());
- player.sendPacket(new SetSummonRemainTime(pet.getMaxFed(), pet.getCurrentFed()));
- }
- else if (target instanceof L2ServitorInstance)
- {
- final L2ServitorInstance summon = (L2ServitorInstance) target;
- // FIXME: summon.setLifeTimeRemaining(summon.getLifeTimeRemaining() - summon.getLifeTime());
- summon.setLifeTimeRemaining(summon.getLifeTimeRemaining() + summon.getLifeTime());
- player.sendPacket(new SetSummonRemainTime(summon.getLifeTime(), summon.getLifeTimeRemaining()));
- }
- else if (DEBUG)
- {
- throw new RuntimeException();
- }
- target.setTarget(target);
- target.broadcastPacket(new MagicSkillUse(target, SKILL_HEAL, 1, 1000, 0));
- }
- }
-
- @Override
- public String onAdvEvent(String event, L2Npc npc, L2PcInstance player)
- {
- if (DEBUG)
- {
- System.out.println(getName() + "#onAdvEvent('" + event + "'," + (npc == null ? "NULL" : npc.getId() + npc.getName()) + "," + (player == null ? "NULL" : player.getName()) + ")");
- }
- final QuestState st = player.getQuestState(QUEST_LOADING_INFO);
- final String[] eventSplit = event.split(" ", 4);
- if (eventSplit.length != 4)
- {
- player.sendPacket(SystemMessageId.INCORRECT_NAME_PLEASE_TRY_AGAIN);
- return null;
- }
- final String eventParam0 = eventSplit[0];
- final String eventParam1 = eventSplit[1];
- String eventParam2 = eventSplit[2];
- final String eventParam3 = eventSplit[3];
-
- switch (eventParam0)
- {
- case "reloadscript":
- {
- if (eventParam1.equals("1"))
- {
- return reloadConfig(st);
- }
- if (eventParam1.equals("0"))
- {
- return rebuildMainHtml(st);
- }
- if (DEBUG)
- {
- throw new RuntimeException();
- }
- }
- case "redirect":
- {
- switch (eventParam1)
- {
- case "main":
- {
- return rebuildMainHtml(st);
- }
- case "manage_buffs":
- {
- return viewAllBuffTypes();
- }
- case "view_buffs":
- {
- return buildHtml("buff");
- }
- case "view_resists":
- {
- return buildHtml("resist");
- }
- case "view_songs":
- {
- return buildHtml("song");
- }
- case "view_dances":
- {
- return buildHtml("dance");
- }
- case "view_chants":
- {
- return buildHtml("chant");
- }
- case "view_others":
- {
- return buildHtml("others");
- }
- case "view_special":
- {
- return buildHtml("special");
- }
- case "view_cubic":
- {
- return buildHtml("cubic");
- }
- default:
- {
- if (DEBUG)
- {
- throw new RuntimeException();
- }
- }
- }
- }
- case "buffpet":
- {
- if ((int) (System.currentTimeMillis() / 1000) > st.getInt("blockUntilTime"))
- {
- st.set("Pet-On-Off", eventParam1);
- if (TIME_OUT)
- {
- addTimeout(st, 3, TIME_OUT_TIME / 2, 600);
- }
- }
- return rebuildMainHtml(st);
- }
- case "create":
- {
- final String param = eventParam1.replaceAll("[ !\"#$%&'()*+,/:;<=>?@\\[\\\\\\]\\^`{|}~]", "");
- if ((param.length() == 0) || param.equals("no_name"))
- {
- player.sendPacket(SystemMessageId.INCORRECT_NAME_PLEASE_TRY_AGAIN);
- return showText(st, "Info", "Please, enter the scheme name!", true, "Return", "main");
- }
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("INSERT INTO npcbuffer_scheme_list (player_id,scheme_name) VALUES (?,?)");
- statement.setInt(1, player.getObjectId());
- statement.setString(2, param);
- statement.executeUpdate();
- statement.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- return rebuildMainHtml(st);
- }
-
- case "delete":
- {
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- PreparedStatement statement = con.prepareStatement("DELETE FROM npcbuffer_scheme_list WHERE id=? LIMIT 1");
- statement.setString(1, eventParam1);
- statement.executeUpdate();
- statement.close();
- statement = con.prepareStatement("DELETE FROM npcbuffer_scheme_contents WHERE scheme_id=?");
- statement.setString(1, eventParam1);
- statement.executeUpdate();
- statement.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- return rebuildMainHtml(st);
- }
- case "delete_c":
- {
- return "" + TITLE_NAME + " Do you really want to delete '" + eventParam2 + "' scheme?" + TITLE_NAME + " ";
- }
- case "create_1":
- {
- return createScheme();
- }
- case "edit_1":
- {
- return editScheme(player);
- }
- case "delete_1":
- {
- return deleteScheme(player);
- }
- case "manage_scheme_1":
- {
- return viewAllSchemeBuffs(eventParam1, eventParam2, "add");
- }
- case "manage_scheme_2":
- {
- return viewAllSchemeBuffs(eventParam1, eventParam2, "remove");
- }
- case "manage_scheme_select":
- {
- return getOptionList(eventParam1);
- }
- case "remove_buff":
- {
- final String[] split = eventParam1.split("_");
- final String scheme = split[0];
- final String skill = split[1];
- final String level = split[2];
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("DELETE FROM npcbuffer_scheme_contents WHERE scheme_id=? AND skill_id=? AND skill_level=? LIMIT 1");
- statement.setString(1, scheme);
- statement.setString(2, skill);
- statement.setString(3, level);
- statement.executeUpdate();
- statement.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- final int temp = Integer.parseInt(eventParam3) - 1;
- final String HTML;
- if (temp <= 0)
- {
- HTML = getOptionList(scheme);
- }
- else
- {
- HTML = viewAllSchemeBuffs(scheme, eventParam2, "remove");
- }
- return HTML;
- }
-
- case "add_buff":
- {
- final String[] split = eventParam1.split("_");
- final String scheme = split[0];
- final String skill = split[1];
- final String level = split[2];
- final int idbuffclass = getClassBuff(skill);
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("INSERT INTO npcbuffer_scheme_contents (scheme_id,skill_id,skill_level,buff_class) VALUES (?,?,?,?)");
- statement.setString(1, scheme);
- statement.setString(2, skill);
- statement.setString(3, level);
- statement.setInt(4, idbuffclass);
- statement.executeUpdate();
- statement.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- final int temp = Integer.parseInt(eventParam3) + 1;
- final String HTML;
- if (temp >= (MAX_SCHEME_BUFFS + MAX_SCHEME_DANCES))
- {
- HTML = getOptionList(scheme);
- }
- else
- {
- HTML = viewAllSchemeBuffs(scheme, eventParam2, "add");
- }
- return HTML;
- }
-
- case "edit_buff_list":
- {
- return viewAllBuffs(eventParam1, eventParam2, eventParam3);
- }
- case "changeBuffSet":
- {
- if (eventParam2.equals(SET_FIGHTER))
- {
- eventParam2 = "0";
- }
- else if (eventParam2.equals(SET_MAGE))
- {
- eventParam2 = "1";
- }
- else if (eventParam2.equals(SET_ALL))
- {
- eventParam2 = "2";
- }
- else if (eventParam2.equals(SET_NONE))
- {
- eventParam2 = "3";
- }
- else if (DEBUG)
- {
- throw new RuntimeException();
- }
- return manageSelectedSet(eventParam1, eventParam2, eventParam3);
- }
- case "editSelectedBuff":
- {
- eventParam2 = eventParam2.replace("-", " ");
- final String[] split = eventParam2.split(" ");
- final String action = split[0];
- final String page = split[1];
- manageSelectedBuff(eventParam1, action);
- final String typeName;
- switch (eventParam3)
- {
- case "buff":
- {
- typeName = "Buffs";
- break;
- }
- case "resist":
- {
- typeName = "Resists";
- break;
- }
- case "song":
- {
- typeName = "Songs";
- break;
- }
- case "dance":
- {
- typeName = "Dances";
- break;
- }
- case "chant":
- {
- typeName = "Chants";
- break;
- }
- case "others":
- {
- typeName = "Others_Buffs";
- break;
- }
- case "special":
- {
- typeName = "Special_Buffs";
- break;
- }
- case "cubic":
- {
- typeName = "Cubics";
- break;
- }
- default:
- {
- throw new RuntimeException();
- }
- }
- return viewAllBuffs(eventParam3, typeName, page);
- }
-
- case "viewSelectedConfig":
- {
- throw new RuntimeException();
- }
- case "changeConfig":
- {
- throw new RuntimeException();
- }
- case "heal":
- {
- if ((int) (System.currentTimeMillis() / 1000) > st.getInt("blockUntilTime"))
- {
- if (player.isInCombat() && !ENABLE_HEAL_IN_COMBAT)
- {
- return showText(st, "Info", "You can't use the heal function while in combat.", false, "Return", "main");
- }
- if (getQuestItemsCount(player, CONSUMABLE_ID) < HEAL_PRICE)
- {
- return showText(st, "Sorry", "You don't have the enough items: You need: " + HEAL_PRICE + " " + getItemNameHtml(st, CONSUMABLE_ID) + "!", false, "0", "0");
- }
- final boolean getSummonbuff = isPetBuff(st);
- if (getSummonbuff)
- {
- if (player.getSummon() != null)
- {
- heal(player, getSummonbuff);
- }
- else
- {
- return showText(st, "Info", "You can't use the Pet's options. Summon your pet first!", false, "Return", "main");
- }
- }
- else
- {
- heal(player, getSummonbuff);
- }
- takeItems(player, CONSUMABLE_ID, HEAL_PRICE);
- if (TIME_OUT)
- {
- addTimeout(st, 1, TIME_OUT_TIME / 2, 600);
- }
- }
- return SMART_WINDOW ? null : rebuildMainHtml(st);
- }
- case "removeBuffs":
- {
- if ((int) (System.currentTimeMillis() / 1000) > st.getInt("blockUntilTime"))
- {
- if (getQuestItemsCount(player, CONSUMABLE_ID) < BUFF_REMOVE_PRICE)
- {
- return showText(st, "Sorry", "You don't have the enough items: You need: " + BUFF_REMOVE_PRICE + " " + getItemNameHtml(st, CONSUMABLE_ID) + "!", false, "0", "0");
- }
- final boolean getSummonbuff = isPetBuff(st);
- if (getSummonbuff)
- {
- if (player.getSummon() != null)
- {
- player.getSummon().stopAllEffects();
- }
- else
- {
- return showText(st, "Info", "You can't use the Pet's options. Summon your pet first!", false, "Return", "main");
- }
- }
- else
- {
- player.stopAllEffects();
- if (player.getCubics() != null)
- {
- for (L2CubicInstance cubic : player.getCubics().values())
- {
- cubic.stopAction();
- player.getCubics().remove(cubic.getId());
- }
- }
- }
- takeItems(player, CONSUMABLE_ID, BUFF_REMOVE_PRICE);
- if (TIME_OUT)
- {
- addTimeout(st, 2, TIME_OUT_TIME / 2, 600);
- }
- }
- return SMART_WINDOW ? null : rebuildMainHtml(st);
- }
- case "cast":
- {
- if ((int) (System.currentTimeMillis() / 1000) > st.getInt("blockUntilTime"))
- {
- final List buffs = new ArrayList<>();
- final List levels = new ArrayList<>();
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT * FROM npcbuffer_scheme_contents WHERE scheme_id=? ORDER BY id");
- statement.setString(1, eventParam1);
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- final int id = Integer.parseInt(rss.getString("skill_id"));
- final int level = Integer.parseInt(rss.getString("skill_level"));
- switch (getBuffType(id))
- {
- case "buff":
- {
- if (ENABLE_BUFFS)
- {
- if (isEnabled(id, level))
- {
- buffs.add(id);
- levels.add(level);
- }
- }
- break;
- }
- case "resist":
- {
- if (ENABLE_RESIST)
- {
- if (isEnabled(id, level))
- {
- buffs.add(id);
- levels.add(level);
- }
- }
- break;
- }
- case "song":
- {
- if (ENABLE_SONGS)
- {
- if (isEnabled(id, level))
- {
- buffs.add(id);
- levels.add(level);
- }
- }
- break;
- }
- case "dance":
- {
- if (ENABLE_DANCES)
- {
- if (isEnabled(id, level))
- {
- buffs.add(id);
- levels.add(level);
- }
- }
- break;
- }
- case "chant":
- {
- if (ENABLE_CHANTS)
- {
- if (isEnabled(id, level))
- {
- buffs.add(id);
- levels.add(level);
- }
- }
- break;
- }
- case "others":
- {
- if (ENABLE_OTHERS)
- {
- if (isEnabled(id, level))
- {
- buffs.add(id);
- levels.add(level);
- }
- }
- break;
- }
- case "special":
- {
- if (ENABLE_SPECIAL)
- {
- if (isEnabled(id, level))
- {
- buffs.add(id);
- levels.add(level);
- }
- }
- break;
- }
- default:
- {
- if (DEBUG)
- {
- throw new RuntimeException();
- }
- }
- }
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
-
- if (buffs.size() == 0)
- {
- return viewAllSchemeBuffs(eventParam1, "1", "add");
- }
- if (!FREE_BUFFS)
- {
- if (getQuestItemsCount(player, CONSUMABLE_ID) < SCHEME_BUFF_PRICE)
- {
- return showText(st, "Sorry", "You don't have the enough items: You need: " + SCHEME_BUFF_PRICE + " " + getItemNameHtml(st, CONSUMABLE_ID) + "!", false, "0", "0");
- }
- }
-
- final boolean getSummonbuff = isPetBuff(st);
-
- if (!getSummonbuff)
- {
- player.setTarget(player);
- player.broadcastPacket(new MagicSkillUse(player, SKILL_BUFF_1, 1, 1000, 0));
- player.broadcastPacket(new MagicSkillUse(player, SKILL_BUFF_2, 1, 1000, 0));
- }
- else
- {
- if (player.getSummon() != null)
- {
- player.getSummon().setTarget(player.getSummon());
- player.getSummon().broadcastPacket(new MagicSkillUse(player.getSummon(), SKILL_BUFF_1, 1, 1000, 0));
- player.getSummon().broadcastPacket(new MagicSkillUse(player.getSummon(), SKILL_BUFF_2, 1, 1000, 0));
- }
- }
-
- for (int i = 0; i < buffs.size(); ++i)
- {
- if (!getSummonbuff)
- {
- SkillData.getInstance().getSkill(buffs.get(i), levels.get(i)).applyEffects(player, player);
- }
- else
- {
- if (player.getSummon() != null)
- {
- SkillData.getInstance().getSkill(buffs.get(i), levels.get(i)).applyEffects(player.getSummon(), player.getSummon());
- }
- else
- {
- return showText(st, "Info", "You can't use the Pet's options. Summon your pet first!", false, "Return", "main");
- }
- }
- }
-
- takeItems(player, CONSUMABLE_ID, SCHEME_BUFF_PRICE);
- if (TIME_OUT)
- {
- addTimeout(st, 3, TIME_OUT_TIME, 600);
- }
- }
- return SMART_WINDOW ? null : rebuildMainHtml(st);
- }
- case "giveBuffs":
- {
- final int cost;
- switch (eventParam3)
- {
- case "buff":
- {
- cost = BUFF_PRICE;
- break;
- }
- case "resist":
- {
- cost = RESIST_PRICE;
- break;
- }
- case "song":
- {
- cost = SONG_PRICE;
- break;
- }
- case "dance":
- {
- cost = DANCE_PRICE;
- break;
- }
- case "chant":
- {
- cost = CHANT_PRICE;
- break;
- }
- case "others":
- {
- cost = OTHERS_PRICE;
- break;
- }
- case "special":
- {
- cost = SPECIAL_PRICE;
- break;
- }
- case "cubic":
- {
- cost = CUBIC_PRICE;
- break;
- }
- default:
- {
- throw new RuntimeException();
- }
- }
-
- if ((int) (System.currentTimeMillis() / 1000) > st.getInt("blockUntilTime"))
- {
- if (!FREE_BUFFS)
- {
- if (getQuestItemsCount(player, CONSUMABLE_ID) < cost)
- {
- return showText(st, "Sorry", "You don't have the enough items: You need: " + cost + " " + getItemNameHtml(st, CONSUMABLE_ID) + "!", false, "0", "0");
- }
- }
- final Skill skill = SkillData.getInstance().getSkill(Integer.parseInt(eventParam1), Integer.parseInt(eventParam2));
- if (skill.hasEffectType(L2EffectType.SUMMON))
- {
- if (getQuestItemsCount(player, skill.getItemConsumeId()) < skill.getItemConsumeCount())
- {
- return showText(st, "Sorry", "You don't have the enough items: You need: " + skill.getItemConsumeCount() + " " + getItemNameHtml(st, skill.getItemConsumeId()) + "!", false, "0", "0");
- }
- }
- final boolean getSummonbuff = isPetBuff(st);
- if (!getSummonbuff)
- {
- if (eventParam3.equals("cubic"))
- {
- if (player.getCubics() != null)
- {
- for (L2CubicInstance cubic : player.getCubics().values())
- {
- cubic.stopAction();
- player.getCubics().remove(cubic.getId());
- }
- }
- npc.broadcastPacket(new MagicSkillUse(npc, player, Integer.parseInt(eventParam1), 1, 1000, 0));
- player.useMagic(SkillData.getInstance().getSkill(Integer.parseInt(eventParam1), Integer.parseInt(eventParam2)), false, false);
- }
- else
- {
- npc.broadcastPacket(new MagicSkillUse(npc, player, Integer.parseInt(eventParam1), 1, 1000, 0));
- SkillData.getInstance().getSkill(Integer.parseInt(eventParam1), Integer.parseInt(eventParam2)).applyEffects(player, player);
- }
- }
- else
- {
- if (eventParam3.equals("cubic"))
- {
- if (player.getCubics() != null)
- {
- for (L2CubicInstance cubic : player.getCubics().values())
- {
- cubic.stopAction();
- player.getCubics().remove(cubic.getId());
- }
- }
- npc.broadcastPacket(new MagicSkillUse(npc, player, Integer.parseInt(eventParam1), 1, 1000, 0));
- player.useMagic(SkillData.getInstance().getSkill(Integer.parseInt(eventParam1), Integer.parseInt(eventParam2)), false, false);
- }
- else
- {
- if (player.getSummon() != null)
- {
- npc.broadcastPacket(new MagicSkillUse(npc, player.getSummon(), Integer.parseInt(eventParam1), 1, 1000, 0));
- SkillData.getInstance().getSkill(Integer.parseInt(eventParam1), Integer.parseInt(eventParam2)).applyEffects(player.getSummon(), player.getSummon());
- }
- else
- {
- return showText(st, "Info", "You can't use the Pet's options. Summon your pet first!", false, "Return", "main");
- }
- }
- }
- takeItems(player, CONSUMABLE_ID, cost);
- if (TIME_OUT)
- {
- addTimeout(st, 3, TIME_OUT_TIME / 10, 600);
- }
- }
- return SMART_WINDOW ? null : buildHtml(eventParam3);
- }
- case "castBuffSet":
- {
- if ((int) (System.currentTimeMillis() / 1000) > st.getInt("blockUntilTime"))
- {
- if (!FREE_BUFFS)
- {
- if (getQuestItemsCount(player, CONSUMABLE_ID) < BUFF_SET_PRICE)
- {
- return showText(st, "Sorry", "You don't have the enough items: You need: " + BUFF_SET_PRICE + " " + getItemNameHtml(st, CONSUMABLE_ID) + "!", false, "0", "0");
- }
- }
- final List buff_sets = new ArrayList<>();
- final int player_class;
- if (player.isMageClass())
- {
- player_class = 1;
- }
- else
- {
- player_class = 0;
- }
- final boolean getSummonbuff = isPetBuff(st);
- if (!getSummonbuff)
- {
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT buffId,buffLevel FROM npcbuffer_buff_list WHERE forClass IN (?,?) ORDER BY id ASC");
- statement.setInt(1, player_class);
- statement.setString(2, "2");
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- final int id = rss.getInt("buffId");
- final int lvl = rss.getInt("buffLevel");
- buff_sets.add(new int[]
- {
- id,
- lvl
- });
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- player.setTarget(player);
- player.broadcastPacket(new MagicSkillUse(player, SKILL_BUFF_1, 1, 1000, 0));
- player.broadcastPacket(new MagicSkillUse(player, SKILL_BUFF_2, 1, 1000, 0));
- for (int[] i : buff_sets)
- {
- SkillData.getInstance().getSkill(i[0], i[1]).applyEffects(player, player);
- }
- }
- else
- {
- if (player.getSummon() != null)
- {
- try (Connection con = DatabaseFactory.getInstance().getConnection())
- {
- final PreparedStatement statement = con.prepareStatement("SELECT buffId,buffLevel FROM npcbuffer_buff_list WHERE forClass IN (?,?) ORDER BY id ASC");
- statement.setString(1, "0");
- statement.setString(2, "2");
- final ResultSet rss = statement.executeQuery();
- while (rss.next())
- {
- final int id = rss.getInt("buffId");
- final int lvl = rss.getInt("buffLevel");
- buff_sets.add(new int[]
- {
- id,
- lvl
- });
- }
- statement.close();
- rss.close();
- }
- catch (SQLException e)
- {
- print(e);
- }
- player.getSummon().setTarget(player.getSummon());
- player.getSummon().broadcastPacket(new MagicSkillUse(player.getSummon(), SKILL_BUFF_1, 1, 1000, 0));
- player.getSummon().broadcastPacket(new MagicSkillUse(player.getSummon(), SKILL_BUFF_2, 1, 1000, 0));
- for (int[] i : buff_sets)
- {
- SkillData.getInstance().getSkill(i[0], i[1]).applyEffects(player.getSummon(), player.getSummon());
- }
- }
- else
- {
- return showText(st, "Info", "You can't use the Pet's options. Summon your pet first!", false, "Return", "main");
- }
- }
- takeItems(player, CONSUMABLE_ID, BUFF_SET_PRICE);
- if (TIME_OUT)
- {
- addTimeout(st, 3, TIME_OUT_TIME, 600);
- }
- }
- return SMART_WINDOW ? null : rebuildMainHtml(st);
- }
- }
- return rebuildMainHtml(st);
- }
-
- @SuppressWarnings("unused")
- @Override
- public String onFirstTalk(L2Npc npc, L2PcInstance player)
- {
- QuestState st = player.getQuestState(QUEST_LOADING_INFO);
- if (st == null)
- {
- st = newQuestState(player);
- }
- if (player.isGM())
- {
- if (SCRIPT_RELOAD)
- {
- return reloadPanel(st);
- }
- return rebuildMainHtml(st);
- }
- else if ((int) (System.currentTimeMillis() / 1000) < st.getInt("blockUntilTime"))
- {
- return showText(st, "Sorry", "You have to wait a while! if you wish to use my services!", false, "Return", "main");
- }
- if (!BUFF_WITH_KARMA && (player.getKarma() > 0))
- {
- return showText(st, "Info", "You have too much karma! Come back, when you don't have any karma!", false, "Return", "main");
- }
- else if (OlympiadManager.getInstance().isRegistered(player))
- {
- return showText(st, "Info", "You can not buff while you are in Olympiad! Come back, when you are out of the Olympiad.", false, "Return", "main");
- }
- else if (TvTEvent.isPlayerParticipant(player.getObjectId()))
- {
- return showText(st, "Info", "You can not buff while you are in TvT! Come back, when you are out of TvT!", false, "Return", "main");
- }
- else if (player.getLevel() < MIN_LEVEL)
- {
- return showText(st, "Info", "Your level is too low! You have to be at least level " + MIN_LEVEL + " , to use my services!", false, "Return", "main");
- }
- else if (player.getPvpFlag() > 0)
- {
- return showText(st, "Info", "You can't buff while you are flagged! Wait some time and try again!", false, "Return", "main");
- }
- else if (player.isInCombat())
- {
- return showText(st, "Info", "You can't buff while you are attacking! Stop your fight and try again!", false, "Return", "main");
- }
- else
- {
- return rebuildMainHtml(st);
- }
- }
-
- @Override
- public boolean showResult(L2PcInstance player, String res)
- {
- if (SMART_WINDOW)
- {
- if ((player != null) && (res != null) && res.startsWith(""))
- {
- final NpcHtmlMessage npcReply = new NpcHtmlMessage();
- npcReply.setHtml(res);
- player.sendPacket(npcReply);
- player.sendPacket(ActionFailed.STATIC_PACKET);
- return false;
- }
- }
- return super.showResult(player, res);
- }
-
- private String getSkillIconHtml(int id, int level)
- {
- final String iconNumber = getSkillIconNumber(id, level);
- return " 9) && (id < 100))
- {
- formatted = "00" + id;
- }
- else if ((id > 99) && (id < 1000))
- {
- formatted = "0" + id;
- }
- else if (id == 1517)
- {
- formatted = "1536";
- }
- else if (id == 1518)
- {
- formatted = "1537";
- }
- else if (id == 1547)
- {
- formatted = "0065";
- }
- else if (id == 2076)
- {
- formatted = "0195";
- }
- else if ((id > 4550) && (id < 4555))
- {
- formatted = "5739";
- }
- else if ((id > 4698) && (id < 4701))
- {
- formatted = "1331";
- }
- else if ((id > 4701) && (id < 4704))
- {
- formatted = "1332";
- }
- else if (id == 6049)
- {
- formatted = "0094";
- }
- else
- {
- formatted = String.valueOf(id);
- }
- return formatted;
- }
-
- public static void main(String[] args)
- {
- new NpcBuffer();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/OlympiadManagerLink.java b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/OlympiadManagerLink.java
index 34a360b96b..3481d07dfd 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/OlympiadManagerLink.java
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/scripts/handlers/bypasshandlers/OlympiadManagerLink.java
@@ -21,9 +21,8 @@ import java.util.List;
import java.util.logging.Level;
import com.l2jmobius.Config;
-import com.l2jmobius.gameserver.data.sql.impl.NpcBufferTable;
-import com.l2jmobius.gameserver.data.sql.impl.NpcBufferTable.NpcBufferData;
import com.l2jmobius.gameserver.data.xml.impl.MultisellData;
+import com.l2jmobius.gameserver.data.xml.impl.SkillData;
import com.l2jmobius.gameserver.handler.IBypassHandler;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.actor.L2Npc;
@@ -283,16 +282,10 @@ public class OlympiadManagerLink implements IBypassHandler
return false;
}
- final NpcBufferData npcBuffGroupInfo = NpcBufferTable.getInstance().getSkillInfo(target.getId(), BUFFS[index]);
- if (npcBuffGroupInfo == null)
- {
- LOGGER.warning("Olympiad Buffer Warning: npcId = " + target.getId() + " Location: " + target.getX() + ", " + target.getY() + ", " + target.getZ() + " Player: " + activeChar.getName() + " has tried to use skill group (" + params[1] + ") not assigned to the NPC Buffer!");
- return false;
- }
-
if (buffCount > 0)
{
- final Skill skill = npcBuffGroupInfo.getSkill().getSkill();
+ // TODO: Add allowed buff list check?
+ final Skill skill = SkillData.getInstance().getSkill(target.getId(), BUFFS[index]);
if (skill != null)
{
target.setTarget(activeChar);
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/stats/npcs/custom/SchemeBuffer.xml b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/stats/npcs/custom/SchemeBuffer.xml
index f7aa28c5be..3bce0fd3ed 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/stats/npcs/custom/SchemeBuffer.xml
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/stats/npcs/custom/SchemeBuffer.xml
@@ -1,6 +1,6 @@
-
+
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/stats/npcs/custom/custom.xml b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/stats/npcs/custom/custom.xml
index 559b47853a..36d226a42c 100644
--- a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/stats/npcs/custom/custom.xml
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/stats/npcs/custom/custom.xml
@@ -52,10 +52,4 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/data/xsd/SchemeBufferSkills.xsd b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/xsd/SchemeBufferSkills.xsd
new file mode 100644
index 0000000000..91ae871150
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/data/xsd/SchemeBufferSkills.xsd
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+ Magnus' Chant Siren's Dance Song of Champion
+
+
+
+
+
+ Mental Shield Magic Barrier Shield Blessed Body Blessed Soul Empower Berserker Spirit Might Focus Concentration Acumen Haste Agility Wind Walk Guidance Death Whisper Bless Shield Resist Shock Vampiric Rage Wild Magic Advanced Block Elemental Protection Divine Protection Arcane Protection Prophecy of Water Prophecy of Fire Prophecy of Wind Chant of Victory Greater Might Greater Shield War Chant Earth Chant Clarity Dance of the Warrior Dance of Inspiration Dance of the Mystic Dance of Fire Dance of Fury Dance of Concentration Dance of Light Dance of Aqua Guard Dance of Earth Guard Dance of the Vampire Dance of Protection Song of Earth Song of Life Song of Water Song of Warding Song of Wind Song of Hunter Song of Invocation Song of Vitality Song of Vengeance Song of Flame Guard Song of Storm Guard Song of Renewal Song of Meditation
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java
index a507962a3d..1652418d10 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java
@@ -128,6 +128,7 @@ public final class Config
public static final String CUSTOM_SCREEN_WELCOME_MESSAGE_CONFIG_FILE = "./config/Custom/ScreenWelcomeMessage.ini";
public static final String CUSTOM_SELL_BUFFS_CONFIG_FILE = "./config/Custom/SellBuffs.ini";
public static final String CUSTOM_SERVER_TIME_CONFIG_FILE = "./config/Custom/ServerTime.ini";
+ public static final String CUSTOM_SCHEME_BUFFER_CONFIG_FILE = "./config/Custom/ShemeBuffer.ini";
public static final String CUSTOM_STARTING_LOCATION_CONFIG_FILE = "./config/Custom/StartingLocation.ini";
public static final String CUSTOM_TVT_CONFIG_FILE = "./config/Custom/TeamVersusTeam.ini";
public static final String CUSTOM_VOTE_REWARD_CONFIG_FILE = "./config/Custom/VoteReward.ini";
@@ -1175,6 +1176,8 @@ public final class Config
public static boolean OFFLINE_FAME;
public static boolean STORE_OFFLINE_TRADE_IN_REALTIME;
public static boolean DISPLAY_SERVER_TIME;
+ public static int BUFFER_MAX_SCHEMES;
+ public static int BUFFER_STATIC_BUFF_COST;
public static boolean WELCOME_MESSAGE_ENABLED;
public static String WELCOME_MESSAGE_TEXT;
public static int WELCOME_MESSAGE_TIME;
@@ -3021,6 +3024,12 @@ public final class Config
DISPLAY_SERVER_TIME = ServerTime.getBoolean("DisplayServerTime", false);
+ // Load SchemeBuffer config file (if exists)
+ final PropertiesParser SchemeBuffer = new PropertiesParser(CUSTOM_SCHEME_BUFFER_CONFIG_FILE);
+
+ BUFFER_MAX_SCHEMES = SchemeBuffer.getInt("BufferMaxSchemesPerChar", 4);
+ BUFFER_STATIC_BUFF_COST = SchemeBuffer.getInt("BufferStaticCostPerBuff", -1);
+
// Load StartingLocation config file (if exists)
final PropertiesParser StartingLocation = new PropertiesParser(CUSTOM_STARTING_LOCATION_CONFIG_FILE);
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameServer.java
index d2c54dcb86..2e024a6666 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameServer.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/GameServer.java
@@ -38,7 +38,6 @@ import com.l2jmobius.gameserver.data.sql.impl.CharNameTable;
import com.l2jmobius.gameserver.data.sql.impl.CharSummonTable;
import com.l2jmobius.gameserver.data.sql.impl.ClanTable;
import com.l2jmobius.gameserver.data.sql.impl.CrestTable;
-import com.l2jmobius.gameserver.data.sql.impl.NpcBufferTable;
import com.l2jmobius.gameserver.data.sql.impl.OfflineTradersTable;
import com.l2jmobius.gameserver.data.sql.impl.TeleportLocationTable;
import com.l2jmobius.gameserver.data.xml.impl.AdminData;
@@ -81,6 +80,7 @@ import com.l2jmobius.gameserver.data.xml.impl.TransformData;
import com.l2jmobius.gameserver.data.xml.impl.UIData;
import com.l2jmobius.gameserver.datatables.AugmentationData;
import com.l2jmobius.gameserver.datatables.BotReportTable;
+import com.l2jmobius.gameserver.datatables.SchemeBufferTable;
import com.l2jmobius.gameserver.datatables.EventDroplist;
import com.l2jmobius.gameserver.datatables.ItemTable;
import com.l2jmobius.gameserver.datatables.MerchantPriceConfigTable;
@@ -273,7 +273,7 @@ public class GameServer
StaticObjectData.getInstance();
ItemAuctionManager.getInstance();
CastleManager.getInstance().loadInstances();
- NpcBufferTable.getInstance();
+ SchemeBufferTable.getInstance();
ZoneManager.getInstance();
GrandBossManager.getInstance().initZones();
EventDroplist.getInstance();
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/data/sql/impl/NpcBufferTable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/data/sql/impl/NpcBufferTable.java
deleted file mode 100644
index ae2fbe4f3f..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/data/sql/impl/NpcBufferTable.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.gameserver.data.sql.impl;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import com.l2jmobius.Config;
-import com.l2jmobius.commons.database.DatabaseFactory;
-import com.l2jmobius.gameserver.model.holders.ItemHolder;
-import com.l2jmobius.gameserver.model.holders.SkillHolder;
-
-public class NpcBufferTable
-{
- private static final Logger LOGGER = Logger.getLogger(NpcBufferTable.class.getName());
-
- private final Map _buffers = new HashMap<>();
-
- public static class NpcBufferData
- {
- private final SkillHolder _skill;
- private final ItemHolder _fee;
-
- protected NpcBufferData(int skillId, int skillLevel, int feeId, int feeAmount)
- {
- _skill = new SkillHolder(skillId, skillLevel);
- _fee = new ItemHolder(feeId, feeAmount);
- }
-
- public SkillHolder getSkill()
- {
- return _skill;
- }
-
- public ItemHolder getFee()
- {
- return _fee;
- }
- }
-
- private static class NpcBufferSkills
- {
- private final int _npcId;
- private final Map _skills = new HashMap<>();
-
- protected NpcBufferSkills(int npcId)
- {
- _npcId = npcId;
- }
-
- public void addSkill(int skillId, int skillLevel, int skillFeeId, int skillFeeAmount, int buffGroup)
- {
- _skills.put(buffGroup, new NpcBufferData(skillId, skillLevel, skillFeeId, skillFeeAmount));
- }
-
- public NpcBufferData getSkillGroupInfo(int buffGroup)
- {
- return _skills.get(buffGroup);
- }
-
- @SuppressWarnings("unused")
- public int getNpcId()
- {
- return _npcId;
- }
- }
-
- protected NpcBufferTable()
- {
- int skillCount = 0;
- try (Connection con = DatabaseFactory.getInstance().getConnection();
- Statement s = con.createStatement();
- ResultSet rset = s.executeQuery("SELECT `npc_id`,`skill_id`,`skill_level`,`skill_fee_id`,`skill_fee_amount`,`buff_group` FROM `npc_buffer` ORDER BY `npc_id` ASC"))
- {
- int lastNpcId = 0;
- NpcBufferSkills skills = null;
-
- while (rset.next())
- {
- final int npcId = rset.getInt("npc_id");
- final int skillId = rset.getInt("skill_id");
- final int skillLevel = rset.getInt("skill_level");
- final int skillFeeId = rset.getInt("skill_fee_id");
- final int skillFeeAmount = rset.getInt("skill_fee_amount");
- final int buffGroup = rset.getInt("buff_group");
-
- if (npcId != lastNpcId)
- {
- if (lastNpcId != 0)
- {
- _buffers.put(lastNpcId, skills);
- }
-
- skills = new NpcBufferSkills(npcId);
- skills.addSkill(skillId, skillLevel, skillFeeId, skillFeeAmount, buffGroup);
- }
- else if (skills != null)
- {
- skills.addSkill(skillId, skillLevel, skillFeeId, skillFeeAmount, buffGroup);
- }
-
- lastNpcId = npcId;
- skillCount++;
- }
-
- if (lastNpcId != 0)
- {
- _buffers.put(lastNpcId, skills);
- }
- }
- catch (SQLException e)
- {
- LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Error reading npc_buffer table: " + e.getMessage(), e);
- }
-
- if (Config.CUSTOM_NPCBUFFER_TABLES)
- {
- try (Connection con = DatabaseFactory.getInstance().getConnection();
- Statement s = con.createStatement();
- ResultSet rset = s.executeQuery("SELECT `npc_id`,`skill_id`,`skill_level`,`skill_fee_id`,`skill_fee_amount`,`buff_group` FROM `custom_npc_buffer` ORDER BY `npc_id` ASC"))
- {
- int lastNpcId = 0;
- NpcBufferSkills skills = null;
- while (rset.next())
- {
- final int npcId = rset.getInt("npc_id");
- final int skillId = rset.getInt("skill_id");
- final int skillLevel = rset.getInt("skill_level");
- final int skillFeeId = rset.getInt("skill_fee_id");
- final int skillFeeAmount = rset.getInt("skill_fee_amount");
- final int buffGroup = rset.getInt("buff_group");
-
- if (npcId != lastNpcId)
- {
- if (lastNpcId != 0)
- {
- _buffers.put(lastNpcId, skills);
- }
-
- skills = new NpcBufferSkills(npcId);
- skills.addSkill(skillId, skillLevel, skillFeeId, skillFeeAmount, buffGroup);
- }
- else if (skills != null)
- {
- skills.addSkill(skillId, skillLevel, skillFeeId, skillFeeAmount, buffGroup);
- }
- lastNpcId = npcId;
- skillCount++;
- }
-
- if (lastNpcId != 0)
- {
- _buffers.put(lastNpcId, skills);
- }
- }
- catch (SQLException e)
- {
- LOGGER.log(Level.SEVERE, getClass().getSimpleName() + ": Error reading custom_npc_buffer table: " + e.getMessage(), e);
- }
- }
- LOGGER.info(getClass().getSimpleName() + ": Loaded " + _buffers.size() + " buffers and " + skillCount + " skills.");
- }
-
- public NpcBufferData getSkillInfo(int npcId, int buffGroup)
- {
- final NpcBufferSkills skills = _buffers.get(npcId);
- return skills != null ? skills.getSkillGroupInfo(buffGroup) : null;
- }
-
- public static NpcBufferTable getInstance()
- {
- return SingletonHolder._instance;
- }
-
- private static class SingletonHolder
- {
- protected static final NpcBufferTable _instance = new NpcBufferTable();
- }
-}
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/SchemeBufferTable.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/SchemeBufferTable.java
new file mode 100644
index 0000000000..10b3939b27
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/datatables/SchemeBufferTable.java
@@ -0,0 +1,289 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.gameserver.datatables;
+
+import java.io.File;
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.logging.Logger;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+import com.l2jmobius.Config;
+import com.l2jmobius.commons.database.DatabaseFactory;
+import com.l2jmobius.gameserver.model.holders.BuffSkillHolder;
+
+/**
+ * This class loads available skills and stores players' buff schemes into _schemesTable.
+ */
+public class SchemeBufferTable
+{
+ private static final Logger LOGGER = Logger.getLogger(SchemeBufferTable.class.getName());
+
+ private static final String LOAD_SCHEMES = "SELECT * FROM buffer_schemes";
+ private static final String DELETE_SCHEMES = "TRUNCATE TABLE buffer_schemes";
+ private static final String INSERT_SCHEME = "INSERT INTO buffer_schemes (object_id, scheme_name, skills) VALUES (?,?,?)";
+
+ private final Map>> _schemesTable = new ConcurrentHashMap<>();
+ private final Map _availableBuffs = new LinkedHashMap<>();
+
+ public SchemeBufferTable()
+ {
+ int count = 0;
+
+ try (Connection con = DatabaseFactory.getInstance().getConnection())
+ {
+ PreparedStatement st = con.prepareStatement(LOAD_SCHEMES);
+ ResultSet rs = st.executeQuery();
+
+ while (rs.next())
+ {
+ final int objectId = rs.getInt("object_id");
+
+ final String schemeName = rs.getString("scheme_name");
+ final String[] skills = rs.getString("skills").split(",");
+
+ ArrayList schemeList = new ArrayList<>();
+
+ for (String skill : skills)
+ {
+ // Don't feed the skills list if the list is empty.
+ if (skill.isEmpty())
+ {
+ break;
+ }
+
+ schemeList.add(Integer.valueOf(skill));
+ }
+
+ setScheme(objectId, schemeName, schemeList);
+ count++;
+ }
+
+ rs.close();
+ st.close();
+ }
+ catch (Exception e)
+ {
+ LOGGER.warning("BufferTable: Failed to load buff schemes : " + e);
+ }
+
+ try
+ {
+ DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
+ DocumentBuilder db = dbf.newDocumentBuilder();
+ Document doc = db.parse(new File("./data/SchemeBufferSkills.xml"));
+
+ final Node n = doc.getFirstChild();
+
+ for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
+ {
+ if (!d.getNodeName().equalsIgnoreCase("category"))
+ {
+ continue;
+ }
+
+ final String category = d.getAttributes().getNamedItem("type").getNodeValue();
+
+ for (Node c = d.getFirstChild(); c != null; c = c.getNextSibling())
+ {
+ if (!c.getNodeName().equalsIgnoreCase("buff"))
+ {
+ continue;
+ }
+
+ final NamedNodeMap attrs = c.getAttributes();
+ final int skillId = Integer.parseInt(attrs.getNamedItem("id").getNodeValue());
+
+ _availableBuffs.put(skillId, new BuffSkillHolder(skillId, Integer.parseInt(attrs.getNamedItem("price").getNodeValue()), category, attrs.getNamedItem("desc").getNodeValue()));
+ }
+ }
+ }
+ catch (Exception e)
+ {
+ LOGGER.warning("BufferTable: Failed to load buff info : " + e);
+ }
+ LOGGER.info("BufferTable: Loaded " + count + " players schemes and " + _availableBuffs.size() + " available buffs.");
+ }
+
+ public void saveSchemes()
+ {
+ try (Connection con = DatabaseFactory.getInstance().getConnection())
+ {
+ // Delete all entries from database.
+ PreparedStatement st = con.prepareStatement(DELETE_SCHEMES);
+ st.execute();
+ st.close();
+
+ st = con.prepareStatement(INSERT_SCHEME);
+
+ // Save _schemesTable content.
+ for (Map.Entry>> player : _schemesTable.entrySet())
+ {
+ for (Map.Entry> scheme : player.getValue().entrySet())
+ {
+ // Build a String composed of skill ids seperated by a ",".
+ final StringBuilder sb = new StringBuilder();
+ for (int skillId : scheme.getValue())
+ {
+ sb.append(skillId + ",");
+ }
+
+ // Delete the last "," : must be called only if there is something to delete !
+ if (sb.length() > 0)
+ {
+ sb.setLength(sb.length() - 1);
+ }
+
+ st.setInt(1, player.getKey());
+ st.setString(2, scheme.getKey());
+ st.setString(3, sb.toString());
+ st.addBatch();
+ }
+ }
+ st.executeBatch();
+ st.close();
+ }
+ catch (Exception e)
+ {
+ LOGGER.warning("BufferTable: Error while saving schemes : " + e);
+ }
+ }
+
+ public void setScheme(int playerId, String schemeName, ArrayList list)
+ {
+ if (!_schemesTable.containsKey(playerId))
+ {
+ _schemesTable.put(playerId, new HashMap>());
+ }
+ else if (_schemesTable.get(playerId).size() >= Config.BUFFER_MAX_SCHEMES)
+ {
+ return;
+ }
+
+ _schemesTable.get(playerId).put(schemeName, list);
+ }
+
+ /**
+ * @param playerId : The player objectId to check.
+ * @return the list of schemes for a given player.
+ */
+ public Map> getPlayerSchemes(int playerId)
+ {
+ return _schemesTable.get(playerId);
+ }
+
+ /**
+ * @param playerId : The player objectId to check.
+ * @param schemeName : The scheme name to check.
+ * @return the List holding skills for the given scheme name and player, or null (if scheme or player isn't registered).
+ */
+ public List getScheme(int playerId, String schemeName)
+ {
+ if ((_schemesTable.get(playerId) == null) || (_schemesTable.get(playerId).get(schemeName) == null))
+ {
+ return Collections.emptyList();
+ }
+
+ return _schemesTable.get(playerId).get(schemeName);
+ }
+
+ /**
+ * @param playerId : The player objectId to check.
+ * @param schemeName : The scheme name to check.
+ * @param skillId : The skill id to check.
+ * @return true if the skill is already registered on the scheme, or false otherwise.
+ */
+ public boolean getSchemeContainsSkill(int playerId, String schemeName, int skillId)
+ {
+ final List skills = getScheme(playerId, schemeName);
+ if (skills.isEmpty())
+ {
+ return false;
+ }
+
+ for (int id : skills)
+ {
+ if (id == skillId)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * @param groupType : The type of skills to return.
+ * @return a list of skills ids based on the given groupType.
+ */
+ public List getSkillsIdsByType(String groupType)
+ {
+ List skills = new ArrayList<>();
+ for (BuffSkillHolder skill : _availableBuffs.values())
+ {
+ if (skill.getType().equalsIgnoreCase(groupType))
+ {
+ skills.add(skill.getId());
+ }
+ }
+ return skills;
+ }
+
+ /**
+ * @return a list of all buff types available.
+ */
+ public List getSkillTypes()
+ {
+ List skillTypes = new ArrayList<>();
+ for (BuffSkillHolder skill : _availableBuffs.values())
+ {
+ if (!skillTypes.contains(skill.getType()))
+ {
+ skillTypes.add(skill.getType());
+ }
+ }
+ return skillTypes;
+ }
+
+ public BuffSkillHolder getAvailableBuff(int skillId)
+ {
+ return _availableBuffs.get(skillId);
+ }
+
+ public static SchemeBufferTable getInstance()
+ {
+ return SingletonHolder.INSTANCE;
+ }
+
+ private static class SingletonHolder
+ {
+ protected static final SchemeBufferTable INSTANCE = new SchemeBufferTable();
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/enums/InstanceType.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/enums/InstanceType.java
index 950ae55459..b324b50ad8 100644
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/enums/InstanceType.java
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/enums/InstanceType.java
@@ -103,7 +103,7 @@ public enum InstanceType
L2ClanHallDoormenInstance(L2DoormenInstance),
// Custom
L2ClassMasterInstance(L2NpcInstance),
- L2NpcBufferInstance(L2Npc),
+ L2SchemeBufferInstance(L2Npc),
L2EventMobInstance(L2Npc);
private final InstanceType _parent;
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcBufferInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcBufferInstance.java
deleted file mode 100644
index 906b70bebb..0000000000
--- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2NpcBufferInstance.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * This file is part of the L2J Mobius project.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- */
-package com.l2jmobius.gameserver.model.actor.instance;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.logging.Logger;
-
-import com.l2jmobius.gameserver.cache.HtmCache;
-import com.l2jmobius.gameserver.data.sql.impl.NpcBufferTable;
-import com.l2jmobius.gameserver.data.sql.impl.NpcBufferTable.NpcBufferData;
-import com.l2jmobius.gameserver.data.xml.impl.SkillData;
-import com.l2jmobius.gameserver.enums.InstanceType;
-import com.l2jmobius.gameserver.model.actor.L2Character;
-import com.l2jmobius.gameserver.model.actor.L2Npc;
-import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
-import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
-import com.l2jmobius.gameserver.model.skills.Skill;
-import com.l2jmobius.gameserver.network.SystemMessageId;
-import com.l2jmobius.gameserver.network.serverpackets.ActionFailed;
-import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
-import com.l2jmobius.gameserver.network.serverpackets.SystemMessage;
-import com.l2jmobius.gameserver.taskmanager.AttackStanceTaskManager;
-
-/**
- * The Class L2NpcBufferInstance.
- * Zoey76: TODO: Unhardcode as DP base script for NPC Buffers.
- */
-public class L2NpcBufferInstance extends L2Npc
-{
- private static final Logger LOGGER = Logger.getLogger(L2NpcBufferInstance.class.getName());
-
- private static final Map pageVal = new HashMap<>();
-
- /**
- * Creates a NPC buffer.
- * @param template the template
- */
- public L2NpcBufferInstance(L2NpcTemplate template)
- {
- super(template);
- setInstanceType(InstanceType.L2NpcBufferInstance);
- }
-
- @Override
- public void showChatWindow(L2PcInstance player, int val)
- {
- if (player == null)
- {
- return;
- }
-
- String htmContent = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/html/mods/NpcBuffer.htm");
- if (val > 0)
- {
- htmContent = HtmCache.getInstance().getHtm(player.getHtmlPrefix(), "data/html/mods/NpcBuffer-" + val + ".htm");
- }
-
- if (htmContent != null)
- {
- final NpcHtmlMessage npcHtmlMessage = new NpcHtmlMessage(getObjectId());
- npcHtmlMessage.setHtml(htmContent);
- npcHtmlMessage.replace("%objectId%", String.valueOf(getObjectId()));
- player.sendPacket(npcHtmlMessage);
- }
- player.sendPacket(ActionFailed.STATIC_PACKET);
- }
-
- @Override
- public void onBypassFeedback(L2PcInstance player, String command)
- {
- // BypassValidation Exploit plug.
- if ((player == null) || (player.getLastFolkNPC() == null) || (player.getLastFolkNPC().getObjectId() != getObjectId()))
- {
- return;
- }
-
- L2Character target = player;
- if (command.startsWith("Pet"))
- {
- if (!player.hasSummon()) // TODO: Should be hasPet() ?
- {
- player.sendPacket(SystemMessageId.YOU_DO_NOT_HAVE_A_PET);
- showChatWindow(player, 0); // 0 = main window
- return;
- }
- target = player.getSummon();
- }
-
- final int npcId = getId();
- if (command.startsWith("Chat"))
- {
- final int val = Integer.parseInt(command.substring(5));
-
- pageVal.put(player.getObjectId(), val);
-
- showChatWindow(player, val);
- }
- else if (command.startsWith("Buff") || command.startsWith("PetBuff"))
- {
- final String[] buffGroupArray = command.substring(command.indexOf("Buff") + 5).split(" ");
-
- for (String buffGroupList : buffGroupArray)
- {
- if (buffGroupList == null)
- {
- LOGGER.warning("NPC Buffer Warning: npcId = " + npcId + " has no buffGroup set in the bypass for the buff selected.");
- return;
- }
-
- final int buffGroup = Integer.parseInt(buffGroupList);
-
- final NpcBufferData npcBuffGroupInfo = NpcBufferTable.getInstance().getSkillInfo(npcId, buffGroup);
- if (npcBuffGroupInfo == null)
- {
- LOGGER.warning("NPC Buffer Warning: npcId = " + npcId + " Location: " + getX() + ", " + getY() + ", " + getZ() + " Player: " + player.getName() + " has tried to use skill group (" + buffGroup + ") not assigned to the NPC Buffer!");
- return;
- }
-
- if (npcBuffGroupInfo.getFee().getId() != 0)
- {
- final L2ItemInstance itemInstance = player.getInventory().getItemByItemId(npcBuffGroupInfo.getFee().getId());
- if ((itemInstance == null) || (!itemInstance.isStackable() && (player.getInventory().getInventoryItemCount(npcBuffGroupInfo.getFee().getId(), -1) < npcBuffGroupInfo.getFee().getCount())))
- {
- final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_NOT_ENOUGH_NECESSARY_ITEMS_TO_USE_THE_SKILL);
- player.sendPacket(sm);
- continue;
- }
-
- if (itemInstance.isStackable())
- {
- if (!player.destroyItemByItemId("Npc Buffer", npcBuffGroupInfo.getFee().getId(), npcBuffGroupInfo.getFee().getCount(), player.getTarget(), true))
- {
- final SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.THERE_ARE_NOT_ENOUGH_NECESSARY_ITEMS_TO_USE_THE_SKILL);
- player.sendPacket(sm);
- continue;
- }
- }
- else
- {
- for (int i = 0; i < npcBuffGroupInfo.getFee().getCount(); ++i)
- {
- player.destroyItemByItemId("Npc Buffer", npcBuffGroupInfo.getFee().getId(), 1, player.getTarget(), true);
- }
- }
- }
-
- final Skill skill = SkillData.getInstance().getSkill(npcBuffGroupInfo.getSkill().getSkillId(), npcBuffGroupInfo.getSkill().getSkillLevel());
- if (skill != null)
- {
- skill.applyEffects(player, target);
- }
- }
-
- showChatWindow(player, pageVal.get(player.getObjectId()));
- }
- else if (command.startsWith("Heal") || command.startsWith("PetHeal"))
- {
- if (!target.isInCombat() && !AttackStanceTaskManager.getInstance().hasAttackStanceTask(target))
- {
- final String[] healArray = command.substring(command.indexOf("Heal") + 5).split(" ");
-
- for (String healType : healArray)
- {
- if (healType.equalsIgnoreCase("HP"))
- {
- target.setCurrentHp(target.getMaxHp());
- }
- else if (healType.equalsIgnoreCase("MP"))
- {
- target.setCurrentMp(target.getMaxMp());
- }
- else if (healType.equalsIgnoreCase("CP"))
- {
- target.setCurrentCp(target.getMaxCp());
- }
- }
- }
- showChatWindow(player, pageVal.get(player.getObjectId()));
- }
- else if (command.startsWith("RemoveBuffs") || command.startsWith("PetRemoveBuffs"))
- {
- target.stopAllEffectsExceptThoseThatLastThroughDeath();
- showChatWindow(player, pageVal.get(player.getObjectId()));
- }
- else
- {
- super.onBypassFeedback(player, command);
- }
- }
-}
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SchemeBufferInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SchemeBufferInstance.java
new file mode 100644
index 0000000000..0fd04cb1bb
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2SchemeBufferInstance.java
@@ -0,0 +1,450 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.gameserver.model.actor.instance;
+
+import java.text.NumberFormat;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.StringTokenizer;
+
+import com.l2jmobius.Config;
+import com.l2jmobius.gameserver.data.xml.impl.SkillData;
+import com.l2jmobius.gameserver.datatables.SchemeBufferTable;
+import com.l2jmobius.gameserver.model.actor.L2Character;
+import com.l2jmobius.gameserver.model.actor.L2Npc;
+import com.l2jmobius.gameserver.model.actor.L2Summon;
+import com.l2jmobius.gameserver.model.actor.templates.L2NpcTemplate;
+import com.l2jmobius.gameserver.network.serverpackets.NpcHtmlMessage;
+
+public class L2SchemeBufferInstance extends L2Npc
+{
+ private static final int PAGE_LIMIT = 6;
+
+ public L2SchemeBufferInstance(L2NpcTemplate template)
+ {
+ super(template);
+ }
+
+ @Override
+ public void onBypassFeedback(L2PcInstance player, String command)
+ {
+ StringTokenizer st = new StringTokenizer(command, " ");
+ String currentCommand = st.nextToken();
+
+ if (currentCommand.startsWith("menu"))
+ {
+ final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
+ html.setFile(player.getHtmlPrefix(), getHtmlPath(getId(), 0));
+ html.replace("%objectId%", getObjectId());
+ player.sendPacket(html);
+ }
+ else if (currentCommand.startsWith("cleanup"))
+ {
+ player.stopAllEffects();
+
+ final L2Summon summon = player.getSummon();
+ if (summon != null)
+ {
+ summon.stopAllEffects();
+ }
+
+ final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
+ html.setFile(player.getHtmlPrefix(), getHtmlPath(getId(), 0));
+ html.replace("%objectId%", getObjectId());
+ player.sendPacket(html);
+ }
+ else if (currentCommand.startsWith("heal"))
+ {
+ player.setCurrentHpMp(player.getMaxHp(), player.getMaxMp());
+ player.setCurrentCp(player.getMaxCp());
+
+ final L2Summon summon = player.getSummon();
+ if (summon != null)
+ {
+ summon.setCurrentHpMp(summon.getMaxHp(), summon.getMaxMp());
+ }
+
+ final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
+ html.setFile(player.getHtmlPrefix(), getHtmlPath(getId(), 0));
+ html.replace("%objectId%", getObjectId());
+ player.sendPacket(html);
+ }
+ else if (currentCommand.startsWith("support"))
+ {
+ showGiveBuffsWindow(player);
+ }
+ else if (currentCommand.startsWith("givebuffs"))
+ {
+ final String schemeName = st.nextToken();
+ final int cost = Integer.parseInt(st.nextToken());
+
+ L2Character target = null;
+ if (st.hasMoreTokens())
+ {
+ final String targetType = st.nextToken();
+ if ((targetType != null) && targetType.equalsIgnoreCase("pet"))
+ {
+ target = player.getSummon();
+ }
+ }
+ else
+ {
+ target = player;
+ }
+
+ if (target == null)
+ {
+ player.sendMessage("You don't have a pet.");
+ }
+ else if ((cost == 0) || player.reduceAdena("NPC Buffer", cost, this, true))
+ {
+ for (int skillId : SchemeBufferTable.getInstance().getScheme(player.getObjectId(), schemeName))
+ {
+ SkillData.getInstance().getSkill(skillId, SkillData.getInstance().getMaxLevel(skillId)).applyEffects(this, target);
+ }
+ }
+ }
+ else if (currentCommand.startsWith("editschemes"))
+ {
+ showEditSchemeWindow(player, st.nextToken(), st.nextToken(), Integer.parseInt(st.nextToken()));
+ }
+ else if (currentCommand.startsWith("skill"))
+ {
+ final String groupType = st.nextToken();
+ final String schemeName = st.nextToken();
+
+ final int skillId = Integer.parseInt(st.nextToken());
+ final int page = Integer.parseInt(st.nextToken());
+
+ final List skills = SchemeBufferTable.getInstance().getScheme(player.getObjectId(), schemeName);
+
+ if (currentCommand.startsWith("skillselect") && !schemeName.equalsIgnoreCase("none"))
+ {
+ if (skills.size() < player.getStat().getMaxBuffCount())
+ {
+ skills.add(skillId);
+ }
+ else
+ {
+ player.sendMessage("This scheme has reached the maximum amount of buffs.");
+ }
+ }
+ else if (currentCommand.startsWith("skillunselect"))
+ {
+ skills.remove(Integer.valueOf(skillId));
+ }
+
+ showEditSchemeWindow(player, groupType, schemeName, page);
+ }
+ else if (currentCommand.startsWith("createscheme"))
+ {
+ try
+ {
+ final String schemeName = st.nextToken();
+ if (schemeName.length() > 14)
+ {
+ player.sendMessage("Scheme's name must contain up to 14 chars. Spaces are trimmed.");
+ return;
+ }
+
+ final Map> schemes = SchemeBufferTable.getInstance().getPlayerSchemes(player.getObjectId());
+ if (schemes != null)
+ {
+ if (schemes.size() == Config.BUFFER_MAX_SCHEMES)
+ {
+ player.sendMessage("Maximum schemes amount is already reached.");
+ return;
+ }
+
+ if (schemes.containsKey(schemeName))
+ {
+ player.sendMessage("The scheme name already exists.");
+ return;
+ }
+ }
+
+ SchemeBufferTable.getInstance().setScheme(player.getObjectId(), schemeName.trim(), new ArrayList());
+ showGiveBuffsWindow(player);
+ }
+ catch (Exception e)
+ {
+ player.sendMessage("Scheme's name must contain up to 14 chars. Spaces are trimmed.");
+ }
+ }
+ else if (currentCommand.startsWith("deletescheme"))
+ {
+ try
+ {
+ final String schemeName = st.nextToken();
+ final Map> schemes = SchemeBufferTable.getInstance().getPlayerSchemes(player.getObjectId());
+
+ if ((schemes != null) && schemes.containsKey(schemeName))
+ {
+ schemes.remove(schemeName);
+ }
+ }
+ catch (Exception e)
+ {
+ player.sendMessage("This scheme name is invalid.");
+ }
+ showGiveBuffsWindow(player);
+ }
+ }
+
+ @Override
+ public String getHtmlPath(int npcId, int val)
+ {
+ String filename = "";
+ if (val == 0)
+ {
+ filename = "" + npcId;
+ }
+ else
+ {
+ filename = npcId + "-" + val;
+ }
+
+ return "data/html/mods/SchemeBuffer/" + filename + ".htm";
+ }
+
+ /**
+ * Sends an html packet to player with Give Buffs menu info for player and pet, depending on targetType parameter {player, pet}
+ * @param player : The player to make checks on.
+ */
+ private void showGiveBuffsWindow(L2PcInstance player)
+ {
+ final StringBuilder sb = new StringBuilder(200);
+
+ final Map> schemes = SchemeBufferTable.getInstance().getPlayerSchemes(player.getObjectId());
+ if ((schemes == null) || schemes.isEmpty())
+ {
+ sb.append("You haven't defined any scheme. ");
+ }
+ else
+ {
+ for (Map.Entry> scheme : schemes.entrySet())
+ {
+ final int cost = getFee(scheme.getValue());
+ sb.append("" + scheme.getKey() + " [" + scheme.getValue().size() + " / " + player.getStat().getMaxBuffCount() + "]" + ((cost > 0) ? " - cost: " + NumberFormat.getInstance(Locale.ENGLISH).format(cost) : "") + " ");
+ sb.append("Use on Me | ");
+ sb.append("Use on Pet | ");
+ sb.append("Edit | ");
+ sb.append("Delete ");
+ }
+ }
+
+ final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
+ html.setFile(player.getHtmlPrefix(), getHtmlPath(getId(), 1));
+ html.replace("%schemes%", sb.toString());
+ html.replace("%max_schemes%", Config.BUFFER_MAX_SCHEMES);
+ html.replace("%objectId%", getObjectId());
+ player.sendPacket(html);
+ }
+
+ /**
+ * This sends an html packet to player with Edit Scheme Menu info. This allows player to edit each created scheme (add/delete skills)
+ * @param player : The player to make checks on.
+ * @param groupType : The group of skills to select.
+ * @param schemeName : The scheme to make check.
+ * @param page The page.
+ */
+ private void showEditSchemeWindow(L2PcInstance player, String groupType, String schemeName, int page)
+ {
+ final NpcHtmlMessage html = new NpcHtmlMessage(getObjectId());
+ final List schemeSkills = SchemeBufferTable.getInstance().getScheme(player.getObjectId(), schemeName);
+
+ html.setFile(player.getHtmlPrefix(), getHtmlPath(getId(), 2));
+ html.replace("%schemename%", schemeName);
+ html.replace("%count%", schemeSkills.size() + " / " + player.getStat().getMaxBuffCount());
+ html.replace("%typesframe%", getTypesFrame(groupType, schemeName));
+ html.replace("%skilllistframe%", getGroupSkillList(player, groupType, schemeName, page));
+ html.replace("%objectId%", getObjectId());
+ player.sendPacket(html);
+ }
+
+ /**
+ * @param player : The player to make checks on.
+ * @param groupType : The group of skills to select.
+ * @param schemeName : The scheme to make check.
+ * @param page The page.
+ * @return a String representing skills available to selection for a given groupType.
+ */
+ private String getGroupSkillList(L2PcInstance player, String groupType, String schemeName, int page)
+ {
+ // Retrieve the entire skills list based on group type.
+ List skills = SchemeBufferTable.getInstance().getSkillsIdsByType(groupType);
+ if (skills.isEmpty())
+ {
+ return "That group doesn't contain any skills.";
+ }
+
+ // Calculate page number.
+ final int max = countPagesNumber(skills.size(), PAGE_LIMIT);
+ if (page > max)
+ {
+ page = max;
+ }
+
+ // Cut skills list up to page number.
+ skills = skills.subList((page - 1) * PAGE_LIMIT, Math.min(page * PAGE_LIMIT, skills.size()));
+
+ final List schemeSkills = SchemeBufferTable.getInstance().getScheme(player.getObjectId(), schemeName);
+ final StringBuilder sb = new StringBuilder(skills.size() * 150);
+
+ int row = 0;
+ for (int skillId : skills)
+ {
+ sb.append(((row % 2) == 0 ? "" : ""));
+
+ if (skillId < 100)
+ {
+ if (schemeSkills.contains(skillId))
+ {
+ sb.append("" + SkillData.getInstance().getSkill(skillId, 1).getName() + "" + SchemeBufferTable.getInstance().getAvailableBuff(skillId).getDescription() + " ");
+ }
+ else
+ {
+ sb.append("" + SkillData.getInstance().getSkill(skillId, 1).getName() + "" + SchemeBufferTable.getInstance().getAvailableBuff(skillId).getDescription() + " ");
+ }
+ }
+ else if (skillId < 1000)
+ {
+ if (schemeSkills.contains(skillId))
+ {
+ sb.append("" + SkillData.getInstance().getSkill(skillId, 1).getName() + "" + SchemeBufferTable.getInstance().getAvailableBuff(skillId).getDescription() + " ");
+ }
+ else
+ {
+ sb.append("" + SkillData.getInstance().getSkill(skillId, 1).getName() + "" + SchemeBufferTable.getInstance().getAvailableBuff(skillId).getDescription() + " ");
+ }
+ }
+ else
+ {
+ if (schemeSkills.contains(skillId))
+ {
+ sb.append("" + SkillData.getInstance().getSkill(skillId, 1).getName() + "" + SchemeBufferTable.getInstance().getAvailableBuff(skillId).getDescription() + " ");
+ }
+ else
+ {
+ sb.append("" + SkillData.getInstance().getSkill(skillId, 1).getName() + "" + SchemeBufferTable.getInstance().getAvailableBuff(skillId).getDescription() + " ");
+ }
+ }
+
+ sb.append("
");
+ row++;
+ }
+
+ // Build page footer.
+ sb.append("");
+
+ if (page > 1)
+ {
+ sb.append("Previous ");
+ }
+ else
+ {
+ sb.append("Previous ");
+ }
+
+ sb.append("Page " + page + " ");
+
+ if (page < max)
+ {
+ sb.append("Next ");
+ }
+ else
+ {
+ sb.append("Next ");
+ }
+
+ sb.append("
");
+
+ return sb.toString();
+ }
+
+ /**
+ * @param groupType : The group of skills to select.
+ * @param schemeName : The scheme to make check.
+ * @return a string representing all groupTypes available. The group currently on selection isn't linkable.
+ */
+ private static String getTypesFrame(String groupType, String schemeName)
+ {
+ final StringBuilder sb = new StringBuilder(500);
+ sb.append("");
+
+ int count = 0;
+ for (String type : SchemeBufferTable.getInstance().getSkillTypes())
+ {
+ if (count == 0)
+ {
+ sb.append("");
+ }
+
+ if (groupType.equalsIgnoreCase(type))
+ {
+ sb.append("" + type + " ");
+ }
+ else
+ {
+ sb.append("" + type + " ");
+ }
+
+ count++;
+ if (count == 4)
+ {
+ sb.append(" ");
+ count = 0;
+ }
+ }
+
+ if (!sb.toString().endsWith(""))
+ {
+ sb.append("");
+ }
+
+ sb.append("
");
+
+ return sb.toString();
+ }
+
+ /**
+ * @param list : A list of skill ids.
+ * @return a global fee for all skills contained in list.
+ */
+ private static int getFee(ArrayList list)
+ {
+ if (Config.BUFFER_STATIC_BUFF_COST > 0)
+ {
+ return list.size() * Config.BUFFER_STATIC_BUFF_COST;
+ }
+
+ int fee = 0;
+ for (int sk : list)
+ {
+ fee += SchemeBufferTable.getInstance().getAvailableBuff(sk).getValue();
+ }
+
+ return fee;
+ }
+
+ private static int countPagesNumber(int objectsSize, int pageSize)
+ {
+ return (objectsSize / pageSize) + ((objectsSize % pageSize) == 0 ? 0 : 1);
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/holders/BuffSkillHolder.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/holders/BuffSkillHolder.java
new file mode 100644
index 0000000000..2e38a43cfb
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/holders/BuffSkillHolder.java
@@ -0,0 +1,44 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.gameserver.model.holders;
+
+/**
+ * A container used for schemes buffer.
+ */
+public final class BuffSkillHolder extends IntIntHolder
+{
+ private final String _type;
+ private final String _description;
+
+ public BuffSkillHolder(int id, int price, String type, String description)
+ {
+ super(id, price);
+
+ _type = type;
+ _description = description;
+ }
+
+ public final String getType()
+ {
+ return _type;
+ }
+
+ public final String getDescription()
+ {
+ return _description;
+ }
+}
\ No newline at end of file
diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/holders/IntIntHolder.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/holders/IntIntHolder.java
new file mode 100644
index 0000000000..22d161aa38
--- /dev/null
+++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/holders/IntIntHolder.java
@@ -0,0 +1,69 @@
+/*
+ * This file is part of the L2J Mobius project.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+package com.l2jmobius.gameserver.model.holders;
+
+import com.l2jmobius.gameserver.data.xml.impl.SkillData;
+import com.l2jmobius.gameserver.model.skills.Skill;
+
+/**
+ * A generic int/int container.
+ */
+public class IntIntHolder
+{
+ private int _id;
+ private int _value;
+
+ public IntIntHolder(int id, int value)
+ {
+ _id = id;
+ _value = value;
+ }
+
+ public int getId()
+ {
+ return _id;
+ }
+
+ public int getValue()
+ {
+ return _value;
+ }
+
+ public void setId(int id)
+ {
+ _id = id;
+ }
+
+ public void setValue(int value)
+ {
+ _value = value;
+ }
+
+ /**
+ * @return the L2Skill associated to the id/value.
+ */
+ public final Skill getSkill()
+ {
+ return SkillData.getInstance().getSkill(_id, _value);
+ }
+
+ @Override
+ public String toString()
+ {
+ return getClass().getSimpleName() + ": Id: " + _id + ", Value: " + _value;
+ }
+}
\ No newline at end of file