Skip to content

Skill Cd Reset On Pvp.

Featured Replies

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.

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

  • Author

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 

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

  • Author

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.

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));
}		
  • Author

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!

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.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.