Advertisement
Dekita

$D13x Skill Levels 1.4-+

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