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 = 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • "I recently purchased the account panel from this developer and wanted to leave a positive review.   The transaction was smooth, and the developer demonstrated exceptional professionalism throughout the process.   What truly sets them apart is their outstanding post-sale support. They are responsive, patient, and genuinely helpful when addressing questions or issues. It's clear they care about their customers' experience beyond just the initial sale.   I am thoroughly satisfied and grateful for the service. This is a trustworthy seller who provides real value through both a quality product and reliable support. 100% recommended."
    • Server owners, Top.MaxCheaters.com is now live and accepting Lineage 2 server listings. There is no voting, no rankings manipulation, and no paid advantages. Visibility is clean and equal, and early listings naturally appear at the top while the platform grows. If your server is active, it should already be listed. Submit here https://Top.MaxCheaters.com This platform is part of the MaxCheaters.com network and is being built as a long-term reference point for the Lineage 2 community. — MaxCheaters.com Team
    • ⚙️ General Changed “No Carrier” title to “Disconnected” to avoid confusion after abnormal DC. On-screen Clan War kill notifications will no longer appear during Sieges, Epics, or Events. Bladedancer or SwordSinger classes can now log in even when Max Clients (2) is reached, you cannot have both at the same time. The max is 3 clients. Duels will now be aborted if a monster aggros players during a duel (retail-like behavior). Players can no longer send party requests to blocked players (retail-like). Fixed Researcher Euclie NPC dialogue HTML error. Changed Clan leave/kick penalty from 12 hours to 3 hours. 🧙 Skills Adjusted Decrease Atk. Spd. & Decrease Speed land rates in Varka & FoG. Fixed augmented weapons not getting cooldown when entering Olympiad. 🎉 Events New Team vs Team map added. New Save the King map added (old TvT map). Mounts disabled during Events. Letter Collector Event enabled Monsters drop letters until Feb. 13th Louie the Cat in Giran until Feb. 16th Inventory slots +10 during event period 📜 Quests Fixed “Possessor of a Precious Soul Part 1” rare stuck issue when exceeding max quest items. Fixed Seven Signs applying Strife buff/debuff every Monday until restart. 🏆 Milestones New milestone: “Defeat 700 Monsters in Varka” 🎁 Rewards: 200 Varka’s Mane + Daily Coin 🌍 NEW EXP Bonus Zones Hot Springs added Varka Silenos added (hidden spots excluded) As always, thank you for your support! L2Elixir keeps evolving, improving, and growing every day 💙   Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • https://sms.pro/ — we are an SMS activation platform  seeking partners  mobile number providers  mobile number owners  owners of GSM modems  SIM card owners We process 1,000,000 activations every day.  寻找合作伙伴  手机号码提供商  手机号码持有者  GSM调制解调器持有者  SIM卡持有者 我们每天处理1,000,000次激活。  Ищем партнеров  Владельцы сим карт  провайдеров  владельцев мобильных номеров  владельцев модемов  Обрабатываем от 1 000 000 активаций в день ⚡️ Fast. Reliable.   https://sms.pro/ Support: https://t.me/alismsorg_bot
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..