Dekita

Untitled

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

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×