All pastes #366608 Raw Edit

Untitled

public text v1 · immutable
#366608 ·published 2007-02-21 19:58 UTC
rendered paste body
function Load_Items()
    open to read 4,"Data\Item.ini"

      Log("Opened Items.ini")

        read string 4,parse$
      repeat

         if lower$(parse$)="[potion]"
            Log("Read potion")
            array insert at bottom Potions(0)
            inc gl_potions
            fail=0
            repeat
                read string 4,parse$
                Log("Param "+ GetParam(parse$))
                st$=GetParam(parse$)
                select st$
                    case "sid"
                        id$=GetString(parse$)
                        potions(gl_potions).sid=id$
                    endcase
                    case "name"
                        potions(gl_potions).id=GetString(parse$)
                    endcase
                    case "unid"
                        potions(gl_potions).unid=GetString(parse$)
                    endcase
                    case "icon"
                        potions(gl_potions).media$=GetString(parse$)
                    endcase
                    case "mesh"
                        potions(gl_potions).mesh=GetString(parse$)
                    endcase
                    case "level"
                        potions(gl_potions).level=GetInt(parse$)
                    endcase
                    case "rarity"
                        potions(gl_potions).rarity=GetInt(parse$)
                    endcase
                    case default
                        fail=1
                        Log("failed to select")
                    endcase
                    log("select end")
                endselect
            until fail=1
         else
            read string 4,parse$
         endif
        until file end(2)=1
    close file 4
endfunction