Page 1 of 1

Cursed weapons issues

Posted: Tue May 17, 2011 9:09 pm
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.

Re: Cursed weapons issues

Posted: Tue May 17, 2011 9:23 pm
by hope
it is not meant to be added from admin panel

Re: Cursed weapons issues

Posted: Tue May 17, 2011 11:23 pm
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.

Re: Cursed weapons issues

Posted: Wed May 18, 2011 12:43 am
by Tryskell
Like last share, not legacy, except if you consider the current trunk is legacy... :o

Re: Cursed weapons issues

Posted: Wed May 18, 2011 3:20 am
by bobzih
plz Would do a full diff of the file?

Re: Cursed weapons issues

Posted: Wed May 18, 2011 5:14 am
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

Re: Cursed weapons issues

Posted: Wed May 18, 2011 5:28 am
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.

Re: Cursed weapons issues

Posted: Wed May 18, 2011 8:05 pm
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.

Re: Cursed weapons issues

Posted: Mon May 07, 2012 3:44 am
by Xyl11
still doesn't fix. what am i doing wrong? i still got issues with cursed weapons.
becker knives