设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 103|回复: 0

[转载发布] Dynamic Traits and Effects

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    开心
    2026-7-12 04:10
  • 签到天数: 209 天

    连续签到: 2 天

    [LV.7]常住居民III

    7959

    主题

    864

    回帖

    3万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    29925
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    38778

    灌水之王

    发表于 3 天前 | 显示全部楼层 |阅读模式
    Dynamic Traits and Effects


            2015.11.26


            by Shaz


    Introduction


            This plugin allows you to add and remove traits and effects on database items during gameplay, and to put their values into variables for querying.


    How to Use


            Add to your plugins folder (file name is irrelevant, but I call mine DynamicTraitsAndEffects.js)


            To add or remove traits, use the following plugin commands:


    AddTrait class id traitCode dataId [value]
    RemoveTrait class id traitCode [dataId] [value]




            To add or remove effects, use the following plugin commands:


    AddEffect class id effectCode dataId [value1] [value2]
    RemoveEffect class id effectCode [dataId] [value1] [value2]




            To put the value of a trait or effect into a variable, use the following plugin commands:


    GetTrait var class id traitCode dataId
    GetEffect var1 var2 class id effectCode dataId




            class is the type of object your are changing or querying, and will be one of the following words: actor, class, skill, item, weapon, armor, enemy or state


            id is the object's id in the database


            traitCode and effectCode are tags that correspond to the titles in the Traits and Effects dialogue boxes (see spoiler below).  You need to use the words, not the numbers (so use TRAIT_ELEMENT_RATE rather than 11).


            dataId is the item in the drop-down list in the dialogue boxes.  When the list contains database items (like states, skills, elements) this will be the id of the item.  When the list does not contain database items (HP, maxHP, etc) the first item in the list is 0


            value, value1 and value2 are the values to populate in the trait or effect - if omitted, these will default to 0


            var, var1, var2 are variable ids that will be populated with the value of the traits (one value only) and effects (two values)


            The RemoveTrait and RemoveEffect plugins have optional parameters for dataId and values.  If not entered, ALL traits/effects with the trait/effect code will be removed


            Object id and values can be formulae as long as they have no spaces


            To determine the correct values to pass into the plugin, and whether numbers representing percentages should be whole numbers or fractions (ie 1 = 100% or 100 = 100%), the best thing to do would be to set up the trait or effect temporarily in the database, save, then view the appropriate json file in the Data folder.  The Online JavaScript Beautifier can be used to make it more readable.


            Valid Trait Codes (value in JSON file - text to use in plugin):

    Spoiler                Code:       
    1. *  11-TRAIT_ELEMENT_RATE      41-TRAIT_STYPE_ADD       61-TRAIT_ACTION_PLUS
    2. *  12-TRAIT_DEBUFF_RATE       42-TRAIT_STYPE_SEAL      62-TRAIT_SPECIAL_FLAG
    3. *  13-TRAIT_STATE_RATE        43-TRAIT_SKILL_ADD       63-TRAIT_COLLAPSE_TYPE
    4. *  14-TRAIT_STATE_RESIST      44-TRAIT_SKILL_SEAL      64-TRAIT_PARTY_ABILITY
    5. *  21-TRAIT_PARAM             51-TRAIT_EQUIP_WTYPE
    6. *  22-TRAIT_XPARAM            52-TRAIT_EQUIP_ATYPE
    7. *  23-TRAIT_SPARAM            53-TRAIT_EQUIP_LOCK
    8. *  31-TRAIT_ATTACK_ELEMENT    54-TRAIT_EQUIP_SEAL
    9. *  32-TRAIT_ATTACK_STATE      55-TRAIT_SLOT_TYPE
    10. *  33-TRAIT_ATTACK_SPEED
    11. *  34-TRAIT_ATTACK_TIMES
    复制代码








            Valid Effect Codes (value in JSON file - text to use in plugin):

    Spoiler                Code:       
    1. *  11-EFFECT_RECOVER_HP       41-EFFECT_SPECIAL
    2. *  12-EFFECT_RECOVER_MP       42-EFFECT_GROW
    3. *  13-EFFECT_GAIN_TP          43-EFFECT_LEARN_SKILL
    4. *  21-EFFECT_ADD_STATE        44-EFFECT_COMMON_EVENT
    5. *  22-EFFECT_REMOVE_STATE
    6. *  31-EFFECT_ADD_BUFF
    7. *  32-EFFECT_ADD_DEBUFF
    8. *  33-EFFECT_REMOVE_BUFF
    9. *  34-EFFECT_REMOVE_DEBUFF
    复制代码








    Plugin


    Download from pastebin


    Credit


            - Shaz


    Terms


            - free for use in commercial games


    Notes


            Post below if you need help setting up plugin commands


    本贴来自国际rpgmaker官方论坛作者:Shaz处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/dynamic-traits-and-effects.51533/
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-8-1 01:30 , Processed in 0.115001 second(s), 54 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表