ThelwHelpRePaidia Posted April 9, 2015 Posted April 9, 2015 Hello here is a code for olympiad with A grade Index: I:/workspace/L2_GameServer/java/com/l2jstep/gameserver/network/clientpackets/UseItem.java =================================================================== --- I:/workspace/L2_GameServer/java/com/l2jstep/gameserver/network/clientpackets/UseItem.java (revision 4167) +++ I:/workspace/L2_GameServer/java/com/l2jstep/gameserver/network/clientpackets/UseItem.java (working copy) @@ -97,6 +97,14 @@ if (activeChar.getActiveTradeList() != null) activeChar.cancelActiveTrade(); + + int weaponGrade = activeChar.getActiveWeaponItem().getCrystalType(); + int armorGrade = activeChar.getActiveChestArmorItem().getCrystalType(); + if (activeChar.isInOlympiadMode() && (weaponGrade == L2Item.CRYSTAL_S || armorGrade == L2Item.CRYSTAL_S)) + { + activeChar.sendMessage("You cannot use S grade equipment at the Grand Olympiad games."); + return; + } // NOTE: disabled due to deadlocks // synchronized (activeChar.getInventory()) Index: I:/workspace/L2_GameServer/java/com/l2jstep/gameserver/model/olympiad/Olympiad.java =================================================================== --- I:/workspace/L2_GameServer/java/com/l2jstep/gameserver/model/olympiad/Olympiad.java (revision 4167) +++ I:/workspace/L2_GameServer/java/com/l2jstep/gameserver/model/olympiad/Olympiad.java (working copy) @@ -50,6 +50,7 @@ import com.l2jserver.gameserver.network.serverpackets.NpcHtmlMessage; import com.l2jserver.gameserver.network.serverpackets.SystemMessage; import com.l2jserver.gameserver.templates.StatsSet; +import com.l2jserver.gameserver.templates.L2Item; import com.l2jserver.util.L2FastList; import javolution.util.FastMap; @@ -482,6 +483,14 @@ * return false; } */ + int weaponGrade = noble.getActiveWeaponItem().getCrystalType(); + int armorGrade = noble.getActiveChestArmorItem().getCrystalType(); + if (weaponGrade == L2Item.CRYSTAL_S || armorGrade == L2Item.CRYSTAL_S) + { + noble.sendMessage("You cannot join the grand olympiad games using S grade equipment."); + return false; + } + if (!_inCompPeriod) { sm = new SystemMessage(SystemMessageId.THE_OLYMPIAD_GAME_IS_NOT_CURRENTLY_IN_PROGRESS); Code is not mine! Quote
SweeTs Posted April 9, 2015 Posted April 9, 2015 Bad, so bad. The olympiad check probably is while registering, so well.. You may register and then equip it and voile, you are with S grade. The check should be zone related with auto unequip. Quote
ThelwHelpRePaidia Posted April 9, 2015 Author Posted April 9, 2015 dk about the code didnt test it Quote
Nightw0lf Posted April 10, 2015 Posted April 10, 2015 also this checks only if he wears the item so if he has it in inventory, as sweety said if you dont check auto unequip they will ware it after they enter. zones can be done onEnter method make some restriction example net.sf.l2j.gameserver.model.zone.type here Quote
Ravin3~ Posted August 22, 2015 Posted August 22, 2015 (edited) thanks for share Edited August 22, 2015 by RêdfLâg Quote
Kraker Posted August 22, 2015 Posted August 22, 2015 (edited) You must edit Olympiad Stadium Zone to unequip restricted items when the player go in that area, then create a condition to prevent the use of those items while inside that area. In addition, you don't need core support to do that. Add <set name="is_oly_restricted" val="true" /> on item's XML of your choice. Edited August 22, 2015 by Kraker Quote
Trance Posted August 23, 2015 Posted August 23, 2015 Just do this. Index: java/net/sf/l2j/gameserver/model/item/kind/Item.java =================================================================== --- java/net/sf/l2j/gameserver/model/item/kind/Item.java (revision 2) +++ java/net/sf/l2j/gameserver/model/item/kind/Item.java (working copy) @@ -477,7 +477,7 @@ public boolean checkCondition(L2Character activeChar, L2Object target, boolean sendMessage) { // Don't allow hero equipment and restricted items during Olympiad - if ((isOlyRestrictedItem() || isHeroItem()) && ((activeChar instanceof L2PcInstance) && activeChar.getActingPlayer().isInOlympiadMode())) + if ((isOlyRestrictedItem() || isOlyRestrictedItemByGrade() || isHeroItem()) && ((activeChar instanceof L2PcInstance) && activeChar.getActingPlayer().isInOlympiadMode())) { if (isEquipable()) activeChar.getActingPlayer().sendPacket(SystemMessageId.THIS_ITEM_CANT_BE_EQUIPPED_FOR_THE_OLYMPIAD_EVENT); @@ -550,6 +550,11 @@ return _isOlyRestricted; } + public boolean isOlyRestrictedItemByGrade() + { + return (getCrystalType() == CrystalType.S); + } + public boolean isPetItem() { return (getItemType() == ArmorType.PET || getItemType() == WeaponType.PET); 1 Quote
BAN_L2JDev Posted February 19, 2021 Posted February 19, 2021 On 8/22/2015 at 11:37 PM, Trance said: Just do this. Index: java/net/sf/l2j/gameserver/model/item/kind/Item.java =================================================================== --- java/net/sf/l2j/gameserver/model/item/kind/Item.java (revision 2) +++ java/net/sf/l2j/gameserver/model/item/kind/Item.java (working copy) @@ -477,7 +477,7 @@ public boolean checkCondition(L2Character activeChar, L2Object target, boolean sendMessage) { // Don't allow hero equipment and restricted items during Olympiad - if ((isOlyRestrictedItem() || isHeroItem()) && ((activeChar instanceof L2PcInstance) && activeChar.getActingPlayer().isInOlympiadMode())) + if ((isOlyRestrictedItem() || isOlyRestrictedItemByGrade() || isHeroItem()) && ((activeChar instanceof L2PcInstance) && activeChar.getActingPlayer().isInOlympiadMode())) { if (isEquipable()) activeChar.getActingPlayer().sendPacket(SystemMessageId.THIS_ITEM_CANT_BE_EQUIPPED_FOR_THE_OLYMPIAD_EVENT); @@ -550,6 +550,11 @@ return _isOlyRestricted; } + public boolean isOlyRestrictedItemByGrade() + { + return (getCrystalType() == CrystalType.S); + } + public boolean isPetItem() { return (getItemType() == ArmorType.PET || getItemType() == WeaponType.PET); Hello, how are you. if i want to block some items in olympiad how would the right place be? Quote
Irrelevant Posted February 19, 2021 Posted February 19, 2021 6 minutes ago, L2VANPER said: Hello, how are you. if i want to block some items in olympiad how would the right place be? pack ? Quote
BAN_L2JDev Posted February 19, 2021 Posted February 19, 2021 (edited) 2 minutes ago, Irrelevant said: pack ? aCis 398 I don't find Olympiad Items and Block and Dual Box Edited February 19, 2021 by L2VANPER Quote
Irrelevant Posted February 20, 2021 Posted February 20, 2021 9 hours ago, L2VANPER said: aCis 398 I don't find Olympiad Items and Block and Dual Box config/events # Allow to get in oly with same ip players AltOlyAllowSameIPInOly = false # Restrict specified items in Olympiad. ItemID's need to be separated with a comma (ex. 1,200,350) # This item will auto remove if is wear # This item will be auto blocked to use until olympiad match end # 0 is default AltOlyRestrictedItems = Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.