lua/wrappers/game/lua_character.cpp
/**
	 * Drops an item at the given map coordinates.
	 * Return codes:
	 * <ul>
	 * <li>1: Success.</li>
	 * <li>0: Item was nil.</li>
	 * <li>-1: Drop location was too far away.</li>
	 * <li>-2: Drop location was invalid for item.</li>
	 * <li>-3: Error.</li>
	 * </ul>
	 *
	 * @param am.item item The item to drop
	 * @param number x X map location to drop at
	 * @param number y Y map location to drop at
	 * @returns integer Drop item return code.
	 */
Drops an item at the given map coordinates.

@param am.item item The item to drop
@param number x X map location to drop at
@param number y Y map location to drop at
@returns integer Drop item return code.
Drops an item at the given map coordinates . @param am . item item The item to drop @param number x X map location to drop at @param number y Y map location to drop at @returns integer Drop item return code .
int Character_drop_item(lua_State *lua)
	{
		Character *obj = castUData<Character>(lua, 1);
		if (obj)
		{
			Item *item = castUData<Item>(lua, 2);
			if (item)
			{
				if (lua_isnum(lua, 3) && lua_isnum(lua, 4))
				{
					lua_pushinteger(lua, obj->dropItem(item, lua_tofloat(lua, 3), lua_tofloat(lua, 4)));
				}
				else
				{
					lua_pushinteger(lua, obj->dropItem(item));
				}
				return 1;
			}
			return LuaState::expectedArgs(lua, "drop_item", 2, "am.item item", "am.item item, number x, number y");
		}
		return LuaState::expectedContext(lua, "drop_item", "am.character");
	}
int Character_drop_item ( lua_State * lua ) { Character * obj = castUData < Character > ( lua , 1 ) ; if ( obj ) { Item * item = castUData < Item > ( lua , 2 ) ; if ( item ) { if ( lua_isnum ( lua , 3 ) && lua_isnum ( lua , 4 ) ) { lua_pushinteger ( lua , obj -> dropItem ( item , lua_tofloat ( lua , 3 ) , lua_tofloat ( lua , 4 ) ) ) ; } else { lua_pushinteger ( lua , obj -> dropItem ( item ) ) ; } return 1 ; } return LuaState :: expectedArgs ( lua , " " , 2 , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Drops an item at the given map coordinates.
Drops an item at the given map coordinates .