Jump to content
  • 0

[Request] for l2j developers


<< Masterio >>

Question

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.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

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
Answer this question...

×   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...

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