赞 | 0 |
VIP | 77 |
好人卡 | 306 |
积分 | 1 |
经验 | 85662 |
最后登录 | 2023-11-23 |
在线时间 | 1782 小时 |
Lv1.梦旅人 虱子
- 梦石
- 0
- 星屑
- 121
- 在线时间
- 1782 小时
- 注册时间
- 2010-6-19
- 帖子
- 3597
|
- $shizi_battle_result = []
- #上面这个依旧是初始化用,不用管
- $shizi_battle_result_goldrand = false #是否开启随机金钱
- $shizi_battle_result_goldrandnum = 50 #随机幅度为50
- $shizi_battle_result_exprand = false #是否开启随机经验
- $shizi_battle_result_exprandnum = 30 #随机幅度为30
- $shizi_battle_result_max = 99 #最多获得99件宝物
- #宝物设置的格式:
- #$shizi_battle_result[*] = [怪物ID,[ [宝物类型,宝物ID,宝物出现几率] , [宝物类型,宝物ID,宝物出现几率]]
- #宝物类型:
- #0、物品
- #1、武器
- #2、防具
- $shizi_battle_result[0] = [1,[[2,1,70],[1,2,40]]]
- #下面是脚本内容
- class Scene_Battle
- def start_phase5
- @phase = 5
- $game_system.me_play($game_system.battle_end_me)
- $game_system.bgm_play($game_temp.map_bgm)
- exp = 0
- gold = 0
- treasures = []
- for enemy in $game_troop.enemies
- unless enemy.hidden
- exp += enemy.exp
- gold += enemy.gold
- if rand(100) < enemy.treasure_prob
- 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
- for i in $shizi_battle_result
- if enemy.id == i[0]
- for shizi in i[1]
- if rand(100) < shizi[2]
- case shizi[0]
- when 0
- treasures.push($data_items[shizi[1]])
- when 1
- treasures.push($data_weapons[shizi[1]])
- when 2
- treasures.push($data_armors[shizi[1]])
- end
- end
- end
- end
- end
- end
- end
- end
- treasures = treasures[0...$shizi_battle_result_max]
- gold = rand($shizi_battle_result_goldrandnum*2)-$shizi_battle_result_goldrandnum+gold if gold >= $shizi_battle_result_goldrandnum and $shizi_battle_result_goldrand == true
- exp = rand($shizi_battle_result_exprandnum*2)-$shizi_battle_result_exprandnum+exp if exp >= $shizi_battle_result_exprandnum and $shizi_battle_result_exprand == true
- 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
复制代码 |
|