Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use
viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Naonah
Posts: 357 Joined: Sun Apr 04, 2010 11:12 pm
Post
by Naonah » Sun Sep 19, 2010 1:15 am
If you want to receive support we need this info to help you properly.
» Find Revision
L2J Revision
Number :
L2JDP Revision
Number :
Hi:)
I have custom items as circlets (with custom stats).
I would like to restrict them at olympiad.
How I want it to work: when a player is going to be ported to olympiad stadium, a circlet is auto unequipped. (similar to hero's Wings od Destiny)
..but I have a small problem.
I edited OlympiadGame.java
Code: Select all
protected void removals() { if (_aborted) return; if (_playerOne == null || _playerTwo == null) return; if (_playerOneDisconnected || _playerTwoDisconnected) return; for (L2PcInstance player : _players) { try { // Remove Buffs player.stopAllEffectsExceptThoseThatLastThroughDeath(); // Remove Clan Skills if (player.getClan() != null) { for (L2Skill skill : player.getClan().getAllSkills()) player.removeSkill(skill, false, true); if (player.getClan().getHasCastle() > 0) CastleManager.getInstance().getCastleByOwner(player.getClan()).removeResidentialSkills(player); if (player.getClan().getHasFort() > 0) FortManager.getInstance().getFortByOwner(player.getClan()).removeResidentialSkills(player); } int itemId = getItemId(); if (itemId == 13511) { for (L2ItemInstance specialitem : player.getInventory().getItems()) if (specialitem.isEquipped()) { player.getInventory().unEquipItemInSlotAndRecord(specialitem.getLocationSlot()); }
I have a problem here:
int itemId = getItemId(); Info:
The method getItemId() is undefined for the type OlympiadGame.
Please help me a bit cuz I dont know well this project
Thank you.
Best regards.
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
_DS_
L2j Veteran
Posts: 3437 Joined: Wed Apr 30, 2008 8:53 am
Location: Russia
Post
by _DS_ » Sun Sep 19, 2010 4:54 am
# Restrict specified items in Olympiad. ItemID's need to be separated with a comma (ex. 1,200,350)
# Default: 0
AltOlyRestrictedItems = 0
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
SolidSnake
Posts: 865 Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy
Post
by SolidSnake » Sun Sep 19, 2010 7:42 am
DS, he wants to unequip the equipable item, too
SolidSnake
Posts: 865 Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy
Post
by SolidSnake » Sun Sep 19, 2010 8:07 am
Code: Select all
Index: java/com/l2jserver/gameserver/model/entity/Hero.java===================================================================--- java/com/l2jserver/gameserver/model/entity/Hero.java (revision 4415)+++ java/com/l2jserver/gameserver/model/entity/Hero.java (working copy)@@ -734,7 +734,79 @@ for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++) { L2ItemInstance equippedItem = player.getInventory().getPaperdollItem(i);- if ((equippedItem != null) && equippedItem.isHeroItem())+ if ((equippedItem != null) && equippedItem.isHeroItem() || equippedItem.isOlyRestrictedItem()) { player.getInventory().unEquipItemInSlotAndRecord(i); } }
Then write the items ID as _DS_ said
_DS_ wrote: # Restrict specified items in Olympiad. ItemID's need to be separated with a comma (ex. 1,200,350)
# Default: 0
AltOlyRestrictedItems = 0
_DS_
L2j Veteran
Posts: 3437 Joined: Wed Apr 30, 2008 8:53 am
Location: Russia
Post
by _DS_ » Sun Sep 19, 2010 9:17 am
Maybe should be committed...
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
_DS_
L2j Veteran
Posts: 3437 Joined: Wed Apr 30, 2008 8:53 am
Location: Russia
Post
by _DS_ » Sun Sep 19, 2010 9:53 am
SolidSnake, this is a wrong part of the code
It used only during computing new heroes. Easiest way of restricting - add xml condition, like for hero items.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
Naonah
Posts: 357 Joined: Sun Apr 04, 2010 11:12 pm
Post
by Naonah » Sun Sep 19, 2010 10:01 am
Thank you for replies:)
I have these items restricted like DS said.
All is OK if item is unequipped because a player cant equip it during oly match.
The problem is when he has this item equipped before oly registration. After porting an item is
still in a slot (here HAIRALL). If you click on this item ofc y have info that item is restricted but this item features are still applied (like for exemple: P. Att. +25%)
About SolidSnake solution: I will try to move these code (ofc modified) from Hero.java to OlympiadGame.java and test it.
Anyway I will try to test your solutions and give a feedback here
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
SolidSnake
Posts: 865 Joined: Wed Jan 20, 2010 6:54 pm
Location: Italy
Post
by SolidSnake » Sun Sep 19, 2010 10:39 am
Ops sorry
Try this one
Code: Select all
Index: java/com/l2jserver/gameserver/model/olympiad/OlympiadGame.java===================================================================--- java/com/l2jserver/gameserver/model/olympiad/OlympiadGame.java (revision 4415)+++ java/com/l2jserver/gameserver/model/olympiad/OlympiadGame.java (working copy)@@ -39,1 +39,68 @@import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;import com.l2jserver.gameserver.model.actor.instance.L2PetInstance;+import com.l2jserver.gameserver.model.itemcontainer.Inventory;import com.l2jserver.gameserver.model.olympiad.Olympiad.COMP_TYPE;import com.l2jserver.gameserver.network.SystemMessageId;@@ -285,5 +285,6 @@ player.getActiveWeaponInstance().setChargedSpiritshot(L2ItemInstance.CHARGED_NONE); }++ for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++)+ {+ L2ItemInstance equippedItem = player.getInventory().getPaperdollItem(i);+ if ((equippedItem != null) && equippedItem.isOlyRestrictedItem())+ {+ player.getInventory().unEquipItemInSlotAndRecord(i);+ }+ } // enable skills with cool time <= 15 minutes
Naonah
Posts: 357 Joined: Sun Apr 04, 2010 11:12 pm
Post
by Naonah » Sun Sep 19, 2010 11:39 am
@SolidSnake - Thank you. Works fine
@DS - I think you can commit this. It is a good solution. Adding conditions to items also work but I think core solution is better
Once again thank you.
/closed
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
_DS_
L2j Veteran
Posts: 3437 Joined: Wed Apr 30, 2008 8:53 am
Location: Russia
Post
by _DS_ » Sun Sep 19, 2010 3:25 pm
Code: Select all
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 5229)+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)@@ -13694,7 +13694,8 @@ for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++) { L2ItemInstance equippedItem = getInventory().getPaperdollItem(i);- if (equippedItem != null && !equippedItem.getItem().checkCondition(this, this, false))+ if (equippedItem != null && (!equippedItem.getItem().checkCondition(this, this, false)+ || (isInOlympiadMode() && equippedItem.isOlyRestrictedItem()))) { getInventory().unEquipItemInSlotAndRecord(i);
Test this. For Freya, but should apply.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
Naonah
Posts: 357 Joined: Sun Apr 04, 2010 11:12 pm
Post
by Naonah » Sun Sep 19, 2010 6:52 pm
_DS_ wrote: Code: Select all
Index: java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java===================================================================--- java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (revision 5229)+++ java/com/l2jserver/gameserver/model/actor/instance/L2PcInstance.java (working copy)@@ -13694,7 +13694,8 @@ for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++) { L2ItemInstance equippedItem = getInventory().getPaperdollItem(i);- if (equippedItem != null && !equippedItem.getItem().checkCondition(this, this, false))+ if (equippedItem != null && (!equippedItem.getItem().checkCondition(this, this, false)+ || (isInOlympiadMode() && equippedItem.isOlyRestrictedItem()))) { getInventory().unEquipItemInSlotAndRecord(i);
Test this. For Freya, but should apply.
You mean to put this into L2PcInstance.java or OlympiadGame.java?
... because in L2PcInstance (rev. 4415) there is no such method.
Line 13694 is inside
public static boolean checkSummonTargetStatus(L2Object target, L2PcInstance summonerChar)
Thank you.
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}
_DS_
L2j Veteran
Posts: 3437 Joined: Wed Apr 30, 2008 8:53 am
Location: Russia
Post
by _DS_ » Sun Sep 19, 2010 7:06 pm
Press "guess" button. Ofc my current l2pcinstance far from epilogue.
Commiter of the shit
public static final int PI = 3.1415926535897932384626433832795;
Probe
Posts: 915 Joined: Thu Sep 03, 2009 6:36 pm
Location: Israel
Contact:
Post
by Probe » Sun Sep 19, 2010 7:09 pm
don't search for line number, search for the actual line removed.
Naonah
Posts: 357 Joined: Sun Apr 04, 2010 11:12 pm
Post
by Naonah » Sun Sep 19, 2010 8:45 pm
Probe wrote: don't search for line number, search for the actual line removed.
oops, yes you are right
I am just a bit tired
@_DS_: Works fine. Can be committed to Epilogue project
Code: Select all
public void checkItemRestriction() { for (int i = 0; i < Inventory.PAPERDOLL_TOTALSLOTS; i++) { L2ItemInstance equippedItem = getInventory().getPaperdollItem(i); if (equippedItem != null && (!equippedItem.getItem().checkCondition(this, this, false) || (isInOlympiadMode() && equippedItem.isOlyRestrictedItem()))) { getInventory().unEquipItemInSlotAndRecord(i);
public void l2jserver ()
{
if (you want l2j server == no problems)
use Linux;
else
use Windows;
}