Jump to content

Neo-Mind

Members
  • Posts

    806
  • Joined

  • Last visited

  • Days Won

    18

Posts posted by Neo-Mind

  1. Hello.

    I'm trying to add Green Gemstones to the game, and have had nothing but success right up until getting the actual sprite to show up in-game.

    I've attached a few pictures below to cover the most obvious things. I've also copied the name of another sprite and used it as a placeholder for the ID of my Green Gemstone, and it shows up fine (As another item in-game, such as a blue gemstone)... Just can't get the Green Gemstone sprite to show up.. >.>

     

    Any and all help/advice/input would be greatly appreciated! Thanks very much!

    which client date r u using. you would need to update iteminfo lua file for newer clients instead.

    newer means late 2012 onwards.

  2. OK I have come up with a different solution for the cases when you want to load the data from many files (assuming you can edit them).

    Put the following in a file and make the client load it. 

    -- Define Some arrays and constants 
    iiFiles = {"System/itemInfo_1.lub", "System/itemInfo_2.lub", "System/itemInfo_3.lub", "System/itemInfo_4.lub"} -- List of Files to Read which contains the tables
    iiTables = {tbl_1, tbl_2, tbl_3, tbl_4} -- List of Table Names read from the files in decreasing order of priority
    
    iiNum = table.getn(iiTables) -- Number of Entries in above array.
    initID = 501   -- First Item ID (Don't change this one unless Gravity decided to put lower values for ItemIDs)
    lastID = 32767 -- Last  Item ID (Does not matter if some Item IDs in between are not defined, they will be skipped automatically.)
    
    --#############################################################################--
    -- Do Not Modify anything beyond this point unless you know what you are doing.--
    --#############################################################################--
    
    -- Read the Tables in the Lua files mentioned
    for index = 0, iiNum-1, 1 do
      dofile(iiFiles[index])
    end
    
    -- Define a new main function that looks through all the tables.
    function main()
      for ItemID = initID, lastID, 1 do
        for index = 0, iiNum-1, 1 do -- Iterate through each table
          curTable = iiTables[index]
          if curTable != nil && curTable[ItemID] != nil then -- Check if Table is valid and it has an entry for ItemID.
            ITEMDATA = curTable[ItemID]
            result, msg = AddItem(ItemID, ITEMDATA.unidentifiedDisplayName, ITEMDATA.unidentifiedResourceName, ITEMDATA.identifiedDisplayName, ITEMDATA.identifiedResourceName, ITEMDATA.slotCount, ITEMDATA.ClassNum)
            if not result then
              return false, msg
            end
            for k,v in pairs(ITEMDATA.unidentifiedDescriptionName) do
              result, msg = AddItemUnidentifiedDesc(ItemID, v)
              if not result then
                return false, msg
              end
            end
            for k,v in pairs(ITEMDATA.identifiedDescriptionName) do
              result, msg = AddItemIdentifiedDesc(ItemID, v)
              if not result then
                return false, msg
              end
            end
            index = iiNum -- alternative to continue statement (No More Tables need to be checked)
          end -- if curTable
        end -- for index
      end -- for ItemID
      return true, "good"
    end
    
    When you simply dofile the tbl array gets overwritten each time. so you need to rename those to proper names.

    Here the assumption is that tbl_1 is defined in ItemInfo_1 file, tbl_2 in ItemInfo_2 file etc. 

     

    Hope this was clear.

    • Love 1
  3. Much better to use Notepad ++ .. It's free.. Just google it. :)

    Agreed with this. Throw away Notepad. Use Notepad++ and you will be able to view it properly.

     

     

    As for what rayn was saying. UNIX text files use \n (Line Feed) to denote line endings but Windows files use \r\n sequence (Carriage Return Line Feed).

    Therefore if you open a UNIX file in Notepad it does not detect the line endings and therefore everything ends up in 1 line.

  4. Introduction
    Well this idea came up when evilpunker asked about the possibility of having a patch which loads a second file which overrides the iteminfo file. But there is a better way to do that with lua itself.

    How to do it?
    The key idea is that the item information is added using the main function by the client. so in your custom file you just need to modify the main function to accept your items. Here is how it can be done.



    -- Load the original file. As you might have guessed you can also load your translated file here instead 
    -- (just make sure the "tbl" array contains your item info)
     
    dofile("System/iteminfo.lub") 
     
    -- Now as a simple example . I am simply going to change name of Red Potion to Crimson Potion. 
    -- But you can add anything in the same way. Format is same as the original one, just
    -- the table name is different
     
    tbl_custom = {
      [501] = {
        unidentifiedDisplayName = "Crimson Potion",
        unidentifiedResourceName = "»¡°£Æ÷¼Ç",
        unidentifiedDescriptionName = {
          "A potion made from",
          "grinded Red Herbs that",
          "restores ^000088about 45 HP^000000.",
          "^ffffff_^000000",
          "Weight: ^7777777^000000"
        },
        identifiedDisplayName = "Crimson Potion",
        identifiedResourceName = "»¡°£Æ÷¼Ç",
        identifiedDescriptionName = {
          "^000088HP Recovery Item^000000",
          "A potion made from",
          "grinded Red Herbs that",
          "restores ^000088about 45 HP^000000.",
          "^ffffff_^000000",
          "Weight: ^7777777^000000"
        },
        slotCount = 0,
        ClassNum = 0
      },
    }
     
    -- Now for a helper function because i hate repetitions 
    -- It adds items from curTable if it is not present in refTable
     
    function itemAdder(curTable, refTable)
      for ItemID,DESC in pairs(curTable) do
        if refTable == nil or refTable[ItemID] == nil then
          result, msg = AddItem(ItemID, DESC.unidentifiedDisplayName, DESC.unidentifiedResourceName, DESC.identifiedDisplayName, DESC.identifiedResourceName, DESC.slotCount, DESC.ClassNum)
          if not result then
            return false, msg
          end
          for k,v in pairs(DESC.unidentifiedDescriptionName) do
            result, msg = AddItemUnidentifiedDesc(ItemID, v)
            if not result then
              return false, msg
            end
          end
          for k,v in pairs(DESC.identifiedDescriptionName) do
            result, msg = AddItemIdentifiedDesc(ItemID, v)
            if not result then
              return false, msg
            end
          end
        end
      end
      return true, "good"
    end
     
     
    -- And the newly designed main function
    function main()
      result, msg = itemAdder(tbl_custom, nil) -- add custom items (including official overrides)
      if result then
        result, msg = itemAdder(tbl, tbl_custom) -- add non-overridden official items
      end
      return result, msg
    end
    

    How is it useful?
    Think how item_db2.txt is useful for adding custom items in a server. Its the same strategy here.

    You can keep your official items in a base file (or you can just use the official iteminfo.lub file if you want the korean names)
    and keep your custom items in a different file (make sure the first dofile function calls the base file).

    The above code is error free, so feel free to copy and add your items :). Hope the topic was not too confusing :lol:
    The lua code can be further expanded for overriding only parts of an official item. But i will leave that update for the future :D

    P.S. The client should be patched to accept your custom file not the base file. ^_^

    post-3078-0-44385000-1411452271_thumb.jpg

    • Upvote 8
  5. DATA.INI wont be there in .text section. did you check the .diff or .xdiff section you should find a reference there. The string itself should be there in .rdata section.

     

    To access the sections click the Blue M button which shows u the Memory Map window. scroll down till you see your exe name and the section name u need.

    Select the row and press enter.

  6. I use 2014-06-13a . Well its the newest usable client available anyways :)  . I haven't tested it extensively though hmm.

     

    Depends on your needs.

     

    If you want renewal features on your server best for you is 2013-2014 game clients

    If you want pre-re you can select from 2010 up to 2013 game client.

    You must decide.

    Like what Anacondaqq said. If you want new features and interfaces (along with proper third classes & skills)  you need to get Clients in the 2013-2014 range. Otherwise 2010-2012 game clients are what are you need.

×
×
  • Create New...