Jump to content

Olympiad A Grade


Recommended Posts

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!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

  • 4 months later...
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
Link to comment
Share on other sites

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
Link to comment
Share on other sites

  • 2 months later...
  • 5 years later...
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?

Link to comment
Share on other sites

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 = 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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.

×
×
  • Create New...