Jump to content

Recommended Posts

Posted

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!

Posted

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.

Posted

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

  • 4 months later...
Posted (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 by Kraker
Posted

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);
  • Like 1
  • 2 months later...
  • 5 years later...
Posted
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?

Posted
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 = 

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • If you're planning to create a vid for your l2 server, sometimes it helps doing part of it yourself, like converting raw gameplay clips or reworking formats before sending them off. I had a situation where a guy I hired asked for all files in MP4, and I had some weird MOD formats from an old camera. Took forever trying to open them properly until I converted them first.   For stuff like that, I’ve been using this https://www.movavi.com/video-converter/mod-converter.html converter. Makes prepping the raw files way smoother before passing them on to whoever is editing.
    • ➡ Discount for your purchase: JUNE2025 (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • ➡ Discount for your purchase: JUNE2025 (10% discount) ➡ Our Online Shop: https://socnet.store  ➡ Our SMM-Boosting Panel: https://socnet.pro  ➡ Telegram Shop Bot: https://socnet.shop  ➡ Telegram Support: https://t.me/solomon_bog  ➡ Telegram Channel: https://t.me/accsforyou_shop  ➡ Discord Support: @AllSocialNetworksShop  ➡ Discord Server: https://discord.gg/y9AStFFsrh  ➡ WhatsApp Support: https://wa.me/79051904467 ➡ WhatsApp Channel: https://whatsapp.com/channel/0029Vau0CMX002TGkD4uHa2n  ➡ Email Support: solomonbog@socnet.store 
    • Today I bless all my lovelies here at MaxCheaters with the pleasure to see one of the best armors ever created. Forged in the heart of Greece, it embodies the fiery spirit in which every Greek holds within them. Bold and bright, fierce and roaring.   Behold, the 🔥🔥MeGaFlaME ELLiNaS🔥🔥 armor set. Now it has been immortalized. For all to feel its warmth.   Credits: The17heroes Gracia Final Download: https://l2jbaylee.dev/shares/FirePowerOfGreeceArmor.rar   @911reg May it live forever in our hearts.
    • I don't understand people's obsession with such terrible armor. Shame on the person that made this and the people that like it.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock