adiktuzmiko

Skill Levels Add-On: EXP On Use v1.01

Feb 26th, 2014
651
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.46 KB | None | 0 0
  1. =begin
  2. ======================================================
  3.  
  4.   Skill Levels Add-On: EXP On Use v1.01
  5.   by Adiktuzmiko                  
  6.  
  7.   Date Created: 02/27/2014
  8.   Date Last Updated: 04/11/2014
  9.   Requires: Skill Levels v1.03 and up
  10.   Difficulty: Easy
  11.  
  12. ======================================================
  13.  Overview
  14. ======================================================
  15.  
  16.  This script allows you to set-up skills so that they
  17.  gain exp when you use them. Set-up is via formula so
  18.  you can make whatever formula you want. Formula is
  19.  set for both hit and miss so you can make skills have
  20.  different EXP gain if it hits or misses.
  21.  
  22. ======================================================
  23.  Usage
  24. ======================================================
  25.  
  26.  Put this script into your scripts editor, probably
  27.  below any other script that might modify Game_Battler.
  28.  Next thing to do is to tag your skills.
  29.  
  30.  <SKILL EXP_H>formula<END SKILL EXP_H> = Sets the formula for exp
  31.  gain when this skill hits. Accepts multiple lines
  32.  
  33.  <SKILL EXP_M>formula<END SKILL EXP_M> = Sets the formula for exp
  34.  gain when this skill misses. Accepts multiple lines
  35.  
  36. ======================================================
  37.  Compatibility
  38. ======================================================
  39.  
  40.  Aliases Game_Battler's item_apply
  41.  
  42. ======================================================
  43.  Terms and Conditions
  44. ======================================================
  45.  
  46.  View it here: http://lescripts.wordpress.com/terms-and-conditions/
  47.  
  48. ======================================================
  49. =end
  50.  
  51. #======================================================
  52. #  Do not edit below this line
  53. #======================================================
  54.  
  55. module ADIK
  56.   module SKILL_LEVEL_USE
  57.     HIT = /<SKILL EXP_H>(.*)<END SKILL EXP_H>/im
  58.     MISS = /<SKILL EXP_M>(.*)<END SKILL EXP_M>/im
  59.   end
  60. end
  61.  
  62. class Game_Battler
  63.  
  64.   alias item_apply_skill_level item_apply
  65.   def item_apply(user, item)
  66.     item_apply_skill_level(user, item)
  67.     return unless item.is_a?(RPG::Skill)
  68.     a = user
  69.     b = self
  70.     if @result.hit?
  71.       if item.note =~ ADIK::SKILL_LEVEL_USE::HIT
  72.         value = eval($1.to_s)
  73.       else
  74.         return
  75.       end
  76.       user.mod_skill_exp(item.id,'add',value)
  77.     else
  78.       if item.note =~ ADIK::SKILL_LEVEL_USE::MISS
  79.         value = eval($1.to_s)
  80.       else
  81.         return
  82.       end
  83.       user.mod_skill_exp(item.id,'add',value)  
  84.     end
  85.   end
  86.  
  87. end
Advertisement
Add Comment
Please, Sign In to add comment