Cursed weapons issues
Posted: 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.

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 :
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) :
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 :
Tested on my IL refactored Freya pack. So don't whine about panels buttons on the picture.
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.

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); }
- 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);
Code: Select all
public void onPlayerEnter() { if (isCursedWeaponEquipped()) CursedWeaponsManager.getInstance().getCursedWeapon(getCursedWeaponEquippedId()).cursedOnLogin(); startWarnUserTakeBreak();