SCRIPTS: Fix Curing Waltz III to Be Usable by /DNC

According to FFXIclopedia, Curing Waltz III is usable by /DNC, but the amount of HP healed is calculated slightly differently. The current script healed 0 hp is dancer was not your main job.

Formula (for DNC): Amount Healed = floor(((Target's VIT+Caster's CHR)*0.750) + 270,1)

Formula (for /DNC): Amount Healed = floor(((Target's VIT+Caster's CHR)*0.375) + 270,1)

http://wiki.ffxiclopedia.org/wiki/Curing_Waltz_III
SCRIPTS: fix paintbrush door
CORE: fixed guild vendor prices
CORE: treasure pool will remove non-exclusive items before exclusive items
-minor refactoring in treasure pool methods
Merge pull request #185 from maxtherabbit/master

SCRIPTS: fix paintbrush door
CORE: changed TH calculations: rerolls a maximum of 2 times, extra TH increases chance for rolls to pass
Merge branch 'master' of https://github.com/DarkstarProject/darkstar
Database mobs and npcs assault Wamoura Farm Raid @lebros cavern
Merge pull request #191 from starlightknight/curing-waltz-iii-sub-fix

SCRIPTS: Fix Curing Waltz III to Be Usable by /DNC
Implement Shield Mastery

Shield mastery prevents spell interruption on a shield block and grants bonus TP (based on rank) on a shield block.
Ranged physical attacks don't interrupt spells or trigger Shield Mastery
CORE: fix for uninitialized treasure hunter level
Merge pull request #192 from maxtherabbit/th

CORE: fix for uninitialized treasure hunter level
Merge pull request #184 from Jupiter065/patch-1

CORE: Add Shield Mastery support, prevent spell interrupts from ranged attacks
SQL: After one derp - Team Donko presents spell ranges.
SQL: Two derps. lautan teach me to mysqldump!!
CORE: Implement Remaining Missing NIN Spells/Abilities/Traits

This changes attempts to implement all remaining missing features for NIN, up to Lv99

The following changes are implemented:

SPELLS:

Aisha: Ichi - Lowers the targets attack by 15%. Corresponding tools / toolbags / and scrolls have been finished as necessary as well.

http://wiki.bluegartr.com/bg/Aisha:_Ichi

Yurin: Ichi - Gives the target the effect Inhibit TP, which lowers TP gain. Lowers TP gain by 10%. Corresponding tools / toolbags / and scrolls have been finished as necessary as well.

http://wiki.bluegartr.com/bg/Yurin:_Ichi

Myoshu: Ichi - Grants the caster the effect of Subtle Blow Plus, with a Subtle Blow Bonus of +10. Corresponding tools / toolbags / and scrolls have been finished as necessary as well.

http://wiki.bluegartr.com/bg/Myoshu:_Ichi

Migawari: Ichi - Makes the caster immune to "severely damaging attacks" for the next minute. These are defines as attacks that do damage within a certain threshold of the caster's max hp. From best available info, the threshold starts at 100% of the users max hp, and is lowered by 1% per 5 ninjutsu skill. Corresponding tools / toolbags / and scrolls have been finished as necessary as well.

http://wiki.bluegartr.com/bg/Migawari:_Ichi

Kakka: Ichi - Grants the caster the effect of Store TP, with a Store TP bonus of +10. Corresponding tools / toolbags / and scrolls have been finished as necessary as well.

TODO: Ryuno base price does not seem to be listed on any of the major wikis. If someone with retail is willing to check this for me I will happily put it in the SQL.

http://wiki.bluegartr.com/bg/Kakka:_Ichi

ABILITIES:

Issekigan - NIN 95 - Substantially increases parrying rate for the next minute. The exact rate is not know, but from the testing linked to from the BGWiki article, it is thought that if you have already capped out your parry rate at 25%, Issekigan will boost you beyond that by another 25% to cap out at around 50% for the duration of the effect. The user will also be granted an emnity bonus for each successful parry.

http://wiki.bluegartr.com/bg/Issekigan

Mikage - NIN 96 - NIN One Hour Ability - Makes your main hand attacks vary with the number of utsusemi shadows that are currently up.

TODO: Determine correct animation. I can't find any screenshots or videos of it, and it is not listed in Altana Viewer. If anyone is willing to help me out with that it would be appreciated :p right now it has the same animation as Issekigan set.

http://wiki.bluegartr.com/bg/Mikage

TRAITS:

Tactical Parry - Grants a TP bonus on each successful parry. Implemented for all job / tier levels that have it. Conflicting information between FFXIcyclopedia / BGWiki as to whether the trait is affected by Store TP or not. BGWiki says no, and seems to be more reliable on this fact, as FFXIclopedia's info is listed as unconfirmed, so the implementation is not affected by Store TP.

http://wiki.ffxiclopedia.org/wiki/Tactical_Parry
http://wiki.bluegartr.com/bg/Tactical_Parry

Mag. Burst Bonus - Grants a bonus to the magic burst damage.

http://wiki.ffxiclopedia.org/wiki/Magic_Burst_Bonus

Skillchain Bonus - Grants a bonus to skillchain damage.

http://wiki.ffxiclopedia.org/wiki/Skillchain_Bonus

This collectively should make nin fully functional all the way to 99.
CORE: NIN Spells/Abilities/Traits - Incorporate Feedback from teschnei

Mikage: Don't stack with DA/TA

Inhibit TP: Became a modifier that can be used by similar spells

Migawari: Refactored to have a generic method that is called affect the resist damage and resist magic damage mods are applied. This method can be reused for other similar spells.
When looking at similar spells, they each have a different non-cumulative threshold for applying, which means even though their reduction may be cumulative, it might not always stack. Therefore, these stayed as effect power and sub power respectively, which is processed by the generic function.
CORE: Migawari - Add 2 more calls for HandleSevereDamage()
SCRIPTS: Add Severe Damage Handling for Monster TP Moves

I don't know that I like this approach as it kind of duplicates a small chunk of what is in core in the lua scripts, but I don't know enough about how the Lua/C interaction works yet to do it another way. Given that the HP deletion happens inside the lua scripts, the only way I could avoid this small duplication would be to expose new core methods to lua.
CORE/SCRIPTS: Refactor Migawari Entry Point

Push the effect out of the calls across the core code. Replaced with an intermediary helper function. The differences between Migawari and similar spells are as follows: the threshold and reduction percent (stored in the effect because they don't always stack together), and whether or not the effect is removed after one hit (the bool flag).

The previous generic method was already equipped to handle that, except, by doing so calls for other spells would be duplicated throughout the core code. The new intermediary method will solve this and serve as the extension point for similar spells, giving us the least amount of copy/paste.