Code:
######################################################################
# Blue Magic Script #
# by Vinardo #
######################################################################
# One of your heroes can learn Blue Magic from enemy and actors! #
# #
# It's alfa version- here can be bug's... #
######################################################################
# Sorry for my english- I'm from Poland #
######################################################################
class Game_System
alias init_blue_magic_later initialize
def initialize
init_blue_magic_later
@BLUE_MAGIC_SKILL = true
end
attr_accessor :BLUE_MAGIC_SKILL
end
class Scene_Battle
alias make_skill_action_result_blue_later make_skill_action_result
def make_skill_action_result(battler = nil, plus_id = nil)
if battler == nil
make_skill_action_result_blue_later
battler, targets = @active_battler, @target_battlers
elsif plus_id == nil
make_skill_action_result_blue_later(battler)
targets = battler.target
else
make_skill_action_result_blue_later(battler, plus_id)
targets = battler.target
end
if $game_system.BLUE_MAGIC_SKILL &&
target = targets[rand(targets.size)]
if rand(100) < $data_skills[battler.current_action.skill_id].hit
##### Number of actor (Blue Mage) Id ####
actor = $game_actors[9]#<- HERE!!!
blue_1 = $data_skills[7]
blue_2 = $data_skills[10] # blue_2 ->number of priority; $data_skills[10] blue magic skill (ICE)
blue_3 = $data_skills[13]
blue_4 = $data_skills[1]
blue_5 = $data_skills[81] ###If you need more then copy this and...###
if $game_party.actors.include?(actor)
if battler.current_action.skill_id == blue_1.id #Fire
if @es1 == true
else
skil_1 = $data_skills[blue_1.id]
actor.learn_skill(skil_1.id)
target.damage = "#{actor.name} learned #{skil_1.name}!"
@es1 = true
end
elsif battler.current_action.skill_id == blue_2.id #Ice
if @es2 == true
else
skil_2 = $data_skills[blue_2.id]
actor.learn_skill(skil_2.id)
target.damage = "#{actor.name} learned #{skil_2.name}!"
@es2 = true
end
elsif battler.current_action.skill_id == blue_3.id #Thunder
if @es3 == true
else
skil_3 = $data_skills[blue_3.id]
actor.learn_skill(skil_3.id)
target.damage = "#{actor.name} learned #{skil_3.name}!"
@es3 = true
end
elsif battler.current_action.skill_id == blue_4.id #Heal
if @es4 == true
else
skil_4 = $data_skills[blue_4.id]
actor.learn_skill(skil_4.id)
target.damage = "#{actor.name} learned #{skil_4.name}!"
@es4 = true
end
elsif battler.current_action.skill_id == blue_5.id #Metra Magic}
if @es5 == true # }
else # }
skil_5 = $data_skills[blue_5.id] # } ...and this, but you must change blue_ number, @es number, skil_ number and $data_skills[number]!
actor.learn_skill(skil_5.id) # }
target.damage = "#{actor.name} learned #{skil_5.name}!" # }
@es5 = true # }
end # }
end
end
else
target.damage = "It's can not be!"
end
else
target.damage = 'Miss!'
end
end
end