QUOTE (Dalhan @ Nov 3 2012, 12:05 AM)

Thanks, this is pretty much what I wanted! But I have two more questions now :x
Firstly, you said common events can only be employed in skills. Does this mean I wont be able to have the event run when players do standard attacks? (Guard, attack, etc)
Secondly, the GUI input for increasing a players SP (The option on page 3, change SP) doesn't work with percentages. Am I able to assign a percentage to a variable and then reference that?
I get the odd feeling I'm going to end up scripting all of this >_<
Unfortunately... you're going to script everything if you're planning to use normal attacks.
This is because common events are only tied to skills and items.
BTW, no need to worry, it's not so much difficult to do

Try pasting this above main

CODE
#--------------------------------------------------------------------------
# ** Battle Invariables
#--------------------------------------------------------------------------
module Battle
SP_RECOVERY_RATE = 3.0 #percentage of SP recovered with every attack
end
#--------------------------------------------------------------------------
# ** Scene_Battle
#--------------------------------------------------------------------------
class Scene_Battle
#--------------------------------------------------------------------------
# * aliases
#--------------------------------------------------------------------------
alias old_update_phase4_step5 update_phase4_step5
#--------------------------------------------------------------------------
# * update phase 4 (step 5 - id est damage display)
#--------------------------------------------------------------------------
def update_phase4_step5
# call aliased method
old_update_phase4_step5
# show active battler "damage"
if @active_battler.damage != nil
@active_battler.damage_pop = true
end
end
# class end
end
#--------------------------------------------------------------------------
# ** Game_Battler
#--------------------------------------------------------------------------
class Game_Battler
#--------------------------------------------------------------------------
# * aliases
#--------------------------------------------------------------------------
alias old_attack_effect attack_effect
#--------------------------------------------------------------------------
# * attack_effect
# attacker : battler who performs the attack
#--------------------------------------------------------------------------
def attack_effect(attacker)
# call aliased method
old_attack_effect(attacker)
# add sp recovery
if self.damage != nil and self.damage != "Miss"
dmg = (Battle::SP_RECOVERY_RATE*attacker.maxsp/100).to_i
attacker.sp += dmg
attacker.damage = - dmg
end
end
end
Anyway, remember that you can also use variable to vary SP. To increase a character's SP by means of a variable, just do what I list below:
1. Variable[001] = Battler MAXSP
2. Variable[001] *= 3
3. Variable[001] /= 100
4. Change Battler SP (battler, Variable[001])
without using scripts

You can also do this:
(call script)
battler = $scene.active_battler
sp_recovery = battler.maxsp * 3 / 100
battler.sp += sp_recovery
(end of the call script)
I hope this can help

Jens