Project1
标题:
怎么让怪物掉落2个和2种以上物品?
[打印本页]
作者:
398712048
时间:
2012-6-3 14:11
标题:
怎么让怪物掉落2个和2种以上物品?
现在有个任务是制作收集材料...... dsu_plus_rewardpost_czw
作者:
锐·小杜
时间:
2012-6-3 14:34
显示文章:你得到了***
然后增加物品***
作者:
okcd00
时间:
2012-6-3 14:42
在要出现任务物品的队伍中,新建事件“增减物品”就可以了。
或者可以新建一个公共事件和技能,让敌人在某个回合的时候100%使用该技能,技能没有什么实质用处,但是调用公共事件1(主角获得物品XXX)
‘‘──okcd00于2012-6-3 14:45补充以下内容:
具体点的话,就是:队伍-新建事件页-开关“任务1开启”为ON时-增减物品XXX 1个
或者:给敌人“XX”技能“惊慌掉落物品”,在第三回合100%使用,技能-公共事件1“主角获得物品XXX 1个 ”
’’
作者:
kangxi0109
时间:
2012-6-3 15:33
本帖最后由 kangxi0109 于 2012-6-3 22:29 编辑
四宝掉落脚本:
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
# ============================================================================
# 四格掉宝设定 by SailCat
# ============================================================================
# 脚本使用说明:
# 1.复制后插入到Main前面
# 2.数据库设定额外掉宝的概率,在敌人名称那里
# 格式: 敌人名称,宝物2,宝物3,宝物4 例:幽灵,A2,I32,A3
# 宝物写法: (I|W|A)n 分别对应: n号道具,n号武器,n号防具 I W A必须大写
# 例: Cockatrice,A5,I5,W3
# Fishman,I2,I3
# 三栏中任一栏留空不写时,取前一格的设定,全都不写时,取默认宝物设定
# 3.190行是四格概率比设定,在那里填上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
#==============================================================================
# ■ Scene_Battle
#------------------------------------------------------------------------------
# 处理战斗画面的类。
#==============================================================================
class Scene_Battle
#--------------------------------------------------------------------------
# ● 开始结束战斗回合
#--------------------------------------------------------------------------
def start_phase5
# 转移到回合 5
@phase = 5
# 演奏战斗结束 ME
$game_system.me_play($game_system.battle_end_me)
# 还原为战斗开始前的 BGM
$game_system.bgm_play($game_temp.map_bgm)
# 初始化 EXP、金钱、宝物
exp = 0
gold = 0
treasures = []
# 循环
for enemy in $game_troop.enemies
# 敌人不是隐藏状态的情况下
unless enemy.hidden
# 获得 EXP、增加金钱
exp += enemy.exp
gold += enemy.gold
# 出现宝物判定
if rand(100) < enemy.treasure_prob
rarity = [113, 200, 150, 85] #四项宝物的掉落比率
case rand(rarity[0] + rarity[1] + rarity[2] + rarity[3])
when 0..rarity[0] - 1
if enemy.item_id > 0
treasures.push($data_items[enemy.item_id])
end
if enemy.weapon_id > 0
treasures.push($data_weapons[enemy.weapon_id])
end
if enemy.armor_id > 0
treasures.push($data_armors[enemy.armor_id])
end
when rarity[0]..rarity[0] + rarity[1] - 1
if enemy.item2_id > 0
treasures.push($data_items[enemy.item2_id])
end
if enemy.weapon2_id > 0
treasures.push($data_weapons[enemy.weapon2_id])
end
if enemy.armor2_id > 0
treasures.push($data_armors[enemy.armor2_id])
end
when rarity[0] + rarity[1]..rarity[0] + rarity[1] + rarity[2] - 1
if enemy.item3_id > 0
treasures.push($data_items[enemy.item3_id])
end
if enemy.weapon3_id > 0
treasures.push($data_weapons[enemy.weapon3_id])
end
if enemy.armor3_id > 0
treasures.push($data_armors[enemy.armor3_id])
end
else
if enemy.item4_id > 0
treasures.push($data_items[enemy.item4_id])
end
if enemy.weapon4_id > 0
treasures.push($data_weapons[enemy.weapon4_id])
end
if enemy.armor4_id > 0
treasures.push($data_armors[enemy.armor4_id])
end
end
end
end
end
# 限制宝物数为 8 个
treasures = treasures[0..7]
# 获得 EXP
for i in 0...$game_party.actors.size
actor = $game_party.actors[i]
if actor.cant_get_exp? == false
last_level = actor.level
actor.exp += exp
if actor.level > last_level
@status_window.level_up(i)
end
end
end
# 获得金钱
$game_party.gain_gold(gold)
# 获得宝物
for item in treasures
case item
when RPG::Item
$game_party.gain_item(item.id, 1)
when RPG::Weapon
$game_party.gain_weapon(item.id, 1)
when RPG::Armor
$game_party.gain_armor(item.id, 1)
end
end
# 生成战斗结果窗口
@result_window = Window_BattleResult.new(exp, gold, treasures)
# 设置等待计数
@phase5_wait_count = 100
end
end
#==============================================================================
# 本脚本来自www.66RPG.com,使用和转载请保留此信息
#==============================================================================
复制代码
作者:
398712048
时间:
2012-6-3 20:21
脚本的话,每个怪物的第二到第四个物品掉落概率不是一定了吗?如果我想让1号怪物第二个物品爆率为0.2,2号怪物的第二个物品爆率为0.3,怎么办?
作者:
kangxi0109
时间:
2012-6-3 22:39
398712048 发表于 2012-6-3 20:21
脚本的话,每个怪物的第二到第四个物品掉落概率不是一定了吗?如果我想让1号怪物第二个物品爆率为0.2,2号 ...
事实上,这个0.2和0.3差不了多少吧,你完全可以将四个格子的掉落几率统一成100:75:50:25,然后将掉落物对号入座即可。如果硬要区别开来,那需要设置的数据就比较多了,20种怪就要手动设置80个数据,30种就要手动设置120个,50种的话,算了吧。
作者:
幻耶
时间:
2012-6-4 10:56
战斗结束调用公共事件(胜利宣言、得到多物品)
http://www.66rpg.com/articles/3221
作者:
li1143217499
时间:
2013-5-22 12:33
囡囚囨囚囨図囨囧。。男人不仁不义不囧。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1