duongtiep Level 15
Danh hiệu : The King Tổng số bài gửi : 1229 MGV Xu : 2677 Danh tiếng : 45 Ngày tham gia : 10/12/2010 Đến từ : Quảng Ninh
| Tiêu đề: Level up effects 15/12/2010, 19:38 | |
| Nguồn:RPGREVOLUTION Tác giả:Redyugi Tác dụng + Chỉnh lương HP và MP sẽ được phục hồi khi lv up + Chọn trạng thái đc hồi phục khi lv up + Thêm item khi lv up,ví dụ là huân huy chương chả hạn(nói thêm cái huân huy chương cho dễ hỉu) + Chạy common event khi lv up Script - Code:
-
##### # Redyugi's Level Up Effects # 8-8-09 ##### class Game_Actor < Game_Battler ######### # Set up ######### # # Health RECOVER_ALL_HP = false # Recover all HP when level up? RECOVER_HP = true # Recovers certain amount of HP # If above is true HP_SET = false # True = Set amount of HP, False = percentage of HP HP_RECOVER = 50 # Amount recovered by above # # MP RECOVER_ALL_MP = false # Recover all MP when level up? RECOVER_MP = true # Recovers certain amount of MP # If above is true MP_SET = false # True = Set amount of MP, False = percentage of MP MP_RECOVER = 35 # Amount recovered by above # # States REMOVE_STATES = true # Remove certain states when level up? STATES_TO_REMOVE = [1, 2, 3, 4, 5, 6] # States to remove if above is true REMOVE_ALL_STATES = false # Remove all states # # Items GAIN_ITEMS = true # Gain items when level up? ITEMS_GAINED = [1, 3] # Gives player items using Item ID ITEMS_NUM = 2 #Number of items you are giving the player # # Common Events COMMON_EVENT = true #Play a common event when level up? EVENT_NUMBER = 1 # Which common event ######### # End Set Up #########
alias redyugi_level_up level_up def level_up redyugi_level_up @hp = maxhp if RECOVER_ALL_HP if RECOVER_HP if HP_SET == true @hp += HP_RECOVER else recover = maxhp * (HP_RECOVER / 100.00) recover.to_s @hp += recover.to_i end end @mp = maxmp if RECOVER_ALL_MP if RECOVER_MP if MP_SET @mp += MP_RECOVER else recover = maxmp * (MP_RECOVER / 100.00) recover.to_s @mp += recover.to_i end end if REMOVE_STATES @states -= STATES_TO_REMOVE end if REMOVE_ALL_STATES @states.clone.each { |i| remove_state(i) } end if GAIN_ITEMS for x in 0..ITEMS_NUM $game_party.gain_item($data_items[x], 0.25) end end if COMMON_EVENT $data_common_events[EVENT__NUMBER] $game_temp.common_event_id = EVENT_NUMBER end end end |
|