I would like to modify Relax Skill ID226 to regenerate MP as well as HP. I did the XML part but need to modify handler for that skill
It turns off when HP is full but I need the same for MP. So stop the effect when MP and HP is full
Furthermore, I would like that skill to work out-of-combat only. I can't find a condition for XML side so I guess it must be done inside the handler itself.
This is for L2J High Five. Thanks
/*
* Copyright (C) 2004-2013 L2J DataPack
*
* This file is part of L2J DataPack.
*
* L2J DataPack 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.
*
* L2J DataPack 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 <http://www.gnu.org/licenses/>.
*/
package handlers.effecthandlers;
import l2r.gameserver.enums.CtrlIntention;
import l2r.gameserver.model.effects.EffectFlag;
import l2r.gameserver.model.effects.EffectTemplate;
import l2r.gameserver.model.effects.L2Effect;
import l2r.gameserver.model.effects.L2EffectType;
import l2r.gameserver.model.stats.Env;
import l2r.gameserver.network.SystemMessageId;
public class Relax extends L2Effect
{
public Relax(Env env, EffectTemplate template)
{
super(env, template);
}
@Override
public L2EffectType getEffectType()
{
return L2EffectType.RELAXING;
}
@Override
public boolean onStart()
{
if (getEffected().isPlayer())
{
getEffected().getActingPlayer().sitDown(false);
}
else
{
getEffected().getAI().setIntention(CtrlIntention.AI_INTENTION_REST);
}
return super.onStart();
}
@Override
public boolean onActionTime()
{
if (getEffected().isDead())
{
return false;
}
if (getEffected().isPlayer())
{
if (!getEffected().getActingPlayer().isSitting())
{
return false;
}
}
if ((getEffected().getCurrentHp() + 1) > getEffected().getMaxRecoverableHp())
{
if (getSkill().isToggle())
{
getEffected().sendPacket(SystemMessageId.SKILL_DEACTIVATED_HP_FULL);
return false;
}
}
double manaDam = calc();
if (manaDam > getEffected().getCurrentMp())
{
if (getSkill().isToggle())
{
getEffected().sendPacket(SystemMessageId.SKILL_REMOVED_DUE_LACK_MP);
return false;
}
}
getEffected().reduceCurrentMp(manaDam);
return true;
}
@Override
public int getEffectFlags()
{
return EffectFlag.RELAXING.getMask();
}
}
You can post now and register later.
If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.
Discord :
utchiha_market
Telegram :
https://t.me/utchiha_market
Auto Buy Store :
https://utchihamkt.mysellauth.com/
Join our server for more products :
https://discord.gg/uthciha-services
https://campsite.bio/utchihaamkt
Added:
A new default personal account template is now available — you can check it out at the demo URL: https://demo.lin2web.com/login
Starter packs are now available for purchasing starting items
The entire template structure has been completely redesigned
[L2 Nostalgia – Interlude x3] Grand Opening June 1st, 2025 @ 18:00 GMT+3
[L2 Nostalgia – Interlude x3]
A True Classic Returns – Grand Opening June 1st, 2025 @ 18:00 GMT+3
The Golden Age of Lineage 2
Rediscover the magic of Lineage 2 Interlude on a carefully crafted low-rate server that respects the original experience while offering modern quality-of-life improvements.
Chronicle: Interlude
Rates: x3 EXP/SP – x2 Adena
x3 Drop/Spoil
Balanced & Fair: No Pay-to-Win
Clean & Retail-like: No custom items or edits
Want more details?
Check out all the features here https://l2-nostalgia.com/
Private Beta Test
A 3-day closed beta will launch on Saturday, May 17 at 20:00 GMT+3, exclusively for members of our Discord community.
During the beta, testers will have access to special commands and tools to speed up progression and help us fine-tune gameplay.
To join the beta, you must be in our Discord.
Join here: https://discord.com/invite/hGbVVNWnzA
Join the community. Feel the nostalgia.
L2 Nostalgia – For those who remember.
Question
Sybar
Hi,
I would like to modify Relax Skill ID226 to regenerate MP as well as HP. I did the XML part but need to modify handler for that skill
It turns off when HP is full but I need the same for MP. So stop the effect when MP and HP is full
Furthermore, I would like that skill to work out-of-combat only. I can't find a condition for XML side so I guess it must be done inside the handler itself.
This is for L2J High Five. Thanks
Edited by Sybar0 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.