05-14-2012, 07:22 AM
I downloaded without any errors.
Scripts:
[RGSS 1.00 REPTILE SCRIPTS]
[Script One: NRGSS] (Working)
Script two: NCEA (Working good)
Script three: NCEA Map Encryption (Don't working... Grr...)
It's problem with three: Map Encryption Script.
Other script work succesfull.
Scripts:
[RGSS 1.00 REPTILE SCRIPTS]
[Script One: NRGSS] (Working)
Content Hidden
Code:
############################################################
#**NRGSS (Narzew RGSS Module)
#**Narzew
#**narzewcreations.rox.pl
#**Projekt zaczęty w kwietniu 2012 roku.
#**Wersja 1.1
############################################################
#**Zeiling Engine and NRGSS Engine
#**Narzew
############################################################
#??.04.12 - Script Start Date
#11.05.12 - Script Completed Date V 1.0
#V 1.0
############################################################
#**Instructions:
#**NRGSS.register
#**Description: Register a product
#**In: Product
#**Out: Operation (Nil)
#**NRGSS.registered?(product)
#**Description: Is the product registered?
#**In: Product
#**Out: Boolean
#**NRGSS.in_range?
#**Description: Is the integer in range?
#**In: Max
#**In: Min
#**In: Value
#**Out: Boolean
#**NRGSS.round_range
#**Description: Round integer range
#**In: Max
#**In: Min
#**In: Value
#**Out: Operation (Nil)
#**NRGSS.unpack_byte
#**Description: Unpacks byte to text
#**In: Byte
#**Out: Unpacked Byte
#**NRGSS.unpack_text
#**Description: Unpack bytes to text
#**In: Text
#**Out: Unpacked Text
#**NRGSS.encrypt_int
#**Description: Encrypts an int.
#**In: Int
#**In: Key
#**Out: Encrypted Int
#**Description: Decrypts encrypted int.
#**NRGSS.decrypt_int
#**In: Int
#**In: Key
#**Out: Decrypted Int
############################################################
$nrgss = 1.1
module NRGSS
$registered_names = []
def self.register(product)
$registered_names << product
end
def self.registered?(product)
$registered_names.include?(product) ? true : false
end
def self.activate(product)
NRGSS.register(product)
unless NRGSS.registered?(product)
raise 'Error with activating #{product}. Game will now close.'
end
end
def self.in_range?( x, y, value)
value = self if value == nil
return true if value.to_i > x.to_i and value < y.to_i
end
def self.round_range(x, y, value)
value = self if value == nil
if value > x
value = x
elsif value < y
value = y
end
end
def self.unpack_byte(byte)
result = []
case byte
when 0 then result << '$NULL$'
when 1 then result << '$SOH$'
when 2 then result << '$STX$'
when 3 then result << '$ETX$'
when 4 then result << '$EOT$'
when 5 then result << '$ENQ$'
when 6 then result << '$ACK$'
when 7 then result << '$BEL$'
when 8 then result << '$BS$'
when 9 then result << '$TAB$'
when 10 then result << '$LF$'
when 11 then result << '$VT$'
when 12 then result << '$FF$'
when 13 then result << '$CR$'
when 14 then result << '$SO$'
when 15 then result << '$SI$'
when 16 then result << '$DLE$'
when 17 then result << '$DC1$'
when 18 then result << '$DC2$'
when 19 then result << '$DC3$'
when 20 then result << '$DC4$'
when 21 then result << '$NAK$'
when 22 then result << '$SYN$'
when 23 then result << '$ETB$'
when 24 then result << '$CAN$'
when 25 then result << '$EN$'
when 26 then result << '$SUB$'
when 27 then result << '$ESC$'
when 28 then result << '$FS$'
when 29 then result << '$GS$'
when 30 then result << '$RS$'
when 31 then result << '$US$'
when 32 then result << ' '
when 33 then result << '!'
when 34 then result << '\"'
when 35 then result << '#'
when 36 then result << '$'
when 37 then result << '%'
when 38 then result << '&'
when 39 then result << '\''
when 40 then result << '('
when 41 then result << ')'
when 42 then result << '*'
when 43 then result << '+'
when 44 then result << ','
when 45 then result << '-'
when 46 then result << '.'
when 47 then result << '/'
when 48 then result << '0'
when 49 then result << '1'
when 50 then result << '2'
when 51 then result << '3'
when 52 then result << '4'
when 53 then result << '5'
when 54 then result << '6'
when 55 then result << '7'
when 56 then result << '8'
when 57 then result << '9'
when 58 then result << ':'
when 59 then result << ';'
when 60 then result << '<'
when 61 then result << '='
when 62 then result << '>'
when 63 then result << '?'
when 64 then result << '@'
when 65 then result << 'A'
when 66 then result << 'B'
when 67 then result << 'C'
when 68 then result << 'D'
when 69 then result << 'E'
when 70 then result << 'F'
when 71 then result << 'G'
when 72 then result << 'H'
when 73 then result << 'I'
when 74 then result << 'J'
when 75 then result << 'K'
when 76 then result << 'L'
when 77 then result << 'M'
when 78 then result << 'N'
when 79 then result << 'O'
when 80 then result << 'P'
when 81 then result << 'Q'
when 82 then result << 'R'
when 83 then result << 'S'
when 84 then result << 'T'
when 85 then result << 'U'
when 86 then result << 'V'
when 87 then result << 'W'
when 88 then result << 'X'
when 89 then result << 'Y'
when 90 then result << 'Z'
when 91 then result << '['
when 92 then result << '\\'
when 93 then result << ']'
when 94 then result << '^'
when 95 then result << '_'
when 96 then result << '`'
when 97 then result << 'a'
when 98 then result << 'b'
when 99 then result << 'c'
when 100 then result << 'd'
when 101 then result << 'e'
when 102 then result << 'f'
when 103 then result << 'g'
when 104 then result << 'h'
when 105 then result << 'i'
when 106 then result << 'j'
when 107 then result << 'k'
when 108 then result << 'l'
when 109 then result << 'm'
when 110 then ersult << 'n'
when 111 then result << 'o'
when 112 then result << 'p'
when 113 then result << 'q'
when 114 then result << 'r'
when 115 then result << 's'
when 116 then result << 't'
when 117 then result << 'u'
when 118 then result << 'v'
when 119 then result << 'w'
when 120 then result << 'x'
when 121 then result << 'y'
when 122 then result << 'z'
when 123 then result << '{'
when 124 then result << '|'
when 125 then result << '}'
when 126 then result << '~'
when 127 then result << '$DEL$'
else
result << '$NOT$'
end
end
def self.unpack_text(text)
result = []
text.each{|byte|
result << NRGSS.unpack_byte(byte)
}
return result.to_s
end
def self.pack_bytes(text)
result = []
text.each_byte{|byte| result << byte }
return result
end
def self.pack_byte(letter)
result = []
count = 0
letter.each_byte{|byte| result << letter }
return result.at(0)
end
def self.encrypt_int(int, val=12)
srand(val*2)
val.times{
int = int + val
int = int - 2
int = int + rand(val * 4)
int = int - rand(val * 3)
}
return int
end
def self.decrypt_int(int, val=12)
srand(val*2)
val.times{
int = int - val
int = int + 2
int = int - rand(val * 4)
int = int + rand(val * 3)
}
return int
end
def self.require_rbl(file)
raise("Rbl #{file} is required. Please install or download it.") if !File.exist?(file)
end
def self.rbl_read(data)
file = File.open(data, 'rb')
data = file.read
file.close
end
def self.rbl_build(src, file)
writefile = File.open(file, 'wb')
$rbl_data = src
Marshal.dump($rbl_data, writefile)
writefile.close
end
def self.call(rbl, func, args, bind)
file = File.open(rbl, 'rb')
$rbl_data = Marshal.load(file)
$rbl_args = args
eval(Zlib::Inflate.inflate($rbl_data[func])) if bind == false or bing == 0 or bind == nil
eval(Zlib::Inflate.inflate($rbl_data[func]), TOPLEVEL_BINDING) if bind == true or bind == 1
file.close
end
def self.zlib_compress_file(readfile2, writefile2, level=9)
readfile = File.open(readfile2, 'rb')
data = readfile.read
readfile.close
writefile = File.open(writefile2, 'wb')
i1 = Zlib::Deflate.deflate(data, level)
writefile.write(i1)
writefile.close
end
def self.zlib_decompress_file(readfile2, writefile2, level=9)
readfile = File.open(readfile2, 'rb')
data = readfile.read
readfile.close
writefile = File.open(writefile2, 'wb')
i1 = Zlib::Deflate.deflate(data, level)
writefile.write(i1)
writefile.close
end
def self.mda_compress(datalist, archive)
$archived_data = []
file = File.open(archiwe, 'wb')
count = 0
datalist.each{|data|
datafile = File.open(data, 'rb')
datafile_d = datafile.read
datafile.close
$archived_data[count] = datafile_d
count += 1
}
Marshal.dump($archived_data, file)
file.close
end
def self.mda_load(data, archive)
file = File.open(data, archive)
$archived_data = Marshal.load(file)
return $archived_data[data]
end
def self.decompress(data, file, archive)
NRGSS.file_write(NRGSS.mda_load(data, archive), file)
end
def self.file_read(var, file2)
file = File.open(file2, 'rb')
var = file.read
file.close
end
def self.file_read2(file2)
file = File.open(file2, 'rb')
return file.read
end
def self.file_read3(file2)
return load_data(file2)
end
def self.file_write(var, file2)
file = File.open(file2, 'wb')
file.write(var)
file.close
end
def self.file_link(afile, bfile, cfile)
file1 = File.open(afile, 'rb')
file2 = File.open(bfile, 'rb')
file3 = File.open(cfile, 'wb')
file3.write(file1.read)
file3.write(file2.read)
file1.close
file2.close
file3.close
end
def self.cbrt(x)
result = x**(1.0/3.0)
return result
end
def self.root(nr, st)
result = nr**(1.0/st.to_f)
return result
end
def self.oppose(nr)
result = nr - (nr*2)
return result
end
def self.threepower(x, st)
return (x**st)**st
end
def self.circlethreepower(x)
return (x**x)**x
end
def self.zlib_defl(filename)
file = File.open(filename, 'rb')
filedata = file.read
file.close
return Zlib::Deflate.deflate(filedata, 9)
end
def self.zlib_infl(filename)
file = File.open(filename)
filedata = file.read
file.close
return Zlib::Inflate.inflate(filedata)
end
end
def _d(int, key=12)
return NRGSS.decrypt_int(int, key)
end
def _e(int, key=12)
return NRGSS.encrypt_int(int, key)
end
def _td(int, key=12)
dec = NRGSS.decrypt_int(int, key)
enc = NRGSS.encrypt_int(dec, key)
return enc == int
end
def byte(byte)
return NRGSS.pack_byte(byte)
end
def ubyte(byte)
return NRGSS.unpack_byte(byte)
end
Script two: NCEA (Working good)
Content Hidden
Code:
############################################################
#**Narzew Creations Encryption Algorithm (NCEA)
#**Narzew
#**narzewcreations.rox.pl
#**Projekt zaczęty 10 listopada 2011 roku.
#**Wersja 0.2 Optimal
############################################################
#**NCEA jest produktem, kodującym grę.
#**Produkt jest chroniony licencją NC z argumentami: brak
#**Produkt wymaga oprogramowania NRGSS w wersji 0.2 lub większej
#**Narzew
############################################################
#10.11.11 - Script Start Date
#10.11.11 - Script Completed Date - V 0.1
#20.11.11 - Script Completed Date - V 0.2
#12.05.12 - Script Completed Date - V 0.2 Optimal
############################################################
raise 'NRGSS is not installed. Please install NRGSS or download it.\nYou can get latest NRGSS from: http://ncr.rox.pl' if !defined?(NRGSS)
NRGSS.activate('NCEA')
$administrable = true # Edit if you want.
$admin = true if $DEBUG == true and $administrable == true # Don't edit
module NCEA
module CONFIG
#Wszędzie false by zdeaktywować skrypt
#Kodować dane?
ENCRYPT_DATA = true
#Wczytać zakodowane dane?
LOAD_DATA = true
#Wczytać skrypty?
LOAD_SCRIPTS = false
#Plik danych
DATA_FILE = 'Data.ncp'
end
#**Koduj
def self.nc_encrypt(filename)
file = File.open(filename, 'rb')
data2 = file.read
file.close
data = Zlib::Deflate.deflate(data2 ,9)
file= File.open(filename, 'wb')
Marshal.dump(data,file)
file.close
end
#**Wczytuj
def self.nc_load(filename)
file = File.open(filename, 'rb')
data = Marshal.load(file)
data2 = data
file.close
data = Zlib::Inflate.inflate(data2)
return data
end
#**Wczytuj do pliku
def self.nc_load_to_rbx(filename)
file = File.open('temp.rbx', 'wb')
file.write(nc_load(filename))
file.close
end
#**Dekoduj
def self.nc_decrypt(filename)
file = File.open(filename, 'rb')
data = Marshal.load(file)
data2 = data
file.close
data = Zlib::Inflate.inflate(data2)
file = File.open(filename, 'wb')
file.write(data2)
end
def self.encrypt_game_data
@@_datafile = File.open(NCEA::CONFIG::DATA_FILE, 'wb')
$game_data = {
0 => NRGSS.file_read3('Data/Actors.rxdata'),
1 => NRGSS.file_read3('Data/Animations.rxdata'),
2 => NRGSS.file_read3('Data/Armors.rxdata'),
3 => NRGSS.file_read3('Data/Classes.rxdata'),
4 => NRGSS.file_read3('Data/CommonEvents.rxdata'),
5 => NRGSS.file_read3('Data/Enemies.rxdata'),
6 => NRGSS.file_read3('Data/Items.rxdata'),
7 => NRGSS.file_read3('Data/MapInfos.rxdata'),
8 => NRGSS.file_read3('Data/Scripts.rxdata'),
9 => NRGSS.file_read3('Data/Skills.rxdata'),
10 => NRGSS.file_read3('Data/States.rxdata'),
11 => NRGSS.file_read3('Data/System.rxdata'),
12 =>NRGSS.file_read3('Data/Tilesets.rxdata'),
13 => NRGSS.file_read3('Data/Troops.rxdata'),
14 => NRGSS.file_read3('Data/Weapons.rxdata')
}
Marshal.dump($game_data, @@_datafile)
@@_datafile.close
NCEA.nc_encrypt(NCEA::CONFIG::DATA_FILE)
end
def self.load_game_data
NCEA.nc_load_to_rbx(NCEA::CONFIG::DATA_FILE)
@@_datafile = File.open('temp.rbx', 'rb')
$game_data = Marshal.load(@@_datafile)
@@_datafile.close
File.delete('temp.rbx')
$data_actors = $game_data[0]
$data_animations = $game_data[1]
$data_armors = $game_data[2]
$data_classes = $game_data[3]
$data_common_events = $game_data[4]
$data_enemies = $game_data[5]
$data_items = $game_data[6]
$data_map_infos = $game_data[7]
$data_scripts = $game_data[8]
$data_skills = $game_data[9]
$data_states = $game_data[10]
$data_system = $game_data[11]
$data_tilesets = $game_data[12]
$data_troops = $game_data[13]
$data_weapons = $game_data[14]
end
def self.go_on
if NCEA::CONFIG::ENCRYPT_DATA
NCEA.encrypt_game_data if $admin == true
end
if NCEA::CONFIG::LOAD_DATA
NCEA.load_game_data
if !$admin && NCEA::CONFIG::LOAD_SCRIPTS
$game_data[8].each do |s|
eval(Zlib::Inflate.inflate(s[2]), nil, s[1])
end
end
end
end
end
Script three: NCEA Map Encryption (Don't working... Grr...)
Content Hidden
Code:
module NCEA
MapFile = 'MapData.ncp'
def self.encrypt_maps
file = File.open(NCEA::MapFile, 'wb')
$mapdata = []
count = 1
999.times{
if count < 10
$mapdata << load_data("Data/Map00#{count}.rxdata") if File.exist?("Data/Map00#{count}.rxdata")
count += 1
elsif count > 10 and count < 100
$mapdata << load_data("Data/Map0#{count}.rxdata") if File.exist?("Data/Map0#{count}.rxdata")
count += 1
else
$mapdata << load_data("Data/Map#{count}.rxdata") if File.exist?("Data/Map#{count}.rxdata")
count += 1
end
}
Marshal.dump($mapdata, file)
file.close
NCEA.nc_encrypt(NCEA::MapFile)
end
def self.load_map(map)
file = File.open('MapData.ncp', 'rb')
NCEA.nc_load_to_rbx(NCEA::MapFile)
$mapdata = load_data('temp.rbx')
file.close
return $mapdata.at(map)
end
end
NCEA.encrypt_maps
class Game_Map
def setup(map_id)
@map_id = map_id
@map = NCEA.load_map(@map_id)
tileset = @map.tileset_id
@tileset_name = tileset.tileset_name
@autotile_names = tileset.autotile_names
@panorama_name = tileset.panorama_name
@panorama_hue = tileset.panorama_hue
@fog_name = tileset.fog_name
@fog_hue = tileset.fog_hue
@fog_opacity = tileset.fog_opacity
@fog_blend_type = tileset.fog_blend_type
@fog_zoom = tileset.fog_zoom
@fog_sx = tileset.fog_sx
@fog_sy = tileset.fog_sy
@battleback_name = tileset.battleback_name
@passages = tileset.passages
@priorities = tileset.priorities
@terrain_tags = tileset.terrain_tags
@display_x = 0
@display_y = 0
@need_refresh = false
@events = {}
for i in @map.events.keys
@events[i] = Game_Event.new(@map_id, @map.events[i])
end
@common_events = {}
for i in 1...$data_common_events.size
@common_events[i] = Game_CommonEvent.new(i)
end
@fog_ox = 0
@fog_oy = 0
@fog_tone = Tone.new(0, 0, 0, 0)
@fog_tone_target = Tone.new(0, 0, 0, 0)
@fog_tone_duration = 0
@fog_opacity_duration = 0
@fog_opacity_target = 0
@scroll_direction = 2
@scroll_rest = 0
@scroll_speed = 4
end
end
It's problem with three: Map Encryption Script.
Other script work succesfull.