Advertisement
Guest User

Untitled

a guest
Aug 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 2.83 KB | None | 0 0
  1.  
  2. if $BlizzABS
  3. class BlizzABS::Processor
  4.   def exp_factor(actor, gold)
  5.     lvl = gold - actor.level #compare the Enemy Level(EXP field)
  6.                               #with the actor's current level
  7.     sexp = 0
  8.         case lvl
  9.     when 16..100000 # The instance where enemies are 16+ levels higher than you.
  10.       sexp = 10.0
  11.     when 15
  12.       sexp = 5.0
  13.     when 14
  14.       sexp = 4.25
  15.     when 13
  16.       sexp = 3.5
  17.     when 12
  18.       sexp = 3.0
  19.     when 11
  20.       sexp = 2.5
  21.     when 10
  22.       sexp = 2.25
  23.     when 9
  24.       sexp = 2.0
  25.     when 8
  26.       sexp = 1.75
  27.     when 7
  28.       sexp = 1.55
  29.     when 6
  30.       sexp = 1.4
  31.     when 5
  32.       sexp = 1.3
  33.     when 4
  34.       sexp = 1.25  # enemy levels are higher than yours.
  35.     when 3
  36.       sexp = 1.15  #^
  37.     when 2         #|
  38.       sexp = 1.1   #|
  39.     when 1         #|
  40.       sexp = 1.05
  41.     when 0         # The instance where enemeis and yourself are the same level.
  42.       sexp = 1.0
  43.     when -1        #|
  44.       sexp = 0.95  #|
  45.     when -2        #|
  46.       sexp = 0.9   #v
  47.     when -3
  48.       sexp = 0.8   #enemy levels are lower than yours.
  49.     when -4
  50.       sexp = 0.7
  51.     when -5
  52.       sexp = 0.6
  53.     when -6
  54.       sexp = 0.5
  55.     when -7
  56.       sexp = 0.4
  57.     when -8
  58.       sexp = 0.3
  59.     when -9
  60.       sexp = 0.2
  61.     when -10
  62.       sexp = 0.1
  63.     when -11
  64.       sexp = 0.05
  65.     when -100000..-12 # The instance where you are 12+ levels higher than the foe.
  66.       sexp = 0.01
  67.     end
  68.   return sexp
  69. end
  70.   #----------------------------------------------------------------------------
  71.   # exp_result
  72.   #  enemy - the killed enemy event
  73.   #  Processes EXP gain after the death of an enemy.
  74.   #----------------------------------------------------------------------------
  75.   def exp_result(enemy)
  76.       # get EXP
  77.       exp = enemy.exp if enemy.exp != nil
  78.       gold = enemy.gold if enemy.gold != nil
  79.         # All the stuff dealing with TONs
  80.         if $tons_version != nil
  81.           # if version is correct and using Different Difficulties
  82.           if $tons_version >= 6.4 && TONS_OF_ADDONS::DIFFICULTY
  83.             # multiply gained gold
  84.             exp = exp * $game_system.exp_rate / 100
  85.           end
  86.           # if version is correct and using Passive Skills
  87.           if $tons_version >= 6.5 && $game_system.PASSIVE_SKILLS
  88.             # multiply gained gold with each actor's rate
  89.             $game_party.actors.each {|actor| exp *= actor.exp_rate}
  90.             exp = exp.to_i
  91.           end
  92.         end
  93.  
  94.       # iterate through all party members
  95.       $game_party.actors.each {|actor|
  96.           # increase EXP except if actor can't get EXP
  97.           actor.exp += (exp * exp_factor(actor, gold)).ceil unless actor.cant_get_exp?}
  98.     # return exp value for further processing
  99.     return exp
  100.   end#def
  101. end#class
  102. $BlizzABS = BlizzABS::Processor.new
  103. end#if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement