Welcome to MaxCheaters.com

Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads

  • 0

Help Skill Cd Reset On Pvp.


Question

Hi, 
I came up with a concept which allows the cooldown reset of a certain skill when someone kills a player in pvp.
Here is what I tried so far but it doesn't seem to do anything at all:
 



//Reset skill cooldown on pvp 
for (Skill skill : getAllSkills())
{
   if (skill.getId() == 821) //Currently Shadow Step 
   {
	enableSkill(skill);
   }
}

P.S I added it inside IncreasePvpKills() method in L2PcInstance class.
Any suggestions to make it functional?
Thank you.

Share this post


Link to post
Share on other sites

9 answers to this question

Recommended Posts

  • 0
if (getSkill(821) != null)

You can add this check but anyway, you will enable all skills. :P Also you have to send SkillCoolTime packet, to update the icon.

sendPacket(new SkillCoolTime(this));
Edited by SweeTs

Share this post


Link to post
Share on other sites
  • 0

Oh yes forgot about the packet , thanks for the info :)
Is there a way to reset cd on a specific skill instead of reseting everything?
By the way there is not any getSkill() method on L2PcInstance or L2Character so I won't be able to use this check :P 

Share this post


Link to post
Share on other sites
  • 0

SweeTs probably meant getKnownSkill(821) != null, besides i don't see why your enableSkill(skill) would enable every skill.

Share this post


Link to post
Share on other sites
  • 0

Nevermind fixed it :D
Here is the code if someone wants it :
 

//Reset skill cooldown on pvp 
Skill skill = SkillData.getInstance().getSkill(821, 1); //Currently Shadow Step			
			
if (skill != null)  
{
	enableSkill(skill);				
	sendPacket(new SkillCoolTime(this));
}		

Simple and works like a charm for l2jserver high five.

Share this post


Link to post
Share on other sites
  • 0

You don't really need the SkillData

//Reset skill cooldown on pvp 
Skill skill = getKnownSkill(821); //Currently Shadow Step			
			
if (skill != null)  
{
    enableSkill(skill);				
    sendPacket(new SkillCoolTime(this));
}		

Share this post


Link to post
Share on other sites
  • 0

getKnownSkill verify player's skills, while SkillData is simply the skill template. So SkillData approach is plain wrong, you would send a refresh packet no matter the player class.

 

Versus' approach is the only one.

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.