MaxHp and MaxMp effect heals with a task.

This commit is contained in:
MobiusDev 2019-02-08 02:08:04 +00:00
parent 8b313ed415
commit c3d11803a9
20 changed files with 320 additions and 210 deletions

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -39,7 +40,11 @@ public class MaxHp extends AbstractStatEffect
@Override
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal && !effected.isHpBlocked())
if (_heal)
{
if (!effected.isHpBlocked())
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
@ -54,6 +59,8 @@ public class MaxHp extends AbstractStatEffect
break;
}
}
}, 100);
}
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -40,20 +41,23 @@ public class MaxMp extends AbstractStatEffect
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal)
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
case DIFF: // DIFF
case DIFF:
{
effected.setCurrentMp(effected.getCurrentMp() + _amount);
break;
}
case PER: // PER
case PER:
{
effected.setCurrentMp(effected.getCurrentMp() + (effected.getMaxMp() * (_amount / 100)));
break;
}
}
}, 100);
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -39,7 +40,11 @@ public class MaxHp extends AbstractStatEffect
@Override
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal && !effected.isHpBlocked())
if (_heal)
{
if (!effected.isHpBlocked())
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
@ -54,6 +59,8 @@ public class MaxHp extends AbstractStatEffect
break;
}
}
}, 100);
}
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -40,20 +41,23 @@ public class MaxMp extends AbstractStatEffect
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal)
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
case DIFF: // DIFF
case DIFF:
{
effected.setCurrentMp(effected.getCurrentMp() + _amount);
break;
}
case PER: // PER
case PER:
{
effected.setCurrentMp(effected.getCurrentMp() + (effected.getMaxMp() * (_amount / 100)));
break;
}
}
}, 100);
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -39,7 +40,11 @@ public class MaxHp extends AbstractStatEffect
@Override
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal && !effected.isHpBlocked())
if (_heal)
{
if (!effected.isHpBlocked())
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
@ -54,6 +59,8 @@ public class MaxHp extends AbstractStatEffect
break;
}
}
}, 100);
}
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -40,20 +41,23 @@ public class MaxMp extends AbstractStatEffect
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal)
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
case DIFF: // DIFF
case DIFF:
{
effected.setCurrentMp(effected.getCurrentMp() + _amount);
break;
}
case PER: // PER
case PER:
{
effected.setCurrentMp(effected.getCurrentMp() + (effected.getMaxMp() * (_amount / 100)));
break;
}
}
}, 100);
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -39,7 +40,11 @@ public class MaxHp extends AbstractStatEffect
@Override
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal && !effected.isHpBlocked())
if (_heal)
{
if (!effected.isHpBlocked())
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
@ -54,6 +59,8 @@ public class MaxHp extends AbstractStatEffect
break;
}
}
}, 100);
}
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -40,20 +41,23 @@ public class MaxMp extends AbstractStatEffect
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal)
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
case DIFF: // DIFF
case DIFF:
{
effected.setCurrentMp(effected.getCurrentMp() + _amount);
break;
}
case PER: // PER
case PER:
{
effected.setCurrentMp(effected.getCurrentMp() + (effected.getMaxMp() * (_amount / 100)));
break;
}
}
}, 100);
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -39,7 +40,11 @@ public class MaxHp extends AbstractStatEffect
@Override
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal && !effected.isHpBlocked())
if (_heal)
{
if (!effected.isHpBlocked())
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
@ -54,6 +59,8 @@ public class MaxHp extends AbstractStatEffect
break;
}
}
}, 100);
}
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -40,20 +41,23 @@ public class MaxMp extends AbstractStatEffect
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal)
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
case DIFF: // DIFF
case DIFF:
{
effected.setCurrentMp(effected.getCurrentMp() + _amount);
break;
}
case PER: // PER
case PER:
{
effected.setCurrentMp(effected.getCurrentMp() + (effected.getMaxMp() * (_amount / 100)));
break;
}
}
}, 100);
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -39,7 +40,11 @@ public class MaxHp extends AbstractStatEffect
@Override
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal && !effected.isHpBlocked())
if (_heal)
{
if (!effected.isHpBlocked())
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
@ -54,6 +59,8 @@ public class MaxHp extends AbstractStatEffect
break;
}
}
}, 100);
}
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -40,20 +41,23 @@ public class MaxMp extends AbstractStatEffect
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal)
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
case DIFF: // DIFF
case DIFF:
{
effected.setCurrentMp(effected.getCurrentMp() + _amount);
break;
}
case PER: // PER
case PER:
{
effected.setCurrentMp(effected.getCurrentMp() + (effected.getMaxMp() * (_amount / 100)));
break;
}
}
}, 100);
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -39,7 +40,11 @@ public class MaxHp extends AbstractStatEffect
@Override
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal && !effected.isHpBlocked())
if (_heal)
{
if (!effected.isHpBlocked())
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
@ -54,6 +59,8 @@ public class MaxHp extends AbstractStatEffect
break;
}
}
}, 100);
}
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -40,20 +41,23 @@ public class MaxMp extends AbstractStatEffect
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal)
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
case DIFF: // DIFF
case DIFF:
{
effected.setCurrentMp(effected.getCurrentMp() + _amount);
break;
}
case PER: // PER
case PER:
{
effected.setCurrentMp(effected.getCurrentMp() + (effected.getMaxMp() * (_amount / 100)));
break;
}
}
}, 100);
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -39,7 +40,11 @@ public class MaxHp extends AbstractStatEffect
@Override
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal && !effected.isHpBlocked())
if (_heal)
{
if (!effected.isHpBlocked())
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
@ -54,6 +59,8 @@ public class MaxHp extends AbstractStatEffect
break;
}
}
}, 100);
}
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -40,20 +41,23 @@ public class MaxMp extends AbstractStatEffect
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal)
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
case DIFF: // DIFF
case DIFF:
{
effected.setCurrentMp(effected.getCurrentMp() + _amount);
break;
}
case PER: // PER
case PER:
{
effected.setCurrentMp(effected.getCurrentMp() + (effected.getMaxMp() * (_amount / 100)));
break;
}
}
}, 100);
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -39,7 +40,11 @@ public class MaxHp extends AbstractStatEffect
@Override
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal && !effected.isHpBlocked())
if (_heal)
{
if (!effected.isHpBlocked())
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
@ -54,6 +59,8 @@ public class MaxHp extends AbstractStatEffect
break;
}
}
}, 100);
}
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -40,20 +41,23 @@ public class MaxMp extends AbstractStatEffect
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal)
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
case DIFF: // DIFF
case DIFF:
{
effected.setCurrentMp(effected.getCurrentMp() + _amount);
break;
}
case PER: // PER
case PER:
{
effected.setCurrentMp(effected.getCurrentMp() + (effected.getMaxMp() * (_amount / 100)));
break;
}
}
}, 100);
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -39,7 +40,11 @@ public class MaxHp extends AbstractStatEffect
@Override
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal && !effected.isHpBlocked())
if (_heal)
{
if (!effected.isHpBlocked())
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
@ -54,6 +59,8 @@ public class MaxHp extends AbstractStatEffect
break;
}
}
}, 100);
}
}
}
}

View File

@ -16,6 +16,7 @@
*/
package handlers.effecthandlers;
import com.l2jmobius.commons.concurrent.ThreadPool;
import com.l2jmobius.gameserver.model.StatsSet;
import com.l2jmobius.gameserver.model.actor.L2Character;
import com.l2jmobius.gameserver.model.items.instance.L2ItemInstance;
@ -40,20 +41,23 @@ public class MaxMp extends AbstractStatEffect
public void continuousInstant(L2Character effector, L2Character effected, Skill skill, L2ItemInstance item)
{
if (_heal)
{
ThreadPool.schedule(() ->
{
switch (_mode)
{
case DIFF: // DIFF
case DIFF:
{
effected.setCurrentMp(effected.getCurrentMp() + _amount);
break;
}
case PER: // PER
case PER:
{
effected.setCurrentMp(effected.getCurrentMp() + (effected.getMaxMp() * (_amount / 100)));
break;
}
}
}, 100);
}
}
}