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
OFWGKTA
iCoke~
6 participantes

    Sistema de skills estilo Ragnarok

    iCoke~
    iCoke~
    Membro Ativo
    Membro Ativo


    Medalhas : Sistema de skills estilo Ragnarok Trophy12
    Mensagens : 268
    Créditos : 25

    Ficha do personagem
    Nível: 1
    Experiência:
    Sistema de skills estilo Ragnarok Left_bar_bleue0/0Sistema de skills estilo Ragnarok Empty_bar_bleue  (0/0)
    Vida:
    Sistema de skills estilo Ragnarok Left_bar_bleue30/30Sistema de skills estilo Ragnarok Empty_bar_bleue  (30/30)

    Sistema de skills estilo Ragnarok Empty Sistema de skills estilo Ragnarok

    Mensagem por iCoke~ Seg Jan 09, 2017 8:59 pm

    O que é?
    É uma modificação que eu fiz nos scripts "[INP] Mouse" e "[SPR] Sprite_Hotkey" para fazer com que a utilização das skills seja parecida com a do jogo Ragnarok Online.

    O que mudou?
    Antes, você selecionava o monstro e apertava a tecla na hotkey para usar a skill no monstro selecionado. Agora você aperta a tecla na hotkey, o mouse muda o cursor(sinalizando que tem uma skill armazenada), e então você clica no monstro com o mouse para liberar a skill nele.
    Além de liberar a skill, o personagem também fala o nome da skill, como em Ragnarok.
    Se mudar de ideia e não quiser mais usar a skill, é só clicar em qualquer tile.

    Scripts: 
    [INP] Mouse:
    Código:
    #===============================================================================
    # ** Mouse
    #-------------------------------------------------------------------------------
    # By Valentine, Cybersam and Astro_mech
    #      Editado por iCoke~ (Skills estilo Ragnarok)
    #===============================================================================

    class Mouse
      # Apagar ícone original do cursor
      Win32API.new('user32', 'ShowCursor', 'i', 'i').call(0)
      # Win32 API
      ScreenToClient = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
      GetCursorPos = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
      GetClientRect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
      GetPrivateProfileStringA = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
      FindWindowA = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')
      # Outras configurações dos ícones do mouse
      MOUSE_ICON = {}
      MOUSE_ICON["Default"] = "Cursor01"
      MOUSE_ICON["Enemy"] = "001-Weapon01"
      MOUSE_ICON["Player"] = "Cursor02"
      MOUSE_ICON["NPC"] = "Cursor02"
      MOUSE_ICON["SKILL"] = "skillcursor"
      #--------------------------------------------------------------------------
      # * Variáveis Públicas
      #--------------------------------------------------------------------------
      attr_reader :x
      attr_reader :y
      attr_accessor :target_type
      attr_accessor :target
      attr_accessor :object
      #--------------------------------------------------------------------------
      # * Inicialização dos Objetos
      #--------------------------------------------------------------------------
      def initialize
        $skilling = false
        @icon = MOUSE_ICON["Default"]
        @sprite = Sprite.new
        @sprite.bitmap = RPG::Cache.icon(@icon)
        @sprite.z = 999999999
        @sprite2 = Sprite.new
        @sprite2.z = @sprite.z - 1
        @target_type = 0
        @target = 0
        @object = 0
        update
      end
      #--------------------------------------------------------------------------
      # * Obtenção da Posição do Cursor
      #--------------------------------------------------------------------------
      def get_cursor_pos
        pos = [0, 0].pack('ll')
        GetCursorPos.call(pos)
        ScreenToClient.call(HWND, pos)
        return pos.unpack('ll')
      end
      #--------------------------------------------------------------------------
      # * Obtenção do Identificador
      #--------------------------------------------------------------------------
      def self.find_window
        game_name = "\0" * 256
        GetPrivateProfileStringA.call('Game', 'Title', '', game_name, 255, ".\\Game.ini")
        game_name.delete!("\0")
        return FindWindowA.call('RGSS Player', game_name)
      end
      #--------------------------------------------------------------------------
      # * Obtenção do Cumprimento da Tela
      #--------------------------------------------------------------------------
      def get_client_rect
        rect = [0, 0, 0, 0].pack('l4')
        GetClientRect.call(HWND, rect)
        return rect.unpack('l4')[2..3]
      end
      #--------------------------------------------------------------------------
      # * Reiniciar
      #--------------------------------------------------------------------------
      def reset
        @icon = MOUSE_ICON["Default"]
        @sprite.bitmap.dispose if @sprite.bitmap != nil
        @sprite.bitmap = RPG::Cache.icon(@icon)
      end
      #--------------------------------------------------------------------------
      # * Definição do Ícone
      #--------------------------------------------------------------------------
      def set_icon=(icon)
        @sprite2.bitmap.dispose if @sprite2.bitmap != nil
        @sprite2.bitmap = RPG::Cache.icon(icon)
      end
      #--------------------------------------------------------------------------
      # * Reiniciar Gráfico
      #--------------------------------------------------------------------------
      def reset_sprite
        return if @object == 0
        clear_icon unless Input.press?(Input::Key['Mouse Left'])
      end
      #--------------------------------------------------------------------------
      # * Apagar Ícone
      #--------------------------------------------------------------------------
      def clear_icon
        @object = 0
        self.set_icon = ""
      end
      #--------------------------------------------------------------------------
      # * Apagar Alvo
      #--------------------------------------------------------------------------
      def clear_target
        if @target_type > 0
          $game_map.events[@target.id].opacity = 255 if @target_type == 1
          @target.opacity = 255 if @target_type == 2
          @target_type = 0
          @target = 0
        end
      end
      #--------------------------------------------------------------------------
      # * Atualização do Frame
      #--------------------------------------------------------------------------
      def update
        # Atualiza as coordenadas do ícone
        @x, @y = get_cursor_pos
        @sprite.x = @x if !@sprite.disposed? and @sprite.x != @x
        @sprite.y = @y if !@sprite.disposed? and @sprite.y != @y
        @sprite2.x = @x - 13 unless @sprite2.disposed?
        @sprite2.y = @y - 13 unless @sprite2.disposed?
        if $scene.is_a?(Scene_Map)
          # Se o mouse foi clicado
          mouse_interactive if Input.trigger?(Input::Key['Mouse Left'])
          mouse_netinteractive if Input.trigger?(Input::Key['Mouse Right'])
          # Se o mouse está sobre
          check_icon_to_icon
          #sistema de mouse pra skill
          if $skilling == true
           @icon = MOUSE_ICON["SKILL"]
           @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
           @sprite.bitmap = RPG::Cache.icon(@icon)
          end
    #----------------------------------------------------------------
    # * Sistema de skill estilo ragnarok
    #----------------------------------------------------------------
        #Atacando monstros.
          if $skilling == true and Input.trigger?(Input::Key['Mouse Left']) and @target_type == 1
            if $game_party.actors[0].sp >= $data_skills[$memorize].sp_cost
             if $data_skills[$memorize].scope != 1
              $data_skills[$memorize].scope = 1
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
             else
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
             end
            else
              Game_Chat.add("SP insuficiente!", Color.new(200, 0, 0))
              clear_skill_mouse
            end
        #Atacando Players.
          elsif $skilling == true and Input.trigger?(Input::Key['Mouse Left']) and @target_type == 2
            if $game_party.actors[0].sp >= $data_skills[$memorize].sp_cost
            if $data_skills[$memorize].scope != 3 and $data_skills[$memorize].power < 0
              $data_skills[$memorize].scope = 3
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
            else
              $data_skills[$memorize].scope = 1
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
             end
            else
              Game_Chat.add("SP insuficiente!", Color.new(200, 0, 0))
              clear_skill_mouse
            end
          #Buffs próprios
          elsif $skilling == true and Input.trigger?(Input::Key['Mouse Left']) and tile_x == $game_player.x and tile_y == $game_player.y and @target_type != 2
           if $game_party.actors[0].sp >= $data_skills[$memorize].sp_cost
            if $data_skills[$memorize].power < 0
              $data_skills[$memorize].scope = 3
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")
              clear_skill_mouse
            else
            clear_skill_mouse
            end
          else
            Game_Chat.add("SP insuficiente!", Color.new(200, 0, 0))
              clear_skill_mouse
            end
          elsif $skilling == true and Input.trigger?(Input::Key['Mouse Left']) and @target_type == 0
            clear_skill_mouse
          end
        end
      end
      def clear_skill_mouse
       $memorize = 0
       $skilling = false
       clear_target
      end
      #--------------------------------------------------------------------------
      # * Sobre a janela?
      #--------------------------------------------------------------------------
      def over_window?
        for w in $game_temp.windows
          return true if w.visible and w.in_area?
        end
        return false
      end
      #--------------------------------------------------------------------------
      # * Definição do Ícone de Acordo Com o Comentário
      #--------------------------------------------------------------------------
      def check_icon_to_icon
        object = get_allobject
        if object[0]
          if object[1].is_a?(Game_Event)
            list = comment_include(object[1], "Mouse")  
            return if list == nil
            # Conferir o que tem na lista
            for key in MOUSE_ICON.keys
              next if !list.include?(key)
              next if @icon == MOUSE_ICON[key]
              return if @object > 0
              @icon = MOUSE_ICON[key]
              @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
              @sprite.bitmap = RPG::Cache.icon(@icon)
            end
          elsif object[1].is_a?(Game_NetPlayer)
            if @icon != MOUSE_ICON["Player"]
              return if @object > 0
              @icon = MOUSE_ICON["Player"]
              @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
              @sprite.bitmap = RPG::Cache.icon(@icon)
            end
          end
        elsif @icon != MOUSE_ICON["Default"]
          @icon = MOUSE_ICON["Default"]
          @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
          @sprite.bitmap = RPG::Cache.icon(@icon)
        end
      end
      #--------------------------------------------------------------------------
      # * Sistema Interativo
      #--------------------------------------------------------------------------
      def mouse_interactive
        # Verificar se há algo na posição
        object = get_object
        # Se for um evento
        if object[0] and object[1].is_a?(Game_Event)
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          return if @object > 0
          return if over_window?
          # Mover a posição
          $game_player.turn_to(object[1]) if !in_direction?($game_player, object[1])
          # Selecionar evento
          list = comment_include(object[1], "ABS")
          unless list.nil?
            if $game_map.events[object[1].id].opacity == 150
              $game_map.events[object[1].id].opacity = 255
              @target_type = 0
              @target = 0
            elsif $game_map.events[object[1].id].opacity != 150
              $game_map.events[object[1].id].opacity = 150
              @target.opacity = 255 if @target_type == 2
              $game_map.events[@target.id].opacity = 255 if @target_type == 1
              @target_type = 1
              @target = object[1]
              @target = 0 if $ABS.enemies[@target.id] == nil
            end
          end
        end
        # Verificar se há algo na posição
        object = get_netobj
        # Se for um jogador
        if object[0] and object[1].is_a?(Game_NetPlayer)
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          return if @object > 0
          return if over_window?
          # Mover a posição
          $game_player.turn_to(object[1]) if !in_direction?($game_player, object[1])
          # Selecionar jogador
          return if !in_range?($game_player, object[1], 20)
          if object[1].opacity == 150
            object[1].opacity = 255
            @target_type = 0
            @target = 0
          else
            object[1].opacity = 150
            @target.opacity = 255 if @target_type == 2
            $game_map.events[@target.id].opacity = 255 if @target_type == 1
            @target_type = 2
            @target = object[1]
          end
        end
        # Se não há nada de movimento
        return if !$game_map.passable?(tile_x, tile_y, 0, $game_player)
        return if @object > 0
        return if over_window?
        return if $dragging
        $game_player.find_path(tile_x, tile_y) if Config::ATTACK == "Mouse" and @target != 0 and tile_x == @target.x and tile_y == @target.y and $game_temp.follow == 1 or Config::PATH_FIND
      end
      #--------------------------------------------------------------------------
      # * Mouse Interativo do Jogador
      #--------------------------------------------------------------------------
      def mouse_netinteractive
        # Verificar se há algo na posição
        object = get_netobj
        if object[0] and object[1].is_a?(Game_NetPlayer)
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          # Mover a posição
          $game_player.turn_to(object[1]) if !in_direction?($game_player, object[1])
          # Retornar se não estiver no alcance
          return if !in_range?($game_player, object[1], 20)
          # Iniciar
          $scene.netcommand_window.active_netcommand(@x, @y, object[1])
        end
      end
      #--------------------------------------------------------------------------
      # * Obtenção da Posição
      #--------------------------------------------------------------------------
      def get_pos(object)
        return [tile_x - 1, tile_y] if $game_map.passable?(tile_x - 1, tile_y, 0, object)
        return [tile_x, tile_y - 1] if $game_map.passable?(tile_x, tile_y - 1, 0, object)
        return [tile_x + 1, tile_y] if $game_map.passable?(tile_x + 1, tile_y, 0, object)
        return [tile_x, tile_y + 1] if $game_map.passable?(tile_x, tile_y + 1, 0, object)
        return nil
      end
      #--------------------------------------------------------------------------
      # * Obtenção do Objeto
      #--------------------------------------------------------------------------
      def get_object
        for event in $game_map.events.values
          return [true, event] if event.x == tile_x and event.y == tile_y
        end
        return [false, nil]
      end
      #--------------------------------------------------------------------------
      # * Obtenção do Objeto do Jogador
      #--------------------------------------------------------------------------
      def get_netobj
        for player in Network.mapplayers.values
          return [true, player] if player.x == tile_x and player.y == tile_y
        end
        return [false, nil]
      end
      #--------------------------------------------------------------------------
      # * Obtenção de Todos os Objetos
      #--------------------------------------------------------------------------
      def get_allobject
        for player in Network.mapplayers.values
          return [true, player] if player.x == tile_x and player.y == tile_y
        end
        for event in $game_map.events.values
          return [true, event] if event.x == tile_x and event.y == tile_y
        end
        return [false, nil]
      end
      #--------------------------------------------------------------------------
      # * Obtenção do Comentário
      #--------------------------------------------------------------------------
      def comment_include(*args)
        list = *args[0].list
        trigger = *args[1]
        return nil if list == nil
        return nil unless list.is_a?(Array)
        for item in list
          next if item.code != 108
          par = item.parameters[0].split(' ')
          return item.parameters[0] if par[0] == trigger
        end
        return nil
      end
      #--------------------------------------------------------------------------
      # * No Alcance?(Elemento, Objeto, Alcance) - Near Fantastica
      #--------------------------------------------------------------------------
      def in_range?(element, object, range)
        x = (element.x - object.x) * (element.x - object.x)
        y = (element.y - object.y) * (element.y - object.y)
        r = x + y
        return true if r <= (range * range)
        return false
      end
      #--------------------------------------------------------------------------
      # * Na Direção?(Elemento, Objeto) - Near Fantastica
      #--------------------------------------------------------------------------
      def in_direction?(element, object)
        return true if element.direction == 2 and object.y >= element.y and object.x == element.x
        return true if element.direction == 4 and object.x <= element.x and object.y == element.y
        return true if element.direction == 6 and object.x >= element.x and object.y == element.y
        return true if element.direction == 8 and object.y <= element.y and object.x == element.x
        return false
      end
      #--------------------------------------------------------------------------
      # * Retorna a Atual Coordenada X do Azulejo do Mouse que Está Sobre o Mapa
      #--------------------------------------------------------------------------
      def tile_x
        return ((($game_map.display_x.to_f / 4.0).floor + @x.to_f) / 32.0).floor
      end
      #--------------------------------------------------------------------------
      # * Retorna a Atual Coordenada Y do Azulejo do Mouse que Está Sobre o Mapa
      #--------------------------------------------------------------------------
      def tile_y
        return ((($game_map.display_y.to_f / 4.0).floor + @y.to_f) / 32.0).floor
      end
      # Impede o bug do F2
      HWND = self.find_window
    end



    [SPR] Sprite_Hotkey:

    Código:
    #==============================================================================
    # ** Sprite_Hotkey
    #------------------------------------------------------------------------------
    # By Valentine
    #    Editado por iCoke~ (Skills estilo Ragnarok)
    #==============================================================================

    class Sprite_Hotkey < RPG::Sprite
      #--------------------------------------------------------------------------
      # * Variáveis Públicas
      #--------------------------------------------------------------------------
      attr_accessor :exhausted
      #--------------------------------------------------------------------------
      # * Inicialização dos Objetos
      #--------------------------------------------------------------------------
      def initialize
        super()
        self.bitmap = Bitmap.new(30 * Config::MAX_HOTKEYS, 26)
        $game_temp.windows << self
        self.x = 235
        self.y = 13
        self.z = 999
        self.bitmap.font.size = 12
        @picture1 = RPG::Cache.picture("Hotkey1")
        @picture2 = RPG::Cache.picture("Hotkey2")
        @exhausted = 0
        @size = 30
        @memory = 0
        $memorize = 0
        refresh
      end
      #--------------------------------------------------------------------------
      # * Atualização do Frame
      #--------------------------------------------------------------------------
      def update
        use
        remove if in_area?
        if @exhausted > 0
          @exhausted += 1
          if @exhausted == 3 * 10
            @exhausted = 0
          end
        end
      end
        
      #--------------------------------------------------------------------------
      # * Atualização
      #--------------------------------------------------------------------------
      def refresh
        self.bitmap.clear
        for i in 1..Config::MAX_HOTKEYS
          x = (i - 1) % Config::MAX_HOTKEYS * @size
          self.bitmap.blt(x, 0, @picture1, Rect.new(0, 0, @picture1.width, @picture1.height))
          next if $game_party.actors[0].hotkey[i] == 0 or $game_party.actors[0].hotkey[i] == nil
          if $game_party.actors[0].hotkey[i] >= 0
            item = $data_skills[$game_party.actors[0].hotkey[i]]
          else
            item = $data_items[$game_party.actors[0].hotkey[i] * - 1]
          end
          icon = RPG::Cache.icon(item.icon_name)
          self.bitmap.blt(x + 1, 1, icon, Rect.new(0, 0, icon.width, icon.height))
          # Se for item
          if $game_party.actors[0].hotkey[i] < 0
            self.bitmap.font.color = Color.new(0, 0, 0)
            self.bitmap.draw_text(x + 27 - self.bitmap.text_size($game_party.item_number($game_party.actors[0].hotkey[i] * - 1).to_s).width, 6, 36, 32, $game_party.item_number($game_party.actors[0].hotkey[i] * - 1).to_s)
            self.bitmap.font.color = Color.new(255, 255, 255)
            self.bitmap.draw_text(x + 26 - self.bitmap.text_size($game_party.item_number($game_party.actors[0].hotkey[i] * - 1).to_s).width, 5, 36, 32, $game_party.item_number($game_party.actors[0].hotkey[i] * - 1).to_s)
          end
        end
        self.bitmap.blt(0, 0, @picture2, Rect.new(0, 0, @picture2.width, @picture2.height))
      end
      #--------------------------------------------------------------------------
      # * Usar Item/Magia da Hotkey
      #--------------------------------------------------------------------------
      def use
       return if $scene.box_active
          for i in 1..Config::MAX_HOTKEYS
          if Input.repeat?(48 + i)
            if $game_party.actors[0].hotkey[i] != 0 and $game_party.actors[0].hotkey[i] != nil
              # A condição do exausted já é feita dentro dos defs abaixo
              if $game_party.actors[0].hotkey[i] >= 0
               # $scene.skill_window.use_skill($game_party.actors[0].hotkey[i])
               $mouse.clear_target
               $memorize = $game_party.actors[0].hotkey[i]
               $skilling = true
              else
                $scene.item_window.use_item($game_party.actors[0].hotkey[i]* -1, i)
              end
            end
          end
        end
      end
      
      #--------------------------------------------------------------------------
      # * Adicionar Item
      #--------------------------------------------------------------------------
      def add_item(k)
        if $scene.item_window.item != nil
          if $scene.item_window.item.id != 0 and $scene.item_window.item.is_a?(RPG::Item)
            return if $scene.item_window.item.id == Config::GOLD_ID
            $game_party.actors[0].hotkey[k] = $scene.item_window.item.id * -1
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Adicionar Magia
      #--------------------------------------------------------------------------
      def add_skill(k)
        if $scene.skill_window.skill != nil
          if $scene.skill_window.skill.id != 0
            $game_party.actors[0].hotkey[k] = $scene.skill_window.skill.id
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Remoção do Item/Magia
      #--------------------------------------------------------------------------
      def remove
        for i in 0..Config::MAX_HOTKEYS-1
          if Input.trigger?(Input::Key['Mouse Right']) and in_area?([(i * @size), 0, @picture1.width, @picture1.height])
            $game_party.actors[0].hotkey[i + 1] = 0
            refresh
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Memorização do Item/Magia na Hotkey
      #--------------------------------------------------------------------------
      def select_skill
        for i in 0..Config::MAX_HOTKEYS-1
          if !Input.press?(Input::Key['Mouse Left']) and in_area?([(i * @size), 0, @picture1.width, @picture1.height])
            # Item
            if $mouse.object == 1
              add_item(i + 1)
            # Magia
            elsif $mouse.object == 2
              add_skill(i + 1)
            end
            refresh
          end
        end
      end
    end



    Imagem necessária na pasta Graphics/Icons:
    Nomeie-a de "skillcursor" sem aspas.
    Sistema de skills estilo Ragnarok Skillcursor_zpsrib2w48b
    Screenshots:
    Sistema de skills estilo Ragnarok Untitled-2_zpsbfrqzi0t
    Edit:
    Percebi que não funcionava para outros players, portanto o código [INP] Mouse foi corrigido e agora funciona corretamente.


    Agora você pode:

    - Atacar monstro
    - Curar monstro
    - Atacar player
    - Curar player
    - Curar a si mesmo

    Créditos:
    Valentine pelos scripts.
    iCoke~ pela edição no modo de utilizar as skills.


    Última edição por iCoke~ em Ter Jan 10, 2017 1:01 am, editado 2 vez(es)
    OFWGKTA
    OFWGKTA
    Experiente
    Experiente


    Mensagens : 408
    Créditos : 27

    Ficha do personagem
    Nível: 1
    Experiência:
    Sistema de skills estilo Ragnarok Left_bar_bleue5/50Sistema de skills estilo Ragnarok Empty_bar_bleue  (5/50)
    Vida:
    Sistema de skills estilo Ragnarok Left_bar_bleue30/30Sistema de skills estilo Ragnarok Empty_bar_bleue  (30/30)

    Sistema de skills estilo Ragnarok Empty Re: Sistema de skills estilo Ragnarok

    Mensagem por OFWGKTA Ter Jan 10, 2017 12:12 am

    Maravilhoso


    _________________
    Sistema de skills estilo Ragnarok 112898
    EVANGELION 
    iCoke~
    iCoke~
    Membro Ativo
    Membro Ativo


    Medalhas : Sistema de skills estilo Ragnarok Trophy12
    Mensagens : 268
    Créditos : 25

    Ficha do personagem
    Nível: 1
    Experiência:
    Sistema de skills estilo Ragnarok Left_bar_bleue0/0Sistema de skills estilo Ragnarok Empty_bar_bleue  (0/0)
    Vida:
    Sistema de skills estilo Ragnarok Left_bar_bleue30/30Sistema de skills estilo Ragnarok Empty_bar_bleue  (30/30)

    Sistema de skills estilo Ragnarok Empty Re: Sistema de skills estilo Ragnarok

    Mensagem por iCoke~ Ter Jan 10, 2017 12:58 am

    Obrigado! Acabei de corrigir um bug, se está com a versão antiga, sugiro que atualize Very Happy
    OFWGKTA
    OFWGKTA
    Experiente
    Experiente


    Mensagens : 408
    Créditos : 27

    Ficha do personagem
    Nível: 1
    Experiência:
    Sistema de skills estilo Ragnarok Left_bar_bleue5/50Sistema de skills estilo Ragnarok Empty_bar_bleue  (5/50)
    Vida:
    Sistema de skills estilo Ragnarok Left_bar_bleue30/30Sistema de skills estilo Ragnarok Empty_bar_bleue  (30/30)

    Sistema de skills estilo Ragnarok Empty Re: Sistema de skills estilo Ragnarok

    Mensagem por OFWGKTA Ter Jan 10, 2017 2:11 am

    iCoke~ escreveu:Obrigado! Acabei de corrigir um bug, se está com a versão antiga, sugiro que atualize Very Happy
    O problema é que uso Netplay Crystal do RD, então tenho que configurar para funcionar perfeitamente


    _________________
    Sistema de skills estilo Ragnarok 112898
    EVANGELION 
    Caio Juan
    Caio Juan
    Colaborador
    Colaborador


    Medalhas : Sistema de skills estilo Ragnarok 94Jxv
    Mensagens : 815
    Créditos : 71

    Sistema de skills estilo Ragnarok Empty Re: Sistema de skills estilo Ragnarok

    Mensagem por Caio Juan Ter Jan 10, 2017 1:04 pm

    Hum, interessante! 
    Parabéns vou dar testar ele, depois deixo uma analise melhor aqui. +1  Razz Wink Wink


    _________________
    -Não Aceito Mais do que um Mapa Perfeito-
    Sistema de skills estilo Ragnarok VfZx7

    Sistema de skills estilo Ragnarok Arenax
    Aguardem!!!
    xKyan
    xKyan
    Novato
    Novato


    Mensagens : 5
    Créditos : 0

    Sistema de skills estilo Ragnarok Empty Re: Sistema de skills estilo Ragnarok

    Mensagem por xKyan Qua Jan 11, 2017 11:44 pm

    Eai cara blz? então estou tendo um erro com o script, de uma olhada na foto

    Sistema de skills estilo Ragnarok Mcb1mp

    Eu Uso NPM 4.9 e nenhum Além do prorpio script do NP esta rodando
    iCoke~
    iCoke~
    Membro Ativo
    Membro Ativo


    Medalhas : Sistema de skills estilo Ragnarok Trophy12
    Mensagens : 268
    Créditos : 25

    Ficha do personagem
    Nível: 1
    Experiência:
    Sistema de skills estilo Ragnarok Left_bar_bleue0/0Sistema de skills estilo Ragnarok Empty_bar_bleue  (0/0)
    Vida:
    Sistema de skills estilo Ragnarok Left_bar_bleue30/30Sistema de skills estilo Ragnarok Empty_bar_bleue  (30/30)

    Sistema de skills estilo Ragnarok Empty Re: Sistema de skills estilo Ragnarok

    Mensagem por iCoke~ Qui Jan 12, 2017 12:29 pm

    xKyan escreveu:Eai cara blz? então estou tendo um erro com o script, de uma olhada na foto

    Sistema de skills estilo Ragnarok Mcb1mp

    Eu Uso NPM 4.9 e nenhum Além do prorpio script do NP esta rodando
    Tenta esses dois aqui:
    [INP] Mouse
    Código:
    #===============================================================================
    # ** Mouse Script v1 - Obrigado a Cybersam que decodificou o Windows, a fim de fazer
    #                      este trabalho. Dou-lhe o crédito, porque tudo que fiz foi adicionar algumas funções.
    #                      Sem esse script todo o meu sistema não funcionaria. Obrigado!
    #                      Eu não editaria este script, porque poderia ser facilmente desarrumado.(Astro_Mech says)
    #-------------------------------------------------------------------------------
    # Author    Cybersam
    # Edit      Valentine
    # Version   2.0
    # Date      11-04-06
    # Edit      Astro_mech
    # Edit      iCoke~ para Skill estilo Ragnarok
    #===============================================================================
    SDK.log("MouseInput", "Astro_mech", "1.1", " 15-06-14")

    #-------------------------------------------------------------------------------
    # * Verificar SDK
    #-------------------------------------------------------------------------------
    if SDK.state('MouseInput') == true
    module Mouse
      #--------------------------------------------------------------------------
      # * Inicialização
      #--------------------------------------------------------------------------
      gsm = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
      @cursor_pos = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
      module_function
      #--------------------------------------------------------------------------
      # * Posição Global do Mouse
      #--------------------------------------------------------------------------
      def mouse_global_pos
        pos = [0, 0].pack('ll')
        if @cursor_pos.call(pos) != 0
          return pos.unpack('ll')
        else
          return nil
        end
      end
      #--------------------------------------------------------------------------
      # * Posição do Mouse
      #--------------------------------------------------------------------------
      def mouse_pos(catch_anywhere = false)
        Input.mouse_update # Edição do Rataime's
        width, height = client_size
        x, y = screen_to_client(*mouse_global_pos)
        if Input.Anykey == false
          if catch_anywhere or (x >= 0 and y >= 0 and $mouse.x < width and $mouse.y < height)
            return x, y
          else
            return $mouse.x, $mouse.y
          end
        else
          return x, y
          return $mouse.x, $mouse.y
        end
      end
    end

    #--------------------------------------------------------------------------
    # * Inicialização
    #--------------------------------------------------------------------------
    $scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
    $client_rect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
    $readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
    $findwindow = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')

    #--------------------------------------------------------------------------
    # * Tela do Cliente
    #--------------------------------------------------------------------------
    def screen_to_client(x, y)
      return nil unless x and y
      pos = [x, y].pack('ll')
      if $scr2cli.call(hwnd, pos) != 0
        return pos.unpack('ll')
      else
        return nil
      end
    end
    #--------------------------------------------------------------------------
    # * H Windowed
    #--------------------------------------------------------------------------
    def hwnd
      game_name = "\0" * 256
      $readini.call('Game','Title','',game_name,255,".\\Game.ini")
      game_name.delete!("\0")
      return $findwindow.call('RGSS Player',game_name)
    end
    #--------------------------------------------------------------------------
    # * Tamanho do cliente
    #--------------------------------------------------------------------------
    def client_size
      rect = [0, 0, 0, 0].pack('l4')
      $client_rect.call(hwnd, rect)
      right, bottom = rect.unpack('l4')[2..3]
      return right, bottom
    end

    end
    #-------------------------------------------------------------------------------
    # * Fim do SDK
    #-------------------------------------------------------------------------------
    #===============================================================================
    # ** Mouse Script v1 - Controlls the Mouse's functions, inlcuding drawing.
    #                       + Event Map Interaction by MrMo, Merged by trebor777
    #-------------------------------------------------------------------------------
    # Author    Astro_mech
    # Version   1.3
    # Date      15-11-06
    # Edit      Me™, Mr.Mo and trebor777
    #===============================================================================
    SDK.log("Mouse", "Astro_mech", "1.3", " 13-04-06")

    #-------------------------------------------------------------------------------
    # * Verificar SDK
    #-------------------------------------------------------------------------------
    if SDK.state('Mouse')
      cursor = Win32API.new("user32", "ShowCursor", "i", "i" )
      cursor.call(0)
      
    class Game_Mouse
      MOUSE_ICON = {}
      MOUSE_ICON["Default"] = "Cursor01" # Ícone do mouse padrão
      # Outras configurações dos ícones do mouse
      MOUSE_ICON["NPC"] = "Cursor02"
      MOUSE_ICON["Item"] = "Cursor03"
      MOUSE_ICON["Event"] = "Cursor02"
      MOUSE_ICON["Enemy"] = "001-Weapon01"
      MOUSE_ICON["NETPLAYER"] = "Cursor02"
      MOUSE_ICON["SKILL"] = "skillcursor"
      #--------------------------------------------------------------------------
      # * Variáveis Públicas
      #--------------------------------------------------------------------------
      attr_accessor :target_type
      attr_accessor :target
      attr_accessor :icon
      attr_accessor :object
      attr_reader :x
      attr_reader :y
      #--------------------------------------------------------------------------
      # * Inicialização dos Objetos
      #--------------------------------------------------------------------------
      def initialize
        $skilling = false
        @x = 0
        @y = 0
        @icon = MOUSE_ICON["Default"]
        @sprite = Sprite.new
        @sprite.opacity = 0
        @sprite.z = 999999999
        @target_type = 0
        @target = 0
        @sprite2 = Sprite.new
        @object = 0
      end
      #--------------------------------------------------------------------------
      # * Reiniciar
      #--------------------------------------------------------------------------
      def reset
        @icon = MOUSE_ICON["Default"]
        @sprite.dispose if @sprite.bitmap != nil
        @sprite = Sprite.new
        @sprite.bitmap = RPG::Cache.icon(@icon)
        # Atualiza as coordenadas do ícone
        @x, @y = Mouse.mouse_pos
        @sprite.x = @x
        @sprite.y = @y
        @sprite.z = 999999999
      end
      #--------------------------------------------------------------------------
      # * Definir Ícone
      #--------------------------------------------------------------------------
      def set_icon=(image)
        @sprite2.bitmap.dispose if @sprite2.bitmap != nil
        @sprite2 = Sprite.new
        @sprite2.bitmap = RPG::Cache.icon(image)
        @sprite2.z = 99999999
        @sprite2.x = @x - 13
        @sprite2.y = @y - 13
      end
      #--------------------------------------------------------------------------
      # * Reiniciar Gráfico
      #--------------------------------------------------------------------------
      def reset_sprite
        return if @object == 0
        unless Input.pressed?(Input::Mouse_Left)
          @object = 0
          # Não retire o '$mouse.'
          $mouse.set_icon = ""
        end
      end
      #--------------------------------------------------------------------------
      # * Apagar Alvo
      #--------------------------------------------------------------------------
      def clear_target
        if @target_type > 0
          $game_map.events[@target.id].opacity = 255 if @target_type == 1
          @target.opacity = 255 if @target_type == 2
          @target_type = 0
          @target = 0
        end
      end
      #--------------------------------------------------------------------------
      # * Atualização do Frame
      #--------------------------------------------------------------------------
      def update
        # Atualiza as coordenadas do ícone
        @old_x = @x # Impede o bug do F2
        @old_y = @y # Impede o bug do F2
        @x, @y = Mouse.mouse_pos
        @x = @old_x if @x == nil # Impede o bug do F2
        @y = @old_y if @y == nil # Impede o bug do F2
        @sprite.x = @x
        @sprite.y = @y
        @sprite2.x = @x - 13 unless @sprite2.disposed?
        @sprite2.y = @y - 13 unless @sprite2.disposed?
        if $scene.is_a?(Scene_Map)
          # Se o mouse foi clicado
          mouse_interactive if Input.trigger(Input::Mouse_Left)
          mouse_netinteractive if Input.trigger(Input::Mouse_Right)
          # Se o mouse está sobre
          check_icon_to_icon
          #sistema de mouse pra skill
          if $skilling == true
           @icon = MOUSE_ICON["SKILL"]
           @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
           @sprite.bitmap = RPG::Cache.icon(@icon)
          end
    #----------------------------------------------------------------
    # * Sistema de skill estilo ragnarok
    #----------------------------------------------------------------
        #Atacando monstros.
          if $skilling == true and Input.pressed?(Input::Mouse_Left) and @target_type == 1
            if $game_party.actors[0].sp >= $data_skills[$memorize].sp_cost
             if $data_skills[$memorize].scope != 1
              $data_skills[$memorize].scope = 1
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
             else
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
             end
            else
              Game_Chat.add("SP insuficiente!", Color.new(200, 0, 0))
              clear_skill_mouse
            end
        #Atacando Players.
          elsif $skilling == true and Input.pressed?(Input::Mouse_Left) and @target_type == 2
            if $game_party.actors[0].sp >= $data_skills[$memorize].sp_cost
            if $data_skills[$memorize].scope != 3 and $data_skills[$memorize].power < 0
              $data_skills[$memorize].scope = 3
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
            else
              $data_skills[$memorize].scope = 1
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
             end
            else
              Game_Chat.add("SP insuficiente!", Color.new(200, 0, 0))
              clear_skill_mouse
            end
          #Buffs próprios
          elsif $skilling == true and Input.pressed?(Input::Mouse_Left) and tile_x == $game_player.x and tile_y == $game_player.y and @target_type != 2
           if $game_party.actors[0].sp >= $data_skills[$memorize].sp_cost
            if $data_skills[$memorize].power < 0
              $data_skills[$memorize].scope = 3
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")
              clear_skill_mouse
            else
            clear_skill_mouse
            end
          else
            Game_Chat.add("SP insuficiente!", Color.new(200, 0, 0))
              clear_skill_mouse
            end
          elsif $skilling == true and Input.pressed?(Input::Mouse_Left) and @target_type == 0
            clear_skill_mouse
          end
        end
      end
      def clear_skill_mouse
       $memorize = 0
       $skilling = false
       clear_target
      end
      #--------------------------------------------------------------------------
      # * Definir Ícone de Acordo Com o Comentário
      #--------------------------------------------------------------------------
      def check_icon_to_icon
        object = get_allobject
        if object[0]
          if object[1].is_a?(Game_Event)
            list = comment_include(object[1], "Mouse")  
            return if list == nil
            # Conferir o que tem na lista
            for key in MOUSE_ICON.keys
              next if !list.include?(key)
              next if @icon == MOUSE_ICON[key]
              return if @object > 0
              @icon = MOUSE_ICON[key]
              @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
              @sprite.bitmap = RPG::Cache.icon(@icon)
            end
          elsif object[1].is_a?(Game_NetPlayer)
            # Conferir o que tem na lista
            if @icon != MOUSE_ICON["NETPLAYER"]
              return if @object > 0
              @icon = MOUSE_ICON["NETPLAYER"]
              @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
              @sprite.bitmap = RPG::Cache.icon(@icon)
            end
          end
        elsif @icon != MOUSE_ICON["Default"]
          @icon = MOUSE_ICON["Default"]
          @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
          @sprite.bitmap = RPG::Cache.icon(@icon)
        end
      end
      #--------------------------------------------------------------------------
      # * Sistema Interativo
      #--------------------------------------------------------------------------
      def mouse_interactive
        # Verificar se há algo na posição
        object = get_object
        if object[0] and object[1].is_a?(Game_Event)
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          return if @object > 0
          return if $scene.windows_area?
          # Mover a posição
          $game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
          # Selecionar evento
          list = comment_include(object[1], "ABS")
          unless list.nil?
            if $game_map.events[object[1].id].opacity == 150
              $game_map.events[object[1].id].opacity = 255
              @target_type = 0
              @target = 0
            else
              $game_map.events[object[1].id].opacity = 150
              @target.opacity = 255 if @target_type == 2
              $game_map.events[@target.id].opacity = 255 if @target_type == 1
              @target_type = 1
              @target = object[1]
              @target = 0 if $ABS.enemies[@target.id] == nil
            end
          end
        end
        
        # Verificar se há algo na posição
        object = get_netobj
        if object[0] and object[1].is_a?(Game_NetPlayer)
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          return if @object > 0
          return if $scene.windows_area?
          # Mover a posição
          $game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
          # Selecionar jogador
          return if !in_range?($game_player, object[1], 20)
          if object[1].opacity == 150
            object[1].opacity = 255
            @target_type = 0
            @target = 0
          else
            object[1].opacity = 150
            @target.opacity = 255 if @target_type == 2
            $game_map.events[@target.id].opacity = 255 if @target_type == 1
            @target_type = 2
            @target = object[1]
          end
        end
        
        if object[0] and object[1].is_a?(Game_Event)
          list = comment_include(object[1], "Mouse")
          return if list == nil
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          # Mover a posição
          return $game_player.find_path(pos[0], pos[1]) if list.include?("Cursor") and !in_range?($game_player, object[1], 1)
          $game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
          # Retornar se não estiver na direção ou no alcance
          return if !in_direction?($game_player,object[1]) or !in_range?($game_player, object[1], 1)
          # Iniciar
          object[1].start if list.include?("Cursor")
          #return
        end
        
        # Se não há nada de movimento
        return if !$game_map.passable?(tile_x, tile_y, 0, $game_player)
        return if @object > 0
        return if $scene.windows_area?
        #return if $game_temp.in_area
        return if $dragging
        $game_player.find_path(tile_x, tile_y) if Config::ATTACK == "Mouse" and @target != 0 and tile_x == @target.x and tile_y == @target.y and $game_temp.follow == 1 or Config::PATHFIND
      end
      #--------------------------------------------------------------------------
      # * Mouse Interativo do Jogador
      #--------------------------------------------------------------------------
      def mouse_netinteractive
        # Verificar se há algo na posição
        object = get_netobj
        if object[0] and object[1].is_a?(Game_NetPlayer)
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          # Mover a posição
          $game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
          # Retornar se não estiver no alcance
          return if !in_range?($game_player, object[1], 20)
          # Iniciar
          $scene.netcommand.active_netcommand(@x,@y,object[1])
        end
      end
      #--------------------------------------------------------------------------
      # * Obter Posição
      #--------------------------------------------------------------------------
      def get_pos(object)
        return [tile_x-1,tile_y] if $game_map.passable?(tile_x-1, tile_y, 0, object)
        return [tile_x,tile_y-1] if $game_map.passable?(tile_x, tile_y-1, 0, object)
        return [tile_x+1,tile_y] if $game_map.passable?(tile_x+1, tile_y, 0, object)
        return [tile_x,tile_y+1] if $game_map.passable?(tile_x, tile_y+1, 0, object)
        return nil
      end
      #--------------------------------------------------------------------------
      # * Obter Objeto
      #--------------------------------------------------------------------------
      def get_object
        for event in $game_map.events.values
          return [true,event] if event.x == tile_x and event.y == tile_y
        end
        return [false,nil]
      end
      #--------------------------------------------------------------------------
      # * Obter Objeto do Jogador
      #--------------------------------------------------------------------------
      def get_netobj
        for player in Network::Main.mapplayers.values
          return [true,player] if player.x == tile_x and player.y == tile_y
        end
        return [false,nil]
      end
      #--------------------------------------------------------------------------
      # * Obter Todos os Objetos
      #--------------------------------------------------------------------------
      def get_allobject
        for player in Network::Main.mapplayers.values
          return [true,player] if player.x == tile_x and player.y == tile_y
        end
        for event in $game_map.events.values
          return [true,event] if event.x == tile_x and event.y == tile_y
        end
        return [false,nil]
      end
      #--------------------------------------------------------------------------
      # * Obter Comentário
      #--------------------------------------------------------------------------
      def comment_include(*args)
        list = *args[0].list
        trigger = *args[1]
        return nil if list == nil
        return nil unless list.is_a?(Array)
        for item in list
          next if item.code != 108
          par = item.parameters[0].split(' ')
          return item.parameters[0] if par[0] == trigger
        end
        return nil
      end
      #--------------------------------------------------------------------------
      # * No Alcance?(Elemento, Objeto, Alcance) - Near Fantastica
      #--------------------------------------------------------------------------
      def in_range?(element, object, range)
        x = (element.x - object.x) * (element.x - object.x)
        y = (element.y - object.y) * (element.y - object.y)
        r = x + y
        return true if r <= (range * range)
        return false
      end
      #--------------------------------------------------------------------------
      # * Na Direção?(Elemento, Objeto) - Near Fantastica
      #--------------------------------------------------------------------------
      def in_direction?(element, object)
        return true if element.direction == 2 and object.y >= element.y and object.x == element.x
        return true if element.direction == 4 and object.x <= element.x and object.y == element.y
        return true if element.direction == 6 and object.x >= element.x and object.y == element.y
        return true if element.direction == 8 and object.y <= element.y and object.x == element.x
        return false
      end
      #--------------------------------------------------------------------------
      # * Retorna a Atual Coordenada X do Azulejo do Mouse que Está Sobre o Mapa
      #--------------------------------------------------------------------------
      def tile_x
        return ((($game_map.display_x.to_f/4.0).floor + @x.to_f)/32.0).floor
      end
      #--------------------------------------------------------------------------
      # * Retorna a Atual Coordenada Y do Azulejo do Mouse que Está Sobre o Mapa
      #--------------------------------------------------------------------------
      def tile_y
        return ((($game_map.display_y.to_f/4.0).floor + @y.to_f)/32.0).floor
      end
      #--------------------------------------------------------------------------
      # * Desaparecer
      #--------------------------------------------------------------------------
      def invisible
        @sprite.opacity = 0
      end
      #--------------------------------------------------------------------------
      # * Tornar Visível
      #--------------------------------------------------------------------------
      def visible
        @sprite.opacity = 255
      end
      #--------------------------------------------------------------------------
      # * Exibição
      #--------------------------------------------------------------------------
      def dispose
        @sprite.dispose
      end
    end
    end
    #-------------------------------------------------------------------------------
    # * Fim do SDK
    #-------------------------------------------------------------------------------

    [SPR] Hotkey

    Código:
    #==============================================================================
    # ** Hotkey
    #------------------------------------------------------------------------------
    # By Valentine
    #   Editado por iCoke~ para Skills estilo Ragnarok
    #==============================================================================

    class Hotkey < RPG::Sprite
      #--------------------------------------------------------------------------
      # * Inicialização dos Objetos
      #--------------------------------------------------------------------------
      def initialize
        super()
        self.bitmap = Bitmap.new(270,26)
        self.x = 235
        self.y = 13
        self.z = 999
        self.bitmap.font.size = 12
        @picture1 = RPG::Cache.picture("Hotkey1")
        @picture2 = RPG::Cache.picture("Hotkey2")
        @exhausted = 0
        @size = 30
        refresh
      end
      #--------------------------------------------------------------------------
      # * Atualização do Frame
      #--------------------------------------------------------------------------
      def update
        use
        remove if in_area?
        if @exhausted > 0
          @exhausted += 1
          if @exhausted == 3 * 10
            @exhausted = 0
          end
        end
        # Mudar opacidade
        #if $game_player.x >= self.x/32 and $game_player.x <= self.bitmap.width/32 and $game_player.y >= self.y/32 and $game_player.y <= self.bitmap.height/32 and self.opacity != 150
          #self.opacity = 150
        #elsif $game_player.x < self.x/32 or $game_player.x > self.bitmap.width/32 or $game_player.y < self.y/32 or $game_player.y > self.bitmap.height/32 and self.opacity == 150
          #self.opacity = 255
        #end
      end
      #--------------------------------------------------------------------------
      # * Atualização
      #--------------------------------------------------------------------------
      def refresh
        self.bitmap.clear
        for i in 1..Config::MAX_HOTKEYS
          x = (i-1) % Config::MAX_HOTKEYS * @size
          self.bitmap.blt(x, 0, @picture1, Rect.new(0, 0, @picture1.width, @picture1.height))
          next if $game_party.actors[0].hotkey[i] == 0 or $game_party.actors[0].hotkey[i] == nil
          if $game_party.actors[0].hotkey[i] >= 0
            item = $data_skills[$game_party.actors[0].hotkey[i]]
          else
            item = $data_items[$game_party.actors[0].hotkey[i]*-1]
          end
          icon = RPG::Cache.icon(item.icon_name)
          self.bitmap.blt(x+1, 1, icon, Rect.new(0, 0, icon.width, icon.height))
          # Se for item
          if $game_party.actors[0].hotkey[i] < 0
            self.bitmap.font.color = Color.new(0,0,0)
            self.bitmap.draw_text(x+27 - self.bitmap.text_size($game_party.item_number($game_party.actors[0].hotkey[i]*-1).to_s).width, 6, 36, 32, $game_party.item_number($game_party.actors[0].hotkey[i]*-1).to_s)
            self.bitmap.font.color = Color.new(255,255,255)
            self.bitmap.draw_text(x+26 - self.bitmap.text_size($game_party.item_number($game_party.actors[0].hotkey[i]*-1).to_s).width, 5, 36, 32, $game_party.item_number($game_party.actors[0].hotkey[i]*-1).to_s)
          end
        end
        self.bitmap.blt(0, 0, @picture2, Rect.new(0, 0, @picture2.width, @picture2.height))
      end
      #--------------------------------------------------------------------------
      # * Usar Item/Magia da Hotkey
      #--------------------------------------------------------------------------
      def use
        #return if $scene.currency_window.currency_box.active
        return if $scene.box_active
        for i in 1..Config::MAX_HOTKEYS
          if Input.trigger?(48+i)
            if $game_party.actors[0].hotkey[i] != 0 and $game_party.actors[0].hotkey[i] != nil
              # Não mude de lugar as duas linhas abaixo
              return if @exhausted > 0
              @exhausted = 1
              if $game_party.actors[0].hotkey[i] >= 0
               # $scene.skill_window.use_skill($game_party.actors[0].hotkey[i])
               $mouse.clear_target
               $memorize = $game_party.actors[0].hotkey[i]
               $skilling = true
              else
                $scene.item_window.use_item($game_party.actors[0].hotkey[i]* -1, i)
              end
            end
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Adicionar Item
      #--------------------------------------------------------------------------
      def add_item(k)
        if $scene.item_window.item != nil
          if $scene.item_window.item.id != 0 and $scene.item_window.item.is_a?(RPG::Item)
            $game_party.actors[0].hotkey[k] = $scene.item_window.item.id * -1
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Adicionar Magia
      #--------------------------------------------------------------------------
      def add_skill(k)
        if $scene.skill_window.skill != nil
          if $scene.skill_window.skill.id != 0
            $game_party.actors[0].hotkey[k] = $scene.skill_window.skill.id
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Remover Item/Magia
      #--------------------------------------------------------------------------
      def remove
        for i in 0..Config::MAX_HOTKEYS-1
          if Input.pressed?(Input::Mouse_Right) and in_area?([(i*@size), 0,@picture1.width, @picture1.height])
            $game_party.actors[0].hotkey[i+1] = 0
            refresh
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Memorizar Item/Magia na Hotkey
      #--------------------------------------------------------------------------
      def select_skill
        for i in 0..Config::MAX_HOTKEYS-1
          if !Input.pressed?(Input::Mouse_Left) and in_area?([(i*@size), 0,@picture1.width, @picture1.height])
            # Item
            if $mouse.object == 1
              add_item(i+1)
            # Magia
            elsif $mouse.object == 2
              add_skill(i+1)
            end
            refresh
          end
        end
      end
    end
    Adanrox
    Adanrox
    Diva
    Diva


    Mensagens : 522
    Créditos : 74

    Ficha do personagem
    Nível: 1
    Experiência:
    Sistema de skills estilo Ragnarok Left_bar_bleue0/0Sistema de skills estilo Ragnarok Empty_bar_bleue  (0/0)
    Vida:
    Sistema de skills estilo Ragnarok Left_bar_bleue30/30Sistema de skills estilo Ragnarok Empty_bar_bleue  (30/30)

    Sistema de skills estilo Ragnarok Empty Re: Sistema de skills estilo Ragnarok

    Mensagem por Adanrox Qui Jan 12, 2017 12:57 pm

    - Gostei das editações, bem utiu para alguns.

    + 1 Credito


    _________________
    Sistema de skills estilo Ragnarok EiLDYSs
    xKyan
    xKyan
    Novato
    Novato


    Mensagens : 5
    Créditos : 0

    Sistema de skills estilo Ragnarok Empty Re: Sistema de skills estilo Ragnarok

    Mensagem por xKyan Qui Jan 12, 2017 9:36 pm

    Tenta esses dois aqui: escreveu:[INP] Mouse
    Código:
    #===============================================================================
    # ** Mouse Script v1 - Obrigado a Cybersam que decodificou o Windows, a fim de fazer
    #                      este trabalho. Dou-lhe o crédito, porque tudo que fiz foi adicionar algumas funções.
    #                      Sem esse script todo o meu sistema não funcionaria. Obrigado!
    #                      Eu não editaria este script, porque poderia ser facilmente desarrumado.(Astro_Mech says)
    #-------------------------------------------------------------------------------
    # Author    Cybersam
    # Edit      Valentine
    # Version   2.0
    # Date      11-04-06
    # Edit      Astro_mech
    # Edit      iCoke~ para Skill estilo Ragnarok
    #===============================================================================
    SDK.log("MouseInput", "Astro_mech", "1.1", " 15-06-14")

    #-------------------------------------------------------------------------------
    # * Verificar SDK
    #-------------------------------------------------------------------------------
    if SDK.state('MouseInput') == true
    module Mouse
      #--------------------------------------------------------------------------
      # * Inicialização
      #--------------------------------------------------------------------------
      gsm = Win32API.new('user32', 'GetSystemMetrics', 'i', 'i')
      @cursor_pos = Win32API.new('user32', 'GetCursorPos', 'p', 'i')
      module_function
      #--------------------------------------------------------------------------
      # * Posição Global do Mouse
      #--------------------------------------------------------------------------
      def mouse_global_pos
        pos = [0, 0].pack('ll')
        if @cursor_pos.call(pos) != 0
          return pos.unpack('ll')
        else
          return nil
        end
      end
      #--------------------------------------------------------------------------
      # * Posição do Mouse
      #--------------------------------------------------------------------------
      def mouse_pos(catch_anywhere = false)
        Input.mouse_update # Edição do Rataime's
        width, height = client_size
        x, y = screen_to_client(*mouse_global_pos)
        if Input.Anykey == false
          if catch_anywhere or (x >= 0 and y >= 0 and $mouse.x < width and $mouse.y < height)
            return x, y
          else
            return $mouse.x, $mouse.y
          end
        else
          return x, y
          return $mouse.x, $mouse.y
        end
      end
    end

    #--------------------------------------------------------------------------
    # * Inicialização
    #--------------------------------------------------------------------------
    $scr2cli = Win32API.new('user32', 'ScreenToClient', %w(l p), 'i')
    $client_rect = Win32API.new('user32', 'GetClientRect', %w(l p), 'i')
    $readini = Win32API.new('kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l')
    $findwindow = Win32API.new('user32', 'FindWindowA', %w(p p), 'l')

    #--------------------------------------------------------------------------
    # * Tela do Cliente
    #--------------------------------------------------------------------------
    def screen_to_client(x, y)
      return nil unless x and y
      pos = [x, y].pack('ll')
      if $scr2cli.call(hwnd, pos) != 0
        return pos.unpack('ll')
      else
        return nil
      end
    end
    #--------------------------------------------------------------------------
    # * H Windowed
    #--------------------------------------------------------------------------
    def hwnd
      game_name = "\0" * 256
      $readini.call('Game','Title','',game_name,255,".\\Game.ini")
      game_name.delete!("\0")
      return $findwindow.call('RGSS Player',game_name)
    end
    #--------------------------------------------------------------------------
    # * Tamanho do cliente
    #--------------------------------------------------------------------------
    def client_size
      rect = [0, 0, 0, 0].pack('l4')
      $client_rect.call(hwnd, rect)
      right, bottom = rect.unpack('l4')[2..3]
      return right, bottom
    end

    end
    #-------------------------------------------------------------------------------
    # * Fim do SDK
    #-------------------------------------------------------------------------------
    #===============================================================================
    # ** Mouse Script v1 - Controlls the Mouse's functions, inlcuding drawing.
    #                       + Event Map Interaction by MrMo, Merged by trebor777
    #-------------------------------------------------------------------------------
    # Author    Astro_mech
    # Version   1.3
    # Date      15-11-06
    # Edit      Me™, Mr.Mo and trebor777
    #===============================================================================
    SDK.log("Mouse", "Astro_mech", "1.3", " 13-04-06")

    #-------------------------------------------------------------------------------
    # * Verificar SDK
    #-------------------------------------------------------------------------------
    if SDK.state('Mouse')
      cursor = Win32API.new("user32", "ShowCursor", "i", "i" )
      cursor.call(0)
      
    class Game_Mouse
      MOUSE_ICON = {}
      MOUSE_ICON["Default"] = "Cursor01" # Ícone do mouse padrão
      # Outras configurações dos ícones do mouse
      MOUSE_ICON["NPC"] = "Cursor02"
      MOUSE_ICON["Item"] = "Cursor03"
      MOUSE_ICON["Event"] = "Cursor02"
      MOUSE_ICON["Enemy"] = "001-Weapon01"
      MOUSE_ICON["NETPLAYER"] = "Cursor02"
      MOUSE_ICON["SKILL"] = "skillcursor"
      #--------------------------------------------------------------------------
      # * Variáveis Públicas
      #--------------------------------------------------------------------------
      attr_accessor :target_type
      attr_accessor :target
      attr_accessor :icon
      attr_accessor :object
      attr_reader :x
      attr_reader :y
      #--------------------------------------------------------------------------
      # * Inicialização dos Objetos
      #--------------------------------------------------------------------------
      def initialize
        $skilling = false
        @x = 0
        @y = 0
        @icon = MOUSE_ICON["Default"]
        @sprite = Sprite.new
        @sprite.opacity = 0
        @sprite.z = 999999999
        @target_type = 0
        @target = 0
        @sprite2 = Sprite.new
        @object = 0
      end
      #--------------------------------------------------------------------------
      # * Reiniciar
      #--------------------------------------------------------------------------
      def reset
        @icon = MOUSE_ICON["Default"]
        @sprite.dispose if @sprite.bitmap != nil
        @sprite = Sprite.new
        @sprite.bitmap = RPG::Cache.icon(@icon)
        # Atualiza as coordenadas do ícone
        @x, @y = Mouse.mouse_pos
        @sprite.x = @x
        @sprite.y = @y
        @sprite.z = 999999999
      end
      #--------------------------------------------------------------------------
      # * Definir Ícone
      #--------------------------------------------------------------------------
      def set_icon=(image)
        @sprite2.bitmap.dispose if @sprite2.bitmap != nil
        @sprite2 = Sprite.new
        @sprite2.bitmap = RPG::Cache.icon(image)
        @sprite2.z = 99999999
        @sprite2.x = @x - 13
        @sprite2.y = @y - 13
      end
      #--------------------------------------------------------------------------
      # * Reiniciar Gráfico
      #--------------------------------------------------------------------------
      def reset_sprite
        return if @object == 0
        unless Input.pressed?(Input::Mouse_Left)
          @object = 0
          # Não retire o '$mouse.'
          $mouse.set_icon = ""
        end
      end
      #--------------------------------------------------------------------------
      # * Apagar Alvo
      #--------------------------------------------------------------------------
      def clear_target
        if @target_type > 0
          $game_map.events[@target.id].opacity = 255 if @target_type == 1
          @target.opacity = 255 if @target_type == 2
          @target_type = 0
          @target = 0
        end
      end
      #--------------------------------------------------------------------------
      # * Atualização do Frame
      #--------------------------------------------------------------------------
      def update
        # Atualiza as coordenadas do ícone
        @old_x = @x # Impede o bug do F2
        @old_y = @y # Impede o bug do F2
        @x, @y = Mouse.mouse_pos
        @x = @old_x if @x == nil # Impede o bug do F2
        @y = @old_y if @y == nil # Impede o bug do F2
        @sprite.x = @x
        @sprite.y = @y
        @sprite2.x = @x - 13 unless @sprite2.disposed?
        @sprite2.y = @y - 13 unless @sprite2.disposed?
        if $scene.is_a?(Scene_Map)
          # Se o mouse foi clicado
          mouse_interactive if Input.trigger(Input::Mouse_Left)
          mouse_netinteractive if Input.trigger(Input::Mouse_Right)
          # Se o mouse está sobre
          check_icon_to_icon
          #sistema de mouse pra skill
          if $skilling == true
           @icon = MOUSE_ICON["SKILL"]
           @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
           @sprite.bitmap = RPG::Cache.icon(@icon)
          end
    #----------------------------------------------------------------
    # * Sistema de skill estilo ragnarok
    #----------------------------------------------------------------
        #Atacando monstros.
          if $skilling == true and Input.pressed?(Input::Mouse_Left) and @target_type == 1
            if $game_party.actors[0].sp >= $data_skills[$memorize].sp_cost
             if $data_skills[$memorize].scope != 1
              $data_skills[$memorize].scope = 1
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
             else
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
             end
            else
              Game_Chat.add("SP insuficiente!", Color.new(200, 0, 0))
              clear_skill_mouse
            end
        #Atacando Players.
          elsif $skilling == true and Input.pressed?(Input::Mouse_Left) and @target_type == 2
            if $game_party.actors[0].sp >= $data_skills[$memorize].sp_cost
            if $data_skills[$memorize].scope != 3 and $data_skills[$memorize].power < 0
              $data_skills[$memorize].scope = 3
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
            else
              $data_skills[$memorize].scope = 1
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")        
              clear_skill_mouse
             end
            else
              Game_Chat.add("SP insuficiente!", Color.new(200, 0, 0))
              clear_skill_mouse
            end
          #Buffs próprios
          elsif $skilling == true and Input.pressed?(Input::Mouse_Left) and tile_x == $game_player.x and tile_y == $game_player.y and @target_type != 2
           if $game_party.actors[0].sp >= $data_skills[$memorize].sp_cost
            if $data_skills[$memorize].power < 0
              $data_skills[$memorize].scope = 3
              $scene.skill_window.use_skill($memorize)
              $game_player.show_text($data_skills[$memorize].name + "!")
              clear_skill_mouse
            else
            clear_skill_mouse
            end
          else
            Game_Chat.add("SP insuficiente!", Color.new(200, 0, 0))
              clear_skill_mouse
            end
          elsif $skilling == true and Input.pressed?(Input::Mouse_Left) and @target_type == 0
            clear_skill_mouse
          end
        end
      end
      def clear_skill_mouse
       $memorize = 0
       $skilling = false
       clear_target
      end
      #--------------------------------------------------------------------------
      # * Definir Ícone de Acordo Com o Comentário
      #--------------------------------------------------------------------------
      def check_icon_to_icon
        object = get_allobject
        if object[0]
          if object[1].is_a?(Game_Event)
            list = comment_include(object[1], "Mouse")  
            return if list == nil
            # Conferir o que tem na lista
            for key in MOUSE_ICON.keys
              next if !list.include?(key)
              next if @icon == MOUSE_ICON[key]
              return if @object > 0
              @icon = MOUSE_ICON[key]
              @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
              @sprite.bitmap = RPG::Cache.icon(@icon)
            end
          elsif object[1].is_a?(Game_NetPlayer)
            # Conferir o que tem na lista
            if @icon != MOUSE_ICON["NETPLAYER"]
              return if @object > 0
              @icon = MOUSE_ICON["NETPLAYER"]
              @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
              @sprite.bitmap = RPG::Cache.icon(@icon)
            end
          end
        elsif @icon != MOUSE_ICON["Default"]
          @icon = MOUSE_ICON["Default"]
          @sprite.bitmap.dispose if @sprite.bitmap != nil or @sprite.bitmap.disposed?
          @sprite.bitmap = RPG::Cache.icon(@icon)
        end
      end
      #--------------------------------------------------------------------------
      # * Sistema Interativo
      #--------------------------------------------------------------------------
      def mouse_interactive
        # Verificar se há algo na posição
        object = get_object
        if object[0] and object[1].is_a?(Game_Event)
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          return if @object > 0
          return if $scene.windows_area?
          # Mover a posição
          $game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
          # Selecionar evento
          list = comment_include(object[1], "ABS")
          unless list.nil?
            if $game_map.events[object[1].id].opacity == 150
              $game_map.events[object[1].id].opacity = 255
              @target_type = 0
              @target = 0
            else
              $game_map.events[object[1].id].opacity = 150
              @target.opacity = 255 if @target_type == 2
              $game_map.events[@target.id].opacity = 255 if @target_type == 1
              @target_type = 1
              @target = object[1]
              @target = 0 if $ABS.enemies[@target.id] == nil
            end
          end
        end
        
        # Verificar se há algo na posição
        object = get_netobj
        if object[0] and object[1].is_a?(Game_NetPlayer)
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          return if @object > 0
          return if $scene.windows_area?
          # Mover a posição
          $game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
          # Selecionar jogador
          return if !in_range?($game_player, object[1], 20)
          if object[1].opacity == 150
            object[1].opacity = 255
            @target_type = 0
            @target = 0
          else
            object[1].opacity = 150
            @target.opacity = 255 if @target_type == 2
            $game_map.events[@target.id].opacity = 255 if @target_type == 1
            @target_type = 2
            @target = object[1]
          end
        end
        
        if object[0] and object[1].is_a?(Game_Event)
          list = comment_include(object[1], "Mouse")
          return if list == nil
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          # Mover a posição
          return $game_player.find_path(pos[0], pos[1]) if list.include?("Cursor") and !in_range?($game_player, object[1], 1)
          $game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
          # Retornar se não estiver na direção ou no alcance
          return if !in_direction?($game_player,object[1]) or !in_range?($game_player, object[1], 1)
          # Iniciar
          object[1].start if list.include?("Cursor")
          #return
        end
        
        # Se não há nada de movimento
        return if !$game_map.passable?(tile_x, tile_y, 0, $game_player)
        return if @object > 0
        return if $scene.windows_area?
        #return if $game_temp.in_area
        return if $dragging
        $game_player.find_path(tile_x, tile_y) if Config::ATTACK == "Mouse" and @target != 0 and tile_x == @target.x and tile_y == @target.y and $game_temp.follow == 1 or Config::PATHFIND
      end
      #--------------------------------------------------------------------------
      # * Mouse Interativo do Jogador
      #--------------------------------------------------------------------------
      def mouse_netinteractive
        # Verificar se há algo na posição
        object = get_netobj
        if object[0] and object[1].is_a?(Game_NetPlayer)
          # Obter a posição correta
          pos = get_pos(object[1])
          # Retornar se não houver posição
          return if pos == nil
          # Mover a posição
          $game_player.turn_to(object[1]) if !in_direction?($game_player,object[1])
          # Retornar se não estiver no alcance
          return if !in_range?($game_player, object[1], 20)
          # Iniciar
          $scene.netcommand.active_netcommand(@x,@y,object[1])
        end
      end
      #--------------------------------------------------------------------------
      # * Obter Posição
      #--------------------------------------------------------------------------
      def get_pos(object)
        return [tile_x-1,tile_y] if $game_map.passable?(tile_x-1, tile_y, 0, object)
        return [tile_x,tile_y-1] if $game_map.passable?(tile_x, tile_y-1, 0, object)
        return [tile_x+1,tile_y] if $game_map.passable?(tile_x+1, tile_y, 0, object)
        return [tile_x,tile_y+1] if $game_map.passable?(tile_x, tile_y+1, 0, object)
        return nil
      end
      #--------------------------------------------------------------------------
      # * Obter Objeto
      #--------------------------------------------------------------------------
      def get_object
        for event in $game_map.events.values
          return [true,event] if event.x == tile_x and event.y == tile_y
        end
        return [false,nil]
      end
      #--------------------------------------------------------------------------
      # * Obter Objeto do Jogador
      #--------------------------------------------------------------------------
      def get_netobj
        for player in Network::Main.mapplayers.values
          return [true,player] if player.x == tile_x and player.y == tile_y
        end
        return [false,nil]
      end
      #--------------------------------------------------------------------------
      # * Obter Todos os Objetos
      #--------------------------------------------------------------------------
      def get_allobject
        for player in Network::Main.mapplayers.values
          return [true,player] if player.x == tile_x and player.y == tile_y
        end
        for event in $game_map.events.values
          return [true,event] if event.x == tile_x and event.y == tile_y
        end
        return [false,nil]
      end
      #--------------------------------------------------------------------------
      # * Obter Comentário
      #--------------------------------------------------------------------------
      def comment_include(*args)
        list = *args[0].list
        trigger = *args[1]
        return nil if list == nil
        return nil unless list.is_a?(Array)
        for item in list
          next if item.code != 108
          par = item.parameters[0].split(' ')
          return item.parameters[0] if par[0] == trigger
        end
        return nil
      end
      #--------------------------------------------------------------------------
      # * No Alcance?(Elemento, Objeto, Alcance) - Near Fantastica
      #--------------------------------------------------------------------------
      def in_range?(element, object, range)
        x = (element.x - object.x) * (element.x - object.x)
        y = (element.y - object.y) * (element.y - object.y)
        r = x + y
        return true if r <= (range * range)
        return false
      end
      #--------------------------------------------------------------------------
      # * Na Direção?(Elemento, Objeto) - Near Fantastica
      #--------------------------------------------------------------------------
      def in_direction?(element, object)
        return true if element.direction == 2 and object.y >= element.y and object.x == element.x
        return true if element.direction == 4 and object.x <= element.x and object.y == element.y
        return true if element.direction == 6 and object.x >= element.x and object.y == element.y
        return true if element.direction == 8 and object.y <= element.y and object.x == element.x
        return false
      end
      #--------------------------------------------------------------------------
      # * Retorna a Atual Coordenada X do Azulejo do Mouse que Está Sobre o Mapa
      #--------------------------------------------------------------------------
      def tile_x
        return ((($game_map.display_x.to_f/4.0).floor + @x.to_f)/32.0).floor
      end
      #--------------------------------------------------------------------------
      # * Retorna a Atual Coordenada Y do Azulejo do Mouse que Está Sobre o Mapa
      #--------------------------------------------------------------------------
      def tile_y
        return ((($game_map.display_y.to_f/4.0).floor + @y.to_f)/32.0).floor
      end
      #--------------------------------------------------------------------------
      # * Desaparecer
      #--------------------------------------------------------------------------
      def invisible
        @sprite.opacity = 0
      end
      #--------------------------------------------------------------------------
      # * Tornar Visível
      #--------------------------------------------------------------------------
      def visible
        @sprite.opacity = 255
      end
      #--------------------------------------------------------------------------
      # * Exibição
      #--------------------------------------------------------------------------
      def dispose
        @sprite.dispose
      end
    end
    end
    #-------------------------------------------------------------------------------
    # * Fim do SDK
    #-------------------------------------------------------------------------------

    [SPR] Hotkey

    Código:
    #==============================================================================
    # ** Hotkey
    #------------------------------------------------------------------------------
    # By Valentine
    #   Editado por iCoke~ para Skills estilo Ragnarok
    #==============================================================================

    class Hotkey < RPG::Sprite
      #--------------------------------------------------------------------------
      # * Inicialização dos Objetos
      #--------------------------------------------------------------------------
      def initialize
        super()
        self.bitmap = Bitmap.new(270,26)
        self.x = 235
        self.y = 13
        self.z = 999
        self.bitmap.font.size = 12
        @picture1 = RPG::Cache.picture("Hotkey1")
        @picture2 = RPG::Cache.picture("Hotkey2")
        @exhausted = 0
        @size = 30
        refresh
      end
      #--------------------------------------------------------------------------
      # * Atualização do Frame
      #--------------------------------------------------------------------------
      def update
        use
        remove if in_area?
        if @exhausted > 0
          @exhausted += 1
          if @exhausted == 3 * 10
            @exhausted = 0
          end
        end
        # Mudar opacidade
        #if $game_player.x >= self.x/32 and $game_player.x <= self.bitmap.width/32 and $game_player.y >= self.y/32 and $game_player.y <= self.bitmap.height/32 and self.opacity != 150
          #self.opacity = 150
        #elsif $game_player.x < self.x/32 or $game_player.x > self.bitmap.width/32 or $game_player.y < self.y/32 or $game_player.y > self.bitmap.height/32 and self.opacity == 150
          #self.opacity = 255
        #end
      end
      #--------------------------------------------------------------------------
      # * Atualização
      #--------------------------------------------------------------------------
      def refresh
        self.bitmap.clear
        for i in 1..Config::MAX_HOTKEYS
          x = (i-1) % Config::MAX_HOTKEYS * @size
          self.bitmap.blt(x, 0, @picture1, Rect.new(0, 0, @picture1.width, @picture1.height))
          next if $game_party.actors[0].hotkey[i] == 0 or $game_party.actors[0].hotkey[i] == nil
          if $game_party.actors[0].hotkey[i] >= 0
            item = $data_skills[$game_party.actors[0].hotkey[i]]
          else
            item = $data_items[$game_party.actors[0].hotkey[i]*-1]
          end
          icon = RPG::Cache.icon(item.icon_name)
          self.bitmap.blt(x+1, 1, icon, Rect.new(0, 0, icon.width, icon.height))
          # Se for item
          if $game_party.actors[0].hotkey[i] < 0
            self.bitmap.font.color = Color.new(0,0,0)
            self.bitmap.draw_text(x+27 - self.bitmap.text_size($game_party.item_number($game_party.actors[0].hotkey[i]*-1).to_s).width, 6, 36, 32, $game_party.item_number($game_party.actors[0].hotkey[i]*-1).to_s)
            self.bitmap.font.color = Color.new(255,255,255)
            self.bitmap.draw_text(x+26 - self.bitmap.text_size($game_party.item_number($game_party.actors[0].hotkey[i]*-1).to_s).width, 5, 36, 32, $game_party.item_number($game_party.actors[0].hotkey[i]*-1).to_s)
          end
        end
        self.bitmap.blt(0, 0, @picture2, Rect.new(0, 0, @picture2.width, @picture2.height))
      end
      #--------------------------------------------------------------------------
      # * Usar Item/Magia da Hotkey
      #--------------------------------------------------------------------------
      def use
        #return if $scene.currency_window.currency_box.active
        return if $scene.box_active
        for i in 1..Config::MAX_HOTKEYS
          if Input.trigger?(48+i)
            if $game_party.actors[0].hotkey[i] != 0 and $game_party.actors[0].hotkey[i] != nil
              # Não mude de lugar as duas linhas abaixo
              return if @exhausted > 0
              @exhausted = 1
              if $game_party.actors[0].hotkey[i] >= 0
               # $scene.skill_window.use_skill($game_party.actors[0].hotkey[i])
               $mouse.clear_target
               $memorize = $game_party.actors[0].hotkey[i]
               $skilling = true
              else
                $scene.item_window.use_item($game_party.actors[0].hotkey[i]* -1, i)
              end
            end
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Adicionar Item
      #--------------------------------------------------------------------------
      def add_item(k)
        if $scene.item_window.item != nil
          if $scene.item_window.item.id != 0 and $scene.item_window.item.is_a?(RPG::Item)
            $game_party.actors[0].hotkey[k] = $scene.item_window.item.id * -1
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Adicionar Magia
      #--------------------------------------------------------------------------
      def add_skill(k)
        if $scene.skill_window.skill != nil
          if $scene.skill_window.skill.id != 0
            $game_party.actors[0].hotkey[k] = $scene.skill_window.skill.id
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Remover Item/Magia
      #--------------------------------------------------------------------------
      def remove
        for i in 0..Config::MAX_HOTKEYS-1
          if Input.pressed?(Input::Mouse_Right) and in_area?([(i*@size), 0,@picture1.width, @picture1.height])
            $game_party.actors[0].hotkey[i+1] = 0
            refresh
          end
        end
      end
      #--------------------------------------------------------------------------
      # * Memorizar Item/Magia na Hotkey
      #--------------------------------------------------------------------------
      def select_skill
        for i in 0..Config::MAX_HOTKEYS-1
          if !Input.pressed?(Input::Mouse_Left) and in_area?([(i*@size), 0,@picture1.width, @picture1.height])
            # Item
            if $mouse.object == 1
              add_item(i+1)
            # Magia
            elsif $mouse.object == 2
              add_skill(i+1)
            end
            refresh
          end
        end
      end
    end

    Ja corrigi o problema,era meu NP que estava desatualizado, mas vlw +1
    avatar
    joao662
    Novato
    Novato


    Mensagens : 2
    Créditos : 0

    Sistema de skills estilo Ragnarok Empty valew :D

    Mensagem por joao662 Qui Fev 09, 2017 12:24 pm

    valew Very Happy

    Conteúdo patrocinado


    Sistema de skills estilo Ragnarok Empty Re: Sistema de skills estilo Ragnarok

    Mensagem por Conteúdo patrocinado


      Data/hora atual: Sex Abr 26, 2024 9:53 pm