Chocobo Shirt and Destrier Beret Related Patches
Posted: 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.
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.