Thread: [REQ] #129 Data .xml files please!

Results 1 to 7 of 7
  1. #1 [REQ] #129 Data .xml files please! 
    Banned
    Join Date
    Apr 2016
    Posts
    357
    Thanks given
    65
    Thanks received
    15
    Rep Power
    0
    Hello im looking for Vencillio

    ItemDefinitions.xml
    NpcDefinitions.xml

    Thanks if someone share these
    Reply With Quote  
     

  2. #2  
    Forum Moderator


    Join Date
    Jan 2009
    Posts
    5,294
    Thanks given
    1,026
    Thanks received
    3,045
    Rep Power
    5000
    Code:
            List<ItemDefinition> list = new ArrayList<>();
    
            for(i = 0; i < totalItems; i++) {
                ItemDef def = forID(i);
                if(def != null) {
                    ItemDefinition definition = new ItemDefinition();
    
                    definition.setId(i);
                    definition.setName(def.name == null ? "" : def.name);
                    definition.setNote(def.certTemplateID == 799);
                    definition.setNoteId(def.certID);
                    definition.setStackable(def.stackable);
                    definition.setTradable(true);
                    definition.setGeneralPrice(def.value);
                    definition.setHighAlch((int)Math.ceil(def.value * 0.75));
                    definition.setLowAlch((int)Math.ceil(def.value * 0.25));
    
                    list.add(definition);
                }
            }
    
            try {
                Files.write(Paths.get("definitions.xml"), new XStream().toXML(list).getBytes());
            } catch (IOException e) {
                e.printStackTrace();
            }
    Code:
    public class ItemDefinition {
    
        private int id;
        private String name;
        private boolean tradable;
        private boolean stackable;
        private boolean note;
        private int noteId;
        private int highAlch;
        private int lowAlch;
        private int generalPrice;
    
        public ItemDefinition() {
        }
    
        public int getId() {
            return id;
        }
    
        public void setId(int id) {
            this.id = id;
        }
    
        public String getName() {
            return name;
        }
    
        public void setName(String name) {
            this.name = name;
        }
    
        public boolean isTradable() {
            return tradable;
        }
    
        public void setTradable(boolean tradable) {
            this.tradable = tradable;
        }
    
        public boolean isStackable() {
            return stackable;
        }
    
        public void setStackable(boolean stackable) {
            this.stackable = stackable;
        }
    
        public boolean isNote() {
            return note;
        }
    
        public void setNote(boolean note) {
            this.note = note;
        }
    
        public int getNoteId() {
            return noteId;
        }
    
        public void setNoteId(int noteId) {
            this.noteId = noteId;
        }
    
        public int getHighAlch() {
            return highAlch;
        }
    
        public void setHighAlch(int highAlc) {
            this.highAlch = highAlch;
        }
    
        public int getLowAlch() {
            return lowAlch;
        }
    
        public void setLowAlch(int lowAlch) {
            this.lowAlch = lowAlch;
        }
    
        public int getGeneralPrice() {
            return generalPrice;
        }
    
        public void setGeneralPrice(int generalPrice) {
            this.generalPrice = generalPrice;
        }
    }
    Code:
            <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
            <dependency>
                <groupId>com.thoughtworks.xstream</groupId>
                <artifactId>xstream</artifactId>
                <version>1.4.9</version>
            </dependency>
    Last edited by Stuart; 01-09-2017 at 07:29 PM. Reason: empty names fixed
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2013
    Posts
    811
    Thanks given
    50
    Thanks received
    43
    Rep Power
    55
    Quote Originally Posted by Stuart View Post
    Code:
            List<ItemDefinition> list = new ArrayList<>();
    
            for(i = 0; i < totalItems; i++) {
                ItemDef def = forID(i);
                if(def != null) {
                    ItemDefinition definition = new ItemDefinition();
    
                    definition.setId(i);
                    definition.setName(def.name);
                    definition.setNote(def.certTemplateID == 799);
                    definition.setNoteId(def.certID);
                    definition.setStackable(def.stackable);
                    definition.setTradable(true);
                    definition.setGeneralPrice(def.value);
                    definition.setHighAlc((int)Math.ceil(def.value * 0.75));
                    definition.setLowAlch((int)Math.ceil(def.value * 0.25));
    
                    list.add(definition);
                }
            }
    
            try {
                Files.write(Paths.get("definitions.xml"), new XStream().toXML(list).getBytes());
            } catch (IOException e) {
                e.printStackTrace();
            }
    Code:
    public class ItemDefinition {
    
        private int id;
        private String name;
        private boolean tradable;
        private boolean stackable;
        private boolean note;
        private int noteId;
        private int highAlc;
        private int lowAlch;
        private int generalPrice;
    
        public ItemDefinition() {
        }
    
        public int getId() {
            return id;
        }
    
        public void setId(int id) {
            this.id = id;
        }
    
        public String getName() {
            return name;
        }
    
        public void setName(String name) {
            this.name = name;
        }
    
        public boolean isTradable() {
            return tradable;
        }
    
        public void setTradable(boolean tradable) {
            this.tradable = tradable;
        }
    
        public boolean isStackable() {
            return stackable;
        }
    
        public void setStackable(boolean stackable) {
            this.stackable = stackable;
        }
    
        public boolean isNote() {
            return note;
        }
    
        public void setNote(boolean note) {
            this.note = note;
        }
    
        public int getNoteId() {
            return noteId;
        }
    
        public void setNoteId(int noteId) {
            this.noteId = noteId;
        }
    
        public int getHighAlc() {
            return highAlc;
        }
    
        public void setHighAlc(int highAlc) {
            this.highAlc = highAlc;
        }
    
        public int getLowAlch() {
            return lowAlch;
        }
    
        public void setLowAlch(int lowAlch) {
            this.lowAlch = lowAlch;
        }
    
        public int getGeneralPrice() {
            return generalPrice;
        }
    
        public void setGeneralPrice(int generalPrice) {
            this.generalPrice = generalPrice;
        }
    }
    Code:
            <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
            <dependency>
                <groupId>com.thoughtworks.xstream</groupId>
                <artifactId>xstream</artifactId>
                <version>1.4.9</version>
            </dependency>
    wht do these files do bro where do i place them jw
    _._.-\_\_/\/\_/_/-._._
    _.\__.-_/Project-Rs3\_-.__/
    ._-..\_/\_/\/\_/\_/..-
    Reply With Quote  
     

  4. #4  
    Banned
    Join Date
    Apr 2016
    Posts
    357
    Thanks given
    65
    Thanks received
    15
    Rep Power
    0
    Quote Originally Posted by Stuart View Post
    Code:
            List<ItemDefinition> list = new ArrayList<>();
    
            for(i = 0; i < totalItems; i++) {
                ItemDef def = forID(i);
                if(def != null) {
                    ItemDefinition definition = new ItemDefinition();
    
                    definition.setId(i);
                    definition.setName(def.name == null ? "" : def.name);
                    definition.setNote(def.certTemplateID == 799);
                    definition.setNoteId(def.certID);
                    definition.setStackable(def.stackable);
                    definition.setTradable(true);
                    definition.setGeneralPrice(def.value);
                    definition.setHighAlch((int)Math.ceil(def.value * 0.75));
                    definition.setLowAlch((int)Math.ceil(def.value * 0.25));
    
                    list.add(definition);
                }
            }
    
            try {
                Files.write(Paths.get("definitions.xml"), new XStream().toXML(list).getBytes());
            } catch (IOException e) {
                e.printStackTrace();
            }
    Code:
            <!-- https://mvnrepository.com/artifact/com.thoughtworks.xstream/xstream -->
            <dependency>
                <groupId>com.thoughtworks.xstream</groupId>
                <artifactId>xstream</artifactId>
                <version>1.4.9</version>
            </dependency>
    What does this code do? And how to use it never used this before. Thanks for the share atleast.
    Reply With Quote  
     

  5. #5  
    Donator

    IlluZive's Avatar
    Join Date
    Mar 2014
    Age
    22
    Posts
    280
    Thanks given
    153
    Thanks received
    187
    Rep Power
    242
    Quote Originally Posted by TA TA View Post
    What does this code do? And how to use it never used this before. Thanks for the share atleast.
    Read the code. It generates the definitions to a new file called definitions.xml


    [Only registered and activated users can see links. ][Only registered and activated users can see links. ]
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  6. #6  
    Banned
    Join Date
    Apr 2016
    Posts
    357
    Thanks given
    65
    Thanks received
    15
    Rep Power
    0
    Quote Originally Posted by IlluZive View Post
    Read the code. It generates the definitions to a new file called definitions.xml
    Thanks but i know it make the file i readed it but i have no idea how to properly use those
    Reply With Quote  
     

  7. #7  
    Registered Member inkk's Avatar
    Join Date
    Jul 2014
    Posts
    306
    Thanks given
    62
    Thanks received
    40
    Rep Power
    0
    Quote Originally Posted by TA TA View Post
    Thanks but i know it make the file i readed it but i have no idea how to properly use those
    make it run on the client start up and it'll dump the data from the cache in xml format
    Quote Originally Posted by lostlegend View Post
    its not os-legacy its switched to Project-Insanity.
    And Very Much i ReCoded MEself. Check it out and u wil see ur self.
    People allways bothering with saying OS-LEGACY.. U NEVER CHECKED SERVERDONT COMPLAIN CHECK IT OUT B4 COMPLAINING
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [REQ] #121.2 OSRS .xml files
    By TA TA in forum Requests
    Replies: 1
    Last Post: 10-02-2016, 07:02 PM
  2. Replies: 2
    Last Post: 05-15-2010, 05:32 AM
  3. Loading data through an XML File.
    By Ecstasy in forum Tutorials
    Replies: 6
    Last Post: 09-13-2009, 06:58 AM
  4. Phate's lost world map xml files !
    By WhiteFang in forum Downloads
    Replies: 16
    Last Post: 08-15-2007, 10:48 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •