Jump to content

Modding the ranger's racial enemy ability


Recommended Posts

Hi guys, I'm new to the modding scene for BGEE/BG2EE. I want to make a couple of changes to the ranger's racial enemy ability:

  • Grants -4 to THAC0 instead of -4 to THAC0 and +4 damage
  • Racial enemy selection can be changed on level-up

I've got the latest version of Near Infinity installed and have been looking through IESDP, but haven't located the relevant file(s). Any tips?

Link to comment

Aw, I kinda got that impression from digging through older topics but wanted to confirm. It might be possible to add a -4 damage penalty vs. the selected racial enemy type but that's pretty ugly.

Does the hardcoded part also mean I can't add the "select racial enemy" screen on level-up even if I don't touch the ability itself?

Link to comment
On 7/17/2023 at 11:35 AM, testlum said:

Aw, I kinda got that impression from digging through older topics but wanted to confirm. It might be possible to add a -4 damage penalty vs. the selected racial enemy type but that's pretty ugly.

Does the hardcoded part also mean I can't add the "select racial enemy" screen on level-up even if I don't touch the ability itself?

I think in stats.ids there is "HATEDRACE" entry which could be racial enemy. If that's correct, maybe it is possible to detect it in scripts with "CheckStat" trigger or with op318. And if this is also correct you could maybe do what you want in scripts. I'm thinking about something like that:

  • For effect change: for every player check if class is ranger and if you haven't adjusted it yet, then apply some spell that will add effects you want. I'm not sure which exactly opcode it would be, but you could maybe grant -4 damage vs race to negate hardcoded +4? To apply different spell depending on race you can use one of those techniques: 
    • In every spell use op318 to protect agains itself if HATEDRACE stat is not the one that this spell is intended for. The you can just apply them all and one that is correct would work, the rest will be blocked.
    • Create long list of blocks for every race "if CheckStat(HATEDRACE, %race%) then apply spell for this race". You can hide this long list of blocks in cutscene and execute it without starting cutscene mode.
       
  • For change on level up: I think you will need to do that by innate ability that would do it via dialogue and only if ChangeStat script action works correctly with it.The you could track character level in variable and give this innate ability on level up, if there is no simpler way to detect level up.

Anyway, this is quite complex for someone new to modding, unless you have some other coding experience. But I just wanted to mention that maybe there is some possibility to do that.

Link to comment

See also opcode 326, for "cast spell if target meets condition". You could grant on-hit effects (opcodes 248 and 249) in which the EFF is itself an opcode 326 (target "self") with a HATEDRACE=(race) filter and then the spell cast (target "preset target") is whatever you want to do to that favored-race enemy you're hitting.

These approaches involve lots and lots of subspells and EFFs; every possible racial enemy gets its own collection of helper SPLs/EFFs.

Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...