Jump to content

Question

Posted

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;
        }

 

Recommended Posts

  • 0
Posted (edited)

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
  • 0
Posted

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 :)

  • 0
Posted

 

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

 

 

  • 0
Posted

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 :)

  • 0
Posted (edited)

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
  • 0
Posted

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?

  • 0
Posted (edited)

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
  • 0
Posted

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 :(

  • 0
Posted

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.

  • 0
Posted

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.

  • 0
Posted (edited)

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • Dragic is a trusted guy—buy with confidence. The feature list looks incredibly solid, and you've clearly put a ton of work into this pack. Good luck with the sale, mate!
    • Im Selling my Interlude server L2wish only The Data and Core of L2wish based on lucera2 files with source code reconstructed which i did a long time ago. Im not selling the servername copyrights logos launcher etc only server data and source code, including Essence Interface reworked with interface source also.      EXP/SP: x75  Adena: x20  Drop: x20  Spoil: x20  Seal Stones: x5  Fangs of Stakato: x5  Raid Boss EXP/SP: x75  Raid Boss Drop: x1  Epic Boss Drop: x1  Manor: x5  Safe Enchant: +3  Max Enchant: Unlimited   Normal Scroll S/A Grade: 50%   Blessed Scroll S/A Grade: 55%    Normal Scroll B/C/D Grade: 50%    Blessed Scroll B/C/D Grade 55%  Max clans in ally (2)  3rd Class Cost (700 Halisha's Mark from Shrine of Loyalty)  NPC Buffer with 3h buff duration  GM Shop until B-Grade  Mana Potions  (1000 Power Delay 10 Seconds)  Auto-learn skills   Buff Slots (22+4 extra with Divine Inspiration)  Autopickup  Auction House in NPC at all towns  Offline Stores  Max Clients per PC (2)  Retail Geodata and Pathnodes  Reworked movement  Shift + Click Droplist on Monsters  Alt + Click Remove Buffs  Global Shout & Trade Chat  Special akamanah and zariche transformation  Seven Sings (Open)  Olympiad Weekly Circle  Olympiad Non-class  (5 min participants to begin)  Olympiad Class based (5 min participants to begin)  Tyrannosaurus drop Top LS chance 20% 5 Minutes Respawn  Flames of Invincibility cast 5 sec / duration 30 sec  Premium Account System  Auto Farm system using 10th Skill Bar.  IMPROVED RING OF CORE +1 STR +1 INT • INCREASE M. ATK. AND P. ATK.  IMPROVED EARRING OF ORFEN +1 WIT • INCREASE CASTING SPEED.  Subclass Quest           Part I: Kill Cabrio (Aden-Seal of Shilen) Talk to the box and bring the item to Subclass Quest           NPC.           Part II: Go for Hallate TOI 3, Kernon TOI 8 and Golkonda TOI 11, (Regardless of the order)           kill them, talk to the boxes and bring the sticks to Subclass Quest NPC to redeem your           subclass item.    Vote Reward System with Vote Coins and 12 Hours Vote Rune.  Vote Rune increases your P. Def and M. Def by 6%, P. Attack and M. Attack by 4%, Movement Speed by 4%.  Duration 12 Hours   Quest Name Drop  Relics of the Old Empire x4-8  Gather The Flames x3  Alliance with the Ketra Orcs x5  Alliance with the Varka Silenos x5  War with Ketra Orcs x10  War with the Varka Silenos x10  The Finest Food x5  A Powerful Primeval Creature x5  Rise and Fall of the Elroki Tribe x8  Legacy of Insolence x6-50%  Exploration of Giants Cave Part 1 x3  Exploration of Giants Cave Part 2 x3   Seekers of the Holy Grail x10   Guardians of the Holy Grail x10  Hunt of the Golden Ram Mercenary Force x10  The Zero Hour x5  Delicious Top Choice Meat x1  Heart in Search of Power x1  Whisper of Dreams 1/2 x3  In Search Of Fragments Of The Dimension x1 Raid Boss Name LvL Respawn  Frintezza    80 Respawn 48 Hours + - 30 Min  • Frintezza’s Necklace drop chance is 100%  Valakas    80 Respawn 240 Hours + - 30 Min  Sleep time 30 Minutes • Necklace of Valakas drop chance is 100%  Antharas    80 Respawn 192 Hours + - 30 Min  Sleep time 30 Minutes • Earring of Antharas drop chance is 100%  Baium    80 Respawn 120 Hours + - 30 Min  Sleep time 30 Minutes • Ring of Baium drop chance is 100%  Zaken    80 Respawn 48 Hours + - 30 Min  Door Open 22:00 in the night • Zaken’s Earring drop chance is 100%  Orfen    80 Every 24 Hours -+ 20 Minutes  • Earring of Orfen drop chance is 30%  Core    80 Every 26 Hours -+ 20 Minutes   • Ring of Core drop chance is 30%  Ant Queen    80 Every 28 Hours -+ 20 Minutes • Ring of Queen Ant drop chance is 30%  Splendor Barakiel    80 Spawn 6 Hours + - 15 Min Random  Subclass - Cabrio    80 Spawn 6 Hours + - 15 Min Random  Subclass - Hallate    80 Spawn 6 Hours + - 15 Min Random  Subclass - Kernon    80 Spawn 6 Hours + - 15 Min Random  Subclass - Golkonda    80 Spawn 6 Hours + - 15 Min Random   Ketra's Hero Hekaton    80 Spawn 22 Hours + - 15 Min Random   Ketra's Commander Tayr    80 Spawn 22 Hours + - 15 Min Random  Varka's Hero Shadith    80 Spawn 22 Hours + - 15 Min Random   Varka's Commander    80 Spawn 22 Hours + - 15 Min Random   Command Description .getreward Get vote reward from Hopzone. .rune Your Rune Informations. .menu Personal Menu Options. .raid Shows Normal Raids & Respawn. .epic Shows Epic Raids & Respawn. .rewards Get your Achievments. .offline Offline Shops. .relog Clearing your cache fps.     Source code reconstructed from my Lucera2 project.           Contact me for more informations, trollers will be not answered and don't expect a low price or a price drop. This project was running with 500+ real players.
    • TG Support: https://t.me/buyingproxysup | Channel: https://t.me/buyingproxycom Discord support: #buyingproxy | Server: Join the BuyingProxy Discord Server!  Create your free account here
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..