Jump to content

[Discussion]Κάντε request java mods


Recommended Posts

Είναι αυτό για interlude;

Για αυτό έκανα request εδώ.

Αν δεν είναι για interlude μπορεί με simple changes  να γίνει;

μπορει να γινει με απλες αλλαγες , περασε το και δες αν εχει problem πουθενα.
Link to comment
Share on other sites

Δεν μπορώ να βρω καν που να το βάλω, τα codes που μου λέει καν δεν υπάρχουν

                // Don't allow hero equipment and restricted items during Olympiad
-                if (activeChar.isInOlympiadMode() && (item.isHeroItem() || item.isOlyRestrictedItem()))
+                if (activeChar.isInOlympiadMode() && (item.isHeroItem() || item.isOlyRestrictedItem() ||
+                		activeChar.getActiveWeaponItem().getCrystalType() == L2Item.CRYSTAL_S))

 

Link to comment
Share on other sites

Δεν μπορώ να βρω καν που να το βάλω, τα codes που μου λέει καν δεν υπάρχουν

                // Don't allow hero equipment and restricted items during Olympiad
-                if (activeChar.isInOlympiadMode() && (item.isHeroItem() || item.isOlyRestrictedItem()))
+                if (activeChar.isInOlympiadMode() && (item.isHeroItem() || item.isOlyRestrictedItem() ||
+                		activeChar.getActiveWeaponItem().getCrystalType() == L2Item.CRYSTAL_S))

Στο UseItem.java βαλε κατω απο εδω:

if(item == null)
		return;

 

αυτο

if (activeChar.isInOlympiadMode() && (item.isHeroItem() || item.isOlyRestrictedItem() ||
    activeChar.getActiveWeaponItem().getCrystalType() == L2Item.CRYSTAL_S))
                 return;

Link to comment
Share on other sites

 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.templates.StatsSet;
import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
+import com.l2jserver.gameserver.templates.item.L2Item;
import com.l2jserver.util.L2FastList;


@@ -269,6 +270,38 @@
				}

				player.checkItemRestriction();
+				
+				int weaponGrade = player.getActiveWeaponItem().getCrystalType();
+				if (weaponGrade == L2Item.CRYSTAL_S)
+				{
+		        	L2ItemInstance[] unequipped = player.getInventory().unEquipItemInBodySlotAndRecord(weaponGrade);
+		            InventoryUpdate iu = new InventoryUpdate();
+		            for (L2ItemInstance element : unequipped)
+						iu.addModifiedItem(element);
+		            player.sendPacket(iu);
+		            player.abortAttack();
+		            player.broadcastUserInfo();
+		            
+		            // this can be 0 if the user pressed the right mousebutton twice very fast
+		            if (unequipped.length > 0)
+		            {
+		                if (unequipped[0].isWear())
+		                    return;
+		                SystemMessage sm = null;
+		                if (unequipped[0].getEnchantLevel() > 0)
+		                {
+		                    sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
+		                    sm.addNumber(unequipped[0].getEnchantLevel());
+		                    sm.addItemName(unequipped[0]);
+		                }
+		                else
+		                {
+		                    sm = new SystemMessage(SystemMessageId.S1_DISARMED);
+		                    sm.addItemName(unequipped[0]);
+		                }
+		                player.sendPacket(sm);
+		            }
+		        }

				// Remove shot automation
				player.disableAutoShotsAll();

To import είναι αυτό;

import net.sf.l2j.gameserver.model.L2ItemInstance;

Και το αρχείο java είναι αυτό;

net.sf.l2j.gameserver/Olympiad;

 

Link to comment
Share on other sites

 import com.l2jserver.gameserver.network.serverpackets.SystemMessage;
import com.l2jserver.gameserver.templates.StatsSet;
import com.l2jserver.gameserver.templates.chars.L2NpcTemplate;
+import com.l2jserver.gameserver.templates.item.L2Item;
import com.l2jserver.util.L2FastList;


@@ -269,6 +270,38 @@
				}

				player.checkItemRestriction();
+				
+				int weaponGrade = player.getActiveWeaponItem().getCrystalType();
+				if (weaponGrade == L2Item.CRYSTAL_S)
+				{
+		        	L2ItemInstance[] unequipped = player.getInventory().unEquipItemInBodySlotAndRecord(weaponGrade);
+		            InventoryUpdate iu = new InventoryUpdate();
+		            for (L2ItemInstance element : unequipped)
+						iu.addModifiedItem(element);
+		            player.sendPacket(iu);
+		            player.abortAttack();
+		            player.broadcastUserInfo();
+		            
+		            // this can be 0 if the user pressed the right mousebutton twice very fast
+		            if (unequipped.length > 0)
+		            {
+		                if (unequipped[0].isWear())
+		                    return;
+		                SystemMessage sm = null;
+		                if (unequipped[0].getEnchantLevel() > 0)
+		                {
+		                    sm = new SystemMessage(SystemMessageId.EQUIPMENT_S1_S2_REMOVED);
+		                    sm.addNumber(unequipped[0].getEnchantLevel());
+		                    sm.addItemName(unequipped[0]);
+		                }
+		                else
+		                {
+		                    sm = new SystemMessage(SystemMessageId.S1_DISARMED);
+		                    sm.addItemName(unequipped[0]);
+		                }
+		                player.sendPacket(sm);
+		            }
+		        }

				// Remove shot automation
				player.disableAutoShotsAll();

To import είναι αυτό;

import net.sf.l2j.gameserver.model.L2ItemInstance;

Και το αρχείο java είναι αυτό;

net.sf.l2j.gameserver/Olympiad;

Κοιτα την μεθοδο που σου εχει σε πιο import ειναι και θα σου βγαλει αυτοματη επιδιορθωση το eclipse.

Link to comment
Share on other sites

Κοιτα την μεθοδο που σου εχει σε πιο import ειναι και θα σου βγαλει αυτοματη επιδιορθωση το eclipse.

Όταν λες την μέθοδο;

net.sf.l2j;

Link to comment
Share on other sites

καλησπέρα σε όλους,

 

Θα ήθελα έναν κώδικα (με κώδικα μου είπαν πως θα δουλέψει μόνο)

Έτσι ώστε ήττε με τα Enchant Scrolls που έχουμε ήδη ήττε να φτιάξουμε ένα νέο Scroll (δεν υπάρχει θέμα) να μπορεί να γίνετε Enchant από ένα συγκεκριμένο Enchant Level σε ένα άλλο αλλά με πιθανότητες που θα μπορώ να ορίσω εγώ από τα configs (για περισσότερες δοκιμές κυρίως) 

 

Ευχαριστώ εκ των πρωτέρων!!!

 

Index: java/net/sf/l2j/gameserver/handler/itemhandlers/EnchantScrolls.java
===================================================================
--- java/net/sf/l2j/gameserver/handler/itemhandlers/EnchantScrolls.java	(revision 5343)
+++ java/net/sf/l2j/gameserver/handler/itemhandlers/EnchantScrolls.java	(working copy)
@@ -35,6 +35,7 @@
         951, 952, 953, 954, 6573, 6574, // c grade
         955, 956, 957, 958, 6575, 6576, // d grade
         959, 960, 961, 962, 6577, 6578  // s grade
+        , 65535
	};


Index: java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java
===================================================================
--- java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java	(revision 5343)
+++ java/net/sf/l2j/gameserver/clientpackets/RequestEnchantItem.java	(working copy)
@@ -206,6 +206,34 @@
                 || (item.getItem().getBodyPart() == L2Item.SLOT_FULL_ARMOR
                         && item.getEnchantLevel() < Config.ENCHANT_SAFE_MAX_FULL))
             chance = 100;
+        
+        if (scroll.getItemId() == 65535)
+        {
+        	int NEEDED_ENCHANT_LEVEL = 10,
+        		MAX_ENCHANT_LEVEL = 16,
+        		CHANCE_WEAPON = 80,
+        		CHANCE_ARMOR = 80,
+        		CHANCE_JEWEL = 80;
+        	
+        	if (item.getEnchantLevel() < NEEDED_ENCHANT_LEVEL || item.getEnchantLevel() > MAX_ENCHANT_LEVEL)
+        	{
+        		activeChar.sendMessage("You can only enchant with this scroll from +"+NEEDED_ENCHANT_LEVEL+" to +"+MAX_ENCHANT_LEVEL+".");
+        		return;
+        	}
+        	
+        	if (item.getItem().getType2() == L2Item.TYPE2_WEAPON)
+        	{
+        		chance = CHANCE_WEAPON;
+        	}
+        	if (item.getItem().getType2() == L2Item.TYPE2_SHIELD_ARMOR)
+        	{
+        		chance = CHANCE_ARMOR;
+        	}
+        	if (item.getItem().getType2() == L2Item.TYPE2_ACCESSORY)
+        	{
+        		chance = CHANCE_JEWEL;
+        	}
+        }

         if (Rnd.get(100) < chance)
         {

 

Prepei na work. Opou 65535 antikatestise to me to item id apo to custom scroll sou.

 

ξέχασες μου φαίνεται το item.getEnchantLevel()+1 κάτω από κάθε chance,γιατί έτσι δεν κάνει enchant από ότι βλέπω..;)

 

Θέλει τελικά Edit? δεν μου απάντησε κάποιος :(

Και έχω pack Frozen να πω γιατί το ξέχασα τελείως....

Link to comment
Share on other sites

me to command .away otan patas CTRL + ALT + DEL kai kluneis to Lineage 2

kai trws critical error otan mpeneis mesa sto game exeis Kokkino Name Kai Title color

ean mporeis fixaretw

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.



×
×
  • Create New...