Cursed weapons issues

Find the proper support area, Saga-Version.
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
User avatar
Tryskell
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

Cursed weapons issues

Post by Tryskell »

Hiho, again me and my topics-which-go-in-legacy-because-I-said-Interlude-in-the-topic :

You currently got issues with cursed weapons, when you add the item directly with admin command. The first weapon is fine, but second item on same player make the whole process buggy. Second weapon is eaten, but the weapon is still active according to the "cw_info" panel. I invite you to test what I say.

Image

Here's the fix (no patch because I haven't the last Freya version, nor want to dev on it) :

On cursedWeapon model, replace reActivate() method for following :

Code: Select all

    public void reActivate(boolean fromZero)    {        if (fromZero)        {            _isActivated = true;            if (_endTime - System.currentTimeMillis() <= 0)                endOfLife();            else                _removeTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new RemoveTask(), _durationLost*12000L, _durationLost*12000L);        }        else            _removeTask = ThreadPoolManager.getInstance().scheduleGeneralAtFixedRate(new RemoveTask(), _durationLost*12000L, _durationLost*12000L);    }
That will cast you 2 errors :
- for the adminhandler (datapack) : replace for cw.reActivate(false);
- for the CursedWeaponsManager restore() method, replace for cw.reActivate(true);

----------------

Another "issue" is this dead code on checkPlayer() method, CursedWeaponManager (you got twice this message, here and in enterworld) :

Code: Select all

                SystemMessage sm = SystemMessage.getSystemMessage(SystemMessageId.S2_MINUTE_OF_USAGE_TIME_ARE_LEFT_FOR_S1);                sm.addString(cw.getName());                //sm.addItemName(cw.getItemId());                sm.addNumber((int) ((cw.getEndTime() - System.currentTimeMillis()) / 60000));                player.sendPacket(sm);
To finish and if you got issues about cursed weapons messages at logging (I had so perhaps you're in same condition), I invite you to move the check from where it is (enterworld) to L2PcInstance onPlayerEnter() method :

Code: Select all

     public void onPlayerEnter()    {        if (isCursedWeaponEquipped())           CursedWeaponsManager.getInstance().getCursedWeapon(getCursedWeaponEquippedId()).cursedOnLogin();                startWarnUserTakeBreak();
Tested on my IL refactored Freya pack. So don't whine about panels buttons on the picture.
hope
Posts: 1160
Joined: Thu Aug 30, 2007 5:17 pm

Re: Cursed weapons issues

Post by hope »

it is not meant to be added from admin panel
User avatar
Tryskell
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

Re: Cursed weapons issues

Post by Tryskell »

hope wrote:it is not meant to be added from admin panel
Ofc, so why there is a admin command, lol ?

You can speak of commands' uselesness of any command actually. None are supposed to exist. You're not supposed to give karma ingame, not supposed to use gmshop, or not even supposed to open a admin panel. But they work (mostly) without any bugs.

What's the point of your answer ? Stop to eat clowns. :roll:

If there is a admin command, better to debug it or remove it.

PS : on any thread I posted (3/5 ?), you were the first ppl to post, and each time your answers are kinda... Offtopic, if not totally pointless, to be honest.

We got something in France for that : "Il faut tourner sept fois sa langue dans sa bouche avant de parler". Google it, and remember it.
User avatar
Tryskell
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

Re: Cursed weapons issues

Post by Tryskell »

Like last share, not legacy, except if you consider the current trunk is legacy... :o
bobzih
Posts: 1
Joined: Wed Mar 30, 2011 4:09 am

Re: Cursed weapons issues

Post by bobzih »

plz Would do a full diff of the file?
hope
Posts: 1160
Joined: Thu Aug 30, 2007 5:17 pm

Re: Cursed weapons issues

Post by hope »

Tryskell wrote:
hope wrote:it is not meant to be added from admin panel
Ofc, so why there is a admin command, lol ?

You can speak of commands' uselesness of any command actually. None are supposed to exist. You're not supposed to give karma ingame, not supposed to use gmshop, or not even supposed to open a admin panel. But they work (mostly) without any bugs.

What's the point of your answer ? Stop to eat clowns. :roll:

If there is a admin command, better to debug it or remove it.

PS : on any thread I posted (3/5 ?), you were the first ppl to post, and each time your answers are kinda... Offtopic, if not totally pointless, to be honest.

We got something in France for that : "Il faut tourner sept fois sa langue dans sa bouche avant de parler". Google it, and remember it.
you dont see gms on retail giving them out to players. Just because the command is there does not mean you use it. Yes there might be a bug in the code and when someone finds it they post a fix this way it makes the coding better
User avatar
jurchiks
Posts: 6769
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Cursed weapons issues

Post by jurchiks »

If there exists a command then it most certainly was made to use it (for testing or whatever, doesn't matter).
And if the command is implemented server-side, then it MUST be as bugless as possible just like everything else, unless, of course, you like buggy code.
So there can't be any valid arguments for not fixing it.
If you have problems, FIRST TRY SOLVING THEM YOURSELF, and if you get errors, TRY TO ANALYZE THEM, and ONLY if you can't help it, THEN ask here.
Otherwise you will never learn anything if all you do is copy-paste!
Discussion breeds innovation.
User avatar
Tryskell
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

Re: Cursed weapons issues

Post by Tryskell »

hope wrote:Yes there might be a bug in the code and when someone finds it they post a fix this way it makes the coding better
It's what I'm actually doing and it's what you try to attack.
bobzih wrote:plz Would do a full diff of the file?
This is an easy fix, but yeah if I see it's used, I will do better next time (checkout last version blabla). For this particular fix, sry :P.
Xyl11
Posts: 1
Joined: Mon May 07, 2012 3:37 am

Re: Cursed weapons issues

Post by Xyl11 »

still doesn't fix. what am i doing wrong? i still got issues with cursed weapons.
becker knives
Post Reply