Jump to content
  • 0

Enchant Skills Protection Issue


GameBlonD

Question

Hello,

 

How can i add here:

    public boolean isAllowedToEnchantSkills()
    {
        if (isLocked())
            return false;
        if (isTransformed())
            return false;
        if (AttackStanceTaskManager.getInstance().getAttackStanceTask(this))
            return false;
        if (isCastingNow() || isCastingSimultaneouslyNow() || isInCombat())
            return false;
        if (isInBoat() || isInAirShip())
            return false;
        return true;
    }

If the skill has cooldown to return false?
 

    // Check if this skill is enabled (ex : reuse time)
        if (isSkillDisabled(skill))
        {
            SystemMessage sm = null;
            
            if (_reuseTimeStamps.containsKey(Integer.valueOf(skill.getReuseHashCode())))
            {
                int remainingTime = (int)(_reuseTimeStamps.get(Integer.valueOf(skill.getReuseHashCode())).getRemaining()/1000);
                int hours = remainingTime / 3600;
                int minutes = (remainingTime % 3600) / 60;
                int seconds = (remainingTime % 60);
                if (hours > 0)
                {
                    sm = new SystemMessage(SystemMessageId.S2_HOURS_S3_MINUTES_S4_SECONDS_REMAINING_FOR_REUSE_S1);
                    sm.addSkillName(skill);
                    sm.addNumber(hours);
                    sm.addNumber(minutes);
                }
                else if (minutes > 0)
                {
                    sm = new SystemMessage(SystemMessageId.S2_MINUTES_S3_SECONDS_REMAINING_FOR_REUSE_S1);
                    sm.addSkillName(skill);
                    sm.addNumber(minutes);
                }
                else
                {
                    sm = new SystemMessage(SystemMessageId.S2_SECONDS_REMAINING_FOR_REUSE_S1);
                    sm.addSkillName(skill);
                }
                
                sm.addNumber(seconds);
            }
            else
            {
                sm = new SystemMessage(SystemMessageId.S1_PREPARED_FOR_REUSE);
                sm.addSkillName(skill);
            }
            
            sendPacket(sm);
            return false;
        }

 

Link to comment
Share on other sites

Recommended Posts

  • 0

Okey maybe im wrong but since you have in your hands the skill that will removed you can check this one ...

 

something like that 

if (linked && _linkedSkill != null && player.isSkillDisabled(_linkedSkill))
	{
		message
	}

before 

final int costMultiplier = skill.getEnchantCostMultiplier();
Edited by melron
Link to comment
Share on other sites

  • 0

Thanks now it works fine!

 

Btw do you know what cause this issue?  why the skills got refreshed when enchanted?

 

Can we fix it retail like?  I think it has something to do with the skill changing skill_level.

 

Do you know where the skill reuse time saved before player make restart? (after restart it saved on character_skills_save)


Thanks again :)

Link to comment
Share on other sites

  • 0

 

Okey maybe im wrong but since you have in your hands the skill that will removed you can check this one ...

 

something like that 

if (linked && _linkedSkill != null && player.isSkillDisabled(_linkedSkill))
	{
		message
	}

before 

final int costMultiplier = skill.getEnchantCostMultiplier();

When the character login and try to enchant a skill he gets the message.

 

This works only after the char use the skill and wait for the cooldown :P

 

 

Link to comment
Share on other sites

  • 0

Thanks now it works fine!

 

 

Btw do you know what cause this issue?  why the skills got refreshed when enchanted?

 

Can we fix it retail like?  I think it has something to do with the skill changing skill_level.

 

Do you know where the skill reuse time saved before player make restart? (after restart it saved on character_skills_save)

 

 

Thanks again :)

No problem, always happy to help. Consider marking my post as "answer" to this thread in order to help other people find this fix too :)

Link to comment
Share on other sites

  • 0

No problem, always happy to help. Consider marking my post as "answer" to this thread in order to help other people find this fix too :)

I have one problem with this it happens the same with the above code

 

When i login i can't enchant the skill only if i use it and wait for the reuse :/

Edited by GameBlonD
Link to comment
Share on other sites

  • 0

I have one problem with this it happens the same with the above code

 

When i login i can't enchant the skill only if i use it and wait for the reuse :/

hm...this sounds weird actually. I did not have any problems like this when i was using it my own.

 

So, to make this straight. Lets say you are a tank and you have Ultimate Defense.

 

Ultimate defense is NOT in cooldown. You log in. You try to enchant UD, but you cant. You use UD. UD is on cooldown. You cant enchant because its on cooldown. UD cooldown restored. You can enchant UD normally...

 

Is this your problem?

Link to comment
Share on other sites

  • 0

hm...this sounds weird actually. I did not have any problems like this when i was using it my own.

 

So, to make this straight. Lets say you are a tank and you have Ultimate Defense.

 

Ultimate defense is NOT in cooldown. You log in. You try to enchant UD, but you cant. You use UD. UD is on cooldown. You cant enchant because its on cooldown. UD cooldown restored. You can enchant UD normally...

 

Is this your problem?

Yes

 

IT happens on all skills expect Blink/rapid shot so far

 

Maybe return checkUseMagicConditions(skill, false, false);   those 2 false?

Edited by GameBlonD
Link to comment
Share on other sites

  • 0

Yes

 

IT happens on all skills expect Blink/rapid shot so far

Well, that sounds pretty weird. I got a couple of things for you:

1) Did you add any protection by your own during tests and now you forget to remove it after you applied my code?

2) Did you try to remove my code and see if everything is back to normal?

3) Try to use //removereuse command and restart. If after //removereuse still having this problem, i have no idea :(

Link to comment
Share on other sites

  • 0

Well, that sounds pretty weird. I got a couple of things for you:

1) Did you add any protection by your own during tests and now you forget to remove it after you applied my code?

2) Did you try to remove my code and see if everything is back to normal?

3) Try to use //removereuse command and restart. If after //removereuse still having this problem, i have no idea :(

1. no

2. yes

 

Its strange , i will try to find the retail fix , but i don't know where the server saves the cooldown when the player is online.

Link to comment
Share on other sites

  • 0

1. no

2. yes

 

Its strange , i will try to find the retail fix , but i don't know where the server saves the cooldown when the player is online.

Take a look at here, xxdem refers to the retail fix.

Link to comment
Share on other sites

  • 0

Open isSkillDisabled method,

 

Inside of this method add messages in every IF / case (where return is true) to see where the problem is,

post the prob here ;)

Edited by melron
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...