We moved our repositories to BitBucket!

If you can't login or you can't register to the forums do not rise an issue, instead please write to support (at) l2jserver.com

Check our wiki!

Report server issues here

Forum has been updated to phpBB 3.2, let's see if this fixes some minor bugs we had.

Thank you for visiting http://www.l2jserver.com/

Cursed weapons issues

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

Cursed weapons issues

Post by Tryskell » Tue May 17, 2011 9:09 pm

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 » Tue May 17, 2011 9:23 pm

it is not meant to be added from admin panel

User avatar
Tryskell
Advanced User
Advanced User
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

Re: Cursed weapons issues

Post by Tryskell » Tue May 17, 2011 11:23 pm

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
Advanced User
Advanced User
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

Re: Cursed weapons issues

Post by Tryskell » Wed May 18, 2011 12:43 am

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 » Wed May 18, 2011 3:20 am

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

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: 6760
Joined: Sat Sep 19, 2009 4:16 pm
Location: Eastern Europe

Re: Cursed weapons issues

Post by jurchiks » Wed May 18, 2011 5:28 am

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
Advanced User
Advanced User
Posts: 256
Joined: Wed Nov 25, 2009 5:57 pm
Location: France :)

Re: Cursed weapons issues

Post by Tryskell » Wed May 18, 2011 8:05 pm

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 » Mon May 07, 2012 3:44 am

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

Locked