Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #===============================================================================
- #
- # ☆ $D13x - Weapon Attacks
- # -- Author : Dekita
- # -- Version : 1.0
- # -- Level : Easy
- # -- Requires : N/A
- # -- Engine : RPG Maker VX Ace.
- #
- #===============================================================================
- # ☆ Import
- #-------------------------------------------------------------------------------
- $D13x={}if$D13x==nil
- $D13x[:Wep_Attacks]=true
- #===============================================================================
- # ☆ Updates
- #-------------------------------------------------------------------------------
- # D /M /Y
- # 23/o3/2o13 - Started, Finished,
- #
- #===============================================================================
- # ☆ Introduction
- #-------------------------------------------------------------------------------
- # This script will allow you to give each weapon its own default attack skill.
- # You can also define the chance of the skill being used.
- # eg.
- # Axe has skill 65, it will use skill 65 50% of the time and the default skill
- # the other 50% of the time.
- #
- # You can also do the same for the guard skill :)
- #
- #===============================================================================
- # ★☆★☆★☆★☆★☆★☆★☆★ TERMS AND CONDITIONS: ☆★☆★☆★☆★☆★☆★☆★☆★☆
- #===============================================================================
- # 1. You MUST give credit to "Dekita" !!
- # 2. You are NOT allowed to repost this script.(or modified versions)
- # 3. You are NOT allowed to convert this script.
- # 4. You are NOT allowed to use this script for Commercial games.
- # 5. ENJOY!
- #
- # "FINE PRINT"
- # By using this script you hereby agree to the above terms and conditions,
- # if any violation of the above terms occurs "legal action" may be taken.
- # Not understanding the above terms and conditions does NOT mean that
- # they do not apply to you.
- # If you wish to discuss the terms and conditions in further detail you can
- # contact me at http://dekitarpg.wordpress.com/
- #
- #===============================================================================
- # ☆ Instructions
- #-------------------------------------------------------------------------------
- # Place Below " ▼ Materials " and Above " ▼ Main " in your script editor.
- #
- #===============================================================================
- # ☆ Notetags ( default )
- #-------------------------------------------------------------------------------
- # <atk skill: skill_id, chance>
- # <grd skill: skill_id, chance>
- #
- # skill_id = the skill id from the database
- # chance = a value from 0-100, 0 = 0% chance, 100 = 100% chance
- #
- # <atk skill: skill_id>
- # <grd skill: skill_id>
- # Use this notetag for weapons that Always use skill_id as the default attack.
- #
- #===============================================================================
- # ☆ Additional Credit
- #-------------------------------------------------------------------------------
- # ' Takemypassword ' - For giving me the inspiration to write this :)
- #
- #===============================================================================
- module Weapon_Attacks
- #===============================================================================
- #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
- # ☆ General Settings
- #--------------------------------------------------------------------------
- # Turn This Script Off Here.
- Use_Script = true
- # Set The Default Attack and Guard Skills Here.
- Default_Skills={
- :attack => 1 ,
- :guard => 2 ,
- } # << Keep
- # Modify The Notetag You Use Here.
- Notes={
- :attack => [ /<atk skill:(.*)>/i , /<atk skill:(.*),(.*)>/i ] ,
- :guard => [ /<grd skill:(.*)>/i , /<grd skill:(.*),(.*)>/i ] ,
- } # << Keep
- end #####################
- # CUSTOMISATION END #
- #####################
- #☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★#
- # #
- # http://dekitarpg.wordpress.com/ #
- # #
- #★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆★☆#
- #===============================================================================#
- # ARE YOU MODIFYING BEYOND THIS POINT? \.\. #
- # YES?\.\. #
- # OMG, REALLY? \| #
- # WELL SLAP MY FACE AND CALL ME A DRAGONITE.\..\.. #
- # I REALLY DIDN'T THINK YOU HAD IT IN YOU.\..\.. #
- #===============================================================================#
- if !$D13x[:CORE]
- #===============================================================================
- module DataManager
- #===============================================================================
- #---------------------------------------------------------------------------
- # Alias List
- #---------------------------------------------------------------------------
- class << self
- alias :lbd_unique_wepatk :load_database
- end
- #---------------------------------------------------------------------------
- # Load Database (alias)
- #---------------------------------------------------------------------------
- def self.load_database
- lbd_unique_wepatk
- loa_unique_wepatk
- end
- #---------------------------------------------------------------------------
- # Load Unique Shit
- #---------------------------------------------------------------------------
- def self.loa_unique_wepatk
- for wep in $data_weapons
- next if wep == nil
- wep.load_unique_defatk
- end
- end
- end # DataManager
- end # if !$D13x[:CORE]
- #===============================================================================
- class RPG::EquipItem < RPG::BaseItem
- #===============================================================================
- #---------------------------------------------------------------------------
- # Alias List
- #---------------------------------------------------------------------------
- alias :deki_weapon_defatk :load_unique_shit if $D13x[:CORE]
- #---------------------------------------------------------------------------
- # Pi Variables
- #---------------------------------------------------------------------------
- attr_accessor :atk_skill_id
- attr_accessor :grd_skill_id
- #---------------------------------------------------------------------------
- # Load Unique Shit
- #---------------------------------------------------------------------------
- def load_unique_shit
- deki_weapon_defatk if $D13x[:CORE]
- load_unique_defatk
- end
- #---------------------------------------------------------------------------
- # Load Unique Notes
- #---------------------------------------------------------------------------
- def load_unique_defatk
- @atk_skill_id = nil
- @grd_skill_id = nil
- load_weapon_defatks
- end
- #---------------------------------------------------------------------------
- # Load Weapon Default Attacks
- #---------------------------------------------------------------------------
- def load_weapon_defatks
- return unless self.is_a?(RPG::Weapon)
- self.note.split(/[\r\n]+/).each do |line|
- case line
- when Weapon_Attacks::Notes[:attack][0] ; @atk_skill_id = [$1.to_i , 100]
- when Weapon_Attacks::Notes[:guard][0] ; @grd_skill_id = [$1.to_i , 100]
- when Weapon_Attacks::Notes[:attack][1] ; @atk_skill_id = [$1.to_i,$2.to_i]
- when Weapon_Attacks::Notes[:guard][1] ; @grd_skill_id = [$1.to_i,$2.to_i]
- end
- end
- end
- end
- #===============================================================================
- class Game_Actor < Game_Battler
- #===============================================================================
- #--------------------------------------------------------------------------
- # Alias List
- #--------------------------------------------------------------------------
- alias :atksklid :attack_skill_id
- alias :grdsklid :guard_skill_id
- #--------------------------------------------------------------------------
- # Get Skill ID of Normal Attack
- #--------------------------------------------------------------------------
- def attack_skill_id
- return atksklid if Weapon_Attacks::Use_Script == false
- self.weapons.each do |e|
- next if e == nil
- next if e.atk_skill_id == nil
- if e.atk_skill_id[0] != nil && e.atk_skill_id[1] > rand(100)
- return e.atk_skill_id[0]
- end
- end
- return Weapon_Attacks::Default_Skills[:attack]
- end
- #--------------------------------------------------------------------------
- # Get Skill ID of Guard
- #--------------------------------------------------------------------------
- def guard_skill_id
- return grdsklid if Weapon_Attacks::Use_Script == false
- self.weapons.each do |e|
- next if e == nil
- next if e.grd_skill_id == nil
- if e.grd_skill_id[0] != nil && e.grd_skill_id[1] > rand(100)
- return e.grd_skill_id[0] if e.grd_skill_id[0] != nil
- end
- end
- return Weapon_Attacks::Default_Skills[:guard]
- end
- end
- #==============================================================================#
- # http://dekitarpg.wordpress.com/ #
- #==============================================================================#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement