Sanitized and improved several macros through the code

- Sanitized all potentially unsafe macros (related eA:15259)
- Improved some function-like macros to evaluate their argument only
  once and keep it in a temporary variable.  This improves performance
  in the damage calculation related code.

Signed-off-by: Haru <haru@dotalux.com>
Replaced hardcoded Item IDs with constants

- This makes it harder to get the item IDs wrong in the code.
- Fixes item 'Slot_Coupon' being incorrectly considered a Spell Book due
  to an oversight (wrong item nameid) when the check was introduced.

Signed-off-by: Haru <haru@dotalux.com>