Ace 스크립트

스킬을 훔치는 시스템입니다.


돈 밝히는 모 게임회사의 온라인게임에서 새로나온 직업이 아마 이런 기술을 가지고 있죠?


저는 아직 rgss가 미숙해서 잘 이해가 되진 않지만, 잘 아시는 분들이 아마 잘 활용하리라 믿습니다.


출처 : http://translate.googleusercontent.com/translate_c?hl=ko&prev=/search%3Fq%3Drpg%2Bvx%2Bace%26hl%3Dko%26newwindow%3D1%26biw%3D667%26bih%3D639%26tbs%3Dqdr:h%26prmd%3Dimvns&rurl=translate.google.co.kr&sl=en&twu=1&u=http://yamiworld.wordpress.com/2011/12/11/yeas-add-on-skill-steal-unofficial-edition-v1-00/&usg=ALkJrhgZA81UMIKE1w1s40raka35XXm_-A






#==============================================================================

# 겈 Yanfly Engine Ace - Skill Steal v1.00

#   Yami's Unofficial Edition

# -- Last Updated: 2011.12.11

# -- Level: Normal

# -- Requires: n/a

#==============================================================================


$imported = {} if $imported.nil?

$imported["YEA-SkillSteal"] = true


#==============================================================================

# 겈 Updates

# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

# 2011.12.11 - Edited (Yami).

# 2011.12.10 - Started Script and Finished.

#==============================================================================

# 겈 Introduction

# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

# This script enables items and skills to have skill stealing properties. When

# an actor uses that said item or skill on an enemy and the enemy has skills

# that can be stolen, that actor will learn all of the skills the enemy has to

# provide. This skill stealing system is madeakin to the Final Fantasy X's

# Lancet skill from Kimahri.

#==============================================================================

# 겈 Instructions

# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

# To install this script, open up your script editor and copy/paste this script

# to an open slot below 겈 Materials/멹띫 but above 겈 Main. Remember to save.

# -----------------------------------------------------------------------------

# Skill Notetags - These notetags go in the skills notebox in the database.

# -----------------------------------------------------------------------------

# <skill steal>

# If this skill targets an enemy, the actor who uses it will learn all of the

# stealable skills the enemy knows in its action list.

#

# <skill steal temp>

# If this skill targets an enemy, the actor who uses it will learn all of the

# stealable skills the enemy knows in its action list, but all learned skills

# will be forget when the battle ends.

# <stealable skill: x>

# A skill with this notetag can be stolen from enemies if it is listed within

# the enemy's action list. x is the chance this skill can be stolen.

# -----------------------------------------------------------------------------

# Item Notetags - These notetags go in the items notebox in the database.

# -----------------------------------------------------------------------------

# <skill steal>

# If this item targets an enemy, the actor who uses it will learn all of the

# stealable skills the enemy knows in its action list.

#

# <skill steal temp>

# If this skill targets an enemy, the actor who uses it will learn all of the

# stealable skills the enemy knows in its action list, but all learned skills

# will be forget when the battle ends.

#==============================================================================

# 겈 Compatibility

# =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

# This script is made strictly for RPG Maker VX Ace. It is highly unlikely that

# it will run with RPG Maker VX without adjusting.

#==============================================================================


module YEA

  module SKILL_STEAL

    

    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    # - Battlelog Settings -

    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    # These are the various battlelog settings made for skill stealing. Change

    # the text and message duration for a successful skill stealing.

    #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

    MSG_SKILL_STEAL = "%s learns %s from %s!" # Text for successful steal.

    MSG_FAIL        = "%s fails on learning %s from %s!" # Text for successful steal.

    MSG_DURATION    = 4                       # Lower number = shorter duration.

    

  end # SKILL_STEAL

end # YEA


#==============================================================================

# 겈 Editting anything past this point may potentially result in causing

# computer damage, incontinence, explosion of user's head, coma, death, and/or

# halitosis so edit at your own risk.

#==============================================================================


module YEA

  module REGEXP

  module USABLEITEM

    

    SKILL_STEAL     = /<(?:SKILL_STEAL|skill steal)>/i

    SKILL_STEAL_TEM = /<(?:SKILL_STEAL_TEMP|skill steal temp)>/i

    STEALABLE_SKILL = /<(?:STEALABLE_SKILL|stealable skill):[ ](d+)?>/i

    

  end # USABLEITEM

  end # REGEXP

end # YEA


#==============================================================================

# 걾 DataManager

#==============================================================================


module DataManager

  

  #--------------------------------------------------------------------------

  # alias method: load_database

  #--------------------------------------------------------------------------

  class <<self; alias load_database_ss load_database; end

  def self.load_database

    load_database_ss

    load_notetags_ss

  end

  

  #--------------------------------------------------------------------------

  # new method: load_notetags_ss

  #--------------------------------------------------------------------------

  def self.load_notetags_ss

    groups = [$data_skills, $data_items]

    for group in groups

      for obj in group

        next if obj.nil?

        obj.load_notetags_ss if obj.is_a?(RPG::Skill)

        obj.load_notetags_ss if obj.is_a?(RPG::Item)

      end

    end

  end

  

end # DataManager


#==============================================================================

# 걾 RPG::UsableItem

#==============================================================================


class RPG::UsableItem < RPG::BaseItem

  

  #--------------------------------------------------------------------------

  # public instance variables

  #--------------------------------------------------------------------------

  attr_accessor :skill_steal

  attr_accessor :skill_steal_temp

  attr_accessor :stealable_skill

  attr_accessor :stealable_skill_chance

  

  #--------------------------------------------------------------------------

  # common cache: load_notetags_s

  #--------------------------------------------------------------------------

  def load_notetags_ss

    #---

    self.note.split(/[rn]+/).each { |line|

      case line

      #---

      when YEA::REGEXP::USABLEITEM::SKILL_STEAL

        @skill_steal = true

      when YEA::REGEXP::USABLEITEM::SKILL_STEAL_TEM

        @skill_steal_temp = true

      when YEA::REGEXP::USABLEITEM::STEALABLE_SKILL

        next unless self.is_a?(RPG::Skill)

        @stealable_skill = true

        @stealable_skill_chance = $1.to_i

        @stealable_skill_chance = 0 if @stealable_skill_chance < 0

        @stealable_skill_chance = 100 if @stealable_skill_chance > 100

      #---

      end

    } # self.note.split

    #---

  end

  

end # RPG::UsableItem


#==============================================================================

# 걾 Game_Battler

#==============================================================================


class Game_Battler < Game_BattlerBase

  

  #--------------------------------------------------------------------------

  # public instance variables

  #--------------------------------------------------------------------------

  attr_accessor :stolen_skills

  

  #--------------------------------------------------------------------------

  # alias method: on_battle_start

  #--------------------------------------------------------------------------

  alias steal_skill_on_battle_start on_battle_start

  def on_battle_start

    steal_skill_on_battle_start

    @stolen_skills = [] if self.actor?

  end

  

  #--------------------------------------------------------------------------

  # alias method: on_battle_end

  #--------------------------------------------------------------------------

  alias steal_skill_on_battle_end on_battle_end

  def on_battle_end

    steal_skill_on_battle_end

    if self.actor?

      for i in @stolen_skills

        forget_skill(i)

      end

      @stolen_skills = []

    end

  end

  

  #--------------------------------------------------------------------------

  # alias method: item_user_effect

  #--------------------------------------------------------------------------

  alias game_battler_item_user_effect_ss item_user_effect

  def item_user_effect(user, item)

    game_battler_item_user_effect_ss(user, item)

    item_skill_steal_effect(user, item)

  end

  

  #--------------------------------------------------------------------------

  # new method: item_skill_steal_effect

  #--------------------------------------------------------------------------

  def item_skill_steal_effect(user, item)

    return unless item.skill_steal

    return unless user.actor?

    return if self.actor?

    for skill in stealable_skills

      next if user.skill_learn?(skill)

      @result.success = true

      break

    end

  end

  

end # Game_Battler


#==============================================================================

# 걾 Game_Enemy

#==============================================================================


class Game_Enemy < Game_Battler

  

  #--------------------------------------------------------------------------

  # stealable_skills

  #--------------------------------------------------------------------------

  def stealable_skills

    array = []

    for action in enemy.actions

      skill = $data_skills[action.skill_id]

      array.push(skill) if skill.stealable_skill

    end

    return array

  end

  

end # Game_Enemy


#==============================================================================

# 걾 Scene_Battle

#==============================================================================


class Scene_Battle < Scene_Base

  

  #--------------------------------------------------------------------------

  # alias method: apply_item_effects

  #--------------------------------------------------------------------------

  alias scene_battle_apply_item_effects_ss apply_item_effects

  def apply_item_effects(target, item)

    scene_battle_apply_item_effects_ss(target, item)

    apply_skill_steal(target, item)

  end

  

  #--------------------------------------------------------------------------

  # new method: apply_skill_steal

  #--------------------------------------------------------------------------

  def apply_skill_steal(target, item)

    return unless item.skill_steal or item.skill_steal_temp

    return if target.actor?

    return unless @subject.actor?

    for skill in target.stealable_skills

      next if @subject.skill_learn?(skill)

      if rand(100) <= skill.stealable_skill_chance

        @subject.learn_skill(skill.id) if !item.skill_steal_temp

        if item.skill_steal_temp

          @subject.learn_skill(skill.id)

          @subject.stolen_skills.push(skill.id) if !@subject.stolen_skills.include?(skill.id)

        end

        string = YEA::SKILL_STEAL::MSG_SKILL_STEAL

        skill_text = sprintf("\i[%d]%s", skill.icon_index, skill.name)

        text = sprintf(string, @subject.name, skill_text, target.name)

        @log_window.add_text(text)

        YEA::SKILL_STEAL::MSG_DURATION.times do @log_window.wait end

        @log_window.back_one

      else

        string = YEA::SKILL_STEAL::MSG_FAIL

        skill_text = sprintf("\i[%d]%s", skill.icon_index, skill.name)

        text = sprintf(string, @subject.name, skill_text, target.name)

        @log_window.add_text(text)

        YEA::SKILL_STEAL::MSG_DURATION.times do @log_window.wait end

        @log_window.back_one

      end

    end

  end

  

end # Scene_Battle


#==============================================================================

# 겈 End of File

#==============================================================================

  • ?
    rpgxp배우미 2011.12.30 16:41

    악 메이플 ㅋㅋㅋ

  • ?
    단맛과자 2011.12.31 16:51

    몬스터의 스킬을 뺏는건가요?

  • ?
    김진리 2012.07.21 22:16
    팬텀 ㅋㅋㅋㅋ
  • profile
    시즈쿠 2015.09.30 23:08
    뭐지.. 이건 어떻게 쓰는거지.....?
  • profile
    리팝이 2016.08.28 02:14
    요기 글에 있는 스크립트를 복사해서 쓰면 안대네요
    https://github.com/Archeia/YEARepo/blob/master/Gameplay/Skill_Steal.rb#L3
    요기 링크가셔서 스크립트 복사하고 하니 잘 대네요

List of Articles
번호 분류 제목 글쓴이 날짜 조회 수
공지 스크립트 자료 게시물 작성시 주의사항 습작 2012.12.24 5110
공지 RPG VX ACE 유용한 링크 모음 16 아방스 2012.01.03 28932
57 아이템 랜덤 아이템샵. 1 탐험가 2012.10.28 2297
56 전투 레벨업시 HP/MP 전체회복 9 쿠쿠밥솥 2012.02.05 5029
55 맵/타일 레이어 맵 <layer> 기능 2 file LuD 2017.08.03 1474
54 맵/타일 맵 이동시 이벤트(NPC) 위치 유지하기 (수정) 4 이브 2012.11.07 2144
53 파티 맵에서 4명 이상 대열 이동 가능수 조절하는 스크립트 5 Omegaroid 2013.10.17 1785
52 메뉴 메뉴창 없애기 2 file hamin 2014.02.28 3879
51 기타 메시지 표시 중에 자동으로 타이머 멈추기 1 file Bunny_Boy 2014.12.07 1028
50 아이템 물품 이름 컬러 변경 14 까까까 2012.01.04 5632
49 미니맵 미니맵 표시 스크립트 21 file 아방스 2012.01.16 6492
48 변수/스위치 변수/스위치 전역 저장 시스템 ( 게임이 종료 및 재시작되어도 값이 변하지 않는 변수와 스위치를 설정 ) 7 미루 2013.07.11 3175
47 오디오 볼륨변경 스크립트 레기우스州 2020.08.09 517
46 온라인 브라우저 열기 스크립트 1 큔. 2018.09.09 674
45 장비 사용자 장비 슬롯 1.1 27 file 아방스 2012.01.31 6615
44 전투 사이드뷰 배틀 스크립트 (Animated Battlers By Jet10985) 6 file Rebiart 2014.05.18 4517
43 기타 사칙연산 게임 by 77er 1 file 77ER. 2013.08.19 1606
42 상태/속성 상태를 해제하는 상태 3 file 레미티 2013.03.07 1545
41 그래픽 셰이크 강화 스크립트 file 시낵스 2023.12.13 163
40 스킬 스킬 숙련도 시스템 8 아이미르 2012.02.24 4918
» 스킬 스킬 스틸 시스템 5 아르피쥐 2011.12.18 3880
38 전투 스킬 캐스팅 시스템 3 스리아씨 2013.10.12 32181
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 Next
/ 11