Twin Matrix
Member
Do you know how to make it so that a skill recovers SP instead of HP? ^^
class RPG::Skill
# Percent: skill_id => percent (skill 5 - 10% would be 5 => 10)
SP_Recovery_P = {}
# Direct
SP_Recovery_D = {}
[SP_Recovery_P, SP_Recovery_D].each {|c| c.default = 0}
def sp_recovery_p
return SP_Recovery_P[@id]
end
def sp_recovery_d
return SP_Recovery_D[@id]
end
end
class Game_Battler
alias_method :seph_skillsprec_gmbtlr_se, :skill_effect
def skill_effect(user, skill)
result = seph_skillsprec_gmbtlr_se(user, skill)
if result
if skill.sp_recover_p > 0
self.sp += Integer(self.maxsp * (skill.sp_recover_p / 100.0))
end
if skill.sp_recover_d > 0
self.sp += skill.sp_recover_d
end
end
return result
end
end
class RPG::Skill
# Percent: skill_id => percent (skill 5 - 10% would be 5 => 10)
SP_Recovery_P = {}
# Direct
SP_Recovery_D = {}
[SP_Recovery_P, SP_Recovery_D].each {|c| c.default = 0}
def sp_recovery_p
return SP_Recovery_P[@id]
end
def sp_recovery_d
return SP_Recovery_D[@id]
end
end
class Game_Battler
alias_method :seph_skillsprec_gmbtlr_se, :skill_effect
def skill_effect(user, skill)
result = seph_skillsprec_gmbtlr_se(user, skill)
if result
d = 0
if skill.sp_recover_p > 0
d += Integer(self.maxsp * (skill.sp_recover_p / 100.0))
end
if skill.sp_recover_d > 0
d += skill.sp_recover_d
end
self.sp += d
if d > 0
self.damage = d
end
end
return result
end
end