Buyingstore persistency

Basic features of @autotrade persistency now also available for buyingstores.
Minor bug fix

If a player did not meet the requirements to reopen the buyingstore/vending for whatever reason the character is now set offline.

A possible examples I have tested with is to change the area where the player's shop was to novending, which will not allow him to open the shop in this area.
Buyingstore persistency Beta

Changed the loading process to clean up if there are some leftovers(corrupt tables).

Modified the loading query to also take in the zeny limit as criteria, since it would not make sense to set up an autotrader that already has reached his limit(this case should not be possible, if you do not modify the values in your MySQL table by hand).

Enjoy and do not forget to run the upgrade .sql files.
Character deletion fix

Fixed a problem where the client froze in a "Please wait" state because it got a packet it was not meant to get.
Also fixed wrong deletion times.

Fixes:
http://rathena.org/board/tracker/issue-8456-delete-character-delay-bug/
http://rathena.org/board/tracker/issue-8601-character-deletion-bug/
http://rathena.org/board/tracker/issue-8399-character-deletion-bug/

Minor follow up to 996ee3d:
Forgotten import, which got ignored by Visual Studio.
Follow up b3506fb

Somehow I missed the upgrade file. Sorry guys.
Thanks to @exneval for raising my attention on it.
Bug Fixes
* Dragon Breath (Fire and Water) are no longer reduced by DEF or Flee. (bugreport:8378)
* Crush Strike no longer ignores caster's % damage cards.
* Phantom Thrust is now single enemy targetable.
* Fixed Gates of Hell SP cost, range, and sphere cost. (bugreport:7898)
* Cleaned up Tiger Cannon splash damage and remaining HP/SP consumption. (bugreport:8538)
* Fixed Rising Dragon HP/SP regen to work with Spiritual Cadence.
* Corrected Magic Decoy item requirement define not checking for PTS.
* Poem of Netherworld now targets everyone except party members. (bugreport:7741)
* Adjusted a couple skills that have infinite timers to not displays negative time to the client. (bugreport:8549)
* Fixed Sorcerer's Spirit max HP formula. (bugreport:8315)
* Fixed Banding not giving the Overawe effect. (bugreport:7641)
* Fixed Weapon Crush not casting at all. (bugreport:8583)
* Fixed Demonic Fire damage formulas from Fire Expansion.
* Fixed Fire Expansion - Smoke Powder not giving ranged and melee damage reduction. (bugreport:7841)
* Fixed Fire Expansion - Tear Gas not draining HP and not displaying the /cry emoticon. (bugreport:7841)
* Fixed Issen (Killing Stroke) damage formula for pre-renewal. (bugreport:4071)
* Adjusted Warg Strike to be a misc type attack and ignore target's Flee. (bugreport:7599)
* Updated Throw Kunai damage formulas for renewal and pre-renewal. (bugreport:7119)
* Severe Rainstorm is no longer castable on Land Protector. (bugreport:7097)
* Fixed Tropic, Chilly Air, Wild Storm, and Upheaval options not casting their specific autocast skills.
* Updated Fire Cloak, Water Drop, Wind Curtain, and Stone Shield to 100% property resistance and damage.
* Updated Heater, Cooler, Blast, and Cursed Soil damage formulas.
* Increased SP cost of Psychic Wave when Heater, Cooler, Blast, or Cursed Soil are active.
* Updated Zephyr Flee increase bonus.
* Fixed Elemental HP and ATK2 formulas.
* Fixed Sienna Execrate not consuming 2 Red Gemstones. (bugreport:7494)
* Fixed Shadow Chaser's Masquerade skills success rate formula. (bugreport:7436)
* Fixed Exceed Break to restore walk speed when cast is cancelled. (bugreport:7681)
* Vacuum Extreme no longer affects users who are in Hallucination Walk.
* Fixed Hallucination Walk missing magic avoidance.
* Adjusted Lif's Mental Change skill duration to 1 minute, 3 minutes, and 5 minutes respectively per level.
* Hovering will now specifically ignore Skid Trap, Land Mine, Ankle Snare, Flasher, Shockwave Trap, Sandman, Freezing Trap, Blast Mine, Claymore Trap , Quagmire, Gravitation Field, Volcano, Deluge, Whirlwind, Watery Evasion, Electric Walk, Fire Walk, Vacuum Extreme, Windmill, and Moon Slasher. (bugreport:7179)
* Raging Trifecta will now display an animation on usage. (bugreport:1307)
* Cleaned up Auto Shadow Spell check for the specific skills it can cast. (bugreport:8582)
Follow up 4019fb4
- Wrong macro for itemdb_is_element, thx @exneval
- Incompatible type issue on UNT_BANDING. bugreport:8616 http://rathena.org/board/tracker/issue-8616-error-while-recompiling/
- Skill usage messages ot conf/msg_conf/map_msg.conf instead following official client fail message by clif_skill_fail() for each failure. (related with skill_require_db.txt)
--> "%s is required." (similar: 28 messages)
-->"[%s] Poison effect was applied to the weapon." (similar: 8 messages)
-->"Please equipped with a %s." (similar: 7 messages)

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
* Added script commands2, rentitem2 and makeitem2, suggestion http://rathena.org/board/topic/90918-emistrys-rentitem2-be-added-to-svn/
-- *rentitem2 <item id>,<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>;
-- *rentitem2 "<item name>",<time>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>;
-- from http://www.eathena.ws/board/index.php?showtopic=241313&view=findpost&p=1315831
-- *makeitem2 <item id>,<amount>,"<map name>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>;
-- *makeitem2 "<item name>",<amount>,"<map name>",<X>,<Y>,<identify>,<refine>,<attribute>,<card1>,<card2>,<card3>,<card4>;
-- Credits for the script author(s) & contributor(s)
-- NOTE: I didn't make the documentation yet
* Follow up 3441d4a

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
Improved 'client_hash_check' config. (Hercules e4a1ca2)
- Added option to disable hash check by GM group_id (specify 'disabled' as hash for a certain group_id to let them log in with any client, even if 'client_hash_check' is enabled.
- Updated and reworded related documentation for the feature.

Improvements on script command 'axtoi'; added 'strtol'. (Hercules 1cf7c1e)
- Added script command 'strtol' (conforming to the ISO C90 function).
- Modified script command 'axtoi' to internally use 'strtol' instead of an unnecessary separate implementation.

Cleaned up many sections of script documentation, and modernized syntax in examples.
Added documentation for 'rentitem2' and 'makeitem2'. (follow-up 339c0a8)

Added 'true' (1) and 'false' (2) as script constants.

'freeloop' argument is now optional, and will only return the value of freeloop if no argument is given. (tid:92470)
http://rathena.org/board/topic/92470-freeloop-optional-argument/

Added a missing mapflag to custom 'devil_square' script. (bugreport:8611)
http://rathena.org/board/tracker/issue-8611-devil-square-bug/

Signed-off-by: Euphy <euphy.raliel@rathena.org>
Modernized syntax and fixed errors in the sample scripts. (Hercules 21fa090)

Signed-off-by: Euphy <euphy.raliel@rathena.org>
Item database update.
- Added/edited itemscripts for some new items.
- Corrected the persistence of many Hit- and Flee-increasing consumables, as they should dispel upon death. (incl. bugreport:8626)
http://rathena.org/board/tracker/issue-8626-accuracy-30-scroll-effect-when-death/

Hercules merges:
- Added optional 'count' parameter to script command 'successrefitem'. (9d1f80e)
- Atcommand bindings are now case-insensitive, like normal atcommands. (92be98c)
- Consumables without expire time no longer stack with rental items. (afcb4bc, bugreport:8458)
http://rathena.org/board/tracker/issue-8458-rent-item-bug/

Signed-off-by: Euphy <euphy.raliel@rathena.org>
Added script command 'getguildmember', similar to 'getpartymember'. (tid:78308, credits: AnnieRuru, GodLesZ)
http://rathena.org/board/topic/78308-getguildmember/

Signed-off-by: Euphy <euphy.raliel@rathena.org>
Added optional 'dragon color' parameter to @mount. (tid:79844)
http://rathena.org/board/topic/79844-mount/

Signed-off-by: Euphy <euphy.raliel@rathena.org>
Item database update.
- Added some new headgears.
- Fixed High Wizard Card itemscript. (bugreport:8635)
http://rathena.org/board/tracker/issue-8635-bonus-command-dont-have-bignoremdefclass/

Signed-off-by: Euphy <euphy.raliel@rathena.org>
Some fixes for bugreport:8633 http://rathena.org/board/tracker/issue-8633-about-this-commit-skills/
- Added some dummy Skill IDs tp skill_copyable_db.txt
- Demonic fire doens't have duration for lv 2 and 5
- Typo on skill_require_db.txt for Siena Execrate

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
* Fixed bugreport:8632 http://rathena.org/board/tracker/issue-8632-map-server-crash/
* Revert mvptomb_destroy changes at 5988c7a, bugreport:8634 http://rathena.org/board/tracker/issue-8634-memory-issues-with-update-consistent-and-persistent-lag/
* Fixed bugreport:8640 http://rathena.org/board/tracker/issue-8640-bonus-baddmonsteriddropitem/

Signed-off-by: Cydh Ramdh <house.bad@gmail.com>
Added support for constants in NPC sprite IDs. (Hercules 124ab2a, e9b4aec)
Fixed some typos in source files.

Signed-off-by: Euphy <euphy.raliel@rathena.org>
Implemented @warp suggestions.
This will display map name suggestions when attempting to @warp to a non-existent map.
To enable, turn on 'feature.warp_suggestions' in 'conf/battle/feature.conf'.

Signed-off-by: Euphy <euphy.raliel@rathena.org>