RPGXP 스크립트
2013.10.21 06:49

문과 상자를 쉽게 만들수 있는 스크립트

조회 수 2244 추천 수 0 댓글 18
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

#
# 이벤트 이름에 따라 상자 또는 문으로 작동할 수 있도록 합니다.
# 제작자 jinoh67 (nil)
#
# 비밀번호 형식 (xxxx부분) :
#  1714 -> 비밀번호는 1714이다.
#  012345 -> 비밀번호는 012345이다.
#  v32 -> 비밀번호는 32번 변수의 값이다.
#
# 상자 사용 방법 (이벤트 명령 사용 불가능) :
#  이벤트 이름을 다음과 같은 형식으로 지정해준다.
#
#   _CHEST12 -> 12번 아이템을 얻는다.
#   _CHEST12x4 -> 12번 아이템을 4개 얻는다.
#   _CHEST12_PWDxxxx -> 비밀번호를 입력하면 12번 아이템을 얻는다.
#   _CHEST12x4_PWDxxxx -> 비밀번호를 입력하면 12번 아이템을 4개 얻는다.
#   _CHESTPWDxxxx -> 플레이어를 낚는다.
#
# 문 사용 방법 (비밀번호가 맞을 시 이벤트 명령 실행) :
#   이벤트 이름을 다음과 같은 형식으로 지정해준다.
#   _DOORxxxx -> 비밀번호를 입력하면 이벤트 명령을 실행한다.
#


class Game_Event
  def str2num (str, offset = 0, var = nil, bdg = nil, final = nil)
    i = offset
    if final == nil
      final = str.size
    end
    val = 0
    while i < final && '0'[0] <= str[i] && str[i] <= '9'[0]
      val = val * 10 + (str[i] - '0'[0])
      i += 1
    end
    if var != nil && bdg != nil
      eval "#{var} = " + i.to_s, bdg
    end
    return val
  end
  
  def self.setup2
    waitCmd = RPG::MoveCommand.new(15, [2])
    stopCmd = RPG::MoveCommand.new(0, [])
    k = RPG::MoveRoute.new
    k.repeat = false
    k.skippable = false
    k.list = []
    for i in 16..19 do
      k.list.push (RPG::MoveCommand.new(i))
      k.list.push (waitCmd)
    end
    k.list.push (stopCmd)
    @@openChestMoveRoute = k
    k = RPG::MoveRoute.new
    k.repeat = false
    k.skippable = false
    k.list = []
    for i in 0..3 do
      k.list.push (RPG::MoveCommand.new(19 - i))
      if i < 3
        k.list.push (waitCmd)
      end
    end
    k.list.push (stopCmd)
    @@closeChestMoveRoute = k
    k = RPG::MoveRoute.new
    k.repeat = false
    k.skippable = false
    k.list = [RPG::MoveCommand.new(16), stopCmd]
    @@initalChestMoveRoute = k
    @@chest_array = [];
  end

  self.setup2
  
  def scan_pwd (str, offset, var = nil, bdg = nil)
    @pwd_len = 4
    @pwd_type = 0
    @pwd = nil
    if str[offset] == 'v'[0]
      @pwd_type = 1
      @pwd = str2num (str, offset + 1, var, bdg)
    else
      @pwd_type = 2
      k = nil
      @pwd = str2num (str, offset, :k, binding)
      if var != nil && bdg != nil
        eval "#{var} = " + k.to_s, bdg
      end
      @pwd_len = k - offset
      if @pwd_len <= 0
        @pwd_type = 0
        @pwd = nil
        @pwd_len = 0
      end
    end
  end
  
  alias :refresh_old :refresh

  def refresh # call this method at last in refresh method
    refresh_old
    cn = @event.name
    if cn.index ('_CHEST') == 0
      # get chest number
      @chest_id = @@chest_array.index (self)
      if @chest_id == nil
        @chest_id = @@chest_array.push (self).size - 1
      end
      @chest_id += $chest_start
      
      # scan
      i = 0
      @chest_item = str2num (cn, 6, :i, binding)
      if @chest_item <= 0 || $data_items.size <= @chest_item
        @chest_item = nil
      else
        @item_name = $data_items[@chest_item].name
        k = cn.index('x', i)
        if k != nil
          @chest_quantity = str2num (cn, k + 1, :i, binding)
        else
          @chest_quantity = 1
        end
      end
      i = cn.index('_PW', i) # _CHEST_PW
      @pwd_len = 4
      if i == nil
        @pwd_type = 0 # No password
        @pwd = nil
      else
        scan_pwd (cn, i + 3, :i, binding)
      end
      
      # setup
      @walk_anime = false
      @direction_fix = false
      
      # generate
      @list = [
        RPG::EventCommand.new(209, 0, [0, @@initalChestMoveRoute]),
        RPG::EventCommand.new(111, 0, [2, 0, 0]),
          RPG::EventCommand.new(209, 1, [0, @@openChestMoveRoute]),
          RPG::EventCommand.new(250, 1, [RPG::AudioFile.new("044-Chest01")]),
          RPG::EventCommand.new(210, 1, []),
          RPG::EventCommand.new(101, 1, ["상자가 비었다."]),
          RPG::EventCommand.new(209, 1, [0, @@closeChestMoveRoute]),
          RPG::EventCommand.new(250, 1, [RPG::AudioFile.new("024-Door01")]),
        RPG::EventCommand.new(411, 0, [])
        ];
      ind = 1
      if @pwd_type > 0
        @list.push (RPG::EventCommand.new(101, ind, ["비밀번호가 걸려있다."]))
        @list.push (RPG::EventCommand.new(122, ind, [$tmp_id, $tmp_id, 0, 0, 0]))
        @list.push (RPG::EventCommand.new(103, ind, [$tmp_id, @pwd_len]))
        if @pwd_type == 2
          @list.push (RPG::EventCommand.new(111, ind, [1, $tmp_id, 0, @pwd, 0]))
        else
          @list.push (RPG::EventCommand.new(111, ind, [1, $tmp_id, 1, @pwd, 0]))
        end
        ind += 1
      end
      @list.push(RPG::EventCommand.new(209, ind, [0, @@openChestMoveRoute]))
      @list.push(RPG::EventCommand.new(250, ind,
        [RPG::AudioFile.new("044-Chest01")]))
      @list.push(RPG::EventCommand.new(210, ind, []))
      @list.push(RPG::EventCommand.new(123, ind, [0, 0]))
      if @chest_item == nil
        @list.push(RPG::EventCommand.new(101, ind,
          [(@pwd_type > 0 ? "비밀번호까지 걸렸는데 " : "") + "상자가 비었다."]))
      else
        @list.push(RPG::EventCommand.new(126, ind,
          [@chest_item, 0, 0, @chest_quantity]))
        @list.push(RPG::EventCommand.new(101, ind,
          [@item_name + "을 " + @chest_quantity.to_s + "개 얻었다."]))
      end
      @list.push(RPG::EventCommand.new(209, ind, [0, @@closeChestMoveRoute]))
      @list.push(RPG::EventCommand.new(250, ind,
        [RPG::AudioFile.new("024-Door01")]))
      if @pwd_type > 0
        @list.push (RPG::EventCommand.new(411, ind - 1, []))
        @list.push (RPG::EventCommand.new(101, ind, ["비밀번호가 틀린 듯하다."]))
      end
      for i in 0..(ind-1)
        @list.push (RPG::EventCommand.new(0, i, []))
      end
      # @page.list = @list
    elsif cn.index ("_DOOR") == 0
      # get door number
      list_bkup = @list
      scan_pwd (cn, 5)
      if @pwd_type == 0
        return
      end
      @list = [
        RPG::EventCommand.new(111, 0, [2, 0, 1]),
          RPG::EventCommand.new(101, 1, ["비밀번호가 걸려있다."]),
          RPG::EventCommand.new(122, 1, [$tmp_id, $tmp_id, 0, 0, 0]),
          RPG::EventCommand.new(103, 1, [$tmp_id, @pwd_len]),
          RPG::EventCommand.new(111, 1, [1, $tmp_id, 0, @pwd, 5]),
            RPG::EventCommand.new(101, 2, ["비밀번호가 틀린 듯하다."]),
            RPG::EventCommand.new(115, 2, []),
          RPG::EventCommand.new(123, 1, [0, 0]),
        RPG::EventCommand.new(0, 0, [])
      ]
      if (@pwd_type == 1)
        @list[4] = RPG::EventCommand.new(111, 1, [1, $tmp_id, 1, @pwd, 5])
      end
      @list.concat(list_bkup)
    end
  end
end

?
  • ?
    두부 2013.10.26 05:26
    vx va는 간단하게 작성하기에서 있는데

    xp는 집적 만들어야하니 불편한점이 있었는데...

    감사합니다!
  • ?
    2013.10.26 05:57
    수정했습니다
  • ?
    exam 2013.11.10 00:34
    잘 보고갑니다
  • ?
    XP데이 2013.11.17 02:53
    exam님은 nil님을호출을받자
    누구인줄몰랐습니다.
  • ?
    2013.11.10 04:40
    nil님이 exam님을 호출하였습니다.
  • ?
    exam 2013.11.10 04:38

    전 킹카보단
    잉여킹차가 더 좋을것 같네요 ㅋㅋ
  • ?
    2013.11.10 04:36
    잉여킹카는 어때요?
  • ?
    exam 2013.11.10 04:25
    전 잉여빵보단 잉여킹을 더 좋아합니다 ㅋㅋ
  • ?
    2013.11.10 04:23
    잉여빵은요??

    아 맞다 농구할때 드립을 왜 하죠???
  • ?
    exam 2013.11.10 04:23
    ㅋㅋ
    그래서 제가 잉여맨을 좋아합니다
    (죄송 드립임)
  • ?
    2013.11.10 04:21
    이런 잉여스러운 스크립트에 댓글을 달아 주시다니!!! ㄱㅅ
  • ?
    exam 2013.11.10 04:38
    한국어를 사용합시다
  • ?
    exam 2013.11.10 04:41
    네 모바일 ㅠㅠ
  • ?
    2013.11.10 04:39
    윗부분에 한국어를 주석으로 사용했습니다 :)
    허허 댓글 올린 현재 모바일이시군요 채팅방에 없는거보니
  • ?
    exam 2013.11.10 04:42
    근데 저 스크립트요
    수정해서 붙여넣기 해야되나요
    아니면 그냥 붙여넣기 하면되나요?
  • ?
    2013.11.10 05:18
  • ?
    exam 2013.11.10 05:02

    쓰신 글에서 더 추가안 해도 되죠?
  • ?
    2013.11.10 05:01
    새로 스크립트 만들어서 붙여넣기하세요

  1. 텔레포트 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views896 Votes0
    Read More
  2. 윈도우 링 메뉴

    Date2013.10.01 CategoryRPGXP 스크립트 By Views840 Votes0
    Read More
  3. 현재위치&임무 표시

    Date2013.10.01 CategoryRPGXP 스크립트 By Views968 Votes0
    Read More
  4. 화면의 쉐이크를 더 어지럽게 바꿔보자!

    Date2013.10.01 CategoryRPGXP 스크립트 By Views986 Votes0
    Read More
  5. 현재 시간 확인

    Date2013.10.01 CategoryRPGXP 스크립트 By Views899 Votes0
    Read More
  6. 레벨업시 능력치 표시

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1081 Votes0
    Read More
  7. 아이템 갯수 제한

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1063 Votes0
    Read More
  8. 복권 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1146 Votes0
    Read More
  9. 대기 회복 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1078 Votes0
    Read More
  10. 상점에서 아이템 능력치를 표시해주는 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1656 Votes0
    Read More
  11. 메뉴 스크립트 Zer0 CMS

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1384 Votes0
    Read More
  12. 발소리 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views1730 Votes0
    Read More
  13. 부활 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views2767 Votes0
    Read More
  14. 미니맵 스크립트

    Date2013.10.01 CategoryRPGXP 스크립트 By Views2177 Votes0
    Read More
  15. 파이널 판타지 7 스타일 메뉴

    Date2013.10.01 CategoryRPGXP 스크립트 By Views2027 Votes0
    Read More
  16. 맵이름 표시 스크립트

    Date2013.10.05 CategoryRPGXP 스크립트 By 운 Views2246 Votes0
    Read More
  17. 로고를 띄우는 스크립트

    Date2013.10.07 CategoryRPGXP 스크립트 ByXEONSOFT블로그 Views1681 Votes0
    Read More
  18. 문과 상자를 쉽게 만들수 있는 스크립트

    Date2013.10.21 CategoryRPGXP 스크립트 By Views2244 Votes0
    Read More
  19. 이름조합스크립트

    Date2013.10.27 CategoryRPGXP 스크립트 ByScissor Views2766 Votes0
    Read More
  20. 아이템 조합 스크립트

    Date2013.12.06 CategoryRPGXP 스크립트 By 운 Views2715 Votes0
    Read More
Board Pagination Prev 1 2 3 4 5 6 7 8 9 10 11 ... 15 Next
/ 15






[개인정보취급방침] | [이용약관] | [제휴문의] | [후원창구] | [인디사이드연혁]

Copyright © 1999 - 2016 INdiSide.com/(주)씨엘쓰리디 All Rights Reserved.
인디사이드 운영자 : 천무(이지선) | kernys(김원배) | 사신지(김병국)