Jump to content
  • 0

[Help] Code Npc Enchant


Question

Posted

Psaxnw ena code na perasw se l2jfrozen pou to opoio na poulaei kapoio weapon h armor pou 8a to exw ka8orisei egw to poso enchant 8a einai kai na dinei ena allo weapon h armor  sto idio enchant.

An mporei na me help kapios 8a to ektimousa para polu.

5 answers to this question

Recommended Posts

  • 0
Posted

Ένας φίλος μου είχε βοηθήσει κάποιον με το ίδιο request.

 

Index: /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/network/serverpackets/MultiSellList.java
===================================================================
--- /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/network/serverpackets/MultiSellList.java (revision 24)
+++ /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/network/serverpackets/MultiSellList.java (revision 71)
@@ -119,5 +119,5 @@
                else
                {
-                   writeH(0x00); // enchant level
+                   writeH(ing.getEnchantLevel()); // enchant level
                    writeD(0x00); // augment id
                    writeD(0x00); // mana
@@ -154,5 +154,5 @@
                else
                {
-                   writeH(0x00); // enchant level
+                   writeH(ing.getEnchantLevel()); // enchant level
                    writeD(0x00); // augment id
                    writeD(0x00); // mana
Index: /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/model/multisell/PreparedEntry.java
===================================================================
--- /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/model/multisell/PreparedEntry.java (revision 24)
+++ /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/model/multisell/PreparedEntry.java (revision 71)
@@ -72,5 +72,5 @@
        adenaA-beep-t += _taxA-beep-t; // do not forget tax
        if (adenaA-beep-t > 0)
-           _ingredients.add(new Ingredient(ADENA_ID, adenaA-beep-t, false, false));
+           _ingredients.add(new Ingredient(ADENA_ID, adenaA-beep-t,0, false, false));
        
        // now copy products
Index: /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/model/multisell/Ingredient.java
===================================================================
--- /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/model/multisell/Ingredient.java (revision 24)
+++ /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/model/multisell/Ingredient.java (revision 71)
@@ -30,4 +30,5 @@
    private int _itemId;
    private long _itemCount;
+    private int _EnchantmentLevel;
    private boolean _isTaxIngredient, _maintainIngredient;
    
@@ -35,8 +36,9 @@
    private ItemInfo _itemInfo = null;
    
-   public Ingredient(int itemId, long itemCount, boolean isTaxIngredient, boolean maintainIngredient)
+   public Ingredient(int itemId, long itemCount,int EnchantmentLevel, boolean isTaxIngredient, boolean maintainIngredient)
    {
        _itemId = itemId;
        _itemCount = itemCount;
+       _EnchantmentLevel = EnchantmentLevel;
        _isTaxIngredient = isTaxIngredient;
        _maintainIngredient = maintainIngredient;
@@ -80,5 +82,5 @@
    public final int getEnchantLevel()
    {
-       return _itemInfo != null ? _itemInfo.getEnchantLevel() : 0;
+            return _itemInfo == null?_EnchantmentLevel:_itemInfo.getEnchantLevel();
    }
    
Index: /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/datatables/MultiSell.java
===================================================================
--- /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/datatables/MultiSell.java (revision 52)
+++ /trunk/L2J_Gameserver/java/com/l2jserver/gameserver/datatables/MultiSell.java (revision 71)
@@ -270,4 +270,8 @@
            if ("ingredient".equalsIgnoreCase(n.getNodeName()))
            {
+               int enchantmentLevel = 0;
+               if (n.getAttributes().getNamedItem("enchantmentLevel") != null)
+               enchantmentLevel = Integer.parseInt(n.getAttributes().getNamedItem("enchantmentLevel").getNodeValue());
+               
                int id = Integer.parseInt(n.getAttributes().getNamedItem("id").getNodeValue());
                long count = Long.parseLong(n.getAttributes().getNamedItem("count").getNodeValue());
@@ -286,12 +290,16 @@
                    mantainIngredient = false;
                
-               entry.addIngredient(new Ingredient(id, count, isTaxIngredient, mantainIngredient));
+               entry.addIngredient(new Ingredient(id, count, enchantmentLevel, isTaxIngredient, mantainIngredient));
            }
            else if ("production".equalsIgnoreCase(n.getNodeName()))
            {
+               int enchantmentLevel = 0;
+               if (n.getAttributes().getNamedItem("enchantmentLevel") != null)
+               enchantmentLevel = Integer.parseInt(n.getAttributes().getNamedItem("enchantmentLevel").getNodeValue());
+               
                int id = Integer.parseInt(n.getAttributes().getNamedItem("id").getNodeValue());
                long count = Long.parseLong(n.getAttributes().getNamedItem("count").getNodeValue());
                
-               entry.addProduct(new Ingredient(id, count, false, false));
+               entry.addProduct(new Ingredient(id, count, enchantmentLevel, false, false));
            }
        }

 

Βάλε αυτόν τον κώδικα στον πηγαίο κώδικα και στο multisell βάλε αυτήν την γραμμή :

 

<production id="15572" count="1" enchantmentLevel="25"/>

 

Εκεί που είναι 25 είναι το πόσο + θέλεις να δώσει το item.

 

Ελπίζω να σε βοήθησα!

 

Edit : υπάρχει περίπτωση να χρειαστεί να κάνεις μερικές αλλαγές στον κώδικα γιατί είναι για άλλο client όπως μπορείς να δεις.

Guest
This topic is now closed to further replies.


  • Posts

    • Introducing: Cloud Hosting and Stream Rewards!   Hey everyone, I'm excited to share something big on top of the recent NimeraCP V2 update I announced a few days ago. We're introducing Cloud Hosting and Stream Rewards!   Starting at 30 euros per month, subscribing to NimeraCP will give you access to deploy your own instance directly through your dashboard on nimeracp.com. This is a huge upgrade for our ecosystem, offering a much more affordable option than self-hosting and simplifying the entire installation process. No more wasting hours setting things up, buying separate dedicated hosts or VPSs, just deploy on our infrastructure and relax.     Currently these packs are available for Cloud Hosting:   aCis r382 aCis r401 aCis r409 L2Scripts Vanguard   More are coming soon as development progresses. If you need your pack to be added, please reach out to us.   On top of that, we've rolled out an update that introduces Stream Rewards. Now, players can link their Kick, Twitch or Trovo accounts to NimeraCP, stream, and earn rewards. Admins can create reward campaigns, set a required streaming time, and when a streamer meets the requirements, they can instantly transfer the reward to their game character.     As I mentioned in our last update, big things are coming, and this is just the beginning.   Best, Splicho
    • There were a few minor hiccups along the way, but the problem was eventually resolved. Overall, he is a very experienced, skilled, and trustworthy developer, and I will definitely continue to use his services in the future. thank yuo .   this topic can be locked please . thank you  
    • 99.99% of the people you 'sell' this to will not see any meaning on any sort of code, as simple or complicated as it may be, so i suggest the video. would be much better for practical reasons. good luck though
    • I've completely decompiled, replicated, and devirtualized the Gamear DLL file. You can see it there; otherwise, wait a day or two and I'll make a video myself. Best regards. static int __fastcall hkAEmitter_Tick_Impl(void* this_, void* /*edx*/, float dt, int levelTick) {     // Ares: if (IsA(this, AEmitter))     if (this_ && g_UClass_Emitter && GX_IsA(this_, g_UClass_Emitter))     {         // Ares: v7 = sub_1300CAA0()         void* v7 = g_localPawn;         if (v7)         {             // Ares: if IsA(v7, APawn) && lvl in (0,8)             if (g_UClass_APawn && GX_IsA(v7, g_UClass_APawn))             {                 const int lvl = (int)InterlockedCompareExchange((volatile LONG*)&g_skipLevel, 0, 0);                 if (lvl > 0 && lvl < 😎                 {                     // Ares: v6 = sub_13026800(this, v7)                     const float v6 = GX_Distance3D(this_, v7);                     // Live-tuning (debug): aplica overrides en runtime                     GX_LiveApply_Tick(this_, v6); Today I'll see how the classic client works on the Eris server. If it works well, I'll proceed to decompile the dll for classic as well. GG.. 🙂
  • 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..