Jump to content

Recommended Posts

Posted

-Gia Interlude L2JBrazil latest revision

-exei prostethei dinatotita gia polla diaforetika armor set.

 

### Eclipse Workspace Patch 1.0
#P L2JBrasil_CORE
Index: java/com/it/br/gameserver/Custom/ArmorSet.java
===================================================================
--- java/com/it/br/gameserver/Custom/ArmorSet.java	(revision 0)
+++ java/com/it/br/gameserver/Custom/ArmorSet.java	(revision 0)
@@ -0,0 +1,89 @@
+/* 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 2, 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package com.it.br.gameserver.Custom;
+
+/**
+ *
+ * @author  Issle
+ */
+public class ArmorSet
+{
+	private int glovesId;
+	private int bootsId;
+	private int helmetId;
+	private int pantsId;
+	private int bodyId;
+	
+	/**
+	 * Add the ids in the following order for this set:
+	 * 
+	 * @param _bootsId
+	 * @param _pantsId
+	 * @param _bodyId
+	 * @param _glovesId
+	 * @param _helmetId
+	 */
+	public ArmorSet(int _bootsId, int _pantsId, int _bodyId, int _glovesId, int _helmetId)
+	{
+		glovesId =_glovesId;
+		bootsId = _bootsId;
+		helmetId = _helmetId;
+		pantsId = _pantsId;
+		bodyId = _bodyId;
+	}
+	
+	/**
+	 * @return Returns the helmetId.
+	 */
+	public int getHelmetId()
+	{
+		return helmetId;
+	}
+
+	/**
+	 * @return Returns the pantsId.
+	 */
+	public int getPantsId()
+	{
+		return pantsId;
+	}
+
+	/**
+	 * @return Returns the bodyId.
+	 */
+	public int getBodyId()
+	{
+		return bodyId;
+	}
+
+	/**
+	 * @return Returns the bootsId.
+	 */
+	public int getBootsId()
+	{
+		return bootsId;
+	}
+
+	/**
+	 * @return Returns the glovesId.
+	 */
+	public int getGlovesId()
+	{
+		return glovesId;
+	}
+}
Index: java/com/it/br/gameserver/GameServer.java
===================================================================
--- java/com/it/br/gameserver/GameServer.java	(revision 1178)
+++ java/com/it/br/gameserver/GameServer.java	(working copy)
@@ -29,6 +29,7 @@
import com.it.br.Config;
import com.it.br.L2DatabaseFactory;
import com.it.br.Server;
+import com.it.br.gameserver.Custom.NoblesseArmor;
import com.it.br.gameserver.cache.CrestCache;
import com.it.br.gameserver.cache.HtmCache;
import com.it.br.gameserver.communitybbs.Manager.ForumsBBSManager;
@@ -539,6 +540,7 @@
         TvTManager.getInstance();
		Npcbuffer.getInstance().engineInit();
		NpcBufferSkillIdsTable.getInstance();
+		NoblesseArmor.loadConfigurations();
         if (Config.NPCBUFFER_FEATURE_ENABLED) 
	        { 
	                BufferSkillsTable.getInstance();
Index: java/com/it/br/gameserver/model/L2Character.java
===================================================================
--- java/com/it/br/gameserver/model/L2Character.java	(revision 1178)
+++ java/com/it/br/gameserver/model/L2Character.java	(working copy)
@@ -36,6 +36,7 @@
import com.it.br.gameserver.GameTimeController;
import com.it.br.gameserver.GeoData;
import com.it.br.gameserver.ThreadPoolManager;
+import com.it.br.gameserver.Custom.NoblesseArmor;
import com.it.br.gameserver.ai.CtrlEvent;
import com.it.br.gameserver.ai.CtrlIntention;
import com.it.br.gameserver.ai.L2AttackableAI;
@@ -1514,6 +1515,10 @@
			if (((L2PlayableInstance)this).getCharmOfLuck()) //remove Lucky Charm if player has SoulOfThePhoenix/Salvation buff 
			((L2PlayableInstance)this).stopCharmOfLuck(null); 
			} 
+		else if(this instanceof L2PcInstance && NoblesseArmor.hasArmorNoblesse((L2PcInstance)this))
+		{
+			//Do nothing aka do not remove effects.
+		}
		else
			stopAllEffects();

Index: java/com/it/br/gameserver/Custom/NoblesseArmor.java
===================================================================
--- java/com/it/br/gameserver/Custom/NoblesseArmor.java	(revision 0)
+++ java/com/it/br/gameserver/Custom/NoblesseArmor.java	(revision 0)
@@ -0,0 +1,95 @@
+/* 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 2, 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, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ *
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+package com.it.br.gameserver.Custom;
+
+import java.util.LinkedList;
+import java.util.logging.Logger;
+
+import com.it.br.gameserver.model.Inventory;
+import com.it.br.gameserver.model.PcInventory;
+import com.it.br.gameserver.model.actor.instance.L2PcInstance;
+
+/**
+ *
+ * @author  Issle
+ */
+public class NoblesseArmor
+{
+	protected static final Logger _log = Logger.getLogger(NoblesseArmor.class.getName());
+	private static LinkedList<ArmorSet> armorSets = new LinkedList<ArmorSet>();
+	
+	public static void loadConfigurations()
+	{
+		//Add your custom armor sets here. A player must have 
+		//one of these sets equiped to retain his buffs onDie.
+		armorSets.add(new ArmorSet(123, 234, 2356, 3456, 456));
+		armorSets.add(new ArmorSet(1234, 234, 2356, 3456, 4556));
+		armorSets.add(new ArmorSet(123, 2384, 2356, 34536, 456));
+		
+		
+		_log.info("[NoblesseArmor]: Loaded "+String.valueOf(armorSets.size())+" armor sets.");
+	}
+	
+	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);
+		
+		for(ArmorSet set: armorSets)
+		{
+			if(isValidArmor(set, _pantsId, _bodyId, _helmetId, _glovesId, _bootsId))
+			{
+				activeChar.sendMessage("You maintained your buffs cause of your special armor configuration.");
+				return true;
+			}
+		}
+		activeChar.sendMessage("No special armor configuration, you lost your buffs.");
+		return false;
+	}
+
+	/**
+	 * @param set
+	 * @param pantsId
+	 * @param bodyId
+	 * @param helmetId
+	 * @param glovesId
+	 * @param bootsId
+	 * @return
+	 */
+	private static boolean isValidArmor(ArmorSet set, int pantsId, int bodyId, int helmetId, int glovesId, int bootsId)
+	{
+		if(pantsId != set.getPantsId())
+			return false;
+		if(bodyId != set.getBodyId())
+			return false;
+		if(helmetId != set.getHelmetId())
+			return false;
+		if(glovesId != set.getGlovesId())
+			return false;
+		if(bootsId != set.getBootsId())
+			return false;
+		
+		return true;
+	}
+	
+}

 

 

Den to kano adapt gia allo l2jinterlude project giati brazil, equal, archid, teon kai den ksero ego ti alla skata einai ola projects gia klamata. Epatha otan eida ton kodika tou l2jbrazil. Oi developers tou L2JBrazil einai GIA TA KLAMATA ! Den exoun idea pos na grapsoun kodika. To leo dimosia na to akousoun metadoste to :)

 

 

Tora gia to share:

 

Prostheteis armor sets sto simeio pou grafei :

 

+ //Add your custom armor sets here. A player must have

+ //one of these sets equiped to retain his buffs onDie.

+ armorSets.add(new ArmorSet(123, 234, 2356, 3456, 456));

+ armorSets.add(new ArmorSet(1234, 234, 2356, 3456, 4556));

+ armorSets.add(new ArmorSet(123, 2384, 2356, 34536, 456));

 

Exo balei 3 tixea armor sets ta bgazete kai bazete ta dika sas. Gia na kratisei kapios ta buffs prepei na foraei ena set apo tin lista pou tha ftiaksete. I seira me tin opia mpenoun ta ID fenete ston constructor: ArmorSet(int _bootsId, int _pantsId, int _bodyId, int _glovesId, int _helmetId).

 

As to testarei kapios an to perasei giati ego den ixa interlude na ot testaro.

esy ti project proteineis?

Posted

alo ti "protino" allo ti einai kalo. Ayti ti stigmi ayta ta project iparxoun ti na kanoume. Den einai kala, den exoun kalous developers ( poso malon exoun poli poli kakous developers apo ta liga pragmata pou ida sto brazil ). Alla ti na kanoume etsi einai :)

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.


×
×
  • Create New...