A small bug that can potentially be easily fixed:
The mapIndex of the zone "Fargrave" is
nil.
This returns
nil ...
Lua Code:
GetMapIndexByZoneId(1282)
1282 is the zoneId of "Fargrave". When the character is in the zone, the ID could also be retrieved via:
Lua Code:
local playersZoneIndex = GetUnitZoneIndex("player")
local playersZoneId = GetZoneId(playersZoneIndex)