赞 | 0 |
VIP | 3 |
好人卡 | 18 |
积分 | 2 |
经验 | 72569 |
最后登录 | 2023-12-30 |
在线时间 | 596 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 229
- 在线时间
- 596 小时
- 注册时间
- 2010-6-21
- 帖子
- 1218
|
给你一个脚本就行了4格掉宝,可以设置4种不同的掉落物品- #==============================================================================
- # 本脚本来自www.66RPG.com,使用和转载请保留此信息
- #==============================================================================
- # ============================================================================
- # 四格掉宝设定 by SailCat
- # ============================================================================
- # 脚本使用说明:
- # 1.复制后插入到Main前面
- # 2.数据库设定额外掉宝的概率,在敌人名称那里
- # 格式: 敌人名称,宝物2,宝物3,宝物4
- # 宝物写法: (I|W|A)n 分别对应: n号道具,n号武器,n号防具 I W A必须大写
- # 例: Cockatrice,A5,I5,W3
- # Fishman,I2,I3
- # 三栏中任一栏留空不写时,取前一格的设定,全都不写时,取默认宝物设定
- # 3.186行是四格概率比设定,在那里填上4个数字就可以更改概率了,该行内容:
- # rarity = [178, 51, 15, 12]
- # ============================================================================
- #--------------------------------------------------------------------------
- # □ RPG::Enemy
- #--------------------------------------------------------------------------
- module RPG
- class Enemy
- def name
- name = @name.split(/,/)[0]
- return name != nil ? name : ""
- end
- def treasure2
- treasure = @name.split(/,/)[1]
- return treasure.to_s
- end
- def treasure3
- treasure = @name.split(/,/)[2]
- return treasure.to_s
- end
- def treasure4
- treasure = @name.split(/,/)[3]
- return treasure.to_s
- end
- end
- end
- #==============================================================================
- # ■ Game_Enemy
- #------------------------------------------------------------------------------
- # 处理敌人的类。本类在 Game_Troop 类 ($game_troop) 的
- # 内部使用。
- #==============================================================================
- class Game_Enemy < Game_Battler
- #--------------------------------------------------------------------------
- # ● 获取物品 ID2
- #--------------------------------------------------------------------------
- def item2_id
- if $data_enemies[@enemy_id].treasure2 == ""
- return item_id
- elsif $data_enemies[@enemy_id].treasure2[0,1] != "I"
- return 0
- else
- return $data_enemies[@enemy_id].treasure2[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取武器 ID2
- #--------------------------------------------------------------------------
- def weapon2_id
- if $data_enemies[@enemy_id].treasure2 == ""
- return weapon_id
- elsif $data_enemies[@enemy_id].treasure2[0,1] != "W"
- return 0
- else
- return $data_enemies[@enemy_id].treasure2[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取防具 ID2
- #--------------------------------------------------------------------------
- def armor2_id
- if $data_enemies[@enemy_id].treasure2 == ""
- return armor_id
- elsif $data_enemies[@enemy_id].treasure2[0,1] != "A"
- return 0
- else
- return $data_enemies[@enemy_id].treasure2[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取物品 ID3
- #--------------------------------------------------------------------------
- def item3_id
- if $data_enemies[@enemy_id].treasure3 == ""
- return item2_id
- elsif $data_enemies[@enemy_id].treasure3[0,1] != "I"
- return 0
- else
- return $data_enemies[@enemy_id].treasure3[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取武器 ID3
- #--------------------------------------------------------------------------
- def weapon3_id
- if $data_enemies[@enemy_id].treasure3 == ""
- return weapon2_id
- elsif $data_enemies[@enemy_id].treasure3[0,1] != "W"
- return 0
- else
- return $data_enemies[@enemy_id].treasure3[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取防具 ID3
- #--------------------------------------------------------------------------
- def armor3_id
- if $data_enemies[@enemy_id].treasure3 == ""
- return armor2_id
- elsif $data_enemies[@enemy_id].treasure3[0,1] != "A"
- return 0
- else
- return $data_enemies[@enemy_id].treasure3[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取物品 ID4
- #--------------------------------------------------------------------------
- def item4_id
- if $data_enemies[@enemy_id].treasure4 == ""
- return item3_id
- elsif $data_enemies[@enemy_id].treasure4[0,1] != "I"
- return 0
- else
- return $data_enemies[@enemy_id].treasure4[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取武器 ID4
- #--------------------------------------------------------------------------
- def weapon4_id
- if $data_enemies[@enemy_id].treasure4 == ""
- return weapon3_id
- elsif $data_enemies[@enemy_id].treasure4[0,1] != "W"
- return 0
- else
- return $data_enemies[@enemy_id].treasure4[/[0-9]+/].to_i
- end
- end
- #--------------------------------------------------------------------------
- # ● 获取防具 ID4
- #--------------------------------------------------------------------------
- def armor4_id
- if $data_enemies[@enemy_id].treasure4 == ""
- return armor3_id
- elsif $data_enemies[@enemy_id].treasure4[0,1] != "A"
- return 0
- else
- return $data_enemies[@enemy_id].treasure4[/[0-9]+/].to_i
- end
- end
- end
复制代码 |
评分
-
查看全部评分
|