Author Topic: [FF8] Auto-Potion, Darkside HP loss and more  (Read 10203 times)

Callisto

  • *
  • Posts: 303
    • View Profile
[FF8] Auto-Potion, Darkside HP loss and more
« on: 2016-08-15 16:18:43 »
Hey guys,

I'm right before finishing my balancing mod, but there are still some things I'd like to change, but don't know how. Huge thanks to anyone who can help me with the following:

1. Auto-Potion: The items that work with this ability are Potion, Potion+, Hi-Potion, Hi-Potion+ and X-Potion. I'd like to exclude X-Potion from this list if possible.

2. Darkside HP loss: JWP helped me greatly with changing the Darkside damage multiplier earlier, but I realized that the problem is rather the mild HP loss when using the ability, and not its power. If possible, I'd like to increase the HP loss from 10% to 20% per use.

3. GF compatibility boosting items: Is there a way to remove the negative effect on other GF? I already found out how to modify the boost for each item in mitem.bin (menu.fs), however, the negative effect is always half the boosting value. In other words, there is no separate byte that controls the effect on other GF. Example: The effect for Bomb Fragment can be adjusted at offset 0x23B in mitem.bin. Raising or lowering that value affects the positive and negative effect at the same time. I guess there must be a formula somewhere in the .exe that can disable this.

4. Dispel + Damage: I would really like to have this for a certain enemy, but Dispel per se is actually a curative spell with a spell power of 0, so it never does any damage. I've tried making an offensive spell out of it, but then, it no longer removes positive status effects. Any ideas how to make it cause damage while removing status effects at the same time?

5. Cover Ability: I'm looking for the physical damage reduction multiplier here. I don't want the ability to reduce any damage at all.
« Last Edit: 2016-08-15 16:23:05 by Callisto »

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #1 on: 2016-08-17 14:43:43 »
2. change 0x4905B1 (0x905B1 in exe) from 02 to 01

3. change 0x4FC4B3 (0xFC4B3 in exe) from D1F8 to 31C0

4. How would you want it to react to zombified people?
You could try changing 0x49332F (0x9332F in exe) from 01 to 00 but it'd might impact other spells that use the attack type - i.e. it'd also change cure etc. You'd either have to make your own attack type, edit an existing one or change the cure spells so that they use the same attack type as the potions (healing fixed amounts).
You might also be able to change it for a specific magic.

5. change 0x491091 (0x91091 in exe) from D1EE to 9090

I might take a look into the others if I get time.
« Last Edit: 2016-08-18 01:22:30 by JWP »

Callisto

  • *
  • Posts: 303
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #2 on: 2016-08-18 01:55:39 »
Awesome, thanks ;D

As for 4, I would like Zombies to react to the attack normally. That is, taking damage while having positive status effects removed. I know this is probably the most difficult of the options, but well.. Having cure spells dealing fixed amounts wouldn't be a good trade-off. Are there any unused attack types left in the code that could be used to realize this, perhaps?

Again, thanks for digging into this. Much appreciated.

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #3 on: 2016-08-18 11:58:28 »
Well, I have a small request too ! ;D

I have modified the init.out to change the default abilities of all GFs and managed to do it. But now, I want to modify the items and the amount of gils. It's quite a boring thing because I have to launch a new game after every change I do. So, is there someone who knows wich offset I have to change for these two things ? Thanks in advance !

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #4 on: 2016-08-18 12:13:14 »
If it's in init.out, you should easily be able to get the offsets from here
I think init.out starts at 0x60, so just subtract 0x60 from any offsets on that page.
e.g. that page lists starting Gil as 0x0B1C in the save game data, so it should be 0xABC in init.out
items should start at 0xAF4 but you might need to edit the battle order of items too (see the sections before items in the save game).
« Last Edit: 2016-08-18 12:15:45 by JWP »

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #5 on: 2016-08-18 14:21:10 »
1. looking at the code, auto potion seems to work in this manner:
if maxhp - currenthp <= 200, use a Potion
else if (has Hi-Potion), use Hi-Potion
else if (has Potion), use Potion
else if (has Potion+), use Potion+
else if (has Hi-Potion+), use Hi-Potion+
else if (has X-Potion), use X-Potion
else if (has Elixir), use Elixir

if you want to exclude X-Potion, change 0x487AF4 (0x87AF4 in exe) from 74 to EB
if you want to exclude Elixir, change 0x487B1C (0x87B1C in exe) from 0F 84 C2 00 00 00 to E9 C3 00 00 00 90

4. The following changes should make a new attack type (0x25) which should do what you want:
Code: [Select]
0x4922D9 (0x922D9 in exe)
from: 24
to:   25

0x492AB8 (0x92AB8 in exe)
from: 90 90 90 90
to:   34 89 B6 00

0xB68934 (0x768934 in exe)
from: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
to:   6A 07 8B 44 24 30 8B 4C 24 28 50 56 51 E8 3A A9 92 FF 83 C4 10 8B F8 80 25 DE 7A D2 01 FE E9 7B 9C 92 FF

I haven't tested the changes properly, so let me know if they work or not.

Expanding on mitem.bin, the items are as follows (they're in order of item ID):
Code: [Select]
0A 00 00 00 Empty
00 03 04 00 Potion
00 03 08 00 Potion+
00 03 14 00 Hi-Potion
00 03 28 00 Hi-Potion+
00 03 FF 00 X-Potion
00 0B 14 00 Mega-Potion
01 23 00 01 Phoenix Down
01 2B 00 01 Mega Phoenix
00 03 FF 3E Elixir
00 0B FF 3E Megalixir
15 03 00 02 Antidote
15 03 00 04 Soft
15 03 00 08 Eye Drops
15 03 00 10 Echo Screen
15 03 00 40 Holy Water
15 03 00 7E Remedy
15 03 00 7E Remedy+
07 00 00 00 Hero-trial
07 00 00 00 Hero
07 00 00 00 Holy War-trial
07 00 00 00 Holy War
07 00 00 00 Shell Stone
07 00 00 00 Protect Stone
07 00 00 00 Aura Stone
07 00 00 00 Death Stone
07 00 00 00 Holy Stone
07 00 00 00 Flare Stone
07 00 00 00 Meteor Stone
07 00 00 00 Ultima Stone
07 00 00 00 Gysahl Greens
07 00 00 00 Phoenix Pinion
07 00 00 00 Friendship
06 2B 00 7F Tent
06 2D 00 7F Pet House
06 37 00 7F Cottage
03 05 04 00 G-Potion
03 05 14 00 G-Hi-Potion
03 0D 14 00 G-Mega-Potion
04 25 00 00 G-Returner
0B 05 00 00 Rename Card
12 05 00 00 Amnesia Greens
11 05 01 00 HP-J Scroll
11 05 02 00 Str-J Scroll
11 05 03 00 Vit-J Scroll
11 05 04 00 Mag-J Scroll
11 05 05 00 Spr-J Scroll
11 05 06 00 Spd-J Scroll
11 05 09 00 Luck-J Scroll
11 05 07 00 Aegis Amulet
11 05 0A 00 Elem Atk
11 05 0F 00 Elem Guard
11 05 0B 00 Status Atk
11 05 11 00 Status Guard
11 05 13 00 Rosetta Stone
11 05 14 00 Magic Scroll
11 05 15 00 GF Scroll
11 05 16 00 Draw Scroll
11 05 17 00 Item Scroll
11 05 19 00 Gambler Spirit
11 05 1F 00 Healing Ring
11 05 21 00 Phoenix Spirit
11 05 1C 00 Med Kit
11 05 24 00 Bomb Spirit
11 05 25 00 Hungry Cookpot
11 05 26 00 Mog`s Amulet
11 05 53 00 Steel Pipe
11 05 54 00 Star Fragment
11 05 55 00 Energy Crystal
11 05 56 00 Samantha Soul
11 05 57 00 Healing Mail
11 05 58 00 Silver Mail
11 05 59 00 Gold Armor
11 05 5A 00 Diamond Armor
11 05 27 00 Regen Ring
11 05 28 00 Giant`s Ring
11 05 29 00 Gaea`s Ring
11 05 2A 00 Strength Love
11 05 2B 00 Power Wrist
11 05 2C 00 Hyper Wrist
11 05 2D 00 Turtle Shell
11 05 2E 00 Orihalcon
11 05 2F 00 Adamantine
11 05 33 00 Rune Armlet
11 05 34 00 Force Armlet
11 05 35 00 Magic Armlet
11 05 30 00 Circlet
11 05 31 00 Hypno Crown
11 05 32 00 Royal Crown
11 05 36 00 Jet Engine
11 05 37 00 Rocket Engine
11 05 47 00 Moon Curtain
11 05 46 00 Steel Curtain
11 05 48 00 Glow Curtain
11 05 49 00 Accelerator
11 05 3C 00 Monk`s Code
11 05 3E 00 Knight`s Code
11 05 3B 00 Doc`s Code
11 05 3D 00 Hundred Needles
11 05 4C 00 Three Stars
11 05 4D 00 Ribbon
08 00 00 00 Normal Ammo
08 00 00 00 Shotgun Ammo
08 00 00 00 Dark Ammo
08 00 00 00 Fire Ammo
08 00 00 00 Demolition Ammo
08 00 00 00 Fast Ammo
08 00 00 00 AP Ammo
08 00 00 00 Pulse Ammo
0A 00 00 00 M-Stone Piece
0A 00 00 00 Magic Stone
0A 00 00 00 Wizard Stone
0A 00 00 00 Ochu Tentacle
0A 00 00 00 Healing Water
0A 00 00 00 Cockatrice Pinion
0A 00 00 00 Zombie Powder
0A 00 00 00 Lightweight
0A 00 00 00 Sharp Spike
0A 00 00 00 Screw
0A 00 00 00 Saw Blade
0A 00 00 00 Mesmerize Blade
0A 00 00 00 Vampire Fang
0A 00 00 00 Fury Fragment
0A 00 00 00 Betrayal Sword
0A 00 00 00 Sleep Powder
0A 00 00 00 Life Ring
0A 00 00 00 Dragon Fang
13 43 01 00 Spider Web
13 43 02 00 Coral Fragment
13 43 03 00 Curse Spike
13 43 04 00 Black Hole
13 43 05 00 Water Crystal
13 43 06 00 Missile
13 43 07 00 Mystery Fluid
13 43 08 00 Running Fire
13 43 09 00 Inferno Fang
13 43 0A 00 Malboro Tentacle
13 43 0B 00 Whisper
13 43 0C 00 Laser Cannon
13 43 0D 00 Barrier
13 43 0E 00 Power Generator
13 43 0F 00 Dark Matter
10 83 02 08 Bomb Fragment
10 83 02 10 Red Fang
10 83 01 08 Arctic Wind
10 83 01 10 North Wind
10 83 00 10 Dynamo Stone
10 83 08 08 Shear Feather
10 83 0B 10 Venom Fang
10 83 05 10 Steel Orb
10 83 0A 10 Moon Stone
10 83 04 10 Dino Bone
10 83 08 10 Windmill
10 83 06 10 Dragon Skin
10 83 07 0A Fish Fin
10 83 09 10 Dragon Fin
10 83 03 10 Silence Powder
10 83 0B 08 Poison Powder
0A 00 00 00 Dead Spirit
10 83 0E 10 Chef`s Knife
10 83 0D 10 Cactus Thorn
10 83 0C 10 Shaman Stone
0A 00 00 00 Fuel
0A 00 00 00 Girl Next Door
0A 00 00 00 Sorceress` Letter
0D 01 00 00 Chocobo`s Tag
0C 01 00 00 Pet Nametag
0F 01 00 00 Solomon Ring
0E 01 2B 03 Magical Lamp
14 03 0A 01 HP Up
14 03 01 02 Str Up
14 03 01 04 Vit Up
14 03 01 08 Mag Up
14 03 01 10 Spr Up
14 03 01 20 Spd Up
14 03 01 40 Luck Up
10 83 FF 65 LuvLuv G
09 01 00 03 Weapons Mon 1st
09 01 04 07 Weapons Mon Mar
09 01 08 0B Weapons Mon Apr
09 01 0C 0F Weapons Mon May
09 01 10 13 Weapons Mon Jun
09 01 14 17 Weapons Mon Jul
09 01 18 1B Weapons Mon Aug
09 01 1C 1C Combat King 001
09 02 1D 1D Combat King 002
09 02 1E 1E Combat King 003
09 02 1F 1F Combat King 004
09 02 20 20 Combat King 005
09 02 21 21 Pet Pals Vol.1
09 03 22 22 Pet Pals Vol.2
09 03 23 23 Pet Pals Vol.3
09 03 24 24 Pet Pals Vol.4
09 03 25 25 Pet Pals Vol.5
09 03 26 26 Pet Pals Vol.6
09 03 27 27 Occult Fan I
09 04 28 28 Occult Fan II
09 04 29 29 Occult Fan III
09 04 2A 2A Occult Fan IV

from this, it's possible to conclude that the first byte is the item type and defines the effect/icon and the other 3 bytes are parameters.
Looking at the list, it seems the following item types are defined (note there might be more unused ones, I might look into it at some point):
00 - heal characters
01 - revive characters
03 - heal GF
04 - revive GF
06 - cure at save point
07 - no effect with pouch icon
08 - no effect with ammo icon
09 - magazine
0A - no effect with octagonal icon
0B - rename GF
0C - rename Angelo
0D - rename Chocobo
0E - start battle
0F - get Doomtrain
10 - increase GF compatability
11 - learn GF ability
12 - forget GF ability
13 - learn blue magic
14 - increase stats
15 - heal abnormal statuses
« Last Edit: 2016-08-18 17:37:13 by JWP »

Callisto

  • *
  • Posts: 303
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #6 on: 2016-08-18 19:38:21 »
Wow, I didn't know that even Elixirs work with Auto-Potion as well. Thanks for thinking ahead and looking for a way to disable these too. Already tested and it seems to work perfectly as well as all the other things. Will be very helpful for my mod. Amazing work!! :)

When I was adding the code for the new attack type in the .exe, I noticed that there seems to be quite some more space for other types. Do you think it would be possible to create a move that works like a Megalixir + revives everyone at full HP? Pretty much like Angel Whisper in FF VII, just on all allies.

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #7 on: 2016-08-18 19:47:43 »
The space in the part of the exe that I dumped the code isn't the problem, the space in the jump table is - around 0x492AB8 (0x92AB8 in exe).
There's room for 1 more attack type without any major changes.
Couldn't you do that attack by using the same attack type as mega elixir but ticking the death status and revive flag (using Doomtrain)?
One thing to be wary of is that the dispel attack I've done might ignore enemy spirit, you might want to test that.
« Last Edit: 2016-08-18 20:00:08 by JWP »

Callisto

  • *
  • Posts: 303
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #8 on: 2016-08-18 20:46:03 »
Alright, creating that ultimate healing move worked with Doomtrain just fine, as you suggested.

Yes, the Dispel attack ignores spirit indeed. I would rather not have it that way. I hope it's no big deal to figure out how to make it a normal magical attack. Please let me know once you found out which bytes to change.

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #9 on: 2016-08-19 00:17:00 »
If it's in init.out, you should easily be able to get the offsets from here
I think init.out starts at 0x60, so just subtract 0x60 from any offsets on that page.
e.g. that page lists starting Gil as 0x0B1C in the save game data, so it should be 0xABC in init.out
items should start at 0xAF4 but you might need to edit the battle order of items too (see the sections before items in the save game).

Thanks, with your help, I managed to do it. ;D

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #10 on: 2016-08-19 00:46:24 »
No problem Girl next door :).
ok, this should make a new attack type of 0x25 that behaves exactly like a magic attack except it removes statuses instead of adding them, I have no idea if there's any side effects or anything though :P.

First undo all the changes from before, then make the following changes:

Code: [Select]
0x491C19 (0x91C19 in exe)
from: 11
to:   12

0x492010 (0x92010 in exe)
from: E8 7B 00 00
to:   E9 1F 69 6D

0x49208A (0x9208A in exe)
from: 90
to:   00

0x4922D9 (0x922D9 in exe)
from: 24
to:   25

0x492AB8 (0x92AB8 in exe)
from: 90 90 90 90
to:   5E 89 B6 00

0xB68934 (0x768934 in exe)
from:
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00
to:
80 7C E4 38 12 74 07 E8 50 97 92 FF EB 17 FF 35
34 A2 D2 01 66 A1 3E A2 D2 01 50 55 51 E8 CA 8E
92 FF 83 C4 10 E9 B7 96 92 FF 6A 12 8B 4C 24 30
8B 54 24 28 51 56 52 E8 60 91 92 FF 83 C4 10 8B
F8 E9 58 9C 92 FF


« Last Edit: 2016-08-19 00:48:00 by JWP »

Callisto

  • *
  • Posts: 303
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #11 on: 2016-08-19 01:58:10 »
From the looks of it, this must have been painful to figure out. Much more code than last time :-X

Anyway, looks good so far. The new attack removes exactly the same status effects as the normal Dispel does (just on the entire party), it can not be reflected, does magical damage, can be shelled, does not ignore Spirit, and in the case of Dispel, it now gives me a white "miss" instead of a green one if used on a target not under any positive status.

I can't think of any other possible side effects at the moment. Well done.

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #12 on: 2016-08-19 02:40:55 »
It's not that bad, I knew where all the stuff was.
The stuff for attack type 0x25 is mostly copied from the standard magic attack except it uses 0x12 instead of 0x00 in a function call.

Basically most magic attacks call a function to do most of the work (the cure attacks call a different one though).
All I did was add a new magic attack type of 0x12 (this is different from the attack type) which follows the same code path as 0x00 (a standard magic attack).

In the magic attack function, there's a call to an inflict status function, I hijacked this function call and made it jump to my code.
My code is then just a basic if statement in ASM:
if (magic_attack_type != 0x12) {
    inflict_status_function(caster_id, target_id, 1) - 1 means it's a magic attack, 0 is for physical attacks
}
else {
    cure_status_function(target_id, spell_power, status_word, status_dword)
}

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #13 on: 2016-08-19 21:32:10 »
Another thing: do you know in wich file can I change the items names ? I mean, not the battle items but all the others.

JWP

  • *
  • Posts: 194
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #14 on: 2016-08-19 22:14:57 »
All item names are in kernel.bin, see section 40 listed in this post. More specifically it contains names and descriptions, the pointers to the names are all in section 9.

You have to be careful how you edit it because you can screw all the text offsets up if you're not careful, I'd suggest using Carbuncle if you can (Doomtrain doesn't support text editing at the moment).

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #15 on: 2016-08-19 22:57:56 »
I can't use Carbuncle because I'm editing the french version. I will make a back-up of my kernel.bin before any change to avoid a bad issue. Thanks ! :)

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #16 on: 2016-08-23 13:12:35 »
Hum OK, that's quite difficult. I think I will wait... you think Doomtrain will be able to edit texts in all languages ?

Maki

  • 0xBAADF00D
  • *
  • Posts: 621
  • 0xCCCCCCCC
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #17 on: 2016-08-23 16:55:05 »
Hum OK, that's quite difficult. I think I will wait... you think Doomtrain will be able to edit texts in all languages ?

Sooner or later. We discussed it a bit. It may support all original languages except Japanese. This can take a while though.

Girl next door

  • *
  • Posts: 144
    • View Profile
Re: [FF8] Auto-Potion, Darkside HP loss and more
« Reply #18 on: 2016-08-23 18:34:54 »
No problem, I will wait. When you say "a while", you mean weeks or months ?