Utils: Equip Checks

Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

This script provides a set of convenience script calls for your checking equips. You can check actors based on their ID, or based on their position in the party.

For example, you can check if an actor has a certain weapon or armor equipped. In addition to checking specific weapons or armors, you can check whether certain weapon types or armor types are equipped, or even when an equip type is equipped.

Not only can you check whether a single equip is equipped, you can check if any equip from a list of equips is equipped, or whether all equips from a list of equips is equipped.

Download

Script: download here

Installation

Place this script below Materials and above Main

Usage

All script calls take an “index”, which can be either the actor ID or the
party index.

The actor ID is based on the database ID of the actor, and uses positive
indices. If you pass in a 1, you will check actor 1.

The party index is based on the position in the party, and you use negative
indices. For example, if you pass in a -1, it will check the current first
actor in the party.

The ID of the weapons and armors can be looked up in the database.
The ID of the weapon types and armor types can be looked up in the terms.

The following script calls check whether a certain equip is equipped.

weapon_equipped?(index, weapon_id) - true if weapon is equipped
armor_equipped?(index, armor_id) - true if armor is equipped
wtype_equipped?(index, wtype_id) - true if weapon type is equipped
atype_equipped?(index, atype_id) - true if armor type is equipped

The following script calls check whether any equip from a list of ID’s is
equipped. Pass the ID’s in the form [1,2,3]

any_weapon_equipped?(index, weapon_ids)
any_armor_equipped?(index, armor_ids)
any_wtype_equipped?(index, wtype_ids)
any_atype_equipped?(index, atype_ids)

The following script calls check whether all equips from a list of ID’s is
equipped. Pass the ID’s in the form [1,2,3]. Note the plural in the method
names

all_weapons_equipped?(index, weapon_ids)
all_armors_equipped?(index, armor_ids)
all_wtypes_equipped?(index, wtype_ids)
all_atypes_equipped?(index, atype_ids)

Examples

To check whether actor 1 has weapon 3 equipped, use

weapon_equipped?(1, 3)

To check whether the second member of the party has either weapon 1, 3, or 8
equipped, use

any_weapon_equipped?(-2, [1,3,8])

To check whether the third actor has all of armors 1, 12, and 34 equipped, use

all_armors_equipped?(3, [1, 12, 34])
Help spread the word!Share on FacebookShare on TumblrTweet about this on TwitterShare on Google+Share on LinkedInShare on RedditFlattr the author

You may also like...

Leave a Reply

Your email address will not be published.

To create code blocks or other preformatted text, indent by four spaces:

    This will be displayed in a monospaced font. The first four 
    spaces will be stripped off, but all other whitespace
    will be preserved.
    
    Markdown is turned off in code blocks:
     [This is not a link](http://example.com)

To create not a block, but an inline code span, use backticks:

Here is some inline `code`.

For more help see http://daringfireball.net/projects/markdown/syntax