Skip to content

By changing the a creatures kit do they automatically get the kit abilities up to their level?

GreenerGreener Member Posts: 430
edited May 2017 in General Modding
Hypothetically if I'd like to change the class/kit of Tamoko from Cleric to a Fighter/Kensai how would I go about this via weidu?

By changing a creatures kit do they automatically get the kit abilities up to their level or do I need to manually add them?

BEGIN ~Tamoko Class/Kit Change (Kensai)~

COPY_EXISTING_REGEXP GLOB ~tamoko.*.CRE~ ~override~
PATCH_IF SOURCE_SIZE > 0x2d3 BEGIN
WRITE_SHORT 0x244 0 // Needed to change the the kit
WRITE_BYTE 0x246 3 // Change kit to kensai
WRITE_BYTE 0x247 0x40 // Needed to change the kit
WRITE_BYTE 0x273 2 // Change class to fighter
WRITE_SHORT 0x28 25872 // Change animation to female monk
SET_BG2_PROFICIENCY ~PROFICIENCYKATANA~ 5 // Give katana proficiency
REMOVE_KNOWN_SPELLS // Remove known spells
REMOVE_MEMORIZED_SPELLS // Remove Memorized spells
READ_LONG 0x2a8 off1 // Read Memorization Info Offset
READ_LONG 0x2ac num1 // Read Number of Memorization Info
WRITE_LONG (%off1%+(%num1%-1)*0x10+0x2) 0 // Set to 0 Number of (Currently) Memorizable Spells
WRITE_SHORT 0x0024 88 // Current Hit Points
WRITE_SHORT 0x0026 88 // Maximum Hit Points
WRITE_BYTE 0x0054 8 // Saving throw versus death
WRITE_BYTE 0x0055 10 // Saving throw versus wands
WRITE_BYTE 0x0056 9 // Saving throw versus polymorph
WRITE_BYTE 0x0057 9 // Saving throw versus breath attacks
WRITE_BYTE 0x0058 11 // Saving throw versus spells
WRITE_BYTE 0x0073 0 // Remove spiked Proficiency
WRITE_BYTE 0x0235 0 // Highest attained level in class 2
WRITE_BYTE 0x0236 0 // Highest attained level in class 3
REPLACE_CRE_ITEM ~sw1h44~ #0 #0 #0 ~NONE~ ~WEAPON1~ EQUIP // Replacing primary weapon
REMOVE_CRE_ITEM ~plat05~ ~shld06~ // Remove items
ADD_CRE_ITEM ~potn52~ #3 #0 #0 ~IDENTIFIED~ ~QITEM1~ // Add potion of extra healing to quick item slot 1
ADD_CRE_ITEM ~potn11~ #1 #0 #0 ~IDENTIFIED~ ~QITEM2~ // Add potion of extra healing to quick item slot 2
ADD_CRE_ITEM ~potn14~ #1 #0 #0 ~IDENTIFIED~ ~QITEM3~ // Add potion of extra healing to quick item slot 3
END
BUT_ONLY_IF_IT_CHANGES

BEGIN ~Tamoko Portrait Change~

COPY ~Tamoko/Portraits/TamokoL.BMP~ ~override~
ACTION_DEFINE_ASSOCIATIVE_ARRAY "cre_portrait" BEGIN
"Tamoko" => "TamokoL"
"Tamoko2" => "TamokoL"
END

ACTION_PHP_EACH "cre_portrait" AS "cre" => "portrait" BEGIN
COPY_EXISTING ~%cre%.cre~ ~override~
WRITE_EVALUATED_ASCII ~0x34~ ~%portrait%~ #8 // Change small portrait
END

Thank you in advance...
Post edited by Greener on

Comments

  • The user and all related content has been deleted.
  • GreenerGreener Member Posts: 430

    When an NPC joins the party, they get all of f their kit effects/abilities. And when an AddKit script is processed, same thing.

    If the character doesn't join the party, then just setting the kit in Weidu won't give the abilities/bonuses.

    (I think. Been away from modding for a few months...)

    Thank you!
  • The user and all related content has been deleted.
  • GreenerGreener Member Posts: 430

    Note, this means two things:

    1) For non-joinable characters, to have kit bonuses, you must manually add the bonuses to the .cre file.

    2) For joinable characters, you must NOT manually add the kit bonuses... if you do, they will be doubled upon joining the party.

    I understand thank you!

    I used the following:
    LPF ADD_CRE_EFFECT INT_VAR opcode=171 target=1 timing=9 power=1 STR_VAR resource=~spcl141~ END
    LPF ADD_CRE_EFFECT INT_VAR opcode=171 target=1 timing=9 power=1 STR_VAR resource=~spcl141~ END
    LPF ADD_CRE_EFFECT INT_VAR opcode=171 target=1 timing=9 power=1 STR_VAR resource=~spcl141~ END
    LPF ADD_CRE_EFFECT INT_VAR opcode=171 target=1 timing=9 power=1 STR_VAR resource=~spcl142~ END
    LPF ADD_CRE_EFFECT INT_VAR opcode=171 target=1 timing=9 power=1 STR_VAR resource=~spcl143~ END
  • The user and all related content has been deleted.
  • GreenerGreener Member Posts: 430

    Final note, I was mostly talking about kit bonuses, not abilities. Like turning one of the assassins in Beregost or Nashkel into an actual Assassin and giving him a +1 thac0 bonus. You would do that in Weidu. But if you also give him the Poison Weapon ability in Weidu, nothing will happen in-game... because his script will not cause him to use it. So for non-joinable NPCs gaining kit abilities, their scripts really need to be altered as well.

    Which is beyond my abilities, so this is the point where I duck out of the conversation...

    Thank you, it seems to be working, though I'm sure the code could be cleaner?

    BACKUP ~Tamoko/Backup~
    AUTHOR ~Greener~
    VERSION ~1.0~

    BEGIN ~Tamoko Class/Kit Change (Kensai)~


    COPY ~Tamoko/Bams/CSW1H44.bam~ ~override~
    COPY ~Tamoko/Bams/IBDS1H01.bam~ ~override~
    COPY ~Tamoko/BCS/BDFIGH01.bcs~ ~override~
    COPY ~Tamoko/Spell/BDCRIMSN.spl~ ~override~
    COPY ~Tamoko/Item/BDSW1H01.itm~ ~override~ // Crimson Dawn +2

    SAY NAME1 ~Katana~
    SAY NAME2 ~Crimson Dawn +2~
    SAY UNIDENTIFIED_DESC ~The katana is a single-edged, slightly curved sword that ends with a chisel point. The katana is perhaps one of the finest swords ever made, the steps to its creation a long and secret process that is more art form than anything else. This blade is an important facet of Kara-Turan culture. To touch or wield a samurai's katana is to insult the samurai and to incite his wrath. For a gaijin, or foreigner, to own such a blade is a rare occurrence. Either the gaijin is a greatly honored friend of an important minister, or the gaijin has murdered a samurai.

    STATISTICS:

    Damage: 1d10 (slashing)
    Speed Factor: 4
    Proficiency Type: Katana
    Type: One-handed
    Requires:
    6 Strength

    Weight: 6~

    SAY DESC ~Legend tells that this elegant blade appeared at the moment the sun rose over the eastern horizon. As the dawn's rosy light flooded the forest, the blade shimmered into being atop a flat stone. Local foresters, even warriors, were afraid to touch the weapon lest it was cursed. Finally, a brave old man who had been a fighter in his youth grasped the hilt and claimed the blade as its own. Terrifying beasts sprang at him a moment later, creatures of red mist and fangs and claws. The old man clung to his courage and lay about him with the sword. He grew faster with every monster he killed until finally the clearing was empty. The old man was feasted in the village for days and then set off to live his final years seeking adventure on the road.

    STATISTICS:

    Equipped abilities:
    - Critical Hit Chance: +5% (with this weapon only)

    Combat abilities:
    - 15% chance per kill of hasting the wielder for 3 rounds

    THAC0: +2
    Damage: 1d10+2 (slashing)
    Speed Factor: 2
    Proficiency Type: Katana
    Type: One-handed
    Requires:
    6 Strength

    Weight: 4~

    COPY_EXISTING_REGEXP GLOB ~tamoko.*.CRE~ ~override~
    PATCH_IF SOURCE_SIZE > 0x2d3 BEGIN
    REPLACE_CRE_ITEM ~bdsw1h01~ #0 #0 #0 ~NONE~ ~WEAPON1~ EQUIP // Replacing primary weapon
    REMOVE_CRE_ITEM ~plat05~ ~shld06~ // Remove items
    ADD_CRE_ITEM ~potn52~ #3 #0 #0 ~IDENTIFIED~ ~QITEM1~ // Add potion of extra healing to quick item slot 1
    ADD_CRE_ITEM ~potn11~ #1 #0 #0 ~IDENTIFIED~ ~QITEM2~ // Add potion of extra healing to quick item slot 2
    ADD_CRE_ITEM ~potn14~ #1 #0 #0 ~IDENTIFIED~ ~QITEM3~ // Add potion of extra healing to quick item slot 3
    WRITE_SHORT 0x244 0 // Needed to change the the kit
    WRITE_BYTE 0x246 3 // Change kit to kensai
    WRITE_BYTE 0x247 0x40 // Needed to change the kit
    WRITE_BYTE 0x273 2 // Change class to fighter
    WRITE_SHORT 0x28 25872 // Change animation to female monk
    SET_BG2_PROFICIENCY ~PROFICIENCYKATANA~ 5 // Give katana proficiency
    SET_BG2_PROFICIENCY ~PROFICIENCY2WEAPON~ 3 // Give two weapon style
    SET_BG2_PROFICIENCY ~PROFICIENCYSINGLEWEAPON~ 2 // Give single weapon style
    REMOVE_KNOWN_SPELLS // Remove known spells
    REMOVE_MEMORIZED_SPELLS // Remove Memorized spells
    READ_LONG 0x2a8 off1 // Read Memorization Info Offset
    READ_LONG 0x2ac num1 // Read Number of Memorization Info
    WRITE_LONG (%off1%+(%num1%-1)*0x10+0x2) 0 // Set to 0 Number of (Currently) Memorizable Spells
    ADD_KNOWN_SPELL ~spcl144~ #0 ~innate~ // Give kai innate
    ADD_MEMORIZED_SPELL ~spcl144~ #0 ~innate~ ( 5 ) // Memorize kai innate x5
    LPF ADD_CRE_EFFECT INT_VAR opcode=171 target=1 timing=9 power=1 STR_VAR resource=~spcl141~ END
    LPF ADD_CRE_EFFECT INT_VAR opcode=171 target=1 timing=9 power=1 STR_VAR resource=~spcl141~ END
    LPF ADD_CRE_EFFECT INT_VAR opcode=171 target=1 timing=9 power=1 STR_VAR resource=~spcl141~ END
    LPF ADD_CRE_EFFECT INT_VAR opcode=171 target=1 timing=9 power=1 STR_VAR resource=~spcl142~ END
    LPF ADD_CRE_EFFECT INT_VAR opcode=171 target=1 timing=9 power=1 STR_VAR resource=~spcl143~ END
    WRITE_SHORT 0x0024 88 // Current Hit Points
    WRITE_SHORT 0x0026 88 // Maximum Hit Points
    WRITE_BYTE 0x0052 11 // THAC0
    WRITE_BYTE 0x0054 8 // Saving throw vs death
    WRITE_BYTE 0x0055 10 // Saving throw vs wands
    WRITE_BYTE 0x0056 9 // Saving throw vs polymorph
    WRITE_BYTE 0x0057 9 // Saving throw vs breath attacks
    WRITE_BYTE 0x0058 11 // Saving throw vs spells
    WRITE_BYTE 0x0073 0 // Remove spiked Proficiency
    WRITE_BYTE 0x0235 0 // Highest attained level in class 2
    WRITE_BYTE 0x0236 0 // Highest attained level in class 3
    WRITE_ASCII 0x0248 ~bdfigh01~ #8 // Creature script - Override
    END
    BUT_ONLY_IF_IT_CHANGES

    BEGIN ~Tamoko Portrait Change~

    COPY ~Tamoko/Portraits/TamokoL.BMP~ ~override~
    ACTION_DEFINE_ASSOCIATIVE_ARRAY "cre_portrait" BEGIN
    "Tamoko" => "TamokoL"
    "Tamoko2" => "TamokoL"
    END

    ACTION_PHP_EACH "cre_portrait" AS "cre" => "portrait" BEGIN
    COPY_EXISTING ~%cre%.cre~ ~override~
    WRITE_EVALUATED_ASCII ~0x34~ ~%portrait%~ #8 // Change small portrait
    END
Sign In or Register to comment.