Advertisement
Dekita

$D13x - skill levels 1.6

Jul 19th, 2013
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.59 KB | None | 0 0
  1. #===============================================================================
  2. #
  3. # ☆ $D13x - Skill Levels
  4. # -- Author : Dekita
  5. # -- Version : 1.6
  6. # -- Level : Easy / Normal
  7. # -- Requires : $D13x - Statistic Control
  8. # -- Engine : RPG Maker VX Ace.
  9. #
  10. #===============================================================================
  11. # ☆ Import
  12. #-------------------------------------------------------------------------------
  13. $D13x={}if$D13x==nil
  14. $D13x[:Skill_Lv]=true
  15. #===============================================================================
  16. # ☆ Updates
  17. #-------------------------------------------------------------------------------
  18. # D /M /Y
  19. # 2o/o7/2o13 - Small bugfix, (when using damage items)
  20. # 28/o5/2o13 - Small Bugfix, (:dmg_deal |:dmg_take formulas)
  21. # 2o/o5/2o13 - Update, (:dmg_deal | :dmg_take eval formulas)
  22. # 17/o5/2o13 - Fixed Incorrect Notetag Info,
  23. # - Added reset_skills_exp script call,
  24. # 22/o4/2o13 - Fixed Bug, (forget skill error)
  25. # 23/o3/2o13 - Fixed Bug, (guard skill leveling)
  26. # - Added Guard && Attack Skill Lv Options,
  27. # - Added New Script Calls,
  28. # 21/o3/2o13 - Fixed Bug, (enemy damage)
  29. # - Fixed Bug, (Mp/Tp cost)
  30. # 2o/o3/2o13 - Finished,
  31. # 1o/o3/2o13 - Started
  32. #
  33. #===============================================================================
  34. # ☆ Introduction
  35. #-------------------------------------------------------------------------------
  36. # This script gives skills - levels.
  37. # You can have different growth types, exp requirements, max level,
  38. # level name and damage multiplier for each skill.
  39. # Simple notetag usage.
  40. # Plug-N-Play.
  41. #
  42. #===============================================================================
  43. # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
  44. #===============================================================================
  45. # 1. You MUST give credit to "Dekita" !!
  46. # 2. You are NOT allowed to repost this script.(or modified versions)
  47. # 3. You are NOT allowed to convert this script.
  48. # 4. You are NOT allowed to use this script for Commercial games.
  49. # 5. ENJOY!
  50. #
  51. # "FINE PRINT"
  52. # By using this script you hereby agree to the above terms and conditions,
  53. # if any violation of the above terms occurs "legal action" may be taken.
  54. # Not understanding the above terms and conditions does NOT mean that
  55. # they do not apply to you.
  56. # If you wish to discuss the terms and conditions in further detail you can
  57. # contact me at http://dekitarpg.wordpress.com/
  58. #
  59. #===============================================================================
  60. # ☆ Instructions
  61. #-------------------------------------------------------------------------------
  62. # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
  63. # Place Under My $D13x - Statistic Control Script.
  64. #
  65. #===============================================================================
  66. # ☆ Script Calls
  67. #-------------------------------------------------------------------------------
  68. # level_skill(actor_id, skill_id, show = true)
  69. # level_skill(actor_id, skill_id)
  70. # gain_skill_exp(actor_id, skill_id, value, show = true)
  71. # gain_skill_exp(actor_id, skill_id, value)
  72. #
  73. # actor_id = the id of the actor from the database.
  74. # skill_id = the id of the skill from the database.
  75. # value = the amount you wish to increase the exp.
  76. # show = make show false to not display skills level change.
  77. #
  78. #-------------------------------------------------------------------------------
  79. # $game_actors[ACTOR_ID].reset_skills_exp
  80. # $game_party.members[MEBMER_ID].reset_skills_exp
  81. # $game_party.leader.reset_skills_exp
  82. #
  83. # ACTOR_ID = the id of the actor from the database.
  84. # MEMBER_ID = the party members id (0 = leader)
  85. # This script call will reset all skills exp and level.
  86. #
  87. #===============================================================================
  88. # ☆ Notetags ( default )
  89. # For use with Skill Noteboxes only !
  90. #-------------------------------------------------------------------------------
  91. # <exp set: id>
  92. # replace id with the id of the Exp_Set (defined below) that you wish to use.
  93. #
  94. # <growth type: id>
  95. # replace id with the id of the Growth_Type (defined below) that you wish to use.
  96. #
  97. # <max level: value>
  98. # replace value with the maximum level for that skill
  99. # (cannot be higher than the Exp_Set hash size)
  100. #
  101. #===============================================================================
  102. # ☆ HELP
  103. #-------------------------------------------------------------------------------
  104. # The default max level is the size of its Exp_Set[id] hash.
  105. #
  106. #===============================================================================
  107. module Skill_Levels
  108. #===============================================================================
  109. Exp_Set=[]# << Keep
  110. Growth_Type=[]# << Keep
  111.  
  112. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  113. # ☆ General Settings
  114. #--------------------------------------------------------------------------
  115. # Reset Exp to 0 after level up ?
  116. Exp_Reset_On_Lv_Up = false # true
  117.  
  118. # Reset Level && Exp after forgetting skill ?
  119. Reset_On_Forget = true
  120.  
  121. # If these are true, skill costs will be multiplied by the DMG Multi
  122. Dmg_Multi_Skill_Cost = { :mp => true , :tp => false }
  123.  
  124. # Default Exp Set given to skills (unless notetagged)
  125. Default_Exp_Set_ID = 0
  126.  
  127. # Default Growth Type given to skills (unless notetagged)
  128. Default_GrowthT_ID = 0
  129.  
  130. # Make this true to allow the default Attack skill to level up
  131. Default_Attack_Can_Lv = false
  132.  
  133. # Make this true to allow the default Guard skill to level up
  134. Default_Guard__Can_Lv = false
  135.  
  136. # Default Notetags
  137. Notes={
  138. :exp_set => /<exp set:(.*)>/i ,
  139. :max_lev => /<max level:(.*)>/i ,
  140. :gro_typ => /<growth type:(.*)>/i ,
  141. }# << end Notes={}
  142.  
  143. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  144. # ☆ Exp Setup - Settings
  145. #--------------------------------------------------------------------------
  146. # here is where you define the required exp for each level
  147. # as well as the level name and damage multiplier.
  148. # DMG Multi will also increase any statistics gained by
  149. # using the Statistic Control scripts notetags
  150. # you can add to this array as you please.
  151. Exp_Set[0]={#<< Exp Settings : 0 Begin
  152. # Level => [Exp Req, "Name", DMG Multi] ,
  153. 1 => [ 0, "Lv 1", 1.0 ] , # << Default level
  154. 2 => [ 25, "Lv 2", 1.1 ] ,
  155. 3 => [ 50, "Lv 3", 1.2 ] ,
  156. 4 => [ 100, "Lv 4", 1.4 ] ,
  157. 5 => [ 200, "Lv 5", 1.6 ] ,
  158. 6 => [ 400, "Lv 6", 1.8 ] ,
  159. 7 => [ 800, "Lv 7", 2.0 ] ,
  160. 8 => [ 1600, "Lv 8", 2.4 ] ,
  161. 9 => [ 3200, "Lv 9", 3.0 ] ,
  162. }# << Keep
  163.  
  164. Exp_Set[1]={#<< Exp Settings : 1 Begin
  165. # Level => [Exp Req, "Name", DMG Multi] ,
  166. 1 => [ 0, "Lv 1", 1.0 ] , # << Default level
  167. 2 => [ 50, "Lv 2", 1.1 ] ,
  168. 3 => [ 100, "Lv 3", 1.2 ] ,
  169. 4 => [ 200, "Lv 4", 1.4 ] ,
  170. 5 => [ 400, "Lv 5", 1.6 ] ,
  171. 6 => [ 800, "Lv 6", 1.8 ] ,
  172. 7 => [ 1600, "Lv 7", 2.0 ] ,
  173. 8 => [ 3200, "Lv 8", 2.4 ] ,
  174. 9 => [ 6400, "Lv 9", 3.0 ] ,
  175. }# << Keep
  176.  
  177. Exp_Set[2]={#<< Exp Settings : 2 Begin
  178. # Level => [Exp Req, "Name", DMG Multi] ,
  179. 1 => [ 0, "Lv 1", 1.0 ] , # << Default level
  180. 2 => [ 15, "Lv 2", 1.1 ] ,
  181. 3 => [ 45, "Lv 3", 1.2 ] ,
  182. 4 => [ 135, "Lv 4", 1.4 ] ,
  183. 5 => [ 405, "Lv 5", 1.6 ] ,
  184. 6 => [ 1215, "Lv 6", 1.8 ] ,
  185. 7 => [ 3645, "Lv 7", 2.0 ] ,
  186. 8 => [ 10935, "Lv 8", 2.4 ] ,
  187. 9 => [ 32805, "Lv 9", 3.0 ] ,
  188. }# << Keep
  189.  
  190. Exp_Set[3]={#<< Exp Settings : 3 Begin
  191. # Level => [Exp Req, "Name", DMG Multi] ,
  192. # This Exp_Set Was Customized By Arrenjevleth @ http://forums.rpgmakerweb.com
  193. 1 => [ 0, "I", 1.0 ] , # << Default level
  194. 2 => [ 10, "II", 1.1 ] ,
  195. 3 => [ 30, "III", 1.25 ] ,
  196. 4 => [ 60, "IV", 1.45 ] ,
  197. 5 => [ 100, "V", 1.7 ] ,
  198. 6 => [ 150, "VI", 2.0 ] ,
  199. 7 => [ 210, "VII", 2.35 ] ,
  200. 8 => [ 280, "VIII", 2.75 ] ,
  201. 9 => [ 350, "IX", 3.15 ] ,
  202. 10 => [ 430, "X", 3.60 ] ,
  203. 11 => [ 520, "XI", 4.1 ] ,
  204. 12 => [ 620, "XII", 4.65 ] ,
  205. 13 => [ 730, "XIII", 5.25 ] ,
  206. 14 => [ 850, "XIV", 5.8 ] ,
  207. 15 => [ 1000, "XV", 6.5 ] ,
  208. 16 => [ 1250, "XVI", 7.25 ] ,
  209. 17 => [ 1600, "XVII", 8.05 ] ,
  210. 18 => [ 2050, "XVIII", 8.9 ] ,
  211. 19 => [ 2600, "XIX", 9.8 ] ,
  212. 20 => [ 5000, "*", 15.0 ] ,
  213. }# << Keep
  214.  
  215. # << You can add more Exp_Set[ id ] here, simply copy the code from
  216. # above and change the id number and values to suit your needs.
  217.  
  218. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  219. # ☆ Growth Type - Settings
  220. #--------------------------------------------------------------------------
  221. # Here is where you can define the exp gained for various conditions
  222. # you can add to this array as you please.
  223. # :per_use = exp gained per use of the skill
  224. # :per_dmg = per (100 * skill level) damage dealt
  225. # :per_bat = exp gained per battle (while you know the skill)
  226. # :per_die = exp gained when actor dies ( for the skill )
  227. # :per_esc = exp gained when actor escapes battle (for the skill)
  228. # :dmg_deal = formula to eval when actor deals damage using this skill
  229. # :dmg_take = formula to eval when actor takes damage FROM this skill
  230. # Exp wlil be given to the actor's skill if they know it
  231. # Pointless really, but there you go :p
  232. # When using :dmg_deal | :dmg_take you can use the arguements below
  233. # in your formulas (the formula is calculated in Game_Battler)
  234. # user = returns the actor/eney using the skill
  235. # self = returns the target actor/enemy of the skill
  236. # item = returns the item used
  237. # damage = returns the total value of the damage taken/dealt
  238. #--------------------------------------------------------------------------
  239. Growth_Type[0]={
  240. :per_use => 1,
  241. :per_dmg => 0,
  242. :per_bat => 1,
  243. :per_die => 0,
  244. :per_esc => 0,
  245. :dmg_deal => "1",
  246. :dmg_take => "0",
  247. } # << Keep
  248.  
  249. Growth_Type[1]={
  250. :per_use => 0,
  251. :per_dmg => 1,
  252. :per_bat => 0,
  253. :per_die => 0,
  254. :per_esc => 0,
  255. :dmg_deal => "0",
  256. :dmg_take => "0",
  257. } # << Keep
  258.  
  259. Growth_Type[2]={
  260. :per_use => 1,
  261. :per_dmg => 0,
  262. :per_bat => 0,
  263. :per_die => 0,
  264. :per_esc => 0,
  265. :dmg_deal => "0",
  266. :dmg_take => "0",
  267. } # << Keep
  268.  
  269. # << You can add more Growth_Type[ id ] here, simply copy the code from
  270. # above and change the id number and values to suit your needs.
  271.  
  272. #####################
  273. # CUSTOMISATION END #
  274. end #####################
  275. #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
  276. # #
  277. # http://dekitarpg.wordpress.com/ #
  278. # #
  279. #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
  280. #===============================================================================#
  281. # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
  282. # YES?\.\. #
  283. # OMG, REALLY? \| #
  284. # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
  285. # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
  286. #===============================================================================#
  287. module BattleManager
  288. #===============================================================================
  289. #--------------------------------------------------------------------------
  290. # Alias List
  291. #--------------------------------------------------------------------------
  292. class << self
  293. alias :gain_skill_exp :gain_exp
  294. end
  295. #--------------------------------------------------------------------------
  296. # EXP Acquisition and Level Up Display
  297. #--------------------------------------------------------------------------
  298. def self.gain_exp
  299. gain_skill_exp
  300. skills_gain_exp
  301. end
  302. #--------------------------------------------------------------------------
  303. # EXP Acquisition and Level Up Display (Skills)
  304. #--------------------------------------------------------------------------
  305. def self.skills_gain_exp
  306. $game_party.battle_members.each do |actor|
  307. actor.skills.each do |skill|
  308. next if skill == nil
  309. value = Skill_Levels::Growth_Type[skill.growth_type][:per_bat]
  310. actor.increase_skill_exp(skill, value)
  311. end
  312. end
  313. wait_for_message
  314. end
  315.  
  316. end
  317.  
  318. #===============================================================================
  319. class RPG::Skill < RPG::UsableItem
  320. #===============================================================================
  321. #---------------------------------------------------------------------------
  322. # Alias List
  323. #---------------------------------------------------------------------------
  324. alias :deki_skill_levz :load_stat_control
  325. #---------------------------------------------------------------------------
  326. # Pi Variables
  327. #---------------------------------------------------------------------------
  328. attr_accessor :exp_set
  329. attr_accessor :growth_type
  330. attr_accessor :max_lv
  331. #---------------------------------------------------------------------------
  332. # Load Stat Control
  333. #---------------------------------------------------------------------------
  334. def load_stat_control
  335. deki_skill_levz
  336. @exp_set = Skill_Levels::Default_Exp_Set_ID
  337. @growth_type = Skill_Levels::Default_GrowthT_ID
  338. @max_lv = Skill_Levels::Exp_Set[@exp_set].size
  339. self.note.split(/[\r\n]+/).each do |line|
  340. case line
  341. when Skill_Levels::Notes[:max_lev] then @max_lv = $1.to_i
  342. when Skill_Levels::Notes[:exp_set] then @exp_set = $1.to_i
  343. when Skill_Levels::Notes[:gro_typ] then @growth_type = $1.to_i
  344. end
  345. end
  346. end
  347.  
  348. end
  349.  
  350. #===============================================================================
  351. class Game_Battler < Game_BattlerBase
  352. #===============================================================================
  353. #--------------------------------------------------------------------------
  354. # Alias List
  355. #--------------------------------------------------------------------------
  356. alias :_MDV__skillev :make_damage_value
  357. alias :_APV__skillev :apply_variance
  358. #--------------------------------------------------------------------------
  359. # M.D.V
  360. #--------------------------------------------------------------------------
  361. def make_damage_value(user, item)
  362. @skillev_user = user
  363. @skillev_item = item
  364. _MDV__skillev(user, item)
  365. end
  366. #--------------------------------------------------------------------------
  367. # Apply Variance Mod ( HEAVY ALIAS )
  368. #--------------------------------------------------------------------------
  369. def apply_variance(damage, variance)
  370. user = @skillev_user
  371. item = @skillev_item
  372. orii = _APV__skillev(damage, variance)
  373. if item.is_a?(RPG::Skill)
  374. orig = apply_skill_variance(user,item,orii)
  375. do_dmg_exp_eval(user, item, orig)
  376. end
  377. orig
  378. end
  379. #--------------------------------------------------------------------------
  380. # Do Exp Gain Eval Formula
  381. #--------------------------------------------------------------------------
  382. def do_dmg_exp_eval(user, item, damage)
  383. return if item.id == (attack_skill_id || guard_skill_id)
  384. mod = Skill_Levels::Growth_Type[item.growth_type]
  385. if user.is_a?(Game_Actor)
  386. val = eval(mod[:dmg_deal]).to_i rescue 0
  387. val = 0 if ((val == nil) || (val < 0))
  388. user.increase_skill_exp(item, val)
  389. end
  390. if self.is_a?(Game_Actor)
  391. val = eval(mod[:dmg_take]).to_i rescue 0
  392. val = 0 if ((val == nil) || (val < 0))
  393. self.increase_skill_exp(item, val)
  394. end
  395. end
  396. #--------------------------------------------------------------------------
  397. # Apply Skill Variance
  398. #--------------------------------------------------------------------------
  399. def apply_skill_variance(user,item,orig)
  400. return orig if user.is_a?(Game_Enemy)
  401. return orig if item.id == (attack_skill_id || guard_skill_id)
  402. lvdmgmul = Skill_Levels::Exp_Set[item.exp_set][user.skills_lv(item.id)][2]
  403. valu = orig * lvdmgmul
  404. ex = ((valu/100)*user.skills_lv(item.id)*
  405. Skill_Levels::Growth_Type[item.growth_type][:per_dmg]).to_i
  406. user.increase_skill_exp(item, ex)
  407. valu
  408. end
  409.  
  410. end
  411.  
  412. #===============================================================================
  413. class Game_Actor < Game_Battler
  414. #===============================================================================
  415. #--------------------------------------------------------------------------
  416. # Alias List
  417. #--------------------------------------------------------------------------
  418. alias :ls_alias_SD13x :learn_skill
  419. alias :fs_alias_SD13x :forget_skill
  420. alias :from_suparr_pscc :pay_skill_cost
  421. alias :init_de_skeel :init_skills
  422. alias :die_exp_skill :die
  423. alias :escape_exp_skill :escape
  424. alias :skill_lv_mp_st :skill_mp_cost
  425. alias :skill_lv_tp_st :skill_tp_cost
  426. #--------------------------------------------------------------------------
  427. # Learn Skill
  428. #--------------------------------------------------------------------------
  429. def learn_skill(skill_id)
  430. old_skills = skills.clone
  431. ls_alias_SD13x(skill_id)
  432. if skills != old_skills
  433. @skills_lv[skill_id] = 1
  434. @skills_exp[skill_id] = 0
  435. @skills_list.push(skill_id)
  436. @skills_list.sort!
  437. end
  438. end
  439. #--------------------------------------------------------------------------
  440. # Initialize Skills
  441. #--------------------------------------------------------------------------
  442. def init_skills
  443. reset_skills_exp
  444. init_de_skeel
  445. end
  446. #--------------------------------------------------------------------------
  447. # Reset Skills Lv + Exp
  448. #--------------------------------------------------------------------------
  449. def reset_skills_exp
  450. ds = $data_skills.size
  451. @skills_lv = [1] * ds
  452. @skills_exp = [0] * ds
  453. end
  454. #--------------------------------------------------------------------------
  455. # Get Skill Level
  456. #--------------------------------------------------------------------------
  457. def skills_lv(id)
  458. @skills_lv[id]
  459. end
  460. #--------------------------------------------------------------------------
  461. # Get Skill Exp
  462. #--------------------------------------------------------------------------
  463. def skills_exp(id)
  464. @skills_exp[id] == nil ? 0 : @skills_exp[id]
  465. end
  466. #--------------------------------------------------------------------------
  467. # Increase Skill Exp
  468. #--------------------------------------------------------------------------
  469. def increase_skill_exp(skill, value = nil, show = true)
  470. mod = Skill_Levels
  471. return if skill.id == attack_skill_id unless mod::Default_Attack_Can_Lv
  472. return if skill.id == guard_skill_id unless mod::Default_Guard__Can_Lv
  473. value = mod::Growth_Type[skill.growth_type][:per_use] if value == nil
  474. return if value == nil || value <= 0
  475. return if @skills_lv[skill.id] >= skill.max_lv
  476. set_id = skill.exp_set
  477. value.times do
  478. break if @skills_lv[skill.id] >= skill.max_lv
  479. @skills_exp[skill.id] += 1
  480. need = mod::Exp_Set[set_id][(@skills_lv[skill.id]+1)][0]
  481. if @skills_exp[skill.id] >= need
  482. increase_skill_proficiency(skill.id, show)
  483. end
  484. end
  485. end
  486. #--------------------------------------------------------------------------
  487. # Increase Skill Level
  488. #--------------------------------------------------------------------------
  489. def increase_skill_proficiency(skill_id, show = true)
  490. return if @skills_lv[skill_id] >= $data_skills[skill_id].max_lv
  491. @skills_lv[skill_id] += 1
  492. if Skill_Levels::Exp_Reset_On_Lv_Up
  493. @skills_exp[skill_id] = 0
  494. end
  495. ltex = Skill_Levels::Exp_Set[$data_skills[skill_id].exp_set][@skills_lv[skill_id]][1]
  496. text = "#{self.name}'s #{$data_skills[skill_id].name} is now #{ltex}"
  497. $game_message.add(text) if show
  498. end
  499. #--------------------------------------------------------------------------
  500. # Forget Skill
  501. #--------------------------------------------------------------------------
  502. def forget_skill(skill_id)
  503. fs_alias_SD13x(skill_id)
  504. @skills_list.delete(skill_id)
  505. if Skill_Levels::Reset_On_Forget
  506. @skills_lv[skill_id] = 1
  507. @skills_exp[skill_id] = 0
  508. end
  509. end
  510. #--------------------------------------------------------------------------
  511. # Die
  512. #--------------------------------------------------------------------------
  513. def die
  514. die_exp_skill
  515. do_obscure_skill_exp(:per_die)
  516. end
  517. #--------------------------------------------------------------------------
  518. # Escape
  519. #--------------------------------------------------------------------------
  520. def escape
  521. escape_exp_skill
  522. do_obscure_skill_exp(:per_esc)
  523. end
  524. #--------------------------------------------------------------------------
  525. # Do Obscure Skill Exp Gain
  526. #--------------------------------------------------------------------------
  527. def do_obscure_skill_exp(type = :nil)
  528. return if type == :nil
  529. skills.each do |skill|
  530. next if skill == nil
  531. value = Skill_Levels::Growth_Type[skill.growth_type][type]
  532. next if value <= 0
  533. actor.increase_skill_exp(skill, value)
  534. end
  535. end
  536. #--------------------------------------------------------------------------
  537. # Pay Cost of Using Skill
  538. #--------------------------------------------------------------------------
  539. def pay_skill_cost(skill)
  540. from_suparr_pscc(skill)
  541. increase_skill_exp(skill)
  542. end
  543. #--------------------------------------------------------------------------
  544. # Calculate Skill's MP Cost
  545. #--------------------------------------------------------------------------
  546. def skill_mp_cost(skill)
  547. old = skill_lv_mp_st(skill)
  548. if Skill_Levels::Dmg_Multi_Skill_Cost[:mp]
  549. old *= Skill_Levels::Exp_Set[skill.exp_set][@skills_lv[skill.id]][2]
  550. end
  551. old.to_i
  552. end
  553. #--------------------------------------------------------------------------
  554. # Calculate Skill's TP Cost
  555. #--------------------------------------------------------------------------
  556. def skill_tp_cost(skill)
  557. old = skill_lv_tp_st(skill)
  558. if Skill_Levels::Dmg_Multi_Skill_Cost[:tp]
  559. old *= Skill_Levels::Exp_Set[skill.exp_set][@skills_lv[skill.id]][2]
  560. end
  561. old.to_i
  562. end
  563.  
  564. end # << Game_Actor
  565.  
  566. #===============================================================================
  567. class Window_SkillList < Window_Selectable
  568. #===============================================================================
  569. #--------------------------------------------------------------------------
  570. # Draw Item Name
  571. #--------------------------------------------------------------------------
  572. def draw_item_name(item, x, y, enabled = true, width = (Graphics.width/2))
  573. return unless item && @actor
  574. w = (width - (standard_padding*2) - 4)
  575. draw_icon(item.icon_index, x, y, enabled)
  576. change_color(normal_color, enabled)
  577. skill_lv = @actor.skills_lv(item.id)
  578. if $D13x[:Skill_Scene] && !SceneManager.scene_is?(Scene_Battle)
  579. refresh_font
  580. text = Skill_Levels::Exp_Set[item.exp_set][skill_lv][1]
  581. draw_text(x + 24, y, w-24, line_height, item.name)
  582. draw_text(x, y, w, line_height, text, 2)
  583. else
  584. text = "#{item.name} #{Skill_Levels::Exp_Set[item.exp_set][skill_lv][1]}"
  585. draw_text(x + 24, y, w-24, line_height, text)
  586. end
  587. end
  588.  
  589. end
  590.  
  591. #===============================================================================
  592. class Game_Interpreter
  593. #===============================================================================
  594. #--------------------------------------------------------------------------
  595. # Increase Skill Level
  596. #--------------------------------------------------------------------------
  597. def level_skill(actor_id, skill_id, show = true)
  598. actor = $game_actors[actor_id]
  599. return if actor == nil
  600. return if (skill_id == nil) || (skill_id <= 0)
  601. actor.increase_skill_proficiency(skill_id, show)
  602. end
  603. #--------------------------------------------------------------------------
  604. # Gain Skill Exp
  605. #--------------------------------------------------------------------------
  606. def gain_skill_exp(actor_id, skill_id, value = 0, show = true)
  607. actor = $game_actors[actor_id]
  608. skill = $data_skills[skill_id]
  609. return if actor == nil
  610. return if skill == nil
  611. return if value <= 0
  612. actor.increase_skill_exp(skill,value,show)
  613. end
  614.  
  615. end
  616.  
  617. #==============================================================================#
  618. # http://dekitarpg.wordpress.com/ #
  619. #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement