Advertisement
Dekita

skill level 1.7

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