Author Topic: Magic Weapons Immunity  (Read 1332 times)

Offline Ben J

  • Keeper of the 44 quest variables
  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2723
  • "See how I reward those who fail me!"
Magic Weapons Immunity
« on: November 14, 2010, 02:49:07 PM »
FRUA has two special abilities concerning immunity to magic weapons: "Immune to weapons < +2" and "immune to weapons < +3".

Would it be possible to hack these specAbs to increase the level of immunity to +4 or +5?
Released designs:

The Sect

Offline nologgie

  • Non-resident Non-expert
  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 3465
Re: Magic Weapons Immunity
« Reply #1 on: November 14, 2010, 03:57:57 PM »
Ummm...

I suspect it would be possible if someone knows where the code is, or can find it.

The Half Damage for <+3 and <+4 is listed in ckitform.txt, as is the divisor. I haven't tried yet, but it could probably be tweaked so weapons <+5 only do one point per hit. It wouldn't be an immunity, but it would be a very high resistance.
Some days it just doesn't pay to gnaw through the straps.

Offline Simeon Pilgrim

  • Full Member
  • ***
  • Posts: 167
    • simeonpilgrim.com
Re: Magic Weapons Immunity
« Reply #2 on: November 14, 2010, 04:57:09 PM »
Not having read the chikform.txt, does it say if it rounds up or truncates the value after division? Because if's it the latter, you would get zero with a big enough divisor, and failing that, if we know the address of the divisor, we then know where the code is, and could rewrite the whole function (if your into that...)

Offline nologgie

  • Non-resident Non-expert
  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 3465
Re: Magic Weapons Immunity
« Reply #3 on: November 14, 2010, 05:40:31 PM »
It doesn't say. I figured I'd poke it with a hex editor and see what it did. (That's about my level.)

I might give rewriting it a shot. Since I have an Op Code listing and the section seems short my chance of success should be considerably better than that of a room full of typing chimps coming up with a script for Hamlet. Probably at least twice as likely!  ;D
Some days it just doesn't pay to gnaw through the straps.

Offline nologgie

  • Non-resident Non-expert
  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 3465
Re: Magic Weapons Immunity
« Reply #4 on: November 15, 2010, 03:02:00 AM »
In this case poking with a hex editor did the trick. The two lines below will change Half Damage <+4 to Zero Damage <+5.

- I didn't check to see if a mage struck for zero damage would lose a spell being cast.
- I used a divide by 100 (0x64), so if you have weapons that do more than 100 points per hit, you may want to increase the number.

Code: [Select]
50d17 4 5
50d29 2 64

Edit:

If you want to alter it a bit (say, to allow damage only by a +6 or better weapon and divide lesser weapon damage by 255), use this code:

Code: [Select]
50d17 4 6
50d29 2 ff
« Last Edit: November 15, 2010, 04:13:25 AM by nologgie »
Some days it just doesn't pay to gnaw through the straps.

Offline Ben J

  • Keeper of the 44 quest variables
  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 2723
  • "See how I reward those who fail me!"
Re: Magic Weapons Immunity
« Reply #5 on: November 15, 2010, 02:00:44 PM »
In this case poking with a hex editor did the trick. The two lines below will change Half Damage <+4 to Zero Damage <+5.

Thanks nologgie! Great work! :D

If only I had this hack while creating "The Sect", I could have had a lot better weapons than a mere "+2" lying around the countryside (in the peroid before the party discovers "The Weapon", that is).

But I'll certainly need this hack for a possible sequel, when a certain weapon will reappear in the future...
Released designs:

The Sect

Offline nologgie

  • Non-resident Non-expert
  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 3465
Re: Magic Weapons Immunity
« Reply #6 on: November 15, 2010, 11:00:54 PM »
You're quite welcome. I figured that was what you had in mind.

I wish someone had thought of this during the "Single Weapon Vulnerability" discussion last year. In hindsight, it's an obvious solution.
Some days it just doesn't pay to gnaw through the straps.

Offline Null Null

  • Maker of excessively difficult vanilla mods
  • Hero Member
  • *****
  • Posts: 567
Re: Magic Weapons Immunity
« Reply #7 on: November 16, 2010, 06:21:06 PM »
Really, really, useful. We have the bytes for half damage <+3 also, right? Convert that to zero damage +4 and we've got every 'plus' immunity up to +5. Perfect for those of you making very-high-level designs. :)

Hmmm...does this require updates to ckitform.txt? That file ought to be updated one of these days...
« Last Edit: November 16, 2010, 06:23:33 PM by Null Null »

Offline nologgie

  • Non-resident Non-expert
  • Dungeon Craft Tester
  • Hero Member
  • ***
  • Posts: 3465
Re: Magic Weapons Immunity
« Reply #8 on: November 16, 2010, 06:54:21 PM »
Hmmm...does this require updates to ckitform.txt? That file ought to be updated one of these days...

Possibly a footnote, but the bytes and their functions are already listed for this one. This is simply a way to apply the information given.
Some days it just doesn't pay to gnaw through the straps.

 

anything