diff --git a/trunk/dist/db_installer/sql/game/announcements.sql b/trunk/dist/db_installer/sql/game/announcements.sql index 7655c144a9..ec755e1cf7 100644 --- a/trunk/dist/db_installer/sql/game/announcements.sql +++ b/trunk/dist/db_installer/sql/game/announcements.sql @@ -11,4 +11,4 @@ CREATE TABLE IF NOT EXISTS `announcements` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8; INSERT INTO announcements (`type`, `author`, `content`) VALUES -(0, 'Mobius', 'Powered by L2J-Mobius'); \ No newline at end of file +(0, 'Mobius', 'Server powered by L2J-Mobius project.'); \ No newline at end of file diff --git a/trunk/dist/db_installer/sql/game/custom_npc_buffer.sql b/trunk/dist/db_installer/sql/game/custom_npc_buffer.sql index 5f9a6729da..e4557f9ecd 100644 --- a/trunk/dist/db_installer/sql/game/custom_npc_buffer.sql +++ b/trunk/dist/db_installer/sql/game/custom_npc_buffer.sql @@ -1,6 +1,6 @@ DROP TABLE IF EXISTS `custom_npc_buffer`; CREATE TABLE IF NOT EXISTS `custom_npc_buffer` ( - `npc_id` mediumint(7) NOT NULL, + `npc_id` int(10) 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', diff --git a/trunk/dist/db_installer/sql/game/custom_spawnlist.sql b/trunk/dist/db_installer/sql/game/custom_spawnlist.sql index 9a782d8873..259e7187bc 100644 --- a/trunk/dist/db_installer/sql/game/custom_spawnlist.sql +++ b/trunk/dist/db_installer/sql/game/custom_spawnlist.sql @@ -2,8 +2,8 @@ DROP TABLE IF EXISTS `custom_spawnlist`; CREATE TABLE IF NOT EXISTS `custom_spawnlist` ( `location` varchar(40) NOT NULL DEFAULT '', `count` tinyint(1) unsigned NOT NULL DEFAULT '0', - `npc_templateid` mediumint(7) unsigned NOT NULL DEFAULT '0', - `locx` mediumint(6) NOT NULL DEFAULT '0', + `npc_templateid` int(10) unsigned NOT NULL DEFAULT '0', + `locx` mediumint(8) NOT NULL DEFAULT '0', `locy` mediumint(6) NOT NULL DEFAULT '0', `locz` mediumint(6) NOT NULL DEFAULT '0', `randomx` mediumint(6) NOT NULL DEFAULT '0', diff --git a/trunk/dist/db_installer/sql/game/raidboss_spawnlist.sql b/trunk/dist/db_installer/sql/game/raidboss_spawnlist.sql index 26d1f3d50c..40347c1d2e 100644 --- a/trunk/dist/db_installer/sql/game/raidboss_spawnlist.sql +++ b/trunk/dist/db_installer/sql/game/raidboss_spawnlist.sql @@ -331,9 +331,9 @@ INSERT IGNORE INTO `raidboss_spawnlist` (`boss_id`,`loc_x`,`loc_y`,`loc_z`,`head -- (29144,0,0,0,0,0,0,0,0), -- Lost Captain (78) (Spawned by Kamaloka's instance) -- (29147,0,0,0,0,0,0,0,0), -- Lost Captain (81) (Spawned by Kamaloka's instance) -- (29186,0,0,0,0,0,0,0,0), -- Balor (85) (stats to be done) -(25725,152316,110439,-5520,36811,129600,86400,6165648,20499), -- Drake Lord (85) -(25726,145734,120031,-3912,45303,129600,86400,6165648,20499), -- Behemoth Leader (85) -(25727,148482,117859,-3712,36584,129600,86400,6165648,20499); -- Dragon Beast (85) +(25725,152260,110394,-5552,0,129600,86400,6165648,20499), -- Drake Lord (85) +(25726,145788,120118,-3912,32768,129600,86400,6165648,20499), -- Behemoth Leader (85) +(25727,148241,117965,-3712,0,129600,86400,6165648,20499); -- Dragon Beast (85) -- Removed DELETE FROM `raidboss_spawnlist` WHERE (boss_id = 25118); -- Guilotine, Warden Of The Execution Grounds diff --git a/trunk/dist/game/config/Server.ini b/trunk/dist/game/config/Server.ini index 934ec137a1..b27d7b12e8 100644 --- a/trunk/dist/game/config/Server.ini +++ b/trunk/dist/game/config/Server.ini @@ -57,7 +57,7 @@ Password = # Available: C3P0, HikariCP, BoneCP ConnectionPool = C3P0 -# Default: 100 +# Default: 500 MaximumDbConnections = 500 # Default: 0 diff --git a/trunk/dist/game/config/default-ipconfig.xml b/trunk/dist/game/config/default-ipconfig.xml index 62dcd4e788..9e13cf7b8d 100644 --- a/trunk/dist/game/config/default-ipconfig.xml +++ b/trunk/dist/game/config/default-ipconfig.xml @@ -8,4 +8,6 @@ + + \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java b/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java index 305189fff7..8e4acf7468 100644 --- a/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java +++ b/trunk/dist/game/data/scripts/handlers/admincommandhandlers/AdminBuffs.java @@ -26,6 +26,7 @@ import java.util.StringTokenizer; import com.l2jserver.Config; import com.l2jserver.gameserver.data.xml.impl.SkillTreesData; import com.l2jserver.gameserver.handler.IAdminCommandHandler; +import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; @@ -160,47 +161,39 @@ public class AdminBuffs implements IAdminCommandHandler StringTokenizer st = new StringTokenizer(command, " "); command = st.nextToken(); - L2PcInstance player = null; + L2Character creature = null; if (st.hasMoreTokens()) { - String playername = st.nextToken(); - - try + creature = L2World.getInstance().getPlayer(st.nextToken()); + if (creature == null) { - player = L2World.getInstance().getPlayer(playername); - } - catch (Exception e) - { - } - - if (player == null) - { - activeChar.sendMessage("The player " + playername + " is not online."); + activeChar.sendMessage("The player " + creature + " is not online."); return false; } } - else if ((activeChar.getTarget() != null) && activeChar.getTarget().isPlayer()) - { - player = activeChar.getTarget().getActingPlayer(); - } else { - activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET); - return false; + final L2Object target = activeChar.getTarget(); + if ((target != null) && target.isCharacter()) + { + creature = (L2Character) target; + } + + if (creature == null) + { + activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET); + return false; + } } - try + creature.resetTimeStamps(); + creature.resetDisabledSkills(); + if (creature.isPlayer()) { - player.resetTimeStamps(); - player.resetDisabledSkills(); - player.sendPacket(new SkillCoolTime(player)); - activeChar.sendMessage("Skill reuse was removed from " + player.getName() + "."); - return true; - } - catch (NullPointerException e) - { - return false; + creature.sendPacket(new SkillCoolTime(creature.getActingPlayer())); } + activeChar.sendMessage("Skill reuse was removed from " + creature.getName() + "."); + return true; } else if (command.startsWith("admin_switch_gm_buffs")) { @@ -384,4 +377,4 @@ public class AdminBuffs implements IAdminCommandHandler } } } -} +} \ No newline at end of file diff --git a/trunk/dist/game/data/scripts/handlers/effecthandlers/MagicalAttackMp.java b/trunk/dist/game/data/scripts/handlers/effecthandlers/MagicalAttackMp.java index 57f7f30058..6b83be6e22 100644 --- a/trunk/dist/game/data/scripts/handlers/effecthandlers/MagicalAttackMp.java +++ b/trunk/dist/game/data/scripts/handlers/effecthandlers/MagicalAttackMp.java @@ -68,7 +68,7 @@ public final class MagicalAttackMp extends AbstractEffect @Override public L2EffectType getEffectType() { - return L2EffectType.MAGICAL_ATTACK; + return L2EffectType.MAGICAL_ATTACK_MP; } @Override diff --git a/trunk/dist/game/data/stats/items/20700-20799.xml b/trunk/dist/game/data/stats/items/20700-20799.xml index 1dc3e34ed2..75bac71723 100644 --- a/trunk/dist/game/data/stats/items/20700-20799.xml +++ b/trunk/dist/game/data/stats/items/20700-20799.xml @@ -914,7 +914,7 @@ - + @@ -934,7 +934,7 @@ - + diff --git a/trunk/dist/game/data/stats/npcs/18200-18299.xml b/trunk/dist/game/data/stats/npcs/18200-18299.xml index 51dd58dc62..4846b3f643 100644 --- a/trunk/dist/game/data/stats/npcs/18200-18299.xml +++ b/trunk/dist/game/data/stats/npcs/18200-18299.xml @@ -3208,12 +3208,26 @@ true - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -3223,6 +3237,7 @@ + CONSTRUCT MALE @@ -3240,26 +3255,40 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -3269,6 +3298,7 @@ + CONSTRUCT MALE @@ -3286,26 +3316,40 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -3315,6 +3359,7 @@ + CONSTRUCT MALE @@ -3332,26 +3377,40 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -3361,6 +3420,7 @@ + CONSTRUCT MALE @@ -3378,26 +3438,40 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + @@ -3407,6 +3481,7 @@ + CONSTRUCT MALE @@ -3424,26 +3499,41 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -3453,6 +3543,7 @@ + CONSTRUCT MALE @@ -3470,26 +3561,41 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -3499,6 +3605,7 @@ + CONSTRUCT MALE @@ -3516,26 +3623,46 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3545,6 +3672,7 @@ + CONSTRUCT MALE @@ -3562,26 +3690,46 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3591,6 +3739,7 @@ + CONSTRUCT MALE @@ -3608,26 +3757,46 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3637,6 +3806,7 @@ + CONSTRUCT MALE @@ -3654,26 +3824,49 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3683,6 +3876,7 @@ + CONSTRUCT MALE @@ -3700,26 +3894,48 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3729,6 +3945,7 @@ + CONSTRUCT MALE @@ -3746,26 +3963,48 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3775,6 +4014,7 @@ + CONSTRUCT MALE @@ -3792,26 +4032,48 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3821,6 +4083,7 @@ + CONSTRUCT MALE @@ -3838,26 +4101,47 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3867,6 +4151,7 @@ + CONSTRUCT MALE @@ -3884,26 +4169,46 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3913,6 +4218,7 @@ + CONSTRUCT MALE @@ -3930,26 +4236,47 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3959,6 +4286,7 @@ + CONSTRUCT MALE @@ -3976,26 +4304,47 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4005,6 +4354,7 @@ + CONSTRUCT MALE @@ -4022,26 +4372,53 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4051,6 +4428,7 @@ + CONSTRUCT MALE @@ -4068,26 +4446,60 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4097,10 +4509,11 @@ + CONSTRUCT MALE - + @@ -4114,26 +4527,60 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4143,10 +4590,11 @@ + CONSTRUCT MALE - + @@ -4160,26 +4608,60 @@ - - - - - - - - - - + + + + + + + + + + true - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/trunk/dist/game/data/stats/skills/00900-00999.xml b/trunk/dist/game/data/stats/skills/00900-00999.xml index e99baf9b3e..d6217fb879 100644 --- a/trunk/dist/game/data/stats/skills/00900-00999.xml +++ b/trunk/dist/game/data/stats/skills/00900-00999.xml @@ -2018,12 +2018,13 @@ - + -377 -392 -407 -437 -453 -469 -501 -518 -535 -570 -588 -606 -643 -662 -681 -719 -738 -758 -777 -797 -816 -836 -856 -875 -895
40 43 46 49 52 55 58 60 62 64 66 68 70 72 74 76 77 78 79 80 81 82 83 84 85
38 41 44 48 51 55 58 61 62 65 67 69 71 73 75 77 78 78 79 80 80 81 82 82 83
833 992 1171 1371 1592 1832 2091 2272 2460 2653 2850 3050 3252 3453 3653 3849 3945 4040 4133 4224 4312 4399 4482 4563 4640
+ @@ -2031,7 +2032,7 @@ - + @@ -2045,20 +2046,22 @@
- - + + + + - - - - + + + - + + @@ -2070,7 +2073,7 @@ - + 40 43 46 49 52 55 58 60 62 64 66 68 70 72 74 76 77 78 79 80 81 82 83 84 85
38 41 44 48 51 55 58 61 62 65 67 69 71 73 75 77 78 78 79 80 80 81 82 82 83
833 992 1171 1371 1592 1832 2091 2272 2460 2653 2850 3050 3252 3453 3653 3849 3945 4040 4133 4224 4312 4399 4482 4563 4640
@@ -2082,33 +2085,33 @@ - + - - - +
- + - - + + - + + + @@ -2123,21 +2126,26 @@ - + + 1 2 3
1.05 1.07 1.1
454 523 635
46 52 60
1.05 1.1 1.15
+ + + + - + @@ -2148,8 +2156,11 @@
- + + + + @@ -2158,8 +2169,11 @@ - + + + + @@ -2168,9 +2182,9 @@ - - - + + + @@ -2192,19 +2206,20 @@ - + + - + - + @@ -2224,15 +2239,20 @@ - + 40 43 49 55 60 66 70 79
1 2 3 4 5 6 7 8
+ + + + + - + @@ -2250,16 +2270,21 @@
- + 24 32 40 52 60 66 72 79
1 2 3 4 5 6 7 8
+ + + + + - + @@ -2277,7 +2302,7 @@
- + @@ -2285,8 +2310,8 @@ - - + + @@ -2294,10 +2319,8 @@ + - - - @@ -2305,7 +2328,7 @@ - + @@ -2323,25 +2346,24 @@ - - + + + + - - - - + @@ -2369,18 +2391,23 @@
- + 40 43 46 49 52 55 58 60 62 64 66 68 70 72 74 76 77 78 79 80 81 82 83 84 85
38 41 44 48 51 55 58 61 62 65 67 69 71 73 75 77 78 78 79 80 80 81 82 82 83
1041 1240 1464 1714 1990 2290 2614 2840 3075 3316 3563 3813 4065 4316 4566 4689 4811 4931 5050 5166 5280 5390 5498 5603 5704
+ + + + + @@ -2402,26 +2429,25 @@
- - - + + + - - + + + - - - - + + diff --git a/trunk/dist/game/data/stats/skills/01500-01599.xml b/trunk/dist/game/data/stats/skills/01500-01599.xml index d365f4e32e..fc81c91382 100644 --- a/trunk/dist/game/data/stats/skills/01500-01599.xml +++ b/trunk/dist/game/data/stats/skills/01500-01599.xml @@ -1591,9 +1591,9 @@ - + - + @@ -1601,8 +1601,8 @@ - - + + @@ -1617,7 +1617,7 @@ - + @@ -1637,7 +1637,7 @@ - + @@ -1652,31 +1652,31 @@ - + - + - - + + - - - + + + @@ -1705,10 +1705,10 @@ - + - + @@ -1716,9 +1716,9 @@ - - - + + + @@ -1727,24 +1727,19 @@ - - - - - - + - + - - - + + + @@ -1753,11 +1748,6 @@ - - - - - @@ -1781,7 +1771,7 @@ - + @@ -1818,10 +1808,11 @@ - + 40 44 48 52 56 58 60 62 64 66 68 70 72 74 76 77 78 79 80 81 82 83 84 85
- 38 43 47 50 53 55 57 59 60 63 64 67 74 83 92 99 100 106 109 115 118 119 125 134
- 57 58 60 61 63 66 68 71 74 77 79 82 89 94 100 104 110 115 139 152 166 179 193 207
+ 31 35 38 40 43 44 46 48 48 51 52 54 60 67 74 80 80 85 88 92 95 96 100 108
+ 7 8 9 10 10 11 11 11 12 12 12 13 14 16 18 19 20 21 21 23 23 23 25 26
+ 57 58 60 61 63 66 68 71 74 77 79 82 89 94 100 104 110 115 136 152 166 179 193 207
57 58 60 61 63 66 68 71 74 77 79 82 84 87 89 90 91 92 93 94 95 96 97 98
@@ -1831,7 +1822,8 @@ - + + @@ -1840,18 +1832,12 @@ - - - - - -
- - 177 295 384
- 28 40 49
+ + 117 295 384
+ 28 40 58
1.2 1.3 1.4
@@ -1860,26 +1846,23 @@ - + - +
- - - + + + - - - @@ -1895,18 +1878,22 @@
+ + + + - - 2 3 4 5 6
+ + 1 2 3 4 5
15 20 25 30 35
40 49 58 64 70
18 22 27 30 33
- + @@ -1925,17 +1912,15 @@
- + 1 2
+ 1.05 1.08
549 611
44 52
1.1 1.16
- 1.05 1.08
0.9 0.84
- 124 151
- 30 37
- 1.05 1.08
- 1.05 1.08
+ 154 188
+ 8 41
0.95 0.92
2 4
5 8
@@ -1959,27 +1944,27 @@ - + - - + +
- + 1 2
379 457
48 56
- 138 164
- 34 40
+ 172 204
+ 28 35
1.15 1.33
- + @@ -2007,14 +1992,14 @@ - +
- + 40 49 58 64 68 72
70 100 140 150 180 200
203 206 210 213 216 220 223 226 230 233 236 240 243 246 250 253 256 260 263 266 270 273 276 280 283 286 290 293 296 300
diff --git a/trunk/dist/game/data/stats/skills/06700-06799.xml b/trunk/dist/game/data/stats/skills/06700-06799.xml index e27cbf23b1..b0bca2f985 100644 --- a/trunk/dist/game/data/stats/skills/06700-06799.xml +++ b/trunk/dist/game/data/stats/skills/06700-06799.xml @@ -556,34 +556,35 @@
- - - + + - + + - + + + - - - + + + - + - + - diff --git a/trunk/dist/game/data/stats/skills/06800-06899.xml b/trunk/dist/game/data/stats/skills/06800-06899.xml index 4fff14c472..8823cf3db0 100644 --- a/trunk/dist/game/data/stats/skills/06800-06899.xml +++ b/trunk/dist/game/data/stats/skills/06800-06899.xml @@ -237,14 +237,13 @@ - + 40 43 49 55 60 66 70 79
1 2 3 4 5 6 7 8
- - - + + @@ -259,13 +258,13 @@
- + 24 32 40 52 60 66 72 79
1 2 3 4 5 6 7 8
- - + + @@ -1332,31 +1331,35 @@
- - - 1 1 1.2
- 1.1 1.15 1.15
+ + 2 3 4
+ 1.1 1.15 1.2
1 1.15 1.15
1 1 1.15
- 1.1 1.3 1.5
+ 1.1 1.3 1.5
50 80 90
+ + + + + - + + - + - - + + - diff --git a/trunk/dist/game/data/stats/skills/06900-06999.xml b/trunk/dist/game/data/stats/skills/06900-06999.xml index 6c7e2eaadf..a66f2f6ade 100644 --- a/trunk/dist/game/data/stats/skills/06900-06999.xml +++ b/trunk/dist/game/data/stats/skills/06900-06999.xml @@ -90,14 +90,17 @@
- + + + + @@ -138,21 +141,25 @@ - + + + + - - + + + - + @@ -160,15 +167,32 @@ - + + + + + + - - + + + + + + + + + + + + + + diff --git a/trunk/dist/game/data/stats/skills/20000-20099.xml b/trunk/dist/game/data/stats/skills/20000-20099.xml index e6929a71d0..6cdd296541 100644 --- a/trunk/dist/game/data/stats/skills/20000-20099.xml +++ b/trunk/dist/game/data/stats/skills/20000-20099.xml @@ -73,8 +73,10 @@ - + + + diff --git a/trunk/dist/game/data/stats/skills/21200-21299.xml b/trunk/dist/game/data/stats/skills/21200-21299.xml index 1fb69a0e91..6a7ed05d80 100644 --- a/trunk/dist/game/data/stats/skills/21200-21299.xml +++ b/trunk/dist/game/data/stats/skills/21200-21299.xml @@ -513,6 +513,7 @@ + @@ -527,7 +528,7 @@
- + @@ -561,6 +562,7 @@ + @@ -575,7 +577,7 @@ - + @@ -657,15 +659,15 @@ - - + + - + @@ -673,15 +675,15 @@ - - + + - + @@ -689,15 +691,15 @@ - - + + - + - + @@ -705,47 +707,47 @@ - - + + - - + + - - + + - - + + - - + + - - - + + + diff --git a/trunk/dist/game/data/stats/skills/23300-23399.xml b/trunk/dist/game/data/stats/skills/23300-23399.xml index ba2cc9a389..08064ec577 100644 --- a/trunk/dist/game/data/stats/skills/23300-23399.xml +++ b/trunk/dist/game/data/stats/skills/23300-23399.xml @@ -150,82 +150,80 @@ - - - + + - - + + - - + + + - + - + - - - + + - - + + - + - - + - - - + + - + + - + - - + + - + @@ -233,26 +231,25 @@ - - - - - + + + - + + - + - - + + - + @@ -261,26 +258,26 @@ - - - - - + + + - + + - + + - + - - + + - + @@ -291,25 +288,28 @@ - - - + + + + + + + + - - - + - + - + + - - + diff --git a/trunk/dist/game/data_classic/scripts/handlers/admincommandhandlers/AdminBuffs.java b/trunk/dist/game/data_classic/scripts/handlers/admincommandhandlers/AdminBuffs.java index 305189fff7..884f440ef7 100644 --- a/trunk/dist/game/data_classic/scripts/handlers/admincommandhandlers/AdminBuffs.java +++ b/trunk/dist/game/data_classic/scripts/handlers/admincommandhandlers/AdminBuffs.java @@ -26,6 +26,7 @@ import java.util.StringTokenizer; import com.l2jserver.Config; import com.l2jserver.gameserver.data.xml.impl.SkillTreesData; import com.l2jserver.gameserver.handler.IAdminCommandHandler; +import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.L2World; import com.l2jserver.gameserver.model.actor.L2Character; import com.l2jserver.gameserver.model.actor.instance.L2PcInstance; @@ -160,47 +161,39 @@ public class AdminBuffs implements IAdminCommandHandler StringTokenizer st = new StringTokenizer(command, " "); command = st.nextToken(); - L2PcInstance player = null; + L2Character creature = null; if (st.hasMoreTokens()) { - String playername = st.nextToken(); - - try + creature = L2World.getInstance().getPlayer(st.nextToken()); + if (creature == null) { - player = L2World.getInstance().getPlayer(playername); - } - catch (Exception e) - { - } - - if (player == null) - { - activeChar.sendMessage("The player " + playername + " is not online."); + activeChar.sendMessage("The player " + creature + " is not online."); return false; } } - else if ((activeChar.getTarget() != null) && activeChar.getTarget().isPlayer()) - { - player = activeChar.getTarget().getActingPlayer(); - } else { - activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET); - return false; + final L2Object target = activeChar.getTarget(); + if ((target != null) && target.isCharacter()) + { + creature = (L2Character) target; + } + + if (creature == null) + { + activeChar.sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET); + return false; + } } - try + creature.resetTimeStamps(); + creature.resetDisabledSkills(); + if (creature.isPlayer()) { - player.resetTimeStamps(); - player.resetDisabledSkills(); - player.sendPacket(new SkillCoolTime(player)); - activeChar.sendMessage("Skill reuse was removed from " + player.getName() + "."); - return true; - } - catch (NullPointerException e) - { - return false; + creature.sendPacket(new SkillCoolTime(creature.getActingPlayer())); } + activeChar.sendMessage("Skill reuse was removed from " + creature.getName() + "."); + return true; } else if (command.startsWith("admin_switch_gm_buffs")) { diff --git a/trunk/dist/game/data_classic/scripts/handlers/effecthandlers/MagicalAttackMp.java b/trunk/dist/game/data_classic/scripts/handlers/effecthandlers/MagicalAttackMp.java index 57f7f30058..6b83be6e22 100644 --- a/trunk/dist/game/data_classic/scripts/handlers/effecthandlers/MagicalAttackMp.java +++ b/trunk/dist/game/data_classic/scripts/handlers/effecthandlers/MagicalAttackMp.java @@ -68,7 +68,7 @@ public final class MagicalAttackMp extends AbstractEffect @Override public L2EffectType getEffectType() { - return L2EffectType.MAGICAL_ATTACK; + return L2EffectType.MAGICAL_ATTACK_MP; } @Override diff --git a/trunk/dist/game/data_classic/stats/skills/00900-00999.xml b/trunk/dist/game/data_classic/stats/skills/00900-00999.xml index 8fba35d089..4a9015ef59 100644 --- a/trunk/dist/game/data_classic/stats/skills/00900-00999.xml +++ b/trunk/dist/game/data_classic/stats/skills/00900-00999.xml @@ -1907,12 +1907,13 @@ - + -377 -392 -407 -437 -453 -469 -501 -518 -535 -570 -588 -606 -643 -662 -681 -719 -738 -758 -777 -797 -816 -836 -856 -875 -895
40 43 46 49 52 55 58 60 62 64 66 68 70 72 74 76 77 78 79 80 81 82 83 84 85
38 41 44 48 51 55 58 61 62 65 67 69 71 73 75 77 78 78 79 80 80 81 82 82 83
833 992 1171 1371 1592 1832 2091 2272 2460 2653 2850 3050 3252 3453 3653 3849 3945 4040 4133 4224 4312 4399 4482 4563 4640
+ @@ -1920,7 +1921,7 @@ - + @@ -1934,20 +1935,22 @@
- - + + + + - - - - + + + - + + @@ -1959,7 +1962,7 @@ - + 40 43 46 49 52 55 58 60 62 64 66 68 70 72 74 76 77 78 79 80 81 82 83 84 85
38 41 44 48 51 55 58 61 62 65 67 69 71 73 75 77 78 78 79 80 80 81 82 82 83
833 992 1171 1371 1592 1832 2091 2272 2460 2653 2850 3050 3252 3453 3653 3849 3945 4040 4133 4224 4312 4399 4482 4563 4640
@@ -1971,33 +1974,33 @@ - + - - - +
- + - - + + - + + + @@ -2012,21 +2015,26 @@ - + + 1 2 3
1.05 1.07 1.1
454 523 635
46 52 60
1.05 1.1 1.15
+ + + + - + @@ -2037,8 +2045,11 @@
- + + + + @@ -2047,8 +2058,11 @@ - + + + + @@ -2057,9 +2071,9 @@ - - - + + + @@ -2081,19 +2095,20 @@ - + + - + - + @@ -2113,15 +2128,20 @@ - + 40 43 49 55 60 66 70 79
1 2 3 4 5 6 7 8
+ + + + + - + @@ -2139,16 +2159,21 @@
- + 24 32 40 52 60 66 72 79
1 2 3 4 5 6 7 8
+ + + + + - + @@ -2166,7 +2191,7 @@
- + @@ -2174,8 +2199,8 @@ - - + + @@ -2183,10 +2208,8 @@ + - - - @@ -2194,7 +2217,7 @@ - + @@ -2212,25 +2235,24 @@ - - + + + + - - - - + @@ -2258,18 +2280,23 @@
- + 40 43 46 49 52 55 58 60 62 64 66 68 70 72 74 76 77 78 79 80 81 82 83 84 85
38 41 44 48 51 55 58 61 62 65 67 69 71 73 75 77 78 78 79 80 80 81 82 82 83
1041 1240 1464 1714 1990 2290 2614 2840 3075 3316 3563 3813 4065 4316 4566 4689 4811 4931 5050 5166 5280 5390 5498 5603 5704
+ + + + + @@ -2291,26 +2318,25 @@
- - - + + + - - + + + - - - - + + diff --git a/trunk/dist/game/data_classic/stats/skills/01500-01599.xml b/trunk/dist/game/data_classic/stats/skills/01500-01599.xml index 2fee824969..7cb2ef898d 100644 --- a/trunk/dist/game/data_classic/stats/skills/01500-01599.xml +++ b/trunk/dist/game/data_classic/stats/skills/01500-01599.xml @@ -1492,9 +1492,9 @@ - + - + @@ -1502,8 +1502,8 @@ - - + + @@ -1518,7 +1518,7 @@ - + @@ -1538,7 +1538,7 @@ - + @@ -1553,31 +1553,31 @@ - + - + - - + + - - - + + + @@ -1606,10 +1606,10 @@ - + - + @@ -1617,9 +1617,9 @@ - - - + + + @@ -1628,24 +1628,19 @@ - - - - - - + - + - - - + + + @@ -1654,11 +1649,6 @@ - - - - - @@ -1682,7 +1672,7 @@ - + @@ -1719,10 +1709,11 @@ - + 40 44 48 52 56 58 60 62 64 66 68 70 72 74 76 77 78 79 80 81 82 83 84 85
- 38 43 47 50 53 55 57 59 60 63 64 67 74 83 92 99 100 106 109 115 118 119 125 134
- 57 58 60 61 63 66 68 71 74 77 79 82 89 94 100 104 110 115 139 152 166 179 193 207
+ 31 35 38 40 43 44 46 48 48 51 52 54 60 67 74 80 80 85 88 92 95 96 100 108
+ 7 8 9 10 10 11 11 11 12 12 12 13 14 16 18 19 20 21 21 23 23 23 25 26
+ 57 58 60 61 63 66 68 71 74 77 79 82 89 94 100 104 110 115 136 152 166 179 193 207
57 58 60 61 63 66 68 71 74 77 79 82 84 87 89 90 91 92 93 94 95 96 97 98
@@ -1732,7 +1723,8 @@ - + + @@ -1741,18 +1733,12 @@ - - - - - -
- - 177 295 384
- 28 40 49
+ + 117 295 384
+ 28 40 58
1.2 1.3 1.4
@@ -1761,26 +1747,23 @@ - + - +
- - - + + + - - - @@ -1796,18 +1779,22 @@ + + + + - - 2 3 4 5 6
+ + 1 2 3 4 5
15 20 25 30 35
40 49 58 64 70
18 22 27 30 33
- + @@ -1826,17 +1813,15 @@
- + 1 2
+ 1.05 1.08
549 611
44 52
1.1 1.16
- 1.05 1.08
0.9 0.84
- 124 151
- 30 37
- 1.05 1.08
- 1.05 1.08
+ 154 188
+ 8 41
0.95 0.92
2 4
5 8
@@ -1860,27 +1845,27 @@ - + - - + +
- + 1 2
379 457
48 56
- 138 164
- 34 40
+ 172 204
+ 28 35
1.15 1.33
- + @@ -1908,14 +1893,14 @@ - +
- + 40 49 58 64 68 72
70 100 140 150 180 200
203 206 210 213 216 220 223 226 230 233 236 240 243 246 250 253 256 260 263 266 270 273 276 280 283 286 290 293 296 300
diff --git a/trunk/dist/game/data_classic/stats/skills/06700-06799.xml b/trunk/dist/game/data_classic/stats/skills/06700-06799.xml index 10c164e3c2..5de2397884 100644 --- a/trunk/dist/game/data_classic/stats/skills/06700-06799.xml +++ b/trunk/dist/game/data_classic/stats/skills/06700-06799.xml @@ -540,34 +540,35 @@
- - - + + - + + - + + + - - - + + + - + - + - diff --git a/trunk/dist/game/data_classic/stats/skills/06800-06899.xml b/trunk/dist/game/data_classic/stats/skills/06800-06899.xml index 0a5d255530..8823cf3db0 100644 --- a/trunk/dist/game/data_classic/stats/skills/06800-06899.xml +++ b/trunk/dist/game/data_classic/stats/skills/06800-06899.xml @@ -237,14 +237,13 @@
- + 40 43 49 55 60 66 70 79
1 2 3 4 5 6 7 8
- - - + + @@ -259,13 +258,13 @@
- + 24 32 40 52 60 66 72 79
1 2 3 4 5 6 7 8
- - + + @@ -1317,6 +1316,11 @@
+ + + + + @@ -1327,31 +1331,35 @@ - - - 1 1 1.2
- 1.1 1.15 1.15
+ + 2 3 4
+ 1.1 1.15 1.2
1 1.15 1.15
1 1 1.15
- 1.1 1.3 1.5
+ 1.1 1.3 1.5
50 80 90
+ + + + + - + + - + - - + + - diff --git a/trunk/dist/game/data_classic/stats/skills/06900-06999.xml b/trunk/dist/game/data_classic/stats/skills/06900-06999.xml index 4432f3d491..7f4aecd9d4 100644 --- a/trunk/dist/game/data_classic/stats/skills/06900-06999.xml +++ b/trunk/dist/game/data_classic/stats/skills/06900-06999.xml @@ -77,14 +77,17 @@
- + + + + @@ -125,21 +128,25 @@ - + + + + - - + + + - + @@ -147,15 +154,32 @@ - + + + + + + - - + + + + + + + + + + + + + + diff --git a/trunk/dist/game/data_classic/stats/skills/20000-20099.xml b/trunk/dist/game/data_classic/stats/skills/20000-20099.xml index 5d4c5d0c08..ca187de711 100644 --- a/trunk/dist/game/data_classic/stats/skills/20000-20099.xml +++ b/trunk/dist/game/data_classic/stats/skills/20000-20099.xml @@ -68,8 +68,10 @@ - + + + diff --git a/trunk/java/com/l2jserver/Config.java b/trunk/java/com/l2jserver/Config.java index 82b8d3ed8e..9fad752a94 100644 --- a/trunk/java/com/l2jserver/Config.java +++ b/trunk/java/com/l2jserver/Config.java @@ -60,6 +60,7 @@ import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap; import org.w3c.dom.Node; +import com.l2jserver.gameserver.GameServer; import com.l2jserver.gameserver.enums.ChatType; import com.l2jserver.gameserver.enums.IllegalActionPunishmentType; import com.l2jserver.gameserver.model.L2World; @@ -4067,16 +4068,17 @@ public final class Config @Override public void load() { - File f = new File(IP_CONFIG_FILE); + GameServer.printSection("Network Configuration"); + final File f = new File(IP_CONFIG_FILE); if (f.exists()) { - LOGGER.log(Level.INFO, "Network Config: ipconfig.xml exists using manual configuration..."); + LOGGER.log(Level.INFO, "Using existing ipconfig.xml."); parseFile(new File(IP_CONFIG_FILE)); } else // Auto configuration... { - LOGGER.log(Level.INFO, "Network Config: ipconfig.xml doesn't exists using automatic configuration..."); + LOGGER.log(Level.INFO, "Using automatic network configuration."); autoIpConfig(); } } @@ -4132,7 +4134,7 @@ public final class Config } catch (IOException e) { - LOGGER.log(Level.INFO, "Network Config: Failed to connect to api.externalip.net please check your internet connection using 127.0.0.1!"); + LOGGER.log(Level.INFO, "Failed to connect to api.externalip.net please check your internet connection using 127.0.0.1!"); externalIp = "127.0.0.1"; } @@ -4172,7 +4174,7 @@ public final class Config { _subnets.add(subnet); _hosts.add(hostAddress); - LOGGER.log(Level.INFO, "Network Config: Adding new subnet: " + subnet + " address: " + hostAddress); + LOGGER.log(Level.INFO, "Adding new subnet: " + subnet + " address: " + hostAddress); } } } @@ -4180,11 +4182,11 @@ public final class Config // External host and subnet _hosts.add(externalIp); _subnets.add("0.0.0.0/0"); - LOGGER.log(Level.INFO, "Network Config: Adding new subnet: 0.0.0.0/0 address: " + externalIp); + LOGGER.log(Level.INFO, "Adding new subnet: 0.0.0.0/0 address: " + externalIp); } catch (SocketException e) { - LOGGER.log(Level.INFO, "Network Config: Configuration failed please configure manually using ipconfig.xml", e); + LOGGER.log(Level.INFO, "Configuration failed please manually configure ipconfig.xml", e); System.exit(0); } } diff --git a/trunk/java/com/l2jserver/commons/database/pool/AbstractConnectionFactory.java b/trunk/java/com/l2jserver/commons/database/pool/AbstractConnectionFactory.java index 0635e3fbb3..79f2571768 100644 --- a/trunk/java/com/l2jserver/commons/database/pool/AbstractConnectionFactory.java +++ b/trunk/java/com/l2jserver/commons/database/pool/AbstractConnectionFactory.java @@ -28,8 +28,7 @@ import java.util.logging.Logger; */ public abstract class AbstractConnectionFactory implements IConnectionFactory { - /** The logger. */ - protected static final Logger LOG = Logger.getLogger(AbstractConnectionFactory.class.getName()); + private static final Logger LOG = Logger.getLogger(AbstractConnectionFactory.class.getName()); @Override public Connection getConnection() diff --git a/trunk/java/com/l2jserver/commons/database/pool/impl/BoneCPConnectionFactory.java b/trunk/java/com/l2jserver/commons/database/pool/impl/BoneCPConnectionFactory.java index 5167f904cc..d4240c9ea2 100644 --- a/trunk/java/com/l2jserver/commons/database/pool/impl/BoneCPConnectionFactory.java +++ b/trunk/java/com/l2jserver/commons/database/pool/impl/BoneCPConnectionFactory.java @@ -18,6 +18,8 @@ */ package com.l2jserver.commons.database.pool.impl; +import java.util.logging.Logger; + import javax.sql.DataSource; import com.l2jserver.commons.database.pool.AbstractConnectionFactory; @@ -31,6 +33,8 @@ import com.l2jserver.commons.database.pool.IConnectionFactory; */ final class BoneCPConnectionFactory extends AbstractConnectionFactory { + private static final Logger LOG = Logger.getLogger(BoneCPConnectionFactory.class.getName()); + private final DataSource _dataSource = null; public BoneCPConnectionFactory() diff --git a/trunk/java/com/l2jserver/commons/database/pool/impl/C3P0ConnectionFactory.java b/trunk/java/com/l2jserver/commons/database/pool/impl/C3P0ConnectionFactory.java index c37d2152b5..a9d8b2b319 100644 --- a/trunk/java/com/l2jserver/commons/database/pool/impl/C3P0ConnectionFactory.java +++ b/trunk/java/com/l2jserver/commons/database/pool/impl/C3P0ConnectionFactory.java @@ -20,6 +20,7 @@ package com.l2jserver.commons.database.pool.impl; import java.beans.PropertyVetoException; import java.sql.SQLException; +import java.util.logging.Logger; import javax.sql.DataSource; @@ -36,6 +37,8 @@ import com.mchange.v2.c3p0.ComboPooledDataSource; */ final class C3P0ConnectionFactory extends AbstractConnectionFactory { + private static final Logger LOG = Logger.getLogger(C3P0ConnectionFactory.class.getName()); + private final ComboPooledDataSource _dataSource; public C3P0ConnectionFactory() diff --git a/trunk/java/com/l2jserver/commons/database/pool/impl/HikariCPConnectionFactory.java b/trunk/java/com/l2jserver/commons/database/pool/impl/HikariCPConnectionFactory.java index 5a6e123e32..ef233e8151 100644 --- a/trunk/java/com/l2jserver/commons/database/pool/impl/HikariCPConnectionFactory.java +++ b/trunk/java/com/l2jserver/commons/database/pool/impl/HikariCPConnectionFactory.java @@ -18,6 +18,8 @@ */ package com.l2jserver.commons.database.pool.impl; +import java.util.logging.Logger; + import javax.sql.DataSource; import com.l2jserver.commons.database.pool.AbstractConnectionFactory; @@ -31,6 +33,8 @@ import com.l2jserver.commons.database.pool.IConnectionFactory; */ final class HikariCPConnectionFactory extends AbstractConnectionFactory { + private static final Logger LOG = Logger.getLogger(HikariCPConnectionFactory.class.getName()); + private final DataSource _dataSource = null; public HikariCPConnectionFactory() diff --git a/trunk/java/com/l2jserver/gameserver/GameServer.java b/trunk/java/com/l2jserver/gameserver/GameServer.java index 5c7aefc8e7..2f0c9bf596 100644 --- a/trunk/java/com/l2jserver/gameserver/GameServer.java +++ b/trunk/java/com/l2jserver/gameserver/GameServer.java @@ -199,10 +199,13 @@ public final class GameServer SecondaryAuthData.getInstance(); AbilityPointsData.getInstance(); - printSection("Skills"); + printSection("Effects"); EffectHandler.getInstance().executeScript(); + printSection("Enchant Skill Groups"); EnchantSkillGroupsData.getInstance(); + printSection("Skill Trees"); SkillTreesData.getInstance(); + printSection("Skills"); SkillData.getInstance(); SummonSkillsTable.getInstance(); @@ -288,18 +291,16 @@ public final class GameServer StaticObjectData.getInstance(); ZoneManager.getInstance(); DoorData.getInstance(); - if (!Config.SERVER_CLASSIC_SUPPORT) - { - ItemAuctionManager.getInstance(); - } CastleManager.getInstance().loadInstances(); NpcBufferTable.getInstance(); GrandBossManager.getInstance().initZones(); EventDroplist.getInstance(); - - printSection("Olympiad"); if (!Config.SERVER_CLASSIC_SUPPORT) { + printSection("Auction Manager"); + ItemAuctionManager.getInstance(); + + printSection("Olympiad"); Olympiad.getInstance(); } Hero.getInstance(); diff --git a/trunk/java/com/l2jserver/gameserver/ai/L2AttackableAI.java b/trunk/java/com/l2jserver/gameserver/ai/L2AttackableAI.java index e20c928540..3a179e4ef2 100644 --- a/trunk/java/com/l2jserver/gameserver/ai/L2AttackableAI.java +++ b/trunk/java/com/l2jserver/gameserver/ai/L2AttackableAI.java @@ -1285,17 +1285,17 @@ public class L2AttackableAI extends L2CharacterAI implements Runnable { targetReconsider(); } - else if (getAttackTarget() != null) + else { - if (getAttackTarget().isMoving()) + final L2Character target = getAttackTarget(); + if (target != null) { - range -= 100; + if (target.isMoving()) + { + range -= 100; + } + moveToPawn(target, Math.max(range, 5)); } - if (range < 5) - { - range = 5; - } - moveToPawn(getAttackTarget(), range); } return; } diff --git a/trunk/java/com/l2jserver/gameserver/ai/L2ControllableMobAI.java b/trunk/java/com/l2jserver/gameserver/ai/L2ControllableMobAI.java index d6e4b6215f..d33a5137b8 100644 --- a/trunk/java/com/l2jserver/gameserver/ai/L2ControllableMobAI.java +++ b/trunk/java/com/l2jserver/gameserver/ai/L2ControllableMobAI.java @@ -21,9 +21,9 @@ package com.l2jserver.gameserver.ai; import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_ACTIVE; import static com.l2jserver.gameserver.ai.CtrlIntention.AI_INTENTION_ATTACK; -import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.stream.Collectors; import com.l2jserver.gameserver.model.L2Object; import com.l2jserver.gameserver.model.MobGroup; @@ -190,7 +190,7 @@ public final class L2ControllableMobAI extends L2AttackableAI } _actor.setTarget(target); - // as a response, we put the target in a forcedattack mode + // as a response, we put the target in a forced attack mode L2ControllableMobInstance theTarget = (L2ControllableMobInstance) target; L2ControllableMobAI ctrlAi = (L2ControllableMobAI) theTarget.getAI(); ctrlAi.forceAttack(_actor); @@ -397,30 +397,31 @@ public final class L2ControllableMobAI extends L2AttackableAI private boolean checkAutoAttackCondition(L2Character target) { - if ((target == null) || !(_actor instanceof L2Attackable)) - { - return false; - } - L2Attackable me = (L2Attackable) _actor; - - if ((target instanceof L2NpcInstance) || (target instanceof L2DoorInstance)) + if ((target == null) || (target instanceof L2NpcInstance) || (target instanceof L2DoorInstance)) { return false; } - if (target.isAlikeDead() || !me.isInsideRadius(target, me.getAggroRange(), false, false) || (Math.abs(_actor.getZ() - target.getZ()) > 100)) + // TODO(Zoey76)[#112]: This check must change if summon fall in L2Npc hierarchy. + if (target instanceof L2Npc) { return false; } // Check if the target isn't invulnerable - if (target.isInvul()) + if (target.isInvul() || target.isAlikeDead()) { return false; } // Spawn protection (only against mobs) - if ((target instanceof L2PcInstance) && ((L2PcInstance) target).isSpawnProtected()) + if (target.isPlayer() && ((L2PcInstance) target).isSpawnProtected()) + { + return false; + } + + final L2Attackable me = getActiveChar(); + if (!me.isInsideRadius(target, me.getAggroRange(), false, false) || (Math.abs(_actor.getZ() - target.getZ()) > 100)) { return false; } @@ -434,56 +435,17 @@ public final class L2ControllableMobAI extends L2AttackableAI return false; } } - - if (target instanceof L2Npc) - { - return false; - } - return me.isAggressive(); } private L2Character findNextRndTarget() { - int aggroRange = ((L2Attackable) _actor).getAggroRange(); - L2Attackable npc = (L2Attackable) _actor; - int npcX, npcY, targetX, targetY; - double dy, dx; - double dblAggroRange = aggroRange * aggroRange; - - final List potentialTarget = new ArrayList<>(); - for (L2Character obj : npc.getKnownList().getKnownCharacters()) - { - npcX = npc.getX(); - npcY = npc.getY(); - targetX = obj.getX(); - targetY = obj.getY(); - - dx = npcX - targetX; - dy = npcY - targetY; - - if (((dx * dx) + (dy * dy)) > dblAggroRange) - { - continue; - } - - L2Character target = obj; - if (checkAutoAttackCondition(target)) - { - potentialTarget.add(target); - } - } - + final List potentialTarget = _actor.getKnownList().getKnownCharactersInRadius(getActiveChar().getAggroRange()).stream().filter(this::checkAutoAttackCondition).collect(Collectors.toList()); if (potentialTarget.isEmpty()) { return null; } - - // we choose a random target - int choice = Rnd.nextInt(potentialTarget.size()); - L2Character target = potentialTarget.get(choice); - - return target; + return potentialTarget.get(Rnd.nextInt(potentialTarget.size())); } private L2ControllableMobInstance findNextGroupTarget() diff --git a/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillTreesData.java b/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillTreesData.java index 126106c9f4..4170c52040 100644 --- a/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillTreesData.java +++ b/trunk/java/com/l2jserver/gameserver/data/xml/impl/SkillTreesData.java @@ -1738,7 +1738,7 @@ public final class SkillTreesData implements IXmlReader */ public static SkillTreesData getInstance() { - return SingletonHolder._instance; + return SingletonHolder.INSTANCE; } /** @@ -1746,6 +1746,6 @@ public final class SkillTreesData implements IXmlReader */ private static class SingletonHolder { - protected static final SkillTreesData _instance = new SkillTreesData(); + protected static final SkillTreesData INSTANCE = new SkillTreesData(); } } diff --git a/trunk/java/com/l2jserver/gameserver/model/L2AccessLevel.java b/trunk/java/com/l2jserver/gameserver/model/L2AccessLevel.java index 58b7c44717..3469506f21 100644 --- a/trunk/java/com/l2jserver/gameserver/model/L2AccessLevel.java +++ b/trunk/java/com/l2jserver/gameserver/model/L2AccessLevel.java @@ -25,19 +25,19 @@ import com.l2jserver.gameserver.data.xml.impl.AdminData; */ public class L2AccessLevel { - /** The access level
*/ + /** The access level. */ private int _accessLevel = 0; - /** The access level name
*/ + /** The access level name. */ private String _name = null; - /** Child access levels */ - L2AccessLevel _childsAccessLevel = null; - /** Child access levels */ + /** Child access levels. */ + private L2AccessLevel _childsAccessLevel = null; + /** Child access levels. */ private int _child = 0; - /** The name color for the access level
*/ + /** The name color for the access level. */ private int _nameColor = 0; - /** The title color for the access level
*/ + /** The title color for the access level. */ private int _titleColor = 0; - /** Flag to determine if the access level has gm access
*/ + /** Flag to determine if the access level has GM access. */ private boolean _isGm = false; /** Flag for peace zone attack */ private boolean _allowPeaceAttack = false; @@ -89,9 +89,8 @@ public class L2AccessLevel } /** - * Returns the access level
- *
- * @return int: access level
+ * Gets the access level. + * @return the access level */ public int getLevel() { @@ -99,9 +98,8 @@ public class L2AccessLevel } /** - * Returns the access level name
- *
- * @return String: access level name
+ * Gets the access level name. + * @return the access level name */ public String getName() { @@ -109,9 +107,8 @@ public class L2AccessLevel } /** - * Returns the name color of the access level
- *
- * @return int: the name color for the access level
+ * Gets the name color of the access level. + * @return the name color for the access level */ public int getNameColor() { @@ -119,9 +116,8 @@ public class L2AccessLevel } /** - * Returns the title color color of the access level
- *
- * @return int: the title color for the access level
+ * Gets the title color color of the access level. + * @return the title color for the access level */ public int getTitleColor() { @@ -129,9 +125,8 @@ public class L2AccessLevel } /** - * Retuns if the access level has gm access or not
- *
- * @return boolean: true if access level have gm access, otherwise false
+ * Verifies if the access level has GM access or not. + * @return {@code true} if access level have GM access, otherwise {@code false} */ public boolean isGm() { @@ -139,9 +134,8 @@ public class L2AccessLevel } /** - * Returns if the access level is allowed to attack in peace zone or not
- *
- * @return boolean: true if the access level is allowed to attack in peace zone, otherwise false
+ * Verifies if the access level is allowed to attack in peace zone or not. + * @return {@code true} if the access level is allowed to attack in peace zone, otherwise {@code false} */ public boolean allowPeaceAttack() { @@ -149,9 +143,8 @@ public class L2AccessLevel } /** - * Retruns if the access level is allowed to use fixed res or not
- *
- * @return true if the access level is allowed to use fixed res, otherwise false
+ * Verifies if the access level is allowed to use fixed resurrection or not. + * @return {@ode true} if the access level is allowed to use fixed resurrection, otherwise {@code false} */ public boolean allowFixedRes() { @@ -159,9 +152,8 @@ public class L2AccessLevel } /** - * Returns if the access level is allowed to perform transactions or not
- *
- * @return boolean: true if access level is allowed to perform transactions, otherwise false
+ * Verifies if the access level is allowed to perform transactions or not. + * @return {@ode true} if access level is allowed to perform transactions, otherwise {@code false} */ public boolean allowTransaction() { @@ -169,9 +161,8 @@ public class L2AccessLevel } /** - * Returns if the access level is allowed to use AltG commands or not
- *
- * @return boolean: true if access level is allowed to use AltG commands, otherwise false
+ * Verifies if the access level is allowed to use AltG commands or not. + * @return {@ode true} if access level is allowed to use AltG commands, otherwise {@code false} */ public boolean allowAltG() { @@ -179,9 +170,8 @@ public class L2AccessLevel } /** - * Returns if the access level can give damage or not
- *
- * @return boolean: true if the access level can give damage, otherwise false
+ * Verifies if the access level can give damage or not. + * @return {@ode true} if the access level can give damage, otherwise {@code false} */ public boolean canGiveDamage() { @@ -189,9 +179,8 @@ public class L2AccessLevel } /** - * Returns if the access level can take aggro or not
- *
- * @return boolean: true if the access level can take aggro, otherwise false
+ * Verifies if the access level can take aggro or not. + * @return {@ode true} if the access level can take aggro, otherwise {@code false} */ public boolean canTakeAggro() { @@ -199,9 +188,8 @@ public class L2AccessLevel } /** - * Returns if the access level can gain exp or not
- *
- * @return boolean: true if the access level can gain exp, otherwise false
+ * Verifies if the access level can gain exp or not. + * @return {@ode true} if the access level can gain exp, otherwise {@code false} */ public boolean canGainExp() { @@ -209,9 +197,9 @@ public class L2AccessLevel } /** - * Returns if the access level contains allowedAccess as child
- * @param accessLevel as AccessLevel
- * @return boolean: true if a child access level is equals to allowedAccess, otherwise false
+ * Returns if the access level contains allowedAccess as child. + * @param accessLevel the parent access level + * @return {@ode true} if a child access level is equals to allowedAccess, otherwise {@code false} */ public boolean hasChildAccess(L2AccessLevel accessLevel) { diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/L2Character.java b/trunk/java/com/l2jserver/gameserver/model/actor/L2Character.java index c1259ddb2e..1551c24bcd 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/L2Character.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/L2Character.java @@ -1156,6 +1156,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe player.updatePvPStatus(target); } } + // Check if hit isn't missed if (!hitted) { @@ -1192,7 +1193,9 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } // Notify AI with EVT_READY_TO_ACT - ThreadPoolManager.getInstance().scheduleAi(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), timeAtk + reuse); + // Old method - use in case of bow reuse issues occur. + // ThreadPoolManager.getInstance().scheduleAi(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), timeAtk + reuse); + ThreadPoolManager.getInstance().scheduleAi(new NotifyAITask(this, CtrlEvent.EVT_READY_TO_ACT), timeAtk); } finally { @@ -2636,6 +2639,8 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe { if (_ai == null) { + // Return the new AI within the synchronized block + // to avoid being nulled by other threads return _ai = initAI(); } } @@ -2655,7 +2660,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe public void setAI(L2CharacterAI newAI) { - L2CharacterAI oldAI = _ai; + final L2CharacterAI oldAI = _ai; if ((oldAI != null) && (oldAI != newAI) && (oldAI instanceof L2AttackableAI)) { oldAI.stopAITask(); @@ -5330,19 +5335,28 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe public int calculateReuseTime(L2Character target, L2Weapon weapon) { - if ((weapon == null) || isTransformed()) + if (isTransformed()) + { + switch (getAttackType()) + { + case BOW: + case CROSSBOW: + return (int) ((517500 * getStat().getWeaponReuseModifier(null)) / getStat().getPAtkSpd()); + } + } + if ((weapon == null)) { return 0; } int reuse = weapon.getReuseDelay(); + // only bows should continue for now if (reuse == 0) { return 0; } - - reuse *= getStat().getWeaponReuseModifier(target); + reuse *= getStat().getWeaponReuseModifier(null); double atkSpd = getStat().getPAtkSpd(); switch (weapon.getItemType()) { @@ -6818,7 +6832,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } /** - * Dummy method overriden in {@link L2PcInstance} + * Dummy method overridden in {@link L2PcInstance} * @return {@code true} if current player can revive and shows 'To Village' button upon death, {@code false} otherwise. */ public boolean canRevive() @@ -6827,7 +6841,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } /** - * Dummy method overriden in {@link L2PcInstance} + * Dummy method overridden in {@link L2PcInstance} * @param val */ public void setCanRevive(boolean val) @@ -6835,7 +6849,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } /** - * Dummy method overriden in {@link L2Attackable} + * Dummy method overridden in {@link L2Attackable} * @return {@code true} if there is a loot to sweep, {@code false} otherwise. */ public boolean isSweepActive() @@ -6844,7 +6858,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } /** - * Dummy method overriden in {@link L2PcInstance} + * Dummy method overridden in {@link L2PcInstance} * @return {@code true} if player is on event, {@code false} otherwise. */ public boolean isOnEvent() @@ -6853,7 +6867,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } /** - * Dummy method overriden in {@link L2PcInstance} + * Dummy method overridden in {@link L2PcInstance} * @return the clan id of current character. */ public int getClanId() @@ -6862,7 +6876,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } /** - * Dummy method overriden in {@link L2PcInstance} + * Dummy method overridden in {@link L2PcInstance} * @return the clan of current character. */ public L2Clan getClan() @@ -6871,7 +6885,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } /** - * Dummy method overriden in {@link L2PcInstance} + * Dummy method overridden in {@link L2PcInstance} * @return {@code true} if player is in academy, {@code false} otherwise. */ public boolean isAcademyMember() @@ -6880,7 +6894,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } /** - * Dummy method overriden in {@link L2PcInstance} + * Dummy method overridden in {@link L2PcInstance} * @return the pledge type of current character. */ public int getPledgeType() @@ -6889,7 +6903,7 @@ public abstract class L2Character extends L2Object implements ISkillsHolder, IDe } /** - * Dummy method overriden in {@link L2PcInstance} + * Dummy method overridden in {@link L2PcInstance} * @return the alliance id of current character. */ public int getAllyId() diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/L2Npc.java b/trunk/java/com/l2jserver/gameserver/model/actor/L2Npc.java index 9bd6fb3fa5..dff120073d 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/L2Npc.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/L2Npc.java @@ -191,23 +191,13 @@ public class L2Npc extends L2Character return getTemplate().getSpiritShotChance(); } - public int getMinSkillChance() - { - return getTemplate().getMinSkillChance(); - } - - public int getMaxSkillChance() - { - return getTemplate().getMaxSkillChance(); - } - /** * Verifies if the NPC can cast a skill given the minimum and maximum skill chances. * @return {@code true} if the NPC has chances of casting a skill */ public boolean hasSkillChance() { - return Rnd.get(100) < Rnd.get(getMinSkillChance(), getMaxSkillChance()); + return Rnd.get(100) < Rnd.get(getTemplate().getMinSkillChance(), getTemplate().getMaxSkillChance()); } public boolean canMove() diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2MonsterInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2MonsterInstance.java index 6b9f484310..cca94f1ffd 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2MonsterInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2MonsterInstance.java @@ -78,9 +78,6 @@ public class L2MonsterInstance extends L2Attackable return super.isAutoAttackable(attacker) && !isEventMob(); } - /** - * Return True if the L2MonsterInstance is Aggressive (aggroRange > 0). - */ @Override public boolean isAggressive() { diff --git a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java index 5945c05224..3c902299d1 100644 --- a/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java +++ b/trunk/java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java @@ -7027,38 +7027,38 @@ public final class L2PcInstance extends L2Playable { // Retrieve the L2PcInstance from the characters table of the database ps.setInt(1, objectId); - try (ResultSet rs = ps.executeQuery()) + try (ResultSet rset = ps.executeQuery()) { - if (rs.next()) + if (rset.next()) { - final int activeClassId = rs.getInt("classid"); - final boolean female = rs.getInt("sex") != Sex.MALE.ordinal(); + final int activeClassId = rset.getInt("classid"); + final boolean female = rset.getInt("sex") != Sex.MALE.ordinal(); final L2PcTemplate template = PlayerTemplateData.getInstance().getTemplate(activeClassId); - PcAppearance app = new PcAppearance(rs.getByte("face"), rs.getByte("hairColor"), rs.getByte("hairStyle"), female); + PcAppearance app = new PcAppearance(rset.getByte("face"), rset.getByte("hairColor"), rset.getByte("hairStyle"), female); - player = new L2PcInstance(objectId, template, rs.getString("account_name"), app); - player.setName(rs.getString("char_name")); - restorePremiumSystemData(player, rs.getString("account_name")); - player._lastAccess = rs.getLong("lastAccess"); + player = new L2PcInstance(objectId, template, rset.getString("account_name"), app); + player.setName(rset.getString("char_name")); + restorePremiumSystemData(player, rset.getString("account_name")); + player._lastAccess = rset.getLong("lastAccess"); - player.getStat().setExp(rs.getLong("exp")); - player.setExpBeforeDeath(rs.getLong("expBeforeDeath")); - player.getStat().setLevel(rs.getByte("level")); - player.getStat().setSp(rs.getLong("sp")); + player.getStat().setExp(rset.getLong("exp")); + player.setExpBeforeDeath(rset.getLong("expBeforeDeath")); + player.getStat().setLevel(rset.getByte("level")); + player.getStat().setSp(rset.getLong("sp")); - player.setWantsPeace(rs.getInt("wantspeace")); + player.setWantsPeace(rset.getInt("wantspeace")); - player.setHeading(rs.getInt("heading")); + player.setHeading(rset.getInt("heading")); - player.setReputation(rs.getInt("reputation")); - player.setFame(rs.getInt("fame")); - player.setRaidPoints(rs.getInt("raidpoints")); - player.setPvpKills(rs.getInt("pvpkills")); - player.setPkKills(rs.getInt("pkkills")); - player.setOnlineTime(rs.getLong("onlinetime")); - player.setNoble(rs.getInt("nobless") == 1); + player.setReputation(rset.getInt("reputation")); + player.setFame(rset.getInt("fame")); + player.setRaidPoints(rset.getInt("raidpoints")); + player.setPvpKills(rset.getInt("pvpkills")); + player.setPkKills(rset.getInt("pkkills")); + player.setOnlineTime(rset.getLong("onlinetime")); + player.setNoble(rset.getInt("nobless") == 1); - final int factionId = rs.getInt("faction"); + final int factionId = rset.getInt("faction"); if (factionId == 1) { player.setGood(); @@ -7068,25 +7068,100 @@ public final class L2PcInstance extends L2Playable player.setEvil(); } - player.setClanJoinExpiryTime(rs.getLong("clan_join_expiry_time")); + player.setClanJoinExpiryTime(rset.getLong("clan_join_expiry_time")); if (player.getClanJoinExpiryTime() < System.currentTimeMillis()) { player.setClanJoinExpiryTime(0); } - player.setClanCreateExpiryTime(rs.getLong("clan_create_expiry_time")); + player.setClanCreateExpiryTime(rset.getLong("clan_create_expiry_time")); if (player.getClanCreateExpiryTime() < System.currentTimeMillis()) { player.setClanCreateExpiryTime(0); } - int clanId = rs.getInt("clanid"); - player.setPowerGrade(rs.getInt("power_grade")); - player.setPledgeType(rs.getInt("subpledge")); + player.setPowerGrade(rset.getInt("power_grade")); + player.setPledgeType(rset.getInt("subpledge")); // player.setApprentice(rs.getInt("apprentice")); + player.setDeleteTimer(rset.getLong("deletetime")); + player.setTitle(rset.getString("title")); + player.setAccessLevel(rset.getInt("accesslevel"), false); + int titleColor = rset.getInt("title_color"); + if (titleColor != PcAppearance.DEFAULT_TITLE_COLOR) + { + player.getAppearance().setTitleColor(titleColor); + } + player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId)); + player.setUptime(System.currentTimeMillis()); + + currentHp = rset.getDouble("curHp"); + currentCp = rset.getDouble("curCp"); + currentMp = rset.getDouble("curMp"); + + player._classIndex = 0; + try + { + player.setBaseClass(rset.getInt("base_class")); + } + catch (Exception e) + { + // TODO: Should this be logged? + player.setBaseClass(activeClassId); + } + + // Restore Subclass Data (cannot be done earlier in function) + if (restoreSubClassData(player)) + { + if (activeClassId != player.getBaseClass()) + { + for (SubClass subClass : player.getSubClasses().values()) + { + if (subClass.getClassId() == activeClassId) + { + player._classIndex = subClass.getClassIndex(); + } + } + } + } + if ((player.getClassIndex() == 0) && (activeClassId != player.getBaseClass())) + { + // Subclass in use but doesn't exist in DB - + // a possible restart-while-modifysubclass cheat has been attempted. + // Switching to use base class + player.setClassId(player.getBaseClass()); + _log.warning("Player " + player.getName() + " reverted to base class. Possibly has tried a relogin exploit while subclassing."); + } + else + { + player._activeClass = activeClassId; + } + + player.setApprentice(rset.getInt("apprentice")); + player.setSponsor(rset.getInt("sponsor")); + player.setLvlJoinedAcademy(rset.getInt("lvl_joined_academy")); + + CursedWeaponsManager.getInstance().checkPlayer(player); + + // Set the x,y,z position of the L2PcInstance and make it invisible + player.setXYZInvisible(rset.getInt("x"), rset.getInt("y"), rset.getInt("z")); + + // Set Teleport Bookmark Slot + player.setBookMarkSlot(rset.getInt("BookmarkSlot")); + + player._vitalityPoints = rset.getInt("vitality_points"); + + player.setPcBangPoints(rset.getInt("pccafe_points")); + + // character creation Time + player.getCreateDate().setTimeInMillis(rset.getTimestamp("createDate").getTime()); + + // Language + player.setLang(rset.getString("language")); + // Set Hero status if it applies player.setHero(Hero.getInstance().isHero(objectId)); + int clanId = rset.getInt("clanid"); if (clanId > 0) { player.setClan(ClanTable.getInstance().getClan(clanId)); @@ -7124,81 +7199,6 @@ public final class L2PcInstance extends L2Playable player.getClanPrivileges().clear(); } - player.setDeleteTimer(rs.getLong("deletetime")); - player.setTitle(rs.getString("title")); - player.setAccessLevel(rs.getInt("accesslevel"), false); - int titleColor = rs.getInt("title_color"); - if (titleColor != PcAppearance.DEFAULT_TITLE_COLOR) - { - player.getAppearance().setTitleColor(titleColor); - } - player.setFistsWeaponItem(player.findFistsWeaponItem(activeClassId)); - player.setUptime(System.currentTimeMillis()); - - currentHp = rs.getDouble("curHp"); - currentCp = rs.getDouble("curCp"); - currentMp = rs.getDouble("curMp"); - - player._classIndex = 0; - try - { - player.setBaseClass(rs.getInt("base_class")); - } - catch (Exception e) - { - // TODO: Should this be logged? - player.setBaseClass(activeClassId); - } - - // Restore Subclass Data (cannot be done earlier in function) - if (restoreSubClassData(player)) - { - if (activeClassId != player.getBaseClass()) - { - for (SubClass subClass : player.getSubClasses().values()) - { - if (subClass.getClassId() == activeClassId) - { - player._classIndex = subClass.getClassIndex(); - } - } - } - } - if ((player.getClassIndex() == 0) && (activeClassId != player.getBaseClass())) - { - // Subclass in use but doesn't exist in DB - - // a possible restart-while-modifysubclass cheat has been attempted. - // Switching to use base class - player.setClassId(player.getBaseClass()); - _log.warning("Player " + player.getName() + " reverted to base class. Possibly has tried a relogin exploit while subclassing."); - } - else - { - player._activeClass = activeClassId; - } - - player.setApprentice(rs.getInt("apprentice")); - player.setSponsor(rs.getInt("sponsor")); - player.setLvlJoinedAcademy(rs.getInt("lvl_joined_academy")); - - CursedWeaponsManager.getInstance().checkPlayer(player); - - // Set the x,y,z position of the L2PcInstance and make it invisible - player.setXYZInvisible(rs.getInt("x"), rs.getInt("y"), rs.getInt("z")); - - // Set Teleport Bookmark Slot - player.setBookMarkSlot(rs.getInt("BookmarkSlot")); - - player._vitalityPoints = rs.getInt("vitality_points"); - - player.setPcBangPoints(rs.getInt("pccafe_points")); - - // character creation Time - player.getCreateDate().setTimeInMillis(rs.getTimestamp("createDate").getTime()); - - // Language - player.setLang(rs.getString("language")); - // Retrieve the name and ID of the other characters assigned to this account. try (PreparedStatement stmt = con.prepareStatement("SELECT charId, char_name FROM characters WHERE account_name=? AND charId<>?")) { @@ -8939,17 +8939,12 @@ public final class L2PcInstance extends L2Playable // Are the target and the player in the same duel? if (isInDuel()) { - // Get L2PcInstance - if (target instanceof L2Playable) + final L2PcInstance cha = target.getActingPlayer(); + if ((cha != null) && (cha.getDuelId() != getDuelId())) { - // Get L2PcInstance - L2PcInstance cha = target.getActingPlayer(); - if (cha.getDuelId() != getDuelId()) - { - sendMessage("You cannot do this while duelling."); - sendPacket(ActionFailed.STATIC_PACKET); - return false; - } + sendMessage("You cannot do this while duelling."); + sendPacket(ActionFailed.STATIC_PACKET); + return false; } } @@ -9119,13 +9114,13 @@ public final class L2PcInstance extends L2Playable case SELF: break; default: - if (!checkPvpSkill(target, skill) && !getAccessLevel().allowPeaceAttack() && target.isPlayable()) + // Verify that player can attack a player or summon + if (target.isPlayable() && !getAccessLevel().allowPeaceAttack() && !checkPvpSkill(target, skill)) { - - // Send a System Message to the L2PcInstance + // Send a System Message to the player sendPacket(SystemMessageId.THAT_IS_AN_INCORRECT_TARGET); - // Send a Server->Client packet ActionFailed to the L2PcInstance + // Send a Server->Client packet ActionFailed to the player sendPacket(ActionFailed.STATIC_PACKET); return false; } @@ -9192,7 +9187,7 @@ public final class L2PcInstance extends L2Playable return false; } - if (!(target instanceof L2Playable)) + if (!target.isPlayable()) { return true; } @@ -9243,7 +9238,6 @@ public final class L2PcInstance extends L2Playable return false; } } - } final boolean isCtrlPressed = (getCurrentSkill() != null) && getCurrentSkill().isCtrlPressed(); @@ -9289,18 +9283,19 @@ public final class L2PcInstance extends L2Playable { if (aClan.isAtWarWith(tClan.getId()) && tClan.isAtWarWith(aClan.getId())) { - // Check if skill can do dmg - return true; // Always return true at war. + // Check if skill can do damage + if ((skill.isAOE() && (skill.getEffectRange() > 0)) && isCtrlPressed && (getTarget() == target)) + { + return true; + } + return isCtrlPressed; } else if ((getClanId() == targetPlayer.getClanId()) || ((getAllyId() > 0) && (getAllyId() == targetPlayer.getAllyId()))) { - // Check if skill can do dmg - if ((skill.getEffectRange() > 0) && isCtrlPressed && (getTarget() == target)) + // Check if skill can do damage + if ((skill.getEffectRange() > 0) && isCtrlPressed && (getTarget() == target) && skill.isDamage()) { - if (skill.isDamage()) - { - return true; - } + return true; } return false; } @@ -9317,15 +9312,12 @@ public final class L2PcInstance extends L2Playable } // On retail, it is impossible to debuff a "peaceful" player. - if ((targetPlayer.getPvpFlag() == 0) && (targetPlayer.getReputation() >= 0)) + if ((targetPlayer.getPvpFlag() == 0) && (targetPlayer.getReputation() > 0)) { - // Check if skill can do dmg - if ((skill.getEffectRange() > 0) && isCtrlPressed && (getTarget() == target)) + // Check if skill can do damage + if ((skill.getEffectRange() > 0) && isCtrlPressed && (getTarget() == target) && skill.isDamage()) { - if (skill.isDamage()) - { - return true; - } + return true; } return false; } diff --git a/trunk/java/com/l2jserver/gameserver/model/effects/L2EffectType.java b/trunk/java/com/l2jserver/gameserver/model/effects/L2EffectType.java index 2489d53d44..efa9a3d8c0 100644 --- a/trunk/java/com/l2jserver/gameserver/model/effects/L2EffectType.java +++ b/trunk/java/com/l2jserver/gameserver/model/effects/L2EffectType.java @@ -43,6 +43,7 @@ public enum L2EffectType HEAL, HP_DRAIN, MAGICAL_ATTACK, + MAGICAL_ATTACK_MP, MANAHEAL_BY_LEVEL, MANAHEAL_PERCENT, MUTE, diff --git a/trunk/java/com/l2jserver/gameserver/model/quest/Quest.java b/trunk/java/com/l2jserver/gameserver/model/quest/Quest.java index 1603baa98f..2f8aaa8ca5 100644 --- a/trunk/java/com/l2jserver/gameserver/model/quest/Quest.java +++ b/trunk/java/com/l2jserver/gameserver/model/quest/Quest.java @@ -1504,7 +1504,7 @@ public class Quest extends AbstractScript implements IIdentifiable { showHtmlFile(player, res, npc); } - else if (res.startsWith("")) + else if (res.startsWith("