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

    • Good day! Due to the increasing number of questions, "Do you provide services for the client?" - I decided to answer with a separate topic. I provide services for editing/modifying the client and individual files, namely: 1. Transfer/Creation/Editing locations, geodata.   2. All kinds of work with NPCs, including transfer, animation, adding effects to them and logos.   3. Actually, Transfer/Creation/Edit any EFFECTS, including Abnormal Effects.   4. Any work with weapons, armor, accessories and everything related to it.   5. Create or edit textures, including dynamic textures.   6. Creating a Lobby Screen, Lobby Char Selection (character selection window) and Lobby Char Creation (character creation window). What I don't do: 1. Coding in any form (except for CB).   I started publishing my work recently, here - YouTube And here - RuTube If required, I respect confidentiality. Any other questions? Welcome to Telegram or PM.
    • 🎮https://discord.gg/yyVRtna9RB 🌎https://l2-forever.com L2 Forever was the best mid rates PvP server back in C4 and C5 and we want to give players the same experience with Interlude!   # L2-Forever * EXP: 50x * Adena: 200x * Spoil: 5x * Drops: 5x   # ENCHANTS *Safe Enchant : 3 *Max. Enchant : 20 *Normal Scroll chance : 65% *Blessed Scroll chance : 70%   # NEW PLAYERS * Start with Coupons allowing you to get free top D-grade * Start at level 20 * Main Town Giran Harbor   # BOOSTED AREA'S * Execution Grounds [ 20 - 40] * Cruma Tower [40-52] * Antharas Lair [52-61] * Antharas Heart [61-80] * Giran Harbor - Shopping Area   # END GAME FARMING AREAS * Monastery of Silence and Primeval Island customized for group farm # PLATINUM ARMORS * Platinum Armors get dropped by raids, allowing everyone to obtain a set and not only donators * Many Raids all over the L2 world drop parts of the Platinum Armors   # BUFFS * Buff duration is set at 1 hour for normal buffs (Buffs and Songs / Dances) * Town Buffers in all main towns with all available buffs Giran Harbor (GH) is the place to be for all your trades and item needs! Platinum Armors   # FOREVER ITEMS * Unique Forever weapons & armors # UNIQUE L2 FOREVER AUGMENTATION SYSTEM * We don't use retail augmentations, we use our own unique system and glows!   # OTHER CUSTOM FEATURES * Global Gatekeeper * NPC Class Changer * Auction House * Unique Augmenter * Subclass with Adena or from Cabrio * Nobless - Barakiel * Useless S weapon Special abilities like (Cheap shot) are changed
    • 🎮https://discord.gg/yyVRtna9RB 🌎https://l2-forever.com L2 Forever was the best mid rates PvP server back in C4 and C5 and we want to give players the same experience with Interlude!   # L2-Forever * EXP: 50x * Adena: 200x * Spoil: 5x * Drops: 5x   # ENCHANTS *Safe Enchant : 3 *Max. Enchant : 20 *Normal Scroll chance : 65% *Blessed Scroll chance : 70%   # NEW PLAYERS * Start with Coupons allowing you to get free top D-grade * Start at level 20 * Main Town Giran Harbor   # BOOSTED AREA'S * Execution Grounds [ 20 - 40] * Cruma Tower [40-52] * Antharas Lair [52-61] * Antharas Heart [61-80] * Giran Harbor - Shopping Area   # END GAME FARMING AREAS * Monastery of Silence and Primeval Island customized for group farm # PLATINUM ARMORS * Platinum Armors get dropped by raids, allowing everyone to obtain a set and not only donators * Many Raids all over the L2 world drop parts of the Platinum Armors   # BUFFS * Buff duration is set at 1 hour for normal buffs (Buffs and Songs / Dances) * Town Buffers in all main towns with all available buffs Giran Harbor (GH) is the place to be for all your trades and item needs! Platinum Armors   # FOREVER ITEMS * Unique Forever weapons & armors # UNIQUE L2 FOREVER AUGMENTATION SYSTEM * We don't use retail augmentations, we use our own unique system and glows!   # OTHER CUSTOM FEATURES * Global Gatekeeper * NPC Class Changer * Auction House * Unique Augmenter * Subclass with Adena or from Cabrio * Nobless - Barakiel * Useless S weapon Special abilities like (Cheap shot) are changed
    • DISCORD : utchiha_market telegram : https://t.me/utchiha_market SELLIX STORE : https://utchihamkt.mysellix.io/ Join our server for more products : https://discord.gg/uthciha-services https://campsite.bio/utchihaamkt
  • Topics

×
×
  • Create New...