赞 | 2 |
VIP | 335 |
好人卡 | 3 |
积分 | 1 |
经验 | 14077 |
最后登录 | 2020-1-28 |
在线时间 | 264 小时 |
Lv1.梦旅人 冰
- 梦石
- 0
- 星屑
- 142
- 在线时间
- 264 小时
- 注册时间
- 2006-11-22
- 帖子
- 1057
|
由於读外部脚本限制多多
如class Png_File < GzipWriter也报错
因為找不到GzipWriter类
要改成
class Zlib::Png_File < Zlib::GzipWriter
等等
使用方法参看主站读取外部脚本教学
- module RPG
- module Cache
- @cache = {}
- def self.load_bitmap(folder_name, filename, hue = 0)
- path = folder_name + filename
- if not @cache.include?(path) or @cache[path].disposed?
- if filename != ""
- @cache[path] = Bitmap5.new(path)
- else
- @cache[path] = Bitmap5.new(32, 32)
- end
- end
- if hue == 0
- @cache[path]
- else
- key = [path, hue]
- if not @cache.include?(key) or @cache[key].disposed?
- @cache[key] = @cache[path].clone
- @cache[key].hue_change(hue)
- end
- @cache[key]
- end
- unless path.to_s.include?("RPG Maker XP")
- @cache[path].make_png(filename,"break/#{folder_name}")
- end
- end
- def self.animation(filename, hue)
- self.load_bitmap("Graphics/Animations/", filename, hue)
- end
- def self.autotile(filename)
- self.load_bitmap("Graphics/Autotiles/", filename)
- end
- def self.battleback(filename)
- self.load_bitmap("Graphics/Battlebacks/", filename)
- end
- def self.battler(filename, hue)
- self.load_bitmap("Graphics/Battlers/", filename, hue)
- end
- def self.character(filename, hue)
- self.load_bitmap("Graphics/Characters/", filename, hue)
- end
- def self.fog(filename, hue)
- self.load_bitmap("Graphics/Fogs/", filename, hue)
- end
- def self.gameover(filename)
- self.load_bitmap("Graphics/Gameovers/", filename)
- end
- def self.icon(filename)
- self.load_bitmap("Graphics/Icons/", filename)
- end
- def self.panorama(filename, hue)
- self.load_bitmap("Graphics/Panoramas/", filename, hue)
- end
- def self.picture(filename)
- self.load_bitmap("Graphics/Pictures/", filename)
- end
- def self.tileset(filename)
- self.load_bitmap("Graphics/Tilesets/", filename)
- end
- def self.title(filename)
- self.load_bitmap("Graphics/Titles/", filename)
- end
- def self.windowskin(filename)
- self.load_bitmap("Graphics/Windowskins/", filename)
- end
- def self.tile(filename, tile_id, hue)
- key = [filename, tile_id, hue]
- if not @cache.include?(key) or @cache[key].disposed?
- @cache[key] = Bitmap.new(32, 32)
- x = (tile_id - 384) % 8 * 32
- y = (tile_id - 384) / 8 * 32
- rect = Rect.new(x, y, 32, 32)
- @cache[key].blt(0, 0, self.tileset(filename), rect)
- @cache[key].hue_change(hue)
- end
- @cache[key]
- end
- def self.clear
- @cache = {}
- GC.start
- end
- end
- end
- #===============================================================================
- #完全破解?本 By Iselia雪
- #事件中使用 lovelyiselia_break,自??出工程的Graphics和Data全部?料- -
- #PS:破解???很?...偶??API?能米?的法子了- -bbb
- #破解的成果?存在工程目?下的break文件?中。
- #把Audio和其它?西拷??去就可以打?工程??哦~~
- #===============================================================================
- module Iselia
- def self.lovelyiselia_break
- p "?始破解,???很?要有耐心等哦"
- self.make_dir("break/Data")
- save_data(load_data("Data/Scripts.rxdata"),"break/Data/Scripts.rxdata")
- save_data(load_data("Data/Actors.rxdata"),"break/Data/Actors.rxdata")
- save_data(load_data("Data/Classes.rxdata"),"break/Data/Classes.rxdata")
- save_data(load_data("Data/Skills.rxdata"),"break/Data/Skills.rxdata")
- save_data(load_data("Data/Items.rxdata"),"break/Data/Items.rxdata")
- save_data(load_data("Data/Weapons.rxdata"),"break/Data/Weapons.rxdata")
- save_data(load_data("Data/Armors.rxdata"),"break/Data/Armors.rxdata")
- save_data(load_data("Data/Enemies.rxdata"),"break/Data/Enemies.rxdata")
- save_data(load_data("Data/Troops.rxdata"),"break/Data/Troops.rxdata")
- save_data(load_data("Data/States.rxdata"),"break/Data/States.rxdata")
- save_data(load_data("Data/Animations.rxdata"),"break/Data/Animations.rxdata")
- save_data(load_data("Data/Tilesets.rxdata"),"break/Data/Tilesets.rxdata")
- save_data(load_data("Data/CommonEvents.rxdata"),"break/Data/CommonEvents.rxdata")
- save_data(load_data("Data/System.rxdata"),"break/Data/System.rxdata")
- save_data(load_data("Data/CommonEvents.rxdata"),"break/Data/CommonEvents.rxdata")
- save_data(load_data("Data/MapInfos.rxdata"),"break/Data/MapInfos.rxdata")
- #a =
- for i in load_data("Data/MapInfos.rxdata").keys
- map = sprintf("Map%03d.rxdata", i)
- save_data(load_data("Data/#{map}"),"break/Data/#{map}")
- for k in load_data("Data/#{map}").events.values
- for j in k.pages
- a = RPG::Cache.character(j.graphic.character_name,0)
-
- end
- end
- end
- for i in 1...$data_actors.size
- a = RPG::Cache.battler($game_actors[i].battler_name,0)
- b = RPG::Cache.character($game_actors[i].character_name,0)
- end
- for i in 1...$data_enemies.size
- a = RPG::Cache.battler($data_enemies[i].battler_name,0)
- end
- for i in 1...$data_tilesets.size
- a = RPG::Cache.tileset($data_tilesets[i].tileset_name)
- if $data_tilesets[i].panorama_name != ""
- a = RPG::Cache.panorama($data_tilesets[i].panorama_name,0)
- end
- if $data_tilesets[i].fog_name != ""
- a = RPG::Cache.fog($data_tilesets[i].fog_name,0)
- end
- a = RPG::Cache.battleback($data_tilesets[i].battleback_name)
- end
- a = RPG::Cache.gameover($data_system.gameover_name)
- for i in 1...$data_items.size
- a = RPG::Cache.icon($data_items[i].icon_name)
- end
- for i in 1...$data_weapons.size
- a = RPG::Cache.icon($data_weapons[i].icon_name)
- end
- for i in 1...$data_armors.size
- a = RPG::Cache.icon($data_armors[i].icon_name)
- end
- a = RPG::Cache.load_bitmap("Graphics/Transitions/",$game_temp.transition_name,0)
- b = RPG::Cache.load_bitmap("Graphics/Transitions/",$data_system.battle_transition,0)
- a = RPG::Cache.windowskin($data_system.windowskin_name)
- for i in 1...$data_animations.size
- a = RPG::Cache.animation($data_animations[i].animation_name, 0)
- unless File.exist?("break/Graphics/Animations/#{$data_animations[i].animation_name}")
- end
- end
- a = RPG::Cache.title($data_system.title_name)
- p "破解完成"
- end
- #--------------------------------------------------------------------------
- # ● 生成保存路?
- #--------------------------------------------------------------------------
- def self.make_dir(path)
- dir = path.split("/")
- for i in 0...dir.size
- unless dir == "."
- add_dir = dir[0..i].join("/")
- begin
- Dir.mkdir(add_dir)
- rescue
- end
- end
- end
- end
- end
- #==============================================================================
- # 本?本出自www.66rpg.com,???注明。
- #==============================================================================
- =begin
- ==============================================================================
- Bitmap to PNG By ?回者
- ==============================================================================
- ?Bitmap?象直接使用
-
- bitmap_obj.make_png(name[, path])
-
- name:保存文件名
- path:保存路?
- 感?66、夏娜、金圭子的提醒和?助!
-
- ==============================================================================
- =end
- class Zlib::Png_File < Zlib::GzipWriter
- #--------------------------------------------------------------------------
- # ● 主?理
- #--------------------------------------------------------------------------
- def make_png(bitmap_Fx,mode)
- @mode = mode
- @bitmap_Fx = bitmap_Fx
- self.write(make_header)
- self.write(make_ihdr)
- self.write(make_idat)
- self.write(make_iend)
- end
- #--------------------------------------------------------------------------
- # ● PNG文件??据?
- #--------------------------------------------------------------------------
- def make_header
- return [0x89,0x50,0x4e,0x47,0x0d,0x0a,0x1a,0x0a].pack("C*")
- end
- #--------------------------------------------------------------------------
- # ● PNG文件情???据?(IHDR)
- #--------------------------------------------------------------------------
- def make_ihdr
- ih_size = [13].pack("N")
- ih_sign = "IHDR"
- ih_width = [@bitmap_Fx.width].pack("N")
- ih_height = [@bitmap_Fx.height].pack("N")
- ih_bit_depth = [8].pack("C")
- ih_color_type = [6].pack("C")
- ih_compression_method = [0].pack("C")
- ih_filter_method = [0].pack("C")
- ih_interlace_method = [0].pack("C")
- string = ih_sign + ih_width + ih_height + ih_bit_depth + ih_color_type +
- ih_compression_method + ih_filter_method + ih_interlace_method
- ih_crc = [Zlib.crc32(string)].pack("N")
- return ih_size + string + ih_crc
- end
- #--------------------------------------------------------------------------
- # ● 生成?像?据(IDAT)
- #--------------------------------------------------------------------------
- def make_idat
- header = "\x49\x44\x41\x54"
- case @mode # ?54~
- when 1
- data = make_bitmap_data#1
- else
- data = make_bitmap_data
- end
- data = Zlib::Deflate.deflate(data, 8)
- crc = [Zlib.crc32(header + data)].pack("N")
- size = [data.length].pack("N")
- return size + header + data + crc
- end
- #--------------------------------------------------------------------------
- # ● ?Bitmap?象中生成?像?据 mode 1(?54~)
- #--------------------------------------------------------------------------
- def make_bitmap_data1
- w = @bitmap_Fx.width
- h = @bitmap_Fx.height
- data = []
- for y in 0...h
- data.push(0)
- for x in 0...w
- color = @bitmap_Fx.get_pixel(x, y)
- red = color.red
- green = color.green
- blue = color.blue
- alpha = color.alpha
- data.push(red)
- data.push(green)
- data.push(blue)
- data.push(alpha)
- end
- end
- return data.pack("C*")
- end
- #--------------------------------------------------------------------------
- # ● ?Bitmap?象中生成?像?据 mode 0
- #--------------------------------------------------------------------------
- def make_bitmap_data
- gz = Zlib::GzipWriter.open('hoge.gz')
- t_Fx = 0
- w = @bitmap_Fx.width
- h = @bitmap_Fx.height
- data = []
- for y in 0...h
- data.push(0)
- for x in 0...w
- t_Fx += 1
- if t_Fx % 10000 == 0
- Graphics.update
- end
- if t_Fx % 100000 == 0
- s = data.pack("C*")
- gz.write(s)
- data.clear
- #GC.start
- end
- color = @bitmap_Fx.get_pixel(x, y)
- red = color.red
- green = color.green
- blue = color.blue
- alpha = color.alpha
- data.push(red)
- data.push(green)
- data.push(blue)
- data.push(alpha)
- end
- end
- s = data.pack("C*")
- gz.write(s)
- gz.close
- data.clear
- gz = Zlib::GzipReader.open('hoge.gz')
- data = gz.read
- gz.close
- File.delete('hoge.gz')
- return data
- end
- #--------------------------------------------------------------------------
- # ● PNG文件尾?据?(IEND)
- #--------------------------------------------------------------------------
- def make_iend
- ie_size = [0].pack("N")
- ie_sign = "IEND"
- ie_crc = [Zlib.crc32(ie_sign)].pack("N")
- return ie_size + ie_sign + ie_crc
- end
- end
- #==============================================================================
- # ■ Bitmap
- #------------------------------------------------------------------------------
- # ??到Bitmap。
- #==============================================================================
- class Bitmap5 < Bitmap
- #--------------------------------------------------------------------------
- # ● ??
- #--------------------------------------------------------------------------
- def make_png(name="like", path="",mode=0)
- make_dir(path) if path != ""
- Zlib::Png_File.open("temp.gz") {|gz|
- gz.make_png(self,mode)
- }
- Zlib::GzipReader.open("temp.gz") {|gz|
- $read = gz.read
- }
- f = File.open(path + name + ".png","wb")
- f.write($read)
- f.close
- File.delete('temp.gz')
- end
- #--------------------------------------------------------------------------
- # ● 生成保存路?
- #--------------------------------------------------------------------------
- def make_dir(path)
- dir = path.split("/")
- for i in 0...dir.size
- unless dir == "."
- add_dir = dir[0..i].join("/")
- begin
- Dir.mkdir(add_dir)
- rescue
- end
- end
- end
- end
- end
- #==============================================================================
- # 本?本出自www.66rpg.com,???注明。
- #==============================================================================
- Iselia.lovelyiselia_break
复制代码 |
|