Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Axis & Allies 1942 Online is now available in Early Access! Buy it on Steam. The FAQ is available.
New Premium Module: Tyrants of the Moonsea! Read More
Attention, new and old users! Please read the new rules of conduct for the forums, and we hope you enjoy your stay!

-HOW TO DO STUFF IN WEIDU-

12467

Comments

  • TressetTresset Member, Moderator Posts: 7,573
    Eh... that may be a bit above me at the moment... Thanks for the suggestion though.

  • semiticgodsemiticgod Member, Moderator Posts: 13,400
    It occurs to me that you can reverse all of the EE edits that prevented stuff from stacking by removing opcode 321, Remove Effects by Resource (and maybe opcode 318, which I believe is an EE-exclusive Protection from Spell opcode) from all spells and items.

    How would you erase all traces of opcode 321 in WeiDu?

  • subtledoctorsubtledoctor Member Posts: 11,179
    edited September 2017

    It occurs to me that you can reverse all of the EE edits that prevented stuff from stacking by removing opcode 321, Remove Effects by Resource (and maybe opcode 318, which I believe is an EE-exclusive Protection from Spell opcode) from all spells and items.

    How would you erase all traces of opcode 321 in WeiDu?

    Something like:
    COPY_EXISTING_REGEXP GLOB ~^.+\.spl$~ ~override~
    LPF DELETE_EFFECT INT_VAR match_opcode = 321 STR_VAR resource = EVAL ~%SOURCE_RES%~ END
    BUT_ONLY
    That doesn't eliminate all traces of 321, which would be Very Bad. It only removes those instances of 321 where the spell being cancelled is the spell that triggered the 321 effect. Generally this captures anti-stacking effects, which are the first effects in a header. It would be a great idea to make sure of that before deleting the effect, but it would require a lot more annoying "loop through headers and set variables" code - there is no simple macro that can check that.

    Note: this paints with a very broad brush...don't come to me if it breaks something. Also note, this will not bring you to some kind of "pre-EE state" or a "pre-1.4 state." The original engine did prevent stacking in tons of cases, it just used opcode 206 as the last effect in a header instead of 321 as the first effect. When you think about how that works, you realize it is terrible. It lets you straight-up waste spells without realizing it. The EEs' use of 321 does not amount to a nerf... rather it is a massive, massive improvement.

    Playing/modding these games without opcode 321 at your disposal is awful.

    semiticgod
  • TressetTresset Member, Moderator Posts: 7,573
    How could I add lines to a .bcs file with weidu? I want to add an extra block of script to baldur.bcs to fix a bug. I have the text I want to add, but am not sure how to command weidu to put it in there.

  • subtledoctorsubtledoctor Member Posts: 11,179
    edited September 2017
    Tresset said:

    How could I add lines to a .bcs file with weidu? I want to add an extra block of script to baldur.bcs to fix a bug. I have the text I want to add, but am not sure how to command weidu to put it in there.

    Get a more certain answer from someone else than me, because I'm not too experienced with scripting and I avoid baldur.bcs like the plague. But I think you would write your s croon of script as s .baf file and then do:
    EXTEND_TOP ~baldur.bcs~ ~mymod/nuscript.baf~
    Or:
    EXTEND_BOTTOM ~baldur.bcs~ ~mymod/nuscript.baf~
    ...depending on where your code should be.

  • GwendolyneGwendolyne Member Posts: 246
    edited September 2017
    Your code is OK if you want to add a brand new block. Otherwise, if you want to modify an existing block:
    COPY_EXISTING ~baldur.bcs~   ~override~
        DECOMPILE_BCS_TO_BAF
        REPLACE_TEXTUALLY ~old code~ ~new code~
        COMPILE_BAF_TO_BCS
    BUT_ONLY
    

    Raduziel
  • argent77argent77 Member Posts: 2,736
    DECOMPILE_BCS_TO_BAF has been superseded by DECOMPILE_AND_PATCH. It has the advantage that a compile error would leave no decompiled script file behind.

    The same sample code would look like this:
    COPY_EXISTING ~baldur.bcs~ ~override~ DECOMPILE_AND_PATCH BEGIN REPLACE_TEXTUALLY ~old code~ ~new code~ END BUT_ONLY

    Raduziel
  • TressetTresset Member, Moderator Posts: 7,573
    edited September 2017
    @subtledoctor Thanks! That was easier than I anticipated.

    @Gwendolyne Are you sure? According to the weidu documentation that I read you are supposed to use DECOMPILE_AND_PATCH instead of DECOMPILE_BCS_TO_BAF and COMPILE_BAF_TO_BCS, but what do I know?

    Edit: Ninja'd by argent77.

  • GwendolyneGwendolyne Member Posts: 246
    @Tresset and @Argent77 You are right. It is just a bad habit. I have been using it for so long that I always write it this way before remembering to replace it with DECOMPILE_AND_PATCH. :blush:

  • TressetTresset Member, Moderator Posts: 7,573
    edited September 2017
    Is there some mysterious magical trick to REPLACE_TEXTUALLY when it comes to editing .bcs files? I am copying the block I want to remove directly from NI but nothing ever gets overwritten...

    Edit: I am thinking that I am not using REGEXP syntax properly...

    Post edited by Tresset on
  • TressetTresset Member, Moderator Posts: 7,573
    edited September 2017
    Ok, here is what I have:

    COPY_EXISTING ~Meliss01.bcs~ ~override~
    ~Meliss02.bcs~ ~override~
    ~Meliss03.bcs~ ~override~
    DECOMPILE_AND_PATCH BEGIN
    REPLACE_TEXTUALLY ~IF
    See(NearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    !HPLT(Myself,20)
    !GlobalTimerNotExpired("UndeadTurn","LOCALS")
    Range(LastSeenBy(Myself),20)
    !HPGT(LastSeenBy(Myself),75)
    THEN
    RESPONSE #100
    SetGlobalTimer("UndeadTurn","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,73243) // Undead thing begone!
    CreateVisualEffectObject("SPDISPMA",NearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    ActionOverride(NearestEnemyOfType([GOODCUTOFF.UNDEAD]),Kill(Myself))
    END~ ~IF
    !Allegiance(NearestEnemyOfType([GOODCUTOFF.UNDEAD]),PC)
    See(NearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    !HPLT(Myself,20)
    !GlobalTimerNotExpired("UndeadTurn","LOCALS")
    Range(LastSeenBy(Myself),20)
    !HPGT(LastSeenBy(Myself),75)
    THEN
    RESPONSE #100
    SetGlobalTimer("UndeadTurn","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,73243) // Undead thing begone!
    CreateVisualEffectObject("SPDISPMA",NearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    ActionOverride(NearestEnemyOfType([GOODCUTOFF.UNDEAD]),Kill(Myself))
    END

    IF
    !Allegiance(SecondNearestEnemyOfType([GOODCUTOFF.UNDEAD]),PC)
    See(SecondNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    !HPLT(Myself,20)
    !GlobalTimerNotExpired("UndeadTurn","LOCALS")
    Range(LastSeenBy(Myself),20)
    !HPGT(LastSeenBy(Myself),75)
    THEN
    RESPONSE #100
    SetGlobalTimer("UndeadTurn","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,73243) // Undead thing begone!
    CreateVisualEffectObject("SPDISPMA",SecondNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    ActionOverride(SecondNearestEnemyOfType([GOODCUTOFF.UNDEAD]),Kill(Myself))
    END

    IF
    !Allegiance(ThirdNearestEnemyOfType([GOODCUTOFF.UNDEAD]),PC)
    See(ThirdNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    !HPLT(Myself,20)
    !GlobalTimerNotExpired("UndeadTurn","LOCALS")
    Range(LastSeenBy(Myself),20)
    !HPGT(LastSeenBy(Myself),75)
    THEN
    RESPONSE #100
    SetGlobalTimer("UndeadTurn","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,73243) // Undead thing begone!
    CreateVisualEffectObject("SPDISPMA",ThirdNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    ActionOverride(ThirdNearestEnemyOfType([GOODCUTOFF.UNDEAD]),Kill(Myself))
    END

    IF
    !Allegiance(FourthNearestEnemyOfType([GOODCUTOFF.UNDEAD]),PC)
    See(FourthNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    !HPLT(Myself,20)
    !GlobalTimerNotExpired("UndeadTurn","LOCALS")
    Range(LastSeenBy(Myself),20)
    !HPGT(LastSeenBy(Myself),75)
    THEN
    RESPONSE #100
    SetGlobalTimer("UndeadTurn","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,73243) // Undead thing begone!
    CreateVisualEffectObject("SPDISPMA",FourthNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    ActionOverride(FourthNearestEnemyOfType([GOODCUTOFF.UNDEAD]),Kill(Myself))
    END

    IF
    !Allegiance(FifthNearestEnemyOfType([GOODCUTOFF.UNDEAD]),PC)
    See(FifthNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    !HPLT(Myself,20)
    !GlobalTimerNotExpired("UndeadTurn","LOCALS")
    Range(LastSeenBy(Myself),20)
    !HPGT(LastSeenBy(Myself),75)
    THEN
    RESPONSE #100
    SetGlobalTimer("UndeadTurn","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,73243) // Undead thing begone!
    CreateVisualEffectObject("SPDISPMA",FifthNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    ActionOverride(FifthNearestEnemyOfType([GOODCUTOFF.UNDEAD]),Kill(Myself))
    END

    IF
    !Allegiance(SixthNearestEnemyOfType([GOODCUTOFF.UNDEAD]),PC)
    See(SixthNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    !HPLT(Myself,20)
    !GlobalTimerNotExpired("UndeadTurn","LOCALS")
    Range(LastSeenBy(Myself),20)
    !HPGT(LastSeenBy(Myself),75)
    THEN
    RESPONSE #100
    SetGlobalTimer("UndeadTurn","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,73243) // Undead thing begone!
    CreateVisualEffectObject("SPDISPMA",SixthNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    ActionOverride(SixthNearestEnemyOfType([GOODCUTOFF.UNDEAD]),Kill(Myself))
    END

    IF
    !Allegiance(SeventhNearestEnemyOfType([GOODCUTOFF.UNDEAD]),PC)
    See(SeventhNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    !HPLT(Myself,20)
    !GlobalTimerNotExpired("UndeadTurn","LOCALS")
    Range(LastSeenBy(Myself),20)
    !HPGT(LastSeenBy(Myself),75)
    THEN
    RESPONSE #100
    SetGlobalTimer("UndeadTurn","LOCALS",ONE_ROUND)
    DisplayStringHead(Myself,73243) // Undead thing begone!
    CreateVisualEffectObject("SPDISPMA",SeventhNearestEnemyOfType([GOODCUTOFF.UNDEAD]))
    ActionOverride(SeventhNearestEnemyOfType([GOODCUTOFF.UNDEAD]),Kill(Myself))
    END~
    END
    BUT_ONLY

    I figure I need a whole ton of backslashes and things in this code, but I have no idea where to put them...

  • TressetTresset Member, Moderator Posts: 7,573
    @argent77 THANK YOU VERY MUCH!!! I doubt I would have ever figured out to do it that way. I will have to study that code carefully for future reference!

  • semiticgodsemiticgod Member, Moderator Posts: 13,400
    Would it be possible to use a custom spell to assign a custom kit to the target? I can use Change AI Type to turn a critter into a ranger, but I don't know how to give it a kit, much less a non-vanilla kit.

  • kjeronkjeron Member Posts: 2,005

    Would it be possible to use a custom spell to assign a custom kit to the target? I can use Change AI Type to turn a critter into a ranger, but I don't know how to give it a kit, much less a non-vanilla kit.

    KIT.IDS is not available for opcode 72 (Change AI type).
    Only script actions work:
    • AddKit(KIT) // Remove existing kit CLAB features and apply new kits CLAB level by level.
    • AddSuperKit(KIT) // Retain existing kit CLAB features and apply new kits CLAB level by level.
    • ChangeStat(Myself,KIT,#,ADD/SET) // Retain existing kit CLAB features, does not apply new kits CLAB.

    semiticgod
  • subtledoctorsubtledoctor Member Posts: 11,179
    edited September 2017
    chimeric said:

    What's a CLAB?

    CLABFI01.2da, CLABDR01.2da, CLABRA03.2da, etc. The .2da tables that have all of the abilities associated with a kit.

  • RatatoskrRatatoskr Member Posts: 353
    This is more of a general coding question than a Weidu question. But does anyone know how to move an entire chain of journal entries into the Quest Done section from the active quest section? I don't want to leave the original journal entries dangling once my custom quest is finished.

  • AionZAionZ Member Posts: 3,014
    @Ratatoskr

    Journal entries can be a bit complicated. But if you add something like the below to the tp2, you can group several journal entry chains together (you need a translation file for this though):
    // JOURNAL ADD_JOURNAL TITLE (@10000) @10001 @10002 @10003 @10004 @10005 @10006 @10007 @10008 USING ~%MOD_FOLDER%/translations/english/setup.tra~ ADD_JOURNAL TITLE (@20000) @20001 @20002 USING ~%MOD_FOLDER%/translations/english/setup.tra~
    Check out my Drake and Aura NPC mods which make use of the journal. Also, there is an EraseJournalEntry() command.

  • RatatoskrRatatoskr Member Posts: 353

    @Ratatoskr

    Journal entries can be a bit complicated. But if you add something like the below to the tp2, you can group several journal entry chains together (you need a translation file for this though):
    // JOURNAL ADD_JOURNAL TITLE (@10000) @10001 @10002 @10003 @10004 @10005 @10006 @10007 @10008 USING ~%MOD_FOLDER%/translations/english/setup.tra~ ADD_JOURNAL TITLE (@20000) @20001 @20002 USING ~%MOD_FOLDER%/translations/english/setup.tra~
    Check out my Drake and Aura NPC mods which make use of the journal. Also, there is an EraseJournalEntry() command.

    Thanks. I was hoping for a nice simple 'move journal entry' command but I suppose that would be too easy :-)

    Sounds like I'll have to go the deleting entry route after all, though your code might help me add/delete a bunch at once. So thanks.

  • RatatoskrRatatoskr Member Posts: 353
    For a completely different question, does anyone know a command to change a character's thief skills after a certain piece of dialogue? I know the game changes the PC's stats from dialogue sometimes, but I can't recall a place where a companion gets changed instead to go look at the code.

    I want to have a conversation between Jan and a modded thief that causes a +5 increase to the mod thief's pickpocket skill. Can I just edit their character file somehow?

    Thanks in advance.

  • AionZAionZ Member Posts: 3,014
    @Ratatoskr

    Make a nameless spell that provides +5% Pick Pockets with the duration type set to 9 (permanent after death). Use ApplySpellRES(SpellRES,Target) in the dialog to cast the spell on the target.

  • RatatoskrRatatoskr Member Posts: 353
    @Artemius_I interesting. I would literally have never thought of that. I guess I'm learning how to make spells too ;-)

    Thankfully that's a ways down the coding process.

  • subtledoctorsubtledoctor Member Posts: 11,179
    Ratatoskr said:

    I guess I'm learning how to make spells too

    Spells aren't bad. Just 1) start with a base spell, like Magic Missile or Bless or Shield; 2) export a copy of it with a new filename; and 3) open the copy and edit things in NI or DLTCEP. It's a bit tedious but not conceptually difficult.

    My advice: before you invest too heavily in that tedium, learn about the various spell-editing functions in Weidu (WRITE_BYTE, WRITE_SHORT, WRITE_LONG, ADD_SPELL_EFFECT, ALTER_EFFECT, CLONE_EFFECT), and learn how to build your spells with Weidu, in the .tp2 file, rather than making them in the other programs and just COPYing over the finished spell. It's a bit of a leap in the early stages but it is way easier to manage and edit things later on in the testing stages.

    As an example, the large portion of my "revised stat bonuses" component is made from just two initial template spells: "d5_stats.spl," which has about 40 'cast spell on condition' effects patched into it, and "d5_statx.spl," which is cloned to create about 40 new spells, each of which is patched at the time of cloning and each of which corresponds to one of the 40 effects in d5_stats.spl:

    COPY ~scales_of_balance/stats/d5_stats.spl~ ~override~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %dex_16% target = 1 timing = 1 STR_VAR resource = ~d5dex16~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %dex_17% target = 1 timing = 1 STR_VAR resource = ~d5dex17~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %dex_18% target = 1 timing = 1 STR_VAR resource = ~d5dex18~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %dex_19% target = 1 timing = 1 STR_VAR resource = ~d5dex19~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %dex_20% target = 1 timing = 1 STR_VAR resource = ~d5dex20~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %dex_21% target = 1 timing = 1 STR_VAR resource = ~d5dex21~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %dex_22% target = 1 timing = 1 STR_VAR resource = ~d5dex22~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %dex_23% target = 1 timing = 1 STR_VAR resource = ~d5dex23~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %dex_24% target = 1 timing = 1 STR_VAR resource = ~d5dex24~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %dex_25% target = 1 timing = 1 STR_VAR resource = ~d5dex25~ END

    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %int_16% target = 1 timing = 1 STR_VAR resource = ~d5int16~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %int_17% target = 1 timing = 1 STR_VAR resource = ~d5int17~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %int_18% target = 1 timing = 1 STR_VAR resource = ~d5int18~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %int_19% target = 1 timing = 1 STR_VAR resource = ~d5int19~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %int_20% target = 1 timing = 1 STR_VAR resource = ~d5int20~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %int_21% target = 1 timing = 1 STR_VAR resource = ~d5int21~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %int_22% target = 1 timing = 1 STR_VAR resource = ~d5int22~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %int_23% target = 1 timing = 1 STR_VAR resource = ~d5int23~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %int_24% target = 1 timing = 1 STR_VAR resource = ~d5int24~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %int_25% target = 1 timing = 1 STR_VAR resource = ~d5int25~ END

    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_13% target = 1 timing = 1 STR_VAR resource = ~d5wis13~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_14% target = 1 timing = 1 STR_VAR resource = ~d5wis14~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_15% target = 1 timing = 1 STR_VAR resource = ~d5wis15~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_16% target = 1 timing = 1 STR_VAR resource = ~d5wis16~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_17% target = 1 timing = 1 STR_VAR resource = ~d5wis17~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_18% target = 1 timing = 1 STR_VAR resource = ~d5wis18~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_19% target = 1 timing = 1 STR_VAR resource = ~d5wis19~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_20% target = 1 timing = 1 STR_VAR resource = ~d5wis20~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_21% target = 1 timing = 1 STR_VAR resource = ~d5wis21~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_22% target = 1 timing = 1 STR_VAR resource = ~d5wis22~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_23% target = 1 timing = 1 STR_VAR resource = ~d5wis23~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_24% target = 1 timing = 1 STR_VAR resource = ~d5wis24~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %wis_25% target = 1 timing = 1 STR_VAR resource = ~d5wis25~ END

    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_14% target = 1 timing = 1 STR_VAR resource = ~d5cha14~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_15% target = 1 timing = 1 STR_VAR resource = ~d5cha15~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_16% target = 1 timing = 1 STR_VAR resource = ~d5cha16~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_17% target = 1 timing = 1 STR_VAR resource = ~d5cha17~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_18% target = 1 timing = 1 STR_VAR resource = ~d5cha18~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_19% target = 1 timing = 1 STR_VAR resource = ~d5cha19~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_20% target = 1 timing = 1 STR_VAR resource = ~d5cha20~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_21% target = 1 timing = 1 STR_VAR resource = ~d5cha21~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_22% target = 1 timing = 1 STR_VAR resource = ~d5cha22~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_23% target = 1 timing = 1 STR_VAR resource = ~d5cha23~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_24% target = 1 timing = 1 STR_VAR resource = ~d5cha24~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 326 parameter2 = %cha_25% target = 1 timing = 1 STR_VAR resource = ~d5cha25~ END

    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5dex16.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5dex16~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 284 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5dex17.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5dex17~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 284 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5dex18.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5dex18~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 284 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5dex19.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5dex19~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 284 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5dex20.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5dex20~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 284 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5dex21.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5dex21~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 284 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5dex22.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5dex22~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 284 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5dex23.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5dex23~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 284 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5dex24.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5dex24~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 284 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5dex25.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5dex25~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 284 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END

    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5int17.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5int17~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5int18.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5int18~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 1 parameter2 = 1 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5int19.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5int19~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 1 parameter2 = 1 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5int20.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5int20~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 2 parameter2 = 1 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5int21.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5int21~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 2 parameter2 = 1 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5int22.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5int22~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 3 parameter2 = 1 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5int23.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5int23~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 4 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 3 parameter2 = 1 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5int24.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5int24~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 4 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 4 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 4 parameter2 = 1 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5int25.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5int25~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 5 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 4 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 191 parameter1 = 4 parameter2 = 1 target = 1 timing = 0 duration = 7 END

    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis13.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis13~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 102 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis14.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis14~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 104 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis15.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis15~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 106 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis16.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis16~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 108 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis17.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis17~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 110 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis18.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis18~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 112 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis19.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis19~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 114 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis20.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis20~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 115 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis21.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis21~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 116 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis22.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis22~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 117 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis23.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis23~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 4 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 118 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis24.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis24~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 4 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 119 parameter2 = 2 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5wis25.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5wis25~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 4 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 104 parameter1 = 120 parameter2 = 2 target = 1 timing = 0 duration = 7 END

    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha14.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha14~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha15.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha14~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha16.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha15~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha17.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha16~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha18.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha17~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 22 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha19.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha18~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 22 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha20.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha19~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 22 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha21.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha20~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 22 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha22.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha21~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 22 parameter1 = 1 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha23.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha22~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 22 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha24.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha23~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 22 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    COPY ~scales_of_balance/stats/d5_statx.spl~ ~override/d5cha25.spl~
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 321 parameter2 = 0 target = 1 timing = 1 STR_VAR resource = ~d5cha24~ END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 36 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 34 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 33 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 35 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 37 parameter1 = 3 parameter2 = 0 target = 1 timing = 0 duration = 7 END
    LPF ADD_SPELL_EFFECT INT_VAR opcode = 22 parameter1 = 2 parameter2 = 0 target = 1 timing = 0 duration = 7 END

    tbone1Grammarsalad
  • RatatoskrRatatoskr Member Posts: 353
    Thanks for the advice. I don't plan to make too many spells at the moment but it's always good to know how to do things properly. Once I get to that point, I'll have to see how many spells I actually need and then go from there.

    I did manage to code my first 2 interjections ever yesterday so there's progress being made.

  • semiticgodsemiticgod Member, Moderator Posts: 13,400
    @subtledoctor: I just had an idea for a small mod and I think you know how to do it. I'd like to create a mod that makes plot-immune critters go to 1 HP whenever one of their ability scores goes below 1 or 2. The idea is to allow stat drain to trigger death dialogues like Abazigal's or Irenicus' without breaking a script somewhere--very convenient for Archers using STR drain, Haer'dalis using DEX drain, or mages using INT drain.

    I know that WeiDu can apply the relevant effect to any item with the minimum HP opcode, but I don't know how to rig an opcode to apply a nonmagical Harm effect on self when an ability score hits a certain value.

  • subtledoctorsubtledoctor Member Posts: 11,179
    edited January 2018

    @subtledoctor: I just had an idea for a small mod and I think you know how to do it. I'd like to create a mod that makes plot-immune critters go to 1 HP whenever one of their ability scores goes below 1 or 2. The idea is to allow stat drain to trigger death dialogues like Abazigal's or Irenicus' without breaking a script somewhere--very convenient for Archers using STR drain, Haer'dalis using DEX drain, or mages using INT drain.

    I know that WeiDu can apply the relevant effect to any item with the minimum HP opcode, but I don't know how to rig an opcode to apply a nonmagical Harm effect on self when an ability score hits a certain value.

    You could set a recurring check for ability score < x and set HP = 1 when it returns true.

    I do this for dynamic stat bonuses that go beyond what the game normally does with stats (e.g., melee to-hit bonus for high DEX). Here's a template. (2nd post on that 2nd page of the thread.) You would create the contingency and effect(s) and then use ADD_CRE_EFFECT to patch them onto whatever creature you want.

    But... since you are talking about enemies, who generally don't have these kinds of things active, you maybe could do it more simply by patching them with a 272 effect, triggering an .EFF each round which uses opcode 326 to evaluate the stat. 272 effects have issues, if they are stacked they can intermittently fail; but in this application the risk of that might be pretty low.

    In either case, be aware that the condition is only evaluated once each round, like bard songs or turn undead. So an Archer with Whirlwind/IH and Called shot might be frustrated if they land 8 hits in one round and don't see the desired effect. But it would trigger at the end of the round.

    semiticgod
  • RaduzielRaduziel Member Posts: 4,477
    Is there a way to alter the Turn Undead effects for a kit?

    As a stupid example: Make it capable of turn Undead and Myconids.

  • subtledoctorsubtledoctor Member Posts: 11,179
    Raduziel said:

    Is there a way to alter the Turn Undead effects for a kit?

    As a stupid example: Make it capable of turn Undead and Myconids.

    Nope. Best you could do is make it a Bard kit and mod the Bard Song. Or make it a Shaman kit and mod the Shaman Dance.

    semiticgod
  • semiticgodsemiticgod Member, Moderator Posts: 13,400
    Theoretically, you could create a spell that would turn myconids into undead, at which point any cleric's turn undead would work on them.

    Raduziel
Sign In or Register to comment.