Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: themrmystery on February 13, 2009, 11:59:15 am

Title: [XP] Simple Multi-Weapon Set Script
Post by: themrmystery on February 13, 2009, 11:59:15 am
Multi-Weapon Sets
Authors: themrmystery
Version: 1
Type: Additional Weapon Sets
Key Term: Game Utility



Introduction

Made to recreate d&d style weapon proficiencies.


Features




Demo
Spoiler: ShowHide
http://themrmystery.com/RMXP/WeaponSetDemo.rar (http://themrmystery.com/RMXP/WeaponSetDemo.rar)

Script

Spoiler: ShowHide
#===============================================================================
#  Multi-Weapon Sets, by TheMrMystery
#  v. 1.0
#----------------------------------------------------------------------
#  Instructions:  Put below all other scripts and above Main.
#                 Look for the Configuration section, near the top.

#  Features:  Allows actors that know specific skills, to use the weapons of
#             another class.
#   
#             Creates the ability to make weapon proficiencies as such;
#             - allowing a Wizard to become a Spell Sword, by letting him
#               take the skill "Use Swords" and unlocking all weapons listed
#               in the "Use Sword" class.
#
#  Why was this script made?
#        For creation of a Dungeons & Dragons style weapon proficiency.
#
#  Compatability:
#    There are no known clashes with other scripts.
#
#  Notes:
#    This script aliases the stats in Game_Actor, and rewrites the refresh
#    method in Window_EquipItem.
#
#  Special Thanks:
#    Modern Algebra: rmrk.net (My "mentor" in writing my first script: this one)
#
#  Legal:
#    This script is not to be used for commercial use without express permission
#    by myself (TheMrMystery, copywrite@themrmystery.com)
#
#    This script may editted to suit your needs, however, please first suggest
#    any additions to me via, forum @ rmrk.net
#
#    If you use this script, please provide some credit to myself (TheMrMystery)
#    somewhere in your game.
#===============================================================================

#===============================================================================
#  Start Code
#===============================================================================

class Game_Actor

  alias mystery_multi_item_sets equippable?

  def equippable?(item)

    #---- Start Configuration ----
    # Enter the skill_id of the skill required to unlock the weapon list
    # Enter the class_id of the class that has the weapons wanted
    # Example: skill_id = 28 is Weapon Mastery: Whip
    #          class_id = 13 is Whip Master (class); which contains all whips
    #                                                in his class weapon list
skill_id_array = [28, 10]
class_id_array = [13, 11] 
    #---- End Configuration ------
   
     eqp_check = mystery_multi_item_sets (item)
     return true if eqp_check
     if item.is_a?(RPG::Weapon)
      real_class = @class_id
      # If weapon proficiency learned
      for i in 0...skill_id_array.size
        if skill_learn? (skill_id_array[i])
          @class_id = class_id_array[i]
          eqp_check |= mystery_multi_item_sets (item)
          @class_id = real_class
        end
      end
    end
    return eqp_check
  end
end


class Window_EquipItem
 
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    # Add equippable weapons
    if @equip_type == 0
      for i in 1...$data_weapons.size
        if $game_party.weapon_number(i) > 0 && @actor.equippable? ($data_weapons[i])
          @data.push($data_weapons[i])
        end
      end
    end
    # Add equippable armor
    if @equip_type != 0
      armor_set = $data_classes[@actor.class_id].armor_set
      for i in 1...$data_armors.size
        if $game_party.armor_number(i) > 0 and armor_set.include?(i)
          if $data_armors[i].kind == @equip_type-1
            @data.push($data_armors[i])
          end
        end
      end
    end
    # Add blank page
    @data.push(nil)
    # Make a bit map and draw all items
    @item_max = @data.size
    self.contents = Bitmap.new(width - 32, row_max * 32)
    for i in 0...@item_max-1
      draw_item(i)
    end
  end
end
#===============================================================================
#  End Code
#===============================================================================



Instructions

See Script.


Compatibility

None that I know of.


Credits and Thanks




Author's Notes
First, I apologize for posting in this section, but I do not have permission/the button to post a new topic in the Script Database.  This script was written by me, it's my first script, it works as instructed.  I do intend to make it better, but only after I learn a bit more about scripting.  Just thought I'd help contribute though and post it in case anyone else was looking for a script like this.

What it does:

It allows you to assign specific skills to trigger more weapon set usability.
This script works well with Blizzard's RO Job Skills

Say you have a Lancer, that can only use Lances and you want to equip a really nice sword you found.
Simply create a "passive skill" and call it: "Sword Use" set it to have the default 1 level.
Next create a class called "Sword Guy" and give him the ability to use every sword.
Now in my script, find the skill_id configuration array, and assign the skill_id to array slot 1, and the class_id for Sword guy to class array slot 1

Now for each individual actor, that spends 1 job point on Use Sword, will now have access to the Sword Guys weapon sets.

Enjoy!

Title: Re: [XP] Simple Multi-Weapon Set Script
Post by: Blizzard on February 13, 2009, 01:08:09 pm
Quote from: themrmystery on February 13, 2009, 11:59:15 am
First, I apologize for posting in this section, but I do not have permission/the button to post a new topic in the Script Database.


Don't worry, that's the point. Not all scripts end up in the database. :)
Title: Re: [XP] Simple Multi-Weapon Set Script
Post by: Kagutsuchi on February 14, 2009, 02:06:26 pm
I think this is a very good idea ^^ I haven't tested it, cause I don't have any project to test it in, but as long as it is pretty much bug free, and is indeed compatible with RO job/skill system then it is awesome!
Title: Re: [XP] Simple Multi-Weapon Set Script
Post by: G_G on February 14, 2009, 02:28:00 pm
demo please? I really didn't catch any of the instructions. They're confusing.
Title: Re: [XP] Simple Multi-Weapon Set Script
Post by: themrmystery on February 14, 2009, 05:53:36 pm
Demo added, see above... it's a very quick demo, but easy to figure out.
Title: Re: [XP] Simple Multi-Weapon Set Script
Post by: G_G on February 14, 2009, 07:00:59 pm
thnx I'll try it out.
Title: Re: [XP] Simple Multi-Weapon Set Script
Post by: themrmystery on February 14, 2009, 07:24:51 pm
Quote from: Kagutsuchi on February 14, 2009, 02:06:26 pm
I think this is a very good idea ^^ I haven't tested it, cause I don't have any project to test it in, but as long as it is pretty much bug free, and is indeed compatible with RO job/skill system then it is awesome!


Yea, it was made for RO Job Skills, and I actually included Blizzard's script in my demo.... Although, I suppose it could be used to let a character class learn new weapon sets as he leveled up...your imagination is the limit! Enjoy