Jump to content

Question

Posted

Καλημερα, εχω ενα προβλημα με εναν κωδικα που εχω περασει στο Eclipse , εχω βαλει οταν κανει sub ο παιχτης να του βγαινουν armor,weapon αλλα το προβλημα ειναι οτι δεν κανει update το inventory...

 

Οριστε ο κωδικας :

 

					if(allowAddition)
				{
					String className = CharTemplateTable.getClassNameById(paramOne);

					if(!player.addSubClass(paramOne, player.getTotalSubClasses() + 1))
					{
						player.sendMessage("The sub class could not be added.");
						player.setLocked(false);
						return;
					}

					int[] armorType = { Inventory.PAPERDOLL_RHAND, Inventory.PAPERDOLL_LHAND, Inventory.PAPERDOLL_LRHAND, Inventory.PAPERDOLL_LRHAND,
						Inventory.PAPERDOLL_CHEST, Inventory.PAPERDOLL_HEAD,
						Inventory.PAPERDOLL_LEGS, Inventory.PAPERDOLL_GLOVES,
						Inventory.PAPERDOLL_FEET, Inventory.PAPERDOLL_BACK};
					for (int items : armorType)
					{
						L2ItemInstance parmorInstance = player.getInventory().getPaperdollItem(items);
						if (parmorInstance != null)
							player.getInventory().unEquipItemInSlot(items);
					}
					player.broadcastPacket(new InventoryUpdate());
					player.setActiveClass(player.getTotalSubClasses());

					if(Config.CHECK_SKILLS_ON_ENTER && !Config.ALT_GAME_SKILL_LEARN)
					{
						player.checkAllowedSkills();
					}

Recommended Posts

  • 0
Posted

kala tha eitane na rwtouses kai to error auto sto l2jfrozen Forum. mpas kai 3eroune auti kalitera. afou einai to code gia l2j frozen logika 3eroune.

  • 0
Posted

akiro telios auto p les , bump

Απλά δεν το κατάλαβες!

Τέσπα, στείλε μου σε ΠΜ τον κώδικα όπως ακριβώς τον έχεις.

Όχι μόνο αυτό που έχεις εδώ.

  • 0
Posted

   public synchronized boolean setActiveClass(int classIndex)
   {
+      L2ItemInstance chest = getInventory().getPaperdollItem(Inventory.PAPERDOLL_CHEST);
+      if (chest != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(chest.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      
+      L2ItemInstance head = getInventory().getPaperdollItem(Inventory.PAPERDOLL_HEAD);
+      if (head != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(head.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      
+      L2ItemInstance gloves = getInventory().getPaperdollItem(Inventory.PAPERDOLL_GLOVES);
+      if (gloves != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(gloves.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      
+      L2ItemInstance feet = getInventory().getPaperdollItem(Inventory.PAPERDOLL_FEET);
+      if (feet != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(feet.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      
+      L2ItemInstance legs = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEGS);
+      if (legs != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(legs.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      
+      L2ItemInstance rhand = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RHAND);
+      if (rhand != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(rhand.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      
+      L2ItemInstance lhand = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LHAND);
+      if (lhand != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(lhand.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      L2ItemInstance lear = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LEAR);
+      if (lhand != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(lear.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      L2ItemInstance rear = getInventory().getPaperdollItem(Inventory.PAPERDOLL_REAR);
+      if (lhand != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(rear.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      L2ItemInstance neck = getInventory().getPaperdollItem(Inventory.PAPERDOLL_NECK);
+      if (lhand != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(neck.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      L2ItemInstance lfinger = getInventory().getPaperdollItem(Inventory.PAPERDOLL_LFINGER);
+      if (lhand != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(lfinger.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      L2ItemInstance rfinger = getInventory().getPaperdollItem(Inventory.PAPERDOLL_RFINGER);
+      if (lhand != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(rfinger.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }
+      L2ItemInstance under = getInventory().getPaperdollItem(Inventory.PAPERDOLL_UNDER);
+      if (lhand != null)
+      {
+         
+            L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(under.getItem().getBodyPart());
+            InventoryUpdate iu = new InventoryUpdate();
+            for (L2ItemInstance element : unequipped)
+               iu.addModifiedItem(element);
+            sendPacket(iu);
+         
+      }

 

vale afto egw to ekana kai test kai eianai ok..

 

ed: soz den eida to new reply :)

  • 0
Posted

αφού δεν το κάνει update λείπει λογικά το player.getInventory().update();

 

βάλτω κάτω από αυτό player.getInventory().unEquipItemInSlot(items);

  • 0
Posted

mia pio pro ekdosh tou parapanw kodika

public synchronized boolean setActiveClass(int classIndex)
{
+int[] armorType = 	
+{
+	Inventory.PAPERDOLL_RHAND, Inventory.PAPERDOLL_LHAND,
+	Inventory.PAPERDOLL_LRHAND, Inventory.PAPERDOLL_LRHAND,
+	Inventory.PAPERDOLL_CHEST, Inventory.PAPERDOLL_HEAD,
+	Inventory.PAPERDOLL_LEGS, Inventory.PAPERDOLL_GLOVES,
+	Inventory.PAPERDOLL_FEET, Inventory.PAPERDOLL_BACK,
+	Inventory.PAPERDOLL_DHAIR, Inventory.PAPERDOLL_HAIR,
+	Inventory.PAPERDOLL_LEAR, Inventory.PAPERDOLL_REAR,
+	Inventory.PAPERDOLL_RFINGER, Inventory.PAPERDOLL_LFINGER,
+	Inventory.PAPERDOLL_NECK, Inventory.PAPERDOLL_UNDER
+};
+
+for (int items : armorType)
+{
+	L2ItemInstance parmorInstance = getInventory().getPaperdollItem(items);
+	if (parmorInstance != null)
+	{
+		L2ItemInstance[] unequipped = getInventory().unEquipItemInBodySlotAndRecord(parmorInstance.getItem().getBodyPart());
+		InventoryUpdate iu = new InventoryUpdate();
+		for (L2ItemInstance element : unequipped)
+		iu.addModifiedItem(element);
+		sendPacket(iu);
+		}
+	}

Guest
This topic is now closed to further replies.


  • Posts

    • We can help your Telegram group or channel grow fast with real, targeted Telegram members, safely and efficiently.   Our Telegram Member Add service lets you add members to Telegram group or channel from real, active communities — not bots or fakes.   With this Telegram group growth service, you’ll see results within hours, backed by clear reporting and safe automation.   ✅ What We Offer   • Done-for-you Telegram Member Add campaigns (Groups · Channels) • Targeted Telegram members from real, active users • Fast growth — up to 10K members in 24 hours • English-speaking or regional audiences (US · UK · EU) • Fully managed Telegram channel growth service with reports & analytics   💡 Why Choose Us   We don’t use spam or fake accounts. Our process safely adds members to your Telegram group or channel through verified multi-account setups, proxy rotation, and opt-out compliance. This ensures lasting growth and minimizes churn. Every campaign is managed by experts using tested Telegram infrastructure and growth systems. We also recommend combining Member Add with Telegram Mass DM for better engagement and retention after join.   🧩 Works Best For   • Businesses or communities launching new Telegram channels • Crypto, SaaS, and marketing projects needing visibility • Influencers and agencies growing multiple Telegram groups • Anyone seeking a reliable Telegram group growth service with real members 📩 To Get More Information   Telegram : @TeleLoopPulse   Website : https://telegramgrowthstudio.com/telegram-member-add.html
    • well,its SharedCreatureData.h problem.   /* 0398 */ //WCHAR m_sResurrectSpellerName[25];   this variable will cause L2server.exe crash...  
    • Custom High Five server L2insolence will open 2025-10-17 21:00 GMT+2 ! ! ! Web site: http://www.l2insolence.eu All info updates on Discord: https://discord.gg/duMjnj3y9A Last wipe was more then 1 year ago. We have custom skill, farm zones, materials for items to buy. Custom wepons, armor, jewels and more. All items in game have own stats. With custom looks. Glowing etc. Rates XP, SP: 25x Spoil and Drop: 10x Adena: 20x Server Hard Farm Enchantment Safe enchant Weapon: +20099 Safe enchant Armor: +20099 Max enchant Weapon: +20099 Max enchant Armor: +20099 Normal scrolls: 100% Blessed scrolls: 100% You can use scrolls or item enchant NPC to make +++ abd life beter. NPC Buffer There's an NPC buffer in all of our main towns: Aden, Giran and Goddard. It supplies Prophet Buffs, Songs and Dances for a small fee. Include all buff. We have custom self buffs learned with npc with custom stats. Global Gatekeeper GM Shop with normal items and custom ones, vote NPC, Event NPC, item upgrader NPC. Raid Bosses, every zone have its own boss and drops for rare mats. Olympiad The olympiad is ongoing every two weeks. Meaning if you become a hero you will have your hero status for two weeks. And hero have own custom stats on items.
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock