Jump to content
  • 0

Skill Cd Reset On Pvp.


Meydex

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.

Link to comment
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
Link to comment
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 

Link to comment
Share on other sites

  • 0

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

Link to comment
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.

Link to comment
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));
}		
Link to comment
Share on other sites

  • 0

Oh yes that works too and it also seems like a more flexible way since it enables all levels of the skill in contrary to SkillData  which requires its lvl too.
Thanks for that man!

Link to comment
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.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.


×
×
  • Create New...