Skip to content

How to use WeiDU to edit Carsomyr?

LathspellguestLathspellguest Member Posts: 60
edited April 2016 in General Modding
Basically, I want to change the MR from 50% to 20%, remove the additional damage to chaotic evil, remove the "dispel magic 3x per day," make it usable only by wizard slayers, and also rename the sword and change the description.

Or is it easier to create a new +5 two-handed sword that dispels on hit and provides 20% magic, and then replace Carsomyr in Firkraag's drop?

In either case, I have no idear how to use WeiDU to accomplish my goals. I can make the appropriate changes in Near Infinity, but they're undone by mod installs after the fact.
Post edited by Lathspellguest on

Comments

  • DeltharisDeltharis Member Posts: 124
    While I wouldn't mind seeing how to do that easily - it would be easier if you just did your Near Infinity edits after modding? It's not like you'll be doing it more than once per playthrough. And than keep your edited Carsomyr file in a safe location and just copy it to override when you do another installation...
  • LathspellguestLathspellguest Member Posts: 60
    Actually that probably is the easiest way to do it. In that case, I'd just need to know how to have WeiDU replace the description text, right?
  • ErgErg Member Posts: 1,756
    edited April 2016
    The following has been tested only on BG2, because I don't have BGII:EE, so it is possible that some changes may be required, but it should get you started.

    First you need to create a tp2 file containing something like:
    BACKUP ~Your_mod_name/backup~
    AUTHOR ~Lathspellguest, at http://forum.baldursgate.com~
    VERSION ~v1~

    BEGIN ~Your mod~

    COPY_EXISTING ~SW2H10.ITM~ ~override~ // Carsomyr +5
    PATCH_IF SOURCE_SIZE > 0x71 BEGIN
    // here we use patch functions and/or macros
    END
    BUT_ONLY_IF_IT_CHANGES
    then you can modify the Carsomyr. Check WeiDU documentation for more info, but basically that's what you need to do:

    change the MR from 50% to 20%

        LPF ALTER_EFFECT
    INT_VAR
    match_opcode = 166
    parameter1 = 20
    END

    remove the additional damage to chaotic evil

       SET opcode_to_delete = 177
    LPM DELETE_ITEM_EQEFFECT

    remove the "dispel magic 3x per day,"

       LPF DELETE_ITEM_HEADER
    INT_VAR header_type = 3
    END

    make it usable only by wizard slayers

        WRITE_LONG 0x1e THIS BOR BIT20 // remove usability for Paladins
    WRITE_LONG 0x1e THIS BAND BNOT BIT11 // add usability for Fighters
    WRITE_LONG 0x29 THIS BOR BIT6 // remove usability for Barbarians
    WRITE_LONG 0x2f THIS BOR BIT0 // remove usability for Berserkers
    WRITE_LONG 0x2f THIS BOR BIT2 // remove usability for Kensai
    PATCH_IF GAME_IS ~bg2ee~ THEN BEGIN // remove usability for True Class Fighters (EEs only)
    LPF ~ADD_ITEM_EQEFFECT~
    INT_VAR
    opcode = 319 // Item Usability
    target = 1 // Self
    parameter1 = 0x4000 // True Class
    parameter2 = 9 // KIT.IDS
    timing = 2 // Instant/While Equipped
    END
    END

    rename the sword and change the description

        SAY NAME2 ~write here the new name~
    SAY IDENTIFIED_DESC ~write here the new description~

    Or is it easier to create a new +5 two-handed sword that dispels on hit and provides 20% magic, and then replace Carsomyr in Firkraag's drop?

    Alternatively, you can create a new item by modifying the original Carsomyr with NI. Let's say it's called MYCARS.ITM, then you can replace in Firkraag inventory with
    BACKUP ~Your_mod_name/backup~
    AUTHOR ~Lathspellguest, at http://forum.baldursgate.com~
    VERSION ~v1~

    BEGIN ~Your mod~

    COPY ~Your_mod_name\items\MYCARS.ITM~ ~override~
    PATCH_IF SOURCE_SIZE > 0x71 BEGIN
    SAY NAME2 ~write here the new name~
    SAY IDENTIFIED_DESC ~write here the new description~
    END
    BUT_ONLY_IF_IT_CHANGES

    COPY_EXISTING ~FIRKRA02.CRE~ ~override~
    PATCH_IF SOURCE_SIZE > 0x2c8 BEGIN
    REPLACE_CRE_ITEM MYCARS #0 #0 #0 ~NONE~ ~QITEM2~
    END
    BUT_ONLY_IF_IT_CHANGES
  • The user and all related content has been deleted.
  • LathspellguestLathspellguest Member Posts: 60
    @subtledoctor Awesome! That's exactly what I was looking for. Thanks so much.
  • lansounetlansounet Member Posts: 1,182
    In any case, for local modding no weidu is required, you could just as well do everything in NI, modify the effects, add new lines to dialog.tlk and reference them in the .itm file.

    Some say NI dialog.tlk editing is unstable but I've never had any issue with it
  • rapsam2003rapsam2003 Member Posts: 1,636
    lansounet said:

    Some say NI dialog.tlk editing is unstable but I've never had any issue with it

    It's actually quite unstable, depending on what you do. WeiDU is the only safe way to edit the dialog.tlk.
  • The user and all related content has been deleted.
Sign In or Register to comment.