diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/config/Character.ini b/L2J_Mobius_01.0_Ertheia/dist/game/config/Character.ini index 8ff4dab335..c47e6b113b 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/config/Character.ini +++ b/L2J_Mobius_01.0_Ertheia/dist/game/config/Character.ini @@ -347,6 +347,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4b4d6d3d18..711bc3edb6 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -182,6 +182,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36400-36499.xml index 700f7342ca..098cfc5839 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1313,6 +1354,7 @@ + @@ -1342,6 +1384,7 @@ + @@ -1372,6 +1415,7 @@ + @@ -1400,6 +1444,7 @@ + @@ -1430,6 +1475,7 @@ + @@ -1458,6 +1504,7 @@ + @@ -1488,6 +1535,7 @@ + @@ -1517,6 +1565,7 @@ + @@ -1549,6 +1598,7 @@ + @@ -1580,6 +1630,7 @@ + @@ -1613,6 +1664,7 @@ + @@ -1645,6 +1697,7 @@ + @@ -1676,6 +1729,7 @@ + @@ -1709,6 +1763,7 @@ + @@ -1741,6 +1796,7 @@ + @@ -1773,6 +1829,7 @@ + @@ -1805,6 +1862,7 @@ + @@ -1837,6 +1895,7 @@ + @@ -1869,6 +1928,7 @@ + @@ -1900,6 +1960,7 @@ + @@ -1931,6 +1992,7 @@ + @@ -1964,6 +2026,7 @@ + @@ -1996,6 +2059,7 @@ + @@ -2029,6 +2093,7 @@ + @@ -2063,6 +2128,7 @@ + @@ -2095,6 +2161,7 @@ + @@ -2128,6 +2195,7 @@ + @@ -2159,6 +2227,7 @@ + @@ -2192,6 +2261,7 @@ + @@ -2223,6 +2293,7 @@ + @@ -2256,6 +2327,7 @@ + @@ -2288,6 +2360,7 @@ + @@ -2321,6 +2394,7 @@ + @@ -2353,6 +2427,7 @@ + @@ -2387,6 +2462,7 @@ + @@ -2420,6 +2496,7 @@ + @@ -2452,6 +2529,7 @@ + @@ -2486,6 +2564,7 @@ + @@ -2519,6 +2598,7 @@ + @@ -2552,6 +2632,7 @@ + @@ -2585,6 +2666,7 @@ + @@ -2618,6 +2700,7 @@ + diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36500-36599.xml index 8c87a21761..cc5d244942 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/documentation.txt index 6550b5db2b..84a62b591c 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_01.0_Ertheia/dist/game/data/stats/skills/documentation.txt @@ -153,6 +153,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java index 631dd42006..236afb3e6e 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java @@ -209,6 +209,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1781,6 +1782,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Player.java index e83c5ce781..ac9e996c2a 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -756,8 +756,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11441,16 +11439,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/item/Weapon.java index d24c63aaef..e3bb874b2b 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,7 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +74,7 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +140,14 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 1a211e541f..cfab51ee8d 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Stat.java index dedd0d6dfb..90488cb5b8 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 3450b57716..4f42655b47 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,64 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final int bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final int bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon() && item.getWeaponItem().isDragonWeapon()) + { + shouldLiftLimit = true; } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_02.5_Underground/dist/game/config/Character.ini b/L2J_Mobius_02.5_Underground/dist/game/config/Character.ini index 5897b96dda..b8b456b61d 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/config/Character.ini +++ b/L2J_Mobius_02.5_Underground/dist/game/config/Character.ini @@ -347,6 +347,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4b4d6d3d18..711bc3edb6 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -182,6 +182,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_02.5_Underground/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36400-36499.xml index 795827fdee..418afca5d4 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36500-36599.xml index a47fd9fb6a..0a3db6b602 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/documentation.txt index 6550b5db2b..84a62b591c 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_02.5_Underground/dist/game/data/stats/skills/documentation.txt @@ -153,6 +153,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java index 67e7af35ed..a85fe469ab 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java @@ -216,6 +216,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1801,6 +1802,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Player.java index 7eacb0343f..c120bac554 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -758,8 +758,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11444,16 +11442,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/item/Weapon.java index d24c63aaef..e3bb874b2b 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,7 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +74,7 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +140,14 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 1a211e541f..cfab51ee8d 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/Stat.java index dedd0d6dfb..90488cb5b8 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 3450b57716..4f42655b47 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,64 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final int bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final int bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon() && item.getWeaponItem().isDragonWeapon()) + { + shouldLiftLimit = true; } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_03.0_Helios/dist/game/config/Character.ini b/L2J_Mobius_03.0_Helios/dist/game/config/Character.ini index 5897b96dda..b8b456b61d 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/config/Character.ini +++ b/L2J_Mobius_03.0_Helios/dist/game/config/Character.ini @@ -347,6 +347,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4b4d6d3d18..711bc3edb6 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -182,6 +182,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_03.0_Helios/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_03.0_Helios/dist/game/data/stats/items/36400-36499.xml index 795827fdee..418afca5d4 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_03.0_Helios/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_03.0_Helios/dist/game/data/stats/items/36500-36599.xml index 7f159b69df..fa8f0b524f 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_03.0_Helios/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/documentation.txt index 6550b5db2b..84a62b591c 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_03.0_Helios/dist/game/data/stats/skills/documentation.txt @@ -153,6 +153,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java index 31d7aa521c..efb0dbd080 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java @@ -216,6 +216,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1814,6 +1815,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Player.java index 4da452de57..84ac0dd39d 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -760,8 +760,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11446,16 +11444,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/item/Weapon.java index d24c63aaef..e3bb874b2b 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,7 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +74,7 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +140,14 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 1a211e541f..cfab51ee8d 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/Stat.java index dedd0d6dfb..90488cb5b8 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 3450b57716..4f42655b47 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,64 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final int bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final int bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon() && item.getWeaponItem().isDragonWeapon()) + { + shouldLiftLimit = true; } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Character.ini b/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Character.ini index 3261c36a79..88ff94a68e 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Character.ini +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Character.ini @@ -347,6 +347,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java index 5d11e2e4ad..e66cf73dcd 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -186,6 +186,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/items/36400-36499.xml index 7781f346f7..59e0701738 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/items/36500-36599.xml index a04cb0f2b0..5b9bba4926 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt index fdfd05596f..cff19a027b 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/data/stats/skills/documentation.txt @@ -157,6 +157,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java index 008f373a32..79ee02edfb 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java @@ -216,6 +216,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1801,6 +1802,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Player.java index 0396769e2c..b561307b65 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -765,8 +765,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11427,16 +11425,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/item/Weapon.java index d24c63aaef..e3bb874b2b 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,7 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +74,7 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +140,14 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 1a211e541f..cfab51ee8d 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Stat.java index d007925d19..4f213dcbd7 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 3450b57716..4f42655b47 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,64 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final int bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final int bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon() && item.getWeaponItem().isDragonWeapon()) + { + shouldLiftLimit = true; } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_05.0_Salvation/dist/game/config/Character.ini b/L2J_Mobius_05.0_Salvation/dist/game/config/Character.ini index f19c93f28d..8893100fde 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/config/Character.ini +++ b/L2J_Mobius_05.0_Salvation/dist/game/config/Character.ini @@ -347,6 +347,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java index eb09091dc1..0a57cfcea6 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -189,6 +189,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/items/36400-36499.xml index 767d994312..c9614742ae 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/items/36500-36599.xml index 486d4f2d3e..7ef42d90d6 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/documentation.txt index 6297fea43d..c0f4bef3f0 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_05.0_Salvation/dist/game/data/stats/skills/documentation.txt @@ -160,6 +160,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java index a7f7dd2dc4..be6bfde003 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java @@ -223,6 +223,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1810,6 +1811,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Player.java index 331e8a49be..d25123ff99 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -761,8 +761,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11453,16 +11451,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/item/Weapon.java index d24c63aaef..e3bb874b2b 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,7 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +74,7 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +140,14 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 1a211e541f..cfab51ee8d 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Stat.java index 8fdb8000ae..5ecf361d73 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 10d5d8f3e3..3b84be0734 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,64 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon() && item.getWeaponItem().isDragonWeapon()) + { + shouldLiftLimit = true; } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/config/Character.ini b/L2J_Mobius_05.5_EtinasFate/dist/game/config/Character.ini index f19c93f28d..8893100fde 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/config/Character.ini +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/config/Character.ini @@ -347,6 +347,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java index 748731f653..e74809f754 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -190,6 +190,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/items/36400-36499.xml index 5d1f7814cd..31aeec4498 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/items/36500-36599.xml index 25cfcaed1a..423fa739ba 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/documentation.txt index e538359b55..37c0f58010 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/data/stats/skills/documentation.txt @@ -161,6 +161,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java index efea8d73b5..b9ab417c9f 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java @@ -223,6 +223,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1817,6 +1818,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Player.java index ef3368d4bd..9d7f29fbce 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -761,8 +761,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11456,16 +11454,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/item/Weapon.java index d24c63aaef..e3bb874b2b 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,7 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +74,7 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +140,14 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 1a211e541f..cfab51ee8d 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Stat.java index 6df8233361..982e74c9d2 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 10d5d8f3e3..3b84be0734 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,64 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon() && item.getWeaponItem().isDragonWeapon()) + { + shouldLiftLimit = true; } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/config/Character.ini b/L2J_Mobius_06.0_Fafurion/dist/game/config/Character.ini index dbbfc52676..b8361f927a 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/config/Character.ini +++ b/L2J_Mobius_06.0_Fafurion/dist/game/config/Character.ini @@ -351,6 +351,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java index 748731f653..e74809f754 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -190,6 +190,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/36400-36499.xml index fd5a799b77..57a475cd57 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/36500-36599.xml index 84b8b937f6..315cf9acb4 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/80000-80099.xml b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/80000-80099.xml index f35e54bc0c..b40d1e08f7 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/80000-80099.xml +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/80000-80099.xml @@ -1120,6 +1120,7 @@ + @@ -1142,6 +1143,7 @@ + @@ -1164,6 +1166,7 @@ + @@ -1190,6 +1193,7 @@ + @@ -1213,6 +1217,7 @@ + @@ -1235,6 +1240,7 @@ + @@ -1256,6 +1262,7 @@ + @@ -1282,6 +1289,7 @@ + @@ -1308,6 +1316,7 @@ + @@ -1336,6 +1345,7 @@ + @@ -1363,6 +1373,7 @@ + @@ -1389,6 +1400,7 @@ + @@ -1414,6 +1426,7 @@ + @@ -1442,6 +1455,7 @@ + @@ -1470,6 +1484,7 @@ + @@ -1500,6 +1515,7 @@ + @@ -1529,6 +1545,7 @@ + @@ -1557,6 +1574,7 @@ + @@ -1584,6 +1602,7 @@ + @@ -1613,6 +1632,7 @@ + @@ -1642,6 +1662,7 @@ + @@ -1673,6 +1694,7 @@ + @@ -1703,6 +1725,7 @@ + @@ -1732,6 +1755,7 @@ + diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/80300-80399.xml b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/80300-80399.xml index b6b94bf3ef..e04995d4e4 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/80300-80399.xml +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/items/80300-80399.xml @@ -151,6 +151,7 @@ + @@ -176,6 +177,7 @@ + @@ -206,6 +208,7 @@ + @@ -238,6 +241,7 @@ + diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/documentation.txt index e538359b55..37c0f58010 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_06.0_Fafurion/dist/game/data/stats/skills/documentation.txt @@ -161,6 +161,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java index 75d796b46f..56cd73f678 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java @@ -224,6 +224,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1852,6 +1853,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Player.java index 01b7bec2ec..f0c02fe9d0 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -761,8 +761,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11462,16 +11460,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/item/Weapon.java index d24c63aaef..e3bb874b2b 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,7 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +74,7 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +140,14 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 1a211e541f..cfab51ee8d 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Stat.java index 6df8233361..982e74c9d2 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 10d5d8f3e3..3b84be0734 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,64 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon() && item.getWeaponItem().isDragonWeapon()) + { + shouldLiftLimit = true; } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Character.ini b/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Character.ini index c11653ab35..6c4e7cc33b 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Character.ini +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Character.ini @@ -361,6 +361,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java index 621226b271..f1739bd482 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -190,6 +190,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/36400-36499.xml index fd5a799b77..57a475cd57 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/36500-36599.xml index 84b8b937f6..315cf9acb4 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80000-80099.xml b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80000-80099.xml index 7eb6d34176..e8eff353f9 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80000-80099.xml +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80000-80099.xml @@ -1120,6 +1120,7 @@ + @@ -1144,6 +1145,7 @@ + @@ -1168,6 +1170,7 @@ + @@ -1196,6 +1199,7 @@ + @@ -1221,6 +1225,7 @@ + @@ -1245,6 +1250,7 @@ + @@ -1268,6 +1274,7 @@ + @@ -1296,6 +1303,7 @@ + @@ -1324,6 +1332,7 @@ + @@ -1354,6 +1363,7 @@ + @@ -1383,6 +1393,7 @@ + @@ -1411,6 +1422,7 @@ + @@ -1438,6 +1450,7 @@ + @@ -1468,6 +1481,7 @@ + @@ -1498,6 +1512,7 @@ + @@ -1530,6 +1545,7 @@ + @@ -1561,6 +1577,7 @@ + @@ -1591,6 +1608,7 @@ + @@ -1620,6 +1638,7 @@ + @@ -1651,6 +1670,7 @@ + @@ -1682,6 +1702,7 @@ + @@ -1715,6 +1736,7 @@ + @@ -1747,6 +1769,7 @@ + @@ -1778,6 +1801,7 @@ + diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80300-80399.xml b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80300-80399.xml index b6b94bf3ef..e04995d4e4 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80300-80399.xml +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80300-80399.xml @@ -151,6 +151,7 @@ + @@ -176,6 +177,7 @@ + @@ -206,6 +208,7 @@ + @@ -238,6 +241,7 @@ + diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80600-80699.xml b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80600-80699.xml index b2ea2f3ef4..99bfabc6f5 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80600-80699.xml +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80600-80699.xml @@ -1204,6 +1204,7 @@ + @@ -1228,6 +1229,7 @@ + diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80700-80799.xml b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80700-80799.xml index e38a80b418..f2e5fd7055 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80700-80799.xml +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80700-80799.xml @@ -4,6 +4,7 @@ + @@ -27,6 +28,7 @@ + @@ -49,6 +51,7 @@ + @@ -73,6 +76,7 @@ + @@ -100,6 +104,7 @@ + @@ -124,6 +129,7 @@ + @@ -148,6 +154,7 @@ + @@ -171,6 +178,7 @@ + @@ -196,6 +204,7 @@ + @@ -221,6 +230,7 @@ + @@ -244,6 +254,7 @@ + @@ -268,6 +279,7 @@ + diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80800-80899.xml b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80800-80899.xml index fc16d1f81d..30e1172dc8 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80800-80899.xml +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80800-80899.xml @@ -772,6 +772,7 @@ + @@ -796,6 +797,7 @@ + @@ -819,6 +821,7 @@ + @@ -842,6 +845,7 @@ + @@ -865,6 +869,7 @@ + @@ -889,6 +894,7 @@ + @@ -916,6 +922,7 @@ + @@ -940,6 +947,7 @@ + @@ -964,6 +972,7 @@ + @@ -987,6 +996,7 @@ + @@ -1012,6 +1022,7 @@ + @@ -1037,6 +1048,7 @@ + @@ -1060,6 +1072,7 @@ + @@ -1084,6 +1097,7 @@ + @@ -1108,6 +1122,7 @@ + @@ -1138,6 +1153,7 @@ + @@ -1167,6 +1183,7 @@ + @@ -1196,6 +1213,7 @@ + @@ -1225,6 +1243,7 @@ + @@ -1255,6 +1274,7 @@ + @@ -1286,6 +1306,7 @@ + @@ -1316,6 +1337,7 @@ + @@ -1346,6 +1368,7 @@ + @@ -1375,6 +1398,7 @@ + @@ -1405,6 +1429,7 @@ + @@ -1436,6 +1461,7 @@ + @@ -1465,6 +1491,7 @@ + @@ -1495,6 +1522,7 @@ + @@ -1525,6 +1553,7 @@ + @@ -1555,6 +1584,7 @@ + @@ -1584,6 +1614,7 @@ + @@ -1613,6 +1644,7 @@ + @@ -1642,6 +1674,7 @@ + @@ -1672,6 +1705,7 @@ + @@ -1703,6 +1737,7 @@ + @@ -1733,6 +1768,7 @@ + @@ -1763,6 +1799,7 @@ + @@ -1792,6 +1829,7 @@ + @@ -1822,6 +1860,7 @@ + @@ -1853,6 +1892,7 @@ + @@ -1882,6 +1922,7 @@ + diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80900-80999.xml b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80900-80999.xml index 2a8a6af2ac..52a35cda4d 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80900-80999.xml +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/items/80900-80999.xml @@ -3,6 +3,7 @@ + diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt index 6eedb4d8c6..80bad74f65 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/data/stats/skills/documentation.txt @@ -161,6 +161,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java index 909d4c00af..4577b10773 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java @@ -224,6 +224,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1862,6 +1863,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java index 8688ab86b8..81995ee3a3 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -773,8 +773,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11491,16 +11489,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/item/Weapon.java index 05a29a67a4..fdc53fe8e6 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,8 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; + private boolean _isCursedWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +75,8 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); + _isCursedWeapon = set.getBoolean("is_cursed_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +142,22 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + + /** + * @return {@code true} if the weapon is a cursed weapon, {@code false} otherwise. + */ + public boolean isCursedWeapon() + { + return _isCursedWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 8c926b89b4..ef57080ace 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Stat.java index 531e3c5c19..a30aaff246 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 10d5d8f3e3..f95f753a76 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,68 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon()) + { + final Weapon weapon = item.getWeaponItem(); + if (weapon.isDragonWeapon() || weapon.isCursedWeapon()) + { + shouldLiftLimit = true; } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/config/Character.ini b/L2J_Mobius_08.2_Homunculus/dist/game/config/Character.ini index cb2515b637..aff251a888 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/config/Character.ini +++ b/L2J_Mobius_08.2_Homunculus/dist/game/config/Character.ini @@ -361,6 +361,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/EffectMasterHandler.java index ae05e05dfc..4674f471a4 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -191,6 +191,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/36400-36499.xml index c477e27c2c..dae4483e48 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/36500-36599.xml index 04abddf47f..5160989130 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80000-80099.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80000-80099.xml index 6a20d6e64f..c696aedaa8 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80000-80099.xml +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80000-80099.xml @@ -1176,6 +1176,7 @@ + @@ -1200,6 +1201,7 @@ + @@ -1224,6 +1226,7 @@ + @@ -1252,6 +1255,7 @@ + @@ -1277,6 +1281,7 @@ + @@ -1301,6 +1306,7 @@ + @@ -1324,6 +1330,7 @@ + @@ -1352,6 +1359,7 @@ + @@ -1380,6 +1388,7 @@ + @@ -1410,6 +1419,7 @@ + @@ -1439,6 +1449,7 @@ + @@ -1467,6 +1478,7 @@ + @@ -1494,6 +1506,7 @@ + @@ -1525,6 +1538,7 @@ + @@ -1556,6 +1570,7 @@ + @@ -1589,6 +1604,7 @@ + @@ -1621,6 +1637,7 @@ + @@ -1652,6 +1669,7 @@ + @@ -1682,6 +1700,7 @@ + @@ -1714,6 +1733,7 @@ + @@ -1746,6 +1766,7 @@ + @@ -1780,6 +1801,7 @@ + @@ -1813,6 +1835,7 @@ + @@ -1845,6 +1868,7 @@ + diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80300-80399.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80300-80399.xml index bdae1a87ba..b89232edbb 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80300-80399.xml +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80300-80399.xml @@ -151,6 +151,7 @@ + @@ -176,6 +177,7 @@ + @@ -206,6 +208,7 @@ + @@ -238,6 +241,7 @@ + diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80600-80699.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80600-80699.xml index c6084ce01e..ca9b2fb885 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80600-80699.xml +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80600-80699.xml @@ -1273,6 +1273,7 @@ + @@ -1297,6 +1298,7 @@ + diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80700-80799.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80700-80799.xml index 6ee61c2e64..b55a375855 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80700-80799.xml +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80700-80799.xml @@ -4,6 +4,7 @@ + @@ -27,6 +28,7 @@ + @@ -49,6 +51,7 @@ + @@ -73,6 +76,7 @@ + @@ -100,6 +104,7 @@ + @@ -124,6 +129,7 @@ + @@ -148,6 +154,7 @@ + @@ -171,6 +178,7 @@ + @@ -196,6 +204,7 @@ + @@ -221,6 +230,7 @@ + @@ -244,6 +254,7 @@ + @@ -268,6 +279,7 @@ + diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80800-80899.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80800-80899.xml index e7149a44ff..f74dbb67dd 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80800-80899.xml +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80800-80899.xml @@ -782,6 +782,7 @@ + @@ -806,6 +807,7 @@ + @@ -829,6 +831,7 @@ + @@ -852,6 +855,7 @@ + @@ -875,6 +879,7 @@ + @@ -899,6 +904,7 @@ + @@ -926,6 +932,7 @@ + @@ -950,6 +957,7 @@ + @@ -974,6 +982,7 @@ + @@ -997,6 +1006,7 @@ + @@ -1022,6 +1032,7 @@ + @@ -1047,6 +1058,7 @@ + @@ -1070,6 +1082,7 @@ + @@ -1094,6 +1107,7 @@ + @@ -1118,6 +1132,7 @@ + @@ -1150,6 +1165,7 @@ + @@ -1181,6 +1197,7 @@ + @@ -1212,6 +1229,7 @@ + @@ -1243,6 +1261,7 @@ + @@ -1275,6 +1294,7 @@ + @@ -1308,6 +1328,7 @@ + @@ -1340,6 +1361,7 @@ + @@ -1372,6 +1394,7 @@ + @@ -1403,6 +1426,7 @@ + @@ -1435,6 +1459,7 @@ + @@ -1468,6 +1493,7 @@ + @@ -1499,6 +1525,7 @@ + @@ -1531,6 +1558,7 @@ + @@ -1563,6 +1591,7 @@ + @@ -1595,6 +1624,7 @@ + @@ -1626,6 +1656,7 @@ + @@ -1657,6 +1688,7 @@ + @@ -1688,6 +1720,7 @@ + @@ -1720,6 +1753,7 @@ + @@ -1753,6 +1787,7 @@ + @@ -1785,6 +1820,7 @@ + @@ -1817,6 +1853,7 @@ + @@ -1848,6 +1885,7 @@ + @@ -1880,6 +1918,7 @@ + @@ -1913,6 +1952,7 @@ + @@ -1944,6 +1984,7 @@ + diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80900-80999.xml b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80900-80999.xml index f4948a0d96..3d58c56bfd 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80900-80999.xml +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/items/80900-80999.xml @@ -3,6 +3,7 @@ + diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/documentation.txt index 60fb337696..b756124034 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_08.2_Homunculus/dist/game/data/stats/skills/documentation.txt @@ -162,6 +162,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java index 7b4ebefefc..68d7209ffe 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java @@ -217,6 +217,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1835,6 +1836,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java index 999f1ed556..657cd518e7 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -778,8 +778,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11607,16 +11605,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/Weapon.java index 05a29a67a4..fdc53fe8e6 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,8 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; + private boolean _isCursedWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +75,8 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); + _isCursedWeapon = set.getBoolean("is_cursed_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +142,22 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + + /** + * @return {@code true} if the weapon is a cursed weapon, {@code false} otherwise. + */ + public boolean isCursedWeapon() + { + return _isCursedWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 8c926b89b4..ef57080ace 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/Stat.java index 7c8311dcce..6548fde01a 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 10d5d8f3e3..f95f753a76 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,68 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon()) + { + final Weapon weapon = item.getWeaponItem(); + if (weapon.isDragonWeapon() || weapon.isCursedWeapon()) + { + shouldLiftLimit = true; } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Character.ini b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Character.ini index d37b76fb25..768dae0042 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Character.ini +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Character.ini @@ -361,6 +361,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/EffectMasterHandler.java index 4ad6ef49c9..33181f1511 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -192,6 +192,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/36400-36499.xml index 86349e7fc6..0578649396 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/36500-36599.xml index 8e9ce89cbd..27d0eb0cce 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80000-80099.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80000-80099.xml index a3042a030a..7293add989 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80000-80099.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80000-80099.xml @@ -1176,6 +1176,7 @@ + @@ -1200,6 +1201,7 @@ + @@ -1224,6 +1226,7 @@ + @@ -1252,6 +1255,7 @@ + @@ -1277,6 +1281,7 @@ + @@ -1301,6 +1306,7 @@ + @@ -1324,6 +1330,7 @@ + @@ -1352,6 +1359,7 @@ + @@ -1380,6 +1388,7 @@ + @@ -1410,6 +1419,7 @@ + @@ -1439,6 +1449,7 @@ + @@ -1467,6 +1478,7 @@ + @@ -1494,6 +1506,7 @@ + @@ -1525,6 +1538,7 @@ + @@ -1556,6 +1570,7 @@ + @@ -1589,6 +1604,7 @@ + @@ -1621,6 +1637,7 @@ + @@ -1652,6 +1669,7 @@ + @@ -1682,6 +1700,7 @@ + @@ -1714,6 +1733,7 @@ + @@ -1746,6 +1766,7 @@ + @@ -1780,6 +1801,7 @@ + @@ -1813,6 +1835,7 @@ + @@ -1845,6 +1868,7 @@ + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80300-80399.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80300-80399.xml index fa6079ee07..bcceb942ad 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80300-80399.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80300-80399.xml @@ -151,6 +151,7 @@ + @@ -176,6 +177,7 @@ + @@ -206,6 +208,7 @@ + @@ -238,6 +241,7 @@ + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80600-80699.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80600-80699.xml index ef8d435f37..612bbfa7db 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80600-80699.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80600-80699.xml @@ -1273,6 +1273,7 @@ + @@ -1297,6 +1298,7 @@ + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80700-80799.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80700-80799.xml index d19c8ab121..d45e6766ce 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80700-80799.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80700-80799.xml @@ -4,6 +4,7 @@ + @@ -27,6 +28,7 @@ + @@ -49,6 +51,7 @@ + @@ -73,6 +76,7 @@ + @@ -100,6 +104,7 @@ + @@ -124,6 +129,7 @@ + @@ -148,6 +154,7 @@ + @@ -171,6 +178,7 @@ + @@ -196,6 +204,7 @@ + @@ -221,6 +230,7 @@ + @@ -244,6 +254,7 @@ + @@ -268,6 +279,7 @@ + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80800-80899.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80800-80899.xml index e7ab90c23a..e092d59449 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80800-80899.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80800-80899.xml @@ -782,6 +782,7 @@ + @@ -806,6 +807,7 @@ + @@ -829,6 +831,7 @@ + @@ -852,6 +855,7 @@ + @@ -875,6 +879,7 @@ + @@ -899,6 +904,7 @@ + @@ -926,6 +932,7 @@ + @@ -950,6 +957,7 @@ + @@ -974,6 +982,7 @@ + @@ -997,6 +1006,7 @@ + @@ -1022,6 +1032,7 @@ + @@ -1047,6 +1058,7 @@ + @@ -1070,6 +1082,7 @@ + @@ -1094,6 +1107,7 @@ + @@ -1118,6 +1132,7 @@ + @@ -1150,6 +1165,7 @@ + @@ -1181,6 +1197,7 @@ + @@ -1212,6 +1229,7 @@ + @@ -1243,6 +1261,7 @@ + @@ -1275,6 +1294,7 @@ + @@ -1308,6 +1328,7 @@ + @@ -1340,6 +1361,7 @@ + @@ -1372,6 +1394,7 @@ + @@ -1403,6 +1426,7 @@ + @@ -1435,6 +1459,7 @@ + @@ -1468,6 +1493,7 @@ + @@ -1499,6 +1525,7 @@ + @@ -1531,6 +1558,7 @@ + @@ -1563,6 +1591,7 @@ + @@ -1595,6 +1624,7 @@ + @@ -1626,6 +1656,7 @@ + @@ -1657,6 +1688,7 @@ + @@ -1688,6 +1720,7 @@ + @@ -1720,6 +1753,7 @@ + @@ -1753,6 +1787,7 @@ + @@ -1785,6 +1820,7 @@ + @@ -1817,6 +1853,7 @@ + @@ -1848,6 +1885,7 @@ + @@ -1880,6 +1918,7 @@ + @@ -1913,6 +1952,7 @@ + @@ -1944,6 +1984,7 @@ + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80900-80999.xml b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80900-80999.xml index c4b4769855..232cc15511 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80900-80999.xml +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/items/80900-80999.xml @@ -3,6 +3,7 @@ + diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/documentation.txt index a01644e318..69e926be2f 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/data/stats/skills/documentation.txt @@ -162,6 +162,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java index bdd3baa72a..967b771028 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java @@ -217,6 +217,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1837,6 +1838,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java index aa77d4dc56..73063e793a 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -791,8 +791,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11634,16 +11632,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/Weapon.java index 05a29a67a4..fdc53fe8e6 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,8 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; + private boolean _isCursedWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +75,8 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); + _isCursedWeapon = set.getBoolean("is_cursed_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +142,22 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + + /** + * @return {@code true} if the weapon is a cursed weapon, {@code false} otherwise. + */ + public boolean isCursedWeapon() + { + return _isCursedWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 8c926b89b4..ef57080ace 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/Stat.java index 7c8311dcce..6548fde01a 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 10d5d8f3e3..f95f753a76 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,68 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon()) + { + final Weapon weapon = item.getWeaponItem(); + if (weapon.isDragonWeapon() || weapon.isCursedWeapon()) + { + shouldLiftLimit = true; } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/config/Character.ini b/L2J_Mobius_10.1_MasterClass/dist/game/config/Character.ini index d37b76fb25..768dae0042 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/config/Character.ini +++ b/L2J_Mobius_10.1_MasterClass/dist/game/config/Character.ini @@ -361,6 +361,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java index 9340e046ea..12d699750d 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -192,6 +192,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("Ignition", Ignition::new); diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/36400-36499.xml index 86349e7fc6..0578649396 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/36500-36599.xml index 8e9ce89cbd..27d0eb0cce 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80000-80099.xml b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80000-80099.xml index a3042a030a..7293add989 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80000-80099.xml +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80000-80099.xml @@ -1176,6 +1176,7 @@ + @@ -1200,6 +1201,7 @@ + @@ -1224,6 +1226,7 @@ + @@ -1252,6 +1255,7 @@ + @@ -1277,6 +1281,7 @@ + @@ -1301,6 +1306,7 @@ + @@ -1324,6 +1330,7 @@ + @@ -1352,6 +1359,7 @@ + @@ -1380,6 +1388,7 @@ + @@ -1410,6 +1419,7 @@ + @@ -1439,6 +1449,7 @@ + @@ -1467,6 +1478,7 @@ + @@ -1494,6 +1506,7 @@ + @@ -1525,6 +1538,7 @@ + @@ -1556,6 +1570,7 @@ + @@ -1589,6 +1604,7 @@ + @@ -1621,6 +1637,7 @@ + @@ -1652,6 +1669,7 @@ + @@ -1682,6 +1700,7 @@ + @@ -1714,6 +1733,7 @@ + @@ -1746,6 +1766,7 @@ + @@ -1780,6 +1801,7 @@ + @@ -1813,6 +1835,7 @@ + @@ -1845,6 +1868,7 @@ + diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80300-80399.xml b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80300-80399.xml index fa6079ee07..bcceb942ad 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80300-80399.xml +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80300-80399.xml @@ -151,6 +151,7 @@ + @@ -176,6 +177,7 @@ + @@ -206,6 +208,7 @@ + @@ -238,6 +241,7 @@ + diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80600-80699.xml b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80600-80699.xml index ef8d435f37..612bbfa7db 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80600-80699.xml +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80600-80699.xml @@ -1273,6 +1273,7 @@ + @@ -1297,6 +1298,7 @@ + diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80700-80799.xml b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80700-80799.xml index d19c8ab121..d45e6766ce 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80700-80799.xml +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80700-80799.xml @@ -4,6 +4,7 @@ + @@ -27,6 +28,7 @@ + @@ -49,6 +51,7 @@ + @@ -73,6 +76,7 @@ + @@ -100,6 +104,7 @@ + @@ -124,6 +129,7 @@ + @@ -148,6 +154,7 @@ + @@ -171,6 +178,7 @@ + @@ -196,6 +204,7 @@ + @@ -221,6 +230,7 @@ + @@ -244,6 +254,7 @@ + @@ -268,6 +279,7 @@ + diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80800-80899.xml b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80800-80899.xml index 1490f91dc9..a4e7ee1803 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80800-80899.xml +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80800-80899.xml @@ -782,6 +782,7 @@ + @@ -806,6 +807,7 @@ + @@ -829,6 +831,7 @@ + @@ -852,6 +855,7 @@ + @@ -875,6 +879,7 @@ + @@ -899,6 +904,7 @@ + @@ -926,6 +932,7 @@ + @@ -950,6 +957,7 @@ + @@ -974,6 +982,7 @@ + @@ -997,6 +1006,7 @@ + @@ -1022,6 +1032,7 @@ + @@ -1047,6 +1058,7 @@ + @@ -1070,6 +1082,7 @@ + @@ -1094,6 +1107,7 @@ + @@ -1118,6 +1132,7 @@ + @@ -1150,6 +1165,7 @@ + @@ -1181,6 +1197,7 @@ + @@ -1212,6 +1229,7 @@ + @@ -1243,6 +1261,7 @@ + @@ -1275,6 +1294,7 @@ + @@ -1308,6 +1328,7 @@ + @@ -1340,6 +1361,7 @@ + @@ -1372,6 +1394,7 @@ + @@ -1403,6 +1426,7 @@ + @@ -1435,6 +1459,7 @@ + @@ -1468,6 +1493,7 @@ + @@ -1499,6 +1525,7 @@ + @@ -1531,6 +1558,7 @@ + @@ -1563,6 +1591,7 @@ + @@ -1595,6 +1624,7 @@ + @@ -1626,6 +1656,7 @@ + @@ -1657,6 +1688,7 @@ + @@ -1688,6 +1720,7 @@ + @@ -1720,6 +1753,7 @@ + @@ -1753,6 +1787,7 @@ + @@ -1785,6 +1820,7 @@ + @@ -1817,6 +1853,7 @@ + @@ -1848,6 +1885,7 @@ + @@ -1880,6 +1918,7 @@ + @@ -1913,6 +1952,7 @@ + @@ -1944,6 +1984,7 @@ + diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80900-80999.xml b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80900-80999.xml index c4b4769855..232cc15511 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80900-80999.xml +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/items/80900-80999.xml @@ -3,6 +3,7 @@ + diff --git a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/documentation.txt index 3b779c4442..053b1265e0 100644 --- a/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_10.1_MasterClass/dist/game/data/stats/skills/documentation.txt @@ -162,6 +162,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. Ignition: Transforms sword to Death Knight's Flame Sword. (l2jmobius) diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java index 10f29c1fee..eeb62448ce 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/Config.java @@ -217,6 +217,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1837,6 +1838,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java index 08b15cb4f5..68278100b4 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -793,8 +793,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11684,16 +11682,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/Weapon.java index 05a29a67a4..fdc53fe8e6 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,8 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; + private boolean _isCursedWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +75,8 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); + _isCursedWeapon = set.getBoolean("is_cursed_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +142,22 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + + /** + * @return {@code true} if the weapon is a cursed weapon, {@code false} otherwise. + */ + public boolean isCursedWeapon() + { + return _isCursedWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 41b088e736..98a2c73b9b 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java index 7c8311dcce..6548fde01a 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 10d5d8f3e3..f95f753a76 100644 --- a/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_10.1_MasterClass/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,68 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon()) + { + final Weapon weapon = item.getWeaponItem(); + if (weapon.isDragonWeapon() || weapon.isCursedWeapon()) + { + shouldLiftLimit = true; } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/config/Character.ini b/L2J_Mobius_10.2_MasterClass/dist/game/config/Character.ini index d37b76fb25..768dae0042 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/config/Character.ini +++ b/L2J_Mobius_10.2_MasterClass/dist/game/config/Character.ini @@ -361,6 +361,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/DragonWeaponListeners.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/DragonWeaponListeners.java deleted file mode 100644 index c50af03d70..0000000000 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/ai/others/DragonWeaponListeners.java +++ /dev/null @@ -1,455 +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 ai.others; - -import org.l2jmobius.commons.util.CommonUtil; -import org.l2jmobius.gameserver.model.actor.Player; -import org.l2jmobius.gameserver.model.events.EventType; -import org.l2jmobius.gameserver.model.events.ListenerRegisterType; -import org.l2jmobius.gameserver.model.events.annotations.Id; -import org.l2jmobius.gameserver.model.events.annotations.RegisterEvent; -import org.l2jmobius.gameserver.model.events.annotations.RegisterType; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemEquip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerItemUnequip; -import org.l2jmobius.gameserver.model.events.impl.creature.player.OnPlayerLogin; -import org.l2jmobius.gameserver.model.item.Weapon; - -import ai.AbstractNpcAI; - -/** - * @author Mobius - */ -public class DragonWeaponListeners extends AbstractNpcAI -{ - private static final int[] WEAPON_IDS = - { - 36417, - 36418, - 36419, - 36420, - 36421, - 36422, - 36423, - 36424, - 36425, - 36426, - 36441, - 36442, - 36443, - 36444, - 36445, - 36446, - 36447, - 36448, - 36449, - 36450, - 36465, - 36466, - 36467, - 36468, - 36469, - 36470, - 36471, - 36472, - 36473, - 36474, - 36489, - 36490, - 36491, - 36492, - 36493, - 36494, - 36495, - 36496, - 36497, - 36498, - 36427, - 36428, - 36429, - 36430, - 36431, - 36432, - 36433, - 36451, - 36452, - 36453, - 36454, - 36455, - 36456, - 36457, - 36475, - 36476, - 36477, - 36478, - 36479, - 36480, - 36481, - 36499, - 36500, - 36501, - 36502, - 36503, - 36504, - 36505, - 36434, - 36435, - 36436, - 36437, - 36438, - 36439, - 36440, - 36458, - 36459, - 36460, - 36461, - 36462, - 36463, - 36464, - 36482, - 36483, - 36484, - 36485, - 36486, - 36487, - 36488, - 36506, - 36507, - 36508, - 36509, - 36510, - 36511, - 36512, - 80066, - 80067, - 80068, - 80069, - 80070, - 80071, - 80072, - 80073, - 80074, - 80075, - 80076, - 80077, - 80078, - 80079, - 80080, - 80081, - 80082, - 80083, - 80084, - 80085, - 80086, - 80087, - 80088, - 80089, - 80315, - 80316, - 80317, - 80318, - }; - - @RegisterEvent(EventType.ON_PLAYER_LOGIN) - @RegisterType(ListenerRegisterType.GLOBAL_PLAYERS) - public void onPlayerLogin(OnPlayerLogin event) - { - final Player player = event.getPlayer(); - if (player != null) - { - final Weapon weapon = player.getActiveWeaponItem(); - if ((weapon != null) && CommonUtil.contains(WEAPON_IDS, weapon.getId())) - { - player.setDragonWeaponEquipped(true); - } - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_EQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemEquip(OnPlayerItemEquip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(true); - } - } - - @RegisterEvent(EventType.ON_PLAYER_ITEM_UNEQUIP) - @RegisterType(ListenerRegisterType.ITEM) - @Id(36417) - @Id(36418) - @Id(36419) - @Id(36420) - @Id(36421) - @Id(36422) - @Id(36423) - @Id(36424) - @Id(36425) - @Id(36426) - @Id(36441) - @Id(36442) - @Id(36443) - @Id(36444) - @Id(36445) - @Id(36446) - @Id(36447) - @Id(36448) - @Id(36449) - @Id(36450) - @Id(36465) - @Id(36466) - @Id(36467) - @Id(36468) - @Id(36469) - @Id(36470) - @Id(36471) - @Id(36472) - @Id(36473) - @Id(36474) - @Id(36489) - @Id(36490) - @Id(36491) - @Id(36492) - @Id(36493) - @Id(36494) - @Id(36495) - @Id(36496) - @Id(36497) - @Id(36498) - @Id(36427) - @Id(36428) - @Id(36429) - @Id(36430) - @Id(36431) - @Id(36432) - @Id(36433) - @Id(36451) - @Id(36452) - @Id(36453) - @Id(36454) - @Id(36455) - @Id(36456) - @Id(36457) - @Id(36475) - @Id(36476) - @Id(36477) - @Id(36478) - @Id(36479) - @Id(36480) - @Id(36481) - @Id(36499) - @Id(36500) - @Id(36501) - @Id(36502) - @Id(36503) - @Id(36504) - @Id(36505) - @Id(36434) - @Id(36435) - @Id(36436) - @Id(36437) - @Id(36438) - @Id(36439) - @Id(36440) - @Id(36458) - @Id(36459) - @Id(36460) - @Id(36461) - @Id(36462) - @Id(36463) - @Id(36464) - @Id(36482) - @Id(36483) - @Id(36484) - @Id(36485) - @Id(36486) - @Id(36487) - @Id(36488) - @Id(36506) - @Id(36507) - @Id(36508) - @Id(36509) - @Id(36510) - @Id(36511) - @Id(36512) - @Id(80066) - @Id(80067) - @Id(80068) - @Id(80069) - @Id(80070) - @Id(80071) - @Id(80072) - @Id(80073) - @Id(80074) - @Id(80075) - @Id(80076) - @Id(80077) - @Id(80078) - @Id(80079) - @Id(80080) - @Id(80081) - @Id(80082) - @Id(80083) - @Id(80084) - @Id(80085) - @Id(80086) - @Id(80087) - @Id(80088) - @Id(80089) - @Id(80315) - @Id(80316) - @Id(80317) - @Id(80318) - public void onPlayerItemUnequip(OnPlayerItemUnequip event) - { - final Player player = event.getPlayer(); - if (player != null) - { - player.setDragonWeaponEquipped(false); - } - } - - public static void main(String[] args) - { - new DragonWeaponListeners(); - } -} diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java index 9340e046ea..12d699750d 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -192,6 +192,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("Ignition", Ignition::new); diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/36400-36499.xml index 86349e7fc6..0578649396 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/36500-36599.xml index 8e9ce89cbd..27d0eb0cce 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80000-80099.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80000-80099.xml index a3042a030a..7293add989 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80000-80099.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80000-80099.xml @@ -1176,6 +1176,7 @@ + @@ -1200,6 +1201,7 @@ + @@ -1224,6 +1226,7 @@ + @@ -1252,6 +1255,7 @@ + @@ -1277,6 +1281,7 @@ + @@ -1301,6 +1306,7 @@ + @@ -1324,6 +1330,7 @@ + @@ -1352,6 +1359,7 @@ + @@ -1380,6 +1388,7 @@ + @@ -1410,6 +1419,7 @@ + @@ -1439,6 +1449,7 @@ + @@ -1467,6 +1478,7 @@ + @@ -1494,6 +1506,7 @@ + @@ -1525,6 +1538,7 @@ + @@ -1556,6 +1570,7 @@ + @@ -1589,6 +1604,7 @@ + @@ -1621,6 +1637,7 @@ + @@ -1652,6 +1669,7 @@ + @@ -1682,6 +1700,7 @@ + @@ -1714,6 +1733,7 @@ + @@ -1746,6 +1766,7 @@ + @@ -1780,6 +1801,7 @@ + @@ -1813,6 +1835,7 @@ + @@ -1845,6 +1868,7 @@ + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80300-80399.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80300-80399.xml index fa6079ee07..bcceb942ad 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80300-80399.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80300-80399.xml @@ -151,6 +151,7 @@ + @@ -176,6 +177,7 @@ + @@ -206,6 +208,7 @@ + @@ -238,6 +241,7 @@ + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80600-80699.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80600-80699.xml index ef8d435f37..612bbfa7db 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80600-80699.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80600-80699.xml @@ -1273,6 +1273,7 @@ + @@ -1297,6 +1298,7 @@ + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80700-80799.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80700-80799.xml index d19c8ab121..d45e6766ce 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80700-80799.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80700-80799.xml @@ -4,6 +4,7 @@ + @@ -27,6 +28,7 @@ + @@ -49,6 +51,7 @@ + @@ -73,6 +76,7 @@ + @@ -100,6 +104,7 @@ + @@ -124,6 +129,7 @@ + @@ -148,6 +154,7 @@ + @@ -171,6 +178,7 @@ + @@ -196,6 +204,7 @@ + @@ -221,6 +230,7 @@ + @@ -244,6 +254,7 @@ + @@ -268,6 +279,7 @@ + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80800-80899.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80800-80899.xml index 1490f91dc9..a4e7ee1803 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80800-80899.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80800-80899.xml @@ -782,6 +782,7 @@ + @@ -806,6 +807,7 @@ + @@ -829,6 +831,7 @@ + @@ -852,6 +855,7 @@ + @@ -875,6 +879,7 @@ + @@ -899,6 +904,7 @@ + @@ -926,6 +932,7 @@ + @@ -950,6 +957,7 @@ + @@ -974,6 +982,7 @@ + @@ -997,6 +1006,7 @@ + @@ -1022,6 +1032,7 @@ + @@ -1047,6 +1058,7 @@ + @@ -1070,6 +1082,7 @@ + @@ -1094,6 +1107,7 @@ + @@ -1118,6 +1132,7 @@ + @@ -1150,6 +1165,7 @@ + @@ -1181,6 +1197,7 @@ + @@ -1212,6 +1229,7 @@ + @@ -1243,6 +1261,7 @@ + @@ -1275,6 +1294,7 @@ + @@ -1308,6 +1328,7 @@ + @@ -1340,6 +1361,7 @@ + @@ -1372,6 +1394,7 @@ + @@ -1403,6 +1426,7 @@ + @@ -1435,6 +1459,7 @@ + @@ -1468,6 +1493,7 @@ + @@ -1499,6 +1525,7 @@ + @@ -1531,6 +1558,7 @@ + @@ -1563,6 +1591,7 @@ + @@ -1595,6 +1624,7 @@ + @@ -1626,6 +1656,7 @@ + @@ -1657,6 +1688,7 @@ + @@ -1688,6 +1720,7 @@ + @@ -1720,6 +1753,7 @@ + @@ -1753,6 +1787,7 @@ + @@ -1785,6 +1820,7 @@ + @@ -1817,6 +1853,7 @@ + @@ -1848,6 +1885,7 @@ + @@ -1880,6 +1918,7 @@ + @@ -1913,6 +1952,7 @@ + @@ -1944,6 +1984,7 @@ + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80900-80999.xml b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80900-80999.xml index c4b4769855..232cc15511 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80900-80999.xml +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/items/80900-80999.xml @@ -3,6 +3,7 @@ + diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/documentation.txt index 3b779c4442..053b1265e0 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_10.2_MasterClass/dist/game/data/stats/skills/documentation.txt @@ -162,6 +162,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. Ignition: Transforms sword to Death Knight's Flame Sword. (l2jmobius) diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java index 10f29c1fee..eeb62448ce 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java @@ -217,6 +217,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1837,6 +1838,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java index 08b15cb4f5..68278100b4 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/actor/Player.java @@ -793,8 +793,6 @@ public class Player extends Playable private int _cursedWeaponEquippedId = 0; private boolean _combatFlagEquippedId = false; - private boolean _isDragonWeaponEquipped = false; - private boolean _canRevive = true; private int _reviveRequested = 0; private double _revivePower = 0; @@ -11684,16 +11682,6 @@ public class Player extends Playable return _cursedWeaponEquippedId; } - public void setDragonWeaponEquipped(boolean value) - { - _isDragonWeaponEquipped = value; - } - - public boolean isDragonWeaponEquipped() - { - return _isDragonWeaponEquipped; - } - public boolean isCombatFlagEquipped() { return _combatFlagEquippedId; diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/Weapon.java index 05a29a67a4..fdc53fe8e6 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,8 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; + private boolean _isCursedWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +75,8 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); + _isCursedWeapon = set.getBoolean("is_cursed_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +142,22 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + + /** + * @return {@code true} if the weapon is a cursed weapon, {@code false} otherwise. + */ + public boolean isCursedWeapon() + { + return _isCursedWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 41b088e736..98a2c73b9b 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1612,7 +1612,8 @@ public class Formulas // Dragon weapon defence stat. final double dragonDefense; - if (attackerPlayer.isDragonWeaponEquipped()) + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) { dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); } diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java index 7c8311dcce..6548fde01a 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 10d5d8f3e3..f95f753a76 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,11 +18,13 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; import org.l2jmobius.gameserver.model.actor.instance.Pet; import org.l2jmobius.gameserver.model.item.ItemTemplate; +import org.l2jmobius.gameserver.model.item.Weapon; import org.l2jmobius.gameserver.model.item.instance.Item; import org.l2jmobius.gameserver.model.itemcontainer.Inventory; import org.l2jmobius.gameserver.model.stats.BaseStat; @@ -63,30 +65,68 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon()) + { + final Weapon weapon = item.getWeaponItem(); + if (weapon.isDragonWeapon() || weapon.isCursedWeapon()) + { + shouldLiftLimit = true; } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini index 7775793463..7e57f9a222 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java index c633439745..be0e238282 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -179,6 +179,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt index ef76524dc8..54cb6367f9 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/data/stats/skills/documentation.txt @@ -150,6 +150,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java index ede8ff3b1f..a3c697c46c 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java @@ -217,6 +217,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1748,6 +1749,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Stat.java index 6b52c36e9c..4840d70a6d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 20b35e80b0..abf85fe9dc 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,57 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final int bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final int bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini index 0cac75b2e9..14b8a3fba4 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java index c633439745..be0e238282 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -179,6 +179,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt index ef76524dc8..54cb6367f9 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/data/stats/skills/documentation.txt @@ -150,6 +150,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java index e67719817c..4c1dd3855a 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java @@ -217,6 +217,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1752,6 +1753,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Stat.java index 6b52c36e9c..4840d70a6d 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 20b35e80b0..abf85fe9dc 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,57 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final int bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final int bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini index 0ba6105985..2ce6ac9e6e 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java index f5d9aa3162..742589267d 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -181,6 +181,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt index d7ff377580..1d8f809b5b 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/data/stats/skills/documentation.txt @@ -152,6 +152,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java index e67719817c..4c1dd3855a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java @@ -217,6 +217,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1752,6 +1753,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Stat.java index 5c252d6b82..ec1c7a9e1a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 27acd60d2b..a1f493bb5d 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,57 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Character.ini index 0ba6105985..2ce6ac9e6e 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java index 282cd2d1d0..389f36fd81 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -184,6 +184,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt index 32ef8c1035..d957346ce2 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/data/stats/skills/documentation.txt @@ -155,6 +155,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java index e67719817c..4c1dd3855a 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java @@ -217,6 +217,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1752,6 +1753,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Stat.java index daaf5c2180..827e3aa363 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 27acd60d2b..a1f493bb5d 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,57 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Character.ini b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Character.ini index 15c8746aea..d50a078cdb 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java index 282cd2d1d0..389f36fd81 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -184,6 +184,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt index 32ef8c1035..d957346ce2 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/data/stats/skills/documentation.txt @@ -155,6 +155,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java index 16414d5a70..7c4c5b84f1 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java @@ -217,6 +217,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1757,6 +1758,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Stat.java index daaf5c2180..827e3aa363 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 27acd60d2b..a1f493bb5d 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,57 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Character.ini b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Character.ini index 9b2c2ee19c..04b850b395 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java index a9edd975a8..edd9f3f88e 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -184,6 +184,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt index f11987e472..4c50bbfb76 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/data/stats/skills/documentation.txt @@ -155,6 +155,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java index 7db3c96bbc..1408cab8b2 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java @@ -217,6 +217,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1763,6 +1764,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Stat.java index 0310ad84de..653201d53e 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 27acd60d2b..a1f493bb5d 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,57 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Classic_Interlude/dist/game/config/Character.ini b/L2J_Mobius_Classic_Interlude/dist/game/config/Character.ini index 9167d7c108..a6eb2fa173 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/config/Character.ini +++ b/L2J_Mobius_Classic_Interlude/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java index e4327aeeda..711bc3edb6 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -133,6 +133,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("DispelBySlotMyself", DispelBySlotMyself::new); EffectHandler.getInstance().registerHandler("DispelBySlotProbability", DispelBySlotProbability::new); EffectHandler.getInstance().registerHandler("DoubleCast", DoubleCast::new); + EffectHandler.getInstance().registerHandler("DragonWeaponDefence", DragonWeaponDefence::new); EffectHandler.getInstance().registerHandler("DuelistFury", DuelistFury::new); EffectHandler.getInstance().registerHandler("EnableCloak", EnableCloak::new); EffectHandler.getInstance().registerHandler("EnchantRate", EnchantRate::new); @@ -181,6 +182,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/DragonWeaponDefence.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/DragonWeaponDefence.java new file mode 100644 index 0000000000..476fb537ad --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/DragonWeaponDefence.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author Mobius + */ +public class DragonWeaponDefence extends AbstractStatPercentEffect +{ + public DragonWeaponDefence(StatSet params) + { + super(params, Stat.DRAGON_WEAPON_DEFENCE); + } +} diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/items/36400-36499.xml b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/items/36400-36499.xml index 7781f346f7..59e0701738 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/items/36400-36499.xml +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/items/36400-36499.xml @@ -212,6 +212,7 @@ + @@ -237,6 +238,7 @@ + @@ -261,6 +263,7 @@ + @@ -288,6 +291,7 @@ + @@ -313,6 +317,7 @@ + @@ -336,6 +341,7 @@ + @@ -365,6 +371,7 @@ + @@ -390,6 +397,7 @@ + @@ -415,6 +423,7 @@ + @@ -440,6 +449,7 @@ + @@ -464,6 +474,7 @@ + @@ -489,6 +500,7 @@ + @@ -513,6 +525,7 @@ + @@ -537,6 +550,7 @@ + @@ -564,6 +578,7 @@ + @@ -589,6 +604,7 @@ + @@ -615,6 +631,7 @@ + @@ -642,6 +659,7 @@ + @@ -667,6 +685,7 @@ + @@ -694,6 +713,7 @@ + @@ -718,6 +738,7 @@ + @@ -743,6 +764,7 @@ + @@ -767,6 +789,7 @@ + @@ -794,6 +817,7 @@ + @@ -819,6 +843,7 @@ + @@ -848,6 +873,7 @@ + @@ -876,6 +902,7 @@ + @@ -906,6 +933,7 @@ + @@ -935,6 +963,7 @@ + @@ -963,6 +992,7 @@ + @@ -993,6 +1023,7 @@ + @@ -1022,6 +1053,7 @@ + @@ -1051,6 +1083,7 @@ + @@ -1080,6 +1113,7 @@ + @@ -1109,6 +1143,7 @@ + @@ -1138,6 +1173,7 @@ + @@ -1166,6 +1202,7 @@ + @@ -1194,6 +1231,7 @@ + @@ -1224,6 +1262,7 @@ + @@ -1253,6 +1292,7 @@ + @@ -1283,6 +1323,7 @@ + @@ -1314,6 +1355,7 @@ + @@ -1343,6 +1385,7 @@ + @@ -1373,6 +1416,7 @@ + @@ -1401,6 +1445,7 @@ + @@ -1431,6 +1476,7 @@ + @@ -1459,6 +1505,7 @@ + @@ -1489,6 +1536,7 @@ + @@ -1518,6 +1566,7 @@ + @@ -1550,6 +1599,7 @@ + @@ -1581,6 +1631,7 @@ + @@ -1614,6 +1665,7 @@ + @@ -1646,6 +1698,7 @@ + @@ -1677,6 +1730,7 @@ + @@ -1710,6 +1764,7 @@ + @@ -1742,6 +1797,7 @@ + @@ -1774,6 +1830,7 @@ + @@ -1806,6 +1863,7 @@ + @@ -1838,6 +1896,7 @@ + @@ -1870,6 +1929,7 @@ + @@ -1901,6 +1961,7 @@ + @@ -1932,6 +1993,7 @@ + @@ -1965,6 +2027,7 @@ + @@ -1997,6 +2060,7 @@ + @@ -2030,6 +2094,7 @@ + @@ -2064,6 +2129,7 @@ + @@ -2096,6 +2162,7 @@ + @@ -2129,6 +2196,7 @@ + @@ -2160,6 +2228,7 @@ + @@ -2193,6 +2262,7 @@ + @@ -2224,6 +2294,7 @@ + @@ -2257,6 +2328,7 @@ + @@ -2289,6 +2361,7 @@ + @@ -2322,6 +2395,7 @@ + @@ -2354,6 +2428,7 @@ + @@ -2388,6 +2463,7 @@ + @@ -2421,6 +2497,7 @@ + @@ -2453,6 +2530,7 @@ + @@ -2487,6 +2565,7 @@ + @@ -2520,6 +2599,7 @@ + @@ -2553,6 +2633,7 @@ + @@ -2586,6 +2667,7 @@ + @@ -2619,6 +2701,7 @@ + diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/items/36500-36599.xml b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/items/36500-36599.xml index a04cb0f2b0..5b9bba4926 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/items/36500-36599.xml +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/items/36500-36599.xml @@ -3,6 +3,7 @@ + @@ -35,6 +36,7 @@ + @@ -67,6 +69,7 @@ + @@ -101,6 +104,7 @@ + @@ -134,6 +138,7 @@ + @@ -168,6 +173,7 @@ + @@ -204,6 +210,7 @@ + @@ -237,6 +244,7 @@ + @@ -271,6 +279,7 @@ + @@ -303,6 +312,7 @@ + @@ -337,6 +347,7 @@ + @@ -369,6 +380,7 @@ + @@ -403,6 +415,7 @@ + diff --git a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt index ec6d9ba27f..69a94b6bc4 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Classic_Interlude/dist/game/data/stats/skills/documentation.txt @@ -103,6 +103,7 @@ DispelBySlot: Removes given amount of target's effects by specified AbnormalType DispelBySlotMyself: Removes given amount of effects by specified AbnormalType DispelBySlotProbability: Removes given amount of effects by specified AbnormalType at a given rate. DoubleCast: Triggers Fire, Water, Wind, Earth stance and enables the ability to cast two skills at once. +DragonWeaponDefence: Dragon weapon defence stat. (l2jmobius) DuelistFury: Synergy effect for Faceoff effect. (l2jmobius) EnableCloak: See/unsee cloaks. EnchantRate: Enchant rate modifier, does not work for non grade items. (l2jmobius) @@ -152,6 +153,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java index 4ff1c6d558..1f9cccf577 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java @@ -216,6 +216,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1755,6 +1756,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/item/Weapon.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/item/Weapon.java index d24c63aaef..e3bb874b2b 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/item/Weapon.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/item/Weapon.java @@ -38,6 +38,7 @@ public class Weapon extends ItemTemplate { private WeaponType _type; private boolean _isMagicWeapon; + private boolean _isDragonWeapon; private int _soulShotCount; private int _spiritShotCount; private int _mpConsume; @@ -73,6 +74,7 @@ public class Weapon extends ItemTemplate _type1 = ItemTemplate.TYPE1_WEAPON_RING_EARRING_NECKLACE; _type2 = ItemTemplate.TYPE2_WEAPON; _isMagicWeapon = set.getBoolean("is_magic_weapon", false); + _isDragonWeapon = set.getBoolean("is_dragon_weapon", false); _soulShotCount = set.getInt("soulshots", 0); _spiritShotCount = set.getInt("spiritshots", 0); _mpConsume = set.getInt("mp_consume", 0); @@ -138,6 +140,14 @@ public class Weapon extends ItemTemplate return _isMagicWeapon; } + /** + * @return {@code true} if the weapon is a dragon weapon, {@code false} otherwise. + */ + public boolean isDragonWeapon() + { + return _isDragonWeapon; + } + /** * @return the quantity of SoulShot used. */ diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java index 289e5f69a5..ef57080ace 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Formulas.java @@ -1610,7 +1610,19 @@ public class Formulas pvpDefense = target.getStat().getMul(Stat.PVP_PHYSICAL_ATTACK_DEFENCE, 1) * Config.PVP_PHYSICAL_ATTACK_DEFENCE_MULTIPLIERS[targetPlayer.getClassId().getId()]; } - return Math.max(0.05, 1 + (pvpAttack - pvpDefense)); // Bonus should not be negative. + // Dragon weapon defence stat. + final double dragonDefense; + final Weapon weapon = attacker.getActiveWeaponItem(); + if ((weapon != null) && weapon.isDragonWeapon()) + { + dragonDefense = target.getStat().getMul(Stat.DRAGON_WEAPON_DEFENCE, 1); + } + else + { + dragonDefense = 1; + } + + return Math.max(0.05, dragonDefense * (1 + (pvpAttack - pvpDefense))); // Bonus should not be negative. } // PvE Bonus diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Stat.java index 54a24adb35..90488cb5b8 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), @@ -87,6 +88,7 @@ public enum Stat CRITICAL_DAMAGE_ADD("cAtkAdd"), // this is another type for special critical damage mods - vicious stance, critical power and critical damage SA HATE_ATTACK("attackHate"), REAR_DAMAGE_RATE("rearDamage"), + DRAGON_WEAPON_DEFENCE("dragonWeaponDefence"), AUTO_ATTACK_DAMAGE_BONUS("autoAttackDamageBonus"), // PVP BONUS diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 20b35e80b0..7d7e5b7b74 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,64 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final int bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + boolean shouldLiftLimit = false; + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final int bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); + } + } + + if (item.isWeapon() && item.getWeaponItem().isDragonWeapon()) + { + shouldLiftLimit = true; } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !shouldLiftLimit && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Character.ini b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Character.ini index b06b11c0ef..c4f319bdd7 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Character.ini +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java index c7d2ed2bd9..50711faa47 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -185,6 +185,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt index 523a7089c7..3ac0597d23 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/data/stats/skills/documentation.txt @@ -156,6 +156,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java index 35bdfa87ad..818564280c 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java @@ -219,6 +219,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1783,6 +1784,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/Stat.java index 3ec0d69666..9c46e1299a 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 27acd60d2b..a1f493bb5d 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,57 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Character.ini b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Character.ini index b06b11c0ef..c4f319bdd7 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Character.ini +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java index 53aad4ada9..4e03470d8e 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -186,6 +186,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt index 46b85b0dd8..c29b17c6ee 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/data/stats/skills/documentation.txt @@ -157,6 +157,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java index 58439be94b..a77b7d280e 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java @@ -219,6 +219,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1786,6 +1787,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/Stat.java index 3ec0d69666..9c46e1299a 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 27acd60d2b..a1f493bb5d 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,57 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Character.ini b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Character.ini index b06b11c0ef..c4f319bdd7 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Character.ini +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/EffectMasterHandler.java index 6543dab8c1..e36cd2ce9a 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -186,6 +186,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/documentation.txt index 1bffd02664..35e9d297e5 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/dist/game/data/stats/skills/documentation.txt @@ -157,6 +157,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java index 58439be94b..a77b7d280e 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/Config.java @@ -219,6 +219,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1786,6 +1787,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/stats/Stat.java index 85ca0e81a7..6c6b7a260d 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 27acd60d2b..a1f493bb5d 100644 --- a/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Essence_6.1_BattleChronicle/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,57 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } } diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Character.ini b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Character.ini index b06b11c0ef..c4f319bdd7 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Character.ini +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Character.ini @@ -266,6 +266,10 @@ MaxMAtkSpeed = 1999 # Default: 250 MaxEvasion = 250 +# Maximum character HP. +# Default: 150000 +MaxHP = 150000 + # Minimum and Maximum Abnormal State Success Rate. # This affect all skills/effects chances, except in skills where minChance or maxChance parameters are defined. # Default: H5 minimum of 10% and maximum of 90%. diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/EffectMasterHandler.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/EffectMasterHandler.java index 6543dab8c1..e36cd2ce9a 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/EffectMasterHandler.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/EffectMasterHandler.java @@ -186,6 +186,7 @@ public class EffectMasterHandler EffectHandler.getInstance().registerHandler("HpCpHeal", HpCpHeal::new); EffectHandler.getInstance().registerHandler("HpCpHealCritical", HpCpHealCritical::new); EffectHandler.getInstance().registerHandler("HpDrain", HpDrain::new); + EffectHandler.getInstance().registerHandler("HpLimit", HpLimit::new); EffectHandler.getInstance().registerHandler("HpRegen", HpRegen::new); EffectHandler.getInstance().registerHandler("HpToOwner", HpToOwner::new); EffectHandler.getInstance().registerHandler("IgnoreDeath", IgnoreDeath::new); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java new file mode 100644 index 0000000000..3e254041ec --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/scripts/handlers/effecthandlers/HpLimit.java @@ -0,0 +1,31 @@ +/* + * 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 handlers.effecthandlers; + +import org.l2jmobius.gameserver.model.StatSet; +import org.l2jmobius.gameserver.model.stats.Stat; + +/** + * @author dontknowdontcare + */ +public class HpLimit extends AbstractStatEffect +{ + public HpLimit(StatSet params) + { + super(params, Stat.HP_LIMIT); + } +} diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/documentation.txt b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/documentation.txt index 1bffd02664..35e9d297e5 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/documentation.txt +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/data/stats/skills/documentation.txt @@ -157,6 +157,7 @@ HpCpHealCritical: HpCp heal effects always trigger Magic Critical Hit. HpCpHeal: Increases current HP by a given amount. If the given amount exceeds maximum HP, it increases current CP with the rest value as well. HpDrain: Magical attack that absorbs given percentage of the damage inflicted as HP. Hp: Increases current HP by a static value. +HpLimit: Increase a character's max hp limit (l2jmobius) HpRegen: HP Regeneration stat. HpToOwner: DOT effect that absorbs HP over time. IgnoreDeath: Become undying. Hp cannot decrease below 1. diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java index c73d7be276..c28768a8bd 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java @@ -219,6 +219,7 @@ public class Config public static int MAX_PATK_SPEED; public static int MAX_MATK_SPEED; public static int MAX_EVASION; + public static int MAX_HP; public static int MIN_ABNORMAL_STATE_SUCCESS_RATE; public static int MAX_ABNORMAL_STATE_SUCCESS_RATE; public static long MAX_SP; @@ -1786,6 +1787,7 @@ public class Config MAX_PATK_SPEED = characterConfig.getInt("MaxPAtkSpeed", 1500); MAX_MATK_SPEED = characterConfig.getInt("MaxMAtkSpeed", 1999); MAX_EVASION = characterConfig.getInt("MaxEvasion", 250); + MAX_HP = characterConfig.getInt("MaxHP", 150000); MIN_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MinAbnormalStateSuccessRate", 10); MAX_ABNORMAL_STATE_SUCCESS_RATE = characterConfig.getInt("MaxAbnormalStateSuccessRate", 90); MAX_SP = characterConfig.getLong("MaxSp", 50000000000L) >= 0 ? characterConfig.getLong("MaxSp", 50000000000L) : Long.MAX_VALUE; diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Stat.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Stat.java index 85ca0e81a7..6c6b7a260d 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Stat.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/Stat.java @@ -58,6 +58,7 @@ import org.l2jmobius.gameserver.util.MathUtil; public enum Stat { // HP, MP & CP + HP_LIMIT("hpLimit"), MAX_HP("maxHp", new MaxHpFinalizer()), MAX_MP("maxMp", new MaxMpFinalizer()), MAX_CP("maxCp", new MaxCpFinalizer()), diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java index 27acd60d2b..a1f493bb5d 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/model/stats/finalizers/MaxHpFinalizer.java @@ -18,6 +18,7 @@ package org.l2jmobius.gameserver.model.stats.finalizers; import java.util.OptionalDouble; +import org.l2jmobius.Config; import org.l2jmobius.gameserver.data.xml.EnchantItemHPBonusData; import org.l2jmobius.gameserver.model.actor.Creature; import org.l2jmobius.gameserver.model.actor.Player; @@ -62,30 +63,57 @@ public class MaxHpFinalizer implements IStatFunction private static double defaultValue(Creature creature, Stat stat, double baseValue) { - final double mul = creature.getStat().getMul(stat); - final double add = creature.getStat().getAdd(stat); - double addItem = 0; + double mul = creature.getStat().getMul(stat); + double add = creature.getStat().getAdd(stat); + + double maxHp = (mul * baseValue) + add + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final boolean isPlayer = creature.isPlayer(); final Inventory inv = creature.getInventory(); - if (inv != null) + if (inv == null) { - // Add maxHP bonus from items - for (Item item : inv.getPaperdollItems()) + if (isPlayer) { - addItem += item.getTemplate().getStats(stat, 0); - - // Apply enchanted item bonus HP - if (item.isArmor() && item.isEnchanted()) + if (creature.getActingPlayer().isCursedWeaponEquipped()) { - final long bodyPart = item.getTemplate().getBodyPart(); - if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) - { - addItem += EnchantItemHPBonusData.getInstance().getHPBonus(item); - } + return Double.MAX_VALUE; + } + + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + return Math.min(maxHp, (Config.MAX_HP * mul) + add); + } + return maxHp; + } + + // Add maxHP bonus from items + for (Item item : inv.getPaperdollItems()) + { + maxHp += item.getTemplate().getStats(stat, 0); + + // Apply enchanted item bonus HP + if (item.isArmor() && item.isEnchanted()) + { + final long bodyPart = item.getTemplate().getBodyPart(); + if ((bodyPart != ItemTemplate.SLOT_NECK) && (bodyPart != ItemTemplate.SLOT_LR_EAR) && (bodyPart != ItemTemplate.SLOT_LR_FINGER)) + { + maxHp += EnchantItemHPBonusData.getInstance().getHPBonus(item); } } } - return (mul * baseValue) + add + addItem + creature.getStat().getMoveTypeValue(stat, creature.getMoveType()); + final double hpLimit; + if (isPlayer && !creature.getActingPlayer().isCursedWeaponEquipped()) + { + mul = creature.getStat().getMul(Stat.HP_LIMIT); + add = creature.getStat().getAdd(Stat.HP_LIMIT); + hpLimit = (Config.MAX_HP * mul) + add; + } + else + { + hpLimit = Double.MAX_VALUE; + } + + return Math.min(maxHp, hpLimit); } }