Created
August 30, 2008 18:47
-
-
Save tekkub/8136 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # data = {:method_vendors=>[{:price=>[8000, 0, 0], :type=>7, :locs=>[440], :react=>[1, 1], | |
| # :desc=>"Alchemy Supplies", :name=>"Alchemist Pestlezugg", :minlevel=>45, :id=>5594}], | |
| # :learned=>200, :produces=>[3577], :skillup=>[200, 240, 260, 280], :method_drops=>[], | |
| # :rarity=>2, :method=>"sold-by,", :reagents=>[[3575, 1]], :id=>9304} | |
| # Assuming the containing structure is an array... | |
| new_data = bigger_struct.map do |data| | |
| source, trainerflag = "Unknown", "nil" | |
| source, trainerflag = 'L["Trainer"]', 1 unless data[:method_vendors].nil? | |
| %Q|self:addTradeSkillSpell(#{data[:id]}, #{data[:skillup].first}, #{source}, #{trainerflag})| | |
| end | |
| p new_data.join("\n") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment