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

Results 1 to 7 of 7
  1. #1 [REQ] #129 Data .xml files please! 
    Registered Member TA TA's Avatar
    Join Date
    Apr 2016
    Posts
    169
    Thanks given
    33
    Thanks received
    7
    Rep Power
    9
    Hello im looking for Vencillio

    ItemDefinitions.xml
    NpcDefinitions.xml

    Thanks if someone share these
    Reply With Quote  
     

  2. #2  
    Registered Member
    Join Date
    Jan 2009
    Posts
    5,041
    Thanks given
    981
    Thanks received
    2,793
    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
    574
    Thanks given
    10
    Thanks received
    9
    Rep Power
    12
    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
    Reply With Quote  
     

  4. #4  
    Registered Member TA TA's Avatar
    Join Date
    Apr 2016
    Posts
    169
    Thanks given
    33
    Thanks received
    7
    Rep Power
    9
    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
    21
    Posts
    222
    Thanks given
    112
    Thanks received
    143
    Rep Power
    143
    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  
    Registered Member TA TA's Avatar
    Join Date
    Apr 2016
    Posts
    169
    Thanks given
    33
    Thanks received
    7
    Rep Power
    9
    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
    292
    Thanks given
    57
    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
  •