Jump to content
  • 0

[Request] for l2j developers


Question

Posted

Hi a have request for java developers.

How to get this red value (pAtk of weapon) from java side.

I  created instance i checked stats funcs etc and i can't obtain this value.

<item id="4700" type="Weapon" name="Sword of Delusion - Health">

<set name="icon" val="icon.weapon_sword_of_delusion_i01" />

<set name="default_action" val="equip" />

<set name="weapon_type" val="sword" />

<set name="bodypart" val="rhand" />

<set name="random_damage" val="10" />

<set name="attack_range" val="40" />

<set name="damage_range" val="0;0;40;120" />

<set name="immediate_effect" val="1" />

<set name="crystal_count" val="1322" />

<set name="crystal_type" val="c" />

<set name="material" val="mithril" />

<set name="weight" val="1400" />

<set name="price" val="3304300" />

<set name="change_weaponId" val="9270" />

<set name="soulshots" val="3" />

<set name="spiritshots" val="3" />

<set name="enchant_enabled" val="1" />

<set name="item_skill" val="3013-1" />

<for>

<set order="0x08" stat="pAtk" val="139" />

<set order="0x08" stat="mAtk" val="76" />

<set order="0x08" stat="rCrit" val="8" />

<set order="0x08" stat="pAtkSpd" val="379" />

<enchant val="0" order="0x0C" stat="pAtk" />

<enchant val="0" order="0x0C" stat="mAtk" />

</for>

</item>

 

I wrote something like this for tests:

for(int i = 0; i<activeChar.getInventory().getItems().length; i++){
			if(activeChar.getInventory().getItems()[i] != null){

					L2ItemInstance itemInstance = activeChar.getInventory().getItems()[i];
					L2Item item = ItemTable.getInstance().getTemplate(itemInstance.getItem().getItemId());

				try{	
					System.out.println("Item: "+item.getName()+", id: "+item.getItemId());
					System.out.println("Icon: "+item.getIcon());
					System.out.println("Body part: "+item.getBodyPart());

				}catch(Exception e){

				}

				System.out.println("Effects: "+item.getEffects(itemInstance, activeChar).length);
				for(int j = 0; j<item.getEffects(itemInstance, activeChar).length; j++){
					try{
						L2Effect effect = item.getEffects(itemInstance, activeChar)[j];
						if(effect != null){
							System.out.println(" Abnormal level:" + effect.getAbnormalLvl());
							System.out.println(" Abnormal Time:" + effect.getAbnormalTime());
							System.out.println(" Abnormal Type:" + effect.getAbnormalType());
							System.out.println(" Count:" + effect.getCount());
							System.out.println(" Effect Flags:" + effect.getEffectFlags());
							System.out.println(" Effect Power:" + effect.getEffectPower());
							System.out.println(" Force Effect:" + effect.getForceEffect());
							System.out.println(" Level:" + effect.getLevel());
							System.out.println(" Total Count:" + effect.getTotalCount());
							System.out.println(" Skill Name:" + effect.getSkill().getName());
						}	
					}catch(Exception e){

					}
				}

				System.out.println("StatFuncs: "+item.getStatFuncs(itemInstance, activeChar).length);
				for(int k = 0; k<item.getStatFuncs(itemInstance, activeChar).length; k++){
					try{
						Func f = item.getStatFuncs(itemInstance, activeChar)[k];
						Env env = new Env();
						env.setItem(itemInstance);

						System.out.println("  order:" +f.order+", stat[name]:"+f.stat.name()+", stat[value]:"+f.stat.getValue()+", stat[ordinal]:"+f.stat.ordinal()+", "+env.toString());
					}catch(Exception e){

					}
				}
				System.out.println("-------------------------------------------------------------------------------");
			}
		}

 

 

This code not obtain information about weapon pAtk/mAtk or Armor pDef/mDef.

 

Thanks for answer.

5 answers to this question

Recommended Posts

  • 0
Posted

try this

                        File f = new File(xml location file);
		InputSource in = new InputSource(new InputStreamReader(new FileInputStream(f), "UTF-8"));
		in.setEncoding("UTF-8");
		Document doc = factory.newDocumentBuilder().parse(in);

		for (Node n = doc.getFirstChild(); n != null; n = n.getNextSibling())
		{
			if (n.getNodeName().equalsIgnoreCase("for"))
			{
				for (Node d = n.getFirstChild(); d != null; d = d.getNextSibling())
				{
					if (d.getNodeName().equalsIgnoreCase("pAtk")){
                                                
}
					{

something  like this you get the data of .xml

  • 0
Posted

Stats.POWER_ATTACK, so far. But it's mixed stats, if you got let's say 2 items add/mul/sub patk it's modifying the value.

 

There is no getPatk() / pdef methods, you have to add them (edit parsing system, adding new variables on L2Weapon / L2Armor).

 

Marwan, I don't prefer to know the performance of parsing the file only to get patk value, lmao. Must be terrible.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


  • Posts

    • I created a system of FAKES to improve my GeoEngine, but I'm having problems with blocks. I've tried everything to fix it, but a block going from the inside out bugs the player's movement and freezes them. However, the reverse doesn't cause this bug. If I'm outside and click inside, the path is traced normally, but if it's reversed, it bugs at the fence. I've created several debugs and read all kinds of GeoEngine versions, but I haven't had any success. Can someone give me some insight into graphical data?   When fakes spawn, they are given possible routes, but they don't follow them. If there's a target, instead of following the correctly drawn path, it simply uses a straight line.  
    • The legendary L2Elixir you remember from 2008 is officially back — remastered, refreshed, and reborn! Our x3 Interlude server launched on 28 November, and the community is growing every single day.   🔥 Fresh start 🔥 Active players joining daily 🔥 Long-term project — Licensed for over 5 years from PlayINERA. 🔥 True 2008 nostalgia with modern stability & polish   If you were part of the original Elixir family, this is your chance to relive the magic. If you’re new — welcome to a classic Lineage II experience built with passion, not profit.   Join the battles. Join the nostalgia. Join L2Elixir Reborn. Website: https://l2elixir.org/ Discord: https://discord.gg/5ydPHvhbxs
    • still available?  java version? client  salvation?  accept smarguart¡?
    • 🎉 L2NeverPain StuckSub - GRAND OPENING 12 December 2025🎉 After beta, testing, mistakes, laughs and a lot of PvP, the moment has finally come. L2NeverPain StuckSub is officially opening its gates on 12 December 2025.   ⚔️What to expect: ✦Main Class +2 Stuck Sub system ✦Balanced PvP & custom party farm areas ✦Custom events, bosses and strong rewards ✦Competitive clan scene with castle rewards   📌Until the opening: ✦Create your clans and register them in the Clan-Register channel ✦Invite your friends / old parties / CPs ✦Stay tuned for more information (rates, events, siege times, etc.)   Get your setups ready, prepare your macros and your Discord/voice. On 12 December 2025 20:00 GMT+2, we write the first chapter of NeverPain together. 🔥 https://l2neverpain.com/ https://discord.gg/kNP3UXgkmN
  • 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