Corrected compile errors in case DB_ENABLE_STATS is defined

Signed-off-by: Haru <haru@dotalux.com>
Corrected some SC behaviour, special thanks to Rytech
- Extracted some methods to check SC blocks
- Fixed issue that when players couldn't attack they couldn't talk to NPCs with mob view id either

Follow up to ec51176326c6028630835538db67826281d34ffe, fixed minor typo
HPM Hooks Update

Signed-off-by: HerculesWSAPI <Hercules@efficiently.awesome>
Re-added revision info to the memory leak log

- Information was missing because sysinfo->final() was freeing the data
  before iMalloc->final() could log it.

Signed-off-by: Haru <haru@dotalux.com>
Follow up to 3c24fb656f3b3370b7152d6f1d2cc9dbc6fbae5d
Moved 'count' declaration in order to fit MSVC c89-c99 standard
SQL Re-Organization.

Signed-off-by: KeiKun <the.keikun@gmail.com>
Organized sql-tools.
Updated sql-upgrade files.