Aldeia RPG

Gostaria de reagir a esta mensagem? Crie uma conta em poucos cliques ou inicie sessão para continuar.

Suporte ao desenvolvimento de jogos


2 participantes

    Adaptação de script

    Reborn
    Reborn
    Experiente
    Experiente


    Mensagens : 500
    Créditos : 28

    Adaptação de script Empty Adaptação de script

    Mensagem por Reborn Ter Dez 20, 2011 5:20 pm

    Quero que faça o sistema de distribuição de pontos, esse aki:
    Código:
    #==============================================================================
    # ** Status
    #------------------------------------------------------------------------------
    #  By Marlos Gama
    #------------------------------------------------------------------------------
     
    class Window_Status2 < Window_Base
      def initialize
        super(25,70,210,240)
        self.contents = Bitmap.new(width - 32, height - 32)
        @dragable = true
        @closable = true
        self.z = 999999
        self.back_opacity = 200
        if User_Edit::DISTRIBUIR_ACTIVE == true
        @str = Button.new(self,145+15, 120+3, " + ") {str}
        @agi = Button.new(self,145+15, 140+3, " + ") {agi}
        @dex = Button.new(self,145+15, 160+3, " + ") {dex}
        @int = Button.new(self,145+15, 180+3, " + ") {int}
        end
        refresh
      end
     
      def update
        super
        refresh if something_changed?
      end
     
      def on_close
        self.visible = false
        self.active = false
        $fechando_ativar = true
      end

      def refresh
        @actor = $game_party.actors[0]
        @old_lvl = @actor.level
        @old_gold = $game_party.item_number(Item_Ouro::Item_Id.to_i)
        @old_hp = @actor.hp
        @old_sp = @actor.sp
        @old_exp = @actor.now_exp
        @old_maxhp = @actor.maxhp
        @old_maxsp = @actor.maxsp
        @old_pontos = $distribuir_pontos
        @old_str = @actor.str
        @old_dex = @actor.dex
        @old_int = @actor.int
        @old_agi = @actor.agi
        self.contents.clear
        # Level
        self.contents.draw_text(0, 0, 62, 32, "Level")
        self.contents.draw_text(100, 0, 100, 32, "#{@actor.level}")
        # Ouro
        self.contents.draw_text(0, 20, 32, 32, "Ouro")
        self.contents.draw_text(100, 20, 100, 32, $game_party.item_number(Item_Ouro::Item_Id.to_i).to_s)
        # HP\MaxHP
        self.contents.draw_text(0, 40, 100, 32, "HP/MaxHP")
        self.contents.draw_text(100, 40, 200, 32, "#{@actor.hp}/#{@actor.maxhp}")
        # SP\MaxSP
        self.contents.draw_text(0, 60, 100, 32, "SP/MaxSP")
        self.contents.draw_text(100, 60, 200, 32, "#{@actor.sp}/#{@actor.maxsp}")
        # HP\MaxHP
        self.contents.draw_text(0, 80, 72, 32, "Exp/Próximo")
        self.contents.draw_text(100, 80, 200, 32, "#{@actor.now_exp}/#{@actor.next_exp}")
        # Str
        self.contents.draw_text(0, 100, 32, 32, "Str")
        self.contents.draw_text(100, 100, 100, 32, "#{@actor.str}")
        # Agi
        self.contents.draw_text(0, 120, 32, 32, "Agi")
        self.contents.draw_text(100, 120, 100, 32, "#{@actor.agi}")
        # Def
        self.contents.draw_text(0, 140, 32, 32, "Def")
        self.contents.draw_text(100, 140, 100, 32, "#{@actor.dex}")
        # Int
        self.contents.draw_text(0, 160, 32, 32, "Int")
        self.contents.draw_text(100, 160, 100, 32, "#{@actor.int}")
        # Atk
        self.contents.draw_text(0, 180, 62, 32, "Pontos")
        if $distribuir_pontos < 0
        self.contents.draw_text(100, 180, 32, 32, "0",0) 
        else 
        self.contents.draw_text(100, 180, 100, 32, $distribuir_pontos.to_s,0)
        end
      end
     
      def something_changed?
        return true if @old_lvl != @actor.level
        return true if @old_gold != $game_party.item_number(Item_Ouro::Item_Id.to_i)
        return true if @old_exp != @actor.now_exp
        return true if @old_hp != @actor.hp
        return true if @old_sp != @actor.sp
        return true if @old_maxhp != @actor.maxhp
        return true if @old_maxsp != @actor.maxsp
        return true if @old_str != @actor.str
        return true if @old_dex != @actor.dex
        return true if @old_int != @actor.int
        return true if @old_agi != @actor.agi
        return true if @old_pontos != $distribuir_pontos
        return false
      end
     
      def str
        if $distribuir_pontos >= 1
        $distribuir_pontos -= 1
        $game_actors[1].str += 1
        #$status.refresh
      else
        #$status.refresh
      end
     end
     
      def dex
      if $distribuir_pontos >= 1
      $distribuir_pontos -= 1
      $game_actors[1].dex += 1
      #$status.refresh
     else
      #$status.refresh
      end
     end
     
      def agi
        if $distribuir_pontos >= 1
        $distribuir_pontos -= 1
        $game_actors[1].agi += 1
        #$status.refresh
      else
        #$status.refresh
      end
     end
     
      def int
        if $distribuir_pontos >= 1
        $distribuir_pontos -= 1
        $game_actors[1].int += 1
        #$status.refresh
      else
        #$status.refresh
      end
     end
     

    end

    fique junto com esse script de status, sendo do lado! Ou então que cada um tenha seu button para ser clicado...
    esse o script:
    Código:
    #==============================================================================#
    # » [KM] Window Status                                                        #
    #==============================================================================#
    # » Desenvolvido por Kadu Macedo                                              #
    # » Pedido feito por Mihawk-                                                  #
    # » Visite:                                        #
    #==============================================================================#
    # » Instruções sobre como utilizar o sistema de profissões:                    #
    # Para definir a profissão de um jogador é bem simples você só                #
    # deve definir por um evento comum qual será o valor da variavel              #
    # escolhida. Você pode ver como foi feito nesse script analizando              #
    # como eu fiz o NPC de Troca de Profissão.                                    #
    #==============================================================================#
    module KDU
      #Imagem que será usada no fundo do menu
      FUNDO_MENU = "fundo_menu"
      #Barra de HP
      BARRA_HP = "barra_hp"
      #Barra de MP
      BARRA_MP = "barra_mp"
      #Barra de XP
      BARRA_XP = "barra_xp"
      #Barra de AGI
      BARRA_AGI = "barra_agi"
      #Barra de DEX
      BARRA_DEX = "barra_dex"
      #Barra de INT
      BARRA_INT = "barra_int"
      #Barra de EVA
      BARRA_STR = "barra_eva"
      #Barra de M.ATK
      BARRA_MATK = "barra_matk"
      #Barra de M.DEF
      BARRA_MDEF = "barra_mdef"
      #Barra de P.ATK
      BARRA_PATK = "barra_patk"
      #Barra de P.DEF
      BARRA_PDEF = "barra_pdef"
      #Valor Máximo dos Atributos
      STAT_MAX = 250
      #Variavel da Profissão    (Não utilize uma variavel global)
      VAR_PRO = 6
      #Profissão 1
      PRO1 = "Estudante"
      #Profissão 2
      PRO2 = "Professor"
      #Profissão 3
      PRO3 = "Monitor"
      #Profissão 4
      PRO4 = "Diretor"
    end
     
    class Window_Status2 < Window_Base
      def initialize
        super(125,90,450,310) # Posição e Tamanho do Menu
        self.contents = Bitmap.new(width - 32, height - 32)
        @dragable = true #Permite arrastar a windowskin
        @closable = true #Permite fechar a windowskin
        self.z = 999999
        self.back_opacity = 0 # Opacidade da Windowskin
        refresh
      end

      def refresh
        self.contents.clear
        @actor = $game_party.actors[0]
        # Mostra a imagem de fundo
        fundo3 = RPG::Cache.picture(KDU::FUNDO_MENU)
        fundo1 = fundo3.width
        fundo2 = fundo3.height
        fundo4 = Rect.new(0,0,fundo1,fundo2)
        self.contents.blt(0,0,fundo3,fundo4)
        # Mostra o gráfico do Personagem
        draw_actor_graphic(@actor, 150, 135)
        # Informações sobre os Equipamentos
        @data = []
        @data.push($data_weapons[@actor.weapon_id])
        @data.push($data_armors[@actor.armor1_id])
        @data.push($data_armors[@actor.armor2_id])
        @data.push($data_armors[@actor.armor3_id])
        @data.push($data_armors[@actor.armor4_id])
        # Mostra a Arma equipada
        draw_item_name2(@data[0], 95, 95)  #Posição X e Y
        # Mostra o Escudo equipado
        draw_item_name2(@data[1], 180, 95) #Posição X e Y
        # Mostra o Capaçete equipado
        draw_item_name2(@data[2], 137, 47)  #Posição X e Y
        # Mostra a Armadura equipada
        draw_item_name2(@data[3], 137, 140)  #Posição X e Y
        # Mostra o Acessório equipado
        draw_item_name2(@data[4], 181, 140) #Posição X e Y
        # Mostra o nome do Personagem
        self.contents.draw_text(140, 180, 100, 32, "#{@actor.name}")
        # Mostra o nome do Clã
        self.contents.draw_text(140, 202, 100, 32, $game_party.actors[0].guild)
        #  Exibe a Profissão do Personagem
        if $game_variables[KDU::VAR_PRO] == 1
          self.contents.draw_text(140, 224, self.width-64, 32, KDU::PRO1,0)
        end
        if $game_variables[KDU::VAR_PRO] == 2
          self.contents.draw_text(140, 224, self.width-64, 32, KDU::PRO2,0)
        end
        if $game_variables[KDU::VAR_PRO] == 3
          self.contents.draw_text(140, 224, self.width-64, 32, KDU::PRO3,0)
        end
        if $game_variables[KDU::VAR_PRO] == 4
          self.contents.draw_text(140, 224, self.width-64, 32, KDU::PRO4,0)
        end
        # Mostra a Classe do Personagem
        draw_actor_class(@actor, 85, 246)
        # Mostra a Barra de HP
        hpbar = RPG::Cache.picture(KDU::BARRA_HP)
        hpbarwidth = hpbar.width * @actor.hp / @actor.maxhp
        hpbarheight = hpbar.height
        hpbar_rect = Rect.new(0,0,hpbarwidth,hpbarheight)
        self.contents.blt(300,45,hpbar,hpbar_rect) # Posição da Barra
        # Mostra a Barra de MP
        spbar = RPG::Cache.picture(KDU::BARRA_MP)
        spbarwidth = spbar.width * @actor.sp / @actor.maxsp
        spbarheight = spbar.height
        spbar_rect = Rect.new(0,0,spbarwidth,spbarheight)
        self.contents.blt(300,65,spbar,spbar_rect) # Posição da Barra
        # Mostra a Barra de XP
        if $game_party.actors[0].level != 99
        xpbar = RPG::Cache.picture(KDU::BARRA_XP)
        xpbarwidth = xpbar.width * @actor.now_exp / @actor.next_exp
        xpbarheight = xpbar.height
        xpbar_rect = Rect.new(0,0,xpbarwidth,xpbarheight)
        self.contents.blt(300,85,xpbar,xpbar_rect) # Posição da Barra
        end
        # Mostra a Barra de P.ATK
        patkbar = RPG::Cache.picture(KDU::BARRA_PATK)
        patkbarwidth = patkbar.width * @actor.atk / KDU::STAT_MAX
        patkbarheight = patkbar.height
        patkbar_rect = Rect.new(0,0,patkbarwidth,patkbarheight)
        self.contents.blt(300,105,patkbar,patkbar_rect) # Posição da Barra
        # Mostra a Barra de P.DEF
        pdefbar = RPG::Cache.picture(KDU::BARRA_PDEF)
        pdefbarwidth = pdefbar.width * @actor.pdef / KDU::STAT_MAX
        pdefbarheight = pdefbar.height
        pdefbar_rect = Rect.new(0,0,pdefbarwidth,pdefbarheight)
        self.contents.blt(300,125,pdefbar,pdefbar_rect) # Posição da Barra
        # Mostra a Barra de M.DEF
        mdefbar = RPG::Cache.picture(KDU::BARRA_MDEF)
        mdefbarwidth = mdefbar.width * @actor.mdef / KDU::STAT_MAX
        mdefbarheight = mdefbar.height
        mdefbar_rect = Rect.new(0,0,mdefbarwidth,mdefbarheight)
        self.contents.blt(300,145,mdefbar,mdefbar_rect) # Posição da Barra
        # Mostra a Barra de DEX
        dexbar = RPG::Cache.picture(KDU::BARRA_DEX)
        dexbarwidth = dexbar.width * @actor.dex / KDU::STAT_MAX
        dexbarheight = dexbar.height
        dexbar_rect = Rect.new(0,0,dexbarwidth,dexbarheight)
        self.contents.blt(300,166,dexbar,dexbar_rect) # Posição da Barra
        # Mostra a Barra de INT
        intbar = RPG::Cache.picture(KDU::BARRA_INT)
        intbarwidth = intbar.width * @actor.int / KDU::STAT_MAX
        intbarheight = intbar.height
        intbar_rect = Rect.new(0,0,intbarwidth,intbarheight)
        self.contents.blt(300,187,intbar,intbar_rect) # Posição da Barra
        # Mostra a Barra de AGI
        agibar = RPG::Cache.picture(KDU::BARRA_AGI)
        agibarwidth = agibar.width * @actor.agi / KDU::STAT_MAX
        agibarheight = agibar.height
        agibar_rect = Rect.new(0,0,agibarwidth,agibarheight)
        self.contents.blt(300,207,agibar,agibar_rect) # Posição da Barra
        #Mostra a Barra de EVA
        strbar = RPG::Cache.picture(KDU::BARRA_STR)
        strbarwidth = strbar.width * @actor.str / KDU::STAT_MAX
        strbarheight = strbar.height
        strbar_rect = Rect.new(0,0,strbarwidth,strbarheight)
        self.contents.blt(300,227,strbar,strbar_rect) # Posição da Barra
    end

    end


    _________________
    Que o pão de queijo esteja com vocês, até!
    MalucaoBeleza
    MalucaoBeleza
    Desenvolvedor
    Desenvolvedor


    Medalhas : Adaptação de script ILtUbYveyXDIf
    Mensagens : 723
    Créditos : 58

    Adaptação de script Empty Re: Adaptação de script

    Mensagem por MalucaoBeleza Qui Dez 22, 2011 11:30 am

    cara é bem simples só vc ler ali e copiar n faço agr pq tou ocupado

      Data/hora atual: Sex Abr 26, 2024 10:27 am