Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> Breath of Fire 3 - Enemy Skill System
TywinLannister
post Mar 27 2008, 02:29 PM
Post #1


Level 3
Group Icon

Group: Member
Posts: 34
Type: Scripter
RM Skill: Skilled




Breath of Fire 3 - Enemy Skill System
Version 1.0
By TywinLannister


Screenshots
None needed this time!

What it does
This script emulates the "watch enemy" system in Breath of Fire 3. That is, if an enemy uses a skill which you can learn in battle and one or more of your party is defending, there is a chance that one of your defending party members will learn the skill being used.

Version History
Version 1.0
Initial Release

Download Link
http://www.sendspace.com/file/fg5gr2

Thanks
ElementalCrisis for a simple yet effective side view battle system!
Fomar 0153 - the blue mage script came in handy.

Customising
Create a new element and call it enemy skill or whatever - make note of its id!
On line 46 of the script - ENEMY_SKILL_ELEMENT_ID = 17; change the number to your element id
on line 47 of the script - CHANCE_TO_LEARN = 100; change this to what you want the percentage chance of learning the skill to be.
Now for the skills, create a skill that your party will be able to learn and give it the enemy skill element.

Script
CODE
#==============================================================================
# ** Tywin_Enemy_Skills
#------------------------------------------------------------------------------
#  © TywinLannister, 2008
#  27/03/08
#  Version 1.0
#------------------------------------------------------------------------------
#  INSTRUCTIONS:
#   - Paste this above main
#  VERSION HISTORY:
#   - 1.0 (27/03/08),  Initial release.
#==============================================================================

#==============================================================================
# ** Game_Party
#------------------------------------------------------------------------------

class Game_Party
  #--------------------------------------------------------------------------
  # * Alias listings
  #--------------------------------------------------------------------------
  alias tywin_skill_initialize initialize
  
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_accessor :enemy_skills_learned     # enemy skills already learned by the party.
  
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    tywin_skill_initialize
    @enemy_skills_learned = []
  end
end

#==============================================================================
# ** Scene_Battle
#------------------------------------------------------------------------------

class Scene_Battle
  #--------------------------------------------------------------------------
  # * Constants
  #--------------------------------------------------------------------------
  ENEMY_SKILL_ELEMENT_ID = 17
  CHANCE_TO_LEARN = 100
  
  #--------------------------------------------------------------------------
  # * Alias Listings
  #--------------------------------------------------------------------------
  alias tywin_skill_execute_action_skill execute_action_skill
  
  #--------------------------------------------------------------------------
  # * Execute Battle Action: Skill
  #--------------------------------------------------------------------------
  def execute_action_skill
    tywin_skill_execute_action_skill
    defending_members = []
    chance_to_learn = CHANCE_TO_LEARN
    skill = @active_battler.action.skill
    if skill.element_set.include?(ENEMY_SKILL_ELEMENT_ID)
      if not $game_party.enemy_skills_learned.include?(skill.id)
        for member in $game_party.existing_members
          if member.guarding?
            defending_members.push(member)
          end
        end
      end
    end
    if defending_members.size > 0
      learn_chance = rand(100)
      if learn_chance < chance_to_learn
        member_to_learn = defending_members[rand(defending_members.size)]
        member_to_learn.learn_skill(skill.id)
        $game_party.enemy_skills_learned.push(skill.id)
        wait(10)
        @message_window.add_instant_text(member_to_learn.name + " learns " + skill.name)
        wait(60)
      end
    end
  end
  
end
Go to the top of the page
 
+Quote Post
   



Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 24th May 2013 - 06:59 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker