Jump to content

Question

Posted

Hello, Few day's ago tried to make some changes in achievements engine, which is shared in this forum, As you know it's data is in .xml file.

 

Here it is:

+ <list>
+ <achievement id="1" name="Champion" description="Player level 80" reward="9142,5" minLevel="80"/>
+ <achievement id="2" name="Hero" description="player hero status" reward="9142,10" mustBeHero="true"/>
+ <achievement id="3" name="Noble" description="Player noblesse status" reward="9142,10" mustBeNoble="true"/>
+ <achievement id="4" name="Weapon" description="Enchant a weapon min + 20" reward="9142,15" minWeaponEnchant="16" />
+ <achievement id="5" name="Pvp's" description="Need 1,000 PvPs" reward="9142,15" minPvPCount="1000"/>
+ <achievement id="6" name="Leader" description="Be a clan leader" reward="9142,10" mustBeClanLeader="true"/>
+ <achievement id="7" name="Pk's" description="Need 1,000 Pks" reward="9142,15" minPkCount="1000"/>
+ <achievement id="8" name="Craft" description="Event Medal" reward="9142,15" itemAmmount="6392,200"/>
+ <achievement id="9" name="Comander" description="Be clan leader of a clan level 8" reward="9142,10" minClanLevel="8" mustBeClanLeader="true"/>
+ <achievement id="10" name="You Life" description="Max HP,CP,MP" reward="9142,10" maxHP="1000" maxMP="1000" maxCP="1000"/>
+ <achievement id="11" name="Karma Player" description="Min Karma" reward="9142,5" minKarmaCount="100"/>
+ <achievement id="12" name="Adena Player" description="Min adena cout" reward="9142,5" minAdenaCount="100"/>
+ <achievement id="13" name="Player In Clan" description="Min player clan" reward="9142,5" minClanMembersCount="1"/>
+ <achievement id="14" name="Achievements" description="Complete all personal achievements" reward="9142,40" CompleteAchievements="18"/>
+ <achievement id="15" name="Reputation Clan" description="Reputation in his clan" reward="9142,5" crpAmmount="100"/>
+ <achievement id="16" name="Leader Of Clan" description="Ter Castle" reward="9142,5" lordOfCastle="true"/>
+ <achievement id="17" name="Mage Class" description="Mage Class" reward="9142,5" mustBeMageClass="true"/>
+ <achievement id="18" name="Slayer" description="Kill Boss and be level 80" reward="9142,5" raidToKill="77771" minLevel="80" />
+ <achievement id="19" name="Skills" description="Have a +10 skill" reward="9142,15" minSkillEnchant="10"/>
+ <achievement id="20" name="SubClasses" description="Have 1 subclasses" reward="9142,5" minSubclassCount="1"/>
+ <achievement id="21" name="Gamer" description="Be online for 1 days" reward="9142,10" minOnlineTime="1"/>
+ <achievement id="22" name="Cursed" description="Cursed Weapon" reward="9142,10" Cursedweapon="true"/>
+ <achievement id="23" name="Armor" description="Complete the enchantment of armor" reward="9142,10" minHeadEnchant="16" minChestEnchant="16" minFeetEnchant="16" minLegsEnchant="16" minGlovestEnchant="16"/>
+ <achievement id="24" name="Married" description="Getting married in the game" reward="9142,10" mustBeMarried="true"/>
+ <achievement id="25" name="Vip" description="Become a VIP player" reward="9142,10" mustBeVip="true"/>
+ </list>
 
I wanted to make extra attribute where is name of character, who first finished it. for example
 <achievement id="1" name="Champion" description="Player level 80" reward="9142,5" minLevel="80" firstFinished="Gam3Master"/>
 
If it is not yet finished attribute must be firstFinished=""
 
So I googled and searched for methods where I can modify xml file and did not get any result, everything was too hard for me.
 
I saw also AnnouncementTable.java(aCis), I knew that where is similar method 
 
 
public void delAnnouncement(int index)
{
// Stop the current task, if any.
_announcements.remove(index).stopTask();
 
// Regenerate the XML.
regenerateXML();
}
 
But as I see it deletes all information and creates a new one.
 
Can anyone help me to make it?
 
Thanks in advance.

3 answers to this question

Recommended Posts

  • 0
Posted

That's the point of xml and using it for static stuff. There is no way to edit a tag without loading the file and saving it. Even the proper way to do it is fat (probably fatter than to build a string from already mapped content, for loop and write it into a new file) :

 

http://stackoverflow.com/questions/31693670/how-to-update-xml-files-in-java

 

You probably have specialized XML library out there to handle any case, but I won't add that for a single use.

 

If you don't use it often, reproduce regenerateXml() behavior.

  • 0
Posted

If there is no way to edit that's mean I have to change it's info from XML to sql I guess....

Anyway thanks for help....

 

Close the topic

Guest
This topic is now closed to further replies.


  • Posts

    • That’s just part of buying and selling; if your service didn't appeal to me at the time, there's no reason for me to force myself to buy it. After all, I regularly buy other interfaces and clients from other users mostly Russians using USDT. But *I'm* the child here, even though *you're* the incredibly arrogant one.   The payment method or the amounts were never the problem you were. But life goes on; you’d rather stay caught up in your delusions, thinking you’re the protagonist of some anime. Princess Alice 😂   I have all the interfaces for the 474/506/509/520/542/563/557. and olds too.  Some were created by me, including the ARENA P140 interface, which will soon be released for free. This includes everything you make available. It will no longer be a monopoly held by just a few people.   Including your clients with system. like  
    • NEW: Ryzen 9 9950X VPS now Available! Our most Powerful VPS plans now available with dedicated Zen 5 cores clocked up to 5.7 GHz, DDR5 ECC, blazing NVMe Gen4 storage (~7 GB/s), 10 Gbit/s uplink with up to 50 TB traffic, and premium Anti-DDoS included on every plan. No KYC, crypto payments accepted, deployed in minutes. ⭐ RYZEN 9 9950X VPS: [ 9.99 ] 2vCore | 6GB DDR5 | 30GB NVMe - DEPLOY [ 19.99 ] 4vCore | 12GB DDR5 | 50GB NVMe - DEPLOY [ 39.99 ] 8vCore | 24GB DDR5 | 80GB NVMe - DEPLOY [ 69.99 ] 12vCore | 48GB DDR5 | 120GB NVMe - DEPLOY - 10 Gbit/s Port included in ALL Plans - Premium Anti-DDoS included in ALL Plans - No-KYC signup, crypto payments accepted ✅ Ryzen 9 9950X VPS ( vpslab.cloud )
    • I thiunk RU Federation having issues now with paypal?
    • 👑 [FOR SALE] Lineage 2 Premium UCP – Modern Web Panel with Progression & Reward Systems. Looking for the ultimate edge to make your server boom and boost revenue? Introducing the L2 Premium UCP—the most comprehensive and modern User Control Panel on the market. Developed with a total focus on player experience (UX) and administrative automation. Say goodbye to outdated, buggy panels. Give your server the look and feel of an official game!  
  • 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..