Hello everyone, i wanted to ask help for a code that returns buffs(cancelled) after a certain amount of time cause i've tried to adapt on latest rev of l2j all existing cancel scripts shared but failed cause many files removed or codes merged and i cant find a way to do it.
Data Rev:10247 server Rev:6478
First code
open eclipse.
Now go to package explorer.
look into L2J_Datapack and go to data.scripts.handlers.effecthandlers and open Cancel.java
open search
Type: package handlers.skillhandlers;
And paste this under: package handlers.skillhandlers;
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.
Question
dasoldier
Hello everyone, i wanted to ask help for a code that returns buffs(cancelled) after a certain amount of time cause i've tried to adapt on latest rev of l2j all existing cancel scripts shared but failed cause
many files removed or codes merged and i cant find a way to do it.
Data Rev:10247
server Rev:6478
First code
open eclipse.
Now go to package explorer.
look into L2J_Datapack and go to data.scripts.handlers.effecthandlers and open Cancel.java
open search
Type: package handlers.skillhandlers;
And paste this under: package handlers.skillhandlers;
import javolution.util.FastList;
import com.l2jserver.gameserver.datatables.SkillTable;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
import com.l2jserver.gameserver.ThreadPoolManager;
import com.l2jserver.gameserver.model.skills.L2Skill;
then open search
Type: return L2EffectType.CANCEL;
}
And paste under: return L2EffectType.CANCEL;
}
private int seconds = 13;
private void returnbuffs (L2Character player, FastList<L2Effect>list)
{
for (L2Effect e : list)
{
L2Skill skill = SkillTable.getInstance().getInfo(e.getSkill().getId(), e.getLevel());
if(skill != null)
{
skill.getEffects(player, player);
}
}
((L2PcInstance)player).isoncanceltask=false;
}
Then open search
Type: ((L2Npc)activeChar)._spiritshotcharged = false;
}
And remove line under: ((L2Npc)activeChar)._spiritshotcharged = false;
}
L2Character target;
Then open search
Type: if (!(obj instanceof L2Character))
continue;
And remove line under: if (!(obj instanceof L2Character))
continue;
target = (L2Character)obj;
Replace it with: final L2Character target = (L2Character)obj;
Then open search
Type: final L2Effect[] effects = target.getAllEffects();
And paste under: final L2Effect[] effects = target.getAllEffects();
if (target instanceof L2PcInstance)
{
((L2PcInstance)target).clearcancelbuffs();
}
Then open search
Type: lastCanceledSkillId = eff.getSkill().getId();
And paste under: lastCanceledSkillId = eff.getSkill().getId();
if (target instanceof L2PcInstance)
{
((L2PcInstance)target).addcancelbuffs(effect);
}
Then open search
Type: lastCanceledSkillId = eff.getSkill().getId();
And paste under: lastCanceledSkillId = eff.getSkill().getId();
if (target instanceof L2PcInstance)
{
((L2PcInstance)target).addcancelbuffs(effect);
}
Then open search
Type: //Possibility of a lethal strike
Formulas.calcLethalHit(activeChar, target, skill);
And paste under: //Possibility of a lethal strike
Formulas.calcLethalHit(activeChar, target, skill);
if (target instanceof L2PcInstance && ((L2PcInstance)target).getcancelbuffs()!=null && !((L2PcInstance)target).isoncanceltask)
{
((L2PcInstance)target).sendMessage("You will get back your buffs in "+seconds+" seconds.");
ThreadPoolManager.getInstance().scheduleGeneral(new Runnable()
{
@Override
public void run()
{
((L2PcInstance)target).isoncanceltask=true;
returnbuffs(target, ((L2PcInstance)target).getcancelbuffs());
}
},seconds * 1000);
}
Second code
Now go to package explorer.
look into com.l2jserver.gameserver.model and open L2Effect.java
Press Ctrl+f to open the search tool.
Type: if (_count == 0 && _icon && getEffected() instanceof L2PcInstance)
{
and press on search.
Remove line under: if (_count == 0 && _icon && getEffected() instanceof L2PcInstance)
{
SystemMessage smsg3 = SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_WORN_OFF); smsg3.addSkillName(_skill);
getEffected().sendPacket(smsg3);
and replace with:
if (!((L2PcInstance)getEffected()).isoncanceltask)
{
SystemMessage smsg3 = SystemMessage.getSystemMessage(SystemMessageId.S1_HAS_WORN_OFF);
smsg3.addSkillName(_skill);
getEffected().sendPacket(smsg3);
}
Third code
look into L2J_server and go to com.l2jserver.gameserver.model.actor.instance and open L2PcInstance.java
open search
Type: private static final String DELETE_TP_BOOKMARK = "DELETE FROM character_tpbookmark WHERE charId=? AND Id=?";
And paste this under: private static final String DELETE_TP_BOOKMARK = "DELETE FROM character_tpbookmark WHERE charId=? AND Id=?";
//Cancel return back buffs
private FastList<L2Effect> cancelbuffs = new FastList<L2Effect>(); //wyatt
public boolean isoncanceltask = false;
public FastList<L2Effect> getcancelbuffs()
{
return cancelbuffs;
}
public void addcancelbuffs(L2Effect effect)
{
cancelbuffs.add(effect);
}
public void clearcancelbuffs()
{
cancelbuffs.clear();
}
Cancel.java CHANGED DispelByCategory.java
Edited by dasoldierL2Effect CHANGED AbstractEffect
Thnx in advance.
0 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.