Author Topic: Creating a race with the "Immune to Fear" Special ability  (Read 925 times)

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1953
Creating a race with the "Immune to Fear" Special ability
« on: May 31, 2016, 04:34:57 AM »
I'm trying to do some hacking of Race special abilities. Ultimately, I want the Gnome and Dwarf races to have the default Dwarf special abilities (they will be Mountain Dwarves and Hill Dwarves), and the Halfling race to have the Immune to Fear ability (they will be Kender).

First, I want the Gnome and Dwarf Races to both use the default Dwarf special abilities. I thought I could achieve that by making both "Race Pointer #2" and "Race Pointer #3" point to Dwarf. I changed "Race Pointer #3" (byte 251066) to be 190 27 (the same as the default for "Race Pointer #2" (byte 251064)).

Then I want to set the Halfling race to look to the Gnome special abilities. So I changed "Race Pointer #4" (byte 241068) to 242 27 (which is the default for "Race Pointer #3").

Finally, I set "Gnome Special 1" (byte 251132) to 92 (which is the special ability number for the "Immune to fear" special ability) (replacing no 48, "Gnome AC").

Evidently I did something wrong, because when I create a Halfling, begin the game and select ENCAMP>MAGIC>DISPLAY, he is not shown as being immune to fear. (As Immune to Fear is one of the special abilities that does have a text string associated with it, I assume it should appear there.)

Can any of you super hackers out there help me identify what I've done wrong, please? I suspect the problem is that I have not properly understood how the "Race Pointers" work.

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Creating a race with the "Immune to Fear" Special ability
« Reply #1 on: May 31, 2016, 09:13:50 PM »
I read everything you said above, and it all seems to make perfect sense to me.

It is possible that the monster ability 92 - "Immune to Fear" doesn't show up in the encamp menu. Try giving your Kender ability 8 - "Protected from Evil" instead of ability 92, because we're certain that one shows up in the encamp menu.

8 -- Protected from Evil.  Standard monster ability, default class ability
for Paladin, and effect of spell "Protection from Evil"; also works as
ability for PC, NPC, or item.

If that ability doesn't show up either, then I can help you track down why the pointers aren't pointing where you think they are.
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1953
Re: Creating a race with the "Immune to Fear" Special ability
« Reply #2 on: June 01, 2016, 12:12:50 AM »
Thanks Nol (yes, you were certainly one of the "super hackers" I had in mind).

I tried what you suggested. "Protected from Evil" also did not show up in the encamp menu. (Incidentally, neither dwarves nor gnomes show as "Protected from Evil" either.)

I don't really understand the "Race Pointers". According to CKITFORM.TXT, they are a two-byte input. I don't understand what the two bytes actually represent. I just thought that by making the value for #3 the same as #2, and setting #4 to the value that normally applies to #3, that logically should work.

Edited to add: I note that the DLUA package places kender in the "Gnome" Slot and they successfully display as having both "Immune to Fear" and "Protected from Evil" when viewed in the Encamp menu. DLUA used the Halfling slot for the Irda race, but I want to maintain the two dwarf races (both with standard dwarf special abilities) if possible.
« Last Edit: June 01, 2016, 12:17:00 AM by steve_mcdee »

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Creating a race with the "Immune to Fear" Special ability
« Reply #3 on: June 01, 2016, 09:43:34 PM »
Code: [Select]
VARIABLE             OFFSET (HEX)     VALUE (HEX)
Elf Race Ptr      #0 251060 (0x3D4B4) 7231 (0x3F1C)
1/2-Elf Race Ptr  #1 251062 (0x3D4B6) 7258 (0x5A1C)
Dwarf Race Ptr    #2 251064 (0x3D4B8) 7102 (0xBE1B)
Gnome Race Ptr    #3 251066 (0x3D4BA) 7154 (0xF21B)
Halfling Race Ptr #4 251068 (0x3D4BC) 7204 (0x241C)

Dwarf SpecAb 1       251080 (0x3D4C8) 47 (2F)
Dwarf SpecAb 2       251105 (0x3D4E1) 26 (1A)
Jump Ptr             251121 (0x3D4F1) 50 (32)

Gnome SpecAb 1       251132 (0x3D4FC) 48 (30)
Gnome SpecAb 2       251157 (0x3D515) 07 (07)
Short Guy SA         251182 (0x3D52E) 97 (61)
Jump Ptr             251198 (0x3D53E) 52 (34)

Elf SpecAb           251209 (0x3D549) 95 (5F)
Jump Ptr             251225 (0x3D559) 25 (19)

1/2-Elf SpecAb       251236 (0x3D564) 18 (12)

The race pointers #0-4 are offsets from a fixed location, in this case 243978.
If you add the offsets to the fixed location, you get the location of each SpecAb.

243978 + 7231 = 251209
243978 + 7258 = 251236
243978 + 7102 = 251080
243978 + 7154 = 251132
243978 + 7204 = 251182
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1953
Re: Creating a race with the "Immune to Fear" Special ability
« Reply #4 on: June 01, 2016, 10:34:33 PM »
I see that Halfling Race Pointer #4 points to the "Short Guy SA". Does that suggest that, in fact, Halflings cannot be given their own special ability that does not also apply to both Gnomes and Dwarves (ie, whatever SA referred to at 251182 will apply to all of Gnomes, Dwarves and Halflings)?

Can you see any way to retain the default Dwarf SAs for Dwarves and Gnomes while also giving Immune to Fear to Halflings?

Are there other pointers that connect up the races with the "Race Pointer #X" bytes (ie, pointers that point to bytes 251060-251068), which might be changed so that both the Gnome and Dwarf races point to 241064 and the Halfling race points to 241066?

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Creating a race with the "Immune to Fear" Special ability
« Reply #5 on: June 02, 2016, 10:03:56 PM »
I see that Halfling Race Pointer #4 points to the "Short Guy SA". Does that suggest that, in fact, Halflings cannot be given their own special ability that does not also apply to both Gnomes and Dwarves (ie, whatever SA referred to at 251182 will apply to all of Gnomes, Dwarves and Halflings)?

Can you see any way to retain the default Dwarf SAs for Dwarves and Gnomes while also giving Immune to Fear to Halflings?

Are there other pointers that connect up the races with the "Race Pointer #X" bytes (ie, pointers that point to bytes 251060-251068), which might be changed so that both the Gnome and Dwarf races point to 241064 and the Halfling race points to 241066?

Races #2-4 will all have the Special Ability at offset 251182. By default, this is the Short Guy SpecAb.

Adding the following two lines to your diff.tbl will give the Paladin SpecAb 08 - Protected from Evil to both Dwarves and Gnomes.

Code: [Select]
3d4b8 be f2
3d4fc 30 8

3d4b8 be f2 changes the Dwarf Race #2 to point to the same set of SpecAbs as the Gnome Race #3.

3d4fc 30 8 changes Gnome SpecAb #1 from 48 - Gnome THAC0 to 08 - Protected from Evil.

So, it is possible to change Dwarves and Gnomes to share one set of SpecAbs - either the 2 Dwarf ones or the 2 Gnome ones. Whichever set you don't use, you can then change Halflings to use the other one. All three races (Dwarf, Gnome, and Halfling) will have the Special Ability at offset 251182. You could make that one effect 0 - No Effect.
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Creating a race with the "Immune to Fear" Special ability
« Reply #6 on: June 02, 2016, 10:50:02 PM »
I think I now have the complete solution to your problem. Copy these lines into your diff.tbl:

Code: [Select]
3d4ba f2 be
3d4bc 24 f2
3d4bd 1c 1b
3d4c8 2f 1
3d4e1 1a 8
3d4fc 30 5c
3d515 7 c

Here is an explanation of what each line does:

1: 3d4ba f2 be // Make Gnomes point to Dwarf SpecAbs
2: 3d4bc 24 f2 // Make Halflings point to Gnome SpecAbs
3: 3d4bd 1c 1b // Make Halflings point to Gnome SpecAbs
4: 3d4c8 2f 1  // Give Dwarves & Gnomes Bless
5: 3d4e1 1a 8  // Give Dwarves & Gnomes Prot from Evil
6: 3d4fc 30 5c // Give Halflings Immune to Fear
7: 3d515 7 c   // Give Halflings Enlarged

1: It only took one byte to change the Gnome Ptr since the second byte was already the same. (be1b versus f21b)
2-3: It took two bytes to change the Halfling Ptr since neither byte was the same (f21b versus 241c)
4-5: You can delete these two lines since I assume you want Dwarves to have the default SpecAbs. I was just testing that you can give them Bless and Prot vs Evil and it will show up for both races Dwarves and Gnomes.
6-7: The last two lines can grant any two SpecAbs to Halflings. I chose Immune to Fear and Enlarged for testing purposes.

All three races are still Short Guys, which decreases the effectiveness of area of effect spells.

For what it's worth, Immune to Fear seems to be effective against Dragon Fear and the Fear spell, but not against Mummy Fear Aura. More testing of this theory is warranted...

The screen shot below uses my FRUA testing design, which has a custom font that shows Upper and Lower Case Letters because I sometimes care about such details.
"Into the Drachensgrab Mountains!"

http://www.noldrek.com

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1953
Re: Creating a race with the "Immune to Fear" Special ability
« Reply #7 on: June 03, 2016, 01:23:54 AM »
Nol, you champion. Thanks. I will study the bytes to better understand how it works. (Making halflings "enlarged" seems ironic.)

I can't really see any way to simulate the "taunt" ability, but perhaps I will pick a spell effect that gives kender some bonus to reflect the fact that opponents who are attacking them may have been distracted.
« Last Edit: June 03, 2016, 05:40:58 AM by steve_mcdee »

Offline steve_mcdee

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 1953
Re: Creating a race with the "Immune to Fear" Special ability
« Reply #8 on: June 03, 2016, 03:27:07 PM »
Working perfectly, by the way. Thanks.

Offline Nol Drek

  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2183
    • Nol Drek's Web Site
Re: Creating a race with the "Immune to Fear" Special ability
« Reply #9 on: June 07, 2016, 07:34:41 PM »
All three races are still Short Guys, which decreases the effectiveness of area of effect spells.

I guess I forgot what Short Guy Magic Resistance does... but the Player's Handbook says it should be as follows:

A Dwarf/Gnome/Halfling PC gains a bonus of +1 for every 3.5 points of constitution ability score.
A constitution of 4 gains a +1, 7 gains a +2, 11 gains a +3, 14 gains a +4, and 18 gains a +5 bonus
to saving throws versus magic wands, staves, rods, and spells.
"Into the Drachensgrab Mountains!"

http://www.noldrek.com