Jump to content

[Share]: Noblesse with Armor


Recommended Posts

Index: java/com/l2jserver/gameserver/Custom/ArmorNoblesse.java
===================================================================
--- java/com/l2jserver/gameserver/Custom/ArmorNoblesse.java	(revision 0)
+++ java/com/l2jserver/gameserver/Custom/ArmorNoblesse.java	(revision 0)
@@ -0,0 +1,72 @@
+/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ * 
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package com.l2jserver.gameserver.Custom;
+
+import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
+import com.l2jserver.gameserver.model.itemcontainer.Inventory;
+import com.l2jserver.gameserver.model.itemcontainer.PcInventory;
+
+/**
+ * @author Issle
+ *
+ */
+public class ArmorNoblesse
+{
+	public static final int bodyId = 0;
+	public static final int pantsId = 0;
+	public static final int glovesId = 0;
+	public static final int bootsId = 0;
+	public static final int helmetId = 0;
+	
+	public static boolean hasArmorNoblesse(L2PcInstance activeChar)
+	{
+		PcInventory inventory = activeChar.getInventory();
+		
+		int _pantsId = inventory.getPaperdollItemId(Inventory.PAPERDOLL_LEGS);
+		int _bodyId = inventory.getPaperdollItemId(Inventory.PAPERDOLL_CHEST);
+		int _helmetId = inventory.getPaperdollItemId(Inventory.PAPERDOLL_HEAD);
+		int _glovesId = inventory.getPaperdollItemId(Inventory.PAPERDOLL_GLOVES);
+		int _bootsId = inventory.getPaperdollItemId(Inventory.PAPERDOLL_FEET);
+		
+		if(_pantsId != pantsId)
+			return false;
+		if(_glovesId != glovesId)
+			return false;
+		if(_bodyId != bodyId)
+			return false;
+		if(_helmetId != helmetId)
+			return false;
+		if(_bootsId != bootsId)
+			return false;
+		activeChar.sendMessage("You maintained your buffs cause of your special armor configuration.");
+		return true;
+	}
+	
+	private static void printParts(L2PcInstance activeChar, int part)
+	{
+		activeChar.sendMessage(String.valueOf(part));
+	}
+}
Index: java/com/l2jserver/gameserver/model/actor/L2Playable.java
===================================================================
--- java/com/l2jserver/gameserver/model/actor/L2Playable.java	(revision 4222)
+++ java/com/l2jserver/gameserver/model/actor/L2Playable.java	(working copy)
@@ -14,6 +14,7 @@
 */
package com.l2jserver.gameserver.model.actor;

+import com.l2jserver.gameserver.Custom.ArmorNoblesse;
import com.l2jserver.gameserver.ai.CtrlEvent;
import com.l2jserver.gameserver.model.L2Effect;
import com.l2jserver.gameserver.model.actor.instance.L2PcInstance;
@@ -136,6 +137,10 @@
			if (getCharmOfLuck()) //remove Lucky Charm if player have Nobless blessing buff 
				stopCharmOfLuck(null);
		}
+		else if(this instanceof L2PcInstance && ArmorNoblesse.hasArmorNoblesse((L2PcInstance)this))
+        {
+        	//do nothing.
+        }
		else
			stopAllEffectsExceptThoseThatLastThroughDeath();

 

to 0 u put ids of armor

for gracia

 

Credits:kuba90/Leluche

Link to comment
Share on other sites

  • 5 weeks later...
  • 3 months later...
  • 1 year later...

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

    • Long story, short - Yes! It is very much possible to do whatever you like, as long as you know what you are doing or at the very least know how to code. This guide is more of a general one on how to use what is already there, at that particular point in time, 9 YEARS AGO, and on a non-specified build on the Acis platform. It does not delve into the inner workings of the server core, kernel, or however else you wanna call it. It does not list what the available zone types are nor how the different zone types are handled in the core. These could differ not only from project to project and developer to developer, but also from the version to version by the same developer/project. As such, the guide won't be much of a help for your particular case, unless your source supports the features you are asking for. To this end, you should search for explanations on how each zone type is handled, or even better - look for yourself. 1. Download and open the source, preferably with IntelliJ due to its user-friendliness. 2. Locate the Zone and ZoneType classes. 3. Look where and how they are used until you find the "PARSER", which takes the info from the XML and stores it on the running server. 4. Follow the crumbs trail from there until you discover the file(s) handling each individual zone type or the info of all of their available options, also known as "HOLDER". 5. Once there, you would have to create and implement the new option(s) for your particular use-case. 6. From there, you have to back-track your steps all the way back to the PARSER class and add the new options there too. 7. Then you would have to check if the XML file in your datapack is linked to an XSD file, and you would want to add the new option(s) within the XSD too, branding them as OPTIONAL so that they are not considered mandatory in all entries. Although the list might look lengthy, and scarry, at first, it is actually an extremely easy thing to do. Regarding point №5, namely creation and implementation, you either know how to do it by yourself or you dont. If you cannot do it and you are not willing to learn java/coding/programming, pay someone to do it for you, but be EXTREMELY vigilant and adamant about NEVER paying up-front, especially in full! Have a nice one, and most importantly, enjoy the process!  
    • is it possible to make zone not allowed mass aggro or hit monster from another player? 
    • There are a lot of new and good-looking L2 advertising websites, but no one cares.  Players keep playing on the same servers with the same owners and new server names.   For example this website looks good: https://l2rankzone.com/ But it does not have traffic compared to the old topzone/hopzone (which wont bring you players either)
    • Hello everyone! I'm looking for help because the Territory Wars are causing critical errors. Build: AdvExt GF Only Clans that own castles are getting errors (mostly when killing large numbers of mobs) Random Duplication in the map for Everyone There are no errors when the TW have passed time Only 3 territories are owned:   Client error: General protection fault! History: NCWnd::AddChild <- NCWnd::RegisterChildWindow <- NCRegionInfoCtrl::UpdateImageBtn <- NCMinimapWnd::AddRegionInfo <- UMinimapCtrlHandle::execAddRegionInfo <- UObject::ProcessEvent <- (MinimapWnd Transient.MinimapWnd0, Function Interface.MinimapWnd.OnEvent) <- XMLUIManager::ExecuteUIEvent <- NConsoleWnd::OnDominionWarStart <- ExDominionWarStart <- UNetworkHandler::Tick <- Function Name=ExDominionWarSt <- UGameEngine::Tick <- UpdateWorld <- MainLoop  
    • Hi all, I used the l2j classic kameal 3.0 version. This version has only the ss/bss use for all grade of weapons. But I want to bring back the old system, when D-C-B-A-S ss/bss still exist. If anyone has the code or idea how to do it please show me the way. Thank you!
  • Topics

×
×
  • Create New...