Chocobo Shirt and Destrier Beret Related Patches

Post Reply
beefypotatoes
Posts: 13
Joined: Sat Jun 29, 2013 12:55 pm

Chocobo Shirt and Destrier Beret Related Patches

Post by beefypotatoes » Wed Jul 24, 2013 1:47 pm

A bunch of updates all relating to the Chocobo Shirt and Destrier Beret.

Because it was somewhat large, I broke it up into 3 pieces which can each be used independently. UPDATE: This is no longer true. One of the sql additions included in latent_level_under now requires auto_reraise.

Quick note, I made and tested these changes on my server which is still running 3773. I took my changes and inserted them into a 3803 version of the repository, but did no checking on them there - I just made the patch files compatible.

What's changed:

auto_reraise.patch - Adds support for auto reraise.
src/map/ai/ai_char_normal.cpp
- Added a check for auto reraise mod when a player dies
src/map/modifier.h
- Added MOD_AUTO_RERAISE variable
scripts/globals/status.lua
- Added MOD_AUTO_RERAISE variable
- Also added a missing one (which is present in modifier.h): MOD_MAG_BURST_BONUS

destrier_chocobo_update.patch - Adds the stats for chocobo shirt and destrier beret (excluding latent buffs, which are in the patch below)
sql/item_armor.sql
- Fixed the MId for the chocobo shirt
sql/item_mods.sql
- Set the defense values for the chocobo shirt and destrier beret
sql/item_usable.sql
- Set the chocobo shirt as usable
scripts/globals/items/chocobo_shirt.lua
- New file. Added logic for the chocobo shirt's crystal dispensing.

latent_level_under.patch - Adds a new latent effect! Activates while the player is under a given level.
Quick Note: I used latent id 49, because I saw nothing else using it. However, it was already a valid number (#define MAX_LATENTEFFECTID 50). Not sure if it is in hidden use somewhere, or an extra latent id had been declared available but never used. Also noticed that MAX_LATENTEFFECTID doesn't actually seem to be used anywhere. Not sure if it's irrelevant, or a hard coded value is somewhere else in the code serving its function.
sql/item_latents.sql
- Added the latent effect +50 acc, +50racc, and +50macc for the chocobo shirt
- Added the latent effect +1 refresh, +1 regen, auto reraise, and +12 movement speed for the destrier beret
src/map/latent_effect.h
- Added new latent effect type
src/map/latent_effect_container.h
src/map/latent_effect_container.cpp

- Added logic and a new function to support the new latent effect
src/map/utils/charutils.cpp
- Added conditions to re-check the new latent effect

Issues relating to the new latent effect:
- Untested: If you delevel to 30 from dieing and then raise and get exp back to be 31, will the latent detect re-leveling from raise and disable itself. I suspect yes, but this is untested.
- Bug: Latent will only deactivate itself based on leveling up/down. If your level is simply set to be higher through the gm command, it will not detect the level change and activate/deactivate accordingly. This is not a problem when changing jobs through a moogle, since all equipment is removed when that happens, and the latent will be checked if/when the player puts their gear back on.

One last thought:
In general the latent system appears to need some attention. It looks like some other latent effects aren't being checked properly when things about your character change.
Attachments
latent_level_under.patch
(4.42 KiB) Downloaded 197 times
auto_reraise.patch
(1.7 KiB) Downloaded 233 times
destrier_chocobo_update.patch
(3.65 KiB) Downloaded 194 times
Last edited by beefypotatoes on Thu Jul 25, 2013 3:29 am, edited 2 times in total.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Chocobo Shirt and Destrier Beret Related Patches

Post by kjLotus » Wed Jul 24, 2013 2:45 pm

i never finished the latent effect container, no. there's a bunch of latent IDs that don't do anything yet because i didn't write any handlers for them yet, and the "hp/mp % from visible gear" was basically a haphazarded guess (that is completely wrong) on some things. i wrote it a really long time ago in hopes that it would be easy to add on to (because there was more important things to finish first, like jerbs). pretty sure the only ones that actually work is regular hp/mp % and subjob (even that's a maybe). it's basically on hold from me until jerbs are done

looking at auto_rr.patch, specific itemIDs shouldn't be checked in the core. one option (probably the least painful) is making a mod for auto-reraise and just sticking it in the latents table

beefypotatoes
Posts: 13
Joined: Sat Jun 29, 2013 12:55 pm

Re: Chocobo Shirt and Destrier Beret Related Patches

Post by beefypotatoes » Wed Jul 24, 2013 3:02 pm

I had figured it was something like that for the latent effect system.

I hadn't thought about doing auto-reraise like that, seems kinda obvious now that you've pointed it out. My bad. I'll look into what it takes to do it that way and post an update if I figure it out.

beefypotatoes
Posts: 13
Joined: Sat Jun 29, 2013 12:55 pm

Re: Chocobo Shirt and Destrier Beret Related Patches

Post by beefypotatoes » Wed Jul 24, 2013 7:17 pm

Thanks to kjLotus's advice, the auto reraise patch has been updated. It now works in a more proper fashion, by adding a new mod (0x19B). I noticed while adding the new mod value, that while most of the mods are in hex, the last couple are in base 10. I entered this one as hex since thats what the majority were. Also, I noticed that in the scripts/global/status.lua file, one of the mods was missing so I added that as well (MOD_MAG_BURST_BONUS). The latent_level_under patch was updated to include the Destrier Beret's latent effect auto reraise. See OP for new downloads (old versions removed).

While I don't believe the retail version of the game has anything other than auto reraise 1, I set it up so it can support other levels of auto reraise as well. When a player dies, they'll get the higher value from either auto reraise or regular reraise.

I should note that if a player wears two piece of gear with auto reraise, they would get auto reraise 2. This is because, as far as I can tell, the current system doesn't support having weaker effects overridden by stronger ones. Like if you wear two pieces of movement speed gear, they'll stack as well.

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Chocobo Shirt and Destrier Beret Related Patches

Post by kjLotus » Wed Jul 24, 2013 8:32 pm

beefypotatoes wrote:While I don't believe the retail version of the game has anything other than auto reraise 1, I set it up so it can support other levels of auto reraise as well. When a player dies, they'll get the higher value from either auto reraise or regular reraise.
both atma of the apocalypse and twilight set are auto-reraise III
beefypotatoes wrote:I should note that if a player wears two piece of gear with auto reraise, they would get auto reraise 2. This is because, as far as I can tell, the current system doesn't support having weaker effects overridden by stronger ones. Like if you wear two pieces of movement speed gear, they'll stack as well.
correct

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Chocobo Shirt and Destrier Beret Related Patches

Post by kjLotus » Fri Jul 26, 2013 2:31 pm

i'll try to remember to grab this sometime this weekend - i haven't looked at it, but the concept is definitely the closest to what i'd have written myself for it (nobody else ever looks at my latent effect container! it's so lonely!)

Post Reply