Toyota Membro
Mensagens : 54 Créditos : 13 Idade : 27 Localização : Rio de Janeiro - RJ Frase Pessoal : " Scripter dos Makers "
| Assunto: Sistema de Chets para seu Jogo. Sex Jan 29, 2010 5:32 pm | |
| Esse é um Sistema de Códigos ( Cheats ) para seu projeto. Ele permite que você escolhe macetes secretos para seu jogo. Exemplo : O script ja vem com algums Chets... se escrever GRANA1000 Você ganha 1000 dinheiro no jogo.. São 2 scripts, copie e cole-os acima do Main no seu projeto. Script 1 - Código:
-
#=begin #=============================================================================== # ** Input Script v2 - Este script foi primeiramente criado por # Cybersam e ela merece a maior parte do # crédito, Tudo o que fiz foi adicionar # algumas funções. # (Astro_Mech diz(traduzido)) # ** Input Script v3 - O que fiz neste script foi deixar os nomes # das teclas, adicionar novos caracteres, # consertar bugs, traduzir e adicionar a # função para escolher as teclas # utilizadas no jogo. # (Aster diz) # ** Chamar como :$scene = Scene_Cheats.new #------------------------------------------------------------------------------- # Author Cybersam # Versão 3.0 # Data 08-03-08 # Editado Aster, Astro_mech e Mr.Mo #===============================================================================
module Input #-------------------------------------------------------------------------- # * Criação das variaveis #-------------------------------------------------------------------------- Botoes = {} @keys = [] @repea = [] @pres = [] @trigg = [] Names = {} @trigg2 = [] Digi = {} Shif = {} #-------------------------------------------------------------------------- # * ID das teclas #-------------------------------------------------------------------------- Mouse_Left = '1' Mouse_Right = '2' Mouse_Middle = '4' Mouse_Esq = '1' Mouse_Direita = '2' Mouse_Meio = '4' Back = '8' Tab = '9' Enter = '13' Shift = '16' Ctrl = '17' Alt = '18' Capslock = '20' Esc = '27' Space = '32' Pgup = 33 Pgdn = 34 End = 35 Home = 36 LT = 37 UPs = 38 RT = 39 DN = 40 EQ = 37 CM = 38 DR = 39 BX = 40 Printscreen = 44 Ins = 45 Del = 46 Numberkeys = {} Numberkeys[0] = 48 # => 0 Numberkeys[1] = 49 # => 1 Numberkeys[2] = 50 # => 2 Numberkeys[3] = 51 # => 3 Numberkeys[4] = 52 # => 4 Numberkeys[5] = 53 # => 5 Numberkeys[6] = 54 # => 6 Numberkeys[7] = 55 # => 7 Numberkeys[8] = 56 # => 8 Numberkeys[9] = 57 # => 9 Numeros = Numberkeys Letters = {} Letters['A'] = 65 Letters['B'] = 66 Letters['C'] = 67 Letters['D'] = 68 Letters['E'] = 69 Letters['F'] = 70 Letters['G'] = 71 Letters['H'] = 72 Letters['I'] = 73 Letters['J'] = 74 Letters['K'] = 75 Letters['L'] = 76 Letters['M'] = 77 Letters['N'] = 78 Letters['O'] = 79 Letters['P'] = 80 Letters['Q'] = 81 Letters['R'] = 82 Letters['S'] = 83 Letters['T'] = 84 Letters['U'] = 85 Letters['V'] = 86 Letters['W'] = 87 Letters['X'] = 88 Letters['Y'] = 89 Letters['Z'] = 90 Leftwin = 91 Rightwin = 92 Winesq = 91 Windir = 92 Numberpad = {} Numberpad[0] = 96 Numberpad[1] = 97 Numberpad[2] = 98 Numberpad[3] = 99 Numberpad[4] = 100 Numberpad[5] = 101 Numberpad[6] = 102 Numberpad[7] = 103 Numberpad[8] = 104 Numberpad[9] = 105 Numerico = Numberpad Asterisconum = 106 # => * Maisnum = 107 # => + Menosnum = 109 # => - Delnum = 110 # => , Barranum = 111 # => / Fkeys = {} Fkeys[1] = 112 Fkeys[2] = 113 Fkeys[3] = 114 Fkeys[4] = 115 Fkeys[5] = 116 Fkeys[6] = 117 Fkeys[7] = 118 Fkeys[8] = 119 Fkeys[9] = 120 Fkeys[10] = 121 Fkeys[11] = 122 Fkeys[12] = 123 Letters['Ç'] = 186 # => ç Ç Letras = Letters Equal = 187 # => = + Comma = 188 # => , < Underscore = 189 # => - _ Underline = 189 # => - _ Dot = 190 # => . > Twodot = 191 # => ; : Quote = 192 # => ' " Backslash = 193 # => / ? Dotnum = 194 # => . Acento = 219 # => ´ ` Rchaves = 220 # => ] } Lchaves = 221 # => [ { Tio = 222 # => ~ ^ Slash = 226 # => \ | #-------------------------------------------------------------------------- # * EDITE AQUI #-------------------------------------------------------------------------- #Instruções: #1 - Leia pra que serve cada botão #2 - suba e escolha quais teclas você deseja que o botão seja #3 - decore o nome ou numero da tecla #3 - coloque como no seguinte exemplo: # Botao['#'] = [Tecla1, Tecla2, Tecla3, Tecla4] #4 - se não quiser 4 teclas diferentes substitua o resto # por 0 Ex: # Botao['#'] = [Tecla1, Tecla2, 0, 0] # Obs: se quiser deixar as normais do RPG Maker XP, não mude nada. #-------------------------------------------------------------- #Botão principal(usado para conversar, confirmar, etc.) Botoes['A'] = [Letters['C'], Enter, Space, 0]#C, Enter, Espaço #Botão secundário(para cancelar, abrir o menu, etc.) Botoes['B'] = [Letters['X'], Esc, Numberpad[0], 0]#X, Esc, 0(num) #Botão terciario(sem uso normal) Botoes['C'] = [Letters['Z'], Shift, 0, 0]#Z, Shift #Outros botoes(sem uso) Botoes['X'] = [Letters['D'], 0, 0, 0]#D Botoes['Y'] = [Letters['S'], 0, 0, 0]#S Botoes['Z'] = [Letters['A'], 0, 0, 0]#A #Botão L e R(Muda de herói ao trocar equips, ver status, etc.) Botoes['L'] = [Letters['Q'], Pgup, 0, 0]#Q, Page Up Botoes['R'] = [Letters['W'], Pgdn, 0, 0]#W, Page Doun #Setas(controla o personagem) Botoes['UP'] = [UPs, 0, 0, 0]#Cima Botoes['RT'] = [RT, 0, 0, 0]#Direita Botoes['LT'] = [LT, 0, 0, 0]#Esquerda Botoes['DN'] = [DN, 0, 0, 0]#Baixo #-------------------------------------------------------------------------- # * FIM DA EDIÇÃO #-------------------------------------------------------------------------- State = Win32API.new('user32','GetKeyState',['i'],'i') Key = Win32API.new('user32','GetAsyncKeyState',['i'],'i') #------------------------------------------------------------------------------- USED_KEYS = [Mouse_Left, Mouse_Right, Mouse_Middle] #------------------------------------------------------------------------------- module_function #-------------------------------------------------------------------------- def Input.getstate(key) !State.call(key).between?(0, 1) end #-------------------------------------------------------------------------- def Input.testkey(key) Key.call(key) & 0x01 == 1 end def Input.pressing @pres end def Input.triggering @trigg end def Input.repeating @repea end #-------------------------------------------------------------------------- def Input.update @trigg = [] @repea = [] @pres = [] for i in 1..226 next if i == 112 @pres.push(i) if Input.getstate(i) @repea.push(i) if Input.testkey(i) @trigg.push(i) if Input.getstate(i) and !@trigg2.include?(i) end @trigg2 = @pres end #-------------------------------------------------------------------------- def Input.triggerd?(key) @trigg.include?(key.to_i) end #-------------------------------------------------------------------------- def Input.repeated?(key) @repea.include?(key.to_i) end #-------------------------------------------------------------------------- def Input.pressed?(key) @pres.include?(key.to_i) end #-------------------------------------------------------------------------- # * 4 Diraction #-------------------------------------------------------------------------- def Input.dir4 return 2 if Input.press?(Botoes['DN']) return 4 if Input.press?(Botoes['LT']) return 6 if Input.press?(Botoes['RT']) return 8 if Input.press?(Botoes['UP']) return 0 end #-------------------------------------------------------------------------- # * 8 Diraction #-------------------------------------------------------------------------- def Input.dir8 return 1 if Input.press?(Botoes['DN']) and Input.press?(Botoes['LT']) return 3 if Input.press?(Botoes['DN']) and Input.press?(Botoes['RT']) return 7 if Input.press?(Botoes['UP']) and Input.press?(Botoes['LT']) return 9 if Input.press?(Botoes['UP']) and Input.press?(Botoes['RT']) return 2 if Input.press?(Botoes['DN']) return 4 if Input.press?(Botoes['LT']) return 6 if Input.press?(Botoes['RT']) return 8 if Input.press?(Botoes['UP']) return 0 end #-------------------------------------------------------------------------- # * Trigger (key) #-------------------------------------------------------------------------- def trigger?(key) keys = check_key(key) for k in keys return true if Input.triggerd?(k) end return false end #-------------------------------------------------------------------------- # * Repeat (key) #-------------------------------------------------------------------------- def repeat?(key) keys = check_key(key) for k in keys return true if Input.repeated?(k) end return false end #-------------------------------------------------------------------------- # * Press (key) #-------------------------------------------------------------------------- def press?(key) keys = check_key(key) for k in keys return true if Input.pressed?(k) end return false end #-------------------------------------------------------------------------- # * Check key (key) #-------------------------------------------------------------------------- def check_key(key) keys = [] if key.is_a?(Array) for i in key keys.push(check_key(i)) end end strings = [] case key when Input::DOWN strings.push('DN') when Input::UP strings.push('UP') when Input::LEFT strings.push('LT') when Input::RIGHT strings.push('RT') when Input::C strings.push('A') when Input::B strings.push('B') when Input::A strings.push('C') when Input::Z strings.push('X') when Input::Y strings.push('Y') when Input::X strings.push('Z') when Input::L strings.push('L') when Input::R strings.push('R') when Input::F5 keys.push(Input::Fkeys[5]) when Input::F6 keys.push(Input::Fkeys[6]) when Input::F7 keys.push(Input::Fkeys[7]) when Input::F8 keys.push(Input::Fkeys[8]) when Input::F9 keys.push(Input::Fkeys[9]) when Input::SHIFT keys.push(Input::Shift) when Input::CTRL keys.push(Input::Ctrl) when Input::ALT keys.push(Input::Alt) else keys.push(key) end if strings.size > 0 for i in strings bt = add_botoes(i) for i2 in bt keys.push(i2) end end end k = keys keys = [] for i in k i = [i] if !i.is_a?(Array) for i2 in i keys.push(i2) end end return keys end #-------------------------------------------------------------------------- # * Adiciona botões (key) #-------------------------------------------------------------------------- def add_botoes(key) keys ||= [] keys.push(Botoes[key]) return keys end #-------------------------------------------------------------------------- # * Check (key) #-------------------------------------------------------------------------- def check(key) Win32API.new("user32","GetAsyncKeyState",['i'],'i').call(key) & 0x01 == 1 # key 0 end #-------------------------------------------------------------------------- # * Mouse Update #-------------------------------------------------------------------------- def mouse_update @used_i = [] for i in USED_KEYS x = check(i) if x == true @used_i.push(i) end end end #-------------------------------------------------------------------------- # * Short Write C #-------------------------------------------------------------------------- def Input.C Input.trigger?(C) end #-------------------------------------------------------------------------- # * Short Write B #-------------------------------------------------------------------------- def Input.B Input.trigger?(B) end #-------------------------------------------------------------------------- # * Short Write A #-------------------------------------------------------------------------- def Input.A Input.trigger?(A) end #-------------------------------------------------------------------------- # * Short Write Down #-------------------------------------------------------------------------- def Input.Down Input.trigger?(DOWN) end #-------------------------------------------------------------------------- # * Short Write Up #-------------------------------------------------------------------------- def Input.Up Input.trigger?(UP) end #-------------------------------------------------------------------------- # * Short Write Right #-------------------------------------------------------------------------- def Input.Right Input.trigger?(RIGHT) end #-------------------------------------------------------------------------- # * Short Write Left #-------------------------------------------------------------------------- def Input.Left Input.trigger?(LEFT) end #-------------------------------------------------------------------------- # * Anykey pressed? ( A or B or C or Down or Up or Right or Left ) #-------------------------------------------------------------------------- def Input.Anykey if A or B or C or Down or Up or Right or Left return true else return false end end end Script 2 - Código:
-
########################################################### ##################### CHEATS SYSTEM ####################### #### V 1.0.2 ############################################## ################################### Por: lb_guilherme ##### ###########################################################
class Window_Cheats < Window_Base attr_reader :name attr_reader :index attr_reader :max_char def initialize(max_char) super(88, 20, 368, 128) @name = "" @max_char = max_char name_array = @name.split(//)[0...@max_char] @name = "" for i in 0...name_array.size @name += name_array[i] end @default_name = @name @index = name_array.size self.active = false refresh update_cursor end def add(character) if @index < @max_char and character != "" @name += character.to_s @index += 1 refresh update_cursor end end def back if @index > 0 name_array = @name.split(//) @name = "" for i in 0...name_array.size-1 @name += name_array[i] end @index -= 1 refresh update_cursor end end def textc return @name end def item_rect(index) rect = Rect.new(0, 0, 0, 0) rect.x = 180 - (@max_char + 1) * 12 + index * 24 rect.y = 36 rect.width = 24 rect.height = WLH return rect end def refresh self.contents.clear name_array = @name.split(//) for i in 0...@max_char c = name_array[i] c = '_' if c == nil self.contents.draw_text(item_rect(i), c, 1) end end def update_cursor self.cursor_rect = item_rect(@index) end def update super update_cursor end end class Scene_Cheats < Scene_Base LETRAS = ["A","B","C","Ç","D","E","F","G","H","I","J","K","L", "M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"] def start super create_menu_background @edit_window = Window_Cheats.new(12) end def terminate super dispose_menu_background @edit_window.dispose end def return_scene $scene = Scene_Map.new end def update super update_menu_background @edit_window.update for i in 0...27 letra = LETRAS[i] if Input.trigger?(Input::Letters[letra]) if @edit_window.index == @edit_window.max_char Sound.play_buzzer else Sound.play_decision @edit_window.add(letra) end end end for i in 0...10 if Input.trigger?(Input::Numberpad[i]) if @edit_window.index == @edit_window.max_char Sound.play_buzzer else Sound.play_decision @edit_window.add(i) end end end for i in 0...10 if Input.trigger?(Input::Numberkeys[i]) if @edit_window.index == @edit_window.max_char Sound.play_buzzer else Sound.play_decision @edit_window.add(i) end end end if Input.trigger?(Input::Space) if @edit_window.index == @edit_window.max_char Sound.play_buzzer else Sound.play_decision @edit_window.add(" ") end end if Input.repeat?(Input::Esc) or Input.repeat?(Input::Back) if @edit_window.index > 0 Sound.play_cancel @edit_window.back end
# ---------------------------------------------- # # CONFIGURAÇÕES: # # ---------------------------------------------- # # Aqui ficam as cheats: # Utilize APENAS espaços, letras MAIUSCULAS (Sem acento) e números # Com no maxímo 12 caracteres elsif Input.trigger?(Input::Enter) if @edit_window.textc == "GRANA500" gold(500) mensege("Ganhou 500G") elsif @edit_window.textc == "GRANA1000" gold(1000) mensege("Ganhou 1000G") elsif @edit_window.textc == "QUEST 1" switch(53,true) mensege("Você completou a Quest 1!!!") elsif @edit_window.textc == "50POÇAO" item(1,50) mensege("Você ganhou 50 Poções!") end return_scene end end # Algumas funções pre-programadas: def switch(id,value) # ex: (Ativa a switch 1) # switch(1,true) $game_switches[id] = value end def gold(value) # ex: (Ganha 250G) # gold(250) $game_party.gain_gold(value) end def item(id,value) # ex: (Ganha 5 Poção) # item(1,5) $game_party.gain_item($data_items[id], value) end def arma(id,value,equip) # ex: (Ganha 1 Espada e equipa) # arma(2,1,true) $game_party.gain_item($data_weapons[id], value, equip) end def armd(id,value,equip) # ex: (Ganha 1 Escudo e não equipa) # armd(1,1,false) $game_party.gain_item($data_armors[id], value, equip) end def mensege(text) # ex: (Exibe mensagem) # mensege("Ganhou 500G") $game_message.face_name = "" $game_message.background = 1 $game_message.position = 1 $game_message.texts.push(text) end end Ajuda:#if @edit_window.textc == "GRANA500" gold(500) mensege("Ganhou 500G") elsif @edit_window.textc == "GRANA1000" gold(1000) mensege("Ganhou 1000G") elsif @edit_window.textc == "QUEST 1" switch(53,true) mensege("Você completou a Quest 1!!!") elsif @edit_window.textc == "50POÇAO" item(1,50) mensege("Você ganhou 50 Poções!") end Tome sempre cuidado para não ultrapassar o limite de 12 caracteres. Abaixo disso, você coloca a função. Para que sabe mecher com script, pode botar qualquer coisa, pra quem não sabe, preparei uns código com algumas funções: switch(id,value) Ativa ou desativa uma Switch gold(value) Dar uma quantidade de Gold item(id,value) Ganha um item arma(id,value,equip) Ganha uma arma, podendo já equipar armd(id,value,equip) Ganha uma armadura, podendo já equipar mensege(text) Exibe uma mensagem Nesse caso o código ficaria assim: (uma arma, 50000G e 500 super poções) elsif @edit_window.textc == "SUPER CHEAT" arma(3,1,false) gold(50000) item(2,500) mensege("Parabens, vc ganhou um bocado de coisa!") Créditos para a equipe formada por Cybersam lb_guilherme Mr.Mo Aster astro_mech Toyota Dúvida: PM se tiver duvida ou quiser ajuda. | |
|