Last active
November 13, 2018 09:04
-
-
Save mike1072/af23146504a87468fa69b2478d8214c1 to your computer and use it in GitHub Desktop.
SR ADD_SPELL Renamification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ACTION_DEFINE_ASSOCIATIVE_ARRAY resource_placeholders BEGIN | |
sppr114 => miasd114 // Faerie Fire | |
sppr115 => miasd115 // Strength of Stone | |
sppr116 => miasd116 // Sunscorch | |
sppr117 => miasd117 // Regenerate Light Wounds | |
sppr118 => miasd118 // Goodberry | |
sppr119 => miasd119 // Cause Light Wounds | |
sppr120 => miasd120 // Animal Summoning I | |
sppr121 => miasd121 // Obscuring Mist | |
sppr215 => miasd215 // Cure Moderate Wounds | |
sppr216 => miasd216 // Fire Trap | |
sppr217 => miasd217 // Regenerate Moderate Wounds | |
sppr218 => miasd218 // Gust of Wind (Druid) | |
sppr219 => miasd219 // Cause Moderate Wounds | |
sppr220 => miasd220 // Animal Summoning II | |
sppr320 => miasd320 // Animal Summoning III | |
sppr321 => miasd321 // Cause Serious Wounds | |
sppr322 => miasd322 // Storm Shield | |
sppr323 => miasd323 // Regenerate Serious Wounds | |
sppr324 => miasd324 // Magic Fang | |
sppr325 => miasd325 // Spike Growth | |
sppr326 => miasd326 // Icelance | |
sppr418 => miasd418 // Ice Storm | |
sppr419 => miasd419 // Regenerate Critical Wounds | |
sppr519 => miasd519 // Polymorph Other | |
sppr520 => miasd520 // Protection from Acid | |
sppr521 => miasd521 // Protection from Cold | |
sppr522 => miasd522 // Protection from Lightning | |
sppr523 => miasd523 // Protection from Fire | |
sppr524 => miasd524 // Mass Regenerate | |
sppr525 => miasd525 // Animal Growth | |
sppr619 => miasd619 // Regeneration | |
sppr620 => miasd620 // Banishment | |
sppr621 => miasd621 // Conjure Air Elemental | |
sppr622 => miasd622 // Conjure Earth Elemental | |
sppr623 => miasd623 // Animate Skeleton Warrior | |
sppr716 => miasd716 // Animal Summoning VII | |
spwi109 => miasa109 // Dimension Jump | |
spwi126 => miasa126 // Detect Alignment | |
spwi225 => miasa225 // Resist Elements | |
spwi226 => miasa226 // Monster Summoning II | |
spwi327 => miasa327 // Icelance | |
spwi426 => miasa426 // Protection from Elemental Energy | |
spwi427 => miasa427 // Vitriolic Sphere | |
END | |
ACTION_INCLUDE ~sr_add_spell_renamification/replace_spell_resources.tpa~ | |
ACTION_FOR_EACH folder IN | |
~spell_rev\shared~ | |
~spell_rev\shared\wings~ | |
~spell_rev\sppr1##~ | |
~spell_rev\sppr2##~ | |
~spell_rev\sppr3##~ | |
~spell_rev\sppr3##\mfang~ | |
~spell_rev\sppr4##~ | |
~spell_rev\sppr5##~ | |
~spell_rev\sppr6##~ | |
~spell_rev\sppr7##~ | |
~spell_rev\spwi1##~ | |
~spell_rev\spwi2##~ | |
~spell_rev\spwi3##~ | |
~spell_rev\spwi4##~ | |
~spell_rev\spwi4##\enchwp~ | |
~spell_rev\spwi5##~ | |
~spell_rev\spwi5##\Old SI~ | |
~spell_rev\spwi6##~ | |
~spell_rev\spwi7##~ | |
~spell_rev\spwi8##~ | |
~spell_rev\spwi9##~ | |
~item_rev\itm~ | |
BEGIN | |
ACTION_BASH_FOR ~%folder%~ ~^.+\.spl$~ BEGIN | |
COPY ~%BASH_FOR_FILESPEC%~ ~%BASH_FOR_DIRECTORY%~ | |
LPF ~REPLACE_RES_IN_SPL~ END | |
BUT_ONLY | |
END | |
ACTION_BASH_FOR ~%folder%~ ~^.+\.itm$~ BEGIN | |
COPY ~%BASH_FOR_FILESPEC%~ ~%BASH_FOR_DIRECTORY%~ | |
LPF ~REPLACE_RES_IN_ITM~ END | |
BUT_ONLY | |
END | |
ACTION_BASH_FOR ~%folder%~ ~^.+\.eff$~ BEGIN | |
COPY ~%BASH_FOR_FILESPEC%~ ~%BASH_FOR_DIRECTORY%~ | |
LPF ~REPLACE_RES_IN_EFF~ END | |
BUT_ONLY | |
END | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ACTION_FOR_EACH opcode IN | |
146 147 148 171 172 206 207 232 251 252 266 318 321 324 326 340 341 361 | |
BEGIN | |
OUTER_SET $spell_opcodes(~%opcode%~) = 0 | |
END | |
DEFINE_PATCH_FUNCTION ~REPLACE_RES~ | |
INT_VAR | |
opcode_offset = 0 | |
resource_offset = 0 | |
BEGIN | |
READ_LONG opcode_offset opcode | |
PATCH_IF (VARIABLE_IS_SET $spell_opcodes(~%opcode%~)) BEGIN | |
READ_ASCII resource_offset resource | |
TO_LOWER resource | |
PATCH_IF (VARIABLE_IS_SET $resource_placeholders(~%resource%~)) BEGIN | |
TEXT_SPRINT placeholder $resource_placeholders(~%resource%~) | |
WRITE_ASCIIE resource_offset ~%placeholder%~ #8 | |
PATCH_PRINT ~# Replaced %resource% with %placeholder% in %SOURCE_RES%~ | |
END | |
END | |
END | |
DEFINE_PATCH_FUNCTION ~REPLACE_RES_IN_EFF~ BEGIN | |
LPF ~REPLACE_RES~ INT_VAR opcode_offset = 0x10 resource_offset = 0x30 END | |
END | |
DEFINE_PATCH_FUNCTION ~REPLACE_RES_IN_ITM_OR_SPL~ | |
INT_VAR is_spell = 0 | |
BEGIN | |
PATCH_IF (is_spell) BEGIN | |
GET_OFFSET_ARRAY abilities SPL_V10_HEADERS | |
END ELSE BEGIN | |
GET_OFFSET_ARRAY abilities ITM_V10_HEADERS | |
END | |
PHP_EACH abilities AS ability => ability_off BEGIN | |
GET_OFFSET_ARRAY2 features ability_off ITM_V10_HEAD_EFFECTS | |
PHP_EACH features AS feature => feature_off BEGIN | |
LPF ~REPLACE_RES~ INT_VAR opcode_offset = feature_off resource_offset = feature_off + 0x14 END | |
END | |
END | |
GET_OFFSET_ARRAY effects ITM_V10_GEN_EFFECTS | |
PHP_EACH effects AS effect => effect_off BEGIN | |
LPF ~REPLACE_RES~ INT_VAR opcode_offset = effect_off resource_offset = effect_off + 0x14 END | |
END | |
END | |
DEFINE_PATCH_FUNCTION ~REPLACE_RES_IN_ITM~ BEGIN | |
LPF ~REPLACE_RES_IN_ITM_OR_SPL~ INT_VAR is_spell = 0 END | |
END | |
DEFINE_PATCH_FUNCTION ~REPLACE_RES_IN_SPL~ BEGIN | |
LPF ~REPLACE_RES_IN_ITM_OR_SPL~ INT_VAR is_spell = 1 END | |
END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BACKUP ~sr_add_spell_renamification/backup~ | |
AUTHOR ~Mike1072~ | |
BEGIN ~SR ADD_SPELL Renamification~ | |
INCLUDE ~sr_add_spell_renamification/convert_hardcoded_spell_resources.tpa~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment