Fixed naming of MySQL build option
Added several script warnings on errors.

As requested by Ablu.

Reviewed-by: Ablu.
Made the lua item_drop script function returns whether it succeeded.

Part of Mana-Mantis #339.

Reviewed-by: Ablu
Fixed the chr_inv_count function to handle equipment.

the function can now count in the inventory
and/or the player's equipment.

I also fixed the script function and added a use case
in the example map.

+ Fixes after Ablu's review.
+ 2nd fix after Ablu's review: Fix the inventory remove behaviour.

Resolves: Mana-Mantis #288

Reviewed-by: Ablu
Added the chr_get_inventory and chr_get_equipment functions.

Those will make the scripters able to get a full view
of the current player's possessions. Use with care.

+ Fixes following Ablu's review.

Resolves: Mana-Mantis #207.

Reviewed-by: Ablu
Made @announce fully functional

- Added announcements having senders now.
- Removed /announcement support.

Reviewed-by: Bjorn.
Removed logging of chat

Reviewed-by: Bertram
Added announce(text [, sender]) lua function

The function will cause a global announcement.
If no sender ist set "Server" will be used.

Reviewed-by: Bjorn.
Fixed use of checkstring method in the script functions

luaL_checkstring might not return so the destructor of string will not be called.

Reviewed-by: Bjorn.
Removed unused createRandomPassword function

Reviewed-by: Erik Schilling
Fixed some lua_newtable/createtable usage

When creating a Lua table, it is possible to specify in advance how many
array elements and how many non-array elements this table will contain,
to avoid dynamic reallocations while filling the table. This wasn't used
optimally by the pushSTLContainer helper methods and some other cases.

Reviewed-by: Erik Schilling
Reviewed-by: Yohann Ferreira
Use a full user data object for MapObject references

Based on a templated helper class, MapObject references in Lua scripts are now
full user data objects. Using the '__index' member of their metatable, a
library is associated with it so that member functions can be called directly
on the object.

Reviewed-by: Yohann Ferreira
Reviewed-by: Erik Schilling
Added a way to specify the min and max attributes values.

This can now be done in attributes.xml through the
minimum and maximum attribute parameters.

I also changed the AttributeInfo struct as requested by bjorn.

Reviewed-by: Erik Schilling, Thorbjørn Lindeijer
Clear the gid flags before processing them

Also read the gids as unsigned integers since that's how Tiled writes them
to prevent the number going negative when the highest flag is used.

Reviewed-by: Yohann Ferreira
Added a generic Lua user data cache

Based on a native Lua table with weak values, so that the user data objects
that are created can be garbage collected when no longer referenced.

Reviewed-by: Yohann Ferreira
Simplified merchant.lua

Just defined an inline function to make talking to the player easier.
Would be nice when NPC scripts could look more like this by default.

Also indented with 4 spaces, which we do in C++ so why not Lua files
(the file had mixed 2 and 4 space indentation before).
Moved @announce permission to GM group

Reviewed-by: Erik Schilling
Merged the example client and server data

It's easier to just talk about world data and to modify it as a whole.
If there is really a need to separate it, a project can still choose to do
that (and in whatever suitable way). There is no need to enforce this
separation or to do it in our example.

Reviewed-by: Erik Schilling
Renamed some iterators + fixed one TODO (stored guilds in a map)

Reviewed-by: bjorn.
Some random code cleanup

Moved a code comment about syncmessages to the bugtracker: #473.

Reviewed-by: bjorn.