Scripts/Spells: fix logic fail in q9874
Merge pull request #11761 from MitchesD/misc

Scripts/Spells: fix logic fail in q9874
Core/Misc: Fix some static analysis issues

Fix some static analysis issues about:
- uninitialized values, most of which are false positives, always initialized before being accessed
- unchecked return values
- dead code never executed
- bad formatting leading to wrong behavior

Please ensure EventMap is never used with event id set to 0 or those events will never execute.
DB/SAI: Fix startup error

By untaught, closes #11587
Core/Spells: Fixed crash happening when a spell script set target to NULL in OnObjectTargetSelect hook for spells using nearby target selection
Core/Map: Save weather, light and music overrides in map to send them to players logging in
Core/Transports: Fixed crashes happening when a transport was despawned with players/dynamicobjects on it
Core/Spells: Fixed target selection hooks running twice for each effect if both target A and B were using the same hook type (OnObjectAreaTargetSelect, OnObjectTargetSelect, OnDestinationTargetSelect)