Jump to content
  • 0

Question

Posted

The code from L2Jserver Freya, in Interlude. No errors in Eclipse and stuff. Using L2JFrozen (yes, I know, q_q). I have posted in their forum, but with no luck.

 

public class ConditionPlayerCp extends Condition
{

private final int _cp;

public ConditionPlayerCp(int cp)
{
	_cp = cp;
}

@Override
public boolean testImpl(Env env)
{
	return env.player.getCurrentCp() * 100/ env.player.getMaxCp() >= _cp;
}
}

 

Added to DocumentBase, again no errors.

			else if ("cp".equalsIgnoreCase(a.getNodeName()))
		{
			int cp = Integer.decode(getValue(a.getNodeValue(), null));
			cond = joinAnd(cond, new ConditionPlayerCp(cp));
		}

Skill condition (XML), no error in console.

	<cond msg="Can be only used when CP is 80% or higher.">
	<player cp="80"/>
</cond>

 

The main problem is that in game, the condition does not take place. I used the skill with the CP condition and did a search on 'ConditionPlayerHp' to see where else I might need to add identical code to and imports. The only other place that had it was DocumentBase, and I added the imports and stuff. When I use the skill, there are no errors in console. It is supposed to be the 'over the body' skill (Titan) for Interlude. It's kind of like Frenzy, except your CP is supposed to be HIGHER then 80%, and then it takes all your other CP. I'm also unsure on how to add consume CP.

Thanks? D:

4 answers to this question

Recommended Posts

  • 0
Posted

It's supposed to be <= _cp, not >= _cp

 

I see... But it works as the opposite function as it should be o_o

Now I can use it when CP is LOWER then 80%, but I want to make it so that you can only use it when CP is OVER 80%.

  • 0
Posted

I see... But it works as the opposite function as it should be o_o

Now I can use it when CP is LOWER then 80%, but I want to make it so that you can only use it when CP is OVER 80%.

Since you copied the code from L2j Freya,i guess you have no problem to copy this.

Here is the commit of Hellbound Release:

http://trac.l2jdp.com/changeset/4541/trunk/datapack_development/data/stats/skills/0500-0599.xml

http://trac.l2jserver.com/changeset/2044

 

You don't need to modify condition.It's wrong in the commit.

  • 0
Posted

Since you copied the code from L2j Freya,i guess you have no problem to copy this.

Here is the commit of Hellbound Release:

http://trac.l2jdp.com/changeset/4541/trunk/datapack_development/data/stats/skills/0500-0599.xml

http://trac.l2jserver.com/changeset/2044

 

You don't need to modify condition.It's wrong in the commit.

 

Hum thanks it worked o_o

A small issue is that the cp consume doesn't work as it should, but a subsitute should work D:

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...