幻想森林

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 1596|回复: 7

[RMXP] 求几个脚本 >.<

[复制链接]

1

主题

3

帖子

26

积分

②入门

积分
26
发表于 2009-2-27 13:36:19 | 显示全部楼层 |阅读模式
前辈们好,小弟新人

急需以下两个脚本:

人物跟随脚本、武器要求等级脚本。

希望各位提供一下呢。

小弟在此谢过了!
想了解此人?请关注每晚火星频道.
回复

使用道具 举报

3

主题

38

帖子

329

积分

④见习

天使和恶魔其实只有一

积分
329
发表于 2009-2-27 17:15:10 | 显示全部楼层
Code
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
#---------------------------------------------------------------------------------
#需要能力值才能装备 改编自到达一定等级才能装备的武器和防具 By凌冰
#用法:在武器、防具的说明里添加LV等级(后面的等级写个数字)STR力量(后面的力量写个数字)
#DEX灵巧(后面的灵巧写个数字)AGI速度(后面的速度写个数字)INT魔力(后面的魔力写个数字)
#可以空缺,空缺项默认为1
#建议和升级加点脚本配合使用
#---------------------------------------------------------------------------------
module RPG
  class Weapon
    def level
     return 1 if @description.split(/LV/)[1] == nil
     return @description.split(/LV/)[1]
   end
   def str
     return 1 if @description.split(/STR/)[1] == nil
     return @description.split(/STR/)[1]
   end
   def dex
     return 1 if @description.split(/DEX/)[1] == nil
     return @description.split(/DEX/)[1]
   end
   def agi
     return 1 if @description.split(/AGI/)[1] == nil
     return @description.split(/AGI/)[1]
   end
   def int
     return 1 if @description.split(/INT/)[1] == nil
     return @description.split(/INT/)[1]
   end
#    def description      
#      return @description.split(/LV/)[0] + &quot;{装备等级&quot; + level + &quot;}&quot;
#    end
end
class Armor
    def level
     return 1 if @description.split(/LV/)[1] == nil
     return @description.split(/LV/)[1]
   end
   def str
     return 1 if @description.split(/STR/)[1] == nil
     return @description.split(/STR/)[1]
   end
   def dex
     return 1 if @description.split(/DEX/)[1] == nil
     return @description.split(/DEX/)[1]
   end
   def agi
     return 1 if @description.split(/AGI/)[1] == nil
     return @description.split(/AGI/)[1]
   end
   def int
     return 1 if @description.split(/INT/)[1] == nil
     return @description.split(/INT/)[1]
   end
#    def description      
#      return @description.split(/LV/)[0] + &quot;{装备等级&quot; + level + &quot;}&quot;
#    end
  end
end

class Game_Actor &lt; Game_Battler
#--------------------------------------------------------------------------
# ● 可以装备判定
#     item : 物品
#--------------------------------------------------------------------------
def equipable?(item)
   # 武器的情况
   if item.is_a?(RPG::Weapon)
     # 包含当前的职业可以装备武器的场合
     if $data_classes[@class_id].weapon_set.include?(item.id) and item.level.to_i&lt;=@level
       if item.str.to_i&lt;= str and item.dex.to_i&lt;= dex and item.agi.to_i&lt;= agi and item.int.to_i&lt;= int
       return true
       end
     end
   end
   # 防具的情况
   if item.is_a?(RPG::Armor)
     # 不包含当前的职业可以装备武器的场合
     if $data_classes[@class_id].armor_set.include?(item.id) and item.level.to_i&lt;=@level
       if item.str.to_i&lt;= str and item.dex.to_i&lt;= dex and item.agi.to_i&lt;= agi and item.int.to_i&lt;= int
       return true
       end
     end
   end
   return false
end
end
#==============================================================================
# ■ Window_EquipItem
#------------------------------------------------------------------------------
#  装备画面、显示浏览变更装备的候补物品的窗口。
#==============================================================================

class Window_EquipItem &lt; Window_Selectable
  #--------------------------------------------------------------------------
  # ● 刷新
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # 添加可以装备的武器
    if @equip_type == 0
      weapon_set = $data_classes[@actor.class_id].weapon_set
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) &gt; 0 and weapon_set.include?(i) and @actor.equipable?($data_weapons)
          @data.push($data_weapons)
        end
      end
    end
    # 添加可以装备的防具
    if @equip_type != 0
      armor_set = $data_classes[@actor.class_id].armor_set
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) &gt; 0 and armor_set.include?(i) and @actor.equipable?($data_armors)
          if $data_armors.kind == @equip_type-1
            @data.push($data_armors)
          end
        end
      end
    end
    # 添加空白
    @data.push(nil)
    # 生成位图、描绘全部项目
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max-1
      draw_item(i)
    end
  end
end

module RPG
  class Weapon
    def description
      a = @description
      a = a.split(/LV/)[0]  if a.split(/LV/)[1] != nil
      a = a.split(/STR/)[0] if a.split(/STR/)[1] != nil
      a = a.split(/DEX/)[0] if a.split(/DEX/)[1] != nil
      a = a.split(/AGI/)[0] if a.split(/AGI/)[1] != nil
      a = a.split(/INT/)[0] if a.split(/INT/)[1] != nil
      return  a
    end
  end
  class Armor
    def description
      a = @description
      a = a.split(/LV/)[0]  if a.split(/LV/)[1] != nil
      a = a.split(/STR/)[0] if a.split(/STR/)[1] != nil
      a = a.split(/DEX/)[0] if a.split(/DEX/)[1] != nil
      a = a.split(/AGI/)[0] if a.split(/AGI/)[1] != nil
      a = a.split(/INT/)[0] if a.split(/INT/)[1] != nil
      return  a
    end
  end

#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================

点此下载范例工程

设置方法:如图需要等级为5力量为10才能装备

Code
我只有这个

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
新手也疯狂!!伟大的事件!!可以完成许多脚本可以完成的!!!
回复 支持 反对

使用道具 举报

7

主题

373

帖子

6346

积分

⑦老手

积分
6346
发表于 2009-2-27 18:07:56 | 显示全部楼层
ls最后少个end。。。
[url=http:\\\\agmer.lunqun.com]AGM制作者论坛[/url]
回复 支持 反对

使用道具 举报

1

主题

3

帖子

26

积分

②入门

积分
26
 楼主| 发表于 2009-2-27 20:27:06 | 显示全部楼层
呢,谢谢1L的前辈!

热泪盈眶!
想了解此人?请关注每晚火星频道.
回复 支持 反对

使用道具 举报

7

主题

373

帖子

6346

积分

⑦老手

积分
6346
发表于 2009-2-27 20:39:30 | 显示全部楼层
是vx版吗。。。加了后进入装备选项会跳出。。。还是因为有些东西得跟据每人不同自己修改?
[url=http:\\\\agmer.lunqun.com]AGM制作者论坛[/url]
回复 支持 反对

使用道具 举报

1

主题

3

帖子

26

积分

②入门

积分
26
 楼主| 发表于 2009-2-27 22:05:01 | 显示全部楼层
这是XP版
想了解此人?请关注每晚火星频道.
回复 支持 反对

使用道具 举报

3

主题

38

帖子

329

积分

④见习

天使和恶魔其实只有一

积分
329
发表于 2009-2-28 14:20:25 | 显示全部楼层
引用第3楼viggo_bird于2009-02-27 20:27发表的  :
呢,谢谢1L的前辈!

热泪盈眶!
大哥   别这么说   我也是新手    偶尔看到过而已   大家一起摸索啦!!!
新手也疯狂!!伟大的事件!!可以完成许多脚本可以完成的!!!
回复 支持 反对

使用道具 举报

0

主题

1

帖子

8

积分

①新人

积分
8
发表于 2009-2-28 14:54:02 | 显示全部楼层
为什么这么设置以后武器都装不了了呢
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|幻想森林

GMT+8, 2026-6-20 05:22 , Processed in 0.014521 second(s), 22 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表